/* =====================================================================
   SENTIO · DSN Group — AI Command Center Theme
   Corporate-modern × futuristic command center × ESG/sustainability
   ===================================================================== */

:root {
  --bg: #060b14;
  --bg-2: #0a1220;
  --panel: rgba(15, 25, 42, 0.72);
  --panel-solid: #0f192a;
  --border: rgba(94, 234, 212, 0.10);
  --border-strong: rgba(94, 234, 212, 0.22);
  --text: #e6edf6;
  --text-dim: #8da2bb;
  --text-faint: #5c708a;
  --green: #10b981;
  --green-bright: #34d399;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --amber: #f59e0b;
  --red: #ef4444;
  --orange: #f97316;
  --radius: 14px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --sidebar-w: 252px;

  /* token tema (gelap = default) */
  --track: #14203a;
  --input-bg: #0b1526;
  --btn-bg: #16263f;
  --item-bg: rgba(13, 22, 38, 0.6);
  --hover: rgba(34, 211, 238, 0.035);
  --topbar-bg: rgba(8, 14, 26, 0.82);
  --grid-line: rgba(94, 234, 212, 0.025);
  --scroll-track: #0a1220;
  --scroll-thumb: #1e3050;
  --glow-radial-1: rgba(16, 185, 129, 0.07);
  --glow-radial-2: rgba(34, 211, 238, 0.06);
}

/* ===================== TEMA TERANG ===================== */
[data-theme="light"] {
  --bg: #eef2f7;
  --bg-2: #e3e9f2;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --border: rgba(13, 148, 136, 0.16);
  --border-strong: rgba(13, 148, 136, 0.32);
  --text: #0f172a;
  --text-dim: #46586e;
  --text-faint: #64748b;
  --track: #e2e8f0;
  --input-bg: #ffffff;
  --btn-bg: #e2e8f0;
  --item-bg: rgba(241, 245, 249, 0.8);
  --hover: rgba(13, 148, 136, 0.06);
  --topbar-bg: rgba(255, 255, 255, 0.88);
  --grid-line: rgba(13, 148, 136, 0.05);
  --scroll-track: #e3e9f2;
  --scroll-thumb: #b6c2d4;
  --glow-radial-1: rgba(16, 185, 129, 0.10);
  --glow-radial-2: rgba(34, 211, 238, 0.09);
}

/* Sidebar tetap gelap di tema terang (gaya corporate dashboard) */
[data-theme="light"] .sidebar {
  --text: #e6edf6;
  --text-dim: #8da2bb;
  --text-faint: #5c708a;
  --border: rgba(94, 234, 212, 0.10);
}

[data-theme="light"] .card,
[data-theme="light"] .kpi { box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06); }
[data-theme="light"] a { color: #0e7490; }
[data-theme="light"] a:hover { color: #047857; }
[data-theme="light"] .live-clock { color: #0e7490; }
[data-theme="light"] .badge-low, [data-theme="light"] .badge-ok { color: #047857; }
[data-theme="light"] .badge-medium, [data-theme="light"] .badge-warn { color: #b45309; }
[data-theme="light"] .badge-high { color: #c2410c; }
[data-theme="light"] .badge-critical, [data-theme="light"] .badge-danger { color: #b91c1c; }
[data-theme="light"] .badge-info { color: #1d4ed8; }
[data-theme="light"] .badge-violet { color: #6d28d9; }
[data-theme="light"] .badge-muted { color: #475569; }
[data-theme="light"] .btn-danger { color: #b91c1c; }
[data-theme="light"] .ai-brief-label { color: #6d28d9; }
[data-theme="light"] .alert-icon.level-3 { color: #b91c1c; }
[data-theme="light"] .alert-icon.level-2 { color: #c2410c; }
[data-theme="light"] .alert-icon.level-1 { color: #b45309; }
[data-theme="light"] .sla-ok { color: #047857; }
[data-theme="light"] .sla-warn { color: #b45309; }
[data-theme="light"] .leaflet-container { background: #dfe8f0; }
[data-theme="light"] .login-card { box-shadow: 0 30px 80px rgba(15, 23, 42, 0.14); }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 500px at 85% -10%, var(--glow-radial-1), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, var(--glow-radial-2), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* grid scanline backdrop */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--green-bright); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 6px; }

/* ============================ SHELL ============================ */
.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-left: var(--sidebar-w); }

.content { flex: 1; padding: 22px 26px 90px; max-width: 1700px; width: 100%; }

/* ============================ SIDEBAR ============================ */
.sidebar {
  width: var(--sidebar-w);
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0a1424 0%, #081020 100%);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; }

.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px; color: #06251c;
  background: linear-gradient(135deg, var(--green-bright), var(--cyan));
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.35);
}

.brand-logo-img {
  width: 70px; height: 100%;
}

.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: 1px; }
.brand-accent { color: var(--green-bright); }
.brand-sub { font-size: 10.5px; color: var(--text-faint); letter-spacing: 2px; text-transform: uppercase; }

.nav { flex: 1; padding: 4px 12px 16px; }

.nav-section {
  font-size: 10px; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--text-faint); padding: 16px 8px 7px;
}

.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px;
  color: var(--text-dim); font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent; margin-bottom: 2px;
  transition: all .15s ease;
}
.nav-link:hover { color: var(--text); background: rgba(34, 211, 238, 0.05); }
.nav-link.active {
  color: var(--green-bright);
  background: linear-gradient(90deg, rgba(16,185,129,0.13), rgba(34,211,238,0.05));
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: inset 2px 0 0 var(--green-bright);
}
.nav-icon { width: 20px; text-align: center; font-size: 15px; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 700; border-radius: 999px;
  min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 0 10px rgba(239, 68, 68, .5);
}

.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.ai-status {
  display: flex; gap: 10px; align-items: center;
  background: rgba(16, 185, 129, 0.07); border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px; padding: 10px 12px;
}
.ai-status-title { font-size: 12px; font-weight: 600; color: var(--green-bright); }
.ai-status-sub { font-size: 10.5px; color: var(--text-faint); }

.pulse-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green-bright); flex-shrink: 0;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.sidebar-overlay { display: none; }

/* ============================ TOPBAR ============================ */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 26px;
  background: var(--topbar-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}

.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 21px; cursor: pointer; }

.page-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.page-subtitle { font-size: 12px; color: var(--text-dim); margin-top: 1px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.live-clock { font-family: var(--font-display); font-size: 13px; color: var(--cyan); letter-spacing: 1px; }

.theme-toggle {
  background: none; border: 1px solid var(--border-strong); color: var(--text-dim);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 16px;
  display: grid; place-items: center; transition: all .15s;
}
.theme-toggle:hover { color: var(--green-bright); border-color: var(--green); }

.bell { position: relative; color: var(--amber); font-size: 16px; }
.bell-badge {
  position: absolute; top: -7px; right: -10px;
  background: var(--red); color: #fff; font-size: 9.5px; font-weight: 700;
  border-radius: 999px; min-width: 16px; height: 16px;
  display: grid; place-items: center; padding: 0 4px;
}

.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #04150f;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-faint); }
.logout-link { color: var(--text-faint); font-size: 17px; margin-left: 4px; }
.logout-link:hover { color: var(--red); }

/* ============================ CARDS / GRID ============================ */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.col-span-2 { grid-column: span 2; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(8px);
  position: relative;
}
.card.glow-top::before {
  content: ''; position: absolute; top: 0; left: 14px; right: 14px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.55), transparent);
}

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; letter-spacing: .4px; display: flex; align-items: center; gap: 8px; }
.card-title .tick { color: var(--green-bright); }
.card-sub { font-size: 11.5px; color: var(--text-faint); }

.mt { margin-top: 16px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 17px; position: relative; overflow: hidden;
}
.kpi::after {
  content: ''; position: absolute; right: -28px; top: -28px; width: 86px; height: 86px;
  border-radius: 50%; background: radial-gradient(circle, var(--kpi-glow, rgba(16,185,129,.14)), transparent 70%);
}
.kpi-label { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-faint); }
.kpi-value { font-family: var(--font-display); font-size: 29px; font-weight: 700; margin: 5px 0 2px; }
.kpi-note { font-size: 11.5px; color: var(--text-dim); }
.kpi-note .up { color: var(--red); }
.kpi-note .down { color: var(--green-bright); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid;
  white-space: nowrap;
}
.badge-low      { color: #6ee7b7; border-color: rgba(110,231,183,.4); background: rgba(16,185,129,.1); }
.badge-medium   { color: #fcd34d; border-color: rgba(252,211,77,.4); background: rgba(245,158,11,.1); }
.badge-high     { color: #fdba74; border-color: rgba(253,186,116,.45); background: rgba(249,115,22,.12); }
.badge-critical { color: #fca5a5; border-color: rgba(252,165,165,.5); background: rgba(239,68,68,.14); animation: blink 2.4s infinite; }
.badge-ok     { color: #6ee7b7; border-color: rgba(110,231,183,.4); background: rgba(16,185,129,.1); }
.badge-info   { color: #93c5fd; border-color: rgba(147,197,253,.4); background: rgba(59,130,246,.12); }
.badge-warn   { color: #fcd34d; border-color: rgba(252,211,77,.4); background: rgba(245,158,11,.1); }
.badge-danger { color: #fca5a5; border-color: rgba(252,165,165,.5); background: rgba(239,68,68,.14); }
.badge-violet { color: #c4b5fd; border-color: rgba(196,181,253,.4); background: rgba(139,92,246,.12); }
.badge-muted  { color: #94a3b8; border-color: rgba(148,163,184,.35); background: rgba(148,163,184,.08); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ============================ TABLES ============================ */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data th {
  text-align: left; padding: 9px 12px;
  font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-faint); border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:hover td { background: var(--hover); }
table.data .num { font-family: var(--font-display); font-weight: 600; }

/* risk bar */
.riskbar { width: 110px; height: 7px; background: var(--track); border-radius: 99px; overflow: hidden; }
.riskbar > span { display: block; height: 100%; border-radius: 99px; }
.risk-score-cell { display: flex; align-items: center; gap: 10px; }
.risk-num { font-family: var(--font-display); font-weight: 700; font-size: 15px; min-width: 42px; }

/* ============================ FORMS ============================ */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }

label.fld { display: block; font-size: 11.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 5px; }

input[type=text], input[type=password], input[type=number], input[type=date],
select, textarea {
  width: 100%; padding: 9px 12px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 9px;
  font-family: var(--font-body); font-size: 13.5px;
  outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
textarea { resize: vertical; min-height: 80px; }
select option { background: var(--panel-solid); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: .4px;
  border: 1px solid transparent; transition: all .15s;
  background: var(--btn-bg); color: var(--text);
}
.btn:hover { filter: brightness(1.15); }
.btn-primary {
  background: linear-gradient(135deg, var(--green), #0d9488); color: #04150f;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.3);
}
.btn-danger { background: rgba(239,68,68,.16); color: #fca5a5; border-color: rgba(239,68,68,.4); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-dim); }
.btn-sm { padding: 5px 11px; font-size: 11.5px; border-radius: 8px; }

.inline-form { display: inline; }

/* filter bar */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filterbar select, .filterbar input { width: auto; min-width: 150px; }

/* flash */
.flash { padding: 12px 16px; border-radius: 11px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid; }
.flash-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.35); color: #6ee7b7; }
.flash-error   { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.35); color: #fca5a5; }

/* ============================ ALERTS ============================ */
.alert-item {
  display: flex; gap: 14px; padding: 15px;
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 11px;
  background: var(--item-bg);
}
.alert-item.level-3 { border-color: rgba(239,68,68,.45); background: linear-gradient(90deg, rgba(239,68,68,.10), transparent 70%), var(--item-bg); }
.alert-item.level-2 { border-color: rgba(249,115,22,.4); background: linear-gradient(90deg, rgba(249,115,22,.08), transparent 70%), var(--item-bg); }
.alert-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-size: 17px; flex-shrink: 0;
}
.alert-icon.level-3 { background: rgba(239,68,68,.16); color: #fca5a5; }
.alert-icon.level-2 { background: rgba(249,115,22,.15); color: #fdba74; }
.alert-icon.level-1 { background: rgba(245,158,11,.13); color: #fcd34d; }
.alert-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.alert-msg { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }
.alert-meta { font-size: 11px; color: var(--text-faint); margin-top: 7px; display: flex; gap: 14px; flex-wrap: wrap; }
.alert-actions { margin-left: auto; display: flex; flex-direction: column; gap: 7px; align-items: flex-end; flex-shrink: 0; }

/* ============================ TIMELINE ============================ */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--green), rgba(34,211,238,.25));
}
.tl-item { position: relative; padding-bottom: 22px; }
.tl-dot {
  position: absolute; left: -30px; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px;
  background: var(--panel-solid); border: 2px solid var(--tl-color, var(--green));
  box-shadow: 0 0 9px color-mix(in srgb, var(--tl-color, var(--green)) 50%, transparent);
}
.tl-head { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.tl-type { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--tl-color, var(--green)); }
.tl-time { font-size: 11px; color: var(--text-faint); }
.tl-title { font-weight: 600; font-size: 13.5px; margin: 3px 0; }
.tl-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.tl-user { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* ============================ AI ELEMENTS ============================ */
.ai-brief {
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, rgba(139,92,246,.09), rgba(34,211,238,.05));
  border-radius: var(--radius); padding: 17px 19px;
  margin-bottom: 16px; position: relative; overflow: hidden;
}
.ai-brief::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--green-bright));
}
.ai-brief-label {
  display: inline-flex; gap: 7px; align-items: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: #c4b5fd; margin-bottom: 8px;
}
.ai-brief-text { font-size: 13.5px; line-height: 1.7; color: var(--text); }

.reco {
  border: 1px solid var(--border); border-radius: 13px; padding: 16px;
  background: var(--item-bg); margin-bottom: 12px;
  border-left: 3px solid var(--reco-color, var(--green));
}
.reco-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 7px; }
.reco-title { font-weight: 600; font-size: 14px; flex: 1; min-width: 200px; }
.reco-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.reco-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--text-faint); align-items: center; }
.confidence {
  display: inline-flex; align-items: center; gap: 6px;
}
.confidence .bar { width: 64px; height: 5px; background: var(--track); border-radius: 99px; overflow: hidden; }
.confidence .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--cyan)); }

/* gauge (CSS conic) */
.gauge { position: relative; width: 122px; height: 122px; border-radius: 50%; display: grid; place-items: center; }
.gauge::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--g-color) calc(var(--g-val) * 1%), var(--track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px));
}
.gauge-val { font-family: var(--font-display); font-size: 27px; font-weight: 700; }
.gauge-label { font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-faint); }

/* component mini bars */
.combar { margin-bottom: 9px; }
.combar-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-dim); margin-bottom: 4px; }
.combar-track { height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.combar-track span { display: block; height: 100%; border-radius: 99px; }

/* keyword chips */
.chip-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--item-bg);
}
.chip small { color: var(--text-faint); font-weight: 500; margin-left: 5px; }

/* site cards */
.site-card { display: flex; gap: 18px; align-items: center; }
.site-card .info { flex: 1; min-width: 0; }
.site-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.site-loc { font-size: 12px; color: var(--text-dim); margin: 2px 0 8px; }
.site-stats { display: flex; gap: 13px; font-size: 11.5px; color: var(--text-faint); flex-wrap: wrap; }
.site-stats b { color: var(--text); font-family: var(--font-display); }

/* map */
.map-box { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-strong); }
#mainMap { height: calc(100vh - 220px); min-height: 460px; }
#miniMap { height: 300px; }
.leaflet-container { background: #0a1220; font-family: var(--font-body); }
.map-legend {
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim);
  padding: 11px 4px 0;
}
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }

/* grievance SLA */
.sla-ok { color: var(--green-bright); font-size: 12px; font-weight: 600; }
.sla-warn { color: var(--amber); font-size: 12px; font-weight: 600; }
.sla-over { color: var(--red); font-size: 12px; font-weight: 700; animation: blink 2.4s infinite; }

/* modal */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(3, 7, 14, 0.78); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding: 5vh 16px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 640px;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.modal h3 { font-family: var(--font-display); margin-bottom: 16px; font-size: 17px; }
.modal-close { float: right; background: none; border: none; color: var(--text-faint); font-size: 19px; cursor: pointer; }

/* detail layout */
.detail-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 13px; }
.kv dt { color: var(--text-faint); }
.kv dd { color: var(--text); }

/* stakeholder quadrant labels */
.quad-note { font-size: 11px; color: var(--text-faint); }

/* footer */
.app-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 26px; font-size: 11.5px; color: var(--text-faint);
  border-top: 1px solid var(--border);
}

/* bottom nav (mobile only) */
.bottom-nav { display: none; }

/* ============================ LOGIN ============================ */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  position: relative; z-index: 1;
}
.login-card {
  width: 100%; max-width: 410px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 34px 30px;
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 50px rgba(16,185,129,.07);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo-img {
  width: 70px; height: 100%; 
}
.login-title { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: 1px; }
.login-sub { font-size: 12px; color: var(--text-dim); margin-top: 5px; line-height: 1.6; }
.login-field { margin-bottom: 15px; }
.login-foot { margin-top: 20px; text-align: center; font-size: 11.5px; color: var(--text-faint); line-height: 1.7; }
.login-foot code { color: var(--cyan); background: rgba(34,211,238,.08); padding: 1px 6px; border-radius: 5px; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .main { margin-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 30px 0 70px rgba(0,0,0,.5); }
  .sidebar-overlay.open { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(3,7,14,.6); }
  .hamburger { display: block; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  html { font-size: 14px; }
  .content { padding: 16px 14px 100px; }
  .topbar { padding: 12px 14px; }
  .kpi-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .form-grid { grid-template-columns: 1fr; }
  .user-meta, .live-clock { display: none; }
  .filterbar select, .filterbar input { flex: 1; min-width: 120px; }
  #mainMap { height: 62vh; min-height: 380px; }
  .alert-item { flex-direction: column; }
  .alert-actions { margin-left: 0; flex-direction: row; align-items: center; }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: var(--topbar-bg); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-strong);
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10px; color: var(--text-faint); font-weight: 600;
  }
  .bottom-nav a span { font-size: 17px; }
  .bottom-nav a.active { color: var(--green-bright); }
  .app-footer { padding-bottom: 80px; }
}

/* ============================ PRINT (laporan) ============================ */
@media print {
  body { background: #fff; color: #111; }
  body::before { display: none; }
  .sidebar, .topbar, .bottom-nav, .app-footer, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .card, .kpi { background: #fff; border: 1px solid #ddd; color: #111; break-inside: avoid; }
  .card-title, .kpi-value, .page-title { color: #111; }
  .kpi-label, .card-sub, .kpi-note { color: #555; }
  table.data th { color: #555; border-color: #ccc; }
  table.data td { border-color: #eee; color: #111; }
  .ai-brief { background: #f5f3ff; color: #111; }
  .ai-brief-text { color: #111; }
}
