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

/* ── TOKENS ───────────────────────────────────────────────── */
:root {
  --brand:      #5865F2;
  --brand-dim:  rgba(88,101,242,.08);
  --brand-dim2: rgba(88,101,242,.15);
  --green:      #22c55e; --green-dim:  rgba(34,197,94,.08);
  --red:        #ef4444; --red-dim:    rgba(239,68,68,.08);
  --yellow:     #f59e0b; --yellow-dim: rgba(245,158,11,.08);
  --cyan:       #06b6d4; --cyan-dim:   rgba(6,182,212,.08);
  --purple:     #8b5cf6; --purple-dim: rgba(139,92,246,.08);
  --r:          6px;
  --sidebar-w:  220px;
}

/* ── DARK THEME (default) ─────────────────────────────────── */
:root, [data-theme="dark"] {
  --bg:       #0a0a0a;
  --bg2:      #111111;
  --surface:  #141414;
  --surface2: #1c1c1c;
  --border:   #2a2a2a;
  --border2:  #383838;
  --text:     #e8e8ea;
  --muted:    #888888;
  --muted2:   #555555;
  --shadow:   0 1px 2px rgba(0,0,0,.5);
  --input-bg: #0f0f0f;
}

/* ── LIGHT THEME ──────────────────────────────────────────── */
[data-theme="light"] {
  --bg:       #f5f5f5;
  --bg2:      #eeeeee;
  --surface:  #ffffff;
  --surface2: #f9f9f9;
  --border:   #e5e5e5;
  --border2:  #d4d4d4;
  --text:     #0a0a0a;
  --muted:    #737373;
  --muted2:   #a3a3a3;
  --shadow:   0 1px 2px rgba(0,0,0,.06);
  --input-bg: #fafafa;
}

/* ── BASE ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
  line-height: 1.5;
  transition: background .15s, color .15s;
}

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── KEYFRAMES ────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes pulse   { 0%,100% { opacity:1; } 50% { opacity:.4; } }
@keyframes fadeUp  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes slideIn { from { transform:translateX(110%); opacity:0; } to { transform:none; opacity:1; } }

/* ── LAYOUT ───────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .2s ease, background .15s, border-color .15s;
}

/* ── NEW SIDEBAR COMPONENTS ───────────────────────────────── */
.sb-logo {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sb-logo-icon {
  width: 28px; height: 28px;
  background: var(--brand);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sb-logo-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}

.sb-nav { flex: 1; padding: 6px 0; overflow-y: auto; }

.sb-section {
  padding: 16px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted2);
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .1s, background .1s, border-color .1s;
  cursor: pointer;
}

.sb-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .8; }
.sb-item:hover { color: var(--text); background: var(--surface2); }
.sb-item.active {
  color: var(--brand);
  background: var(--brand-dim);
  border-left-color: var(--brand);
  font-weight: 600;
}
.sb-item.active svg { opacity: 1; }

.sb-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.sb-user { display: flex; align-items: center; gap: 8px; }

.sb-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0; overflow: hidden;
}

.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-userinfo { flex: 1; min-width: 0; }

.sb-username {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sb-plan { font-size: 11px; color: var(--muted2); margin-top: 1px; }

.sb-icon-btn {
  width: 26px; height: 26px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color .1s, background .1s, border-color .1s;
  text-decoration: none;
  flex-shrink: 0;
  font-family: inherit;
}
.sb-icon-btn:hover { color: var(--text); background: var(--surface2); border-color: var(--border2); }

/* ── LEGACY SIDEBAR CLASSES ───────────────────────────────── */
.sidebar-logo {
  padding: 16px 14px;
  display: flex; align-items: center; gap: 9px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-text { font-size: 14px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.sidebar-logo-icon {
  width: 28px; height: 28px;
  background: var(--brand); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-logo-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted2);
  background: var(--surface2); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 3px; margin-left: auto;
}
.sidebar-section {
  padding: 16px 14px 4px;
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted2);
}
.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  color: var(--muted); text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .1s, background .1s, border-color .1s;
}
.nav-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .8; }
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link.active {
  color: var(--brand); background: var(--brand-dim);
  border-left-color: var(--brand); font-weight: 600;
}
.sidebar-footer { padding: 10px 14px; border-top: 1px solid var(--border); margin-top: auto; }
.user-card {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--r);
  border: 1px solid var(--border);
  cursor: pointer; transition: border-color .1s;
}
.user-card:hover { border-color: var(--border2); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── MAIN ─────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  transition: background .15s;
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 10px;
  position: sticky; top: 0; z-index: 30;
  transition: background .15s, border-color .15s;
}

.topbar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.topbar-spacer { flex: 1; }

/* ── CONTENT ──────────────────────────────────────────────── */
.content { padding: 24px; flex: 1; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: background .15s, border-color .15s;
}

.card-glass { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.card-glow  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; }

.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
}

.accent-top { position: relative; }
.accent-top::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--border2);
  border-radius: var(--r) var(--r) 0 0;
}

/* ── STAT CARDS ───────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow);
  transition: border-color .1s;
}
.stat-card:hover { border-color: var(--border2); }

.stat-label  { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted2); }
.stat-value  { font-size: 26px; font-weight: 700; font-family: 'JetBrains Mono', monospace; letter-spacing: -.04em; line-height: 1; color: var(--text); }
.stat-icon   { width: 28px; height: 28px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 14px; height: 14px; }
.stat-delta  { font-size: 11px; font-weight: 600; color: var(--green); }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; font-family: 'Inter', sans-serif;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; transition: background .1s, border-color .1s, color .1s;
  white-space: nowrap; letter-spacing: -.01em;
  line-height: 1.4;
}

.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { background: #4a55e0; border-color: #4a55e0; }

.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover:not(:disabled) { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface2); color: var(--text); border-color: var(--border2); }

.btn-danger { color: var(--red); background: transparent; border-color: rgba(239,68,68,.2); }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.06); }

.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-lg  { padding: 10px 18px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid transparent;
}

.badge-green  { background: var(--green-dim);  color: #16a34a; border-color: rgba(34,197,94,.15); }
.badge-red    { background: var(--red-dim);    color: #dc2626; border-color: rgba(239,68,68,.15); }
.badge-yellow { background: var(--yellow-dim); color: #d97706; border-color: rgba(245,158,11,.15); }
.badge-blue   { background: var(--brand-dim);  color: var(--brand); border-color: rgba(88,101,242,.15); }
.badge-gray   { background: var(--surface2); color: var(--muted); border-color: var(--border); }
.badge-cyan   { background: var(--cyan-dim);   color: #0891b2; border-color: rgba(6,182,212,.15); }
.badge-purple { background: var(--purple-dim); color: #7c3aed; border-color: rgba(139,92,246,.15); }

[data-theme="dark"] .badge-green  { color: #4ade80; }
[data-theme="dark"] .badge-red    { color: #f87171; }
[data-theme="dark"] .badge-yellow { color: #fbbf24; }
[data-theme="dark"] .badge-blue   { color: #818cf8; }
[data-theme="dark"] .badge-cyan   { color: #22d3ee; }
[data-theme="dark"] .badge-purple { color: #a78bfa; }

.dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

/* ── TABLES ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted2);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

tbody tr { border-bottom: 1px solid var(--border); transition: background .08s; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 10px 12px; color: var(--text); }
tbody tr:last-child { border-bottom: none; }

/* ── FORMS ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

label {
  display: block;
  font-size: 11px; font-weight: 600;
  color: var(--muted); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: .06em;
}

input, select, textarea, .form-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 13px;
  padding: 8px 11px;
  outline: none;
  transition: border-color .1s, box-shadow .1s;
  font-family: 'Inter', sans-serif;
}

input:focus, select:focus, textarea:focus, .form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(88,101,242,.12);
}

input::placeholder, textarea::placeholder { color: var(--muted2); }
select { cursor: pointer; }
textarea { min-height: 80px; resize: vertical; line-height: 1.6; }

/* ── TOGGLE ───────────────────────────────────────────────── */
.toggle {
  width: 32px; height: 18px;
  border-radius: 9px;
  background: var(--border2);
  border: 1px solid var(--border2);
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}

.toggle.on { background: var(--brand); border-color: var(--brand); }
.toggle.on::after { transform: translateX(14px); }

/* ── TABS ─────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 8px 14px;
  font-size: 13px; font-weight: 500;
  color: var(--muted2);
  cursor: pointer;
  border: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .1s, border-color .1s;
  background: none;
  font-family: 'Inter', sans-serif;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}

.tab:hover { color: var(--muted); }
.tab.active { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }

/* ── SERVER CARD ──────────────────────────────────────────── */
.server-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
  transition: border-color .1s, background .1s;
  cursor: pointer;
}
.server-card:hover { border-color: var(--border2); background: var(--surface2); }

.server-icon {
  width: 40px; height: 40px;
  border-radius: var(--r);
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.server-icon img { width: 100%; height: 100%; object-fit: cover; }

/* ── INSTANCE CARD ────────────────────────────────────────── */
.instance-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  transition: border-color .1s;
}
.instance-card:hover { border-color: var(--border2); }

/* ── LOG OUTPUT ───────────────────────────────────────────── */
.log-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; color: #4ade80;
  min-height: 240px; max-height: 440px;
  overflow-y: auto; white-space: pre-wrap;
  word-break: break-all; line-height: 1.7;
}

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  width: 100%; max-width: 440px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transform: scale(.97) translateY(4px);
  transition: transform .15s ease;
  animation: fadeUp .15s ease;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

/* ── LANDING ──────────────────────────────────────────────── */
.hero-glow { display: none; }

.gradient-text {
  background: linear-gradient(120deg, var(--brand), #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px;
  transition: border-color .1s;
}
.feature-card:hover { border-color: var(--border2); }

.pricing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .1s; position: relative;
}
.pricing-card.popular { border-color: var(--brand); }
.pricing-card:hover { border-color: var(--border2); }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  padding: 48px 20px; text-align: center; color: var(--muted2);
}
.empty-state svg { opacity: .2; }
.empty-state h3 { font-size: 14px; font-weight: 600; color: var(--muted); }
.empty-state p  { font-size: 12px; }

/* ── TOAST ────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 16px; right: 16px;
  z-index: 999; display: flex; flex-direction: column; gap: 6px;
}

.toast-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: slideIn .15s ease;
  max-width: 300px; color: var(--text);
  transition: opacity .25s, transform .25s;
}
.toast-item.success { border-color: rgba(34,197,94,.25); background: color-mix(in srgb, var(--surface) 94%, var(--green)); }
.toast-item.error   { border-color: rgba(239,68,68,.25);  background: color-mix(in srgb, var(--surface) 94%, var(--red)); }

/* ── BAR CHART ────────────────────────────────────────────── */
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row   { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bar-label { width: 72px; color: var(--muted2); text-align: right; font-family: 'JetBrains Mono', monospace; }
.bar-track { flex: 1; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.bar-fill  { height: 100%; background: var(--brand); border-radius: 2px; transition: width .5s ease; }
.bar-val   { width: 32px; color: var(--muted2); font-size: 11px; font-family: 'JetBrains Mono', monospace; }

/* ── FOOTER ───────────────────────────────────────────────── */
.footer-full {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}
.footer-grid {
  max-width: 1160px; margin: 0 auto; padding: 0 32px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; padding: 0 20px; } }
.footer-col-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted2); margin-bottom: 12px; }
.footer-col-links { display: flex; flex-direction: column; gap: 8px; }
.footer-col-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color .1s; }
.footer-col-links a:hover { color: var(--text); }
.footer-lang-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); padding: 3px 8px; border-radius: var(--r);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all .1s; font-family: 'Inter', sans-serif;
}
.footer-lang-btn:hover, .footer-lang-btn.active { background: var(--border); color: var(--text); border-color: var(--border2); }
.footer-social { display: flex; gap: 6px; margin-top: 12px; }
.footer-social a {
  width: 30px; height: 30px; border-radius: var(--r);
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none; transition: all .1s;
}
.footer-social a:hover { background: var(--border); color: var(--text); border-color: var(--border2); }
.footer-status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--green-dim); border: 1px solid rgba(34,197,94,.15);
  color: var(--green); padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; margin-top: 6px;
}
.footer-bottom {
  max-width: 1160px; margin: 28px auto 0; padding: 16px 32px 0;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.footer-made { font-size: 12px; color: var(--muted2); }
.footer-made span { color: var(--muted); }

/* ── MODULE CARDS ─────────────────────────────────────────── */
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden; margin-bottom: 8px;
  transition: border-color .1s;
}
.module-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; cursor: pointer; user-select: none;
  transition: background .08s;
}
.module-header:hover { background: var(--surface2); }
.module-body { padding: 0 16px 16px; border-top: 1px solid var(--border); }
.module-body.hidden { display: none; }
.chevron { transition: transform .18s; }
.module-card.open .chevron { transform: rotate(180deg); }

/* ── CHANNEL PICKER ───────────────────────────────────────── */
.channel-picker { position: relative; }
.channel-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); max-height: 240px; overflow-y: auto;
  display: none; margin-top: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.channel-dropdown.open { display: block; }
.channel-option {
  padding: 7px 12px; cursor: pointer;
  font-size: 13px; display: flex; align-items: center; gap: 7px;
  transition: background .08s; color: var(--text);
}
.channel-option:hover { background: var(--surface2); }
.channel-option.selected { color: var(--brand); }
.channel-option .ch-icon { color: var(--muted2); }
.channel-category {
  padding: 6px 12px 2px;
  font-size: 9px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted2); border-top: 1px solid var(--border);
}
.channels-multiselect {
  min-height: 38px; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 5px 10px; cursor: pointer;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.channel-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-dim); color: var(--brand);
  border: 1px solid var(--brand-dim2); border-radius: 3px;
  padding: 1px 6px; font-size: 12px; font-weight: 500;
}
.channel-tag button {
  background: none; border: none; color: var(--brand);
  cursor: pointer; padding: 0; font-size: 13px; line-height: 1;
}

/* ── MOBILE ───────────────────────────────────────────────── */
/* ── SIDEBAR BACKDROP ─────────────────────────────────────── */
#sidebarBackdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 39;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .2s;
}
#sidebarBackdrop.open { opacity: 1; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  #sidebarToggle { display: flex !important; }
  #sidebarBackdrop { display: block; pointer-events: none; }
  #sidebarBackdrop.open { pointer-events: all; }
}

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
}

/* ── GLOBE BACKGROUND ─────────────────────────────────────── */
#globeBg {
  position: fixed;
  top: 50%;
  right: -10vw;
  transform: translateY(-50%);
  width: 70vh;
  height: 70vh;
  min-width: 400px;
  min-height: 400px;
  z-index: 0;
  pointer-events: none;
  opacity: .18;
}
[data-theme="light"] #globeBg { opacity: .1; }
@media (max-width: 768px) { #globeBg { display: none; } }

/* ── UTILITY ──────────────────────────────────────────────── */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-6  { gap: 24px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-6   { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.text-muted     { color: var(--muted); }
.text-sm        { font-size: 12px; }
.text-xs        { font-size: 11px; }
.font-mono      { font-family: 'JetBrains Mono', monospace; }
.grid-2         { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3         { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.w-full         { width: 100%; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-title  { font-size: 14px; font-weight: 600; margin-bottom: 12px; letter-spacing: -.01em; color: var(--text); }
.section-label  { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted2); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.divider        { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.hidden         { display: none !important; }
