/* ==========================================================
   SIGAP NUSANTARA — Admin Dashboard
   Putih sebagai warna utama, hijau sebagai warna sekunder.
   ========================================================== */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --subtle: #f7faf8;
  --line: #e6ece8;
  --line-strong: #d5ded8;
  --ink: #12211a;
  --ink-2: #3c4b44;
  --muted: #6b7a73;

  --green-50: #effaf3;
  --green-100: #d9f2e2;
  --green-200: #b5e4c7;
  --green-500: #22a55a;
  --green-600: #16884a;
  --green-700: #116c3b;
  --green-900: #0b3d23;

  --red: #dc2626;   --red-50: #fef2f2;
  --orange: #ea7a0c; --orange-50: #fff5eb;
  --amber: #b97706; --amber-50: #fff8e6;
  --blue: #1d6fd8;  --blue-50: #eef5ff;
  --slate-50: #f3f5f4;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 40, 28, .04), 0 2px 8px rgba(16, 40, 28, .04);
  --shadow-lg: 0 12px 40px rgba(16, 40, 28, .14);
  --sidebar-w: 84px;
  --topbar-h: 64px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--slate-50); padding: 2px 6px; border-radius: 6px; }
button { font-family: inherit; }
.ic { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.t-right { text-align: right; }
.inline { display: inline; }
.link { color: var(--green-700); font-weight: 600; }
.link:hover { text-decoration: underline; }
.pad { padding: 4px 0; }

/* ---------------- Layout ---------------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0;
}
.sidebar-logo { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  width: 68px; padding: 10px 4px 8px; border-radius: 12px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--subtle); color: var(--ink); }
.nav-item.active { background: var(--green-50); color: var(--green-700); }
.nav-item.active .ic { stroke-width: 2.1; }
.nav-logout:hover { color: var(--red); background: var(--red-50); }

.main { margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.content { padding: 24px 28px 32px; flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; }
.admin-footer { padding: 16px 28px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 28px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo-sm { display: none; }
.brand-name { font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--green-700); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--subtle); }
.icon-btn.sm { width: 34px; height: 34px; }
.notif-dot {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}
.btn-wilayah {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; margin-right: 4px;
  border: 1px solid var(--green-200); background: var(--green-50); color: var(--green-700);
  border-radius: 10px; font-weight: 650; font-size: 13px; cursor: pointer;
}
.btn-wilayah:hover { border-color: var(--green-500); }
.wil-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.profile-btn:hover { background: var(--subtle); }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--green-600); color: #fff; display: grid; place-items: center; font-weight: 700; }
.profile-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.profile-meta b { font-size: 13px; color: var(--ink); }
.profile-meta small { font-size: 11.5px; color: var(--muted); }

/* Dropdown */
.dropdown { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 50;
}
.dropdown.open .dd-menu { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.dd-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dd-group { padding: 8px 10px 2px; font-size: 11px; font-weight: 700; color: var(--green-700); }
.dd-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--ink-2); }
.dd-item:hover { background: var(--subtle); }
.dd-item.on { background: var(--green-50); color: var(--green-700); font-weight: 650; }
.dd-item.danger { color: var(--red); }
.dd-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; }
.dd-notif { width: 340px; }
.dd-help { width: 300px; }
.help-body { padding: 4px 10px 10px; font-size: 13px; color: var(--ink-2); display: grid; gap: 8px; }
.link-btn { border: 0; background: none; color: var(--green-700); font-weight: 650; font-size: 12px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; }
.notif-item:hover { background: var(--subtle); }
.notif-item.unread { background: var(--green-50); }
.notif-item b { display: block; font-size: 13px; }
.notif-item small { display: block; font-size: 12px; color: var(--ink-2); }
.notif-item em { font-style: normal; font-size: 11px; color: var(--muted); }
.notif-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--slate-50); color: var(--ink-2); }
.notif-urgent { background: var(--red-50); color: var(--red); }
.notif-warning { background: var(--amber-50); color: var(--amber); }
.notif-info { background: var(--green-50); color: var(--green-700); }

/* ---------------- Page head ---------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .muted { margin-top: 4px; }
.head-actions { display: flex; gap: 8px; }
.back-link { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--green-700); margin-bottom: 6px; }
.urgent-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: var(--red-50); color: var(--red); font-weight: 650; font-size: 13px; border: 1px solid #fbd5d5;
}
.urgent-pill:hover { background: #fde4e4; }

/* ---------------- Cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stack > .card:last-child { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stack > .card { margin-bottom: 0; }

/* Metrics */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s; overflow: hidden;
}
.metric::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.metric:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.metric-top { display: flex; justify-content: space-between; align-items: center; }
.metric-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.metric-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); }
.metric-val { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.metric-sub { font-size: 12px; color: var(--muted); }
.c-green   { --accent: var(--green-600); --accent-bg: var(--green-50); }
.c-amber   { --accent: var(--amber); --accent-bg: var(--amber-50); }
.c-blue    { --accent: var(--orange); --accent-bg: var(--orange-50); }
.c-emerald { --accent: #0e9f6e; --accent-bg: #e7f8f1; }

/* Map + side */
.grid-map { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; }
.side-col { display: flex; flex-direction: column; gap: 20px; }
.side-col .card { margin-bottom: 0; }
.map-card { display: flex; flex-direction: column; }
.map { height: 430px; border-radius: 10px; border: 1px solid var(--line); background: var(--subtle); z-index: 1; }
.map-sm { height: 260px; }
.map-tools { display: flex; gap: 8px; align-items: center; }
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 12px; font-size: 12px; color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.lg-red { background: var(--red); } .lg-orange { background: var(--orange); } .lg-green { background: var(--green-500); }
.map-card.is-full { position: fixed; inset: 0; z-index: 100; margin: 0; border-radius: 0; }
.map-card.is-full .map { flex: 1; height: auto; }

.seg { display: inline-flex; background: var(--slate-50); border-radius: 10px; padding: 3px; }
.seg-btn { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn.on { background: #fff; color: var(--green-700); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* Leaflet pins */
.pin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.pin-red { background: var(--red); animation: pulse 2s infinite; }
.pin-orange { background: var(--orange); }
.pin-green { background: var(--green-500); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.leaflet-popup-content { font-family: var(--font); font-size: 13px; margin: 12px 14px; }
.leaflet-popup-content b { font-size: 13.5px; }
.pop-meta { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.pop-link { color: var(--green-700) !important; font-weight: 650; }

/* Quick access */
.quick { display: flex; flex-direction: column; gap: 8px; }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, background .15s; }
.quick-item:hover { border-color: var(--green-200); background: var(--green-50); }
.quick-item > span:nth-child(2) { flex: 1; min-width: 0; }
.quick-item b { display: block; font-size: 13.5px; }
.quick-item small { color: var(--muted); font-size: 12px; }
.quick-item > .ic:last-child { transform: rotate(-90deg); color: var(--muted); }
.quick-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.quick-grid .card { margin: 0; }

/* Bars */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; color: var(--ink-2); }
.bar { height: 7px; background: var(--slate-50); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.mini-progress { height: 6px; width: 110px; background: var(--slate-50); border-radius: 99px; overflow: hidden; margin-bottom: 3px; }
.mini-progress i { display: block; height: 100%; background: var(--green-500); }

/* ---------------- Table ---------------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--subtle); white-space: nowrap; }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfdfc; }
.table th.t-right, .table td.t-right { text-align: right; }
.kode { font-weight: 700; color: var(--green-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kode:hover { text-decoration: underline; }
.jenis { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; }
.jenis i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lokasi { display: flex; flex-direction: column; font-size: 12.5px; line-height: 1.45; min-width: 180px; }
.lokasi b { font-size: 13.5px; font-weight: 600; }
.actions { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.nowrap { white-space: nowrap; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-row td { background: #fff !important; }

/* Badges / chips */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.badge-baru { background: var(--red-50); color: var(--red); }
.badge-verifikasi { background: var(--amber-50); color: var(--amber); }
.badge-tindak_lanjut { background: var(--orange-50); color: #c2410c; }
.badge-selesai { background: var(--green-50); color: var(--green-700); }
.badge-ditolak { background: var(--slate-50); color: var(--muted); }
.badge-urgent { background: var(--red); color: #fff; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 650; background: var(--slate-50); color: var(--ink-2); }
.chip-urgent { background: var(--red-50); color: var(--red); }
.chip-tinggi { background: var(--orange-50); color: #c2410c; }
.chip-sedang { background: var(--amber-50); color: var(--amber); }
.chip-rendah { background: var(--green-50); color: var(--green-700); }
.nodata { display: inline-block; padding: 1px 8px; border-radius: 6px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 11.5px; font-weight: 650; }
.count-pill { min-width: 28px; height: 28px; padding: 0 9px; border-radius: 99px; background: var(--red-50); color: var(--red); font-weight: 700; display: grid; place-items: center; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; font-size: 13.5px; font-weight: 650; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap; text-decoration: none;
}
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-soft { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.btn-soft:hover { background: var(--green-100); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--subtle); }
.btn-danger-soft { background: var(--red-50); color: var(--red); }
.btn-danger-soft:hover { background: #fde2e2; }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }

/* ---------------- Forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span:first-child { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field small { font-size: 11.5px; }
input[type=text], input[type=password], input[type=search], input[type=email], input[type=date], input[type=number], input:not([type]), select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  font: inherit; font-size: 13.5px; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34, 165, 90, .15); }
.input-ic { position: relative; display: block; }
.input-ic .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-ic input { padding-left: 36px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--green-600); }
.sel-sm { height: 32px; width: auto; font-size: 12.5px; font-weight: 650; padding: 0 28px 0 10px; }
.sel-dikirim { color: var(--amber); } .sel-diterima { color: var(--blue); } .sel-diproses { color: #c2410c; } .sel-selesai { color: var(--green-700); }
.form-card h2 { margin-bottom: 14px; }
.form-card.narrow { max-width: 460px; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.sub-h { display: flex; align-items: center; gap: 6px; margin: 6px 0 10px; color: var(--green-700); font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 18px 0; }
.filters .field { flex: 1 1 140px; }
.filters .field.grow { flex: 3 1 240px; }
.filter-btns { display: flex; gap: 8px; margin-bottom: 14px; }
.search-inline { min-width: 260px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.radio-cards label { position: relative; cursor: pointer; }
.radio-cards input { position: absolute; opacity: 0; }
.radio-cards span { display: block; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; height: 100%; }
.radio-cards b { display: block; font-size: 13px; }
.radio-cards small { font-size: 11.5px; color: var(--muted); }
.radio-cards input:checked + span { border-color: var(--green-500); background: var(--green-50); }
.radio-cards label.danger input:checked + span { border-color: var(--red); background: var(--red-50); }
.radio-cards input:focus-visible + span { box-shadow: 0 0 0 3px rgba(34, 165, 90, .2); }

/* Alerts */
.alert { position: relative; padding: 12px 40px 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; font-weight: 550; border: 1px solid; }
.alert-success { background: var(--green-50); color: var(--green-900); border-color: var(--green-200); }
.alert-error { background: var(--red-50); color: #991b1b; border-color: #fbd5d5; }
.alert-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 20px; color: inherit; cursor: pointer; opacity: .6; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--green-700); border-color: var(--green-600); }

/* Pager */
.pager { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.pager > div { display: flex; gap: 6px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(10, 30, 20, .35); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-head h3 span { color: var(--green-700); }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--subtle); border-radius: 0 0 16px 16px; }

/* ---------------- Detail page ---------------- */
.grid-detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2-wide { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.grid-2 > .card, .grid-2 > .stack { margin-bottom: 0; }
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 550; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.desc { margin-top: 18px; padding: 14px; background: var(--subtle); border-radius: 10px; }
.desc h3 { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; margin-bottom: 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; background: var(--subtle); }
.stepper { list-style: none; display: flex; padding: 0; margin: 0 0 20px; gap: 6px; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--subtle); color: var(--muted); font-size: 12.5px; font-weight: 650; }
.stepper li span { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; flex-shrink: 0; }
.stepper li.done { background: var(--green-50); color: var(--green-700); }
.stepper li.done span { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.stepper li.current { background: var(--green-600); color: #fff; }
.stepper li.current span { border-color: #fff; color: var(--green-700); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline p { color: var(--ink-2); margin: 2px 0; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); margin-top: 4px; flex-shrink: 0; position: relative; z-index: 1; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.tl-selesai .tl-dot { background: var(--green-500); box-shadow: 0 0 0 1px var(--green-500); }
.tl-tindak_lanjut .tl-dot, .tl-disposisi .tl-dot { background: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.tl-verifikasi .tl-dot { background: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.tl-baru .tl-dot, .tl-ditolak .tl-dot { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.disp-list { list-style: none; margin: 0; padding: 0; }
.disp-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.disp-list li:first-child { border-top: 0; padding-top: 0; }
.disp-main b { display: block; }
.disp-main small { display: block; }
.disp-main p { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* Riwayat log */
.day-head { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 10px; }
.day-head:not(:first-child) { margin-top: 18px; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }
.log-body { flex: 1; min-width: 0; font-size: 13px; }
.log-body > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.log-body p { color: var(--ink-2); margin: 3px 0; }
.log-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--slate-50); color: var(--ink-2); }
.log-dibuat { background: var(--green-50); color: var(--green-700); }
.log-status { background: var(--amber-50); color: var(--amber); }
.log-disposisi { background: var(--orange-50); color: #c2410c; }
.log-prioritas { background: var(--red-50); color: var(--red); }

/* Eskalasi */
.esc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.esc-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; border-top: 3px solid var(--orange); }
.esc-card.prio-urgent { border-top-color: var(--red); }
.esc-card .btn { margin-top: 8px; }
.esc-top { display: flex; justify-content: space-between; align-items: center; }
.esc-card p.small { display: flex; align-items: center; gap: 5px; }

/* Notes */
.note h3 { margin-bottom: 8px; }
.wa-preview { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 12.5px; background: #e9f9ee; border: 1px solid var(--green-100); padding: 12px 14px; border-radius: 4px 12px 12px 12px; color: var(--ink); }

/* ---------------- Login ---------------- */
.login-body { background: var(--subtle); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; color: #fff; display: flex; align-items: flex-end; padding: 48px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .12) 0 2px, transparent 3px) 0 0 / 28px 28px,
    linear-gradient(160deg, #1a9a55 0%, #0f6b3a 55%, #0b3d23 100%);
}
.login-art::before {
  content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 0 0 60px rgba(255, 255, 255, .04), 0 0 0 120px rgba(255, 255, 255, .03);
}
.login-art-inner { position: relative; max-width: 460px; }
.login-art img { background: #fff; border-radius: 14px; padding: 6px; }
.login-art h2 { font-size: 30px; margin: 18px 0 10px; letter-spacing: -.02em; }
.login-art p { opacity: .88; font-size: 14.5px; }
.login-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.login-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 550; }
.login-points .ic { background: rgba(255, 255, 255, .14); border-radius: 8px; padding: 6px; width: 30px; height: 30px; }
.login-card { align-self: center; justify-self: center; width: 100%; max-width: 400px; padding: 32px; background: #fff; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); margin: 24px; }
.login-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-head h1 { font-size: 20px; }
.login-head p { color: var(--muted); font-size: 13px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .grid-map { grid-template-columns: 1fr; }
  .side-col { display: grid; grid-template-columns: 1fr 1fr; }
  .grid-detail, .grid-2, .grid-2-wide { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-meta { display: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 760px) {
  :root { --topbar-h: 58px; }
  body { padding-bottom: 72px; }
  .sidebar {
    inset: auto 0 0 0; width: 100%; height: 66px; flex-direction: row; padding: 0 6px;
    border-right: 0; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .sidebar-logo, .nav-logout { display: none; }
  .sidebar-nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; }
  .nav-item { width: auto; flex: 1; padding: 8px 2px 6px; font-size: 10.5px; }
  .main { margin-left: 0; }
  .topbar { padding: 0 12px; }
  .brand-logo-sm { display: block; }
  .brand > div { display: none; }
  .wil-name { max-width: 120px; }
  .btn-wilayah { padding: 0 9px; }
  .icon-btn { width: 36px; height: 36px; }
  .content { padding: 16px 14px 24px; }
  .admin-footer { padding: 14px; }
  h1 { font-size: 19px; }
  .card { padding: 14px; border-radius: 12px; }
  .metrics { gap: 10px; }
  .metric { padding: 12px 14px; }
  .metric-val { font-size: 26px; }
  .metric-sub { font-size: 11.5px; }
  .side-col { grid-template-columns: 1fr; }
  .map { height: 340px; }
  .dd-menu { position: fixed; left: 10px; right: 10px; top: calc(var(--topbar-h) + 4px); width: auto !important; }
  .field-row, .radio-cards { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dt { margin-top: 8px; font-size: 12px; }
  .stepper { overflow-x: auto; }
  .stepper li { flex: 0 0 auto; }
  .page-head { align-items: stretch; }
  .head-actions .btn { flex: 1; }
  .head-actions, .search-inline { width: 100%; min-width: 0; }

  /* Tabel menjadi kartu pada layar kecil */
  .table-wrap { margin: 0; overflow: visible; }
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; }
  .table-cards td { padding: 7px 0; border: 0; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: 96px 1fr; gap: 8px; text-align: left !important; }
  .table-cards td:last-child { border-bottom: 0; }
  .table-cards td::before { content: attr(data-label); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 2px; }
  .table-cards td > * { grid-column: 2; justify-self: start; }
  .table-cards .empty-row td { display: block; }
  .table-cards .empty-row td::before { display: none; }
  .table-cards tbody tr:hover td { background: transparent; }
  .table-cards .actions { justify-content: flex-start; flex-wrap: wrap; }
  .lokasi { min-width: 0; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-box { border-radius: 18px 18px 0 0; max-height: 90vh; }
}

/* ==========================================================
   Peta wilayah berjenjang, geofence, panel GFW & NASA FIRMS
   ========================================================== */
.min0 { min-width: 0; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.crumb a { color: var(--green-700); font-weight: 600; }
.crumb a:hover { text-decoration: underline; }
.crumb span { color: var(--ink); font-weight: 650; }
.crumb i { font-style: normal; color: var(--line-strong); }

.wil-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.wil-filter .field { margin: 0; }
.wil-filter .field > span:first-child { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.wil-filter select { height: 36px; font-size: 13px; }
.wil-filter select:disabled { background: var(--subtle); color: var(--muted); cursor: not-allowed; }
.wil-filter .btn { height: 36px; }

.map-wrap { position: relative; }
.map-card .map { height: 470px; }
.map-loading {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px;
}
.map-loading[hidden] { display: none; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--green-100); border-top-color: var(--green-600); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.map-layers {
  position: absolute; right: 10px; top: 10px; z-index: 500; background: rgba(255, 255, 255, .95);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; display: grid; gap: 4px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow);
}
.map-layers label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.map-layers input { accent-color: var(--green-600); }
.lg-hs { background: #e8590c; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e8590c55; width: 8px; height: 8px; }
.lg-fence { width: 16px; height: 10px; border-radius: 3px; border: 2px solid #0f6b3a; background: rgba(34, 165, 90, .08); }
.fence-tip { font-family: var(--font); font-weight: 600; font-size: 12px; }
.map-card.is-full .map-wrap { flex: 1; display: flex; }
.map-card.is-full .map-wrap .map { flex: 1; height: auto; }

/* KPI kanan peta */
.kpi { padding: 16px; }
.kpi-head { display: flex; align-items: center; gap: 10px; }
.kpi-head b { display: block; font-size: 13.5px; }
.kpi-head small { display: block; font-size: 11.5px; color: var(--muted); }
.kpi-head .src-badge { margin-left: auto; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ic-tcl { background: #fcecf0; color: #be3455; }
.kpi-ic-hs { background: var(--orange-50); color: #e8590c; }
.kpi-val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 2px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-val em { font-style: normal; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-sub { font-size: 12.5px; color: var(--ink-2); }
.spark { height: 28px; margin: 10px 0 8px; }
.spark svg { width: 100%; height: 100%; display: block; }
.kpi-foot { font-size: 12px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 10px; }
.cf { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cf i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.delta { font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.delta.up-bad { background: var(--red-50); color: var(--red); }
.delta.up-good { background: var(--green-50); color: var(--green-700); }
.delta.flat { background: var(--slate-50); color: var(--muted); }

.src-badge { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; background: var(--slate-50); color: var(--muted); white-space: nowrap; }
.src-ok { background: var(--green-50); color: var(--green-700); }
.src-contoh { background: var(--amber-50); color: var(--amber); }
.src-nodata { background: #fff; color: var(--muted); border: 1px dashed var(--line-strong); }
.src-error { background: var(--red-50); color: var(--red); }
.nodata-lg { font-size: 14px; padding: 4px 10px; vertical-align: middle; }

/* Panel detail API */
.api-panels { margin-bottom: 20px; }
.api-card { display: flex; flex-direction: column; }
.api-card h2 .ic { color: var(--muted); }
.api-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.api-stat { background: var(--subtle); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.api-stat small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.api-stat b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.api-stat > span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.chart { width: 100%; min-height: 170px; }
.chart-sm { min-height: 140px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { font-size: 10.5px; fill: var(--muted); font-family: var(--font); }
.chart .ax-hi { font-size: 11px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.chart .hit { cursor: default; }
.chart .hit:hover { fill: rgba(16, 40, 28, .04); }
.chart-empty { height: 150px; display: grid; place-items: center; background: var(--subtle); border-radius: 10px; }
.chart-tip { position: fixed; z-index: 1000; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); line-height: 1.4; }
.chart-tip[hidden] { display: none; }
.conf-track { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; margin: 12px 0 6px; background: var(--slate-50); }
.conf-track i { display: block; height: 100%; }
.conf-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; flex-wrap: wrap; }
.conf-legend span { display: inline-flex; align-items: center; gap: 5px; }
.conf-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.hs-table-wrap { margin: 0 -18px; }
.table-compact { font-size: 12.5px; }
.table-compact th, .table-compact td { padding: 8px 18px; }
.table-compact td { vertical-align: middle; font-variant-numeric: tabular-nums; }
.api-msg { display: block; font-size: 12.5px; padding: 8px 12px; border-radius: 8px; margin-top: 12px; }
.api-contoh { background: var(--amber-50); color: #7a4f05; }
.api-nodata { background: var(--subtle); color: var(--ink-2); border: 1px dashed var(--line-strong); }
.api-error { background: var(--red-50); color: #991b1b; }
.api-ok { background: var(--green-50); color: var(--green-900); }
.method { font-size: 11.5px; color: var(--muted); margin-top: auto; padding-top: 12px; line-height: 1.5; }

/* Status sumber data */
.ds-list { list-style: none; padding: 0; margin: 0; }
.ds-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ds-list li:last-child { border-bottom: 0; }
.ds-list li > div { flex: 1; min-width: 0; }
.ds-list b { display: block; font-size: 13px; }
.ds-list small { display: block; font-size: 12px; }
.ds-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.ds-ok { background: var(--green-500); } .ds-contoh { background: var(--amber); } .ds-error { background: var(--red); }
.ds-nodata { background: #fff; border: 1.5px dashed var(--muted); }

@media (max-width: 1180px) {
  .side-col { grid-template-columns: 1fr 1fr; }
  .side-col > .card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .wil-filter { grid-template-columns: 1fr 1fr; }
  .wil-filter .btn { grid-column: 1 / -1; }
  .api-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .map-card .map { height: 380px; }
  .side-col { grid-template-columns: 1fr; }
  .kpi-val { font-size: 26px; }
  .hs-table-wrap { margin: 0; }
  .table-compact thead { display: table-header-group; }
  .table-compact th, .table-compact td { padding: 7px 6px; }
  .map-layers { top: auto; bottom: 10px; right: 10px; }
}
@media (max-width: 760px) { .hs-table-wrap { overflow-x: auto; } }
.help-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 6px; }
.map-wrap { z-index: 0; isolation: isolate; }
.map-card .map-wrap { flex: 1; display: flex; }
.map-card .map-wrap .map { flex: 1; height: auto; min-height: 470px; }
@media (max-width: 760px) { .map-card .map-wrap .map { min-height: 380px; } }

/* ==========================================================
   Live refresh, kualitas udara (ISPU)
   ========================================================== */
:root {
  --ispu-baik: #1f9d55; --ispu-sedang: #1d6fd8; --ispu-tidak-sehat: #e0a800;
  --ispu-sangat: #d42a2a; --ispu-berbahaya: #1f2328;
}
.head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--ink-2); background: #fff; font-variant-numeric: tabular-nums; }
.live b { color: var(--ink); font-weight: 650; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 0 rgba(34, 165, 90, .5); animation: livepulse 2s infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 7px rgba(34, 165, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 165, 90, 0); } }
.live.is-busy .live-dot { background: var(--amber); }
.live .icon-btn { width: 28px; height: 28px; }
.map-loading.is-error { color: var(--red); border-color: #fbd5d5; }

.kpi-ic-aq { background: #e8f2f7; color: #3c7f9e; }
.aq-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ispu-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ispu-baik { background: var(--ispu-baik); }
.ispu-sedang { background: var(--ispu-sedang); }
.ispu-tidak-sehat { background: var(--ispu-tidak-sehat); color: #2b2200; }
.ispu-sangat-tidak-sehat { background: var(--ispu-sangat); }
.ispu-berbahaya { background: var(--ispu-berbahaya); }
.ispu-nodata { background: #fff; color: var(--muted); border: 1px dashed var(--line-strong); }
.aq-params { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.aq-p { background: var(--subtle); border-radius: 8px; padding: 7px 9px; position: relative; min-width: 0; }
.aq-p i { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; }
.aq-p small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.aq-p b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.aq-p span { display: block; font-size: 10.5px; color: var(--muted); }

.aq-card { margin-bottom: 20px; }
.aq-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; }
.sub-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 10px; }
.aq-stats { margin: 14px 0 16px; }
.scale-track { position: relative; display: flex; gap: 2px; height: 10px; border-radius: 99px; overflow: visible; margin-top: 26px; }
.scale-track i { display: block; height: 100%; }
.scale-track i:first-child { border-radius: 99px 0 0 99px; }
.scale-track i:nth-child(5) { border-radius: 0 99px 99px 0; }
.scale-mark { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px #fff; }
.scale-mark span { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 700; background: var(--ink); color: #fff; padding: 1px 6px; border-radius: 5px; }
.scale-lbl { display: flex; font-size: 10.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.scale-lbl span { flex: 50; }
.scale-lbl span:nth-child(n+3) { flex: 100; }
.aq-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: r; }
.aq-rank li { counter-increment: r; }
.aq-rank button { width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.aq-rank button::before { content: counter(r); font-size: 11px; font-weight: 700; color: var(--muted); }
.aq-rank button:hover { border-color: var(--green-200); background: var(--green-50); }
.rank-nama { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-3 > .card { margin-bottom: 20px; }
@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) { .aq-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .grid-3 { grid-template-columns: 1fr; }
  .head-right { justify-content: flex-start; }
  .live { font-size: 11.5px; }
  .aq-params { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.sub-title .unit { text-transform: none; letter-spacing: 0; }

/* ==========================================================
   Broadcast peringatan karhutla
   ========================================================== */
.alert-info { background: var(--blue-50); color: #12407a; border-color: #cfe0fb; }
.metric-val-sm { font-size: 26px; }
.fs { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 0; margin: 0 0 14px; transition: opacity .15s; }
.fs legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.fs.fs-off { opacity: .45; }
.dl-tight { grid-template-columns: 48px 1fr; font-size: 12.5px; margin-top: 12px; }
.bc-list { list-style: none; margin: 0; padding: 0; }
.bc-list > li { border-bottom: 1px solid var(--line); }
.bc-list > li:last-child { border-bottom: 0; }
.bc-list summary { list-style: none; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 4px; cursor: pointer; }
.bc-list summary::-webkit-details-marker { display: none; }
.bc-list summary:hover { background: var(--subtle); border-radius: 10px; }
.bc-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.bc-hs { background: var(--orange-50); color: #e8590c; }
.bc-lap { background: var(--red-50); color: var(--red); }
.bc-main { min-width: 0; }
.bc-main b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-main small { display: block; font-size: 12px; }
.bc-stat { text-align: right; line-height: 1.2; }
.bc-stat b { display: block; font-variant-numeric: tabular-nums; }
.bc-stat small { font-size: 11px; }
.bc-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; padding: 4px 4px 16px 54px; }
.bc-rcpt { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bc-rcpt li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; padding: 6px 10px; background: var(--subtle); border-radius: 8px; }
.bc-rcpt small { font-size: 11.5px; }
.phone { max-width: 360px; margin: 0 auto; border: 1px solid var(--line-strong); border-radius: 26px; overflow: hidden; background: #efe7dd; box-shadow: var(--shadow); }
.phone-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #0f6b3a; color: #fff; font-size: 14px; }
.phone-av { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #0f6b3a; display: grid; place-items: center; }
.phone-body { padding: 16px 12px 22px; min-height: 280px;
  background-image: radial-gradient(rgba(0, 0, 0, .04) 1px, transparent 1px); background-size: 14px 14px; }
.bubble { position: relative; background: #fff; border-radius: 4px 12px 12px 12px; padding: 9px 12px 20px; font-size: 13px; line-height: 1.5; color: #111b21; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); overflow-wrap: anywhere; }
.bubble-time { position: absolute; right: 10px; bottom: 4px; font-size: 10.5px; color: #667781; }
@media (max-width: 760px) {
  .bc-list summary { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .bc-list summary .badge { grid-column: 2 / -1; justify-self: start; }
  .bc-detail { grid-template-columns: 1fr; padding-left: 4px; }
}
