/* ═══════════════════════════════════════════════════════════════════
   Samba Unity Data Portal — Styles
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Mono:wght@300;400;500&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;1,6..72,300;1,6..72,400&family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');

/* ── Tokens ── */
:root {
  --bg:            #080b10;
  --surface:       #0d1119;
  --surface-2:     #111520;
  --border:        rgba(255,255,255,0.85);
  --border-soft:   rgba(255,255,255,0.10);
  --red:           #ef3557;
  --gold:          #c9a84c;
  --gold-dim:      rgba(201,168,76,0.15);
  --purple:        #7b4fff;
  --grey:          #8a9aaa;
  --text:          #edf2f7;
  --text-muted:    #8a9daf;
  --text-dim:      #6a7d8f;

  --sidebar-w:     240px;
  --sidebar-collapsed: 60px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.2s ease;
}

/* Branding */
.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: 'DM Mono', monospace;
  font-size: 12px; font-weight: 500;
  color: #fff;
  letter-spacing: -0.5px;
}
.sidebar-brand-text { overflow: hidden; }
.sidebar-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  color: #fff;
  white-space: nowrap;
  line-height: 1.2;
}
.sidebar-sub {
  font-family: 'DM Mono', monospace;
  font-size: 9px; font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Nav sections */
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 8.5px; font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 18px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  font-size: 12.5px; font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.nav-item.active {
  color: #fff;
  border-left-color: var(--red);
  background: rgba(239,53,87,0.08);
}
.nav-item .nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-family: 'DM Mono', monospace;
  font-size: 8.5px; font-weight: 500;
  padding: 2px 6px; border-radius: 10px;
  background: var(--red); color: #fff;
  letter-spacing: 0.04em;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
}
.sidebar-version {
  font-family: 'DM Mono', monospace;
  font-size: 9px; color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* ══════════════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 52px;
  border-bottom: 1px solid var(--border-soft);
  padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 50;
}
.topbar-breadcrumb {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--text-dim);
  letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.topbar-breadcrumb span { color: var(--text-muted); }
.topbar-breadcrumb em { color: #fff; font-style: normal; }
.topbar-meta {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--text-dim);
  letter-spacing: 0.06em;
}

.content { padding: 36px 40px 80px; }

/* ══════════════════════════════════════════════════════════════════
   REPORT: HEADER
══════════════════════════════════════════════════════════════════ */
.report-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}
.report-header-left { flex: 1; }
.brand-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold-dim); border: 1px solid rgba(201,168,76,0.25);
  border-radius: 4px; padding: 4px 12px 4px 10px; margin-bottom: 14px;
}
.brand-badge .hbo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 6px var(--gold);
}
.brand-badge span {
  font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 500;
  letter-spacing: 0.15em; color: var(--gold); text-transform: uppercase;
}
.report-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 300;
  letter-spacing: -0.01em; line-height: 1.15;
  color: #fff; margin-bottom: 8px;
}
.report-header h1 em { font-style: italic; color: #fff; }
.report-subtitle {
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase;
}
.report-header-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 5px; padding-top: 4px;
}
.date-badge {
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--text-muted); letter-spacing: 0.06em;
}
.source-badge {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--text-dim); opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════════════
   SECTION LABELS
══════════════════════════════════════════════════════════════════ */
.section { margin-bottom: 28px; }
.section-label {
  font-family: 'Newsreader', serif;
  font-size: 19px; font-weight: 400; font-style: italic;
  letter-spacing: 0.01em; color: #ffffff;
  margin-bottom: 14px;
}

/* ══════════════════════════════════════════════════════════════════
   CAMPAIGN BRIEF
══════════════════════════════════════════════════════════════════ */
.brief-grid {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.brief-specs {
  display: flex; gap: 0;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}
.brief-specs .meta-item {
  flex: 1; padding-right: 20px; margin-right: 20px;
  border-right: 1px solid var(--border);
}
.brief-specs .meta-item:last-child { border-right: none; padding-right: 0; margin-right: 0; }
.meta-key {
  font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); margin-bottom: 5px;
}
.meta-val {
  font-family: 'DM Mono', monospace; font-size: 12px;
  color: rgba(255,255,255,0.7); line-height: 1.5;
}
.meta-val strong { color: #ffffff; font-weight: 500; }
.brief-text { padding: 24px 28px; }
.brief-text p {
  font-size: 13.5px; line-height: 1.75;
  color: rgba(255,255,255,0.88); font-weight: 300;
}
.brief-text p + p { margin-top: 14px; }
.brief-text strong { color: #ffffff; font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════
   APPROACH
══════════════════════════════════════════════════════════════════ */
.approach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.approach-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 28px;
}
.approach-title {
  font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); margin-bottom: 14px;
}
.approach-body {
  font-size: 13px; line-height: 1.7;
  color: rgba(255,255,255,0.82); font-weight: 300;
}
.approach-body strong { color: #fff; font-weight: 400; }
.batch-list { display: flex; flex-direction: column; gap: 16px; }
.batch-item { display: flex; gap: 14px; align-items: flex-start; }
.batch-pip {
  width: 3px; border-radius: 2px;
  background: var(--purple); flex-shrink: 0;
  align-self: stretch; min-height: 52px;
}
.batch-num {
  font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(255,255,255,0.7); margin-bottom: 6px;
}
.batch-detail { font-size: 12.5px; color: rgba(255,255,255,0.78); line-height: 1.6; }
.batch-detail strong { color: #fff; font-weight: 400; }

/* ══════════════════════════════════════════════════════════════════
   KPI CARDS
══════════════════════════════════════════════════════════════════ */
.kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 22px;
}
.kpi-label {
  font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); margin-bottom: 10px;
}
.kpi-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 600;
  line-height: 1; margin-bottom: 6px;
}
.kpi-card.red    .kpi-value { color: var(--red); }
.kpi-card.cyan   .kpi-value { color: var(--red); }
.kpi-card.gold   .kpi-value { color: var(--gold); }
.kpi-card.purple .kpi-value { color: var(--purple); }
.kpi-card.grey   .kpi-value { color: var(--grey); }
.kpi-sub { font-size: 11px; color: rgba(255,255,255,0.7); line-height: 1.4; }

/* ══════════════════════════════════════════════════════════════════
   CHART
══════════════════════════════════════════════════════════════════ */
.chart-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 32px 24px;
}
.chart-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 20px;
}
.legend { display: flex; gap: 24px; }
.legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(255,255,255,0.85);
}
.legend-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.legend-line { width: 24px; height: 2px; border-radius: 2px; }
.legend-item.targeted .legend-dot  { background: var(--red); box-shadow: 0 0 4px var(--red); }
.legend-item.targeted .legend-line { background: var(--red); box-shadow: 0 0 6px var(--red); }
.legend-item.nontargeted .legend-dot  { background: var(--grey); }
.legend-item.nontargeted .legend-line { background: var(--grey); }
.chart-canvas-wrap { position: relative; height: 460px; }

/* Tooltip */
.custom-tooltip {
  position: absolute; background: #141c28;
  border: 1px solid rgba(239,53,87,0.2);
  border-radius: 8px; padding: 12px 16px;
  pointer-events: none; opacity: 0;
  transition: opacity 0.15s;
  min-width: 190px; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 10;
}
.custom-tooltip.visible { opacity: 1; }
.tt-date {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tt-row {
  display: flex; justify-content: space-between;
  align-items: center; gap: 16px; margin-bottom: 5px;
}
.tt-row:last-child { margin-bottom: 0; }
.tt-label { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.tt-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.tt-dot.t { background: var(--red); }
.tt-dot.n { background: var(--grey); }
.tt-val { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500; }
.tt-val.t        { color: var(--red); }
.tt-val.n        { color: var(--grey); }
.tt-val.lift-pos { color: #4ade80; }
.tt-val.lift-neg { color: #f87171; }
.tt-badge {
  display: inline-block; font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(255,215,0,0.15); color: #ffd700;
  margin-left: 4px; vertical-align: middle;
}

/* ══════════════════════════════════════════════════════════════════
   INSIGHTS
══════════════════════════════════════════════════════════════════ */
.insights-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.insight-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 26px;
}
.insight-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 300; line-height: 1; margin-bottom: 12px;
}
.insight-card:nth-child(1) .insight-num { color: rgba(239,53,87,0.35); }
.insight-card:nth-child(2) .insight-num { color: rgba(123,79,255,0.35); }
.insight-card:nth-child(3) .insight-num { color: rgba(201,168,76,0.35); }
.insight-title {
  font-size: 13px; font-weight: 500; color: #fff;
  margin-bottom: 10px; line-height: 1.4;
}
.insight-body {
  font-size: 12.5px; color: rgba(255,255,255,0.82);
  line-height: 1.7; font-weight: 300;
}
.insight-body strong { color: #fff; font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════
   RECOMMENDATIONS
══════════════════════════════════════════════════════════════════ */
.rec-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.rec-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px 24px;
  display: flex; gap: 16px;
}
.rec-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.rec-card:nth-child(1) .rec-icon { background: rgba(239,53,87,0.12); }
.rec-card:nth-child(2) .rec-icon { background: rgba(123,79,255,0.12); }
.rec-card:nth-child(3) .rec-icon { background: rgba(201,168,76,0.12); }
.rec-title {
  font-size: 13px; font-weight: 500; color: #fff;
  margin-bottom: 7px; line-height: 1.35;
}
.rec-body { font-size: 12px; color: rgba(255,255,255,0.78); line-height: 1.65; font-weight: 300; }
.rec-body strong { color: #fff; font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════════ */
.report-footer {
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
}
.footer-note {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--text-muted); opacity: 0.5; line-height: 1.6;
}
.footer-meta {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--text-muted); opacity: 0.35; text-align: right;
}

/* ══════════════════════════════════════════════════════════════════
   NOISE + GLOW
══════════════════════════════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: 0.4;
}

/* ══════════════════════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}
.report-header { animation: fadeUp 0.45s ease both; }
.section       { animation: fadeUp 0.45s ease both; }
.section:nth-child(2) { animation-delay: 0.06s; }
.section:nth-child(3) { animation-delay: 0.10s; }
.section:nth-child(4) { animation-delay: 0.14s; }
.section:nth-child(5) { animation-delay: 0.18s; }
.section:nth-child(6) { animation-delay: 0.22s; }
.section:nth-child(7) { animation-delay: 0.26s; }
