/* ============================================================
   Vadības panelis (admin.css)
   Balstās uz game-shell.css tumšo dizainu. Šeit tikai paneļa
   specifika: statistikas kartes, tabulas, tabi, žurnāls.
   ============================================================ */

.admin-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.admin-header { margin-bottom: 8px; }

.admin-hero {
  margin: 6px 0 20px;
}

.admin-hero h1 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  color: var(--text);
}

.admin-bar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== Piekļuve liegta ==================== */

.admin-denied-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 34px 28px;
  border: 1px solid rgba(255, 100, 116, 0.35);
  border-radius: 20px;
  background: var(--panel-solid);
  text-align: center;
}

.admin-denied-emoji { font-size: 42px; }

.admin-denied-card h2 {
  margin: 10px 0 8px;
  font-family: var(--font-display);
  color: var(--text);
}

.admin-denied-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ==================== Tabi ==================== */

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-solid);
}

.admin-tab {
  flex: 1;
  min-width: 96px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 700 13px/1 var(--font-body);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-tab:hover { color: var(--text); }

.admin-tab.active {
  background: var(--lime);
  color: #0b1220;
}

.admin-tab-panel { display: grid; gap: 14px; }

/* ==================== Statistikas kartes ==================== */

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.admin-stat-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-solid);
  padding: 14px 16px;
}

.admin-stat-card span {
  display: block;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--lime);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.admin-stat-card.warn strong { color: #ff8b98; }

/* ==================== Paneļa kartes un tabulas ==================== */

.admin-panel-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-solid);
  padding: 18px 20px;
}

.admin-panel-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--text);
}

.admin-note {
  margin: 0 0 14px;
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.55;
}

.admin-count-pill {
  display: inline-block;
  min-width: 26px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(200, 245, 66, 0.14);
  color: var(--lime);
  font-size: 12px;
  text-align: center;
}

.admin-users-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-users-head h3 { margin: 0; }

.admin-users-head input[type="search"] {
  min-height: 40px;
  min-width: 220px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: 600 13.5px/1 var(--font-body);
}

.admin-users-head input[type="search"]:focus {
  outline: none;
  border-color: rgba(200, 245, 66, 0.5);
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  padding: 10px 12px;
  text-align: left;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table td {
  padding: 10px 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table tbody tr:last-child td { border-bottom: 0; }

.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.admin-table .cell-name {
  color: var(--text);
  font-weight: 700;
}

.admin-table .cell-name small {
  display: block;
  color: var(--muted-2);
  font-weight: 600;
}

.admin-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.admin-badge.ok {
  background: rgba(200, 245, 66, 0.12);
  color: var(--lime);
}

.admin-badge.banned {
  background: rgba(255, 100, 116, 0.14);
  color: #ff8b98;
}

.admin-badge.admin {
  background: rgba(77, 148, 255, 0.16);
  color: #7cb2ff;
}

.admin-row-actions {
  display: flex;
  gap: 6px;
}

.admin-mini-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font: 700 11.5px/1 var(--font-body);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.admin-mini-btn:hover {
  color: var(--text);
  border-color: rgba(200, 245, 66, 0.45);
}

.admin-mini-btn.danger:hover {
  color: #ff8b98;
  border-color: rgba(255, 100, 116, 0.5);
}

/* ==================== Paziņojumu forma ==================== */

.admin-form {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.admin-form input[type="text"],
.admin-form textarea {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: 600 13.5px/1.45 var(--font-body);
  resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: rgba(200, 245, 66, 0.5);
}

.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-form-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.admin-form-row select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: 700 13px/1 var(--font-body);
  cursor: pointer;
}

.admin-form-row select option {
  background: #0b1220;
  color: var(--text);
}

/* ==================== Žurnāls ==================== */

.admin-log-list {
  display: grid;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}

.admin-log-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
}

.admin-log-item time {
  flex-shrink: 0;
  color: var(--muted-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.admin-log-item strong { color: var(--lime); font-weight: 700; }

.admin-log-empty {
  color: var(--muted-2);
  font-size: 13px;
  padding: 10px 2px;
}

/* ==================== Responsivitāte ==================== */

@media (max-width: 700px) {
  .admin-page { width: min(100% - 16px, 1180px); }
  .admin-tab { min-width: 30%; }
  .admin-users-head input[type="search"] { width: 100%; min-width: 0; }
}

/* ==================== Aktivitāte un sistēma ==================== */

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.admin-card-head h3,
.system-card h3 {
  margin: 0 0 5px;
}

.admin-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #c8f542;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #42e88c;
  box-shadow: 0 0 0 5px rgb(66 232 140 / 10%);
}

.activity-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(34px, 1fr));
  align-items: end;
  gap: 10px;
  height: 240px;
  padding-top: 18px;
  overflow-x: auto;
}

.activity-day {
  display: grid;
  grid-template-rows: 22px minmax(120px, 1fr) 22px;
  align-items: end;
  justify-items: center;
  min-width: 34px;
  height: 100%;
}

.activity-day span,
.activity-day small {
  color: #7f8da3;
  font-size: 11px;
  font-weight: 700;
}

.activity-day i {
  display: block;
  width: min(28px, 72%);
  min-height: 4px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #c8f542, #67d987);
  box-shadow: 0 0 18px rgb(200 245 66 / 12%);
}

.game-rate {
  display: inline-block;
  vertical-align: middle;
  width: 90px;
  height: 7px;
  margin-right: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #151d2b;
}

.game-rate i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #c8f542;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.system-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: start;
}

.system-card p {
  margin: 0 0 7px;
  color: #aebbd0;
  line-height: 1.55;
}

.system-card p.is-ok {
  color: #65e99a;
}

.system-card small {
  color: #6f7e94;
}

.system-card a,
.system-links a {
  color: #c8f542;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.system-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.system-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid #28364c;
  border-radius: 8px;
  color: #c8f542;
  background: #0b1321;
  font: 800 12px/1 "Sora", sans-serif;
}

.system-checklist {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.system-checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #aebbd0;
}

.system-checklist li span {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid #2b3a50;
  border-radius: 50%;
  color: #c8f542;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 780px) {
  .system-grid {
    grid-template-columns: 1fr;
  }

  .activity-chart {
    grid-template-columns: repeat(14, 42px);
  }
}
