/* Font 'Plus Jakarta Sans' dimuat kondisional lewat <link> di includes/header.php
   (di-skip otomatis saat "Mode Hemat Data" aktif). Fallback ke font sistem di bawah
   supaya halaman tetap enak dibaca walau font online tidak dimuat. */
:root {
  --bg-page: #EEF1F6;
  --bg-card: #FFFFFF;
  --bg-input: #F3F5F9;
  --bg-input-focus: #FFFFFF;

  --navy: #0B3559;
  --navy-deep: #072541;
  --navy-soft: rgba(11,53,89,0.07);

  --red: #D6242E;
  --red-deep: #A91D26;
  --red-soft: rgba(214,36,46,0.08);

  --gold: #B9852A;
  --gold-soft: rgba(185,133,42,0.18);

  --success: #157F46;
  --success-soft: rgba(21,127,70,0.10);

  --warning: #9A6B0A;
  --warning-soft: rgba(217,140,16,0.14);

  --info: #1C5FA0;
  --info-soft: rgba(28,95,160,0.10);

  --danger: #B42323;
  --danger-soft: rgba(180,35,35,0.09);

  --purple: #6B21A8;
  --purple-soft: rgba(107,33,168,0.08);

  --teal: #0D9488;
  --teal-soft: rgba(13,148,136,0.12);

  --text-main: #16212E;
  --text-sub: #48566A;
  --text-muted: #84909F;
  --border: #E2E7EE;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
}

body { display: flex; flex-direction: column; min-height: 100vh; }

a { color: inherit; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: #CBD3DF; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #A0B0C4; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@keyframes slideDown { from { opacity:0; transform:translateY(-14px);} to {opacity:1; transform:translateY(0);} }
@keyframes fadeIn    { from { opacity:0; transform:translateY(10px);} to {opacity:1; transform:translateY(0);} }
@keyframes pulseDot  { 0%,100% {opacity:1;} 50% {opacity:.35;} }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-8px); }
  40%,80% { transform: translateX(8px); }
}

.fade-in { animation: fadeIn .5s ease both; }

/* ═══════════════ NAVBAR ═══════════════ */
.navbar {
  padding: 14px clamp(16px,4vw,32px);
  background: rgba(11,53,89,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--gold);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 1000;
}
.navbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.navbar .brand h2 { margin: 0; color: #fff; font-weight: 800; letter-spacing: -.4px; font-size: 19px; line-height: 1; }
.navbar .brand-tagline { color: rgba(255,255,255,.55); font-size: 10px; font-weight: 700; letter-spacing: .4px; margin-top: 2px; display: none; }
.nav-desktop-group { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 7px;
  color: rgba(255,255,255,.78); background: transparent;
  text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 9px 14px; border-radius: 10px; transition: all .15s ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-call {
  display: flex; align-items: center; gap: 6px; margin-left: 10px;
  background: var(--red); color: #fff; text-decoration: none;
  padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13px;
  transition: background .2s ease, transform .15s ease;
}
.nav-call:hover { background: var(--red-deep); transform: translateY(-1px); }
.nav-admin {
  display: flex; align-items: center; gap: 6px; margin-left: 8px;
  background: transparent; color: var(--gold); border: 1px solid var(--gold);
  padding: 8px 14px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 13px;
  transition: all .2s ease;
}
.nav-admin:hover { background: var(--gold); color: var(--navy); }
.offline-tag {
  background: rgba(21,127,70,.25); color: #7BE6B0; font-size: 9.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px; letter-spacing: .3px; line-height: 1.6;
}
.nav-toggle {
  display: none; background: rgba(255,255,255,.08); border: none; border-radius: 10px;
  width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s ease;
}
.nav-toggle:hover { background: rgba(255,255,255,.14); }
.nav-mobile-menu {
  background: var(--navy-deep); padding: 10px 16px 16px;
  display: none; flex-direction: column; gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-mobile-menu.open { display: flex; }
@media (max-width: 760px) {
  .nav-desktop-group { display: none; }
  .nav-toggle { display: flex; }
}
@media (min-width: 640px) { .navbar .brand-tagline { display: block; } }

/* ═══════════════ FOOTER ═══════════════ */
.site-footer {
  background: var(--navy-deep); color: rgba(255,255,255,.6);
  padding: 24px 20px; text-align: center;
  border-top: 3px solid var(--gold); margin-top: auto;
}
.site-footer .brand-row { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 8px; }
.site-footer .brand-row span { color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.3px; }
.site-footer .sub { font-size: 12.5px; font-weight: 500; margin-bottom: 8px; color: rgba(255,255,255,.7); }
.site-footer .copy { font-size: 11px; color: rgba(255,255,255,.4); font-weight: 600; letter-spacing: .5px; }

/* ═══════════════ LAYOUT / CARD ═══════════════ */
.page-container { padding: clamp(16px,4vw,30px) clamp(14px,4vw,26px); max-width: 1200px; margin: 0 auto; }
.page-container.narrow { max-width: 1000px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15,30,50,.04), 0 14px 30px -16px rgba(15,30,50,.14);
  transition: box-shadow .25s ease, transform .25s ease;
}
.card.hover:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -16px rgba(15,30,50,.22); }
.card.pad { padding: clamp(18px,3vw,24px); }

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 18px;
  padding: clamp(18px,4vw,26px) clamp(18px,4vw,28px);
  border-top: 4px solid var(--navy);
  margin-bottom: clamp(18px,3vw,28px);
}
.page-header .lead { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.page-header h1 { margin: 0 0 8px; color: var(--navy); font-weight: 800; font-size: clamp(20px,4.2vw,26px); letter-spacing: -.3px; line-height: 1.2; }
.page-header p { color: var(--text-sub); margin: 0; font-size: 13.5px; line-height: 1.55; max-width: 520px; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.eyebrow .bar { width: 3px; height: 13px; background: var(--gold); border-radius: 2px; }
.eyebrow span { font-size: 11.5px; color: var(--text-muted); font-weight: 700; letter-spacing: .6px; }

.agency-badge {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: var(--navy); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px var(--gold-soft), 0 0 0 5px rgba(185,133,42,.22);
}

.status-pill {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  border-radius: 999px; padding: 9px 16px 9px 12px; font-size: 12.5px; font-weight: 700;
  border: 1px solid transparent;
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; animation: pulseDot 1.6s ease infinite; }
.status-pill.online { background: var(--success-soft); border-color: rgba(21,127,70,.25); color: var(--success); }
.status-pill.online .dot { background: var(--success); }
.status-pill.offline { background: var(--danger-soft); border-color: rgba(180,35,35,.25); color: var(--danger); }
.status-pill.offline .dot { background: var(--danger); }

/* ═══════════════ STAT CARDS ═══════════════ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px,1fr)); gap: 14px; margin-bottom: clamp(18px,3vw,28px); }
.stat-card { padding: 18px 18px 16px; border-left: 3px solid var(--navy); }
.stat-card .icon-box { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stat-card .label { font-size: 11.5px; color: var(--text-muted); font-weight: 700; letter-spacing: .3px; text-transform: uppercase; line-height: 1.3; }
.stat-card .value { font-size: 26px; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }

/* ═══════════════ FORMS ═══════════════ */
.field { margin-bottom: 16px; }
.field label { font-size: 12px; color: var(--text-sub); font-weight: 700; display: block; margin-bottom: 8px; letter-spacing: .3px; }
.field-input-wrap { position: relative; }
.field-input-wrap .icon-suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; display: flex; }

input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; background: var(--bg-input); border: 1.5px solid var(--border); color: var(--text-main);
  padding: 13px 15px; border-radius: 12px; font-family: inherit; font-size: 14.5px;
  transition: all .2s ease; outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--navy); background: var(--bg-input-focus); box-shadow: 0 0 0 3px var(--navy-soft);
}
textarea { resize: vertical; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; border-radius: 12px; font-weight: 700; font-size: 15px;
  font-family: inherit; cursor: pointer; transition: background .2s ease, transform .15s ease;
  padding: 13px 20px;
}
.btn:disabled { cursor: not-allowed; opacity: .6; }
.btn-block { width: 100%; }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 10px 22px -8px rgba(214,36,46,.5); }
.btn-red:hover:not(:disabled) { background: var(--red-deep); }
.btn-navy { background: var(--navy); color: #fff; box-shadow: 0 8px 20px -6px rgba(11,53,89,.4); }
.btn-navy:hover:not(:disabled) { background: #082844; }
.btn-soft-info { background: var(--info-soft); color: var(--info); border: 1px solid rgba(28,95,160,.25); }
.btn-soft-info:hover { background: rgba(28,95,160,.18); }
.btn-soft-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(180,35,35,.25); }
.btn-soft-danger:hover { background: rgba(180,35,35,.18); }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite; flex-shrink: 0; display: inline-block;
}
.spinner-lg {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--navy);
  animation: spin .8s linear infinite; display: inline-block;
}

/* ═══════════════ BADGE ═══════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 4px 11px 4px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-warning .dot { background: var(--warning); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-success .dot { background: var(--success); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-info .dot { background: var(--info); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-danger .dot { background: var(--danger); }
.badge-muted { background: var(--navy-soft); color: var(--text-muted); }
.badge-muted .dot { background: var(--text-muted); }

/* ═══════════════ TOAST ═══════════════ */
.toast {
  position: fixed; top: 20px; right: 20px; left: 20px; margin-left: auto; max-width: 380px; z-index: 9999;
  color: #fff; border-radius: 14px; padding: 14px 18px;
  display: flex; align-items: flex-start; gap: 10px;
  font-weight: 600; font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 16px 32px -10px rgba(0,0,0,.3);
  animation: slideDown .4s cubic-bezier(.4,0,.2,1) both;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ═══════════════ DASHBOARD: MAP + HISTORY ═══════════════ */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px,1fr)); gap: 20px; margin-bottom: clamp(18px,3vw,28px); }
.map-card { padding: 14px; height: 460px; overflow: hidden; display: flex; flex-direction: column; }
.map-card .map-head { display: flex; flex-direction: column; gap: 2px; padding: 2px 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.map-card .map-head .title-row { display: flex; align-items: center; gap: 10px; }
.map-card .map-head .icon-box { width: 30px; height: 30px; border-radius: 9px; background: var(--navy-soft); display: flex; align-items: center; justify-content: center; }
.map-card .map-head .title-row span { font-weight: 700; font-size: 15px; color: var(--text-main); }
.map-card .map-head .sub { font-size: 12px; color: var(--text-muted); margin-left: 40px; }
#peta-bencana { flex: 1; border-radius: 10px; overflow: hidden; }

.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.section-title .icon-box { width: 30px; height: 30px; border-radius: 9px; background: var(--navy-soft); display: flex; align-items: center; justify-content: center; }
.section-title span.label { font-weight: 700; font-size: 16px; color: var(--text-main); }
.section-title .count-pill { background: var(--navy-soft); color: var(--navy); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; margin-left: auto; }

.history-row {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
  display: flex; align-items: flex-start; gap: 14px; transition: background .2s, border-color .2s;
}
.history-row:hover { background: #fff; }
.history-row .icon-box { width: 40px; height: 40px; border-radius: 12px; background: var(--navy-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.history-row .body { flex: 1; min-width: 0; }
.history-row .top-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.history-row .jenis { font-weight: 700; font-size: 14px; color: var(--text-main); }
.history-row .lokasi { font-size: 13px; color: var(--text-sub); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.history-row .pesan { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-row .meta { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.history-row .meta span { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.history-row .sync-ok { color: var(--success); font-weight: 700; }
.history-row .sync-pending { color: var(--warning); font-weight: 700; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .icon-wrap { display: flex; justify-content: center; margin-bottom: 14px; }
.empty-state .title { font-size: 14px; font-weight: 600; color: var(--text-sub); margin-bottom: 4px; }

/* ═══════════════ MITIGASI PAGE ═══════════════ */
.emergency-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; }
.emergency-card {
  padding: 16px; display: flex; flex-direction: column; align-items: center; text-align: center;
  border-left: 3px solid var(--text-muted); transition: all .2s ease;
}
.emergency-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -12px rgba(15,30,50,.15); }
.emergency-card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 800; color: var(--text-main); }
.emergency-card .number { font-size: 24px; font-weight: 900; color: var(--navy); letter-spacing: .5px; margin-bottom: 6px; text-decoration: none; display: inline-block; transition: color .15s; }
.emergency-card .number:hover { color: var(--red); }
.emergency-card .wilayah { font-size: 12px; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.emergency-card .call-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--red); color: #fff; text-decoration: none; font-size: 13px; font-weight: 700;
  padding: 10px 0; border-radius: 10px; box-shadow: 0 4px 10px rgba(214,36,46,.15);
}

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip-btn {
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-sub); transition: all .15s ease;
  font-family: inherit;
}
.chip-btn.active { border-color: var(--navy); background: var(--navy); color: #fff; }

.mitigasi-row {
  background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--text-muted);
  border-radius: 14px; padding: 18px; display: flex; align-items: flex-start; gap: 14px;
  transition: all .2s ease;
}
.mitigasi-row:hover { background: var(--bg-input); transform: translateX(3px); }
.mitigasi-row .icon-box { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.mitigasi-row .kategori { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.mitigasi-row h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 800; color: var(--text-main); }
.mitigasi-row .deskripsi { font-size: 13px; color: var(--text-sub); line-height: 1.6; white-space: pre-line; }

/* ═══════════════ LOGIN ═══════════════ */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-card { width: 340px; padding: 30px 24px; }
.login-badge { text-align: center; margin-bottom: 26px; }
.login-badge .circle { width: 66px; height: 66px; margin: 0 auto 16px; background: var(--navy-soft); border: 1px solid var(--border); border-radius: 20px; display: flex; align-items: center; justify-content: center; }
.login-badge .title { font-size: 20px; font-weight: 800; color: var(--navy); }
.login-badge .sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.login-shake { animation: shake .45s ease; }
.login-error { color: var(--danger); font-size: 12.5px; font-weight: 600; text-align: center; margin-bottom: 10px; }

/* ═══════════════ ADMIN ═══════════════ */
.admin-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.admin-header .eyebrow-label { font-size: 11.5px; color: var(--text-muted); font-weight: 700; letter-spacing: .6px; margin-bottom: 6px; text-transform: uppercase; }
.admin-header h1 { margin: 0 0 8px; font-size: clamp(22px,4vw,28px); font-weight: 800; color: var(--navy); letter-spacing: -.5px; display: flex; align-items: center; gap: 12px; }
.admin-header h1 .icon-box { width: 38px; height: 38px; border-radius: 12px; background: var(--navy-soft); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.admin-header p { color: var(--text-sub); margin: 0; font-size: 13.5px; margin-left: 50px; }
.admin-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-actions .btn { padding: 10px 16px; font-size: 13px; border-radius: 13px; }

.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  background: var(--bg-input); color: var(--text-sub); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 13px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s ease; font-family: inherit;
}
.filter-pill.active { background: var(--navy); color: #fff; border-color: transparent; }
.filter-pill:hover:not(.active) { background: #e9ecef; }

.admin-row {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 15px 16px;
  display: flex; align-items: flex-start; gap: 13px; transition: background .2s, border-color .2s;
  animation: fadeIn .4s ease both;
}
.admin-row.pending { background: #fffdf5; border-color: rgba(217,140,16,.2); }
.admin-row:hover { background: var(--bg-input); }
.admin-row .icon-box { width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0; background: var(--bg-input); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.admin-row .body { flex: 1; min-width: 0; }
.admin-row .top-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.admin-row .jenis { font-weight: 700; font-size: 14.5px; color: var(--text-main); }
.admin-row .lokasi { font-size: 12.5px; color: var(--text-sub); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.admin-row .pesan { font-size: 12.5px; color: var(--text-sub); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; margin-bottom: 7px; }
.admin-row .waktu { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.admin-row .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }

.action-btn {
  padding: 7px 12px; border-radius: 10px; font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit; display: flex; align-items: center; gap: 5px; transition: all .2s ease; border: 1px solid transparent;
}
.action-btn.success { background: var(--success); color: #fff; border-color: var(--success); }
.action-btn.success:hover { background: var(--success-soft); color: var(--success); }
.action-btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.action-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.action-btn.info { background: var(--info); color: #fff; border-color: var(--info); }
.action-btn.info:hover { background: var(--info-soft); color: var(--info); }
.action-btn.outline-danger { background: transparent; color: var(--danger); border-color: rgba(180,35,35,.27); }
.action-btn.outline-danger:hover { background: var(--danger-soft); }

/* ═══════════════ AI COORDINATOR ═══════════════ */
.ai-prose p { margin-bottom: 18px; line-height: 1.75; color: var(--text-sub); }
.ai-prose ul, .ai-prose ol { padding-left: 20px; }
.ai-prose li { margin-bottom: 10px; line-height: 1.7; color: var(--text-sub); }
.ai-prose strong { color: var(--navy); font-weight: 700; }
.ai-prose h2 { font-size: 15.5px; font-weight: 800; color: var(--text-main); margin: 24px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.ai-prose h2:first-child { margin-top: 0; }
.ai-prose h3 { font-size: 14px; font-weight: 700; color: var(--navy); margin: 18px 0 8px; }
.ai-prose hr { border: none; border-top: 1px dashed var(--border); margin: 20px 0; }

.ai-warning {
  display: flex; align-items: flex-start; gap: 10px; background: var(--warning-soft);
  border: 1px solid rgba(154,107,10,.2); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
}
.ai-warning p { margin: 0; font-size: 13px; color: var(--warning); font-weight: 600; line-height: 1.55; }
.ai-disclaimer {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 24px; border-top: 1px solid var(--border);
  padding-top: 16px; background: var(--navy-soft); border-radius: 12px; padding: 12px 16px;
}
.ai-disclaimer p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.55; }

/* ═══════════════ LOGISTIK (DASHBOARD LOGISTIK MASUK) ═══════════════ */
.stat-grid.nested { margin-bottom: 20px; }

.logistik-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.logistik-toolbar .search-wrap { position: relative; flex: 1; max-width: 280px; min-width: 180px; }
.logistik-toolbar .search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.logistik-toolbar .search-wrap input { padding-left: 38px; }
.logistik-toolbar .filter-row { flex-shrink: 0; }

.logistik-add-form .form-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.logistik-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-bottom: 22px; }
.logistik-summary-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--bg-input); border: 1px solid var(--border);
}
.logistik-summary-card .icon-box { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logistik-summary-card .num { font-size: 20px; font-weight: 800; color: var(--text-main); line-height: 1.1; }
.logistik-summary-card .lbl { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }

.logistik-subhead {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--border);
}
.logistik-subhead span { font-weight: 700; font-size: 13.5px; color: var(--text-sub); }

.logistik-add-form {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.4fr; gap: 14px; align-items: end;
  margin-bottom: 20px; padding: 20px; background: var(--bg-input); border-radius: 14px; border: 1px solid var(--border);
}
.logistik-add-form .field { margin-bottom: 0; }
.logistik-add-form label { font-size: 10.5px; }
.logistik-add-form .btn { height: 46px; }
@media (max-width: 900px) { .logistik-add-form { grid-template-columns: 1fr 1fr; } }

.logistik-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
.logistik-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.logistik-table thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 700; padding: 12px 14px; background: var(--bg-input); border-bottom: 1px solid var(--border);
}
.logistik-table tbody tr { transition: background .15s ease; border-bottom: 1px solid var(--border); }
.logistik-table tbody tr:last-child { border-bottom: none; }
.logistik-table tbody tr:hover { background: var(--bg-input); }
.logistik-table tbody tr.row-menipis { background: var(--warning-soft); }
.logistik-table tbody tr.row-habis { background: var(--danger-soft); }
.logistik-table td { padding: 12px 14px; vertical-align: middle; }
.logistik-table .item-cell { display: flex; align-items: center; gap: 10px; }
.logistik-table .item-cell .icon-box { width: 32px; height: 32px; border-radius: 9px; background: var(--teal-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logistik-table .nama-cell { font-weight: 700; color: var(--text-main); line-height: 1.3; }
.logistik-table .nama-cell small { display: block; font-weight: 500; color: var(--text-muted); font-size: 11px; margin-top: 1px; }
.logistik-table .lokasi-cell { color: var(--text-sub); font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.logistik-table .stok-input-wrap { display: flex; align-items: center; gap: 6px; }
.logistik-table input[type=number] { width: 88px; padding: 8px 10px; font-size: 13px; border-radius: 9px; }
.logistik-table .satuan-inline { color: var(--text-muted); font-size: 12px; }
.logistik-table select.status-select {
  padding: 7px 10px; font-size: 12px; font-weight: 700; border-radius: 999px; border: 1px solid transparent;
  font-family: inherit; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-position: right 8px center; background-repeat: no-repeat; background-size: 10px;
  padding-right: 24px;
}
.logistik-table select.status-select.st-tersedia { background-color: var(--success-soft); color: var(--success); }
.logistik-table select.status-select.st-menipis { background-color: var(--warning-soft); color: var(--warning); }
.logistik-table select.status-select.st-habis { background-color: var(--danger-soft); color: var(--danger); }
.logistik-table .actions-cell { display: flex; gap: 6px; white-space: nowrap; }
.logistik-table .actions-cell .action-btn { padding: 6px 10px; font-size: 11.5px; }
.logistik-empty { text-align: center; padding: 36px 20px; color: var(--text-muted); font-size: 13px; }

/* ═══════════════ MODE HEMAT DATA (DATA SAVER) ═══════════════ */
.data-saver-toggle {
  display: flex; align-items: center; gap: 6px; margin-left: 8px;
  background: transparent; color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.25);
  padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 12px; cursor: pointer;
  font-family: inherit; transition: all .2s ease;
}
.data-saver-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.data-saver-toggle.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.data-saver-banner {
  display: flex; align-items: center; gap: 10px; background: var(--teal-soft); color: var(--teal);
  border: 1px solid rgba(13,148,136,.3); border-radius: 12px; padding: 12px 16px; font-size: 13px;
  font-weight: 600; margin-bottom: 18px;
}
.map-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  height: 100%; color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px;
  background: var(--bg-input); border-radius: 10px;
}
.map-placeholder button { margin-top: 4px; }

/* ═══════════════ MISC UTIL ═══════════════ */
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-muted { color: var(--text-muted); }
.offline-banner {
  display: flex; align-items: center; gap: 10px; background: var(--warning-soft); color: var(--warning);
  border: 1px solid rgba(154,107,10,.25); border-radius: 12px; padding: 12px 16px; font-size: 13px; font-weight: 600;
  margin-bottom: 18px;
}
