:root {
  --bg: #080808;
  --bg1: #0f0f0f;
  --bg2: #161616;
  --bg3: #1e1e1e;
  --bg4: #262626;
  --bg5: #2e2e2e;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.1);
  --border3: rgba(255,255,255,0.18);
  --text: #f5f5f5;
  --text2: #a0a0a0;
  --text3: #606060;
  --red: #dc2626;
  --red-dim: rgba(220,38,38,0.15);
  --red-glow: rgba(220,38,38,0.3);
  --blue: #38bdf8;
  --blue-dim: rgba(56,189,248,0.12);
  --yellow: #facc15;
  --yellow-dim: rgba(250,204,21,0.12);
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.12);
  --purple: #a855f7;
  --purple-dim: rgba(168,85,247,0.12);
  --orange: #f97316;
  --orange-dim: rgba(249,115,22,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font-display: 'Clash Display', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --glow: 0 0 60px rgba(220,38,38,0.08), 0 0 120px rgba(56,189,248,0.04);
}
[data-theme="light"] {
  --bg: #f8f8f8;
  --bg1: #ffffff;
  --bg2: #f2f2f2;
  --bg3: #e8e8e8;
  --bg4: #dcdcdc;
  --bg5: #d0d0d0;
  --border: rgba(0,0,0,0.06);
  --border2: rgba(0,0,0,0.1);
  --border3: rgba(0,0,0,0.16);
  --text: #111111;
  --text2: #555555;
  --text3: #999999;
  --red: #dc2626;
  --red-dim: rgba(220,38,38,0.08);
  --red-glow: rgba(220,38,38,0.2);
  --blue: #0284c7;
  --blue-dim: rgba(2,132,199,0.08);
  --yellow: #ca8a04;
  --yellow-dim: rgba(202,138,4,0.1);
  --green: #16a34a;
  --green-dim: rgba(22,163,74,0.08);
  --purple: #9333ea;
  --purple-dim: rgba(147,51,234,0.08);
  --orange: #ea580c;
  --orange-dim: rgba(234,88,12,0.08);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size: 14px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.4s, color 0.4s;
  overflow: hidden;
}

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 3px; }

/* ══════════════════ GRID BACKGROUND ══════════════════ */
.grid-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.025;
  background-image:
    linear-gradient(var(--text) 1px, transparent 1px),
    linear-gradient(90deg, var(--text) 1px, transparent 1px);
  background-size: 48px 48px;
}
.orb {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(100px); opacity: 0.12;
}
.orb-1 { width: 600px; height: 600px; background: var(--red); top: -200px; left: -100px; }
.orb-2 { width: 400px; height: 400px; background: var(--blue); bottom: -100px; right: 200px; opacity: 0.07; }

/* ══════════════════ TOPBAR ══════════════════ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(8,8,8,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  transition: background 0.4s;
}
[data-theme="light"] .topbar { background: rgba(248,248,248,0.9); }

.logo {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.logo-mark {
  width: 28px; height: 28px;
  background: var(--red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 0 16px var(--red-glow);
}
.logo-text { color: var(--text); }
.logo-text span { color: var(--red); }

.topbar-center {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px;
}
.tab-btn {
  padding: 5px 14px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; font-family: var(--font-body);
  cursor: pointer; transition: all 0.2s;
  background: none; border: none; color: var(--text3);
}
.tab-btn:hover { color: var(--text2); background: var(--bg3); }
.tab-btn.active { background: var(--bg4); color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.streak-pill {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #ff7a00, #ff4400);
  color: #fff; border-radius: 20px;
  padding: 5px 12px; font-size: 12px; font-weight: 600;
  font-family: var(--font-display);
  box-shadow: 0 0 20px rgba(255,100,0,0.3);
}
.icon-btn {
  width: 34px; height: 34px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: all 0.2s; color: var(--text2);
}
.icon-btn:hover { background: var(--bg3); border-color: var(--border2); color: var(--text); }
.icon-btn.active { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.pro-badge {
  background: var(--red); color: #fff;
  border-radius: 8px; padding: 5px 14px;
  font-size: 12px; font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 0 20px var(--red-glow);
  border: none;
}
.pro-badge:hover { transform: translateY(-1px); box-shadow: 0 4px 24px var(--red-glow); }

/* ══════════════════ LAYOUT ══════════════════ */
.shell {
  display: flex;
  height: 100vh;
  padding-top: 56px;
  position: relative; z-index: 1;
}

/* ══════════════════ SIDEBAR ══════════════════ */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg1);
  border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
  padding: 16px 0;
  display: flex; flex-direction: column;
  transition: transform 0.3s;
}
.sb-section { margin-bottom: 24px; }
.sb-label {
  font-size: 10px; font-weight: 600; font-family: var(--font-display);
  color: var(--text3); letter-spacing: 1.5px; text-transform: uppercase;
  padding: 0 20px; margin-bottom: 6px;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; color: var(--text2); font-size: 13.5px;
  cursor: pointer; transition: all 0.15s; position: relative;
  user-select: none;
}
.sb-item:hover { color: var(--text); background: var(--bg2); }
.sb-item.active { color: var(--text); background: var(--bg2); font-weight: 500; }
.sb-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--red); border-radius: 0 3px 3px 0;
}
.sb-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sb-count {
  margin-left: auto; font-size: 11px; font-family: var(--font-mono);
  background: var(--bg3); color: var(--text3);
  border-radius: 10px; padding: 1px 7px; min-width: 22px; text-align: center;
}
.sb-item.active .sb-count { background: var(--red-dim); color: var(--red); }

.sb-add-btn {
  margin: 8px 14px 0;
  padding: 10px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border2);
  background: transparent; color: var(--text3);
  font-size: 13px; font-family: var(--font-body);
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sb-add-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }
/*------------------ logo =====*/
.logo-mark img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px; /* optional: smooth corners */
}
/* ══════════════════ MAIN ══════════════════ */
.main {
  flex: 1; overflow-y: auto; padding: 24px 28px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ══════════════════ STATS ══════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  transition: border-color 0.2s, transform 0.2s;
  cursor: default;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.stat-tag { font-size: 11px; font-family: var(--font-mono); font-weight: 500; padding: 3px 8px; border-radius: 20px; }
.stat-num { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-desc { font-size: 12px; color: var(--text3); }

/* ══════════════════ SECTION HEADER ══════════════════ */
.sec-head { display: flex; align-items: center; justify-content: space-between; }
.sec-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sec-actions { display: flex; gap: 8px; }

/* ══════════════════ BUTTONS ══════════════════ */
.btn {
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-family: var(--font-body); font-weight: 500;
  cursor: pointer; transition: all 0.2s; border: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-red { background: var(--red); color: #fff; box-shadow: 0 0 16px var(--red-glow); }
.btn-red:hover { transform: translateY(-1px); box-shadow: 0 4px 24px var(--red-glow); }
.btn-outline { background: transparent; border: 1px solid var(--border2); color: var(--text2); }
.btn-outline:hover { border-color: var(--border3); color: var(--text); background: var(--bg2); }
.btn-blue { background: var(--blue-dim); border: 1px solid rgba(56,189,248,0.3); color: var(--blue); }
.btn-blue:hover { background: rgba(56,189,248,0.2); }
.btn-sm { padding: 5px 10px; font-size: 11.5px; }

/* ══════════════════ FILTER CHIPS ══════════════════ */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 13px; border-radius: 20px;
  font-size: 12px; font-family: var(--font-display); font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  background: var(--bg2); border: 1px solid var(--border); color: var(--text3);
}
.chip:hover { color: var(--text2); border-color: var(--border2); }
.chip.active { background: var(--red-dim); border-color: var(--red); color: var(--red); }

/* ══════════════════ ADD TASK FORM ══════════════════ */
.task-form {
  background: var(--bg1); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 16px;
  display: none; margin-bottom: 4px;
  animation: slideDown 0.2s ease;
}
.task-form.open { display: block; }
@keyframes slideDown { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform:none; } }
.form-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.f-input {
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 9px 14px; font-size: 13.5px; font-family: var(--font-body);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.f-input::placeholder { color: var(--text3); }
.f-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.f-input.grow { flex: 1; min-width: 200px; }
.f-select {
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--text2); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 12.5px; font-family: var(--font-body);
  outline: none; cursor: pointer;
}
.f-select:focus { border-color: var(--red); }
.form-row2 { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* ══════════════════ TASKS ══════════════════ */
.tasks-list { display: flex; flex-direction: column; gap: 6px; }
.task-item {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  transition: border-color 0.18s, transform 0.18s, opacity 0.3s;
  cursor: pointer; position: relative; overflow: hidden;
  animation: fadeUp 0.25s ease both;
}
.task-item:hover { border-color: var(--border2); transform: translateX(3px); }
.task-item.done { opacity: 0.45; }
.task-item.done .t-title { text-decoration: line-through; color: var(--text3); }
@keyframes fadeUp { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }

/* Priority stripe */
.task-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-radius: 0 2px 2px 0;
}
.task-item.p-high::before { background: var(--red); }
.task-item.p-medium::before { background: var(--yellow); }
.task-item.p-low::before { background: var(--green); }

.t-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; cursor: pointer; background: transparent;
  font-size: 11px; color: transparent;
}
.t-check:hover { border-color: var(--red); }
.task-item.done .t-check {
  background: var(--green); border-color: var(--green); color: #fff;
}

.t-body { flex: 1; min-width: 0; }
.t-title { font-size: 13.5px; font-weight: 500; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.badge {
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  font-family: var(--font-display); font-weight: 600;
}
.b-high { background: var(--red-dim); color: var(--red); }
.b-medium { background: var(--yellow-dim); color: var(--yellow); }
.b-low { background: var(--green-dim); color: var(--green); }
.b-subject { background: var(--blue-dim); color: var(--blue); }
.b-tag { background: var(--purple-dim); color: var(--purple); }
.t-date { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }
.t-overdue { color: var(--red); }
.t-del {
  opacity: 0; background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 14px; padding: 3px 6px; border-radius: 5px;
  transition: all 0.15s;
}
.task-item:hover .t-del { opacity: 1; }
.t-del:hover { background: var(--red-dim); color: var(--red); }

.empty-state {
  text-align: center; padding: 48px 20px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text3);
}
.empty-state .e-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 13.5px; }

/* ══════════════════ AI PLANNER CARD ══════════════════ */
.ai-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.ai-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--red-dim), transparent);
}
.ai-orb {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--red), #ff6b6b);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; box-shadow: 0 0 14px var(--red-glow);
}
.ai-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.ai-body { padding: 16px 18px; }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--text3); font-size: 13px; }
.dots { display: flex; gap: 4px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: blink 1.2s infinite; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100%{opacity:0.2;transform:scale(0.7)} 40%{opacity:1;transform:scale(1)} }
.plan-steps { display: flex; flex-direction: column; gap: 8px; }
.plan-step {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; background: var(--bg2);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.plan-step:hover { border-color: var(--border2); }
.step-num {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--red); color: #fff;
  font-size: 11px; font-family: var(--font-display); font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-text { font-size: 12.5px; color: var(--text2); line-height: 1.6; }
.ai-note { font-size: 12px; color: var(--blue); font-style: italic; margin-top: 10px; padding: 8px 12px; background: var(--blue-dim); border-radius: var(--radius-xs); }

/* ══════════════════ RIGHT PANEL ══════════════════ */
.rightpanel {
  width: 280px; flex-shrink: 0;
  background: var(--bg1);
  border-left: 1px solid var(--border);
  overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 20px;
}
.rp-block {}
.rp-label {
  font-size: 10px; font-family: var(--font-display); font-weight: 700;
  color: var(--text3); letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.rp-label::after { content:''; flex:1; height:1px; background: var(--border); }

/* POMODORO */
.pom-ring { position: relative; width: 110px; height: 110px; margin: 0 auto 14px; }
.pom-ring svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--bg3); stroke-width: 7; }
.ring-fill { fill: none; stroke: var(--red); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 310; transition: stroke-dashoffset 1s linear; }
.ring-fill.break { stroke: var(--green); }
.ring-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pom-time { font-family: var(--font-mono); font-size: 20px; font-weight: 500; }
.pom-label { font-size: 9px; color: var(--text3); letter-spacing: 1px; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; }
.pom-ctrls { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.pom-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg2); color: var(--text2); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.pom-btn:hover { border-color: var(--border2); color: var(--text); background: var(--bg3); }
.pom-btn.main { width: 44px; height: 44px; background: var(--red); border-color: var(--red); color: #fff; font-size: 17px; box-shadow: 0 0 16px var(--red-glow); }
.pom-sessions { text-align: center; font-size: 12px; color: var(--text3); margin-top: 10px; font-family: var(--font-mono); }

/* SOUNDS */
.sound-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.snd-btn {
  padding: 10px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg2);
  cursor: pointer; transition: all 0.2s; text-align: center;
  font-size: 11.5px; color: var(--text2);
}
.snd-btn:hover { border-color: var(--border2); color: var(--text); background: var(--bg3); }
.snd-btn.on { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.snd-icon { font-size: 18px; display: block; margin-bottom: 4px; }

/* STREAK DOTS */
.streak-row { display: flex; gap: 5px; flex-wrap: wrap; }
.s-dot {
  flex: 1; min-width: 28px; height: 28px; border-radius: 7px;
  background: var(--bg3); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 9px; color: var(--text3); transition: all 0.2s;
}
.s-dot.on { background: var(--red-dim); border: 1px solid var(--red); color: var(--red); }
.s-dot.today { background: var(--red); color: #fff; box-shadow: 0 0 12px var(--red-glow); }
.s-dot .day-label { font-size: 8px; margin-top: 1px; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.5px; }

/* PROGRESS */
.prog-item { margin-bottom: 12px; }
.prog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; font-size: 12px; color: var(--text2); }
.prog-bar { height: 5px; background: var(--bg3); border-radius: 5px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }

/* CHART */
.chart-wrap { height: 130px; }

/* ══════════════════ CELEBRATION ══════════════════ */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
.celebration-modal {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: none;
}
.celebration-box {
  background: var(--bg1); border: 1px solid var(--border2);
  border-radius: 24px; padding: 40px 50px; text-align: center;
  max-width: 380px; animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn { from { opacity:0; transform: scale(0.7); } to { opacity:1; transform: scale(1); } }
.celeb-emoji { font-size: 56px; margin-bottom: 16px; }
.celeb-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.celeb-sub { font-size: 14px; color: var(--text2); margin-bottom: 24px; }

/* ══════════════════ NOTIFICATION ══════════════════ */
.notif {
  position: fixed; bottom: 20px; right: 20px; z-index: 9997;
  background: var(--bg1); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  max-width: 280px; min-width: 220px;
  transform: translateX(120%); transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.notif.show { transform: translateX(0); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ══════════════════ ANALYTICS PAGE ══════════════════ */
.analytics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.a-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.a-card.full { grid-column: 1 / -1; }
.a-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; font-size: 11px; }
.big-num { font-family: var(--font-display); font-size: 42px; font-weight: 700; line-height: 1; }
.big-sub { font-size: 12px; color: var(--text3); margin-top: 6px; }
.a-chart-wrap { height: 200px; }

/* ══════════════════ UPGRADE MODAL ══════════════════ */
.upgrade-modal {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: none;
}
.upgrade-box {
  background: var(--bg1); border: 1px solid var(--border2);
  border-radius: 24px; padding: 36px 40px; max-width: 440px; width: 90%;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.upgrade-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.upgrade-sub { color: var(--text2); font-size: 13.5px; margin-bottom: 24px; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.plan-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px;
  cursor: pointer; transition: border-color 0.2s;
}
.plan-card.rec { border-color: var(--red); background: var(--red-dim); }
.plan-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.plan-price { font-size: 22px; font-weight: 700; font-family: var(--font-display); color: var(--red); }
.plan-price span { font-size: 12px; color: var(--text3); font-weight: 400; }
.plan-features { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.plan-features li { font-size: 12px; color: var(--text2); display: flex; gap: 6px; align-items: flex-start; }
.plan-features li::before { content: '✓'; color: var(--green); flex-shrink: 0; }

/* ══════════════════ RESPONSIVE ══════════════════ */
@media (max-width: 1100px) { .rightpanel { display: none; } }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .topbar-center { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .main { padding: 16px; }
}
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }

/* ══════════════════ PAGE VIEWS ══════════════════ */
.page { display: none; flex-direction: column; gap: 20px; }
.page.active { display: flex; }