/* =========================================================================
   Dashboard Pembangunan — Design System (redesign total)
   Palet: ocean navy + teal + gold, data-forward, profesional pemerintahan.
   ========================================================================= */
:root {
  --bg: #eaeef4;
  --bg-2: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f4f7fb;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --ink: #0f2033;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --navy: #0b2e52;
  --navy-700: #0e3a66;
  --primary: #0e5aa7;
  --primary-600: #0c4f95;
  --teal: #0ea5a4;
  --teal-600: #0c8f8e;
  --gold: #d4a017;
  --success: #16a34a;
  --warning: #e0820a;
  --danger: #dc2626;
  --info: #0891b2;

  --grad-hero: linear-gradient(120deg, #0b2e52 0%, #0e5aa7 55%, #0ea5a4 120%);
  --grad-primary: linear-gradient(135deg, #0e5aa7, #0ea5a4);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 32, 51, .06), 0 1px 3px rgba(15, 32, 51, .05);
  --shadow: 0 4px 14px rgba(15, 32, 51, .08);
  --shadow-lg: 0 18px 45px -12px rgba(11, 46, 82, .28);

  --font: "Public Sans", "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }

/* ---------- Layout shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.container-app { width: 100%; max-width: 1340px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .container-app { padding: 0 16px; } }

/* ---------- Top bar (dua tingkat) ---------- */
.topbar { position: sticky; top: 0; z-index: 50; }

/* Baris identitas pemerintah */
.topbar-strip {
  background: linear-gradient(90deg, #0a2748 0%, #0b2e52 45%, #0e4d92 100%);
  color: rgba(255,255,255,.9); font-size: 11.5px; font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.strip-inner { display: flex; align-items: center; justify-content: space-between; height: 34px; }
.strip-gov { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .6px; }
.strip-gov i { color: var(--gold); font-size: 13px; }
.strip-right { display: inline-flex; align-items: center; gap: 16px; }
.strip-clock { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.78); font-variant-numeric: tabular-nums; }
.strip-link { display: inline-flex; align-items: center; gap: 6px; color: #fff; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); transition: background .15s; }
.strip-link:hover { background: rgba(255,255,255,.26); color: #fff; }
@media (max-width: 720px) { .strip-gov { font-size: 10px; letter-spacing: .3px; } .strip-clock { display: none; } }

/* Baris utama */
.topbar-main {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(15,32,51,.05);
}
.topbar-inner { display: flex; align-items: center; gap: 14px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-logo {
  height: 48px; width: auto; flex: none; display: block;
  filter: drop-shadow(0 2px 4px rgba(11,46,82,.22));
}
.brand-logo-link { display: inline-flex; }
.brand-text a { color: inherit; text-decoration: none; }
.brand-text b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.3px; color: var(--navy); line-height: 1.15; }
.brand-ta { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
/* Pemilih tahun mini (dipakai di mobile, menggantikan teks TA.) */
.brand-year {
  display: none; appearance: none; margin-top: 3px;
  border: 1px solid var(--border-strong); background: #fff; border-radius: 8px;
  padding: 3px 24px 3px 9px; font-weight: 800; color: var(--primary); font-size: 11.5px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230e5aa7' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
}

.topnav { display: flex; gap: 2px; margin-left: 4px; flex-wrap: nowrap; }
.topnav a {
  padding: 8px 11px; border-radius: 10px; font-weight: 600; font-size: 12.5px; white-space: nowrap;
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, color .15s; position: relative;
}
.topnav a i { font-size: 13px; }
.topnav a:hover { background: var(--surface-2); color: var(--primary); }
.topnav a.active { background: var(--grad-primary); color: #fff; box-shadow: 0 4px 12px -3px rgba(14,90,167,.5); }
.topnav a.active i { color: #fff; }

/* Dropdown submenu */
.topnav .has-sub { position: relative; display: inline-flex; }
.topnav .sub-toggle {
  padding: 8px 11px; border-radius: 10px; font-weight: 600; font-size: 12.5px; white-space: nowrap;
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  transition: background .15s, color .15s;
}
.topnav .sub-toggle i:first-child { font-size: 13px; }
.topnav .sub-toggle .caret { font-size: 9px; opacity: .65; transition: transform .18s; }
.topnav .has-sub:hover .sub-toggle { background: var(--surface-2); color: var(--primary); }
.topnav .has-sub:hover .caret { transform: rotate(180deg); }
.topnav .has-sub.active .sub-toggle { background: var(--grad-primary); color: #fff; box-shadow: 0 4px 12px -3px rgba(14,90,167,.5); }
.topnav .submenu {
  position: absolute; top: calc(100% + 7px); left: 0; min-width: 214px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 7px; display: none; z-index: 60;
}
.topnav .has-sub::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 8px; } /* jembatan hover */
.topnav .has-sub:hover .submenu { display: block; animation: subIn .15s ease; }
@keyframes subIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.topnav .submenu a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.topnav .submenu a i { font-size: 15px; color: var(--muted); width: 18px; text-align: center; }
.topnav .submenu a:hover { background: var(--surface-2); color: var(--primary); }
.topnav .submenu a:hover i { color: var(--primary); }
.topnav .submenu a.on { background: rgba(14,90,167,.1); color: var(--primary); }
.topnav .submenu a.on i { color: var(--primary); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; border: 1px solid var(--border-strong); background: #fff; color: var(--navy); border-radius: 10px; width: 40px; height: 40px; font-size: 20px; cursor: pointer; align-items: center; justify-content: center; }
.year-select {
  appearance: none; border: 1px solid var(--border-strong); background: #fff;
  border-radius: 10px; padding: 9px 34px 9px 14px; font-weight: 700; color: var(--navy);
  font-size: 13px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230b2e52' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.year-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,90,167,.15); }

/* Responsif: nav jadi menu turun di layar kecil */
@media (max-width: 1120px) {
  .nav-toggle { display: inline-flex; }
  .topnav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    flex-direction: column; gap: 2px; padding: 10px 16px; margin: 0; display: none;
  }
  .topnav.open { display: flex; }
  .topnav a { width: 100%; font-size: 13px; padding: 10px 12px; }
  .topbar-inner { position: relative; }
  /* Submenu tampil inline & selalu terbuka di layar kecil */
  .topnav .has-sub { display: block; width: 100%; }
  .topnav .sub-toggle { width: 100%; font-size: 13px; padding: 10px 12px; }
  .topnav .sub-toggle .caret { margin-left: auto; }
  .topnav .has-sub::after { display: none; }
  .topnav .submenu {
    position: static; display: block; box-shadow: none; border: 0; border-radius: 0;
    padding: 2px 0 6px 22px; min-width: 0; animation: none;
  }
  .topnav .submenu a { font-size: 12.5px; padding: 8px 12px; }
}

/* ---------- Hero band ---------- */
.hero {
  background: var(--grad-hero); color: #fff; position: relative; overflow: hidden;
}
/* Pola titik halus untuk tekstur (mengurangi kesan datar/kaku) */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.10) 1.4px, transparent 1.5px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(105deg, transparent 30%, #000 100%);
          mask-image: linear-gradient(105deg, transparent 30%, #000 100%);
  opacity: .55;
}
/* Cahaya lembut di kanan atas + lingkaran dekoratif */
.hero::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 460px; height: 460px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 60%);
  box-shadow: -120px 220px 0 -40px rgba(14,165,164,.22);
}
.hero-inner { padding: 40px 0 88px; position: relative; z-index: 1; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.hero-lead { position: relative; padding-left: 20px; min-width: 0; }
.hero-lead::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, #ffd97a, var(--gold)); box-shadow: 0 0 14px rgba(212,160,23,.6);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase; color: #ffde8a; margin-bottom: 10px;
}
.hero-eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; border-radius: 2px; opacity: .8; }
.hero h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1.12; text-shadow: 0 1px 12px rgba(0,0,0,.12); }
.hero p { margin: 9px 0 0; color: rgba(255,255,255,.85); font-size: 14px; max-width: 660px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(4px);
}
@media (max-width: 620px) { .hero h1 { font-size: 23px; } .hero-inner { padding: 30px 0 78px; } }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #6ee7b7; }
.chip-live .dot { background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.7); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); } 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }

.main { flex: 1; padding-bottom: 44px; }
.pull-up { margin-top: -56px; position: relative; z-index: 2; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .col-6, .col-5, .col-7, .col-8, .col-4 { grid-column: span 12; }
}
@media (max-width: 620px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.card:hover { box-shadow: var(--shadow); }
.card-link:hover { transform: translateY(-2px); border-color: #bcd3ea; }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-title { font-size: 15px; font-weight: 800; color: var(--navy); margin: 0; letter-spacing: -.2px; }
.card-sub { font-size: 11.5px; color: var(--muted); margin: 3px 0 0; display: flex; align-items: center; gap: 5px; }

/* ---------- KPI stat ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; min-height: 100%; }
.stat-top { display: flex; align-items: center; gap: 11px; }
.stat-ico {
  width: 44px; height: 44px; border-radius: 13px; flex: none; display: grid; place-items: center;
  font-size: 20px;
}
.ico-primary { background: rgba(14,90,167,.12); color: var(--primary); }
.ico-teal { background: rgba(14,165,164,.14); color: var(--teal-600); }
.ico-gold { background: rgba(212,160,23,.16); color: #a9790a; }
.ico-success { background: rgba(22,163,74,.13); color: var(--success); }
.ico-danger { background: rgba(220,38,38,.12); color: var(--danger); }
.ico-info { background: rgba(8,145,178,.13); color: var(--info); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; line-height: 1.15; }
.stat-value small { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-foot { margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ---------- Progress ---------- */
.progress-line { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.progress-line > span { display: block; height: 100%; border-radius: 999px; background: var(--grad-primary); }
.progress-line.teal > span { background: linear-gradient(90deg, #0ea5a4, #34d399); }
.progress-line.gold > span { background: linear-gradient(90deg, #d4a017, #f59e0b); }
.pct-badge {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 12.5px;
  padding: 3px 10px; border-radius: 999px;
}
.pct-good { background: rgba(22,163,74,.13); color: var(--success); }
.pct-mid { background: rgba(224,130,10,.14); color: var(--warning); }
.pct-low { background: rgba(220,38,38,.12); color: var(--danger); }

/* ---------- Segmented control ---------- */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 700;
  font-size: 12.5px; color: var(--muted); cursor: pointer; transition: .15s;
}
.segmented button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:hover { background: var(--bg-2); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-badge { width: 24px; height: 24px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--surface-2); color: var(--ink-2); }
.rank-1 { background: #fef3c7; color: #b45309; }
.rank-2 { background: #e2e8f0; color: #475569; }
.rank-3 { background: #fde68a; color: #92400e; }

/* ---------- Legacy grouped table (header bertingkat, kolom Paket/Pagu) ---------- */
table.tbl-grp { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl-grp thead th {
  background: var(--navy); color: #fff; border: 1px solid #0a2748;
  padding: 7px 8px; text-align: center; font-weight: 700; font-size: 11px; white-space: nowrap;
  text-transform: none; letter-spacing: .2px; position: sticky; top: 0;
}
table.tbl-grp tbody td { border: 1px solid var(--border); padding: 7px 9px; vertical-align: middle; }
table.tbl-grp tbody td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl-grp tbody td.opd { font-weight: 600; color: var(--navy); min-width: 200px; }
table.tbl-grp tbody tr:nth-child(even) { background: var(--surface-2); }
table.tbl-grp tbody tr:hover { background: #eaf2fb; }
table.tbl-grp .grp-alt { background: rgba(14,90,167,.05); }
.dev-pos { color: var(--success); font-weight: 700; }
.dev-neg { color: var(--danger); font-weight: 700; }

/* Hierarki Program > Kegiatan > Sub Kegiatan */
table.tbl-grp tr.lvl-program td { background: rgba(14,90,167,.10); }
table.tbl-grp tr.lvl-kegiatan td { background: rgba(14,165,164,.07); }
table.tbl-grp td.tc { text-align: center; }
table.tbl-grp td.lvl0 { font-weight: 800; color: var(--navy); min-width: 280px; }
table.tbl-grp td.lvl1 { font-weight: 700; padding-left: 20px; color: var(--ink-2); }
table.tbl-grp td.lvl2 { padding-left: 38px; color: var(--ink); }

/* ---------- Peta Strategi (org chart RPJMD, pan & zoom) ---------- */
.ps-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 2px 2px 10px; }
.ps-zoom { display: inline-flex; align-items: center; gap: 4px; }
.ps-zoom button { width: 32px; height: 30px; border: 1px solid var(--border-strong); background: #fff; border-radius: 8px; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; transition: .15s; }
.ps-zoom button:hover { background: var(--surface-2); color: var(--primary); border-color: var(--primary); }
.ps-zoom button.wide { width: auto; padding: 0 11px; gap: 6px; font-size: 12px; font-weight: 700; }
.ps-zoom .lvl { font-size: 12px; color: var(--muted); min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }

.ps-viewport {
  position: relative; overflow: hidden; height: 68vh; min-height: 460px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  cursor: grab; user-select: none; touch-action: none;
  background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px;
}
.ps-viewport.dragging { cursor: grabbing; }
.ps-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; padding: 20px; }
.ps-grid { border-collapse: separate; border-spacing: 22px 30px; margin: 0; table-layout: fixed; }
.ps-grid td { vertical-align: top; padding: 0; }
.ps-node {
  position: relative; box-sizing: border-box; width: 250px; margin: 0 auto;
  border: 1.5px solid #334155; border-radius: 11px;
  background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; text-align: left;
}
.ps-node.lvl-visi { width: 360px; }
.ps-node .hd {
  display: flex; align-items: center; gap: 8px; padding: 8px 13px; color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
}
.ps-node .hd .code { margin-left: auto; background: rgba(255,255,255,.22); padding: 1px 8px; border-radius: 999px; font-size: 11px; }
.ps-node .bd { padding: 11px 13px; }
.ps-node .bd .name { font-weight: 700; font-size: 13px; line-height: 1.35; color: var(--ink); }
/* Grid & konektor di atas garis SVG */
.ps-grid { position: relative; z-index: 1; }
.ps-connectors { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 0; overflow: visible; }
/* Sasaran: grid maksimal 2 kolom, wrap ke baris berikutnya bila > 2 */
.sasaran-wrap { display: grid; gap: 26px 20px; justify-content: center; }
.sasaran-wrap[data-cols="1"] { grid-template-columns: 250px; }
.sasaran-wrap[data-cols="2"] { grid-template-columns: repeat(2, 250px); }
.sasaran-wrap .ps-node { margin: 0; }
/* Warna per level */
.ps-node.lvl-visi    { border-color: #d97706; }
.ps-node.lvl-visi    .hd { background: linear-gradient(90deg,#d97706,#f59e0b); }
.ps-node.lvl-misi    { border-color: #dc2626; }
.ps-node.lvl-misi    .hd { background: linear-gradient(90deg,#dc2626,#ef4444); }
.ps-node.lvl-tujuan  { border-color: #1e40af; }
.ps-node.lvl-tujuan  .hd { background: linear-gradient(90deg,#1e40af,#2563eb); }
.ps-node.lvl-sasaran { border-color: #7c3aed; }
.ps-node.lvl-sasaran .hd { background: linear-gradient(90deg,#7c3aed,#9333ea); }
.ps-indi { margin: 9px 0 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.ps-indi .lbl { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.ps-indi ul { margin: 5px 0 0; padding-left: 16px; }
.ps-indi li { font-size: 11px; line-height: 1.4; color: var(--ink-2); margin-bottom: 2px; }
.ps-indi li .sat { color: var(--muted); }
.ps-indi.empty { color: var(--muted-2); font-style: italic; font-size: 11px; padding: 6px 10px; }
.ps-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; }
.ps-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ---------- Tabel IKU / RPJMD (target tahunan) ---------- */
/* table-layout: fixed → lebar kolom seragam di SEMUA tabel indikator (tujuan & sasaran),
   sehingga posisi kolom tahun selalu sejajar; nama indikator word-wrap. */
table.tbl-iku { width: 100%; min-width: 660px; border-collapse: separate; border-spacing: 0; font-size: 12.5px; table-layout: fixed; }
table.tbl-iku th.ind, table.tbl-iku td.ind { white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
table.tbl-iku thead th {
  background: var(--surface-2); color: var(--muted); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; padding: 9px 10px; text-align: center;
  white-space: nowrap; border-bottom: 2px solid var(--border-strong);
}
table.tbl-iku thead th.ind { text-align: left; }
table.tbl-iku thead th.base { color: var(--muted-2); font-style: italic; }
table.tbl-iku tbody td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
table.tbl-iku tbody td.ind { text-align: left; font-weight: 600; color: var(--ink); line-height: 1.35; }
table.tbl-iku tbody td.sat { color: var(--muted); font-size: 11.5px; }
table.tbl-iku tbody td.base { color: var(--muted-2); }
table.tbl-iku tbody tr:nth-child(even) td { background: var(--surface-2); }
table.tbl-iku tbody tr:hover td { background: #eaf2fb; }
table.tbl-iku tbody tr:last-child td { border-bottom: 0; }
/* Kolom tahun berjalan disorot */
table.tbl-iku th.cur { color: var(--primary); background: rgba(14,90,167,.12); box-shadow: inset 0 2px 0 var(--primary); }
table.tbl-iku td.cur { background: rgba(14,90,167,.08) !important; font-weight: 800; color: var(--navy); box-shadow: inset 1px 0 0 rgba(14,90,167,.25), inset -1px 0 0 rgba(14,90,167,.25); }

/* ---------- Trend table bulanan (di bawah grafik) ---------- */
table.tbl-trend { width: 100%; border-collapse: collapse; font-size: 11px; }
table.tbl-trend th { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); padding: 5px 4px; text-align: center; font-weight: 700; font-size: 10.5px; }
table.tbl-trend td { border: 1px solid var(--border); padding: 4px 5px; text-align: center; font-variant-numeric: tabular-nums; }
table.tbl-trend td.grp { background: var(--navy); color: #fff; font-weight: 800; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
table.tbl-trend td.ket { text-align: left; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.tbl-trend tr.sep td { background: #eef2f7; padding: 2px; border-left: 0; border-right: 0; }

/* ---------- Tabel Reviu Kinerja OPD (compact) ---------- */
table.tbl-review { width: 100%; border-collapse: collapse; font-size: 11.5px; min-width: 760px; }
table.tbl-review thead th { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); padding: 5px 8px; text-align: center; font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .2px; line-height: 1.2; }
table.tbl-review .numrow td { background: var(--navy); color: #fff; font-weight: 700; font-style: italic; text-align: center; border: 1px solid #0a2748; padding: 2px; font-size: 10px; }
table.tbl-review tbody td { border: 1px solid var(--border); padding: 4px 8px; vertical-align: middle; line-height: 1.25; }
table.tbl-review td.no { text-align: center; font-weight: 700; width: 38px; }
table.tbl-review td.sasaran { min-width: 180px; font-weight: 600; color: var(--navy); }
table.tbl-review td.iku { min-width: 210px; }
table.tbl-review td.iku .num { font-weight: 800; color: var(--primary); margin-right: 2px; }
table.tbl-review td.iku .sat-line { font-size: 10px; color: var(--muted); margin-top: 1px; }
table.tbl-review td.trw { text-align: center; width: 66px; padding: 3px 6px; }
table.tbl-review td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl-review td.center { text-align: center; }
table.tbl-review .trw-pill { display: inline-block; background: rgba(14,165,164,.14); color: var(--teal-600); font-weight: 700; font-size: 10px; padding: 1.5px 8px; border-radius: 999px; }
table.tbl-review .col-real { background: #fdf6e9; }
/* Striped per blok IKU */
table.tbl-review tbody tr.rw-alt td { background: var(--surface-2); }
table.tbl-review tbody tr.rw-alt td.col-real { background: #f7ecd6; }
table.tbl-review tbody tr:hover td:not(.col-real) { background: var(--bg-2); }
table.tbl-review tbody tr:hover td.col-real { background: #f5e6c8; }
.review-empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* ---------- Sortable table headers ---------- */
table.tbl th.sortable { cursor: pointer; user-select: none; position: relative; }
table.tbl th.sortable:hover { color: var(--primary); }
table.tbl th.sortable::after { content: "\2195"; opacity: .35; margin-left: 5px; font-size: 10px; }
table.tbl th.sort-asc::after { content: "\2191"; opacity: 1; color: var(--primary); }
table.tbl th.sort-desc::after { content: "\2193"; opacity: 1; color: var(--primary); }

/* ---------- Mini bars in table ---------- */
.mbar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 70px; }
.mbar > span { display: block; height: 100%; background: var(--grad-primary); border-radius: 999px; }

/* ---------- Badges / status ---------- */
.badge-soft { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 700; }
.b-belum { background: rgba(100,116,139,.14); color: #475569; }
.b-proses { background: rgba(224,130,10,.14); color: var(--warning); }
.b-progress { background: rgba(8,145,178,.13); color: var(--info); }
.b-selesai { background: rgba(22,163,74,.13); color: var(--success); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: #fff; color: var(--ink-2); border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 13px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--grad-primary); border-color: transparent; color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.05); }
.btn-sm { padding: 6px 11px; font-size: 12px; }

/* ---------- Section heading ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 2px 2px; }
.section-head h2 { font-size: 17px; font-weight: 800; color: var(--navy); margin: 0; letter-spacing: -.3px; }
.section-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------- Legend ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: #fff; padding: 20px 0; color: var(--muted); font-size: 12.5px; }
.footer .container-app { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Map legend ---------- */
.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 5px;
}
.map-legend .lg-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.map-legend .lg-point { background: #0ea5a4; border: 2px solid #0c8f8e; }
.map-legend .lg-kec { background: rgba(14,90,167,.35); border: 2px solid #0e5aa7; }

/* ---------- Visitor box ---------- */
.visitor-box {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 9px;
  background: var(--vb, #0e5aa7); color: #fff;
  padding: 9px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 10px 24px -8px rgba(15,32,51,.45); min-width: 190px;
  transition: background .5s ease;
}
.visitor-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.85); flex: none; }
.visitor-text { flex: 1; white-space: nowrap; }
.visitor-num { font-variant-numeric: tabular-nums; font-weight: 800; }
@media (max-width: 560px) { .visitor-box { min-width: 0; right: 12px; bottom: 12px; font-size: 11.5px; padding: 7px 12px; } }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .between { justify-content: space-between; }
.text-right { text-align: right; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty { text-align: center; color: var(--muted); padding: 30px; font-size: 13px; }

/* =========================================================================
   RESPONSIF MOBILE — penyempurnaan tampilan layar kecil
   ========================================================================= */
@media (max-width: 860px) {
  /* Header title lebih ringkas */
  .brand-text b { font-size: 14px; }
  .brand-text span { font-size: 10px; }
  .brand-logo { height: 40px; }
}

@media (max-width: 640px) {
  /* Header lebih ringkas agar pemilih tahun tidak terpotong */
  .topbar-inner { gap: 10px; height: 64px; }
  .brand-text b { font-size: 14px; line-height: 1.1; }
  .brand-logo { height: 38px; }
  .nav-toggle { width: 38px; height: 38px; }
  /* Dropdown tahun pindah ke bawah "Dashboard", menggantikan teks TA. */
  .topbar-right .year-select { display: none; }
  .brand-ta { display: none; }
  .brand-year { display: inline-block; }

  /* Judul + kontrol menumpuk, tidak berdesakan */
  .section-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .section-head h2 { font-size: 16px; }
  .section-head > .flex { flex-wrap: wrap; }
  .card-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .card-head > div:first-child { min-width: 0; }

  /* Kontrol jadi lebar penuh & mudah disentuh */
  input[type="search"].btn { width: 100% !important; min-width: 0 !important; }
  .card-head .segmented, .section-head .segmented { width: max-content; max-width: 100%; }
  .segmented { overflow-x: auto; }
  .card-pad .year-select, .section-head .year-select { width: 100% !important; min-width: 0 !important; }

  /* Peta: filter & toolbar peta strategi menumpuk penuh */
  #kecFilter, #metodeFilter, #opdFilter { width: 100% !important; min-width: 0 !important; }
  .ps-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .ps-zoom { justify-content: space-between; }
  .ps-viewport { height: 60vh; min-height: 380px; }

  /* Angka KPI tidak terlalu besar */
  .stat-value { font-size: 19px; }
  .card-pad { padding: 15px 16px; }
  .card-head { padding: 14px 16px 0; }

  /* Hero: tombol & meta rapi */
  .hero-row { flex-direction: column; align-items: stretch; }
  .hero-row .btn-primary { width: 100%; justify-content: center; }
  .hero h1 { font-size: 22px; }
  .hero-lead { padding-left: 16px; }

  /* Grid rincian pendapatan berjenjang & tabel tetap dapat digulir */
  .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Legenda peta strategi turun ke bawah judul */
  .card-head .ps-legend { justify-content: flex-start; }

  /* Footer menumpuk */
  .footer .container-app { flex-direction: column; gap: 4px; }
}

@media (max-width: 400px) {
  .stat-value { font-size: 17px; }
  .hero h1 { font-size: 20px; }
  .container-app { padding: 0 12px; }
}

/* ================= Kinerja Pemda — Capaian RPJMD ================= */
.stat-value .stat-of { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.muted-dash { color: var(--muted-2); }

/* Warna capaian */
.cap-good { color: #0e9e8f; }
.cap-mid  { color: #b7860f; }
.cap-low  { color: #d23f45; }
.cap-na   { color: var(--muted-2); }
.stat-value.cap-txt { font-weight: 800; }

/* Pill/chip capaian */
.cap-pill, .cap-chip {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 800;
  font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.cap-pill.cap-good, .cap-chip.cap-good { background: rgba(14,165,164,.13); color: #0e9e8f; }
.cap-pill.cap-mid,  .cap-chip.cap-mid  { background: rgba(212,160,23,.15); color: #b7860f; }
.cap-pill.cap-low,  .cap-chip.cap-low  { background: rgba(226,72,77,.13);  color: #d23f45; }
.cap-pill.cap-na,   .cap-chip.cap-na   { background: var(--surface-2); color: var(--muted-2); }

/* Kartu misi */
.misi-card .misi-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.misi-head-lead { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.misi-badge {
  flex: none; background: var(--navy); color: #fff; font-weight: 800; font-size: 11px;
  letter-spacing: .3px; padding: 4px 10px; border-radius: 8px; margin-top: 1px;
}
.misi-card .misi-head .card-title { font-size: 15px; line-height: 1.35; }

/* Tabel capaian */
table.tbl-capaian { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 820px; }
table.tbl-capaian thead th {
  background: var(--surface-2); color: var(--muted); text-transform: uppercase;
  font-size: 10px; letter-spacing: .5px; font-weight: 800; text-align: left;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl-capaian thead th.num { text-align: right; }
table.tbl-capaian thead th.center { text-align: center; }
table.tbl-capaian tbody td { border-bottom: 1px solid var(--border); padding: 8px 10px; vertical-align: top; line-height: 1.4; }
table.tbl-capaian tbody td.center { text-align: center; }
table.tbl-capaian tbody td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy); }
table.tbl-capaian tbody td.col-real { background: #fdf6e9; }
table.tbl-capaian tbody td.satuan { color: var(--muted); font-size: 11.5px; }
table.tbl-capaian tbody td.ind { color: var(--text); font-weight: 600; min-width: 220px; }
table.tbl-capaian tbody tr:hover td:not(.col-real) { background: var(--bg-2); }
table.tbl-capaian tbody tr:hover td.col-real { background: #f7ecd6; }

/* Kolom referensi tujuan/sasaran */
td.ref { min-width: 210px; max-width: 300px; }
td.ref .jn { display: inline-block; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 1px 7px; border-radius: 999px; }
td.ref .jn-tujuan  { background: rgba(11,61,145,.10); color: var(--navy); }
td.ref .jn-sasaran { background: rgba(124,58,237,.10); color: #6d28d9; }
td.ref .ref-code { font-size: 10px; font-weight: 800; color: var(--muted-2); margin-left: 6px; letter-spacing: .3px; }
td.ref .ref-label { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
tr.row-sasaran td.ref { padding-left: 18px; }

/* Legend gauge */
.gauge-legend { display: flex; justify-content: center; gap: 18px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.gauge-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.gauge-legend .dot-teal { background: #0ea5a4; }
.gauge-legend .dot-muted { background: #cbd5e1; }

@media (max-width: 640px) {
  .misi-badge { font-size: 10px; padding: 3px 8px; }
  .misi-card .misi-head .card-title { font-size: 13.5px; }
  .gauge-legend { gap: 12px; font-size: 11px; }
}
