/* =========================================================
   KONEKSI AMBON — Portal Potensi Negeri & Desa Kota Ambon
   style.css (public)
   ========================================================= */

:root {
  --navy-900: #061d33;
  --navy-800: #0a2a4a;
  --navy-700: #0e3559;
  --navy-600: #12406b;
  --blue: #1c6fd6;
  --blue-soft: #e8f1fd;
  --blue-line: #cfe0f7;
  --green: #2f9e44;
  --green-soft: #e7f6ec;
  --orange: #f08c00;
  --orange-soft: #fff2e0;
  --purple: #7048e8;
  --purple-soft: #efeafd;
  --red: #e03131;
  --pink: #c2255c;
  --teal: #0ca678;
  --ink: #10243a;
  --ink-2: #3d5570;
  --muted: #6b8299;
  --line: #e3ebf4;
  --bg: #f2f6fb;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(11, 40, 70, .06), 0 1px 3px rgba(11, 40, 70, .05);
  --shadow: 0 4px 14px rgba(11, 40, 70, .08);
  --shadow-lg: 0 18px 40px rgba(8, 32, 56, .18);
  --sidebar: 236px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 800; letter-spacing: -.015em; }
p { margin: 0; }
::selection { background: #cfe4ff; }

/* ---------- progress bar top ---------- */
#loadbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, #1c6fd6, #2f9e44, #f08c00);
  z-index: 2000; transition: width .35s ease, opacity .4s ease;
}

/* =========================== SIDEBAR =========================== */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background:
    radial-gradient(1200px 220px at -20% 0%, rgba(28,111,214,.35), transparent 60%),
    linear-gradient(180deg, #0a2a4a 0%, #082138 62%, #061a2d 100%);
  color: #dce9f7; z-index: 900;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 220px;
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 14px 14px; opacity: .5; pointer-events: none;
  mask-image: linear-gradient(to top, #000, transparent);
}
.sb-brand { padding: 16px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.08); position: relative; z-index: 2; }
.sb-brand img.sb-mark { height: 58px; width: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.sb-brand .sb-title { margin-top: 8px; font-size: 15px; font-weight: 800; color: #fff; letter-spacing: .04em; }
.sb-brand .sb-title span { color: #4dabf7; }
.sb-brand .sb-sub { font-size: 10.5px; color: #9fbcd8; line-height: 1.45; margin-top: 2px; }

.sb-nav { padding: 12px 10px 20px; overflow-y: auto; flex: 1; position: relative; z-index: 2; }
.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; }
.sb-label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #7d9ab7; padding: 10px 10px 6px; font-weight: 700; }
.sb-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  color: #cfe0f1; font-size: 12.8px; font-weight: 600; margin-bottom: 2px;
  transition: background .18s, color .18s, transform .18s;
}
.sb-link svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.sb-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-link.active {
  background: linear-gradient(90deg, #e8f2ff, #d6e8ff);
  color: #0b3f78; box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.sb-link.active svg { opacity: 1; color: #1c6fd6; }
.sb-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); font-size: 10.5px; color: #8fadc9; position: relative; z-index: 2; }
.sb-foot b { color: #d6e8ff; display: block; font-size: 11.5px; }

/* =========================== SHELL =========================== */
.shell { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 800;
}
.tb-gov { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.tb-gov .gov-mark {
  width: 26px; height: 30px; border-radius: 4px; flex: none;
  background: linear-gradient(180deg, #e03131 0 50%, #fff 50% 100%);
  border: 1.5px solid #c92a2a; position: relative; overflow: hidden;
}
.tb-gov .gov-mark::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px;
  transform: translate(-50%, -50%); border-radius: 50%; background: #f7c948; border: 1px solid #b98900;
}
.tb-search {
  flex: 1; max-width: 430px; position: relative; margin-left: 6px;
}
.tb-search input {
  width: 100%; height: 36px; border-radius: 999px; border: 1px solid var(--line);
  background: #f6f9fd; padding: 0 14px 0 36px; font-size: 12.5px; color: var(--ink); outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.tb-search input:focus { background: #fff; border-color: #a9cbf3; box-shadow: 0 0 0 4px rgba(28,111,214,.10); }
.tb-search svg { position: absolute; left: 12px; top: 10px; width: 15px; height: 15px; color: #8ba2b8; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tb-icon {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); position: relative;
}
.tb-icon:hover { background: #f4f8fd; }
.tb-icon .dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 1.5px solid #fff; }
.tb-user { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.tb-user .av {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #1c6fd6, #0ca678);
  color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center;
}
.tb-user .nm { font-size: 12.5px; font-weight: 800; line-height: 1.2; }
.tb-user .rl { font-size: 10.5px; color: var(--muted); }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700;
  background: var(--green-soft); color: #1f7a34; border: 1px solid #bfe6cb; border-radius: 999px; padding: 4px 9px;
}
.live-pill .pulse { width: 6px; height: 6px; border-radius: 50%; background: #2f9e44; box-shadow: 0 0 0 0 rgba(47,158,68,.6); animation: pulse 1.8s infinite; }
.live-pill.off { background: #f1f3f5; color: #868e96; border-color: #dee2e6; }
.live-pill.off .pulse { background: #adb5bd; animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(47,158,68,0); } 100% { box-shadow: 0 0 0 0 rgba(47,158,68,0); } }

.content { padding: 16px 20px 30px; display: flex; flex-direction: column; gap: 14px; }
.mobile-only { display: none; }
section[id] { scroll-margin-top: 72px; }

/* =========================== HERO =========================== */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: #0a2a4a;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.93) 42%, rgba(255,255,255,.55) 62%, rgba(255,255,255,.12) 100%);
}
.hero-inner { padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.hero-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-logo { height: 66px; width: auto; filter: drop-shadow(0 6px 14px rgba(10,42,74,.18)); }
.hero-title { font-size: 40px; line-height: .98; letter-spacing: -.03em; font-weight: 800; color: #0b2b4a; }
.hero-title .amb { color: #d6336c; }
.hero-title .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--green); margin-left: 4px; vertical-align: 6px; }
.hero-tag { max-width: 520px; font-size: 12.8px; color: #274b6b; font-weight: 600; margin-top: 6px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; max-width: 700px; }
.hstat {
  border-radius: 10px; padding: 12px 13px; color: #fff; display: flex; align-items: center; gap: 11px;
  box-shadow: 0 8px 18px rgba(9,38,66,.18); position: relative; overflow: hidden;
}
.hstat::after {
  content: ""; position: absolute; right: -18px; top: -22px; width: 74px; height: 74px;
  border-radius: 50%; background: rgba(255,255,255,.13);
}
.hstat .ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.2); display: grid; place-items: center; flex: none; }
.hstat .ic svg { width: 18px; height: 18px; }
.hstat .n { font-size: 22px; font-weight: 800; line-height: 1; }
.hstat .l { font-size: 10.5px; opacity: .95; font-weight: 600; margin-top: 2px; }
.hstat.b1 { background: linear-gradient(135deg, #1c6fd6, #0f5bb5); }
.hstat.b2 { background: linear-gradient(135deg, #37a54a, #237a35); }
.hstat.b3 { background: linear-gradient(135deg, #f59f00, #e8590c); }
.hstat.b4 { background: linear-gradient(135deg, #7048e8, #5f3dc4); }

.hero-ribbon {
  align-self: flex-end; margin-left: auto; margin-top: -6px;
  background: linear-gradient(90deg, #d6336c, #e03131); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 8px 16px;
  border-radius: 6px 0 0 6px; box-shadow: 0 8px 18px rgba(224,49,49,.3);
  max-width: 330px; line-height: 1.35; text-align: right;
}
.hero-credit {
  position: absolute; right: 20px; top: 16px; z-index: 3; text-align: right;
  font-size: 10.5px; font-style: italic; color: #1d4b6e; opacity: .85;
}
.hero-credit b { display: block; font-size: 19px; font-style: italic; letter-spacing: .01em; color: #123c5c; }

/* =========================== METRIC ROW =========================== */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.metric {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px;
  display: flex; align-items: center; gap: 11px; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric .ic { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.metric .ic svg { width: 19px; height: 19px; }
.metric .l { font-size: 10.8px; color: var(--muted); font-weight: 600; }
.metric .v { font-size: 21px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.metric .foot { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.trend { font-weight: 800; font-size: 10.5px; }
.trend.up { color: #2b8a3e; }
.trend.down { color: #c92a2a; }
.trend.flat { color: #868e96; }

/* =========================== PANELS =========================== */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.panel-head .pic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.panel-head .pic svg { width: 13px; height: 13px; }
.panel-head h3 { font-size: 13.2px; font-weight: 800; }
.panel-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 13px 14px; }
.link-more { font-size: 11px; font-weight: 700; color: var(--blue); display: inline-flex; align-items: center; gap: 4px; }
.link-more:hover { text-decoration: underline; }
select.mini, .mini-input {
  height: 28px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  font-size: 11px; font-weight: 600; color: var(--ink-2); padding: 0 8px; outline: none;
}

.grid-main { display: grid; grid-template-columns: minmax(0,1.72fr) minmax(0,1fr); gap: 14px; align-items: start; }
.right-col { display: flex; flex-direction: column; gap: 14px; }

/* ---------- map ---------- */
.map-wrap { position: relative; height: 336px; border-radius: 8px; overflow: hidden; background: #dbe9f4; }
#map { position: absolute; inset: 0; }
.map-legend {
  position: absolute; left: 10px; top: 10px; z-index: 500; background: rgba(255,255,255,.96);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; box-shadow: var(--shadow);
  max-height: calc(100% - 20px); overflow: auto; width: 192px;
}
.map-legend .t { font-size: 10.5px; font-weight: 800; margin-bottom: 6px; color: var(--ink); }
.map-legend label { display: flex; align-items: flex-start; gap: 6px; font-size: 10.2px; padding: 3px 0; cursor: pointer; color: var(--ink-2); font-weight: 600; }
.map-legend input { accent-color: #1c6fd6; width: 12px; height: 12px; }
.map-legend .sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.map-fallback { position: absolute; inset: 0; object-fit: cover; opacity: .96; }
.map-note { font-size: 10px; color: var(--muted); padding: 8px 2px 0; }
.leaflet-container { font-family: var(--font) !important; background: #d7e7f4 !important; }
.leaflet-popup-content-wrapper { border-radius: 9px !important; box-shadow: var(--shadow-lg) !important; }
.leaflet-popup-content { margin: 11px 13px !important; font-size: 11.5px !important; line-height: 1.5; }
.pop-t { font-weight: 800; font-size: 12.5px; margin-bottom: 2px; color: #0b2b4a; }
.pop-row { display: flex; justify-content: space-between; gap: 12px; color: #3d5570; }
.pop-row b { color: #0b2b4a; }
.pop-theme { display: inline-block; margin-top: 5px; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; color: #fff; }

/* ---------- doughnut ---------- */
.donut-row { display: flex; align-items: center; gap: 14px; }
.donut-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center .n { font-size: 22px; font-weight: 800; line-height: 1; }
.donut-center .l { font-size: 9.5px; color: var(--muted); font-weight: 600; }
.legend-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.legend-list .li { display: flex; align-items: center; gap: 7px; font-size: 10.8px; padding: 2.5px 0; }
.legend-list .li .sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.legend-list .li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 600; }
.legend-list .li .ct { font-weight: 800; color: var(--ink); }
.legend-list .li .pc { color: var(--muted); font-size: 10px; width: 34px; text-align: right; }

/* ---------- progress ---------- */
.prog { display: flex; flex-direction: column; gap: 9px; }
.prog-item .top { display: flex; justify-content: space-between; font-size: 10.8px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.prog-bar { height: 8px; border-radius: 999px; background: #eef3f9; overflow: hidden; }
.prog-bar span { display: block; height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* ---------- news ---------- */
.news-list { display: flex; flex-direction: column; }
.news-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.news-item:last-child { border-bottom: 0; padding-bottom: 0; }
.news-item .thumb { width: 54px; height: 46px; border-radius: 7px; object-fit: cover; flex: none; background: #eef3f9; }
.news-item .tt { font-size: 11.4px; font-weight: 700; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-item:hover .tt { color: var(--blue); }
.news-item .meta { font-size: 9.8px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; }
.badge-cat { font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--blue-soft); color: #12559e; }

/* =========================== SECTION =========================== */
.section { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm); }
.section-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.section-head .no {
  width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, #1c6fd6, #0f5bb5);
  color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: none;
}
.section-head h2 { font-size: 14.5px; }
.section-head .sub { font-size: 11px; color: var(--muted); font-weight: 600; }
.section-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section-body { padding: 14px 16px 16px; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 11px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; cursor: pointer; transition: all .16s;
}
.chip:hover { border-color: #b9d3f2; color: #12559e; }
.chip.on { background: #12559e; border-color: #12559e; color: #fff; }

/* ---------- charts (SVG) ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.chart-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; background: #fff; }
.chart-card .ct { font-size: 12px; font-weight: 800; margin-bottom: 2px; }
.chart-card .cs { font-size: 10.5px; color: var(--muted); margin-bottom: 10px; }
.chart-card svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 10.5px; color: var(--ink-2); font-weight: 600; }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.bar-val { font-size: 9.5px; font-weight: 800; fill: #3d5570; }
.axis-lbl { font-size: 9.5px; fill: #6b8299; font-weight: 600; }

/* ---------- desa cards ---------- */
.desa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px,1fr)); gap: 12px; }
.desa-card {
  border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden;
  cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; display: flex; flex-direction: column;
}
.desa-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfe0f7; }
.desa-card .top { padding: 11px 12px; color: #fff; display: flex; align-items: flex-start; gap: 9px; }
.desa-card .top .nm { font-size: 13px; font-weight: 800; line-height: 1.2; }
.desa-card .top .kc { font-size: 10px; opacity: .9; font-weight: 600; }
.desa-card .top .st { margin-left: auto; font-size: 9px; font-weight: 800; background: rgba(255,255,255,.22); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.desa-card .bd { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.desa-card .kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.desa-card .kv div { background: #f6f9fd; border-radius: 7px; padding: 6px 8px; }
.desa-card .kv .k { font-size: 9.5px; color: var(--muted); font-weight: 600; }
.desa-card .kv .v { font-size: 12.5px; font-weight: 800; }
.desa-card .themes { display: flex; gap: 5px; flex-wrap: wrap; }
.tbadge { font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 999px; color: #fff; }

/* ---------- maps gallery ---------- */
.map-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 12px; }
.map-thumb { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; cursor: zoom-in; background: #fff; transition: transform .18s, box-shadow .18s; }
.map-thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.map-thumb img { width: 100%; height: 148px; object-fit: contain; object-position: center; background: #f7fafd; padding: 4px; }
.map-thumb .cap { padding: 8px 10px; font-size: 11.5px; font-weight: 800; }
.map-thumb .cap span { display: block; font-size: 9.8px; color: var(--muted); font-weight: 600; }

/* ---------- programs ---------- */
.prog-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 12px; }
.pcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.pcard .hd { display: flex; gap: 8px; align-items: flex-start; }
.pcard .hd .nm { font-size: 12.4px; font-weight: 800; line-height: 1.3; }
.pcard .meta { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.status-pill { font-size: 9.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.status-pill.berjalan { background: var(--green-soft); color: #1f7a34; }
.status-pill.perencanaan { background: var(--orange-soft); color: #b35c00; }
.status-pill.selesai { background: var(--blue-soft); color: #12559e; }

/* ---------- work flow strip ---------- */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.flow-card {
  border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line);
  cursor: pointer; transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column;
}
.flow-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.flow-card .hd { padding: 9px 11px; color: #fff; font-size: 11.5px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.flow-card .hd b { font-size: 13px; }
.flow-card .bd { padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.flow-card .bd .row { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-2); font-weight: 600; border-bottom: 1px dashed #eef3f9; padding-bottom: 4px; }
.flow-card .bd .row b { color: var(--ink); }
.flow-card .go { margin-top: auto; font-size: 10.5px; font-weight: 800; color: var(--blue); display: inline-flex; gap: 4px; align-items: center; }

/* ---------- footer ---------- */
.footer {
  margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.footer .fb { display: flex; align-items: center; gap: 10px; }
.footer .fb img { height: 42px; }
.footer .fb .t { font-size: 12.5px; font-weight: 800; }
.footer .fb .s { font-size: 10.5px; color: var(--muted); }
.footer .fr { margin-left: auto; text-align: right; font-size: 10.5px; color: var(--muted); }
.footer .fr b { color: var(--ink); }

/* ---------- WA float ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 950; display: flex; align-items: center; gap: 9px;
  background: #25d366; color: #06301b; font-weight: 800; font-size: 12.5px; padding: 11px 15px 11px 13px;
  border-radius: 999px; box-shadow: 0 10px 26px rgba(37,211,102,.42); transition: transform .18s;
}
.wa-float:hover { transform: translateY(-2px) scale(1.02); }
.wa-float svg { width: 20px; height: 20px; }

/* =========================== MODAL =========================== */
.modal { position: fixed; inset: 0; z-index: 1200; display: none; }
.modal.open { display: block; }
.modal-bd { position: absolute; inset: 0; background: rgba(6,26,45,.55); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; max-width: 780px; margin: 5vh auto; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; animation: pop .22s ease;
}
.modal-card.wide { max-width: 1080px; }
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.modal-head { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 13px 16px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.modal-head h3 { font-size: 14px; }
.modal-head .x { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.modal-body { padding: 16px; }
.modal-body img { border-radius: 8px; }

/* detail desa */
.dd-hero { border-radius: 10px; padding: 14px 16px; color: #fff; display: flex; gap: 12px; align-items: center; }
.dd-hero .nm { font-size: 19px; font-weight: 800; }
.dd-hero .sb { font-size: 11.5px; opacity: .92; font-weight: 600; }
.dd-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-top: 12px; }
.dd-grid .box { background: #f6f9fd; border-radius: 8px; padding: 9px 10px; }
.dd-grid .box .k { font-size: 9.5px; color: var(--muted); font-weight: 700; }
.dd-grid .box .v { font-size: 15px; font-weight: 800; }
.dd-list { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dd-list .row { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; padding: 7px 10px; background: #fbfdff; border: 1px solid var(--line); border-radius: 7px; }
.dd-list .row span { color: var(--muted); font-weight: 600; }
.dd-list .row b { color: var(--ink); text-align: right; }

/* toast */
.toast-wrap { position: fixed; right: 16px; bottom: 76px; z-index: 1500; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0b2b4a; color: #fff; font-size: 12px; font-weight: 600; padding: 10px 14px;
  border-radius: 9px; box-shadow: var(--shadow-lg); animation: slideIn .25s ease; max-width: 330px;
}
.toast.ok { background: #1f7a34; }
.toast.warn { background: #b35c00; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }

/* =========================== RESPONSIVE =========================== */
@media (max-width: 1240px) {
  .grid-main { grid-template-columns: 1fr; }
  .hero-stats { max-width: none; }
  .hero-title { font-size: 34px; }
}
@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-ribbon { margin: 0; align-self: flex-start; border-radius: 6px; text-align: left; }
}
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; width: 246px; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .shell { margin-left: 0; }
  .mobile-only { display: grid; }
  .tb-search { display: none; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-title { font-size: 27px; }
  .content { padding: 12px; }
  .tb-user .nm, .tb-user .rl { display: none; }
  .live-pill span.txt { display: none; }
  .dd-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dd-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .tb-user { display: none; }
  .tb-gov { font-size: 12px; }
  .live-pill { display: none; }
  .tb-gov .gov-mark { width: 22px; height: 26px; }
  .hero-title { font-size: 24px; }
  .hero-inner { padding: 16px 15px; }
  .hero-credit b { font-size: 16px; }
  .map-legend {
    left: 8px; right: 8px; top: auto; bottom: 26px; width: auto;
    display: flex; align-items: center; gap: 10px; overflow-x: auto; padding: 7px 9px;
  }
  .map-legend .t { display: none; }
  .map-legend label { white-space: nowrap; font-size: 10px; padding: 0; }
  .metrics, .hero-stats, .flow { grid-template-columns: 1fr 1fr; }
  .hstat { padding: 9px; }
  .hstat .n { font-size: 18px; }
  .donut-row { flex-direction: column; align-items: stretch; }
  .donut-wrap { margin: 0 auto; }
  .wa-float span { display: none; }
  .wa-float { padding: 12px; }
}
