/* ==========================================================================
   SpeedProxy - 全站设计系统 v2.0
   Modern Tech Dashboard · 暗色优先 · 8px 网格 · 数据驱动
   ========================================================================== */

/* ── Design Tokens ── */
:root {
  /* === Surface (层次系统) === */
  --surface-0: #09090b;          /* page bg */
  --surface-1: #0d0d10;          /* sidebar / panel */
  --surface-2: #131316;          /* card */
  --surface-3: #1a1a1f;          /* card hover / nested */
  --surface-4: #232328;          /* input */
  --surface-inset: #050507;      /* 凹陷 */

  /* === Border === */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(6, 182, 212, 0.50);

  /* === Text === */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-muted: #52525b;
  --text-inverse: #09090b;

  /* === Accent (单一强调色) === */
  --accent-50: #ecfeff;
  --accent-100: #cffafe;
  --accent-200: #a5f3fc;
  --accent-400: #22d3ee;
  --accent-500: #06b6d4;
  --accent-600: #0891b2;
  --accent-700: #0e7490;

  /* === Semantic === */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);
  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.12);

  /* === Brand Gradient === */
  --brand-grad: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --success-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --danger-grad: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gold-grad: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);

  /* === Shadows === */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 0 1px rgba(6, 182, 212, 0.20), 0 8px 24px rgba(6, 182, 212, 0.15);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-card-hover: 0 10px 40px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.25);
  --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.1), 0 0 60px rgba(6, 182, 212, 0.05);
  --shadow-glow-purple: 0 0 20px rgba(168, 85, 247, 0.1), 0 0 60px rgba(168, 85, 247, 0.05);

  /* === Radius === */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;
  --r-full: 9999px;

  /* === Spacing (8px grid) === */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* === Typography === */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, 'Courier New', monospace;

  --t-xs: 11px;
  --t-sm: 12px;
  --t-base: 14px;
  --t-md: 15px;
  --t-lg: 16px;
  --t-xl: 18px;
  --t-2xl: 22px;
  --t-3xl: 28px;
  --t-4xl: 36px;
  --t-5xl: 48px;

  /* === Motion === */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --d-fast: 120ms;
  --d-base: 200ms;
  --d-slow: 320ms;

  /* === Layout === */
  --nav-h: 60px;
  --sidebar-w: 240px;
  --container: 1280px;
}

/* ════════════════════════════════════════════════════════════════════════
   Reset & Base
   ════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.6;
  background: var(--surface-0);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

::selection {
  background: rgba(6, 182, 212, 0.3);
  color: var(--accent-100);
}

a {
  color: var(--accent-400);
  text-decoration: none;
  transition: color var(--d-fast) var(--ease-out);
}
a:hover { color: var(--accent-200); }

button {
  font-family: inherit;
  cursor: pointer;
}

img, svg { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-4);
  border-radius: var(--r-full);
  border: 2px solid var(--surface-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════════════
   Layout
   ════════════════════════════════════════════════════════════════════════ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  position: relative;
}

@media (max-width: 768px) {
  .container { padding: 0 var(--sp-4); }
}

/* ════════════════════════════════════════════════════════════════════════
   Navbar
   ════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(13, 13, 16, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03);
}

.nav-inner {
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--t-lg);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.nav-logo:hover { color: var(--text-primary); }

.nav-logo .logo-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  background: var(--brand-grad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: var(--shadow-glow);
}

.nav-logo .logo-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  color: var(--text-secondary);
  font-size: var(--t-base);
  font-weight: 500;
  border-radius: var(--r-md);
  transition: all var(--d-fast) var(--ease-out);
}
.nav-links a:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}
.nav-links a.active {
  color: var(--text-primary);
  background: var(--surface-3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  font-size: 18px;
  align-items: center;
  justify-content: center;
}
.menu-toggle:hover { background: var(--surface-2); }

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-3);
    gap: var(--sp-1);
    transform: translateY(-110%);
    transition: transform var(--d-base) var(--ease-out);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 10px 14px; }
  .menu-toggle { display: inline-flex; }
}

/* ════════════════════════════════════════════════════════════════════════
   Buttons
   ════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: var(--t-base);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all var(--d-fast) var(--ease-out);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
  color: var(--text-inverse);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn-accent {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.25);
}
.btn-accent:hover {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.35);
}
.btn-accent:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.08));
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.08));
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}
.btn-success:hover { background: rgba(16, 185, 129, 0.2); }

.btn-outline {
  background: transparent;
  color: var(--accent-400);
  border-color: rgba(6, 182, 212, 0.4);
}
.btn-outline:hover {
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-200);
  border-color: rgba(6, 182, 212, 0.6);
}

.btn-sm  { padding: 6px 12px; font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn-lg  { padding: 12px 22px; font-size: var(--t-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }

/* ════════════════════════════════════════════════════════════════════════
   Card (Glassmorphism + 微光效)
   ════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-card);
  transition: all var(--d-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}
.card-hover:hover {
  border-color: var(--border-default);
  background: var(--surface-3);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.card-flat { box-shadow: none; }
.card-elevated {
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}
.card-glass {
  background: rgba(19, 19, 22, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}
.card-title {
  font-size: var(--t-lg);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  letter-spacing: -0.01em;
}
.card-subtitle {
  font-size: var(--t-sm);
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════════════════
   Form
   ════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: var(--t-base);
  font-family: inherit;
  transition: all var(--d-fast) var(--ease-out);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:hover, .form-select:hover { border-color: var(--border-strong); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15), inset 0 1px 2px rgba(0,0,0,0.2);
}
.form-textarea { min-height: 90px; resize: vertical; }

.form-error {
  font-size: var(--t-sm);
  color: var(--danger);
  margin-top: var(--sp-1);
  display: none;
}
.form-error.show { display: block; }

.form-hint {
  font-size: var(--t-sm);
  color: var(--text-tertiary);
  margin-top: var(--sp-1);
}

.input-group {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ════════════════════════════════════════════════════════════════════════
   Badge & Status
   ════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
}
.badge-success { background: var(--success-bg); color: var(--success); border-color: rgba(16, 185, 129, 0.25); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(245, 158, 11, 0.25); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(239, 68, 68, 0.25); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border-color: rgba(59, 130, 246, 0.25); }
.badge-purple  { background: var(--purple-bg);  color: var(--purple);  border-color: rgba(168, 85, 247, 0.25); }
.badge-neutral { background: var(--surface-3);  color: var(--text-secondary); border-color: var(--border-default); }

.badge-dot {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 500;
}
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* ════════════════════════════════════════════════════════════════════════
   Tables
   ════════════════════════════════════════════════════════════════════════ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-responsive table {
  min-width: 600px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
}
th, td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
th {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr {
  transition: background var(--d-fast) var(--ease-out);
}
tbody tr:hover { background: var(--surface-3); }
td { color: var(--text-secondary); }

.table-empty {
  text-align: center;
  padding: var(--sp-12) var(--sp-4);
  color: var(--text-muted);
  font-size: var(--t-sm);
}

/* ════════════════════════════════════════════════════════════════════════
   Toast
   ════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: calc(var(--nav-h) + var(--sp-4));
  right: var(--sp-6);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-left-width: 3px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--t-sm);
  animation: slideInRight var(--d-base) var(--ease-out);
  backdrop-filter: blur(10px);
}
.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-info    { border-left-color: var(--info); }
.toast-warning { border-left-color: var(--warning); }

@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  to { transform: translateX(110%); opacity: 0; }
}

/* ════════════════════════════════════════════════════════════════════════
   Modal
   ════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-base) var(--ease-out);
  padding: var(--sp-4);
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: rgba(13, 13, 16, 0.95);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: scale(0.96) translateY(8px);
  transition: transform var(--d-base) var(--ease-out);
}
.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.modal-title {
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--surface-3); color: var(--text-primary); }
.modal-actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
  margin-top: var(--sp-5);
}

/* ════════════════════════════════════════════════════════════════════════
   Footer
   ════════════════════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-10) 0;
  margin-top: var(--sp-16);
  background: var(--surface-1);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.footer-copy {
  font-size: var(--t-sm);
  color: var(--text-tertiary);
}
.footer-links {
  display: flex;
  gap: var(--sp-5);
  list-style: none;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-secondary);
  font-size: var(--t-sm);
}
.footer-links a:hover { color: var(--text-primary); }

/* ════════════════════════════════════════════════════════════════════════
   Background decoration (kept, but subtler)
   ════════════════════════════════════════════════════════════════════════ */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-glow::before, .bg-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: glowPulse 8s ease-in-out infinite alternate;
}
.bg-glow::before {
  top: -10%;
  left: -10%;
  width: 480px;
  height: 480px;
  background: rgba(6, 182, 212, 0.18);
}
.bg-glow::after {
  bottom: -10%;
  right: -10%;
  width: 520px;
  height: 520px;
  background: rgba(59, 130, 246, 0.14);
  animation-delay: -4s;
}

@keyframes glowPulse {
  0% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 0.5; transform: scale(1.1); }
}

/* ════════════════════════════════════════════════════════════════════════
   Utility
   ════════════════════════════════════════════════════════════════════════ */
.text-mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }
.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent-400); }

.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--sp-4) 0;
}
.divider-v { width: 1px; height: 1em; background: var(--border-default); display: inline-block; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   Skeleton
   ════════════════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-3) 0%,
    var(--surface-4) 50%,
    var(--surface-3) 100%
  );
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ════════════════════════════════════════════════════════════════════════
   Reduced motion
   ════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ════════════════════════════════════════════════════════════════════════
   Progress bar
   ════════════════════════════════════════════════════════════════════════ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}
.progress-bar .progress {
  height: 100%;
  background: var(--accent-500);
  border-radius: var(--r-full);
  transition: width var(--d-slow) var(--ease-out);
}
.progress-bar .progress.warning { background: var(--warning); }
.progress-bar .progress.danger { background: var(--danger); }
.progress-bar .progress.gradient { background: var(--brand-grad); }

/* ════════════════════════════════════════════════════════════════════════
   Status dot
   ════════════════════════════════════════════════════════════════════════ */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  animation: pulse 2s infinite var(--ease-in-out);
}
.status-dot.slow {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.status-dot.offline {
  background: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(82, 82, 91, 0.15);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ════════════════════════════════════════════════════════════════════════
   Tabs (kept compatible with .tabs / .tab-btn / .tab-content)
   ════════════════════════════════════════════════════════════════════════ */
.tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 3px;
  margin-bottom: var(--sp-5);
  overflow-x: auto;
  max-width: 100%;
}
.tab-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: var(--t-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--d-fast) var(--ease-out);
  font-family: inherit;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  background: var(--surface-4);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}
.tab-content { display: none; }
.tab-content.active {
  display: block;
  animation: fadeIn var(--d-base) var(--ease-out);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════════════════
   FAQ
   ════════════════════════════════════════════════════════════════════════ */
.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
  overflow: hidden;
  background: var(--surface-2);
  transition: border-color var(--d-fast);
}
.faq-item:hover { border-color: var(--border-default); }
.faq-item.open {
  border-color: var(--border-default);
  background: var(--surface-3);
}
.faq-question {
  width: 100%;
  padding: var(--sp-4);
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: var(--t-base);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  font-family: inherit;
}
.faq-question .arrow {
  transition: transform var(--d-base) var(--ease-out);
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.faq-item.open .faq-question .arrow { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--d-slow) var(--ease-out);
}
.faq-answer-inner {
  padding: 0 var(--sp-4) var(--sp-4);
  color: var(--text-secondary);
  font-size: var(--t-sm);
  line-height: 1.75;
}

/* ════════════════════════════════════════════════════════════════════════
   Stat / Metric
   ════════════════════════════════════════════════════════════════════════ */
.metric {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  transition: all var(--d-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.metric::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}
.metric:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.metric-label {
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.metric-value {
  font-size: var(--t-3xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-feature-settings: 'tnum';
  color: var(--text-primary);
}
.metric-sub {
  font-size: var(--t-xs);
  color: var(--text-tertiary);
}
.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--t-xs);
  font-weight: 500;
}
.metric-trend.up { color: var(--success); }
.metric-trend.down { color: var(--danger); }

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
}

/* ════════════════════════════════════════════════════════════════════════
   Code / mono block
   ════════════════════════════════════════════════════════════════════════ */
.mono-block {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════════════
   Action group
   ════════════════════════════════════════════════════════════════════════ */
.action-group {
  display: inline-flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}