/* ============================================================
   be'ah ESG Intelligence Platform · Design System
   ============================================================ */

:root {
  /* Palette — enterprise dark theme with sustainability accent */
  --bg-0: #06090F;
  --bg-1: #0B111C;
  --bg-2: #111827;
  --surface-1: #131B2C;
  --surface-2: #1A2338;
  --surface-3: #212C46;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text-1: #F1F5F9;
  --text-2: #94A3B8;
  --text-3: #64748B;
  --muted: #475569;

  --accent: #F97316;        /* Sculptors orange */
  --accent-2: #FB923C;      /* lighter orange */
  --accent-dim: rgba(249, 115, 22, 0.16);
  --accent-ink: #1A0B02;    /* dark text on orange */
  --info: #E5E7EB;          /* white/gray for secondary */
  --info-dim: rgba(229, 231, 235, 0.10);
  --warn: #FBBF24;
  --warn-dim: rgba(251, 191, 36, 0.14);
  --danger: #F87171;
  --danger-dim: rgba(248, 113, 113, 0.14);
  --violet: #A78BFA;
  --violet-dim: rgba(167, 139, 250, 0.15);

  --grad-primary: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  --grad-sub:     linear-gradient(135deg, rgba(249,115,22,0.18), rgba(234,88,12,0.10));
  --grad-card:    linear-gradient(160deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005));

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --sidebar-w: 260px;
  --topbar-h: 68px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-bg: linear-gradient(180deg, #0A1120 0%, #060A13 100%);
  --topbar-bg: rgba(11, 17, 28, 0.75);
  --input-bg: var(--surface-1);
  --chart-grid: rgba(148,163,184,0.06);
}

/* LIGHT MODE */
[data-theme="light"] {
  --bg-0: #FAFAF9;
  --bg-1: #FFFFFF;
  --bg-2: #FFFFFF;
  --surface-1: #FFFFFF;
  --surface-2: #F5F5F4;
  --surface-3: #E7E5E4;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text-1: #0F0A05;
  --text-2: #57534E;
  --text-3: #78716C;
  --muted: #A8A29E;

  --accent-dim: rgba(249, 115, 22, 0.12);
  --info-dim: rgba(15, 23, 42, 0.08);
  --warn-dim: rgba(251, 191, 36, 0.12);
  --danger-dim: rgba(248, 113, 113, 0.10);
  --violet-dim: rgba(167, 139, 250, 0.10);

  --grad-sub: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(234,88,12,0.06));

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 8px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 24px 60px rgba(15,23,42,.14);

  --sidebar-bg: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  --topbar-bg: rgba(255, 255, 255, 0.85);
  --input-bg: #FFFFFF;
  --chart-grid: rgba(15,23,42,0.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  background-image:
    radial-gradient(1200px 600px at 90% -10%, rgba(249,115,22,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(6,182,212,0.08), transparent 60%);
  transition: background-color .25s ease, color .25s ease;
}
[data-theme="light"] body,
body[data-theme="light"] {
  background-image:
    radial-gradient(1200px 600px at 90% -10%, rgba(249,115,22,0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(6,182,212,0.06), transparent 60%);
}

h1,h2,h3,h4,h5 { margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--text-1); }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; color: var(--text-2); }
a { color: var(--accent-2); text-decoration: none; }

/* ================ APP SHELL ================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  min-height: 0;
}

/* ================ SIDEBAR ================ */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 4px;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
/* Beah brand mark — shows ONLY the three-leaf glyph from the file (crops out the "be'ah" wordmark) */
.sidebar .brand-mark {
  width: 56px; height: 56px;
  flex: none;
  background-image: url("assets/beah-mark.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
  transition: transform .4s cubic-bezier(.3,.7,.2,1);
}
.sidebar .brand:hover .brand-mark {
  transform: translateY(-2px) scale(1.06);
}
[data-theme="light"] .sidebar .brand-mark { filter: drop-shadow(0 3px 10px rgba(15,23,42,0.14)); }
.sidebar .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar .brand-text strong { font-size: 15px; letter-spacing: 0.02em; }
.sidebar .brand-text span { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; }

.nav-section {
  color: var(--text-3);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.15em;
  padding: 16px 10px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
  position: relative;
}
.nav-item:hover { background: var(--surface-1); color: var(--text-1); }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(249,115,22,0.14), rgba(6,182,212,0.06));
  color: var(--text-1);
  border: 1px solid rgba(249,115,22,0.28);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  background: var(--grad-primary); border-radius: 0 3px 3px 0;
}
.nav-item .badge {
  margin-left: auto; font-size: 10px; padding: 2px 6px;
  background: rgba(248,113,113,0.14); color: var(--danger);
  border-radius: 999px; font-weight: 600;
}
.nav-footer {
  margin-top: auto;
  padding: 14px 12px 6px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.nav-footer .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #F97316, #FB923C);
  display: grid; place-items: center; font-weight: 700; color: #1A0B02;
}
.nav-footer .who { display: flex; flex-direction: column; line-height: 1.2; }
.nav-footer .who b { font-size: 13px; }
.nav-footer .who span { font-size: 11px; color: var(--text-3); }

/* ================ MAIN ================ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  padding: 0 26px;
  display: flex; align-items: center; gap: 20px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 10;
}
.topbar .search {
  flex: 1; max-width: 520px;
  position: relative;
}
.topbar .search input {
  width: 100%; padding: 10px 14px 10px 40px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-family: inherit; font-size: 13px;
  transition: border-color .15s;
}
.topbar .search input:focus { outline: none; border-color: rgba(249,115,22,0.45); }
.topbar .search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.topbar .kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 10px; color: var(--text-3); background: var(--bg-1); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }

.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  cursor: pointer; color: var(--text-2);
  transition: all .15s;
  position: relative;
}
.icon-btn:hover { color: var(--text-1); border-color: var(--border-strong); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg-1); }

.period-pill {
  padding: 8px 14px; border-radius: 10px;
  background: var(--surface-1); border: 1px solid var(--border);
  color: var(--text-1); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.period-pill .accent { color: var(--accent-2); }

/* ================ PAGES ================ */
.page-container { flex: 1; overflow-y: auto; padding: 28px 32px 100px; }
.page { display: none; animation: fade .3s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px;
}
.page-header h1 { margin-bottom: 6px; }
.page-header p { color: var(--text-2); }
.page-header .actions { display: flex; gap: 10px; }

.btn {
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-1);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .15s;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn.primary {
  background: var(--grad-primary); border: none; color: #1A0B02;
  box-shadow: 0 6px 20px rgba(249,115,22,0.28);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(249,115,22,0.36); }
.btn.ghost { background: transparent; }
.btn svg { width: 15px; height: 15px; }

/* ================ CARDS / GRID ================ */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid.kpi    { grid-template-columns: repeat(6, 1fr); }

.card {
  background: linear-gradient(180deg, var(--surface-1) 0%, rgba(19,27,44,0.75) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.card .card-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card .card-title h3 { font-size: 14px; letter-spacing: 0; color: var(--text-1); }
.card .card-title .subtle { font-size: 11px; color: var(--text-3); }

/* KPI cards */
.kpi-card {
  padding: 18px;
  min-height: 120px;
  background: linear-gradient(160deg, var(--surface-1), rgba(19,27,44,0.5));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(400px 120px at 100% 0%, rgba(249,115,22,0.10), transparent 60%);
  pointer-events: none;
}
.kpi-card .k-label {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-3); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600;
}
.kpi-card .k-value {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
  margin-top: 12px; color: var(--text-1);
  display: flex; align-items: baseline; gap: 6px;
}
.kpi-card .k-value .unit { font-size: 12px; color: var(--text-3); font-weight: 500; }
.kpi-card .k-delta { margin-top: 6px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.k-delta.up { color: var(--accent-2); }
.k-delta.down { color: var(--danger); }
.k-delta.flat { color: var(--text-3); }

/* Chart wrapper */
.chart-wrap {
  position: relative; height: 260px;
}
.chart-wrap.tall { height: 320px; }

/* ================ AI INSIGHTS ================ */
.insight-panel { display: flex; flex-direction: column; gap: 10px; }
.insight {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; gap: 12px; align-items: flex-start;
}
.insight .dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin-top: 6px; flex: none;
}
.insight .dot.high { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-dim); }
.insight .dot.medium { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-dim); }
.insight .dot.low { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.insight .body b { color: var(--text-1); }
.insight .body p { font-size: 12.5px; margin-top: 2px; }
.insight .body .cta { font-size: 11px; margin-top: 6px; color: var(--accent-2); cursor: pointer; }

/* ================ FRAMEWORK RINGS ================ */
.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.ring {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ring svg { width: 100px; height: 100px; }
.ring .r-title { font-size: 12px; color: var(--text-2); font-weight: 600; }
.ring .r-pct { font-size: 20px; font-weight: 700; }

/* ================ TABLES ================ */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.data-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: rgba(19,27,44,0.6);
  position: sticky; top: 0;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(19,27,44,0.6); }
.data-table code { font-family: var(--font-mono); font-size: 11px; color: var(--info); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-pill.Validated { background: var(--accent-dim); color: var(--accent-2); }
.status-pill.Validated::before { background: var(--accent-2); }
.status-pill.Pending { background: var(--info-dim); color: var(--info); }
.status-pill.Pending::before { background: var(--info); }
.status-pill.Flagged { background: var(--warn-dim); color: var(--warn); }
.status-pill.Flagged::before { background: var(--warn); }
.status-pill['Missing\ Evidence'], .status-pill.Missing { background: var(--danger-dim); color: var(--danger); }
.status-pill.Missing::before { background: var(--danger); }

.quality-bar {
  width: 80px; height: 5px; border-radius: 999px;
  background: rgba(255,255,255,0.05); overflow: hidden;
  display: inline-block; vertical-align: middle; margin-right: 8px;
}
.quality-bar .fill { height: 100%; border-radius: inherit; background: var(--grad-primary); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; color: var(--text-2);
}

.evidence-chip {
  padding: 3px 8px; border-radius: 6px;
  background: var(--info-dim); color: var(--info);
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ================ GHG CALC PANEL ================ */
.calc-formula {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-1);
  overflow-x: auto;
}
.calc-flow { display: grid; grid-template-columns: 1fr 40px 1fr 40px 1fr; gap: 10px; align-items: center; margin: 16px 0; }
.calc-tile {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
}
.calc-tile .l { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.calc-tile .v { font-size: 20px; font-weight: 700; color: var(--text-1); }
.calc-tile .u { font-size: 11px; color: var(--text-3); }
.calc-sym { text-align: center; font-size: 22px; color: var(--accent-2); font-weight: 700; }

.approval-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 8px;
}
.approval-row .step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none;
}
.approval-row.done .step-num { background: var(--accent-dim); color: var(--accent-2); }
.approval-row.pending .step-num { background: var(--info-dim); color: var(--info); }
.approval-row b { font-size: 13px; }
.approval-row .meta { font-size: 11px; color: var(--text-3); }
.approval-row .grow { flex: 1; }

/* ================ TARGETS ================ */
.target-card {
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-1), rgba(19,27,44,0.7));
  border: 1px solid var(--border);
}
.target-card h4 { font-size: 14px; margin-bottom: 4px; }
.target-card .due { font-size: 11px; color: var(--text-3); }
.target-card .pbar { margin: 14px 0 6px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.04); overflow: hidden; }
.target-card .pbar > div { height: 100%; background: var(--grad-primary); border-radius: inherit; }
.target-card .pmeta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.target-card .detail { margin-top: 10px; font-size: 12px; color: var(--text-2); }
.target-card .status-tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; margin-top: 8px;
}
.status-tag.on { background: var(--accent-dim); color: var(--accent-2); }
.status-tag.at { background: var(--danger-dim); color: var(--danger); }
.status-tag.plan { background: var(--info-dim); color: var(--info); }
.status-tag.rfp { background: var(--violet-dim); color: var(--violet); }

.kpi-mini {
  padding: 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.kpi-mini .l { font-size: 11px; color: var(--text-3); }
.kpi-mini .v { font-size: 18px; font-weight: 700; color: var(--text-1); margin: 4px 0; }
.kpi-mini .t { font-size: 10.5px; color: var(--text-3); }
.spark { height: 30px; margin-top: 6px; }

/* ================ MATRIX / STANDARDS ================ */
.matrix-cell {
  font-family: var(--font-mono); font-size: 11px;
  padding: 3px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-2);
  display: inline-block;
}
.matrix-cell.filled { background: rgba(249,115,22,0.16); color: var(--accent-2); }
.matrix-cell.empty { background: rgba(148,163,184,0.05); color: var(--text-3); }

.heat {
  display: grid; gap: 4px;
}
.heat-cell {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
}

/* ================ REPORTING STUDIO ================ */
.template-card {
  padding: 20px;
  border-radius: 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .18s;
  position: relative;
  overflow: hidden;
}
.template-card:hover { border-color: rgba(249,115,22,0.4); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.template-card .badge-row { display: flex; gap: 4px; margin-bottom: 8px; }
.template-card h4 { font-size: 15px; margin-bottom: 6px; }
.template-card p { font-size: 12px; }
.template-card .meta { display: flex; gap: 12px; margin-top: 12px; font-size: 11px; color: var(--text-3); }

.report-preview {
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, #F8FAFC 0%, #EDF2F7 100%);
  color: #0F172A;
  min-height: 380px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.report-preview .cover-wrap { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 2px solid #F97316;}
.report-preview .cover-wrap .brand { display: flex; gap: 10px; align-items: center; }
.report-preview .cover-wrap .mark {
  width: 48px; height: 48px;
  background-image: url("assets/beah-mark.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.report-preview h2 { color: #0F172A; margin-top: 16px; font-size: 24px; }
.report-preview .sub { color: #475569; font-size: 12px; margin-top: 6px; }
.report-preview h4 { color: #0F172A; margin: 18px 0 8px; }
.report-preview p { color: #334155; font-size: 12.5px; }
.report-preview .stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.report-preview .stat { padding: 10px; border-radius: 8px; background: white; border: 1px solid #E2E8F0; }
.report-preview .stat .l { font-size: 10px; color: #64748B; text-transform: uppercase; letter-spacing: 0.08em; }
.report-preview .stat .v { font-size: 18px; font-weight: 700; color: #0F172A; }
.report-preview .fw-list { display: flex; gap: 6px; flex-wrap: wrap; }
.report-preview .fw-pill { background: rgba(249,115,22,0.12); color: #047857; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }

/* ================ LINEAGE GRAPH ================ */
.lineage-graph {
  padding: 20px;
  border-radius: 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  overflow-x: auto;
  min-height: 460px;
}
.lineage-node {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px;
}
.lineage-node.disclosure { background: var(--grad-sub); border-color: rgba(249,115,22,0.35); }
.lineage-node .type-tag { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); border: 1px solid var(--border); padding: 2px 5px; border-radius: 4px; }

/* ================ CHATBOT ================ */
.chat-fab {
  position: fixed; bottom: 26px; right: 26px;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--grad-primary);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(249,115,22,0.45);
  z-index: 100;
  transition: transform .15s;
}
.chat-fab:hover { transform: translateY(-3px) scale(1.03); }
.chat-fab svg { width: 26px; height: 26px; color: #1A0B02; }
.chat-fab .pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 0; }
}

.chat-panel {
  position: fixed; bottom: 100px; right: 26px;
  width: 420px; height: 620px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  z-index: 101;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel.open { display: flex; animation: slideUp .25s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, rgba(249,115,22,0.10), rgba(6,182,212,0.06));
}
.chat-header .ai-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--grad-primary);
  display: grid; place-items: center;
  color: #1A0B02;
}
.chat-header .ai-info b { display: block; font-size: 14px; }
.chat-header .ai-info span { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.chat-header .ai-info span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-dim); }
.chat-header .close { margin-left: auto; cursor: pointer; color: var(--text-3); }

.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.msg { max-width: 85%; display: flex; flex-direction: column; gap: 4px; }
.msg.bot { align-self: flex-start; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg .bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.5;
}
.msg.bot .bubble { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-1); border-bottom-left-radius: 4px; }
.msg.user .bubble { background: var(--grad-primary); color: #1A0B02; border-bottom-right-radius: 4px; font-weight: 500; }
.msg .cite { font-size: 10.5px; color: var(--text-3); display: flex; gap: 4px; flex-wrap: wrap; }
.msg .cite code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-family: var(--font-mono); color: var(--info); }

.typing { display: inline-flex; gap: 3px; padding: 12px 14px; background: var(--surface-2); border-radius: 14px; border: 1px solid var(--border); }
.typing span { width: 6px; height: 6px; background: var(--text-3); border-radius: 50%; animation: typing 1.4s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

.chat-suggestions { padding: 8px 16px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.suggest-chip {
  padding: 6px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 11px; cursor: pointer;
  transition: all .15s;
}
.suggest-chip:hover { border-color: rgba(249,115,22,0.4); color: var(--text-1); }

.chat-input {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.chat-input input {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-1); font-family: inherit; font-size: 13px;
}
.chat-input input:focus { outline: none; border-color: rgba(249,115,22,0.5); }
.chat-input button {
  width: 42px; height: 42px; border-radius: 10px;
  border: none; background: var(--grad-primary);
  color: #1A0B02; cursor: pointer;
  display: grid; place-items: center;
}
.chat-input button svg { width: 16px; height: 16px; }

/* ================ MAP ================ */
.oman-map { width: 100%; height: 340px; }
.oman-map .land { fill: rgba(249,115,22,0.06); stroke: rgba(249,115,22,0.35); stroke-width: 1.5; }
.oman-map .pin { cursor: pointer; }
.oman-map .pin circle.outer { fill: none; stroke-width: 2; }
.oman-map .pin circle.inner { }
.oman-map .pin.landfill circle.outer { stroke: var(--accent-2); }
.oman-map .pin.landfill circle.inner { fill: var(--accent-2); }
.oman-map .pin.industrial circle.outer { stroke: var(--info); }
.oman-map .pin.industrial circle.inner { fill: var(--info); }
.oman-map .pin.healthcare circle.outer { stroke: var(--violet); }
.oman-map .pin.healthcare circle.inner { fill: var(--violet); }
.oman-map .pin.planned circle.outer { stroke: var(--warn); stroke-dasharray: 3 3; }
.oman-map .pin.planned circle.inner { fill: var(--warn); }
.oman-map .pin:hover circle.outer { r: 14; }
.oman-map .pin text { fill: var(--text-2); font-size: 9px; font-family: var(--font-sans); text-anchor: middle; pointer-events: none; }

.legend { display: flex; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--text-3); }
.legend .li { display: flex; align-items: center; gap: 6px; }
.legend .li .sw { width: 10px; height: 10px; border-radius: 50%; }

/* Utility */
.row-flex { display: flex; align-items: center; gap: 12px; }
.mt-14 { margin-top: 14px; }
.mt-20 { margin-top: 20px; }
.mb-14 { margin-bottom: 14px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.small { font-size: 12px; color: var(--text-2); }
.tiny { font-size: 11px; color: var(--text-3); }
.right { text-align: right; }
.mono { font-family: var(--font-mono); font-size: 11px; color: var(--info); }

.tab-bar { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; padding-bottom: 0; }
.tab-bar .tab {
  padding: 10px 16px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  transition: all .15s;
}
.tab-bar .tab:hover { color: var(--text-1); }
.tab-bar .tab.active { color: var(--accent-2); border-color: var(--accent-2); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.15); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.3); }

/* ============================================================
   ENHANCED · OVERVIEW HERO, MATERIALITY, SDGs, SCENARIOS
   ============================================================ */

.hero-card {
  padding: 26px 30px;
  border-radius: 20px;
  background:
    radial-gradient(600px 200px at 90% 20%, rgba(249,115,22,0.14), transparent 70%),
    radial-gradient(400px 180px at 10% 100%, rgba(6,182,212,0.10), transparent 70%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 25% 30%, rgba(249,115,22,0.4), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(6,182,212,0.4), transparent),
    radial-gradient(1px 1px at 85% 20%, rgba(52,211,153,0.3), transparent);
  pointer-events: none;
  opacity: 0.4;
}
.hero-left { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.3);
  color: var(--accent-2); font-size: 11px; font-weight: 600;
  margin-bottom: 12px;
}
.hero-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.hero-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.hero-title .accent { background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-2); font-size: 14px; line-height: 1.6; max-width: 560px; }
.hero-metrics { display: flex; gap: 30px; margin-top: 22px; }
.hero-metrics .hm {
  padding-left: 16px; border-left: 2px solid var(--accent);
}
.hero-metrics .hm .l { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.10em; font-weight: 600; }
.hero-metrics .hm .v { font-size: 20px; font-weight: 700; color: var(--text-1); margin-top: 4px; }
.hero-metrics .hm .t { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.hero-right {
  position: relative; z-index: 1;
  padding: 18px;
  border-radius: 14px;
  background: rgba(11, 17, 28, 0.5);
  border: 1px solid var(--border);
}
.hero-right h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); margin-bottom: 12px; }
.priority-list { display: flex; flex-direction: column; gap: 8px; }
.priority-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px;
}
.priority-row .pri-tag {
  padding: 2px 7px; border-radius: 6px;
  font-size: 10px; font-weight: 700;
}
.priority-row.p1 .pri-tag { background: var(--danger-dim); color: var(--danger); }
.priority-row.p2 .pri-tag { background: var(--warn-dim); color: var(--warn); }
.priority-row.p3 .pri-tag { background: var(--info-dim); color: var(--info); }
.priority-row .p-title { flex: 1; color: var(--text-1); font-weight: 500; }
.priority-row .p-by { color: var(--text-3); font-size: 11px; }

/* KPI cards with sparklines */
.kpi-card .k-spark {
  height: 32px; margin-top: 8px;
}
.kpi-card .k-spark polyline { stroke-linejoin: round; }

/* Materiality Matrix */
.materiality-canvas {
  position: relative;
  height: 320px; width: 100%;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(148,163,184,0.10) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgba(148,163,184,0.10) 50%, transparent 50.2%);
  border-radius: 12px;
  overflow: visible;
}
/* Card holding the materiality canvas must allow tooltip overflow */
.card:has(.materiality-canvas) { overflow: visible; }
.materiality-axis {
  position: absolute;
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.materiality-axis.x { bottom: 4px; right: 8px; }
.materiality-axis.y { top: 4px; left: 8px; transform-origin: top left; }
.materiality-bubble {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, 50%);
  cursor: pointer;
  transition: all .15s;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700;
  color: white;
  border: 2px solid rgba(255,255,255,0.14);
}
.materiality-bubble:hover { transform: translate(-50%, 50%) scale(1.15); z-index: 10; }
.materiality-bubble.E { background: rgba(249,115,22,0.75); }
.materiality-bubble.S { background: rgba(6,182,212,0.75); }
.materiality-bubble.G { background: rgba(139,92,246,0.75); }
.materiality-bubble .tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  padding: 6px 10px; background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--text-1);
  white-space: nowrap; display: none; z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  pointer-events: none;
  max-width: 220px;
}
.materiality-bubble .tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--border-strong);
}
/* Bubbles near right edge — anchor tooltip to the right */
.materiality-bubble.tip-right .tip { left: auto; right: 0; transform: none; }
.materiality-bubble.tip-right .tip::after { left: auto; right: 14px; transform: none; }
/* Bubbles near left edge — anchor tooltip to the left */
.materiality-bubble.tip-left .tip { left: 0; transform: none; }
.materiality-bubble.tip-left .tip::after { left: 14px; transform: none; }
.materiality-bubble:hover .tip { display: block; }
[data-theme="light"] .materiality-bubble .tip { box-shadow: 0 10px 30px rgba(15,23,42,0.14); }

/* SDG Grid */
.sdg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
}
.sdg-tile {
  aspect-ratio: 1;
  border-radius: 10px;
  padding: 8px;
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer;
  transition: transform .15s;
  color: white;
  min-width: 0;
  overflow: hidden;
}
.sdg-tile:hover { transform: translateY(-2px) scale(1.03); }
.sdg-tile .sn { font-size: 20px; font-weight: 800; line-height: 1; }
.sdg-tile .snm {
  font-size: 9px; font-weight: 700; opacity: 0.95;
  text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  word-break: keep-all;
}

/* Dept quality bars */
.dept-list { display: flex; flex-direction: column; gap: 10px; }
.dept-row { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.dept-row .d-name { flex: 1; color: var(--text-1); font-weight: 500; }
.dept-row .d-bar { flex: 1.5; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.04); overflow: hidden; }
.dept-row .d-bar > div { height: 100%; border-radius: inherit; background: var(--grad-primary); }
.dept-row .d-pct { color: var(--text-2); font-weight: 600; min-width: 40px; text-align: right; }
.dept-row .d-count { color: var(--text-3); font-size: 11px; min-width: 60px; text-align: right; }

/* ============================================================
   ENHANCED · GHG · SANKEY, MACC, FACILITY, SCOPE 3
   ============================================================ */

.scope-summary {
  padding: 20px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(249,115,22,0.10), rgba(6,182,212,0.06));
  border: 1px solid rgba(249,115,22,0.28);
  margin-bottom: 20px;
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
}
.scope-summary .sc-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }
.scope-summary .sc-value { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.scope-summary .sc-value .u { font-size: 14px; color: var(--text-2); font-weight: 500; margin-left: 6px; }
.scope-summary .sc-sub { font-size: 13px; color: var(--text-2); margin-top: 8px; max-width: 520px; }
.scope-summary .sc-chip-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.scope-summary .sc-status {
  padding: 8px 16px; border-radius: 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.scope-summary .sc-status.complete { background: var(--accent-dim); color: var(--accent-2); }
.scope-summary .sc-status.gap { background: var(--warn-dim); color: var(--warn); }

/* Sankey */
.sankey-svg { width: 100%; height: 340px; }
.sankey-node rect { stroke: rgba(148,163,184,0.20); stroke-width: 1; }
.sankey-node text { font-size: 11px; fill: var(--text-1); font-family: var(--font-sans); }
.sankey-link { fill-opacity: 0.35; transition: fill-opacity .15s; }
.sankey-link:hover { fill-opacity: 0.65; }

/* MACC (Marginal Abatement Cost) */
.macc-chart { position: relative; height: 320px; width: 100%; }
.macc-bar { transition: opacity .15s; cursor: pointer; }
.macc-bar:hover { opacity: 0.75; }
.macc-tip {
  position: absolute; padding: 8px 12px; background: var(--bg-2);
  border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 11px; color: var(--text-1); pointer-events: none;
  display: none; z-index: 50;
}

/* Scope 3 category grid */
.s3-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.s3-card {
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; gap: 12px;
}
.s3-card .s3-num {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-3); display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  color: var(--text-2);
  flex: none;
}
.s3-card .s3-body { flex: 1; }
.s3-card .s3-body b { font-size: 12px; }
.s3-card .s3-body .s3-meta { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.s3-card .s3-tag {
  padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700;
}
.s3-tag.High { background: var(--danger-dim); color: var(--danger); }
.s3-tag.Medium { background: var(--warn-dim); color: var(--warn); }
.s3-tag.Low { background: var(--info-dim); color: var(--info); }
.s3-tag['N/A'], .s3-tag.na { background: var(--surface-3); color: var(--text-3); }

/* Facility heatmap table */
.heat-td { font-family: var(--font-mono); text-align: right; padding: 8px 12px; border-radius: 4px; font-size: 11.5px; }

/* Scenario simulator */
.simulator-card {
  padding: 20px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border);
}
.sim-toggle {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; margin-bottom: 8px;
  transition: all .15s;
}
.sim-toggle:hover { border-color: var(--border-strong); }
.sim-toggle.active { border-color: rgba(249,115,22,0.5); background: var(--accent-dim); }
.sim-toggle .sim-check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--text-3); display: grid; place-items: center;
  flex: none;
}
.sim-toggle.active .sim-check { border-color: var(--accent-2); background: var(--accent-2); color: #1A0B02; }
.sim-toggle .sim-title { flex: 1; font-size: 13px; font-weight: 600; }
.sim-toggle .sim-impact { font-family: var(--font-mono); font-size: 12px; color: var(--accent-2); }

/* GHG page — tab click brings different content */
.tab.disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   ENHANCED · REPORTING STUDIO
   ============================================================ */

.report-hero {
  padding: 26px 30px;
  border-radius: 20px;
  background:
    radial-gradient(500px 200px at 100% 20%, rgba(6,182,212,0.12), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border);
  margin-bottom: 22px;
  display: grid; grid-template-columns: 2fr 1fr; gap: 30px; align-items: center;
}
.report-hero h2 { font-size: 24px; }
.report-hero p { color: var(--text-2); margin-top: 6px; max-width: 560px; }

.template-visual {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  margin-bottom: 14px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  color: white;
  display: flex; flex-direction: column; justify-content: space-between;
}
.template-visual.tv-gri     { background: linear-gradient(135deg, #10B981 0%, #047857 100%); }
.template-visual.tv-oia     { background: linear-gradient(135deg, #8B5CF6 0%, #4C1D95 100%); }
.template-visual.tv-board   { background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%); border: 1px solid var(--border); }
.template-visual.tv-ifrs    { background: linear-gradient(135deg, #F59E0B 0%, #B45309 100%); }
.template-visual.tv-onzc    { background: linear-gradient(135deg, #34D399 0%, #059669 100%); }
.template-visual.tv-digital { background: linear-gradient(135deg, #06B6D4 0%, #0369A1 100%); }
.template-visual::after {
  content: ""; position: absolute; right: -30px; bottom: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.10); pointer-events: none;
}
.template-visual .tv-brand { font-size: 11px; font-weight: 700; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.14em; }
.template-visual .tv-title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.template-visual .tv-meta { font-size: 10px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.1em; }
.template-visual .tv-mock {
  display: flex; flex-direction: column; gap: 3px; margin: 6px 0;
  opacity: 0.55;
}
.template-visual .tv-mock span { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.7); }
.template-visual .tv-mock span:nth-child(1) { width: 65%; }
.template-visual .tv-mock span:nth-child(2) { width: 90%; }
.template-visual .tv-mock span:nth-child(3) { width: 45%; }

.template-card { padding: 16px; }
.template-card .tc-body { font-size: 12px; color: var(--text-2); }

/* Report preview — magazine style */
.report-preview-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.report-preview-tabs .rpt {
  padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--text-3);
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.report-preview-tabs .rpt:hover { color: var(--text-1); }
.report-preview-tabs .rpt.active { color: var(--accent-2); border-color: var(--accent-2); }

.magazine {
  min-height: 440px;
  border-radius: 14px;
  background: #FDFEFE;
  color: #0F172A;
  padding: 28px 32px;
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
}
.magazine .mag-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid #F97316; padding-bottom: 12px; }
.magazine .mag-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.03em; }
.magazine .mag-brand .mm {
  width: 44px; height: 44px;
  background-image: url("assets/beah-mark.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.magazine .mag-page { font-size: 11px; color: #64748B; font-family: var(--font-mono); }
.magazine h1 { color: #0F172A; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 22px; }
.magazine h1 .mg-accent { background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.magazine .mag-sub { color: #475569; font-size: 13px; margin-top: 6px; }
.magazine h3 { color: #0F172A; margin-top: 22px; font-size: 16px; }
.magazine p { color: #334155; font-size: 12.5px; line-height: 1.65; }
.magazine .mag-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.magazine .mag-stat { padding: 12px; border-radius: 10px; background: #F1F5F9; border-left: 3px solid #F97316; }
.magazine .mag-stat .l { font-size: 10px; color: #64748B; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.magazine .mag-stat .v { font-size: 18px; font-weight: 800; color: #0F172A; margin-top: 4px; }
.magazine .mag-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.magazine .mag-chip { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(249,115,22,0.14); color: #047857; }

/* Pipeline stepper */
.pipeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.pipe-step {
  padding: 14px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  position: relative;
  text-align: center;
}
.pipe-step.done { background: var(--accent-dim); border-color: rgba(249,115,22,0.4); }
.pipe-step.active { background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(249,115,22,0.10)); border-color: rgba(6,182,212,0.5); box-shadow: 0 0 20px rgba(6,182,212,0.15); }
.pipe-step .ps-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); display: grid; place-items: center;
  margin: 0 auto 8px; font-size: 12px; font-weight: 700; color: var(--text-3);
}
.pipe-step.done .ps-num { background: var(--accent); color: #1A0B02; }
.pipe-step.active .ps-num { background: var(--info); color: #1A0B02; }
.pipe-step .ps-title { font-size: 12px; font-weight: 700; color: var(--text-1); }
.pipe-step .ps-detail { font-size: 10.5px; color: var(--text-3); margin-top: 4px; }
.pipe-step.active .ps-detail { color: var(--info); }

/* Publish channels */
.channel-card {
  padding: 14px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.channel-card .ch-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--grad-sub); display: grid; place-items: center;
  color: var(--accent-2); flex: none;
}
.channel-card .ch-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.channel-card .ch-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Digital microsite frame */
.microsite {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border);
  background: #FDFEFE; color: #0F172A;
  min-height: 340px;
}
.microsite .m-nav {
  background: #0F172A; color: white; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px; font-size: 12px;
}
.microsite .m-nav .m-brand { font-weight: 700; letter-spacing: 0.04em; margin-right: auto; }
.microsite .m-nav .m-link { color: rgba(255,255,255,0.7); cursor: pointer; }
.microsite .m-nav .m-link.on { color: var(--accent-2); font-weight: 600; }
.microsite .m-hero {
  padding: 30px 24px 24px;
  background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
  color: white;
}
.microsite .m-hero h3 { color: white; font-size: 22px; }
.microsite .m-hero p { color: rgba(255,255,255,0.9); font-size: 12px; }
.microsite .m-body { padding: 20px 24px; }
.microsite .m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.microsite .m-stat { padding: 12px; border-radius: 8px; background: #F8FAFC; }
.microsite .m-stat .l { font-size: 10px; color: #64748B; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.microsite .m-stat .v { font-size: 16px; font-weight: 800; color: #0F172A; margin-top: 3px; }

/* Compliance checklist */
.comp-list { display: flex; flex-direction: column; gap: 6px; }
.comp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px;
}
.comp-row .comp-status {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  flex: none;
}
.comp-row.done .comp-status { background: var(--accent-dim); color: var(--accent-2); }
.comp-row.warn .comp-status { background: var(--warn-dim); color: var(--warn); }
.comp-row.gap .comp-status { background: var(--danger-dim); color: var(--danger); }
.comp-row .comp-text { flex: 1; color: var(--text-1); }

/* Language toggle */
.lang-toggle {
  display: inline-flex; padding: 3px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.lang-toggle .lt {
  padding: 5px 12px; border-radius: 7px; font-size: 11px; font-weight: 600;
  color: var(--text-3); cursor: pointer;
}
.lang-toggle .lt.on { background: var(--grad-primary); color: #1A0B02; }

/* ============================================================
   LIGHT-MODE COMPONENT OVERRIDES
   ============================================================ */
[data-theme="light"] .kpi-card,
[data-theme="light"] .card,
[data-theme="light"] .target-card,
[data-theme="light"] .simulator-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFDFE 100%);
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 12px rgba(15,23,42,.04);
}
[data-theme="light"] .kpi-card::before,
[data-theme="light"] .hero-card::before,
[data-theme="light"] .report-hero::before { opacity: 0.55; }
[data-theme="light"] .hero-card,
[data-theme="light"] .report-hero {
  background:
    radial-gradient(600px 200px at 90% 20%, rgba(249,115,22,0.10), transparent 70%),
    radial-gradient(400px 180px at 10% 100%, rgba(6,182,212,0.08), transparent 70%),
    linear-gradient(180deg, #FFFFFF, #F8FAFC);
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 12px rgba(15,23,42,.05);
}
[data-theme="light"] .icon-btn,
[data-theme="light"] .period-pill,
[data-theme="light"] .chip,
[data-theme="light"] .btn,
[data-theme="light"] .approval-row,
[data-theme="light"] .kpi-mini,
[data-theme="light"] .channel-card,
[data-theme="light"] .s3-card,
[data-theme="light"] .comp-row,
[data-theme="light"] .priority-row,
[data-theme="light"] .sim-toggle,
[data-theme="light"] .insight {
  background: #FFFFFF;
  border-color: var(--border-strong);
}
[data-theme="light"] .btn.primary {
  color: #1A0B02;
}
[data-theme="light"] .hero-right {
  background: rgba(255,255,255,0.85);
}
[data-theme="light"] .data-table th {
  background: #F8FAFC;
}
[data-theme="light"] .data-table tr:hover td { background: #F8FAFC; }
[data-theme="light"] .calc-formula,
[data-theme="light"] .lineage-graph {
  background: #F8FAFC;
}
[data-theme="light"] .calc-tile,
[data-theme="light"] .quality-bar,
[data-theme="light"] .target-card .pbar,
[data-theme="light"] .dept-row .d-bar {
  background: #F1F5F9;
}
[data-theme="light"] .quality-bar { background: #E2E8F0; }
[data-theme="light"] .k-value,
[data-theme="light"] h1, [data-theme="light"] h2,
[data-theme="light"] h3, [data-theme="light"] h4 { color: var(--text-1); }
[data-theme="light"] .nav-item.active {
  background: linear-gradient(90deg, rgba(249,115,22,0.10), rgba(6,182,212,0.05));
}
[data-theme="light"] .nav-item.active::before {
  content: "";
}
[data-theme="light"] .lineage-node {
  background: #FFFFFF;
}
[data-theme="light"] .sankey-node text { fill: var(--text-1); }
[data-theme="light"] .chat-panel,
[data-theme="light"] .chat-input input,
[data-theme="light"] .msg.bot .bubble,
[data-theme="light"] .typing,
[data-theme="light"] .suggest-chip {
  background: #FFFFFF;
  border-color: var(--border-strong);
  color: var(--text-1);
}
[data-theme="light"] .chat-header {
  background: linear-gradient(90deg, rgba(249,115,22,0.08), rgba(6,182,212,0.04));
}
[data-theme="light"] .pipe-step { background: #FFFFFF; }
[data-theme="light"] .pipe-step.done { background: rgba(249,115,22,0.08); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.12); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  padding: 3px; border-radius: 999px;
  background: var(--surface-1); border: 1px solid var(--border);
  cursor: pointer;
  gap: 2px;
}
.theme-toggle .tt {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: all .15s;
}
.theme-toggle .tt.on {
  background: var(--grad-primary);
  color: #1A0B02;
  box-shadow: 0 4px 12px rgba(249,115,22,0.30);
}
.theme-toggle svg { width: 15px; height: 15px; }

/* ============================================================
   PUBLISHING PIPELINE — full-width flow with arrows
   ============================================================ */

.pipeline-strip {
  padding: 22px 26px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-1), rgba(19,27,44,0.6));
  border: 1px solid var(--border);
  margin-bottom: 22px;
  overflow-x: auto;
}
[data-theme="light"] .pipeline-strip {
  background: linear-gradient(180deg, #FFFFFF, #FCFDFE);
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 12px rgba(15,23,42,.04);
}
.pipeline-strip .ps-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.pipeline-strip .ps-header h3 { display: flex; align-items: center; gap: 8px; }
.pipeline-strip .ps-header .ps-eyebrow {
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700;
}
.pipeline-flow {
  display: flex; align-items: center;
  gap: 0;
  min-width: 900px;
}
.pipe-node {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 14px;
  transition: all .18s;
  cursor: pointer;
  position: relative;
}
.pipe-node:hover { background: var(--surface-2); }
.pipe-circle {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  background: var(--surface-2);
  border: 2px solid var(--border-strong);
  color: var(--text-3);
  position: relative;
  transition: all .18s;
}
.pipe-node.done .pipe-circle {
  background: linear-gradient(135deg, rgba(249,115,22,0.18), rgba(249,115,22,0.08));
  border-color: var(--accent);
  color: var(--accent-2);
}
.pipe-node.active .pipe-circle {
  background: var(--grad-primary);
  border-color: transparent;
  color: #1A0B02;
  box-shadow: 0 8px 30px rgba(249,115,22,0.45), 0 0 0 6px rgba(249,115,22,0.10);
}
.pipe-node.active::after {
  content: ""; position: absolute; top: 20px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2);
  animation: pulseDot 2s ease-in-out infinite;
}
.pipe-labels { text-align: center; }
.pipe-labels .pl-title { font-size: 13px; font-weight: 700; color: var(--text-1); }
.pipe-labels .pl-detail { font-size: 11px; color: var(--text-3); margin-top: 3px; max-width: 130px; line-height: 1.35; }
.pipe-node.active .pl-title { color: var(--accent-2); }
.pipe-node.done .pl-title { color: var(--text-1); }
.pipe-arrow {
  flex: 0 0 40px;
  height: 2px;
  background: var(--border-strong);
  position: relative;
  margin-top: -30px; /* align to circle center */
}
.pipe-arrow.done {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 100%);
}
.pipe-arrow::after {
  content: ""; position: absolute; right: -1px; top: -3px;
  width: 0; height: 0;
  border-left: 6px solid var(--border-strong);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.pipe-arrow.done::after { border-left-color: var(--accent); }

/* ============================================================
   ENRICHED MAGAZINE PREVIEW COMPONENTS
   ============================================================ */
.magazine { padding: 0; overflow: hidden; }
.mag-inner { padding: 28px 32px; }
.mag-banner {
  height: 100px;
  background:
    radial-gradient(400px 100px at 10% 60%, rgba(255,255,255,0.28), transparent 60%),
    linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  display: flex; align-items: center; padding: 0 32px;
  color: white; position: relative;
}
.mag-banner::after {
  content: ""; position: absolute; right: -30px; bottom: -30px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,0.10);
}
.mag-banner .mb-brand { font-weight: 800; letter-spacing: 0.04em; font-size: 18px; }
.mag-banner .mb-crumb { margin-left: auto; font-size: 11px; opacity: 0.85; letter-spacing: 0.14em; text-transform: uppercase; }

.mag-two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-top: 18px; }
.mag-three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.mag-callout {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(249,115,22,0.10), rgba(6,182,212,0.06));
  border-left: 3px solid #F97316;
}
.mag-callout .mc-l { font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase; color: #047857; font-weight: 700; }
.mag-callout .mc-q { font-size: 13px; font-style: italic; color: #0F172A; margin-top: 6px; line-height: 1.5; }
.mag-callout .mc-a { font-size: 11px; color: #475569; margin-top: 8px; font-weight: 600; }

.mag-mini-donut { width: 130px; height: 130px; }
.mag-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 11px; color: #334155; }
.mag-legend .ml { display: flex; align-items: center; gap: 6px; }
.mag-legend .ml .sw { width: 10px; height: 10px; border-radius: 3px; }

.mag-bar-row { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.mag-bar {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: #475569;
}
.mag-bar .mb-lab { flex: 0 0 90px; font-weight: 600; }
.mag-bar .mb-track { flex: 1; height: 6px; border-radius: 999px; background: #E2E8F0; overflow: hidden; }
.mag-bar .mb-track > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #F97316, #FB923C); }
.mag-bar .mb-val { flex: 0 0 60px; text-align: right; font-weight: 700; color: #0F172A; }

.mag-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.mag-board-cell {
  padding: 10px 8px;
  border-radius: 8px; text-align: center;
  background: #F1F5F9; border: 1px solid #E2E8F0;
}
.mag-board-cell .mbc-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #F97316, #FB923C);
  color: white; font-weight: 800; font-size: 12px;
  display: grid; place-items: center; margin: 0 auto 6px;
}
.mag-board-cell .mbc-name { font-size: 10.5px; font-weight: 700; color: #0F172A; line-height: 1.2; }
.mag-board-cell .mbc-role { font-size: 9.5px; color: #64748B; margin-top: 2px; }
.mag-board-cell.independent { border-color: #F97316; }
.mag-board-cell.independent .mbc-role::before { content: "✓ "; color: #047857; font-weight: 700; }

.mag-sdg-strip { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.mag-sdg-tile {
  width: 34px; height: 34px; border-radius: 6px;
  display: grid; place-items: center;
  font-weight: 800; color: white; font-size: 11px;
}

.mag-flow { display: flex; align-items: center; gap: 4px; margin-top: 14px; }
.mag-flow-step {
  flex: 1; text-align: center;
  padding: 10px 6px; border-radius: 8px;
  background: #F1F5F9; border: 1px solid #E2E8F0;
  font-size: 10.5px; font-weight: 600; color: #0F172A;
}
.mag-flow-step .fs-icon { font-size: 16px; display: block; margin-bottom: 4px; }
.mag-flow-arr { color: #F97316; font-weight: 800; }

.mag-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.mag-tag.env { background: rgba(249,115,22,0.14); color: #047857; }
.mag-tag.soc { background: rgba(6,182,212,0.14); color: #0369A1; }
.mag-tag.gov { background: rgba(139,92,246,0.14); color: #6D28D9; }

/* ============================================================
   DETAIL DRAWER (slide-in from right)
   ============================================================ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 9, 15, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  z-index: 400;
  transition: opacity .2s ease;
}
[data-theme="light"] .drawer-backdrop { background: rgba(15, 23, 42, 0.35); }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background: var(--bg-2);
  border-left: 1px solid var(--border-strong);
  box-shadow: -30px 0 80px rgba(0,0,0,.4);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
  z-index: 401;
  display: flex; flex-direction: column;
}
[data-theme="light"] .drawer { background: #FFFFFF; box-shadow: -30px 0 80px rgba(15,23,42,.14); }
.drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: linear-gradient(135deg, rgba(249,115,22,0.08), transparent 60%);
}
.drawer-header .dh-eyebrow {
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.drawer-header h2 { font-size: 20px; letter-spacing: -0.01em; }
.drawer-header p { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.drawer-header .dh-close {
  position: absolute; top: 18px; right: 18px;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-3); display: grid; place-items: center; cursor: pointer;
  transition: all .15s;
}
.drawer-header .dh-close:hover { color: var(--text-1); border-color: var(--border-strong); }
[data-theme="light"] .drawer-header .dh-close { background: #F8FAFC; }

.drawer-tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--border); }
.drawer-tabs .dt {
  padding: 12px 14px; font-size: 12px; font-weight: 600; color: var(--text-3);
  cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s;
}
.drawer-tabs .dt:hover { color: var(--text-1); }
.drawer-tabs .dt.active { color: var(--accent-2); border-color: var(--accent-2); }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 24px; }
.drawer-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* Drawer content components */
.dw-section { margin-bottom: 22px; }
.dw-section h4 {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3);
  font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.dw-section h4 .cnt {
  padding: 1px 8px; border-radius: 999px; background: var(--surface-2);
  font-size: 10px; color: var(--text-2);
}
.dw-hero {
  padding: 18px 20px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(249,115,22,0.14), rgba(6,182,212,0.08));
  border: 1px solid rgba(249,115,22,0.28);
  margin-bottom: 18px;
}
.dw-hero .dwh-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); font-weight: 700; }
.dw-hero .dwh-v { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.dw-hero .dwh-v .u { font-size: 14px; color: var(--text-2); font-weight: 500; margin-left: 6px; }
.dw-hero .dwh-sub { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.dw-hero .dwh-bar { margin-top: 14px; height: 10px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.dw-hero .dwh-bar > div { height: 100%; border-radius: inherit; background: var(--grad-primary); }
.dw-hero .dwh-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 6px; }
[data-theme="light"] .dw-hero .dwh-bar { background: rgba(15,23,42,0.06); }

.dw-kv {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.dw-kv-row {
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.dw-kv-row .kv-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.10em; color: var(--text-3); font-weight: 600; }
.dw-kv-row .kv-v { font-size: 14px; font-weight: 700; color: var(--text-1); margin-top: 3px; }
[data-theme="light"] .dw-kv-row { background: #F8FAFC; }

.dw-timeline { position: relative; padding-left: 24px; }
.dw-timeline::before {
  content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border-strong);
}
.dw-tl-item {
  position: relative; padding-bottom: 16px;
}
.dw-tl-item::before {
  content: ""; position: absolute; left: -22px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface-3); border: 2px solid var(--border-strong);
}
.dw-tl-item.done::before { background: var(--accent-2); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.dw-tl-item.active::before { background: var(--info); border-color: var(--info); box-shadow: 0 0 0 3px var(--info-dim); animation: pulseDot 2s ease-in-out infinite; }
.dw-tl-item .tl-date { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.dw-tl-item .tl-title { font-size: 13px; font-weight: 700; color: var(--text-1); margin-top: 2px; }
.dw-tl-item .tl-detail { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }

.dw-list { display: flex; flex-direction: column; gap: 8px; }
.dw-list-item {
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: border-color .15s;
}
.dw-list-item:hover { border-color: var(--border-strong); }
.dw-list-item .li-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-3); display: grid; place-items: center;
  flex: none; color: var(--accent-2);
}
.dw-list-item .li-body { flex: 1; min-width: 0; }
.dw-list-item .li-body b { font-size: 12.5px; color: var(--text-1); display: block; }
.dw-list-item .li-body .li-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.dw-list-item .li-tag {
  padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700;
}
[data-theme="light"] .dw-list-item { background: #F8FAFC; }

.dw-activity { display: flex; flex-direction: column; gap: 10px; }
.dw-act {
  display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
[data-theme="light"] .dw-act { background: #F8FAFC; }
.dw-act .av {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #F97316, #FB923C);
  color: #1A0B02; font-weight: 700; font-size: 11px;
  display: grid; place-items: center; flex: none;
}
.dw-act .body b { font-size: 12px; color: var(--text-1); }
.dw-act .body p { font-size: 11.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.dw-act .body .when { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }

.dw-chart { height: 160px; margin-top: 4px; }

.dw-tabpanel { display: none; }
.dw-tabpanel.active { display: block; animation: fade .25s ease; }

/* Selectable table rows (drill-down) */
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr.selected td { background: var(--accent-dim) !important; }
.target-card { cursor: pointer; transition: all .18s; }
.target-card:hover { border-color: rgba(249,115,22,0.35); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.28); }
[data-theme="light"] .target-card:hover { box-shadow: 0 12px 30px rgba(15,23,42,.10); }
.kpi-card { cursor: pointer; transition: all .18s; }
.kpi-card:hover { border-color: rgba(249,115,22,0.30); transform: translateY(-2px); }
.kpi-mini { cursor: pointer; transition: border-color .15s, transform .18s; }
.kpi-mini:hover { border-color: rgba(249,115,22,0.30); transform: translateY(-1px); }

/* ============================================================
   MODAL SYSTEM
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 9, 15, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 500;
  opacity: 0; transition: opacity .18s ease;
}
[data-theme="light"] .modal-backdrop { background: rgba(15, 23, 42, 0.4); }
.modal-backdrop.open { display: flex; opacity: 1; }
.modal-panel {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  width: min(720px, 92vw);
  max-height: 92vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 40px 80px rgba(0,0,0,.55);
  transform: translateY(16px) scale(0.98);
  transition: transform .22s cubic-bezier(.2,.7,.2,1);
}
.modal-backdrop.open .modal-panel { transform: translateY(0) scale(1); }
[data-theme="light"] .modal-panel { background: #FFFFFF; box-shadow: 0 30px 80px rgba(15,23,42,.20); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
}
.modal-header .mh-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--grad-primary);
  display: grid; place-items: center;
  color: #1A0B02; flex: none;
}
.modal-header .mh-icon svg { width: 20px; height: 20px; }
.modal-header .mh-title { flex: 1; }
.modal-header .mh-title h3 { font-size: 16px; }
.modal-header .mh-title p { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.modal-header .mh-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  display: grid; place-items: center; cursor: pointer;
  transition: all .15s;
  flex: none;
}
.modal-header .mh-close:hover { color: var(--text-1); border-color: var(--border-strong); }
[data-theme="light"] .modal-header .mh-close { background: #F8FAFC; }

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; justify-content: flex-end;
}

/* Form controls */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-grid .full { grid-column: span 2; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700;
}
.form-input,
.form-select,
.form-textarea {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-family: inherit; font-size: 13px;
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: rgba(249,115,22,0.55); }
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea { background: #FFFFFF; }
.form-textarea { min-height: 72px; resize: vertical; }
.form-hint { font-size: 11px; color: var(--text-3); }

/* Native select — hide default arrow and use custom chevron.
   The custom dropdown component (below) enhances these visually. */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
[data-theme="light"] .form-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
.form-select option {
  background: var(--surface-2);
  color: var(--text-1);
}
[data-theme="light"] .form-select option { background: #FFFFFF; color: #0F172A; }

/* ============================================================
   CUSTOM DROPDOWN — replaces native <select> visuals
   ============================================================ */
.cs-wrap { position: relative; display: block; }
.cs-wrap select.cs-native {
  position: absolute; inset: 0;
  opacity: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.cs-trigger {
  display: flex; align-items: center;
  padding: 10px 40px 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-family: inherit; font-size: 13px;
  cursor: pointer;
  min-height: 40px;
  position: relative;
  transition: border-color .15s;
  user-select: none;
}
.cs-trigger:hover { border-color: var(--border-strong); }
.cs-wrap.open .cs-trigger { border-color: rgba(249,115,22,0.55); background: var(--surface-3); }
[data-theme="light"] .cs-trigger { background: #FFFFFF; }
[data-theme="light"] .cs-wrap.open .cs-trigger { background: #F8FAFC; }
.cs-trigger .cs-val {
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-trigger .cs-chev {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-3);
  transition: transform .18s ease;
  display: grid; place-items: center;
}
.cs-wrap.open .cs-chev { transform: translateY(-50%) rotate(180deg); color: var(--accent-2); }
.cs-trigger .cs-chev svg { width: 14px; height: 14px; }

.cs-menu {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 6px);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  padding: 6px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 700;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity .16s ease, transform .18s cubic-bezier(.2,.7,.2,1);
}
[data-theme="light"] .cs-menu { background: #FFFFFF; box-shadow: 0 20px 40px rgba(15,23,42,.14); }
.cs-wrap.open .cs-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.cs-option {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background .12s;
}
.cs-option:hover, .cs-option.hover { background: var(--surface-2); }
[data-theme="light"] .cs-option:hover, [data-theme="light"] .cs-option.hover { background: #F1F5F9; }
.cs-option.selected {
  background: var(--accent-dim);
  color: var(--accent-2);
  font-weight: 600;
}
.cs-option.selected::after {
  content: "";
  margin-left: auto;
  width: 14px; height: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FB923C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat; background-position: center; background-size: contain;
}

.chip-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-pick {
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: all .15s;
}
.chip-pick:hover { border-color: var(--border-strong); color: var(--text-1); }
.chip-pick.on {
  background: var(--grad-primary); color: #1A0B02; border-color: transparent;
  box-shadow: 0 4px 12px rgba(249,115,22,0.30);
}

/* Slider row */
.slider-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.slider-row .sl-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; }
.slider-row .sl-head b { color: var(--text-1); }
.slider-row .sl-head .sl-val { color: var(--accent-2); font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.slider-row input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--pct, 50%), rgba(148,163,184,0.15) var(--pct, 50%));
  outline: none; cursor: pointer;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(249,115,22,0.5);
  cursor: grab;
  border: 2px solid var(--accent);
}
.slider-row input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--accent);
  cursor: grab;
}
[data-theme="light"] .slider-row { background: #F8FAFC; }
[data-theme="light"] .slider-row input[type=range] { background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--pct, 50%), rgba(15,23,42,0.10) var(--pct, 50%)); }

.projection-card {
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(249,115,22,0.14), rgba(6,182,212,0.08));
  border: 1px solid rgba(249,115,22,0.28);
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px;
  margin-top: 4px;
}
.proj-stat .pl { font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.proj-stat .pv { font-size: 20px; font-weight: 800; margin-top: 4px; color: var(--text-1); }
.proj-stat .ph { font-size: 11px; color: var(--accent-2); margin-top: 2px; font-weight: 600; }

.target-new-anim {
  animation: newTarget 1.2s ease;
}
.period-flash {
  animation: periodFlash .9s ease;
}
@keyframes periodFlash {
  0%   { box-shadow: 0 0 0 3px rgba(249,115,22,0.45), 0 8px 20px rgba(249,115,22,0.20); }
  100% { box-shadow: none; }
}
@keyframes newTarget {
  0%   { transform: translateY(-6px); opacity: 0; box-shadow: 0 0 0 3px rgba(249,115,22,0.4); }
  100% { transform: none; opacity: 1; box-shadow: none; }
}

/* ============================================================
   SECTION BUILDER · DRAG & DROP
   ============================================================ */
.section-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 8px;
  cursor: grab;
  transition: background .15s, border-color .15s, transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .18s;
  user-select: none;
  position: relative;
}
.section-item:hover { border-color: var(--border-strong); background: var(--surface-3); }
.section-item:hover .sb-handle { color: var(--accent-2); }
.section-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: scale(0.98);
}
.section-item.drop-above {
  box-shadow: 0 -2px 0 0 var(--accent-2);
}
.section-item.drop-below {
  box-shadow: 0 2px 0 0 var(--accent-2);
}
.section-item .sb-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: none;
  transition: background .15s, color .15s;
}
.section-item .sb-body { flex: 1; min-width: 0; }
.section-item .sb-body b { font-size: 13px; color: var(--text-1); display: block; }
.section-item .sb-body .sb-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.section-item .sb-handle {
  color: var(--text-3);
  transition: color .15s;
  display: grid; place-items: center;
  flex: none;
}
.section-item .sb-handle svg { width: 14px; height: 14px; }

.section-item.just-moved {
  animation: sectionFlash 1s ease;
}
@keyframes sectionFlash {
  0%   { background: rgba(249,115,22,0.18); border-color: rgba(249,115,22,0.5); }
  100% { background: var(--surface-2); border-color: var(--border); }
}
[data-theme="light"] .section-item {
  background: #FFFFFF;
  border-color: var(--border-strong);
}
[data-theme="light"] .section-item:hover { background: #F8FAFC; }
[data-theme="light"] .section-item .sb-num { background: #F1F5F9; }
[data-theme="light"] .section-item.just-moved {
  animation: sectionFlashLight 1s ease;
}
@keyframes sectionFlashLight {
  0%   { background: rgba(249,115,22,0.14); border-color: rgba(249,115,22,0.4); }
  100% { background: #FFFFFF; border-color: var(--border-strong); }
}

/* Drop toast — must sit above drawers (z 401), modals (z 500), and select menus (z 700) */
.drop-toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 12px 18px; border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid rgba(249,115,22,0.5);
  color: var(--text-1); font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s cubic-bezier(.2,.7,.2,1);
}
[data-theme="light"] .drop-toast { background: #FFFFFF; box-shadow: 0 20px 60px rgba(15,23,42,.18); }
.drop-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.drop-toast .dt-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad-primary); color: #1A0B02;
  display: grid; place-items: center;
}

/* Clickable template selection state */
.template-card { transition: all .18s; }
.template-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.18), 0 8px 24px rgba(249,115,22,0.14);
  transform: translateY(-2px);
}
.template-card.selected::before {
  content: "✓ Active"; position: absolute; top: 12px; right: 12px;
  background: var(--grad-primary); color: #1A0B02;
  padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  z-index: 2;
}

/* Responsive */
@media (max-width: 1400px) {
  .grid.kpi { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .rings { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 74px 1fr; }
  .sidebar .brand-text, .sidebar .nav-item span, .sidebar .nav-section, .sidebar .nav-footer .who { display: none; }
  .sidebar .nav-item { justify-content: center; }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .rings { grid-template-columns: repeat(2, 1fr); }
  .chat-panel { width: calc(100vw - 40px); right: 20px; }
  .hero-card, .report-hero { grid-template-columns: 1fr; }
  .sdg-grid { grid-template-columns: repeat(4, 1fr); }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
}
