/* ═══════════════════════════════════════════════════════
   Meller Brand PE DD Report — McKinsey-Grade Stylesheet
   White background, professional consulting style
   ═══════════════════════════════════════════════════════ */

:root {
  --navy: #1a2332;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --sidebar-w: 260px;
  --header-h: 0px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--navy);
  background: white;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── SIDEBAR ── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: white;
}
.confidential-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(220,38,38,0.2);
  color: #fca5a5;
  border-radius: 3px;
  font-weight: 600;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 7px 20px;
  font-size: 12.5px;
  color: var(--gray-400);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  line-height: 1.3;
}
.sidebar-nav a:hover {
  color: white;
  background: rgba(255,255,255,0.05);
  text-decoration: none;
}
.sidebar-nav a.active {
  color: white;
  background: rgba(37,99,235,0.15);
  border-left-color: var(--blue);
  font-weight: 600;
}
.nav-num {
  display: inline-block;
  width: 26px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-500);
  flex-shrink: 0;
}
.sidebar-nav a.active .nav-num { color: var(--blue); }
.sidebar-footer {
  padding: 12px 20px;
  font-size: 11px;
  color: var(--gray-500);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ── HAMBURGER (mobile) ── */
#hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  background: var(--navy);
  color: white;
  border: none;
  padding: 8px 12px;
  font-size: 20px;
  border-radius: 6px;
  cursor: pointer;
}
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

/* ── MAIN CONTENT ── */
#main {
  margin-left: var(--sidebar-w);
  padding: 48px 56px 80px;
  max-width: 1120px;
}

/* ── REPORT HEADER ── */
.report-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 3px solid var(--navy);
}
.firm-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.report-header h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 8px;
}
.subtitle {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 16px;
}
.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 12px;
  color: var(--gray-500);
}
.report-meta span {
  padding: 4px 0;
}

/* ── SECTIONS ── */
.section {
  margin-bottom: 56px;
  padding-top: 24px;
}
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 4px;
}
.section h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-200);
}
.section-intro {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.8;
  margin-bottom: 24px;
}
.section-rule { border-top: 1px solid var(--gray-200); margin: 32px 0; }

h3.subsection {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 28px 0 12px;
}
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 32px; }

/* ── TWO-COLUMN LAYOUT ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}

/* ── KPI CARDS ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.kpi-card {
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.kpi-card.kpi-navy { border-left: 4px solid var(--navy); }
.kpi-card.kpi-blue { border-left: 4px solid var(--blue); }
.kpi-card.kpi-green { border-left: 4px solid var(--green); }
.kpi-card.kpi-amber { border-left: 4px solid var(--amber); }
.kpi-card.kpi-red { border-left: 4px solid var(--red); }
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 4px;
}
.kpi-sub {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.4;
}
.kpi-source {
  margin-top: 8px;
  font-size: 11px;
}
.kpi-source a { color: var(--blue); }

/* ── STAT ROWS ── */
.stat-row {
  display: flex;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}
.stat-label {
  font-size: 13px;
  color: var(--gray-500);
  min-width: 140px;
  flex-shrink: 0;
}
.stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}
.stat-note {
  font-size: 12px;
  color: var(--gray-400);
  margin-left: auto;
}

/* ── METRIC BARS ── */
.metric-bar { margin-bottom: 10px; }
.mb-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.mb-track {
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.mb-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  transition: width 0.5s;
}
.mb-fill.green { background: var(--green); }
.mb-fill.amber { background: var(--amber); }
.mb-fill.red { background: var(--red); }

/* ── TABLES ── */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead {
  background: var(--gray-50);
}
th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
  line-height: 1.5;
}
tr:hover td { background: var(--gray-50); }
.data-table td { font-variant-numeric: tabular-nums; }
.sources-table td { font-size: 12px; }

/* ── TAGS ── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tag-risk { background: #fef2f2; color: #b91c1c; }
.tag-opp { background: #f0fdf4; color: #15803d; }
.tag-watch { background: #fffbeb; color: #b45309; }
.tag-high { background: #fef2f2; color: #b91c1c; }
.tag-med { background: #fffbeb; color: #b45309; }
.tag-low { background: #f0fdf4; color: #15803d; }

/* ── CALLOUTS ── */
.callout {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
}
.callout.info { background: #eff6ff; border-left: 4px solid var(--blue); }
.callout.success { background: #f0fdf4; border-left: 4px solid var(--green); }
.callout.warn { background: #fffbeb; border-left: 4px solid var(--amber); }
.callout.danger { background: #fef2f2; border-left: 4px solid var(--red); }
.callout-icon { font-size: 18px; flex-shrink: 0; line-height: 1.4; }

/* ── THESIS BOX ── */
.thesis-box {
  padding: 24px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.8;
  margin: 16px 0 24px;
}

/* ── KEY INSIGHT ── */
.key-insight {
  padding: 20px 24px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.7;
}

/* ── HIGHLIGHT BOX ── */
.highlight-box {
  padding: 20px 24px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin: 16px 0;
}

/* ── SCENARIOS ── */
.scenarios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0 24px;
}
.scenario-card {
  padding: 24px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--gray-200);
}
.scenario-card.bear { background: #fef2f2; border-color: #fecaca; }
.scenario-card.base { background: #eff6ff; border-color: #bfdbfe; }
.scenario-card.bull { background: #f0fdf4; border-color: #bbf7d0; }
.s-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 8px;
}
.bear .s-label { color: var(--red); }
.base .s-label { color: var(--blue); }
.bull .s-label { color: var(--green); }
.s-moic {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}
.bear .s-moic { color: var(--red); }
.base .s-moic { color: var(--blue); }
.bull .s-moic { color: var(--green); }
.s-sub {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.5;
}

/* ── EXHIBITS (CHARTS) ── */
.exhibit {
  margin: 24px 0;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.exhibit img {
  display: block;
  max-width: 680px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  padding: 12px 16px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.exhibit img:hover { opacity: 0.92; }
.exhibit figcaption {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
  border-top: 1px solid var(--gray-200);
}
.exhibit figcaption a { color: var(--blue); }
.exhibit-block { margin: 24px 0; }

/* ── LISTS ── */
.report-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.report-list li {
  padding: 8px 0 8px 20px;
  position: relative;
  font-size: 14px;
  line-height: 1.6;
  border-bottom: 1px solid var(--gray-100);
}
.report-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: bold;
}

/* ── RISK INDICATORS ── */
.risk-high { color: var(--red); font-weight: 700; }
.risk-medium { color: var(--amber); font-weight: 700; }
.risk-low { color: var(--green); font-weight: 700; }

/* ── TEXT UTILITIES ── */
.text-muted { color: var(--gray-500); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }

/* ── LIGHTBOX ── */
#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}
#lightbox-overlay.active { display: flex; flex-direction: column; }
#lightbox-close {
  position: fixed;
  top: 16px; right: 16px;
  background: none;
  border: none;
  color: white;
  font-size: 36px;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
}
#lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}
#lightbox-caption {
  color: #cbd5e1;
  font-size: 13px;
  text-align: center;
  max-width: 80vw;
  margin-top: 12px;
  line-height: 1.5;
}

/* ── ACCESS GATE OVERLAY ── */
.report-gate-overlay {
  position: fixed;
  inset: 0;
  background: var(--navy);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.report-gate-card {
  background: white;
  border-radius: 12px;
  padding: 48px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0,0,0,0.3);
}
.report-gate-card .gate-brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray-400);
  margin-bottom: 16px;
  font-weight: 700;
}
.report-gate-card h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
  border: none;
  padding: 0;
}
.report-gate-card p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}
.report-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.report-gate-form input {
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.05em;
  outline: none;
  transition: border-color 0.2s;
}
.report-gate-form input:focus { border-color: var(--blue); }
.report-gate-form button {
  padding: 14px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.report-gate-form button:hover { background: #243347; }
.report-gate-status {
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}
.report-gate-status.error { color: var(--red); }
.gate-hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
  font-size: 12px;
  color: var(--gray-400);
}
.gate-hint strong {
  color: var(--navy);
  font-size: 14px;
  letter-spacing: 0.05em;
}
.gate-back {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--gray-400);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  #sidebar.open { transform: translateX(0); }
  #hamburger { display: block; }
  #overlay.active { display: block; }
  #main { margin-left: 0; padding: 60px 24px 80px; }
  .two-col { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .scenarios { grid-template-columns: 1fr; }
  .report-header h1 { font-size: 22px; }
}
@media (max-width: 500px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .report-meta { flex-direction: column; }
}
