/* ============================================================
   Executive Dashboard — style.css
   Tema  : Dark Navy × Gold — "bisnis banget"
   Font  : DM Sans (body) + DM Mono (angka/data)
   Target: Desktop & Tablet (min 768px)
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Core palette */
  --navy-950:  #060C1A;
  --navy-900:  #0B1527;
  --navy-800:  #102040;
  --navy-700:  #162C58;
  --navy-600:  #1E3A70;
  --navy-500:  #2752A0;
  --navy-400:  #3D6ECC;

  /* Gold accents */
  --gold-500:  #C9952A;
  --gold-400:  #E0AA3A;
  --gold-300:  #F0C060;
  --gold-200:  #F8DFA0;

  /* Semantic colours */
  --surface-base:   var(--navy-950);
  --surface-card:   var(--navy-900);
  --surface-panel:  var(--navy-800);
  --surface-hover:  var(--navy-700);
  --border-subtle:  rgba(255,255,255,0.07);
  --border-strong:  rgba(255,255,255,0.14);

  /* Text */
  --text-primary:   #EEF2FF;
  --text-secondary: #8A9DC4;
  --text-muted:     #4E6594;
  --text-gold:      var(--gold-300);

  /* Semantic status */
  --green-500: #22C55E;
  --green-400: #4ADE80;
  --green-bg:  rgba(34, 197, 94, 0.10);
  --red-500:   #EF4444;
  --red-400:   #F87171;
  --red-bg:    rgba(239, 68, 68, 0.10);

  /* Shadows */
  --shadow-card:  0 4px 24px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.30);
  --shadow-panel: 0 8px 40px rgba(0,0,0,0.60);
  --shadow-gold:  0 0 20px rgba(201,149,42,0.20);

  /* Layout */
  --sidebar-w:   280px;
  --topbar-h:    64px;
  --gap:         20px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-mid:  0.25s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grid texture on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(21,45,95,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,45,95,0.18) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--navy-900);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-300));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.topbar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.period-label {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 5px 12px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  white-space: nowrap;
}

.period-label strong {
  color: var(--text-gold);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
}

.last-updated {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Layout Shell ─────────────────────────────────────────── */
.layout {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar Filter ───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--navy-900);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-600) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 4px; }

.sidebar-section {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Period buttons */
.period-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-period {
  padding: 8px 6px;
  font-size: 11.5px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: center;
  white-space: nowrap;
}

.btn-period:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-period.active {
  background: var(--navy-600);
  color: var(--text-gold);
  border-color: var(--gold-500);
  font-weight: 600;
}

/* Custom date range */
.custom-range {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.custom-range.visible { display: flex; }

.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-input-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.date-input {
  padding: 8px 10px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  width: 100%;
  transition: border-color var(--t-fast);
}

.date-input:focus {
  outline: none;
  border-color: var(--gold-500);
}

/* Dropdown filters */
.filter-select {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--t-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238A9DC4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--gold-500);
}

.filter-select option {
  background: var(--navy-800);
  color: var(--text-primary);
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-row:last-child { margin-bottom: 0; }

/* Apply / Reset buttons */
.btn-apply {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--navy-950);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all var(--t-fast);
  text-transform: uppercase;
}

.btn-apply:hover {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-apply:active { transform: translateY(0); }

.btn-reset {
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--t-fast);
  margin-top: 8px;
}

.btn-reset:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

/* ── Main Content ─────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Section Headers ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── KPI Cards Grid ───────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--gap);
}

.kpi-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-mid), box-shadow var(--t-mid);
  box-shadow: var(--shadow-card);
}

.kpi-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,0.04);
}

/* Accent strip top */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-500), transparent);
  opacity: 0;
  transition: opacity var(--t-mid);
}

.kpi-card:hover::before { opacity: 1; }

/* Primary card: GMV Ads — accent gold */
.kpi-card.kpi-primary {
  border-color: rgba(201,149,42,0.25);
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-900) 100%);
}

.kpi-card.kpi-primary::before { opacity: 1; }

.kpi-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.kpi-icon.gold { background: rgba(201,149,42,0.15); color: var(--gold-300); }
.kpi-icon.blue { background: rgba(61,110,204,0.20); color: #7AA6FF; }
.kpi-icon.green { background: var(--green-bg); color: var(--green-400); }
.kpi-icon.teal { background: rgba(20,184,166,0.15); color: #2DD4BF; }

.kpi-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-family: 'DM Mono', monospace;
  font-size: 26px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  word-break: break-all;
}

.kpi-card.kpi-primary .kpi-value {
  color: var(--text-gold);
  font-size: 28px;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-vs {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Growth badge */
.badge-growth {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
}

.badge-growth.up {
  background: var(--green-bg);
  color: var(--green-400);
}

.badge-growth.down {
  background: var(--red-bg);
  color: var(--red-400);
}

.badge-growth.neutral {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

.badge-growth .arrow { font-size: 10px; }

/* ── Contribution Highlight Section ───────────────────────── */
.contribution-section {
  background: var(--surface-card);
  border: 1px solid rgba(201,149,42,0.30);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-gold);
}

/* Gold glow orb top-right */
.contribution-section::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(201,149,42,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.contribution-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}

.contrib-metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contrib-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contrib-value {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.contrib-note {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Big contribution percent */
.contrib-pct-block {
  text-align: center;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(201,149,42,0.15), rgba(201,149,42,0.06));
  border: 1px solid rgba(201,149,42,0.35);
  border-radius: var(--radius-md);
  min-width: 140px;
}

.contrib-pct-number {
  font-family: 'DM Mono', monospace;
  font-size: 48px;
  font-weight: 500;
  color: var(--gold-300);
  line-height: 1;
  letter-spacing: -0.03em;
}

.contrib-pct-label {
  font-size: 11px;
  color: var(--gold-500);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

.contrib-separator {
  width: 1px;
  height: 60px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.contrib-narrative {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 800px;
}

.contrib-narrative strong {
  color: var(--text-gold);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
}

/* ── Two-column content grid ──────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

/* Three-column */
.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--gap);
}

/* ── Card wrapper (charts, tables) ────────────────────────── */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Chart containers */
.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap canvas {
  max-width: 100%;
}

/* ── Breakdown Tabs ───────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0;
}

.tab-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  color: var(--text-gold);
  border-bottom-color: var(--gold-500);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Data Table ───────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  padding: 9px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast);
}

.data-table thead th:hover { color: var(--text-secondary); }

.data-table thead th.sorted-asc::after  { content: ' ↑'; color: var(--gold-400); }
.data-table thead th.sorted-desc::after { content: ' ↓'; color: var(--gold-400); }

.data-table thead th.num { text-align: right; }

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--t-fast);
}

/* Zebra striping */
.data-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.025);
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

.data-table tbody td {
  padding: 10px 12px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody td.num {
  text-align: right;
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.data-table tbody td.num.highlight {
  color: var(--text-primary);
  font-weight: 500;
}

/* Rank badge in first column */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 4px;
  background: var(--surface-panel);
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  margin-right: 8px;
  flex-shrink: 0;
}

.rank-badge.top { background: rgba(201,149,42,0.15); color: var(--gold-300); }

/* ROAS badge inside table */
.roas-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
}

.roas-pill.high  { background: var(--green-bg);  color: var(--green-400); }
.roas-pill.med   { background: rgba(234,179,8,0.12); color: #FDE047; }
.roas-pill.low   { background: var(--red-bg);    color: var(--red-400); }

/* Contribution bar in table */
.contrib-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contrib-bar-track {
  flex: 1;
  height: 4px;
  background: var(--surface-panel);
  border-radius: 2px;
  overflow: hidden;
}

.contrib-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  border-radius: 2px;
  transition: width 0.6s ease;
}

.contrib-pct-text {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-gold);
  min-width: 38px;
  text-align: right;
}

/* Empty state */
.empty-state {
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-state-icon {
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* ── Insight Box ──────────────────────────────────────────── */
.insight-box {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold-500);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.insight-icon {
  font-size: 16px;
}

.insight-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.insight-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.insight-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-500);
  margin-top: 6px;
  flex-shrink: 0;
}

.insight-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Loading Skeletons ────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--navy-800) 25%,
    var(--navy-700) 50%,
    var(--navy-800) 75%
  );
  background-size: 1200px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
  display: block;
}

.skel-kpi-val   { height: 34px; width: 70%; margin-bottom: 12px; }
.skel-kpi-badge { height: 20px; width: 60px; border-radius: 20px; }
.skel-line      { height: 14px; margin-bottom: 8px; border-radius: 3px; }
.skel-line.w-90 { width: 90%; }
.skel-line.w-70 { width: 70%; }
.skel-line.w-50 { width: 50%; }
.skel-pct       { height: 56px; width: 56px; border-radius: var(--radius-sm); }
.skel-chart     { height: 240px; width: 100%; }
.skel-table-row { height: 38px; width: 100%; margin-bottom: 4px; }

/* ── Error Toast ──────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--navy-800);
  border: 1px solid var(--red-500);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  max-width: 320px;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast-icon { color: var(--red-400); font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.toast-msg   { font-size: 12px; color: var(--text-secondary); }

/* ── Loading overlay on cards ─────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,21,39,0.70);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(3px);
}

.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--gold-400);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Comparison badge (inline in card footer) ─────────────── */
.comparison-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 3px 8px;
  background: var(--surface-panel);
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

/* ── Trend chart fullwidth ────────────────────────────────── */
.chart-fullwidth .chart-wrap { height: 280px; }
.chart-half .chart-wrap      { height: 240px; }

/* ── Responsive adjustments ───────────────────────────────── */
@media (max-width: 1200px) {
  :root { --sidebar-w: 240px; }
  .kpi-value { font-size: 22px; }
  .kpi-card.kpi-primary .kpi-value { font-size: 24px; }
  .contrib-pct-number { font-size: 40px; }
  .two-col  { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .contribution-grid {
    grid-template-columns: 1fr;
  }
  .contrib-separator { display: none; }
  .contrib-pct-block { text-align: left; padding: 14px 18px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .three-col { grid-template-columns: 1fr; }
}

/* ── Utility ──────────────────────────────────────────────── */
.text-gold  { color: var(--text-gold); }
.text-green { color: var(--green-400); }
.text-red   { color: var(--red-400); }
.text-muted { color: var(--text-muted); }
.mono       { font-family: 'DM Mono', monospace; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ============================================================
   AUTO-INSIGHT PANEL
   ============================================================ */

/* ── Headline Banner ──────────────────────────────────────── */
.insight-headline-banner {
  background: linear-gradient(135deg, var(--navy-800) 0%, rgba(22,44,88,0.80) 100%);
  border: 1px solid rgba(201,149,42,0.35);
  border-left: 4px solid var(--gold-500);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-card), var(--shadow-gold);
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow */
.insight-headline-banner::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(201,149,42,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.insight-headline-left {
  flex: 1;
  min-width: 0;
}

.insight-headline-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-bottom: 6px;
}

.insight-headline-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Scorecard badge */
.scorecard-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  gap: 4px;
  text-align: center;
}

.scorecard-badge.green {
  background: rgba(39,174,96,0.15);
  border: 1px solid rgba(39,174,96,0.35);
}

.scorecard-badge.yellow {
  background: rgba(243,156,18,0.12);
  border: 1px solid rgba(243,156,18,0.35);
}

.scorecard-badge.red {
  background: rgba(231,76,60,0.12);
  border: 1px solid rgba(231,76,60,0.35);
}

.scorecard-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.scorecard-badge.green .scorecard-label  { color: rgba(39,174,96,0.75); }
.scorecard-badge.yellow .scorecard-label { color: rgba(243,156,18,0.75); }
.scorecard-badge.red .scorecard-label    { color: rgba(231,76,60,0.75); }

.scorecard-score {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.scorecard-badge.green .scorecard-score  { color: #27AE60; }
.scorecard-badge.yellow .scorecard-score { color: #F39C12; }
.scorecard-badge.red .scorecard-score    { color: #E74C3C; }

/* ── Executive Insight Panel ──────────────────────────────── */
.exec-insight-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* Panel header (clickable, collapsible) */
.exec-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--t-fast);
  gap: 12px;
}

.exec-panel-header:hover {
  background: var(--surface-panel);
}

.exec-panel-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exec-panel-icon {
  font-size: 15px;
}

.exec-panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.exec-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Copy-to-clipboard button */
.btn-copy-insight {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.btn-copy-insight:hover {
  color: var(--text-gold);
  border-color: var(--gold-500);
  background: rgba(201,149,42,0.08);
}

.btn-copy-insight.copied {
  color: var(--green-400);
  border-color: var(--green-500);
  background: var(--green-bg);
}

/* Chevron toggle */
.chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform var(--t-mid);
  flex-shrink: 0;
}

.exec-insight-panel.collapsed .chevron {
  transform: rotate(-90deg);
}

/* Panel body */
.exec-panel-body {
  padding: 0 22px 22px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
  max-height: 1200px;
  opacity: 1;
}

.exec-insight-panel.collapsed .exec-panel-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Individual insight items */
.insight-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}

.insight-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.insight-item-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-panel);
  margin-top: 1px;
}

.insight-item-body {
  flex: 1;
  min-width: 0;
}

.insight-item-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.insight-item-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.insight-item-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Warning item: merah */
.insight-item.warning-item .insight-item-label { color: var(--red-400); }
.insight-item.warning-item .insight-item-icon  { background: var(--red-bg); }
.insight-item.warning-item .insight-item-text  { color: #F8A5A5; }

/* Recommendation item: gold */
.insight-item.rec-item .insight-item-label { color: var(--gold-400); }
.insight-item.rec-item .insight-item-icon  { background: rgba(201,149,42,0.12); }

/* Skeleton untuk insight loading */
.skel-insight-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}

.skel-insight-item:last-child { border-bottom: none; }

.skel-insight-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.skel-insight-lines { flex: 1; }

