/* ==========================================================================
   ZENITH CODE — Admin design system
   ========================================================================== */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --font-sans: "Inter", "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 56px;
  --transition: 160ms ease;
}

html[data-theme="dark"] {
  --bg: #08080a;
  --bg-soft: #0b0b0e;
  --sidebar-bg: #050506;
  --topbar-bg: rgba(9, 9, 11, 0.92);
  --surface: #0f0f12;
  --surface-2: #141418;
  --surface-3: #1a1a1f;
  --surface-hover: #18181d;
  --border: #1d1d23;
  --border-strong: #2a2a32;
  --text: #f2f2f3;
  --text-secondary: #a1a1aa;
  --text-muted: #74747e;
  --text-faint: #55555e;
  --accent: #b8f500;
  --accent-strong: #c8ff1a;
  --accent-soft: rgba(184, 245, 0, 0.10);
  --accent-softer: rgba(184, 245, 0, 0.05);
  --accent-border: rgba(184, 245, 0, 0.28);
  --accent-text: #c8f75a;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.10);
  --danger-border: rgba(248, 113, 113, 0.24);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.10);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.10);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.10);
  --chart-grid: #222228;
  --chart-axis: #6b6b74;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.55);
  --input-bg: #0b0b0e;
  --scrollbar: #2a2a31;
  --code-bg: #111114;
  --logo-ink: #0a0a0b;
}

html[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-soft: #eef0f3;
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, 0.94);
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #f1f3f6;
  --surface-hover: #f4f6f8;
  --border: #e3e6eb;
  --border-strong: #d1d6de;
  --text: #0f172a;
  --text-secondary: #5c6675;
  --text-muted: #7b8494;
  --text-faint: #9aa2af;
  --accent: #7ea800;
  --accent-strong: #6a8f00;
  --accent-soft: rgba(126, 168, 0, 0.12);
  --accent-softer: rgba(126, 168, 0, 0.06);
  --accent-border: rgba(126, 168, 0, 0.32);
  --accent-text: #5d7d00;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --danger-border: rgba(220, 38, 38, 0.2);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.08);
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.08);
  --info: #1d4ed8;
  --info-soft: rgba(29, 78, 216, 0.08);
  --chart-grid: #e8eaee;
  --chart-axis: #98a1ad;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 18px 42px rgba(16, 24, 40, 0.12);
  --input-bg: #ffffff;
  --scrollbar: #ccd2db;
  --code-bg: #f5f6f8;
  --logo-ink: #0a0a0b;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
svg { flex-shrink: 0; }
::selection { background: var(--accent); color: #0a0a0b; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.size-3 { width: 12px; height: 12px; }
.size-3\.5 { width: 14px; height: 14px; }
.size-4 { width: 16px; height: 16px; }
.size-5 { width: 20px; height: 20px; }
.size-6 { width: 24px; height: 24px; }
.muted { color: var(--text-muted); }
.muted-icon { color: var(--text-faint); }
.accent { color: var(--accent-text); }
.mono { font-family: var(--font-mono); font-size: 11.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: width var(--transition), transform var(--transition);
}
.sidebar-overlay { display: none; }
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .brand-word,
body.sidebar-collapsed .sidebar-search,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-tag,
body.sidebar-collapsed .nav-group-title { display: none; }
body.sidebar-collapsed .sidebar-head { justify-content: center; padding: 0 12px; }
body.sidebar-collapsed .sidebar-collapse { display: none; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 10px; }
body.sidebar-collapsed .nav-icon { margin: 0; }
body.sidebar-collapsed .sidebar-foot { padding: 12px 10px; }

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--logo-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(184, 245, 0, 0.25), 0 0 18px rgba(184, 245, 0, 0.12);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-mark-lg { width: 38px; height: 38px; border-radius: 10px; }
.brand-mark-lg svg { width: 26px; height: 26px; }
.brand-word {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.brand-word b { color: var(--accent-text); font-weight: 800; }
.sidebar-collapse, .sidebar-close-mobile { color: var(--text-muted); }
.sidebar-close-mobile { display: none !important; }

.sidebar-search {
  position: relative;
  margin: 14px 14px 6px;
}
.sidebar-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.sidebar-search input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 31px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 11.5px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.sidebar-search input::placeholder { color: var(--text-faint); }
.sidebar-search input:focus { border-color: var(--border-strong); background: var(--surface); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 10px 10px; }
.nav-group { margin-bottom: 6px; }
.nav-group-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 6px 10px 3px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  margin: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1px rgba(184, 245, 0, 0.07);
}
html[data-theme="light"] .nav-item.is-active { background: #ebf7c9; color: #46620a; }
.nav-item.is-active .nav-icon { color: var(--accent); }
html[data-theme="light"] .nav-item.is-active .nav-icon { color: #6a8f00; }
.nav-icon { display: inline-flex; color: var(--text-muted); transition: color var(--transition); }
.nav-item:hover .nav-icon { color: var(--text); }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.3;
}
.nav-item.is-active .nav-tag { border-color: var(--accent-border); color: var(--accent-text); }
.nav-empty { padding: 12px 10px; font-size: 11px; color: var(--text-faint); }
.sidebar-foot { padding: 12px 10px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.nav-item.signout { color: var(--danger); }
.nav-item.signout:hover { background: var(--danger-soft); color: var(--danger); }
.nav-item.signout .nav-icon { color: var(--danger); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.mobile-menu-btn { display: none !important; }
.topbar-status { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 3px transparent;
}
.status-chip.is-ok { border-color: var(--accent-border); color: var(--accent-text); background: var(--accent-softer); }
.status-chip.is-ok .status-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(184, 245, 0, 0.12); }
.status-chip.is-down { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.status-chip.is-down .status-dot { background: var(--danger); }
.status-chip.is-warn { color: var(--warning); border-color: rgba(251, 191, 36, 0.28); background: var(--warning-soft); }
.status-chip.is-warn .status-dot { background: var(--warning); }
.topbar-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar-clock {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 0 10px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.icon-btn {
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.notification-btn { position: relative; }
.notification-dot {
  position: absolute;
  top: 2px; right: 1px;
  min-width: 14px; height: 14px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--accent);
  color: #0a0a0b;
  font-size: 8.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--topbar-bg);
}
.theme-toggle [data-theme-icon] { display: none; }
html[data-theme="dark"] .theme-toggle [data-theme-icon="dark"] { display: inline-flex; }
html[data-theme="light"] .theme-toggle [data-theme-icon="light"] { display: inline-flex; }
.admin-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 3px 4px 3px 8px;
  border-radius: 8px;
  margin-left: 2px;
  transition: background var(--transition);
}
.admin-chip:hover { background: var(--surface-2); }
.avatar {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.admin-chip-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.admin-name { font-size: 11.5px; font-weight: 600; color: var(--text); }
.admin-role { font-size: 9.5px; color: var(--text-muted); }
.admin-chip > svg { margin: 0 4px 0 2px; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
  z-index: 80;
}
[data-dropdown].is-open .dropdown-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}
.dropdown-empty { padding: 16px 10px; font-size: 11.5px; color: var(--text-muted); text-align: center; }
.notification-panel { width: 300px; }
.notification-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.notification-item:hover { background: var(--surface-2); color: var(--text); }
.notification-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-panel { width: 230px; }
.dropdown-link {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  text-align: left;
}
.dropdown-link:hover { background: var(--surface-2); color: var(--text); }
.dropdown-link.is-danger { color: var(--danger); }
.dropdown-link.is-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Content ---------- */
.content { padding: 26px 28px 48px; flex: 1; max-width: 1600px; width: 100%; margin: 0 auto; }
.page-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head-text { flex: 1; min-width: 220px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
.page-head p { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 31px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0b;
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-secondary { background: var(--surface-2); border-color: var(--border); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.18); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 10.5px; border-radius: 6px; }
.btn-xs { height: 23px; padding: 0 7px; font-size: 10px; border-radius: 5px; }
.btn-lg { height: 38px; padding: 0 18px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 7px 0 0 7px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 7px 7px 0; }
.btn-group .btn.is-active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); z-index: 1; }
.btn-link { color: var(--accent-text); font-weight: 600; border: 0; background: none; padding: 0; }

/* ---------- Cards & metrics ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.card-title { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.card-sub { margin: 4px 0 0; font-size: 10.5px; color: var(--text-muted); }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-toolbar { display: flex; align-items: center; gap: 8px; }
.card > .empty-state { border: 0; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 17px;
  min-height: 114px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.metric-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 80px at 90% -20%, var(--accent-softer), transparent 70%);
  pointer-events: none;
}
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.metric-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.metric-icon { color: var(--text-faint); }
.metric-value { font-size: 26px; font-weight: 650; line-height: 1.15; letter-spacing: -0.03em; margin-top: 12px; }
.metric-value.accent { color: var(--accent-text); }
.metric-sub { margin-top: auto; padding-top: 10px; font-size: 10.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.metric-sub .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-faint); }
.metric-sub .up { color: var(--success); }
.metric-sub .down { color: var(--danger); }
.metric-sub .warn { color: var(--warning); }
.metric-sub .accent { color: var(--accent-text); }

.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.quick-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}
.quick-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.quick-head { display: flex; align-items: center; gap: 9px; }
.quick-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
}
.quick-title { font-size: 12.5px; font-weight: 650; }
.quick-desc { font-size: 11px; color: var(--text-muted); line-height: 1.55; min-height: 34px; }
.quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.quick-link:hover { border-color: var(--accent-border); color: var(--accent-text); }

/* ---------- Charts ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.chart-grid.chart-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart-card { padding: 0; overflow: hidden; }
.chart-box { position: relative; padding: 8px 14px 12px; min-height: 230px; }
.chart-box svg { width: 100%; height: auto; overflow: visible; }
.chart-empty {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11.5px;
}
.chart-empty svg { color: var(--text-faint); width: 26px; height: 26px; }
.chart-legend { display: flex; align-items: center; gap: 14px; padding: 0 18px 14px; font-size: 10.5px; color: var(--text-muted); flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.legend-dot.input { background: var(--accent); }
.legend-dot.output { background: #7c8cff; }
.legend-dot.failed { background: var(--danger); }
.chart-hover-line { stroke: var(--border-strong); stroke-dasharray: 3 4; }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 10.5px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 5;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 80ms;
}
.donut-wrap { display: flex; align-items: center; gap: 22px; padding: 14px 20px 20px; flex-wrap: wrap; }
.donut-wrap svg { width: 150px; height: 150px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 11px; min-width: 150px; flex: 1; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.donut-legend-item b { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.hbar-list { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 11px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 1.3fr) 3fr auto; gap: 10px; align-items: center; font-size: 11px; }
.hbar-label { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, rgba(184, 245, 0, 0.65), var(--accent)); }
.hbar-value { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.5;
}
.badge-success { background: var(--success-soft); color: var(--success); border-color: rgba(74, 222, 128, 0.18); }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(251, 191, 36, 0.18); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.badge-muted { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: rgba(96, 165, 250, 0.18); }
html[data-theme="light"] .badge-success { border-color: rgba(21, 128, 61, 0.15); }
html[data-theme="light"] .badge-warning { border-color: rgba(180, 83, 9, 0.15); }
html[data-theme="light"] .badge-info { border-color: rgba(29, 78, 216, 0.15); }
.tag {
  display: inline-flex;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 9.5px;
  color: var(--text-muted);
  background: var(--surface-2);
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.data-table th {
  text-align: left;
  padding: 9px 14px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td strong, .data-table td .cell-strong { color: var(--text); font-weight: 600; }
.data-table .cell-sub { display: block; font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.data-table .cell-user { display: flex; align-items: center; gap: 9px; }
.data-table .cell-user .avatar { width: 25px; height: 25px; border-radius: 6px; font-size: 9.5px; }
.cell-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.cell-actions form { display: inline-flex; }
.table-empty { padding: 46px 20px; text-align: center; color: var(--text-muted); font-size: 11.5px; }
.table-empty strong { display: block; color: var(--text-secondary); font-size: 12.5px; margin-bottom: 4px; }
.table-mono { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.progress { height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label, .field-label { font-size: 10.5px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.01em; }
.field .optional { color: var(--text-faint); font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"],
input[type="search"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="tel"], select, textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea { height: auto; min-height: 90px; padding: 9px 10px; resize: vertical; line-height: 1.55; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2388888f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px; cursor: pointer; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-softer); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 36px; }
.input-suffix {
  position: absolute;
  right: 2px; top: 2px;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--text-faint); border-radius: 6px;
}
.input-suffix:hover { color: var(--text); background: var(--surface-2); }
.field-error { font-size: 10.5px; color: var(--danger); }
.field-hint { font-size: 10px; color: var(--text-muted); line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section-title { font-size: 11px; font-weight: 650; color: var(--text); margin: 0 0 12px; letter-spacing: 0.01em; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--border); }
.checkbox { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 11.5px; color: var(--text-secondary); cursor: pointer; }
.checkbox input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.checkbox span strong { display: block; color: var(--text); font-weight: 600; }
.check-row { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 7px 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 11.5px; color: var(--text-secondary); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 32px; height: 18px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background var(--transition); position: relative; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-muted); transition: transform var(--transition), background var(--transition); }
.switch input:checked + .switch-track { background: var(--accent-soft); border-color: var(--accent-border); }
.switch input:checked + .switch-track::after { transform: translateX(14px); background: var(--accent); }
.color-input { display: flex; align-items: center; gap: 8px; }
.color-input input[type="color"] { width: 34px; height: 34px; padding: 2px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--input-bg); cursor: pointer; }
.color-input input[type="text"] { flex: 1; }
.file-drop {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.file-drop:hover { border-color: var(--accent-border); background: var(--accent-softer); }
.file-drop input { display: none; }
.file-drop strong { display: block; color: var(--text-secondary); font-size: 11.5px; margin-bottom: 3px; }
.file-preview { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--surface-2); display: flex; align-items: center; gap: 10px; }
.file-preview img, .file-preview video { max-width: 110px; max-height: 62px; border-radius: 5px; object-fit: cover; }
.file-preview .file-meta { font-size: 10.5px; color: var(--text-muted); min-width: 0; }
.file-preview .file-meta b { display: block; color: var(--text-secondary); font-weight: 600; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.upload-progress { height: 3px; background: var(--surface-3); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 120ms; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-bar .search-field { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.filter-bar .search-field svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.filter-bar .search-field input { padding-left: 30px; height: 31px; font-size: 11.5px; }
.filter-bar select, .filter-bar input[type="date"] { width: auto; min-width: 120px; height: 31px; font-size: 11px; }
.filter-bar .spacer { flex: 1; }
.filter-label { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 650; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 8px;
  border-radius: 5px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-secondary);
  font-size: 10px; font-weight: 500;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }
.chip-removable button { border: 0; background: none; color: inherit; padding: 0; display: inline-flex; }

/* ---------- Tabs ---------- */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 10px 9px;
  border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--text-muted);
  font-size: 11.5px; font-weight: 550; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent-text); border-bottom-color: var(--accent); }
.tab .tab-count { font-size: 9.5px; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--text-muted); }
.tab.is-active .tab-count { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--text-muted); flex-wrap: wrap; }
.pagination-links { display: flex; align-items: center; gap: 4px; }
.page-link { min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-secondary); font-size: 10.5px; }
.page-link:hover { border-color: var(--border-strong); color: var(--text); }
.page-link.is-active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }
.page-link.is-disabled { opacity: 0.4; pointer-events: none; }

/* ---------- Flash & alerts ---------- */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.flash-icon { display: inline-flex; color: var(--text-muted); margin-top: 1px; }
.flash-success { border-color: rgba(74, 222, 128, 0.25); background: var(--success-soft); color: var(--success); }
.flash-success .flash-icon { color: var(--success); }
.flash-error { border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger); }
.flash-error .flash-icon { color: var(--danger); }
.flash-warning { border-color: rgba(251, 191, 36, 0.25); background: var(--warning-soft); color: var(--warning); }
.flash-info { border-color: rgba(96, 165, 250, 0.25); background: var(--info-soft); color: var(--info); }
.flash-close { margin-left: auto; border: 0; background: none; color: inherit; opacity: 0.65; padding: 0; display: inline-flex; }
.flash-close:hover { opacity: 1; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text-secondary); margin-bottom: 16px; }
.alert strong { color: var(--text); }
.alert-warning { border-color: rgba(251, 191, 36, 0.25); background: var(--warning-soft); }
.alert-danger { border-color: var(--danger-border); background: var(--danger-soft); }
.alert-icon { color: var(--warning); margin-top: 1px; }

/* ---------- Empty state ---------- */
.empty-state { padding: 44px 22px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-state-icon { width: 38px; height: 38px; margin: 0 auto 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-faint); display: flex; align-items: center; justify-content: center; }
.empty-state strong { display: block; color: var(--text-secondary); font-size: 12.5px; margin-bottom: 4px; }
.empty-state p { margin: 0 auto 14px; max-width: 380px; font-size: 11px; line-height: 1.6; }

/* ---------- Modal ---------- */
dialog.modal {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(2px); }
dialog.modal.modal-lg { width: min(860px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 12px; }
.modal-title { margin: 0; font-size: 14px; font-weight: 650; }
.modal-sub { margin: 4px 0 0; font-size: 11px; color: var(--text-muted); }
.modal-body { padding: 0 20px 18px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- Installer ---------- */
.step-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.step-chip {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.step-chip.is-active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }

/* ---------- Auth ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 30px 16px; background: var(--bg); }
.install-body { align-items: flex-start; padding-top: 42px; padding-bottom: 42px; }
.auth-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(600px 320px at 50% -8%, rgba(184, 245, 0, 0.10), transparent 70%),
    radial-gradient(600px 300px at 100% 100%, rgba(184, 245, 0, 0.04), transparent 70%);
  pointer-events: none;
}
.auth-shell { position: relative; width: min(410px, 100%); }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 28px 26px;
  box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-word { font-size: 13px; font-weight: 750; letter-spacing: 0.15em; }
.auth-word b { color: var(--accent-text); }
.auth-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; }
.auth-card h1 { margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.auth-lead { margin: 0 0 20px; font-size: 11.5px; color: var(--text-muted); line-height: 1.6; }
.auth-form .field { margin-bottom: 15px; }
.auth-form input { height: 38px; font-size: 12.5px; }
.auth-form .btn { height: 38px; font-size: 12px; margin-top: 4px; }
.auth-link { display: block; text-align: center; margin-top: 14px; font-size: 11px; color: var(--text-muted); }
.auth-link:hover { color: var(--text); }
.auth-note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-faint); line-height: 1.6; text-align: center; }
.auth-footnote { margin: 18px 0 0; text-align: center; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }

/* ---------- Detail layouts ---------- */
.detail-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.detail-card { padding: 20px; }
.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.profile-avatar { width: 62px; height: 62px; border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 750; }
.profile-name { font-size: 15px; font-weight: 650; }
.profile-email { font-size: 11px; color: var(--text-muted); }
.detail-list { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.detail-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 11px; }
.detail-row:last-child { border-bottom: 0; }
.detail-key { color: var(--text-muted); }
.detail-value { color: var(--text); text-align: right; font-weight: 500; word-break: break-word; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.stat-cell { background: var(--surface); padding: 12px 14px; }
.stat-cell-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 650; }
.stat-cell-value { font-size: 17px; font-weight: 650; margin-top: 4px; letter-spacing: -0.02em; }
.stat-cell-value.accent { color: var(--accent-text); }

/* ---------- Promotion preview ---------- */
.preview-stage {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 14px 14px;
  padding: 24px;
  display: flex;
  justify-content: center;
}
.promo-preview {
  width: 100%;
  max-width: 520px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #121215;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.promo-preview-media img, .promo-preview-media video { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.promo-preview-body { padding: 16px; }
.promo-preview-title { font-size: 15px; font-weight: 700; }
.promo-preview-sub { font-size: 11px; opacity: 0.7; margin-top: 3px; }
.promo-preview-desc { font-size: 11px; opacity: 0.8; margin-top: 8px; line-height: 1.6; }
.promo-preview-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.promo-preview-btn { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 6px; background: #b8f500; color: #0a0a0b; font-size: 11px; font-weight: 700; }
.promo-preview-btn.secondary { background: transparent; color: inherit; border: 1px solid rgba(255, 255, 255, 0.25); }
.promo-banner-preview { max-width: 560px; }
.promo-banner-preview img { width: 100%; display: block; }

/* ---------- Health ---------- */
.health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.health-card { padding: 16px 17px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.health-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.health-name { font-size: 11px; color: var(--text-secondary); font-weight: 550; }
.health-state { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.health-dot.warn { background: var(--warning); }
.health-dot.down { background: var(--danger); }
.health-meta { font-size: 10px; color: var(--text-muted); margin-top: 6px; }
.health-card.is-down { border-color: var(--danger-border); }
.health-card.is-warn { border-color: rgba(251, 191, 36, 0.28); }

/* ---------- Misc ---------- */
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.section-title h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.section-title p { margin: 4px 0 0; font-size: 11px; color: var(--text-muted); }
.list-stack { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: 11.5px; }
.list-row:last-child { border-bottom: 0; }
.list-row .avatar { width: 26px; height: 26px; border-radius: 6px; font-size: 9.5px; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-main b { display: block; font-weight: 600; color: var(--text); }
.list-row-main span { font-size: 10px; color: var(--text-muted); }
.activity-dot { width: 26px; height: 26px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.split-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; }
.split-3 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.mb-0 { margin-bottom: 0 !important; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.hint { font-size: 10.5px; color: var(--text-muted); line-height: 1.55; }
.kbd { font-family: var(--font-mono); font-size: 9.5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 1px 4px; color: var(--text-muted); background: var(--surface-2); }
.code-block { background: var(--code-bg); border: 1px solid var(--border); border-radius: 7px; padding: 11px 13px; font-family: var(--font-mono); font-size: 10.5px; line-height: 1.7; color: var(--text-secondary); overflow-x: auto; white-space: pre; }
.copy-row { display: flex; align-items: center; gap: 8px; }
.secret-value { font-family: var(--font-mono); font-size: 11px; color: var(--text); letter-spacing: 0.04em; }
.range-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--surface); }
.range-tab { padding: 0 10px; height: 30px; display: inline-flex; align-items: center; font-size: 10.5px; color: var(--text-muted); border-right: 1px solid var(--border); }
.range-tab:last-child { border-right: 0; }
.range-tab:hover { color: var(--text); background: var(--surface-2); }
.range-tab.is-active { background: var(--accent-soft); color: var(--accent-text); }
.last-updated { font-size: 10px; color: var(--text-faint); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.help-panel { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 12px 14px; font-size: 10.5px; color: var(--text-muted); line-height: 1.65; }
.help-panel b { color: var(--text-secondary); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; }
.perm-item { display: flex; align-items: flex-start; gap: 7px; font-size: 10.5px; color: var(--text-secondary); padding: 3px 0; }
.perm-item input { accent-color: var(--accent); margin-top: 2px; }
.perm-group { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.perm-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.perm-group-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 700; margin-bottom: 8px; }
.metric-inline { display: inline-flex; align-items: baseline; gap: 6px; }
.metric-inline b { font-size: 18px; font-weight: 650; color: var(--text); }
.sidebar-collapsed .sidebar-search { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1250px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .content { padding: 20px 18px 40px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-clock { display: none; }
  .quick-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .split-2, .split-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0, 0, 0, 0.5); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 55; }
  .main, body.sidebar-collapsed .main { margin-left: 0; }
  .mobile-menu-btn { display: inline-flex !important; }
  .sidebar-close-mobile { display: inline-flex !important; }
  .sidebar-collapse { display: none; }
  body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
  body.sidebar-collapsed .brand-word,
  body.sidebar-collapsed .sidebar-search,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-tag,
  body.sidebar-collapsed .nav-group-title { display: revert; }
  body.sidebar-collapsed .sidebar-head { justify-content: flex-start; padding: 0 14px 0 16px; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 8px 10px; }
  .topbar-status .status-chip:nth-child(2) { display: none; }
  .admin-chip-text { display: none; }
  .admin-chip > svg { display: none; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-grid-3 { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-grid { grid-template-columns: 1fr 1fr; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: auto; }
  .page-head h1 { font-size: 20px; }
  .page-actions { width: 100%; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .content { padding: 16px 12px 34px; }
  .metric-grid { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: 1fr; }
  .topbar-status { display: none; }
  .filter-bar { padding: 10px 12px; }
  .filter-bar .search-field { max-width: none; }
  .data-table th, .data-table td { padding: 9px 11px; }
  .page-head { margin-bottom: 16px; }
  .page-actions { gap: 6px; }
  .auth-card { padding: 24px 20px 22px; }
  .mobile-hide { display: none !important; }
  .pagination { justify-content: center; }
}
