/* ============================================================
   Admin Dashboard — Design System
   Ocean Blue Theme · Modern · Responsive
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ===================== TOKENS ===================== */
:root {
  /* Ocean Blue Palette */
  --accent: #0ea5e9;
  --accent-light: #38bdf8;
  --accent-dark: #0284c7;
  --accent-glow: rgba(14, 165, 233, 0.15);
  --accent-glow-strong: rgba(14, 165, 233, 0.25);
  --accent-text: #7dd3fc;
  --accent-muted: rgba(14, 165, 233, 0.6);

  /* Cyan secondary */
  --secondary: #06b6d4;
  --secondary-glow: rgba(6, 182, 212, 0.12);

  /* Surfaces */
  --bg-body: #09090b;
  --bg-card: rgba(24, 24, 27, 0.50);
  --bg-card-solid: #18181b;
  --bg-elevated: rgba(24, 24, 27, 0.70);
  --bg-input: rgba(9, 9, 11, 0.80);
  --bg-nav: rgba(9, 9, 11, 0.88);
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-inset: rgba(0, 0, 0, 0.20);

  /* Text */
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-faint: #52525b;
  --text-inverted: #09090b;

  /* Borders */
  --border: rgba(63, 63, 70, 0.50);
  --border-light: rgba(63, 63, 70, 0.30);
  --border-accent: rgba(14, 165, 233, 0.30);

  /* Danger */
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.12);
  --danger-text: #fca5a5;
  --danger-border: rgba(239, 68, 68, 0.30);

  /* Warning */
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.12);

  /* Success */
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.12);

  /* Blue info */
  --info: #3b82f6;
  --info-glow: rgba(59, 130, 246, 0.12);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-accent: 0 0 20px var(--accent-glow);
  --shadow-glow: 0 0 30px var(--accent-glow), 0 0 60px var(--accent-glow);

  /* Transitions */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --nav-width: 250px;
  --nav-height-mobile: 68px;
  --content-max: 1200px;
}

/* ===================== BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: rgba(14, 165, 233, 0.30); color: #e0f2fe; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -16px) scale(1.04); }
  66% { transform: translate(-10px, 10px) scale(0.98); }
}

.fade-in { animation: fadeIn 0.4s var(--ease-out) both; }

/* ===================== BACKGROUND ===================== */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: blob-float 14s ease-in-out infinite;
}
.bg-orbs .orb-1 {
  width: 420px; height: 420px;
  top: -80px; left: -60px;
  background: var(--accent-glow-strong);
}
.bg-orbs .orb-2 {
  width: 500px; height: 500px;
  bottom: -10%; right: -10%;
  background: var(--secondary-glow);
  animation-delay: -6s;
}
.bg-orbs .overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.55);
}

/* ===================== GLASS ===================== */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ===================== LAYOUT: NAV ===================== */
.app-nav {
  position: fixed;
  z-index: 50;
  /* Mobile: bottom bar */
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height-mobile);
  border-top: 1px solid var(--border);
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-brand {
  display: none;
}

.nav-links {
  display: flex;
  flex-direction: row;
  flex: 1;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  gap: 2px;
  overflow-x: auto;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: var(--radius-lg);
  max-width: 72px;
  width: 100%;
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
  user-select: none;
  color: var(--text-muted);
  position: relative;
}
.nav-link:active { transform: scale(0.93); }
.nav-link .nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.nav-link .nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}
.nav-link:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.nav-footer { display: none; }

/* Desktop sidebar */
@media (min-width: 1024px) {
  body { padding-left: var(--nav-width); padding-bottom: 0; }

  .app-nav {
    top: 0; bottom: 0; right: auto;
    width: var(--nav-width);
    height: auto;
    border-top: none;
    border-right: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0;
  }

  .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 22px;
    border-bottom: 1px solid var(--border-light);
  }
  .nav-brand-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    background: var(--accent-glow);
    display: grid;
    place-items: center;
    border: 1px solid var(--border-accent);
  }
  .nav-brand-icon svg { width: 20px; height: 20px; color: var(--accent-light); }
  .nav-brand-text { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }

  .nav-links {
    flex-direction: column;
    justify-content: flex-start;
    padding: 16px 14px;
    gap: 4px;
    overflow: visible;
  }

  .nav-link {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 14px;
    max-width: none;
    border-radius: var(--radius-md);
  }
  .nav-link .nav-label {
    font-size: 13.5px;
    letter-spacing: 0;
  }

  .nav-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
  }
  .nav-footer-label { font-size: 12px; color: var(--text-muted); flex: 1; }
}

/* Mobile bottom padding */
@media (max-width: 1023px) {
  body { padding-bottom: calc(var(--nav-height-mobile) + 8px); }
}

/* ===================== LAYOUT: MAIN ===================== */
.app-main {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 24px;
  max-width: var(--content-max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

@media (min-width: 1024px) {
  .app-main { padding: 32px 32px 40px; }
}

/* ===================== TABS ===================== */
.tab-content { display: none; }
.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  animation: fadeInScale 0.3s var(--ease-out) both;
}

/* ===================== PAGE HEADER ===================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-header .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===================== CARDS ===================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-lg { border-radius: var(--radius-2xl); padding: 24px; }
.card-flush { padding: 0; }
.card-static:hover { transform: none; box-shadow: none; }

/* Card with accent border */
.card-accent { border-color: var(--border-accent); }
.card-danger { border-color: var(--danger-border); }

/* Card glow decorations */
.card-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

/* ===================== STAT CARDS ===================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  composes: card;
  padding: 16px 18px;
}
.stat-card .stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.stat-card .stat-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.stat-card .stat-suffix {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ===================== STATUS PILL ===================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
}
.status-dot {
  position: relative;
  width: 10px; height: 10px;
}
.status-dot .dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--danger);
}
.status-dot .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse-ring 1.5s ease-out infinite;
}
.status-dot.online .dot, .status-dot.online .ring { background: var(--success); }
.status-dot.connecting .dot, .status-dot.connecting .ring { background: var(--warning); }
.status-text {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.status-link {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  margin-left: 4px;
  transition: color var(--duration-fast) ease;
}
.status-link:hover { color: var(--accent); }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.btn-primary {
  background: var(--accent);
  color: var(--text-inverted);
  font-weight: 700;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-light); }

.btn-secondary {
  background: var(--bg-card-solid);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) { background: #27272a; border-color: var(--text-faint); }

.btn-danger {
  background: var(--danger-glow);
  border-color: var(--danger-border);
  color: var(--danger-text);
}
.btn-danger:hover:not(:disabled) { background: var(--danger); color: white; }

.btn-ghost {
  color: var(--text-muted);
  padding: 8px 14px;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-secondary); }

.btn-accent-ghost {
  background: var(--accent-glow);
  border-color: var(--border-accent);
  color: var(--accent-text);
}
.btn-accent-ghost:hover:not(:disabled) { background: var(--accent-glow-strong); }

.btn-icon {
  padding: 8px; width: 36px; height: 36px;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ===================== FORM INPUTS ===================== */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  outline: none;
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-faint);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input-icon {
  position: relative;
}
.form-input-icon .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}
.form-input-icon .form-input {
  padding-left: 40px;
}

.form-textarea { resize: none; }

/* ===================== TABLES ===================== */
.table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 63, 70, 0.7) transparent;
}
.table-wrap::-webkit-scrollbar { height: 6px; width: 6px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(63, 63, 70, 0.7);
  border-radius: var(--radius-full);
}

.data-table {
  width: 100%;
  text-align: left;
  font-size: 13px;
  border-collapse: collapse;
  white-space: nowrap;
}
.data-table thead { position: sticky; top: 0; z-index: 10; }
.data-table th {
  padding: 12px 18px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-card-solid);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 18px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}
.data-table tbody tr {
  transition: background var(--duration-fast) ease;
}
.data-table tbody tr:hover {
  background: var(--bg-hover);
}
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ===================== TOAST ===================== */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
  width: 90vw;
  max-width: 400px;
}
.toast-container.visible { pointer-events: auto; }
.toast-container.visible .toast-card { animation: slideDown 0.35s var(--ease-out) both; }

.toast-card {
  pointer-events: auto;
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-xl);
}
.toast-icon { flex-shrink: 0; margin-top: 2px; }
.toast-icon .icon-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.toast-icon .icon-circle svg { width: 16px; height: 16px; }
.toast-icon.error .icon-circle { background: var(--danger-glow); color: var(--danger); }
.toast-icon.success .icon-circle { background: var(--success-glow); color: var(--success); }
.toast-icon.info .icon-circle { background: var(--accent-glow); color: var(--accent); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.toast-msg { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; word-break: break-word; }
.toast-close {
  flex-shrink: 0;
  color: var(--text-faint);
  padding: 4px;
  transition: color var(--duration-fast) ease;
}
.toast-close:hover { color: var(--text-secondary); }
.toast-close svg { width: 14px; height: 14px; }

/* ===================== DIALOG MODAL ===================== */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dialog-overlay.visible { display: flex; }

.dialog-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 28px;
  box-shadow: var(--shadow-xl);
  max-width: 400px;
  width: 100%;
  animation: fadeInScale 0.25s var(--ease-out) both;
}
.dialog-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.dialog-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }
.dialog-actions { display: flex; gap: 12px; }
.dialog-actions .btn { flex: 1; padding: 12px; }

/* ===================== SPINNER ===================== */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
.spinner-dark {
  border-color: rgba(9, 9, 11, 0.25);
  border-top-color: var(--text-inverted);
}

/* ===================== CHECKBOX ===================== */
.custom-checkbox {
  appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--text-faint);
  border-radius: 5px;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  flex-shrink: 0;
}
.custom-checkbox::before {
  content: "";
  width: 10px; height: 10px;
  transform: scale(0);
  transition: transform 0.2s var(--ease-spring);
  box-shadow: inset 1em 1em var(--accent);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.custom-checkbox:checked { border-color: var(--accent); }
.custom-checkbox:checked::before { transform: scale(1); }

/* ===================== SKELETON ===================== */
.skeleton {
  background: linear-gradient(90deg, rgba(63,63,70,0.4) 25%, rgba(82,82,91,0.6) 50%, rgba(63,63,70,0.4) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-row {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}

/* ===================== CHART ===================== */
.chart-wrapper {
  position: relative;
  height: 165px;
  width: 100%;
}
.chart-wrapper canvas { display: block; }

/* ===================== MONTH BADGE ===================== */
.month-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid var(--border-accent);
  background: var(--accent-glow);
  color: var(--accent-text);
}

/* ===================== MONTH NAV ===================== */
.month-nav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}
.month-nav-btn:hover:not(:disabled) {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.month-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.month-nav-btn svg { width: 14px; height: 14px; }

/* ===================== THEME TOGGLE ===================== */
.theme-toggle {
  width: 44px; height: 24px;
  background: rgba(63, 63, 70, 0.5);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s var(--ease-out);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.theme-toggle.on { background: var(--accent-glow-strong); border-color: var(--border-accent); }
.theme-toggle.on::after { transform: translateX(20px); background: var(--accent); }

/* ===================== SECTION HEADER + CARD HEADER ===================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title svg { width: 16px; height: 16px; color: var(--accent); }
.section-meta { font-size: 12px; color: var(--text-muted); }

.card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.card-label-accent { color: var(--accent-muted); }

/* ===================== GRID HELPERS ===================== */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
.grid-5 { display: grid; grid-template-columns: 1fr; gap: 20px; }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3-2 { grid-template-columns: 2fr 1fr; }
}
@media (min-width: 1024px) {
  .grid-5 { grid-template-columns: 3fr 2fr; }
}

/* ===================== SETTINGS CARD ===================== */
.settings-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}
.settings-card-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-card-icon svg { width: 18px; height: 18px; }
.settings-card-icon.accent { background: var(--accent-glow); color: var(--accent); }
.settings-card-icon.info { background: var(--info-glow); color: var(--info); }
.settings-card-icon.cyan { background: var(--secondary-glow); color: var(--secondary); }
.settings-card-icon.danger { background: var(--danger-glow); color: var(--danger); }

.settings-card-title { font-size: 14px; font-weight: 700; }
.settings-card-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===================== ACTION LINK ===================== */
.action-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast) ease;
}
.action-link:hover {
  border-color: var(--border-accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.action-link-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  background: rgba(63, 63, 70, 0.4);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all var(--duration-fast) ease;
  flex-shrink: 0;
}
.action-link:hover .action-link-icon {
  background: var(--accent-glow);
  color: var(--accent);
}
.action-link-icon svg { width: 20px; height: 20px; }
.action-link-body { flex: 1; min-width: 0; }
.action-link-title { font-size: 14px; font-weight: 600; transition: color var(--duration-fast) ease; }
.action-link:hover .action-link-title { color: var(--accent-text); }
.action-link-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.action-link-arrow {
  width: 16px; height: 16px;
  color: var(--text-faint);
  flex-shrink: 0;
  transform: rotate(-45deg);
  transition: color var(--duration-fast) ease;
}
.action-link:hover .action-link-arrow { color: var(--accent); }

/* ===================== TERMINAL ===================== */
.terminal {
  background: #0a0a0c;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.7;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  scroll-behavior: smooth;
  color: var(--text-secondary);
}

/* ===================== ACCOUNT STRIP ===================== */
.account-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.account-strip svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.account-strip .label { font-size: 12px; color: var(--text-muted); }
.account-strip .value { font-size: 13px; font-weight: 600; color: var(--accent-text); }

/* ===================== HERO BALANCE ===================== */
.hero-balance {
  position: relative;
  padding: 28px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-balance .hero-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-muted);
  margin-bottom: 12px;
}
.hero-balance .hero-amount {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}
@media (min-width: 640px) {
  .hero-balance .hero-amount { font-size: 44px; }
}
.hero-balance .hero-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.hero-balance .hero-meta svg { width: 14px; height: 14px; }

/* ===================== DANGER ZONE ===================== */
.danger-zone {
  position: relative;
  background: rgba(239, 68, 68, 0.03);
}
.danger-zone .dz-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--danger-border);
  margin-bottom: 20px;
}
.danger-zone .dz-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 640px) {
  .danger-zone .dz-body {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.dz-title { font-size: 14px; font-weight: 700; color: var(--danger-text); }
.dz-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.6; max-width: 420px; }

/* ===================== CONNECTION PAGE ===================== */
.conn-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 768px) {
  .conn-grid { grid-template-columns: 1fr 1fr; }
}

.qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 340px;
  padding: 30px;
}
.qr-placeholder-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(63, 63, 70, 0.3);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--text-faint);
}
.qr-placeholder-icon svg { width: 32px; height: 32px; }
.qr-placeholder-text { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ===================== FLEX HELPERS ===================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }

/* ===================== SPACING ===================== */
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ===================== TYPOGRAPHY ===================== */
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger-text); }
.italic { font-style: italic; }
.hidden { display: none !important; }

/* ===================== SCROLLBAR GLOBAL ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(63, 63, 70, 0.6);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(82, 82, 91, 0.8); }

/* ===================== LIGHT MODE ===================== */
.light-mode {
  --bg-body: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-solid: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.85);
  --bg-input: rgba(241, 245, 249, 0.9);
  --bg-nav: rgba(255, 255, 255, 0.92);
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-inset: rgba(0, 0, 0, 0.04);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --border: rgba(148, 163, 184, 0.35);
  --border-light: rgba(148, 163, 184, 0.2);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.light-mode body { background: var(--bg-body); color: var(--text-primary); }
.light-mode .glass { box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06); }
.light-mode .terminal { background: #1e293b; }
.light-mode .skeleton {
  background: linear-gradient(90deg, rgba(203,213,225,.5) 25%, rgba(226,232,240,.8) 50%, rgba(203,213,225,.5) 75%);
  background-size: 200% 100%;
}

/* ===================== LOGIN PAGE ===================== */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 36px;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-xl);
  transition: border-color var(--duration-slow) ease;
}
.login-card:hover { border-color: rgba(63, 63, 70, 0.6); }

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-glow), rgba(6, 182, 212, 0.08));
  border: 1px solid var(--border-accent);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow-accent);
}
.login-logo-icon svg { width: 32px; height: 32px; color: var(--accent-light); filter: drop-shadow(0 0 8px var(--accent-glow-strong)); }
.login-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.login-subtitle { font-size: 13px; color: var(--text-muted); }

.login-form { display: flex; flex-direction: column; gap: 18px; }

.login-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.login-extras label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}
.login-extras label:hover { color: var(--text-secondary); }
.login-check-api {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-muted);
  transition: color var(--duration-fast) ease;
}
.login-check-api:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.login-submit {
  position: relative;
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--text-inverted);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  overflow: hidden;
  transition: all var(--duration-normal) ease;
  box-shadow: var(--shadow-accent);
}
.login-submit:hover { background: var(--accent-light); }
.login-submit:active { transform: scale(0.98); }
.login-submit .sweep {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(100%);
  transition: transform var(--duration-normal) ease-out;
}
.login-submit:hover .sweep { transform: translateY(0); }

.login-footer {
  text-align: center;
  margin-top: 24px;
  opacity: 0.5;
  font-size: 11px;
  color: var(--text-muted);
}

/* Password toggle */
.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  transition: color var(--duration-fast) ease;
}
.pw-toggle:hover { color: var(--accent); }
.pw-toggle svg { width: 20px; height: 20px; }

/* ===================== INLINE CODE ===================== */
code.inline {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  background: rgba(63, 63, 70, 0.4);
  color: var(--accent-text);
  padding: 2px 7px;
  border-radius: 4px;
}

/* ===================== DIVIDER ===================== */
.divider { height: 1px; background: var(--border-light); width: 100%; }
