/* ================================================================
   TinyCompress Admin — Design System v6
   Shadcn UI / Radix Primitives inspired
   Aesthetic: Refined dark utility — obsidian sidebar, crisp cards
   Font: DM Sans (display) + JetBrains Mono (code)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:           #0f1117;
  --bg-2:         #161b27;
  --bg-3:         #1c2333;
  --surface:      #1e2536;
  --surface-2:    #252d40;
  --surface-3:    #2c354a;
  --border:       #2e3854;
  --border-light: #3a4566;

  --text:         #e8eaf2;
  --text-muted:   #8892b0;
  --text-dim:     #556080;

  --accent:       #6366f1;
  --accent-h:     #818cf8;
  --accent-dim:   rgba(99,102,241,.15);
  --accent-glow:  rgba(99,102,241,.25);

  --green:        #22d3a0;
  --green-dim:    rgba(34,211,160,.12);
  --yellow:       #fbbf24;
  --yellow-dim:   rgba(251,191,36,.12);
  --red:          #f87171;
  --red-dim:      rgba(248,113,113,.12);
  --blue:         #38bdf8;
  --blue-dim:     rgba(56,189,248,.12);

  --sidebar-w:    240px;
  --topbar-h:     56px;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-sm:    5px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.4);
  --shadow-md:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.6);
  --shadow-glow:  0 0 0 3px var(--accent-dim);

  --font:         'DM Sans', system-ui, sans-serif;
  --mono:         'JetBrains Mono', 'Fira Code', monospace;
  --transition:   150ms cubic-bezier(.4,0,.2,1);
}

/* ── Base Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body.admin-body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Layout ──────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.admin-content {
  padding: 1.5rem 2rem 3rem;
  flex: 1;
  max-width: 1200px;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.admin-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar Logo */
.sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 68px;
}
.sidebar-logo a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
}
.sidebar-logo-img {
  width: 32px; height: 32px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
}
.sidebar-logo-fallback {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  border: 1px solid var(--accent-dim);
}
.sidebar-logo-text { line-height: 1.2; }
.sidebar-logo-name {
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  letter-spacing: -.01em;
}
.sidebar-logo-sub {
  font-size: .68rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* Sidebar Nav */
.sidebar-menu {
  list-style: none;
  padding: .6rem .6rem 0;
  flex: 1;
}
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.sidebar-menu a .nav-icon {
  font-size: .9rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-menu a:hover {
  background: var(--surface);
  color: var(--text);
}
.sidebar-menu a.active {
  background: var(--accent-dim);
  color: var(--accent-h);
  border: 1px solid rgba(99,102,241,.2);
}
.sidebar-menu a.active .nav-icon { filter: none; }

/* Sidebar section labels */
.sidebar-section-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 1rem .9rem .35rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: .75rem .6rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .9rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: .82rem;
  transition: all var(--transition);
}
.sidebar-footer a:hover { background: var(--surface); color: var(--red); }
.sidebar-footer .view-site:hover { color: var(--blue); }
.sidebar-footer .admin-user {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .9rem;
  margin-bottom: .3rem;
}
.sidebar-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
}
.sidebar-username { font-size: .82rem; color: var(--text-muted); font-weight: 500; }

/* ── Topbar ───────────────────────────────────────────────────── */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-page-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  flex: 1;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition);
  align-items: center;
  justify-content: center;
}
.hamburger-btn:hover { background: var(--surface); color: var(--text); }

/* Status badge */
.status-indicator {
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .7rem;
  border-radius: 999px;
  display: flex; align-items: center; gap: .35rem;
}
.status-indicator::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-ok { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,211,160,.2); }
.status-ok::before { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
.status-warn { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.status-warn::before { background: var(--red); }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--transition);
  line-height: 1;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); box-shadow: var(--shadow-glow); }
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--surface); color: var(--text); border-color: var(--border-light); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(248,113,113,.25);
}
.btn-danger:hover { background: rgba(248,113,113,.2); }
.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(34,211,160,.25);
}
.btn-sm { padding: .3rem .7rem; font-size: .76rem; }
.btn-lg { padding: .6rem 1.4rem; font-size: .9rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Cards ───────────────────────────────────────────────────── */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.card-header .card-desc {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .1rem;
}
.card-link {
  font-size: .76rem;
  color: var(--accent-h);
  text-decoration: none;
  font-weight: 500;
}
.card-link:hover { color: var(--text); }
.card-body { padding: 1.25rem; }

/* ── Stats Grid ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card-icon-wrap {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.stat-icon-blue  { background: var(--blue-dim); }
.stat-icon-green { background: var(--green-dim); }
.stat-icon-yellow{ background: var(--yellow-dim); }
.stat-icon-purple{ background: var(--accent-dim); }
.stat-card-num {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.03em;
  font-family: var(--font);
}
.stat-card-label {
  font-size: .73rem;
  color: var(--text-muted);
  margin-top: .2rem;
  font-weight: 500;
}
.stat-card-trend {
  font-size: .7rem;
  color: var(--green);
  margin-top: .15rem;
}

/* ── Quick Nav Pills ──────────────────────────────────────────── */
.quick-nav {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* ── Admin Row ───────────────────────────────────────────────── */
.admin-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* ── Table ────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.admin-table th {
  text-align: left;
  padding: .6rem 1rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table code {
  font-family: var(--mono);
  font-size: .75rem;
  background: var(--surface-3);
  padding: .1rem .4rem;
  border-radius: 4px;
  color: var(--blue);
}
.no-data { text-align: center; color: var(--text-dim); padding: 2rem !important; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.badge-green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(34,211,160,.2); }
.badge-red    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(248,113,113,.2); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(251,191,36,.2); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(56,189,248,.2); }
.badge-purple { background: var(--accent-dim); color: var(--accent-h); border: 1px solid rgba(99,102,241,.2); }

/* ── Server Status List ───────────────────────────────────────── */
.server-status-list {
  list-style: none;
  padding: .75rem 1.25rem;
}
.server-status-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
}
.server-status-list li:last-child { border-bottom: none; }
.server-status-list li > span:first-child { color: var(--text-muted); }

/* ── Bar Chart ────────────────────────────────────────────────── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  height: 120px;
  padding: 1.25rem 1.25rem .75rem;
}
.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bar-fill {
  width: 100%;
  background: var(--accent-dim);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  position: relative;
  transition: height .5s ease;
  cursor: pointer;
}
.bar-fill:hover { background: var(--accent); }
.bar-count {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .65rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.bar-label {
  font-size: .65rem;
  color: var(--text-dim);
  margin-top: .3rem;
  white-space: nowrap;
}

/* ── Maintenance Toggle ───────────────────────────────────────── */
.toggle-btn {
  font-family: var(--font);
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.toggle-btn.toggle-on {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(248,113,113,.3);
}

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs-wrapper { margin-top: .25rem; }
.tabs-nav {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0;
  scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }
.tab-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .6rem .9rem;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab-link:hover { color: var(--text); }
.tab-link.active {
  color: var(--accent-h);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Settings Forms ──────────────────────────────────────────── */
.settings-form { max-width: 760px; }
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.1rem;
}
.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.form-section-header h3 {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.form-section-header .section-desc {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
/* legacy h3 support */
.form-section > h3 {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .9rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}
.form-row {
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 200px; }
.form-group { margin-bottom: .85rem; }
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  display: block;
  font-size: .77rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .35rem;
  letter-spacing: .01em;
}
.form-control {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: .83rem;
  padding: .5rem .75rem;
  transition: all var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  background: var(--bg-2);
}
.form-control::placeholder { color: var(--text-dim); }
textarea.form-control {
  resize: vertical;
  min-height: 80px;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.6;
}
select.form-control { cursor: pointer; }
.form-hint {
  font-size: .72rem;
  color: var(--text-dim);
  margin-top: .3rem;
}
.form-hint.hint-warn { color: var(--yellow); }
.form-hint.hint-good { color: var(--green); }
.form-hint.hint-danger { color: var(--red); }

/* Checkbox + Radio */
.checkbox-label, .radio-label {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .82rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: .3rem 0;
}
.checkbox-label input, .radio-label input {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .9rem;
}

/* Range Slider */
.range-input {
  width: 100%;
  accent-color: var(--accent);
  height: 4px;
  margin-top: .4rem;
  cursor: pointer;
}

/* Upload / File Input */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-3);
}
.file-upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.file-upload-zone input[type="file"] {
  display: none;
}
.file-upload-label {
  font-size: .82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
}
.file-upload-label .upload-icon { font-size: 1.5rem; }
.logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: .5rem;
}
.logo-preview {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
}
.favicon-preview {
  width: 24px; height: 24px;
  border-radius: 4px;
  object-fit: contain;
  background: var(--surface);
}

/* ── Alert / Flash ───────────────────────────────────────────── */
.alert {
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--green-dim); color: var(--green); border-color: rgba(34,211,160,.25); }
.alert-error   { background: var(--red-dim);   color: var(--red);   border-color: rgba(248,113,113,.25); }
.alert-warn    { background: var(--yellow-dim); color: var(--yellow); border-color: rgba(251,191,36,.25); }
.alert-info    { background: var(--blue-dim);   color: var(--blue);  border-color: rgba(56,189,248,.25); }

/* ── Ad Zones ────────────────────────────────────────────────── */
.ad-zone-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
}
.ad-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.ad-zone-header:hover { background: var(--surface-2); }
.ad-zone-title {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: .5rem;
}
.ad-zone-body {
  padding: 1rem 1.1rem;
  background: var(--bg-3);
  display: none;
}
.ad-zone-body.open { display: block; }
.ad-preview-banner {
  background: var(--surface-3);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
  font-size: .72rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: .6rem;
}

/* ── SEO Section ─────────────────────────────────────────────── */
.seo-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-top: .75rem;
}
.seo-preview-url { font-size: .72rem; color: var(--green); margin-bottom: .25rem; font-family: var(--mono); }
.seo-preview-title { font-size: .95rem; color: var(--blue); font-weight: 500; margin-bottom: .2rem; }
.seo-preview-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }
.seo-char-count { font-size: .7rem; color: var(--text-dim); text-align: right; margin-top: .2rem; }
.seo-char-count.over { color: var(--red); }
.seo-char-count.good { color: var(--green); }

/* ── Schema Type Card ─────────────────────────────────────────── */
.schema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .5rem;
  margin-top: .5rem;
}
.schema-option {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-3);
  display: flex; flex-direction: column; gap: .2rem;
}
.schema-option:hover { border-color: var(--border-light); background: var(--surface); }
.schema-option.selected { border-color: var(--accent); background: var(--accent-dim); }
.schema-option input[type="radio"] { display: none; }
.schema-label { font-size: .78rem; font-weight: 600; color: var(--text); }
.schema-sub { font-size: .68rem; color: var(--text-dim); }

/* ── Mobile Overlay ───────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.hidden { display: none !important; }

/* ── Login Page ──────────────────────────────────────────────── */
body.admin-login-body {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-wrapper {
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}
.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-top: .75rem;
  letter-spacing: -.02em;
}
.login-subtitle { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.login-back { text-align: center; margin-top: 1rem; }
.login-back a { font-size: .78rem; color: var(--text-dim); text-decoration: none; }
.login-back a:hover { color: var(--accent-h); }
.login-hint { font-size: .72rem; color: var(--text-dim); text-align: center; margin-top: .5rem; }
.input-with-toggle { position: relative; }
.input-with-toggle .form-control { padding-right: 2.5rem; }
.toggle-pwd {
  position: absolute;
  right: .6rem; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-dim);
  transition: color var(--transition);
}
.toggle-pwd:hover { color: var(--text); }
.login-form .form-group { margin-bottom: 1rem; }

/* ── API Manager specific ─────────────────────────────────────── */
.api-key-display {
  font-family: var(--mono);
  font-size: .78rem;
  background: var(--bg-3);
  padding: .4rem .7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--blue);
  word-break: break-all;
}
.api-key-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }

/* ── Pagination ───────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: .35rem;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}
.pagination a {
  padding: .3rem .65rem;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.pagination a:hover { background: var(--surface); color: var(--text); }
.pagination a.current {
  background: var(--accent-dim);
  color: var(--accent-h);
  border-color: rgba(99,102,241,.3);
}
.pagination-info { font-size: .75rem; color: var(--text-dim); margin: 0 .5rem; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .admin-main { margin-left: 0; }
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    width: 240px;
    box-shadow: none;
  }
  .admin-sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .hamburger-btn { display: inline-flex; }
  .admin-topbar { padding: 0 1rem; }
  .admin-content { padding: 1rem 1rem 2rem; }
  .admin-row { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tabs-nav { gap: 0; }
  .tab-link { padding: .5rem .65rem; font-size: .75rem; }
  .form-row { flex-direction: column; gap: .6rem; }
  .form-row .form-group { min-width: unset; }
  .settings-form { max-width: 100%; }
  .schema-grid { grid-template-columns: repeat(2, 1fr); }
}
