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

:root {
  --bg-0: #070711;
  --bg-1: #0d0d1a;
  --bg-2: #13131f;
  --bg-3: #1a1a2e;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);
  --text: #e8e8f0;
  --text-muted: #8b8b9a;
  --text-sub: #b4b4c8;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --pink: #ec4899;
  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 24px 20px 16px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.logo-icon { font-size: 1.4rem; }
.accent { color: var(--accent-2); }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-sub);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-item.active { color: var(--accent-2); border-left-color: var(--accent); background: rgba(99,102,241,0.08); }
.nav-icon { font-size: 1rem; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.budget-widget { }
.budget-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.budget-bar-wrap { background: var(--bg-3); border-radius: 99px; height: 6px; margin-bottom: 6px; }
.budget-bar { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--yellow)); transition: width 0.5s; width: 0%; }
.budget-numbers { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-sub); }

/* ===== MAIN ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  background: var(--bg-0);
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,7,17,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 60px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; }
.page-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.date-badge { font-size: 0.78rem; color: var(--text-muted); }
.profile-badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
}

/* ===== SECTIONS ===== */
.section { display: none; padding: 28px; animation: fadeIn 0.3s ease; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== CARDS ===== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.card-header h2 { font-size: 1rem; font-weight: 700; }
.card-header.standalone { margin-bottom: 20px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.mt-2 { margin-top: 16px; }

/* ===== KPI GRID ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--border-hover); }
.kpi-icon { font-size: 1.4rem; margin-bottom: 8px; }
.kpi-value { font-size: 1.8rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 4px; }
.kpi-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-trend { font-size: 0.78rem; margin-top: 8px; font-weight: 600; }
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }
.kpi-trend.neutral { color: var(--yellow); }

/* ===== PRODUCT MINI LIST ===== */
.product-mini-list { display: flex; flex-direction: column; gap: 8px; }
.pml-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.pml-icon { font-size: 1.2rem; }
.pml-info { flex: 1; }
.pml-name { font-weight: 600; font-size: 0.88rem; }
.pml-price { font-size: 0.75rem; color: var(--text-muted); }
.pml-status { font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.status-live { background: rgba(16,185,129,0.15); color: var(--green); }
.status-warn { background: rgba(245,158,11,0.15); color: var(--yellow); }
.status-missing { background: rgba(239,68,68,0.15); color: var(--red); }

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 14px; padding: 0 0 20px 0; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
  z-index: 1;
}
.tl-item.done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-item.active .tl-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent); }
.tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-content { font-size: 0.9rem; color: var(--text); }
.tl-content strong { color: #fff; display: block; margin-bottom: 2px; }

/* ===== INSIGHTS ===== */
.insight-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 700px) { .insight-grid { grid-template-columns: 1fr; } }
.insight {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}
.insight.red { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.2); }
.insight.orange { background: rgba(249,115,22,0.07); border-color: rgba(249,115,22,0.2); }
.insight.yellow { background: rgba(245,158,11,0.07); border-color: rgba(245,158,11,0.2); }
.insight.green { background: rgba(16,185,129,0.07); border-color: rgba(16,185,129,0.2); }
.insight-icon { font-size: 1.3rem; margin-bottom: 6px; }
.insight-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 4px; }
.insight-desc { font-size: 0.85rem; color: var(--text); line-height: 1.5; }

/* ===== PRODUCTS GRID ===== */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.product-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
}
.product-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.pc-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pc-emoji { font-size: 2rem; }
.pc-meta { flex: 1; }
.pc-title { font-weight: 700; font-size: 1rem; }
.pc-type { font-size: 0.75rem; color: var(--text-muted); }
.pc-price { font-size: 1.1rem; font-weight: 800; color: var(--accent-2); margin-bottom: 8px; }
.pc-desc { font-size: 0.88rem; color: var(--text); margin-bottom: 14px; line-height: 1.5; }
.pc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-link { font-size: 0.8rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.85rem; cursor: pointer;
  border: none; text-decoration: none;
  transition: all 0.2s; gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--text-sub); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }
.btn-green { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.btn-green:hover { background: rgba(16,185,129,0.25); }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-copy { background: var(--bg-3); color: var(--text-sub); border: 1px solid var(--border); font-size: 0.75rem; padding: 4px 10px; }
.btn-copy:hover { color: var(--text); }

/* ===== GUMROAD TABLE ===== */
.gumroad-table { display: flex; flex-direction: column; gap: 12px; }
.gr-row {
  display: grid;
  grid-template-columns: 40px 1fr minmax(160px, 2fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.gr-emoji { font-size: 1.3rem; text-align: center; }
.gr-info .gr-name { font-weight: 700; font-size: 0.9rem; }
.gr-info .gr-price { font-size: 0.75rem; color: var(--text-muted); }
.gr-link-input {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 0.78rem;
  font-family: 'Inter', monospace;
  width: 100%;
}
.gr-link-input:focus { outline: none; border-color: var(--accent); }
.gr-link-input.has-link { border-color: rgba(16,185,129,0.4); }
.gr-actions { display: flex; gap: 6px; justify-content: flex-end; }
.badge-info { font-size: 0.75rem; color: var(--text-muted); background: var(--bg-3); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); }

/* ===== STEP LIST ===== */
.step-list { padding-left: 20px; margin-top: 12px; }
.step-list li { margin-bottom: 8px; font-size: 0.85rem; color: var(--text-sub); }
.step-list li strong { color: var(--text); }
.link { color: var(--accent-2); text-decoration: none; }
.link:hover { text-decoration: underline; }
code { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; font-size: 0.82rem; }

/* ===== BUDGET EDITOR ===== */
.budget-editor { display: flex; flex-direction: column; gap: 16px; }
.budget-alloc-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alloc-info { display: flex; align-items: center; gap: 8px; min-width: 180px; font-size: 0.88rem; font-weight: 500; }
.alloc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.alloc-controls { display: flex; align-items: center; gap: 10px; flex: 1; }
.slider { flex: 1; accent-color: var(--accent); cursor: pointer; }
.alloc-value { min-width: 32px; font-weight: 700; color: var(--accent-2); }
.budget-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
.budget-total strong { font-size: 1.2rem; color: var(--green); }
.budget-warning { color: var(--red); font-size: 0.85rem; font-weight: 600; }
.hidden { display: none !important; }

/* ===== FREE CHANNELS ===== */
.free-channels { display: flex; flex-direction: column; gap: 12px; }
.channel-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; background: var(--bg-3); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.channel-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.channel-item > div { flex: 1; }
.channel-item strong { font-size: 0.88rem; }
.channel-item p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.channel-badge { font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; flex-shrink: 0; }
.channel-badge.done { background: rgba(16,185,129,0.15); color: var(--green); }
.channel-badge.todo { background: rgba(99,102,241,0.15); color: var(--accent-2); }

/* ===== AD TEMPLATES ===== */
.ad-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ad-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.ad-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ad-tag { font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(99,102,241,0.15); color: var(--accent-2); }
.ad-text { font-size: 0.9rem; color: var(--text); line-height: 1.6; white-space: pre-line; margin-bottom: 10px; }

/* ===== STRATEGY PHASES ===== */
.strategy-phases { display: flex; flex-direction: column; gap: 16px; }
.phase { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.phase-header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.phase-num { font-size: 1.5rem; font-weight: 900; color: var(--ph-color); opacity: 0.5; }
.phase-header div { flex: 1; }
.phase-header strong { font-size: 0.92rem; }
.phase-budget { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.phase-steps { list-style: none; padding: 14px 20px; display: flex; flex-direction: column; gap: 8px; }
.phase-steps li { font-size: 0.9rem; color: var(--text); }

/* ===== CALC GRID ===== */
.calc-grid { display: flex; flex-direction: column; gap: 2px; }
.calc-row { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 6px; font-size: 0.88rem; }
.calc-row.highlight { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2); }
.calc-row.highlight strong { color: var(--accent-2); font-size: 1rem; }
.calc-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ===== PRIORITY LIST ===== */
.priority-list { display: flex; flex-direction: column; gap: 10px; }
.priority-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); background: var(--bg-3); }
.p-rank { font-size: 1.1rem; font-weight: 900; min-width: 28px; }
.p1 .p-rank { color: #ffd700; }
.p2 .p-rank { color: #c0c0c0; }
.p3 .p-rank { color: #cd7f32; }
.p4 .p-rank { color: var(--text-muted); }
.priority-item strong { font-size: 0.88rem; }
.priority-item p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ===== CHECKLIST ===== */
.progress-bar-wrap { background: var(--bg-3); border-radius: 99px; height: 8px; margin-bottom: 20px; }
.progress-bar-fill { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width 0.5s; }
.progress-text { font-size: 0.78rem; color: var(--text-muted); }
.checklist-groups { display: flex; flex-direction: column; gap: 20px; }
.cl-group-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 10px; color: var(--accent-2); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.08em; }
.cl-items { display: flex; flex-direction: column; gap: 6px; }
.cl-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.cl-item:hover { border-color: var(--border-hover); }
.cl-item.done { opacity: 0.5; }
.cl-item.done .cl-text { text-decoration: line-through; }
.cl-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cl-item.done .cl-check { background: var(--green); border-color: var(--green); color: #fff; font-size: 0.7rem; }
.cl-text { flex: 1; font-size: 0.85rem; }
.cl-priority { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.cl-priority.high { background: rgba(239,68,68,0.15); color: var(--red); }
.cl-priority.med { background: rgba(245,158,11,0.15); color: var(--yellow); }
.cl-priority.low { background: rgba(16,185,129,0.15); color: var(--green); }

/* ===== SECTION INTRO ===== */
.section-intro { font-size: 0.85rem; color: var(--text-sub); margin-bottom: 16px; line-height: 1.6; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: block; }
  .section { padding: 16px; }
  .gr-row { grid-template-columns: 40px 1fr; }
  .gr-actions { grid-column: 1/-1; }
}
