/* ═══════════════════════════════════════════════════════════
   FISKAL.ID - Premium Design System v2
   Decision Support System Kerentanan Fiskal Provinsi Indonesia
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  /* Colors - Clean White Premium */
  --bg: #FFFFFF;
  --bg-alt: #F8F9FB;
  --bg-card: #FFFFFF;
  --surface: #F1F3F7;
  --border: #E4E7EC;
  --border-light: #EEF0F4;
  --border-focus: #93B4D4;

  /* Primary - Navy */
  --primary: #1B2B4B;
  --primary-600: #1E3A5F;
  --primary-500: #2C5282;
  --primary-400: #3B6BA5;
  --primary-lighter: #EDF2F9;
  --primary-text: #1B2B4B;

  /* Accent - Gold */
  --accent: #B8860B;
  --accent-light: #E8D5A0;
  --accent-bg: #FFFDF5;

  /* Text */
  --text: #111827;
  --text-secondary: #4B5563;
  --text-muted: #8896AA;
  --text-on-dark: #FFFFFF;

  /* Klaster Colors */
  --klaster-mandiri: #1D6F42;
  --klaster-rendah: #B8860B;
  --klaster-tinggi: #C24000;
  --klaster-bergantung: #B91C1C;

  --klaster-mandiri-bg: #ECFDF5;
  --klaster-rendah-bg: #FFFEF5;
  --klaster-tinggi-bg: #FFF7ED;
  --klaster-bergantung-bg: #FEF2F2;

  /* Semantic */
  --success: #059669;
  --danger: #DC2626;
  --warning: #D97706;
  --info: #2563EB;

  /* Shadows - Layered for depth */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.03);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* Transitions */
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg-alt);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

/* ── Header ─────────────────────────────────────────────── */
#app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  color: var(--text-on-dark);
  padding: 0 var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 1100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}
.brand-icon svg { width: 20px; height: 20px; }
.brand h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.brand-dot { color: var(--accent); }
.brand-sub {
  font-size: 11px;
  opacity: 0.65;
  font-weight: 400;
  letter-spacing: 0.2px;
  margin-top: 1px;
}
.header-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  text-transform: uppercase;
}
.badge-outline {
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.85);
}
.badge-solid {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
}
.badge-accent {
  background: var(--accent);
  color: #FFFDF5;
  font-weight: 700;
}

/* ── Navigation ─────────────────────────────────────────── */
#tab-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 1050;
}
.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  padding: 0 var(--sp-6);
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  padding: 0 var(--sp-4);
  height: 48px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  white-space: nowrap;
  position: relative;
  letter-spacing: -0.1px;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--sp-4);
  right: var(--sp-4);
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: var(--transition);
}
.tab-btn:hover {
  color: var(--primary-500);
}
.tab-btn.active {
  color: var(--primary);
  font-weight: 600;
}
.tab-btn.active::after {
  background: var(--primary);
}
.tab-icon {
  display: flex;
  align-items: center;
  color: inherit;
  opacity: 0.7;
}
.tab-btn.active .tab-icon { opacity: 1; }

/* ── Main Content ───────────────────────────────────────── */
#tab-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-6) var(--sp-12);
  min-height: calc(100vh - 108px);
  position: relative;
  z-index: 1;
}
.tab-panel {
  display: none;
  animation: tabFadeIn 350ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-panel.active { display: block; }
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section Title ──────────────────────────────────────── */
.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: var(--sp-1);
  letter-spacing: -0.4px;
  line-height: 1.3;
}
.section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-6);
  line-height: 1.5;
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-5);
  transition: var(--transition);
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow-xs);
}
.stat-card:hover,
.stat-card:focus-within,
.stat-card:has(.info-tip-trigger:hover),
.stat-card:has(.info-tip-trigger:focus-visible) {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
  border-color: var(--border-focus);
  z-index: 100;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.stat-card.primary::before { background: linear-gradient(90deg, var(--primary), var(--primary-500)); }
.stat-card.accent::before  { background: linear-gradient(90deg, var(--accent), #D4A520); }
.stat-card.danger::before  { background: linear-gradient(90deg, var(--klaster-bergantung), #EF4444); }
.stat-card.success::before { background: linear-gradient(90deg, var(--klaster-mandiri), #10B981); }
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -1px;
}
.stat-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: var(--sp-1);
  font-weight: 400;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  letter-spacing: -0.2px;
}
.card-title .icon {
  display: flex;
  align-items: center;
  color: var(--primary-500);
  opacity: 0.8;
}

/* ── Layout Helpers ─────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-5); }
.grid-map-sidebar { display: grid; grid-template-columns: 1fr 380px; gap: var(--sp-5); }

/* ── Map Container ──────────────────────────────────────── */
.map-container {
  background: var(--bg-card);
  overflow: hidden;
  height: 500px;
  position: relative;
  z-index: 1;
  isolation: isolate;
}
.map-container .leaflet-pane {
  z-index: 10;
}
.map-container .leaflet-top,
.map-container .leaflet-bottom {
  z-index: 20;
}
.map-container .leaflet-control {
  z-index: 20;
}
.map-container .leaflet-container {
  height: 100%;
  width: 100%;
  background: #F5F7FA;
}
.leaflet-tooltip-custom {
  background: white !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 10px 14px !important;
}

/* ── Sidebar Rankings ───────────────────────────────────── */
.ranking-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.ranking-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  flex: 1;
  box-shadow: var(--shadow-xs);
}
.ranking-card.danger { border-left: 3px solid var(--klaster-bergantung); }
.ranking-card.success { border-left: 3px solid var(--klaster-mandiri); }
.ranking-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.ranking-header.danger { color: var(--klaster-bergantung); }
.ranking-header.success { color: var(--klaster-mandiri); }
.ranking-header svg { flex-shrink: 0; }
.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  transition: var(--transition);
}
.ranking-item:last-child { border-bottom: none; }
.ranking-item:hover { padding-left: 4px; }
.ranking-rank {
  font-weight: 700;
  color: var(--text-muted);
  width: 24px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.ranking-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}
.ranking-value {
  font-weight: 700;
  font-size: 13px;
  min-width: 50px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ranking-value.danger { color: var(--klaster-bergantung); }
.ranking-value.success { color: var(--klaster-mandiri); }

/* ── Klaster Tags ───────────────────────────────────────── */
.klaster-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.klaster-tag.mandiri     { background: var(--klaster-mandiri-bg); color: var(--klaster-mandiri); }
.klaster-tag.rendah      { background: var(--klaster-rendah-bg);  color: var(--klaster-rendah); }
.klaster-tag.tinggi      { background: var(--klaster-tinggi-bg);  color: var(--klaster-tinggi); }
.klaster-tag.bergantung  { background: var(--klaster-bergantung-bg); color: var(--klaster-bergantung); }

/* ── Klaster Summary Cards ──────────────────────────────── */
.klaster-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.klaster-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  text-align: center;
  border-top: 3px solid;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  overflow: visible;
  position: relative;
}
.klaster-card:hover,
.klaster-card:focus-within,
.klaster-card:has(.info-tip-trigger:hover),
.klaster-card:has(.info-tip-trigger:focus-visible) {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
  z-index: 100;
}
.klaster-card.mandiri    { border-top-color: var(--klaster-mandiri); }
.klaster-card.rendah     { border-top-color: var(--klaster-rendah); }
.klaster-card.tinggi     { border-top-color: var(--klaster-tinggi); }
.klaster-card.bergantung { border-top-color: var(--klaster-bergantung); }
.klaster-card .kc-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: var(--sp-2);
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.klaster-card.mandiri .kc-label    { color: var(--klaster-mandiri); }
.klaster-card.rendah .kc-label     { color: var(--klaster-rendah); }
.klaster-card.tinggi .kc-label     { color: var(--klaster-tinggi); }
.klaster-card.bergantung .kc-label { color: var(--klaster-bergantung); }
.klaster-card .kc-count {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}
.klaster-card .kc-prov {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.klaster-card .kc-y {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: var(--sp-2);
  font-weight: 600;
}

/* ── Tables ─────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table thead th {
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  cursor: pointer;
  white-space: nowrap;
}
.data-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: var(--transition);
}
.data-table tbody tr:hover {
  background: var(--primary-lighter);
}
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Search ─────────────────────────────────────────────── */
.search-box {
  position: relative;
  margin-bottom: var(--sp-4);
}
.search-input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-card);
  transition: var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(44,82,130,0.1);
}
.search-input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* ── Dropdown Select ────────────────────────────────────── */
.select-wrap { position: relative; margin-bottom: var(--sp-5); }
.select-wrap select {
  width: 100%;
  max-width: 400px;
  padding: 10px 40px 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  cursor: pointer;
  appearance: none;
  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='%234B5563' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: var(--transition);
}
.select-wrap select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(44,82,130,0.1);
}

/* ── Slider ─────────────────────────────────────────────── */
.slider-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-xs);
}
.slider-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.slider-value-display {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin: var(--sp-2) 0 var(--sp-3);
  letter-spacing: -2px;
  line-height: 1;
}
.slider-value-display span {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}
input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--primary-lighter), var(--surface));
  border-radius: 3px;
  outline: none;
  transition: var(--transition);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(27,43,75,0.25);
  transition: var(--transition-bounce);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(27,43,75,0.35);
}
input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.05);
}
.slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: var(--sp-2);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Insight Card ───────────────────────────────────────── */
.insight-card {
  background: var(--accent-bg);
  border: 1px solid var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-5);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}
.insight-card strong { color: var(--primary-text); }
.insight-card .insight-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 4px;
  color: var(--accent);
}

/* ── Alert Card ─────────────────────────────────────────── */
.alert-card {
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}
.alert-card svg { flex-shrink: 0; margin-top: 2px; }
.alert-card.danger  { background: #FEF2F2; border: 1px solid #FECACA; color: #7F1D1D; }
.alert-card.success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #064E3B; }
.alert-card.info    { background: var(--primary-lighter); border: 1px solid #BFDBFE; color: var(--primary); }

/* ── Policy Cards ───────────────────────────────────────── */
.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.policy-card {
  border-radius: var(--radius);
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-top: 3px solid;
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}
.policy-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.policy-card .policy-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: var(--sp-1);
}
.policy-card .policy-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  font-weight: 500;
}
.policy-card .policy-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Methodology Pipeline ───────────────────────────────── */
.pipeline {
  display: flex;
  gap: 0;
  align-items: stretch;
  margin: var(--sp-6) 0;
  flex-wrap: wrap;
}
.pipeline-step {
  flex: 1;
  min-width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}
.pipeline-step:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.pipeline-step .step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: var(--sp-2);
}
.pipeline-step .step-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: 2px;
}
.pipeline-step .step-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.pipeline-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  padding: 0 6px;
}

/* ── Chart Container ────────────────────────────────────── */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-xs);
}
.chart-container .chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  letter-spacing: -0.2px;
}
.chart-title .ct-icon {
  display: flex;
  align-items: center;
  color: var(--primary-500);
  opacity: 0.7;
}

/* ── Indicator Mini Cards ───────────────────────────────── */
.indicator-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.indicator-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-3);
  text-align: center;
  transition: var(--transition);
}
.indicator-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.indicator-card .ind-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-bottom: 3px;
  line-height: 1.3;
}
.indicator-card .ind-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.indicator-card .ind-compare {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Executive Modal ────────────────────────────────────── */
.exec-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: tabFadeIn 350ms ease-out;
}
.exec-modal-overlay.hidden { display: none; }
.exec-modal {
  background: var(--bg);
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 25px 50px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  overflow: hidden;
  animation: modalIn 450ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.exec-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.exec-header h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.exec-icon {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.exec-body { padding: var(--sp-5) var(--sp-6); }
.exec-alert, .exec-insight, .exec-good {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-3);
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}
.exec-alert svg, .exec-insight svg, .exec-good svg { flex-shrink: 0; margin-top: 2px; }
.exec-alert  { background: #FEF2F2; border: 1px solid #FECACA; }
.exec-insight { background: var(--accent-bg); border: 1px solid var(--accent-light); }
.exec-good   { background: var(--primary-lighter); border: 1px solid #BFDBFE; }
.exec-footer { padding: 0 var(--sp-6) var(--sp-6); }
.exec-start-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  border: none;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  letter-spacing: 0.2px;
}
.exec-start-btn:hover {
  box-shadow: 0 4px 14px rgba(27,43,75,0.3);
  transform: translateY(-1px);
}
.exec-start-btn:active { transform: translateY(0); }

/* ── Loading ────────────────────────────────────────────── */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: var(--text-muted);
}
.loading-screen.hidden { display: none; }
.spinner {
  width: 32px; height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: var(--sp-4);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen p { font-size: 13px; font-weight: 500; }

/* ── Plotly overrides ───────────────────────────────────── */
.js-plotly-plot .plotly .modebar { top: 4px !important; right: 4px !important; }
.js-plotly-plot .plotly .modebar-btn { opacity: 0.4; }
.js-plotly-plot .plotly .modebar-btn:hover { opacity: 0.8; }

/* ── Footer ─────────────────────────────────────────────── */
.dashboard-footer {
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  margin-top: var(--sp-10);
  line-height: 1.6;
}

/* ── Map Legend inline ──────────────────────────────────── */
.map-legend {
  padding: var(--sp-2) var(--sp-5) var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.legend-swatch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.legend-swatch-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-map-sidebar { grid-template-columns: 1fr; }
  .klaster-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .indicator-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  #app-header { padding: 0 var(--sp-4); }
  .header-inner { height: auto; padding: var(--sp-3) 0; flex-wrap: wrap; gap: var(--sp-2); }
  .header-badges { flex-wrap: wrap; }
  .brand h1 { font-size: 17px; }
  .tab-btn { padding: 0 var(--sp-3); height: 42px; font-size: 12px; }
  .tab-icon { display: none; }
  #tab-content { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .klaster-grid { grid-template-columns: 1fr 1fr; }
  .indicator-grid { grid-template-columns: repeat(2, 1fr); }
  .pipeline { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); justify-content: center; padding: var(--sp-1) 0; }
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Utility ────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.font-mono { font-family: 'SF Mono', 'Consolas', 'Liberation Mono', monospace; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ── Card Background Decorative Icons ───────────────────── */
.card-bg-icon {
  position: absolute;
  bottom: -6px;
  right: -4px;
  opacity: 0.045;
  pointer-events: none;
  transform: rotate(-12deg);
  z-index: 0;
  line-height: 0;
  color: currentColor;
  transition: opacity 0.3s ease;
}
.stat-card:hover .card-bg-icon,
.klaster-card:hover .card-bg-icon,
.card:hover .card-bg-icon,
.chart-container:hover .card-bg-icon,
.policy-card:hover .card-bg-icon,
.pipeline-step:hover .card-bg-icon,
.indicator-card:hover .card-bg-icon,
.ranking-card:hover .card-bg-icon { opacity: 0.08; }

/* Ensure parent containers have relative position for bg-icon */
.card, .chart-container,
.policy-card, .pipeline-step, .indicator-card,
.slider-container, .alert-card,
.insight-card { position: relative; overflow: hidden; }

.stat-card, .klaster-card, .ranking-card { position: relative; overflow: visible; }
.stat-card .card-bg-icon, .klaster-card .card-bg-icon { bottom: 2px; right: 2px; }

/* ── Interactive Info Tooltip (Transparency & Methodology) ── */
.info-tip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 6px;
  line-height: 1;
  transition: color var(--transition), transform var(--transition);
  border-radius: 50%;
  outline: none;
  z-index: 20;
}
.info-tip-trigger:hover,
.info-tip-trigger:focus-visible {
  color: var(--primary-500);
  transform: scale(1.18);
}
.info-tip-box {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  background: #1B2B4B;
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.3), 0 4px 10px rgba(0,0,0,0.15);
  z-index: 99999;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font);
  text-align: left;
  white-space: normal;
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}
.info-tip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #1B2B4B transparent transparent transparent;
}
.info-tip-trigger:hover .info-tip-box,
.info-tip-trigger:focus-visible .info-tip-box {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.info-tip-trigger.tip-right .info-tip-box {
  left: -8px;
  transform: translateX(0) translateY(4px);
}
.info-tip-trigger.tip-right:hover .info-tip-box,
.info-tip-trigger.tip-right:focus-visible .info-tip-box {
  transform: translateX(0) translateY(0);
}
.info-tip-trigger.tip-right .info-tip-box::after {
  left: 14px;
  transform: none;
}
.info-tip-trigger.tip-left .info-tip-box {
  left: auto;
  right: -8px;
  transform: translateX(0) translateY(4px);
}
.info-tip-trigger.tip-left:hover .info-tip-box,
.info-tip-trigger.tip-left:focus-visible .info-tip-box {
  transform: translateX(0) translateY(0);
}
.info-tip-trigger.tip-left .info-tip-box::after {
  left: auto;
  right: 14px;
  transform: none;
}
.info-tip-trigger.tip-bottom .info-tip-box {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
}
.info-tip-trigger.tip-bottom:hover .info-tip-box,
.info-tip-trigger.tip-bottom:focus-visible .info-tip-box {
  transform: translateX(-50%) translateY(0);
}
.info-tip-trigger.tip-bottom .info-tip-box::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent #1B2B4B transparent;
}
.info-tip-trigger.tip-bottom.tip-right .info-tip-box {
  left: -8px;
  right: auto;
  transform: translateX(0) translateY(-4px);
}
.info-tip-trigger.tip-bottom.tip-right:hover .info-tip-box,
.info-tip-trigger.tip-bottom.tip-right:focus-visible .info-tip-box {
  transform: translateX(0) translateY(0);
}
.info-tip-trigger.tip-bottom.tip-right .info-tip-box::after {
  left: 14px;
  right: auto;
  transform: none;
}
.info-tip-trigger.tip-bottom.tip-left .info-tip-box {
  left: auto;
  right: -8px;
  transform: translateX(0) translateY(-4px);
}
.info-tip-trigger.tip-bottom.tip-left:hover .info-tip-box,
.info-tip-trigger.tip-bottom.tip-left:focus-visible .info-tip-box {
  transform: translateX(0) translateY(0);
}
.info-tip-trigger.tip-bottom.tip-left .info-tip-box::after {
  left: auto;
  right: 14px;
  transform: none;
}
.info-tip-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 3px;
}
.info-tip-desc {
  display: block;
  font-size: 11.5px;
  line-height: 1.55;
  color: rgba(255,255,255,0.92);
}

/* Card content needs z-index to stay above bg icon */
.stat-label, .stat-value, .stat-detail,
.card-title, .chart-title, .kc-label, .kc-count,
.kc-prov, .kc-y, .wsp-title, .wsp-metric { position: relative; z-index: 1; }

.card-title .info-tip-trigger,
.chart-title .info-tip-trigger,
.wsp-title .info-tip-trigger,
.wsp-metric .info-tip-trigger,
.asym-badge-card .info-tip-trigger {
  margin-left: 4px;
  vertical-align: middle;
  display: inline-flex;
}

.whatif-subpanel,
.whatif-single-card,
.asym-control-card,
.custom-cluster-card {
  position: relative;
  overflow: visible;
}

.card:has(.info-tip-trigger:hover),
.chart-container:has(.info-tip-trigger:hover),
.whatif-subpanel:has(.info-tip-trigger:hover),
.whatif-single-card:has(.info-tip-trigger:hover),
.asym-badge-card:has(.info-tip-trigger:hover),
.asym-control-card:has(.info-tip-trigger:hover),
.custom-cluster-card:has(.info-tip-trigger:hover),
.ranking-card:has(.info-tip-trigger:hover),
.stat-card:has(.info-tip-trigger:hover),
.klaster-card:has(.info-tip-trigger:hover),
.wsp-title:has(.info-tip-trigger:hover),
.wsp-metric:has(.info-tip-trigger:hover),
.card-title:has(.info-tip-trigger:hover),
.chart-title:has(.info-tip-trigger:hover),
.stat-label:has(.info-tip-trigger:hover) {
  overflow: visible !important;
  z-index: 9999 !important;
}

/* ═══════════════════════════════════════════════════════════
   SIMULATOR UPGRADE & WHAT-IF ENHANCEMENTS (v3)
   ═══════════════════════════════════════════════════════════ */

/* ── Simulator Header & Formula Box ─────────────────────── */
.sim-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-2);
}
.btn-formula-info {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}
.btn-formula-info:hover {
  background: var(--primary-lighter);
  border-color: var(--primary-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.formula-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary-500);
  border-radius: var(--radius);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.25s ease-out;
}
.formula-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-light);
}
.formula-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-close-formula {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.btn-close-formula:hover { color: var(--text); }
.formula-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.formula-item {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
}
.formula-item h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-600);
  margin-bottom: var(--sp-2);
}
.formula-code {
  font-family: 'SF Mono', 'Consolas', monospace;
  background: #FFFFFF;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.5;
}
.formula-item p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Scenario Switcher Navigation ───────────────────────── */
.scenario-nav-container {
  margin-bottom: var(--sp-5);
}
.scenario-nav-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}
.scenario-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-3);
}
.scenario-btn {
  text-align: left;
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-xs);
}
.scenario-btn:hover {
  border-color: var(--primary-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.scenario-btn.active {
  border-color: var(--primary);
  background: var(--primary-lighter);
  box-shadow: 0 0 0 2px rgba(27,43,75,0.15);
}
.sc-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-secondary);
  align-self: flex-start;
}
.sc-badge.success { background: var(--klaster-mandiri-bg); color: var(--klaster-mandiri); }
.sc-badge.warning { background: var(--accent-bg); color: var(--accent); }
.sc-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary-text);
}
.sc-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Asymmetric Scenario Controls (Mode B) ──────────────── */
.asym-control-card {
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  border-top: 3px solid var(--success);
}
.asym-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.asym-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}
.asym-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.asym-target-box {
  background: var(--primary-lighter);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-light);
}
.asym-target-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-600);
}
.asym-target-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}
.asym-cluster-rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.asym-badge-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
}
.abc-klaster {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.abc-rate {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin: 3px 0;
}
.abc-note {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Custom Cluster Controls (Mode C) ───────────────────── */
.custom-cluster-card {
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.custom-sliders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
}
.custom-slider-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
}
.cs-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.cs-val-disp {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.cs-minmax {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Barchart Controls & View Toggle ────────────────────── */
.chart-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.view-toggle-group {
  display: inline-flex;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}
.view-toggle-btn {
  background: none;
  border: none;
  padding: 6px 14px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.view-toggle-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* ── Single-Province What-If Card (Tab Profil) ──────────── */
.whatif-single-card {
  margin-bottom: var(--sp-5);
  border-top: 3px solid var(--primary-500);
}
.whatif-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.whatif-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  max-width: 780px;
}
.whatif-badge-box {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  line-height: 1.3;
}
.wbb-title {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  font-weight: 700;
  font-size: 13px;
}
.wbb-title svg {
  flex-shrink: 0;
}
.badge-safe {
  background: var(--klaster-mandiri-bg);
  color: var(--klaster-mandiri);
  border: 1px solid #A7F3D0;
}
.badge-warning {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-light);
}
.badge-danger {
  background: var(--klaster-bergantung-bg);
  color: var(--klaster-bergantung);
  border: 1px solid #FECACA;
}
.wbb-sub {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
}
.whatif-panels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--sp-5);
}
.whatif-subpanel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
}
.wsp-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.wsp-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.slider-val-box {
  min-width: 72px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  text-align: center;
}
.wsp-metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}
.wsp-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}
.wm-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.wm-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.wm-val.danger { color: var(--danger); }
.input-target-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}
.wsp-projection-box {
  margin-top: 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.proy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.proy-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.proy-lbl {
  font-size: 11px;
  color: var(--text-muted);
}
.proy-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}
.proy-diff {
  font-size: 11.5px;
  font-weight: 700;
}
.proy-diff.good { color: var(--success); }
.proy-diff.bad { color: var(--danger); }
.proy-note {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
  line-height: 1.5;
}

