@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700&family=Syne:wght@400;500;600;700&display=swap");

:root {
  --bg: #0a0a0f;
  --panel: #11131a;
  --panel-strong: #171a24;
  --ink: #f2f7f6;
  --muted: #9aa7a8;
  --line: rgba(0, 255, 200, 0.22);
  --line-hot: rgba(0, 255, 200, 0.72);
  --accent: #00ffc8;
  --accent-ink: #001f1a;
  --rose: #ff4fa3;
  --gold: #ffd166;
  --danger: #ff5c6c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--bg);
  font-family: "Syne", system-ui, sans-serif;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(0, 255, 200, 0.16);
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 14px rgba(0, 255, 200, 0.7), inset 0 0 8px rgba(0, 255, 200, 0.2);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.topbar-title {
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-ghost {
  color: var(--muted);
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}
.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: rgba(255,92,108,0.4);
  box-shadow: 0 0 14px rgba(255,92,108,0.2);
}
.btn-danger:hover { box-shadow: 0 0 22px rgba(255,92,108,0.4); }

.btn-success {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 0 14px rgba(0,255,200,0.24);
}
.btn-success:hover { box-shadow: 0 0 24px rgba(0,255,200,0.4); }

.btn-warning {
  color: var(--accent-ink);
  background: var(--gold);
  border-color: rgba(255,209,102,0.5);
}

/* ── Layout ──────────────────────────────────────────────── */
.admin-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ── Access Denied ───────────────────────────────────────── */
.access-denied {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 64px);
  gap: 16px;
  text-align: center;
  color: var(--danger);
}

.access-denied h1 {
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 2rem;
  margin: 0;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  padding: 4px;
  border: 1px solid rgba(0,255,200,0.14);
  border-radius: calc(var(--radius) + 2px);
  background: rgba(255,255,255,0.03);
  width: fit-content;
}

.tab-btn {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 160ms, color 160ms;
}

.tab-btn:hover { color: var(--ink); }

.tab-btn.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 0 16px rgba(0,255,200,0.3);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ── Section heading ─────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 1.05rem;
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0,255,200,0.12);
  border: 1px solid rgba(0,255,200,0.28);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
}

/* ── Card grid ───────────────────────────────────────────── */
.card-grid {
  display: grid;
  gap: 14px;
}

.card {
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  background: var(--panel);
  display: grid;
  gap: 10px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.card-meta strong { color: var(--ink); }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.status-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pending   { background: rgba(255,209,102,0.15); color: var(--gold); border: 1px solid rgba(255,209,102,0.3); }
.status-resolved  { background: rgba(0,255,200,0.10); color: var(--accent); border: 1px solid rgba(0,255,200,0.24); }
.status-published { background: rgba(0,255,200,0.10); color: var(--accent); border: 1px solid rgba(0,255,200,0.24); }
.status-claimed   { background: rgba(255,209,102,0.12); color: var(--gold); border: 1px solid rgba(255,209,102,0.28); }
.status-dismissed { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid rgba(255,255,255,0.1); }

/* ── Cell thumbnail preview ──────────────────────────────── */
.cell-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(0,255,200,0.2);
  background: #000;
  flex-shrink: 0;
}

.cell-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--panel-strong);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius);
}

.empty-state p { margin: 0; font-size: 0.95rem; }

/* ── Loader ──────────────────────────────────────────────── */
.loader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,255,200,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(0,255,200,0.2);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(17,19,26,0.96);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-success { border-color: rgba(0,255,200,0.46); }
.toast-error   { border-color: rgba(255,92,108,0.55); }
.toast-warning { border-color: rgba(255,209,102,0.5); }

.toast-out {
  opacity: 0;
  transform: translateY(8px);
}

/* ── Confirm dialog overlay ──────────────────────────────── */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.72);
}

.dialog-box {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid rgba(0,255,200,0.22);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.dialog-box h3 {
  margin: 0;
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 1rem;
}

.dialog-box p { margin: 0; color: var(--muted); line-height: 1.6; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Search bar ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.search-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid rgba(0,255,200,0.22);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.28);
  color: var(--ink);
  outline: none;
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,255,200,0.1);
}

.filter-select {
  padding: 9px 12px;
  border: 1px solid rgba(0,255,200,0.22);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.28);
  color: var(--ink);
  outline: none;
  font-family: inherit;
  cursor: pointer;
}

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .admin-layout { padding: 20px 14px 48px; }
  .tab-bar { width: 100%; overflow-x: auto; }
  .tab-btn { padding: 8px 14px; }
  .card-header { flex-direction: column; gap: 8px; }
}
