/* ── ADMIN ──
   Reuses the site's tokens and components; this file is only the
   two-column shell, the tables and the stat cards.
*/

/* ── ADMIN ──
   The Admin tab. Reuses the site's tokens and components; this file is
   only the tables, stat cards and the product editor.
*/

/* ── Main ─────────────────────────────────────────────────── */

.adm-main { min-width: 0; }

.adm-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.adm-head h2 { font-size: 22px; margin-right: auto; }

.adm-loading {
  padding: 60px 20px;
  text-align: center;
  color: var(--dim);
}

.adm-section { margin-bottom: 34px; }
.adm-section > h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 14px;
}

/* ── Stats ────────────────────────────────────────────────── */

.adm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}
.adm-stat {
  padding: 18px 20px;
  border: 1px solid var(--edge);
  border-radius: var(--r);
  background: var(--slab);
}
.adm-stat-label {
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 6px;
}
.adm-stat-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* ── Alerts ───────────────────────────────────────────────── */

.adm-alert {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r);
  margin-bottom: 12px;
  font-size: 14px;
}
.adm-alert.warn {
  border: 1px solid rgba(245,181,74,0.3);
  background: rgba(245,181,74,0.07);
  color: #f0d3a0;
}
.adm-alert.bad {
  border: 1px solid rgba(255,92,92,0.3);
  background: rgba(255,92,92,0.07);
  color: #ffc4c4;
}
.adm-alert b { color: var(--paper); }

/* ── Tables ───────────────────────────────────────────────── */

.adm-table-wrap {
  border: 1px solid var(--edge);
  border-radius: var(--r);
  background: var(--slab);
  overflow-x: auto;
}
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: left;
  white-space: nowrap;
}
.adm-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--edge);
  vertical-align: middle;
}
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table tr:hover td { background: rgba(255,255,255,0.02); }
.adm-table .num { font-family: var(--mono); white-space: nowrap; }
.adm-table .actions { text-align: right; white-space: nowrap; }
.adm-table .actions .btn { height: 30px; padding: 0 11px; font-size: 12px; }

.adm-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
}

.adm-name { font-size: 14px; font-weight: 500; color: var(--paper); }
.adm-sub { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.adm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

/* ── Badges ───────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-live    { border: 1px solid rgba(47,209,138,0.4); color: var(--ok); }
.badge-quiet   { border: 1px solid var(--edge-hi); color: var(--dim); }
.badge-warn    { border: 1px solid rgba(245,181,74,0.4); color: var(--warn); }
.badge-bad     { border: 1px solid rgba(255,92,92,0.4); color: var(--bad); }
.badge-info    { border: 1px solid rgba(77,124,255,0.4); color: #9db3ff; }

/* ── Editor drawer ────────────────────────────────────────── */

.adm-drawer { width: min(520px, 100vw); }
.adm-drawer .drawer-body { padding: 20px; }

.adm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.adm-question {
  padding: 14px;
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  background: rgba(0,0,0,0.2);
  margin-bottom: 10px;
}
.adm-question-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.adm-question-head .adm-sub { margin-right: auto; }

.adm-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.adm-check input { width: 16px; height: 16px; accent-color: var(--ember); cursor: pointer; }

.adm-dropzone {
  padding: 26px 18px;
  border: 1px dashed var(--edge-hi);
  border-radius: var(--r);
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.adm-dropzone:hover, .adm-dropzone.over {
  border-color: var(--ember);
  background: rgba(255,90,45,0.05);
  color: var(--muted);
}

.adm-progress {
  height: 4px;
  margin-top: 12px;
  border-radius: 2px;
  background: var(--field);
  overflow: hidden;
}
.adm-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ember);
  transition: width 0.2s linear;
}

@media (max-width: 900px) {
  .adm-row2 { grid-template-columns: 1fr; }
}
