/* =====================================================
   JAGAIN — NPC Indonesia
   Mobile-first responsive CSS
   ===================================================== */

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

:root {
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --bottom-nav-h: 64px;

  /* Colors */
  --bg: #f0f4f8;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a2332;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --blue: #2563eb;
  --blue-light: #dbeafe;
  --green: #16a34a;
  --green-light: #dcfce7;
  --orange: #d97706;
  --orange-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --teal: #0891b2;
  --teal-light: #cffafe;

  --sidebar-bg: #0f1e2e;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active-bg: rgba(37,99,235,.18);
  --sidebar-active: #60a5fa;
  --sidebar-text: #94a3b8;
  --sidebar-label: #475569;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);

  --transition: all .2s ease;
}

html, body { height: 100%; font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
select { cursor: pointer; }

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 149;
}
.sidebar-overlay.show { display: block; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
  overflow: hidden;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.brand-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.brand-name { color: #fff; font-size: 17px; font-weight: 800; letter-spacing: .3px; }
.brand-sub { color: var(--sidebar-text); font-size: 11px; margin-top: 1px; }
.sidebar-close {
  margin-left: auto; background: none; border: none;
  color: var(--sidebar-text); font-size: 20px; padding: 4px;
  display: none;
}

.nav-scroll { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-section {
  padding: 14px 18px 4px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--sidebar-label);
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px;
  color: var(--sidebar-text);
  border-right: 3px solid transparent;
  transition: var(--transition);
  border-radius: 0;
  white-space: nowrap;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  border-right-color: var(--sidebar-active);
}
.nav-item .nav-icon {
  font-size: 17px; width: 22px; text-align: center; flex-shrink: 0;
}
.nav-item .nav-text { font-size: 14px; font-weight: 500; }
.nav-badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
}

.sidebar-user {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.user-ava {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-name { color: #e2e8f0; font-size: 13px; font-weight: 600; }
.user-role { color: var(--sidebar-text); font-size: 11px; }

/* ===== MAIN ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  position: sticky; top: 0; z-index: 100;
}
.topbar-hamburger {
  display: none;
  background: none; border: none; font-size: 22px; color: var(--text);
  padding: 4px; flex-shrink: 0;
}
.topbar-title {
  flex: 1; min-width: 0;
}
.topbar-title h1 { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-breadcrumb { font-size: 12px; color: var(--text-muted); display: none; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 7px 12px;
  transition: var(--transition);
}
.topbar-search:focus-within { border-color: var(--blue); background: #fff; }
.topbar-search input {
  border: none; background: none; outline: none;
  font-size: 14px; color: var(--text); width: 180px;
}
.topbar-search .icon { font-size: 15px; color: var(--text-muted); flex-shrink: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; position: relative; flex-shrink: 0;
}
.topbar-btn .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  width: 17px; height: 17px; border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.level-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--blue-light); color: var(--blue);
  border-radius: 20px; padding: 5px 12px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}

/* ===== CONTENT ===== */
.content {
  flex: 1;
  padding: 20px;
  padding-bottom: 24px;
}

.page { display: none; animation: fadeIn .2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ===== SECTION HEADER ===== */
.section-title {
  font-size: 16px; font-weight: 700; margin-bottom: 4px;
}
.section-desc {
  font-size: 13px; color: var(--text-muted); margin-bottom: 16px;
}

/* ===== STAT CARDS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 14px;
  border-top: 3px solid transparent;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat-card.blue { border-top-color: var(--blue); }
.stat-card.green { border-top-color: var(--green); }
.stat-card.orange { border-top-color: var(--orange); }
.stat-card.red { border-top-color: var(--red); }
.stat-card.purple { border-top-color: var(--purple); }
.stat-card.teal { border-top-color: var(--teal); }

.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.blue .stat-icon { background: var(--blue-light); }
.green .stat-icon { background: var(--green-light); }
.orange .stat-icon { background: var(--orange-light); }
.red .stat-icon { background: var(--red-light); }
.purple .stat-icon { background: var(--purple-light); }
.teal .stat-icon { background: var(--teal-light); }

.stat-info { flex: 1; min-width: 0; }
.stat-number { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.stat-trend { font-size: 12px; margin-top: 5px; font-weight: 500; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }
.stat-trend.warn { color: var(--orange); }

/* ===== ALERT BANNER ===== */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
}
.alert.warn { background: #fffbeb; border: 1.5px solid #fcd34d; color: #78350f; }
.alert.info { background: #eff6ff; border: 1.5px solid #93c5fd; color: #1e3a8a; }
.alert.danger { background: #fff1f2; border: 1.5px solid #fca5a5; color: #7f1d1d; }
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-body strong { font-weight: 700; }
.alert-link { font-weight: 600; text-decoration: underline; cursor: pointer; }
.alert-close { background: none; border: none; font-size: 17px; opacity: .6; flex-shrink: 0; }

/* ===== CHART CARDS ===== */
.chart-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-grid-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.chart-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 8px;
}
.chart-card-title { font-size: 15px; font-weight: 700; }
.chart-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.chart-select {
  font-size: 12px; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 5px 8px;
  background: var(--bg); color: var(--text);
}

/* ===== RANK LIST ===== */
.rank-list { display: flex; flex-direction: column; gap: 11px; }
.rank-row { display: flex; align-items: center; gap: 10px; }
.rank-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-row:nth-child(1) .rank-num { background: #fef9c3; color: #854d0e; }
.rank-row:nth-child(2) .rank-num { background: #f1f5f9; color: #475569; }
.rank-row:nth-child(3) .rank-num { background: #fef3c7; color: #92400e; }
.rank-info { flex: 1; }
.rank-name { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.rank-bar-bg { height: 5px; background: #f1f5f9; border-radius: 3px; }
.rank-bar-fill { height: 5px; background: linear-gradient(90deg, var(--blue), #60a5fa); border-radius: 3px; transition: width .7s ease; }
.rank-val { font-size: 13px; font-weight: 700; color: var(--text-muted); min-width: 34px; text-align: right; }

/* ===== ACTIVITY LIST ===== */
.activity-list { display: flex; flex-direction: column; gap: 14px; }
.activity-item { display: flex; gap: 12px; }
.activity-dot-wrap { display: flex; flex-direction: column; align-items: center; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.activity-dot-line { width: 2px; flex: 1; background: var(--border); margin: 4px 0; }
.activity-item:last-child .activity-dot-line { display: none; }
.activity-dot.green { background: var(--green); }
.activity-dot.blue { background: var(--blue); }
.activity-dot.orange { background: var(--orange); }
.activity-dot.red { background: var(--red); }
.activity-content { flex: 1; padding-bottom: 4px; }
.activity-title { font-size: 13px; font-weight: 500; }
.activity-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== DONUT LEGEND ===== */
.donut-legend { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.donut-legend-item {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
}
.donut-legend-left { display: flex; align-items: center; gap: 7px; }
.donut-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-val { font-weight: 700; color: var(--text); }

/* ===== PAGE TOOLBAR ===== */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-left { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }

.search-input {
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 9px 14px; font-size: 14px; outline: none;
  background: var(--surface); color: var(--text);
  min-width: 200px; flex: 1;
  transition: var(--transition);
}
.search-input:focus { border-color: var(--blue); }

.filter-sel {
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-size: 13px;
  background: var(--surface); color: var(--text);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; border: none;
  transition: var(--transition); white-space: nowrap;
}
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.xs { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-outline { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-ghost { background: none; color: var(--text-muted); border: none; padding: 5px 8px; border-radius: 7px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--red-light); color: var(--red); border: 1.5px solid #fca5a5; }
.btn-danger:hover { background: #fee2e2; }

/* ===== TABLE ===== */
.table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
table.data-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  min-width: 700px;
}
.data-table thead th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.data-table thead th input[type=checkbox] { cursor: pointer; }
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f8fafc; }

.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-muted);
  flex-wrap: wrap; gap: 10px;
}
.pagination { display: flex; gap: 4px; }
.page-btn {
  min-width: 34px; height: 34px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}
.page-btn:hover:not(.active):not(:disabled) { background: var(--bg); }
.page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-btn:disabled { opacity: .4; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-green { background: var(--green-light); color: #15803d; }
.badge-blue { background: var(--blue-light); color: #1d4ed8; }
.badge-orange { background: var(--orange-light); color: #b45309; }
.badge-red { background: var(--red-light); color: #b91c1c; }
.badge-purple { background: var(--purple-light); color: #6d28d9; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-teal { background: var(--teal-light); color: #0e7490; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ===== PROGRESS ===== */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar-bg { height: 6px; border-radius: 3px; background: #f1f5f9; flex: 1; min-width: 60px; }
.progress-bar-fill { height: 6px; border-radius: 3px; }
.progress-bar-fill.good { background: var(--green); }
.progress-bar-fill.mid { background: var(--orange); }
.progress-bar-fill.bad { background: var(--red); }
.progress-pct { font-size: 12px; font-weight: 700; min-width: 32px; text-align: right; }
.progress-pct.good { color: var(--green); }
.progress-pct.mid { color: var(--orange); }
.progress-pct.bad { color: var(--red); }

/* ===== ACTION BUTTONS ===== */
.act-btns { display: flex; gap: 6px; }
.act-btn {
  padding: 5px 10px; border-radius: 7px;
  font-size: 12px; font-weight: 500; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-muted);
}
.act-btn:hover { background: var(--bg); color: var(--text); }
.act-btn.edit { color: var(--blue); border-color: #93c5fd; }
.act-btn.del { color: var(--red); border-color: #fca5a5; }
.act-btn.view { color: var(--green); border-color: #86efac; }

/* =====================================================
   PETA WILAYAH — Province Tile Grid
   ===================================================== */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}
.map-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.map-legend-row {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.map-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.map-legend-dot {
  width: 14px; height: 14px; border-radius: 4px;
}

.island-group { margin-bottom: 18px; }
.island-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted);
  margin-bottom: 8px; padding-left: 2px;
}
.prov-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.prov-tile {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  min-width: 64px;
  position: relative;
  border: 2px solid transparent;
  user-select: none;
}
.prov-tile:hover { transform: scale(1.07); box-shadow: var(--shadow-md); }
.prov-tile.active-prov { background: #dcfce7; color: #15803d; border-color: #86efac; }
.prov-tile.limited-prov { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.prov-tile.inactive-prov { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.prov-tile-name { display: block; white-space: nowrap; }
.prov-tile-count { display: block; font-size: 10px; font-weight: 500; opacity: .8; margin-top: 1px; }

/* Province detail panel */
.prov-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  max-height: 600px;
}
.prov-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.prov-panel-header h3 { font-size: 14px; font-weight: 700; }
.prov-list { overflow-y: auto; flex: 1; }
.prov-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .1s;
}
.prov-list-item:last-child { border-bottom: none; }
.prov-list-item:hover { background: #f8fafc; }
.prov-list-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.prov-list-info { flex: 1; }
.prov-list-name { font-size: 13px; font-weight: 600; }
.prov-list-sub { font-size: 12px; color: var(--text-muted); }

/* =====================================================
   HALAMAN KTA
   ===================================================== */
.kta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

/* =====================================================
   HALAMAN PENGURUS — Org Chart
   ===================================================== */
.org-section { margin-bottom: 24px; }
.org-level-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.org-level-badge {
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}
.org-level-badge.pusat { background: var(--blue-light); color: var(--blue); }
.org-level-badge.prov { background: var(--green-light); color: var(--green); }
.org-level-badge.kabkota { background: var(--orange-light); color: var(--orange); }
.org-level-title { font-size: 16px; font-weight: 700; }
.org-level-count { font-size: 13px; color: var(--text-muted); }

.org-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.org-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-left: 3px solid transparent;
  transition: var(--transition);
}
.org-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.org-card.pusat { border-left-color: var(--blue); }
.org-card.prov { border-left-color: var(--green); }
.org-card.kabkota { border-left-color: var(--orange); }
.org-card-nama { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.org-card-jabatan { font-size: 13px; color: var(--text-muted); }
.org-card-prov { font-size: 12px; color: var(--blue); margin-top: 6px; font-weight: 500; }
.org-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.org-sk { font-size: 11px; color: var(--text-muted); font-family: monospace; }

/* =====================================================
   HALAMAN TENAGA KEOLAHRAGAAN
   ===================================================== */
.tenaga-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.tenaga-stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.tenaga-stat-icon { font-size: 26px; margin-bottom: 6px; }
.tenaga-stat-num { font-size: 22px; font-weight: 800; }
.tenaga-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* =====================================================
   HALAMAN LAPORAN
   ===================================================== */
.laporan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.laporan-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: var(--transition);
}
.laporan-card:hover { box-shadow: var(--shadow-md); }
.laporan-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.laporan-icon.blue { background: var(--blue-light); }
.laporan-icon.green { background: var(--green-light); }
.laporan-icon.orange { background: var(--orange-light); }
.laporan-icon.red { background: var(--red-light); }
.laporan-icon.purple { background: var(--purple-light); }
.laporan-icon.teal { background: var(--teal-light); }
.laporan-title { font-size: 15px; font-weight: 700; }
.laporan-desc { font-size: 13px; color: var(--text-muted); flex: 1; line-height: 1.5; }
.laporan-footer { display: flex; gap: 8px; }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
  z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 580px; max-width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.full { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.form-ctrl {
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 13px; font-size: 14px; color: var(--text);
  background: var(--surface); outline: none;
  transition: var(--transition);
}
.form-ctrl:focus { border-color: var(--blue); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.form-required { color: var(--red); margin-left: 2px; }

/* =====================================================
   BOTTOM NAV (mobile only)
   ===================================================== */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  z-index: 120;
  padding: 0 4px;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0,0,0,.08);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: 1; padding: 6px 4px;
  color: var(--text-muted);
  border-radius: 10px;
  min-width: 0;
}
.bottom-nav-item.active { color: var(--blue); }
.bottom-nav-icon { font-size: 20px; }
.bottom-nav-label { font-size: 10px; font-weight: 600; white-space: nowrap; }
.bottom-nav-more {
  position: relative;
}

/* =====================================================
   TOOLTIP HELPER
   ===================================================== */
.help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  font-size: 10px; font-weight: 700;
  cursor: help; margin-left: 4px;
}

/* =====================================================
   STATUS SUMMARY (dashboard bottom)
   ===================================================== */
.summary-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px; margin-bottom: 16px;
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =====================================================
   UTILITIES
   ===================================================== */
.mono { font-family: 'SF Mono', 'Consolas', monospace; font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.fw-bold { font-weight: 700; }
.flex-center { display: flex; align-items: center; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.w-full { width: 100%; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Tablet */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid-2 { grid-template-columns: 1fr; }
  .chart-grid-eq { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .prov-panel { max-height: 300px; }
  .laporan-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-row { grid-template-columns: 1fr 1fr; }
  .tenaga-stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 768px) {
  :root { --topbar-h: 56px; }
  .content { padding: 14px; padding-bottom: calc(var(--bottom-nav-h) + 14px); }

  /* Hide sidebar, show bottom nav */
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .main { margin-left: 0; }
  .topbar-hamburger { display: block; }
  .topbar-search { display: none; }
  .topbar-breadcrumb { display: none; }
  .level-pill { display: none; }
  .bottom-nav { display: flex; }

  /* Stat grid */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-number { font-size: 20px; }
  .stat-card { padding: 12px 14px; }
  .stat-icon { width: 38px; height: 38px; font-size: 18px; }

  /* Charts */
  .chart-grid-2, .chart-grid-eq, .summary-row { grid-template-columns: 1fr; }
  .chart-card { padding: 14px 16px; }

  /* Map */
  .map-layout { grid-template-columns: 1fr; }
  .prov-tile { min-width: 54px; font-size: 10px; padding: 5px 7px; }

  /* Tables: enable horizontal scroll */
  .table-wrap { border-radius: var(--radius-sm); }

  /* Toolbar */
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search-input { min-width: 100%; }
  .toolbar-right { justify-content: flex-end; }

  /* Laporan */
  .laporan-grid { grid-template-columns: 1fr; }
  .tenaga-stat-row { grid-template-columns: 1fr 1fr; }

  /* Org cards */
  .org-cards { grid-template-columns: 1fr 1fr; }

  /* Form */
  .form-row { grid-template-columns: 1fr; }

  /* Alert */
  .alert { font-size: 13px; }

  /* Modal */
  .modal-box { max-height: 95vh; border-radius: var(--radius); }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-number { font-size: 18px; }
  .org-cards { grid-template-columns: 1fr; }
  .tenaga-stat-row { grid-template-columns: repeat(2, 1fr); }
}
