/* ════════════════════════════════════════════════════════════════════════════
   PharmaSims · styles.css  —  Full design system, zero framework constraints
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg-base:     #080c1a;
  --bg-card:     rgba(13, 18, 37, 0.85);
  --bg-card2:    rgba(20, 27, 52, 0.70);
  --bg-input:    rgba(8, 12, 26, 0.9);
  --border:      rgba(0, 245, 255, 0.12);
  --border-dim:  rgba(255, 255, 255, 0.06);

  --cyan:   #00f5ff;
  --violet: #b16cff;
  --coral:  #ff4d6d;
  --amber:  #ffd166;
  --green:  #06d6a0;
  --orange: #ff9a3c;

  --text-main: #e8eaf0;
  --text-sub:  #8892a4;
  --text-dim:  #4a5568;

  --sidebar-w: 230px;
  --radius:    14px;
  --radius-sm: 8px;

  --font-main: 'Inter', system-ui, sans-serif;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --glow-cyan:   0 0 24px rgba(0, 245, 255, 0.18);
  --glow-violet: 0 0 24px rgba(177, 108, 255, 0.18);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow: hidden;
  height: 100vh;
}

/* Starfield background */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(0,245,255,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(177,108,255,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 60% 20%, rgba(255,77,109,0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(8, 12, 26, 0.95);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.sidebar-logo {
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 1rem;
}
.logo-text {
  display: block;
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.logo-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-sub);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.nav-list { list-style: none; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.2s, color 0.2s;
  position: relative;
  user-select: none;
  font-family: var(--font-main);
  font-size: 0.875rem;
  color: var(--text-sub);
  border-left: 2px solid transparent;
}
.nav-item:hover {
  background: rgba(0, 245, 255, 0.04);
  color: var(--text-main);
}
.nav-item.active {
  background: rgba(0, 245, 255, 0.07);
  color: var(--cyan);
  border-left-color: var(--cyan);
  font-weight: 600;
}
.nav-icon { font-size: 1.1rem; flex-shrink: 0; }
.nav-label { line-height: 1.2; }

.sidebar-footer {
  padding: 1rem 1.25rem 0;
  border-top: 1px solid var(--border-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.8;
}
.sidebar-footer b { color: var(--cyan); }

/* ── Main content ─────────────────────────────────────────────────────── */
#main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 2.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,245,255,0.2) transparent;
}
#main::-webkit-scrollbar { width: 4px; }
#main::-webkit-scrollbar-track { background: transparent; }
#main::-webkit-scrollbar-thumb { background: rgba(0,245,255,0.2); border-radius: 4px; }

.section { display: none; animation: fadeIn 0.3s ease; }
.section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section headers ─────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.section-header .icon { font-size: 1.4rem; }
.section-header h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.section-header p {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-top: 1px;
  margin-left: 0.25rem;
}

/* ── Hero banner ─────────────────────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg,
    rgba(0,245,255,0.06) 0%,
    rgba(177,108,255,0.08) 50%,
    rgba(255,77,109,0.04) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 60%; height: 200%;
  background: radial-gradient(ellipse, rgba(177,108,255,0.06), transparent 70%);
  pointer-events: none;
}
.hero-banner h1 {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-main) 20%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.hero-banner p {
  font-size: 0.9rem;
  color: var(--text-sub);
  max-width: 600px;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(0,245,255,0.08);
  border: 1px solid rgba(0,245,255,0.2);
  color: var(--cyan);
  border-radius: 100px;
  padding: 0.3rem 0.75rem;
  letter-spacing: 0.02em;
}

/* ── KPI cards ───────────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  transition: border-color 0.2s, transform 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent, var(--cyan));
  border-radius: 2px 2px 0 0;
}
.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.kpi-value {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent, var(--cyan));
}
.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  font-family: var(--font-main);
}

/* ── Glass card ──────────────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  padding: 1.5rem;
}
.glass-card + .glass-card { margin-top: 1rem; }

.card-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Two-column layout ───────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; }
.split-3 { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; }
.col-fill { min-width: 0; }

/* ── Controls panel ──────────────────────────────────────────────────── */
.controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,245,255,0.12) transparent;
}
.controls-panel::-webkit-scrollbar { width: 3px; }
.controls-panel::-webkit-scrollbar-thumb { background: rgba(0,245,255,0.12); }

.ctrl-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-sub);
  margin-bottom: 0.4rem;
}

/* ── Drug chip list ──────────────────────────────────────────────────── */
.drug-chip-group { }
.drug-chip-group-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  margin-top: 0.6rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-dim);
}
.chip-wrap { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.drug-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.drug-chip:hover { border-color: rgba(0,245,255,0.25); background: rgba(0,245,255,0.06); }
.drug-chip.selected {
  background: rgba(0,245,255,0.12);
  border-color: rgba(0,245,255,0.4);
}
.drug-chip input[type="checkbox"] { display: none; }
.chip-abbr {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1;
}
.drug-chip.selected .chip-abbr { color: var(--cyan); }

/* ── Checkboxes ──────────────────────────────────────────────────────── */
.checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; }
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-sub);
  user-select: none;
  transition: color 0.15s;
}
.checkbox-item:hover { color: var(--text-main); }
.checkbox-item input[type="checkbox"] { display: none; }
.checkbox-box {
  width: 16px; height: 16px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  font-size: 0.6rem;
  color: transparent;
}
.checkbox-item input:checked ~ .checkbox-box {
  background: rgba(0,245,255,0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ── Sliders ─────────────────────────────────────────────────────────── */
.slider-wrap { }
.slider-value {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}
.slider-val-num {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--cyan);
}
.slider-val-unit {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}
input[type="range"] {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--cyan) 0%, rgba(0,245,255,0.1) 100%);
  cursor: pointer;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg-base);
  box-shadow: 0 0 8px rgba(0,245,255,0.5);
  cursor: grab;
}
input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }

/* ── Search input ────────────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}
.search-wrap input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem 0.6rem 2.2rem;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: rgba(0,245,255,0.35); }
.search-wrap input::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute;
  left: 0.7rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}

/* ── Data table ──────────────────────────────────────────────────────── */
.data-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,245,255,0.12) transparent;
}
.data-table-wrap::-webkit-scrollbar { width: 3px; }
.data-table-wrap::-webkit-scrollbar-thumb { background: rgba(0,245,255,0.15); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
thead {
  position: sticky; top: 0; z-index: 1;
  background: rgba(8, 12, 26, 0.97);
}
th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-dim);
  color: var(--text-main);
  font-family: var(--font-main);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(0,245,255,0.025); }
td.mono { font-family: var(--font-mono); font-size: 0.78rem; }
td.abbr-cell {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cyan);
}

/* ── Class badge ─────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  border: 1px solid;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.badge-nrti   { color: #00f5ff; border-color: rgba(0,245,255,0.3);   background: rgba(0,245,255,0.08); }
.badge-nrtti  { color: #06d6a0; border-color: rgba(6,214,160,0.3);   background: rgba(6,214,160,0.08); }
.badge-nnrti  { color: #b16cff; border-color: rgba(177,108,255,0.3); background: rgba(177,108,255,0.08); }
.badge-pi     { color: #ffd166; border-color: rgba(255,209,102,0.3); background: rgba(255,209,102,0.08); }
.badge-insti  { color: #ff4d6d; border-color: rgba(255,77,109,0.3);  background: rgba(255,77,109,0.08); }
.badge-entry  { color: #ff9a3c; border-color: rgba(255,154,60,0.3);  background: rgba(255,154,60,0.08); }
.badge-capsid { color: #a8ff78; border-color: rgba(168,255,120,0.3); background: rgba(168,255,120,0.08); }
.badge-other  { color: #8892a4; border-color: rgba(136,146,164,0.2); background: rgba(136,146,164,0.06); }

/* ── Insight box ─────────────────────────────────────────────────────── */
.insight-box {
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.8rem;
  line-height: 1.6;
  font-family: var(--font-main);
  margin-top: 0.75rem;
}
.insight-info    { background: rgba(0,245,255,0.06);   border-left: 3px solid rgba(0,245,255,0.5);   color: var(--text-sub); }
.insight-warning { background: rgba(255,209,102,0.06); border-left: 3px solid rgba(255,209,102,0.5); color: var(--text-sub); }
.insight-success { background: rgba(6,214,160,0.06);   border-left: 3px solid rgba(6,214,160,0.5);   color: var(--text-sub); }
.insight-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

/* ── Data readout ────────────────────────────────────────────────────── */
.data-readout {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-sub);
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-dim);
}
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin-top: 0.5rem; }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.tab-btn {
  padding: 0.6rem 1.1rem;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-sub);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Chart container ─────────────────────────────────────────────────── */
.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  /* overflow:visible so Plotly SVGs are never clipped when chart grows taller than the div */
  overflow: visible;
}
.plotly-chart { width: 100%; }

/* ── Loading skeleton ────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  height: 400px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Summary stats strip ─────────────────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.stat-mini {
  text-align: center;
  background: rgba(0,245,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
}
.stat-mini-val {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cyan);
}
.stat-mini-lbl {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── INSTI summary table ──────────────────────────────────────────────── */
.summary-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}

/* ── Prodrug cards ────────────────────────────────────────────────────── */
.prodrug-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent, var(--cyan));
  margin-bottom: 0.75rem;
  backdrop-filter: blur(16px);
}
.prodrug-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.prodrug-abbr {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
}
.prodrug-f {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}
.prodrug-name {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-bottom: 0.5rem;
}
.prodrug-note {
  font-size: 0.75rem;
  color: var(--text-sub);
  line-height: 1.55;
  white-space: pre-line;
  margin-top: 0.5rem;
}

/* ── Peptide info card ────────────────────────────────────────────────── */
.peptide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(16px);
}
.peptide-card-title {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

/* ── Utilities ────────────────────────────────────────────────────────── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-cyan   { color: var(--cyan); }
.text-violet { color: var(--violet); }
.text-coral  { color: var(--coral); }
.text-amber  { color: var(--amber); }
.text-green  { color: var(--green); }
.text-sub    { color: var(--text-sub); }
.font-mono   { font-family: var(--font-mono); }
.font-head   { font-family: var(--font-head); }

/* ── Two-col overview grid ────────────────────────────────────────────── */
.overview-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
}
.overview-right-col { display: flex; flex-direction: column; gap: 1.25rem; }

/* ── Mobile Responsiveness ─────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10000;
  width: 48px;
  height: 48px;
  background: rgba(0, 245, 255, 0.95);
  color: #080c1a;
  border: none;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
  display: none;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-dim);
  align-items: center;
  justify-content: space-between;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--cyan);
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }

  #sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 260px;
    z-index: 9999;
    transition: left 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 6px 0 25px rgba(0,0,0,0.6);
  }

  #sidebar.open { left: 0; }

  .sidebar-header { display: flex; }

  .sidebar-close { display: block; }

  #main {
    padding: 1rem 1rem 2rem;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .chart-box {
    margin-bottom: 1.25rem;
  }

  .controls-panel {
    max-height: none;
  }
}

/* Desktop Notice */
.desktop-notice {
  background: rgba(255, 209, 102, 0.1);
  border: 1px solid rgba(255, 209, 102, 0.3);
  color: #ffd166;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 1.5rem;
  display: none;
}

@media (max-width: 768px) {
  .desktop-notice { display: block; }
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10001;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 520px;
  padding: 2rem;
  position: relative;
  color: var(--text-main);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--cyan);
  cursor: pointer;
}

.modal h2 {
  margin-bottom: 1rem;
  color: var(--cyan);
}

.modal p {
  margin-bottom: 1rem;
  line-height: 1.65;
}

.modal-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-dim);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

/* Documentation Buttons */
.doc-buttons {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doc-btn {
  display: block;
  padding: 0.55rem 0.9rem;
  background: rgba(0,245,255,0.08);
  border: 1px solid rgba(0,245,255,0.25);
  border-radius: 8px;
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.78rem;
  text-align: center;
  transition: all 0.2s;
}

.doc-btn:hover {
  background: rgba(0,245,255,0.15);
  border-color: var(--cyan);
  transform: translateY(-1px);
}
