/* ============================================================
   Cloud — Main Stylesheet
   Aesthetic: glass / clouds / sky — light & dark
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Syne:wght@400;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
  /* Light Mode — Daytime Sky */
  --sky-1:       #E8F4FD;   /* pale dawn */
  --sky-2:       #C5DFFB;   /* clear sky */
  --sky-3:       #93C5FD;   /* mid blue */
  --accent:      #3B82F6;   /* electric blue */
  --accent-glow: rgba(59,130,246,.28);
  --cloud-white: rgba(255,255,255,.72);
  --cloud-edge:  rgba(255,255,255,.35);
  --glass-bg:    rgba(255,255,255,.60);
  --glass-border:rgba(255,255,255,.55);
  --glass-shadow:0 8px 32px rgba(59,130,246,.12);
  --sidebar-bg:  rgba(235,246,255,.80);
  --text-1:      #0F172A;   /* near-black */
  --text-2:      #334155;
  --text-3:      #64748B;
  --text-inv:    #fff;
  --surface:     rgba(255,255,255,.75);
  --surface-2:   rgba(248,252,255,.85);
  --divider:     rgba(148,197,253,.30);
  --input-bg:    rgba(255,255,255,.70);
  --scrollbar:   #93C5FD;
  --danger:      #EF4444;
  --success:     #10B981;
  --warning:     #F59E0B;

  /* Layout */
  --sidebar-w:   240px;
  --topbar-h:    56px;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --radius-xl:   32px;

  /* Type */
  --font-display: 'Syne', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  /* Dark Mode — Midnight Sky */
  --sky-1:       #0A0F1E;
  --sky-2:       #0D1530;
  --sky-3:       #1A2548;
  --accent:      #60A5FA;
  --accent-glow: rgba(96,165,250,.30);
  --cloud-white: rgba(255,255,255,.08);
  --cloud-edge:  rgba(255,255,255,.06);
  --glass-bg:    rgba(15,23,55,.65);
  --glass-border:rgba(96,165,250,.18);
  --glass-shadow:0 8px 40px rgba(0,0,20,.55);
  --sidebar-bg:  rgba(10,15,35,.80);
  --text-1:      #F0F6FF;
  --text-2:      #CBD5E1;
  --text-3:      #64748B;
  --text-inv:    #0A0F1E;
  --surface:     rgba(15,23,55,.70);
  --surface-2:   rgba(13,21,48,.80);
  --divider:     rgba(96,165,250,.10);
  --input-bg:    rgba(15,23,55,.75);
  --scrollbar:   #1E3A5F;
}

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

html { height: 100%; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--sky-1);
  min-height: 100%;
  transition: background .35s var(--ease), color .35s var(--ease);
  overflow-x: hidden;
}

/* Sky gradient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, var(--sky-3) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, var(--sky-2) 0%, transparent 55%),
    linear-gradient(175deg, var(--sky-2) 0%, var(--sky-1) 100%);
  z-index: -2;
  transition: background .4s var(--ease);
}

/* Floating cloud blobs */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 300px 140px at 15% 30%, var(--cloud-white) 0%, transparent 80%),
    radial-gradient(ellipse 220px 100px at 75% 18%, var(--cloud-white) 0%, transparent 80%),
    radial-gradient(ellipse 350px 120px at 55% 75%, var(--cloud-edge) 0%, transparent 80%);
  z-index: -1;
  pointer-events: none;
}

/* ── Typography ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text-1);
  line-height: 1.25;
}
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: .9rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .8; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 99px; }

/* ── Glass card ── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-radius: var(--radius-lg);
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}

.glass:hover {
  box-shadow: var(--glass-shadow), 0 0 0 1px var(--accent-glow);
}

/* ── App Shell ── */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: background .3s var(--ease), transform .3s var(--ease);
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 20px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--divider);
}

.sidebar-logo .logo-mark {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--sky-3));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--accent-glow);
  flex-shrink: 0;
}

.sidebar-logo .logo-mark svg { width: 18px; height: 18px; fill: #fff; }
.sidebar-logo .logo-mark i { font-size: 18px; color: #fff; }
.sidebar-logo .app-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text-1); }

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section { padding: 0 12px; margin-bottom: 4px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-weight: 500;
  font-size: .87rem;
  transition: background .18s var(--ease), color .18s var(--ease);
  cursor: pointer;
  margin-bottom: 1px;
  text-decoration: none;
}

.nav-item:hover { background: var(--cloud-white); color: var(--text-1); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .75; }
.nav-item i { font-size: 15px; width: 16px; text-align: center; flex-shrink: 0; opacity: .75; }
.nav-item.active svg { opacity: 1; }

.nav-item .badge-count {
  margin-left: auto;
  background: var(--accent);
  color: var(--text-inv);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--divider);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .18s;
}
.sidebar-user:hover { background: var(--cloud-white); }
.sidebar-user .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--sky-3)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0; }
.sidebar-user .user-info { min-width: 0; }
.sidebar-user .user-name { font-size: .82rem; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: .73rem; color: var(--text-3); }

/* ── Main Content ── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--text-1); flex: 1; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 36px;
  width: 260px;
  transition: border-color .2s, box-shadow .2s;
}
.topbar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.topbar-search svg { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }
.topbar-search i { font-size: 13px; color: var(--text-3); flex-shrink: 0; }
.topbar-search input { border: none; background: none; color: var(--text-1); font-size: .87rem; width: 100%; outline: none; }
.topbar-search input::placeholder { color: var(--text-3); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Page Content ── */
.page-content { flex: 1; padding: 24px; overflow-y: auto; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: .87rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .18s var(--ease);
  line-height: 1;
  white-space: nowrap;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 4px 18px var(--accent-glow); }

.btn-ghost {
  background: var(--cloud-white);
  color: var(--text-2);
  border: 1px solid var(--divider);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-1); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-sm { padding: 5px 11px; font-size: .8rem; }
.btn-lg { padding: 11px 22px; font-size: .95rem; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* ── Form Elements ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.form-required { color: var(--danger); }

.input, .select, .textarea {
  background: var(--input-bg);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: .87rem;
  padding: 9px 13px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { resize: vertical; min-height: 100px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-open     { background: rgba(59,130,246,.15); color: #3B82F6; }
.badge-pending  { background: rgba(245,158,11,.15); color: #D97706; }
.badge-hold     { background: rgba(100,116,139,.15); color: #64748B; }
.badge-resolved { background: rgba(16,185,129,.15); color: #10B981; }
.badge-closed   { background: rgba(100,116,139,.20); color: #94A3B8; }
.badge-low      { background: rgba(100,116,139,.15); color: #64748B; }
.badge-medium   { background: rgba(59,130,246,.15); color: #3B82F6; }
.badge-high     { background: rgba(245,158,11,.15); color: #D97706; }
.badge-urgent   { background: rgba(239,68,68,.15); color: #EF4444; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--divider);
  transition: background .14s;
}
tbody tr:hover { background: var(--cloud-white); }
tbody td { padding: 11px 14px; color: var(--text-2); vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ── Cards ── */
.card { padding: 22px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-header h3 { margin: 0; }

/* ── Stat Cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card .stat-label { font-size: .78rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--text-1); line-height: 1; }
.stat-card .stat-sub { font-size: .78rem; color: var(--text-3); }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform .22s var(--ease);
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal-header { padding: 22px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-family: var(--font-display); font-size: 1.1rem; }
.modal-body { padding: 18px 24px; }
.modal-footer { padding: 0 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--divider); margin-bottom: 20px; }
.tab-btn {
  padding: 9px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .87rem;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .18s, border-color .18s;
}
.tab-btn:hover { color: var(--text-1); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Tag chip ── */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 8px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--cloud-white);
  border: 1px solid var(--divider);
  color: var(--text-2);
  white-space: nowrap;
}
.tag-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tag-chip .remove { cursor: pointer; opacity: .5; font-size: 10px; margin-left: 2px; }
.tag-chip .remove:hover { opacity: 1; }

/* ── Alerts / Flash ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: .87rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: rgba(16,185,129,.12); color: #10B981; border: 1px solid rgba(16,185,129,.25); }
.alert-error   { background: rgba(239,68,68,.12); color: #EF4444; border: 1px solid rgba(239,68,68,.25); }
.alert-info    { background: rgba(59,130,246,.12); color: #3B82F6; border: 1px solid rgba(59,130,246,.25); }

/* ── Theme toggle ── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--cloud-white);
  border: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: all .18s;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle i { font-size: 15px; }

/* ── Ticket detail ── */
.ticket-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.ticket-meta-item { display: flex; flex-direction: column; gap: 2px; }
.ticket-meta-item .meta-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.ticket-meta-item .meta-value { font-size: .87rem; color: var(--text-1); font-weight: 500; }

.reply-thread { display: flex; flex-direction: column; gap: 16px; }
.reply-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}
.reply-item.internal { border-color: rgba(245,158,11,.25); background: rgba(245,158,11,.05); }
.reply-item.system-note { opacity: .7; }
.reply-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--sky-3)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0; }
.reply-content { flex: 1; min-width: 0; }
.reply-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.reply-author { font-weight: 600; font-size: .87rem; color: var(--text-1); }
.reply-time { font-size: .78rem; color: var(--text-3); }
.reply-type-badge { font-size: .72rem; padding: 1px 7px; border-radius: 99px; }
.reply-type-forward { background: rgba(99,102,241,.15); color: #6366F1; }
.reply-type-note    { background: rgba(245,158,11,.15); color: #D97706; }
.reply-body { font-size: .9rem; color: var(--text-2); line-height: 1.65; white-space: pre-wrap; }

/* ── Department color swatch ── */
.dept-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state svg { width: 48px; height: 48px; color: var(--text-3); margin-bottom: 12px; }
.empty-state h3 { font-family: var(--font-display); color: var(--text-2); margin-bottom: 6px; }
.empty-state p { color: var(--text-3); font-size: .87rem; }

/* ── Setup Wizard ── */
.setup-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.setup-card {
  width: 100%;
  max-width: 560px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(59,130,246,.15);
  overflow: hidden;
}

.setup-header {
  padding: 32px 36px 24px;
  text-align: center;
  border-bottom: 1px solid var(--divider);
}
.setup-header .logo-lockup { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 24px; }
.setup-header .logo-mark-lg {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--sky-3));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px var(--accent-glow);
}
.setup-header .logo-mark-lg svg { width: 26px; height: 26px; fill: #fff; }
.setup-header .logo-mark-lg i { font-size: 24px; color: #fff; }
.setup-header .brand { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--text-1); }

.setup-steps { display: flex; justify-content: center; gap: 0; }
.setup-step {
  display: flex;
  align-items: center;
  gap: 6px;
}
.setup-step .step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  border: 2px solid var(--divider);
  color: var(--text-3);
  background: var(--surface);
  transition: all .25s;
}
.setup-step.done   .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.setup-step.active .step-dot { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.setup-step .step-line { width: 28px; height: 2px; background: var(--divider); }
.setup-step.done .step-line { background: var(--accent); }

.setup-body { padding: 28px 36px 32px; }

/* Theme picker */
.theme-picker { display: flex; gap: 12px; }
.theme-option {
  flex: 1;
  border: 2px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  text-align: center;
  transition: all .18s;
  position: relative;
}
.theme-option input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.theme-option:has(input:checked) { border-color: var(--accent); background: var(--accent-glow); }
.theme-option .theme-preview {
  height: 64px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid rgba(0,0,0,.08);
}
.theme-light-preview { background: linear-gradient(135deg, #E8F4FD 0%, #C5DFFB 100%); }
.theme-dark-preview  { background: linear-gradient(135deg, #0A0F1E 0%, #1A2548 100%); }
.theme-option .theme-label { font-size: .82rem; font-weight: 600; color: var(--text-2); }

/* ── Sidebar mobile toggle ── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-1);
  padding: 4px;
}

/* ── Color swatch input ── */
.color-input-row { display: flex; align-items: center; gap: 10px; }
.color-input-row input[type=color] { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1.5px solid var(--divider); cursor: pointer; padding: 2px; background: var(--input-bg); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .page-content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .setup-header, .setup-body { padding-left: 20px; padding-right: 20px; }
}
