/* ============================================================
   PPPK — Command Center Pemadam Kebakaran
   web.css v2.0 — Fase 4H
   Design System: Dark-first, Fire Red #DC2626, Navy #0A0F1E
   ============================================================ */

/* ---- 0. GOOGLE FONTS ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---- 1. CSS VARIABLES ---- */
:root {
  /* Brand */
  --color-primary:        #DC2626;
  --color-primary-dark:   #B91C1C;
  --color-primary-light:  #FEE2E2;
  --color-secondary:      #EA580C;

  /* Light Mode Backgrounds */
  --bg-primary:           #F8FAFC;
  --bg-secondary:         #F1F5F9;
  --bg-card:              #FFFFFF;
  --border:               #E2E8F0;
  --text-primary:         #0F172A;
  --text-secondary:       #475569;
  --text-muted:           #94A3B8;

  /* Sidebar */
  --sidebar-width:        240px;
  --sidebar-collapsed:    64px;
  --sidebar-bg:           #FFFFFF;
  --sidebar-border:       #E2E8F0;
  --sidebar-text:         #475569;
  --sidebar-active-bg:    #FEE2E2;
  --sidebar-active-text:  #DC2626;
  --sidebar-hover-bg:     #F1F5F9;

  /* Header */
  --header-height:        60px;
  --header-bg:            #FFFFFF;
  --header-border:        #E2E8F0;

  /* Status unit */
  --status-avl:           #16A34A;
  --status-enr:           #D97706;
  --status-ons:           #EA580C;
  --status-hdl:           #DC2626;
  --status-clr:           #0284C7;
  --status-oos:           #6B7280;

  /* Semantic */
  --color-success:        #16A34A;
  --color-warning:        #D97706;
  --color-danger:         #DC2626;
  --color-info:           #0284C7;

  /* Radius */
  --radius-sm:            4px;
  --radius-md:            8px;
  --radius-lg:            12px;
  --radius-xl:            16px;
  --radius-full:          9999px;

  /* Shadow */
  --shadow-sm:            0 1px 3px rgba(0,0,0,.08);
  --shadow-md:            0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:            0 8px 24px rgba(0,0,0,.14);

  /* Transition */
  --transition:           0.2s ease;
  --transition-slow:      0.35s ease;

  /* Z-index */
  --z-sidebar:            200;
  --z-header:             300;
  --z-dropdown:           400;
  --z-modal:              500;
  --z-toast:              600;
}

[data-theme="dark"] {
  --bg-primary:           #0A0F1E;
  --bg-secondary:         #0F172A;
  --bg-card:              #1E293B;
  --border:               #334155;
  --text-primary:         #F8FAFC;
  --text-secondary:       #94A3B8;
  --text-muted:           #64748B;

  --sidebar-bg:           #0F172A;
  --sidebar-border:       #1E293B;
  --sidebar-text:         #94A3B8;
  --sidebar-active-bg:    rgba(220,38,38,.18);
  --sidebar-active-text:  #EF4444;
  --sidebar-hover-bg:     rgba(255,255,255,.05);

  --header-bg:            #0F172A;
  --header-border:        #1E293B;

  --color-primary:        #EF4444;
  --color-primary-dark:   #DC2626;
  --color-primary-light:  rgba(239,68,68,.15);

  --shadow-sm:            0 1px 3px rgba(0,0,0,.3);
  --shadow-md:            0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:            0 8px 24px rgba(0,0,0,.5);
}

/* ---- 2. RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: .9rem;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background var(--transition), color var(--transition);
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ---- 3. APP SHELL ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-slow);
  min-width: 0;
}
.app-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed);
}
.app-main {
  flex: 1;
  padding: 24px;
  margin-top: var(--header-height);
}

/* ---- 4. SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: width var(--transition-slow);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--header-height);
  border-bottom: 1px solid var(--sidebar-border);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .875rem;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-logo-sub {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 400;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-group-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px 4px;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--text-primary);
  text-decoration: none;
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.nav-item-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: .95rem;
}
.nav-item-label { flex: 1; }
.nav-item-badge {
  background: var(--color-primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}
.nav-item-badge-danger { background: var(--color-primary); }
.nav-item-badge-gray   { background: var(--text-muted); }
.sidebar.collapsed .nav-item-label,
.sidebar.collapsed .nav-item-badge,
.sidebar.collapsed .sidebar-group-label { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-logo-text { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: var(--z-tooltip);
}
.sidebar.collapsed .nav-item:hover::after { opacity: 1; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar-toggle {
  position: absolute;
  top: 16px;
  right: -12px;
  width: 24px;
  height: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .65rem;
  color: var(--text-secondary);
  z-index: 1;
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-secondary); }

/* ---- 5. HEADER / TOPBAR ---- */
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.app-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: var(--z-header);
  transition: left var(--transition-slow);
}
.app-header.sidebar-collapsed { left: var(--sidebar-collapsed); }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-muted);
  min-width: 0;
}
.breadcrumb-item { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 500; }
.breadcrumb-sep { color: var(--text-muted); font-size: .7rem; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.header-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.header-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--color-primary);
  border-radius: 50%;
  border: 1.5px solid var(--header-bg);
}
.header-hamburger { display: flex; }
.header-sync {
  font-size: .72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  padding: 0 4px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: calc(var(--z-sidebar) - 1);
  cursor: pointer;
}
.sidebar-overlay.active { display: block; }
.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---- 6. BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
  background: #DC2626;
  color: #fff;
}
.btn-danger:hover { background: #B91C1C; }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-secondary); }
.btn-success {
  background: #16A34A;
  color: #fff;
}
.btn-success:hover { background: #15803D; }
.btn-warning {
  background: #D97706;
  color: #fff;
}
.btn-warning:hover { background: #B45309; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}
.btn-icon-sm { width: 28px; height: 28px; font-size: .75rem; }
.btn-dispatch {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
}
.btn-dispatch:hover { background: var(--color-primary-dark); }

/* ---- 7. CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-subtitle {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.card-body { }
.card-body-scroll { overflow-y: auto; max-height: 360px; padding-right: 2px; }
.card-body-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
:not(.grid) > .card + .card { margin-top: 16px; }

/* Stat Card (KPI) */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card-label {
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.stat-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
}
.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.stat-card-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
}
.stat-card-trend-up { color: var(--color-success); }
.stat-card-trend-down { color: var(--color-danger); }
.stat-card-desc { color: var(--text-muted); }

/* Stat card variants */
.stat-card-primary .stat-card-icon {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.stat-card-success .stat-card-icon {
  background: rgba(22,163,74,.12);
  color: var(--color-success);
}
.stat-card-warning .stat-card-icon {
  background: rgba(217,119,6,.12);
  color: var(--color-warning);
}
.stat-card-info .stat-card-icon {
  background: rgba(2,132,199,.12);
  color: var(--color-info);
}

/* Incident card */
.incident-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: box-shadow var(--transition);
}
.incident-card:hover { box-shadow: var(--shadow-md); }
.incident-card-kritis { border-left-color: #DC2626; }
.incident-card-tinggi  { border-left-color: #D97706; }
.incident-card-sedang  { border-left-color: #0284C7; }
.incident-card-rendah  { border-left-color: #6B7280; }

/* Unit card (dispatch board) */
.unit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.unit-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.unit-card.selected { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-light); }
.unit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.unit-card-id { font-size: .8rem; font-weight: 700; color: var(--text-primary); }

/* ---- 8. BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-gray    { background: #F1F5F9; color: #475569; }
.badge-blue    { background: #EFF6FF; color: #1D4ED8; }
.badge-green   { background: #DCFCE7; color: #15803D; }
.badge-yellow  { background: #FEF9C3; color: #A16207; }
.badge-red     { background: #FEE2E2; color: #B91C1C; }
.badge-orange  { background: #FEF3C7; color: #B45309; }
[data-theme="dark"] .badge-gray   { background: #1E293B; color: #94A3B8; }
[data-theme="dark"] .badge-blue   { background: rgba(29,78,216,.18); color: #93C5FD; }
[data-theme="dark"] .badge-green  { background: rgba(22,163,74,.18); color: #86EFAC; }
[data-theme="dark"] .badge-yellow { background: rgba(161,98,7,.18); color: #FDE047; }
[data-theme="dark"] .badge-red    { background: rgba(185,28,28,.18); color: #FCA5A5; }
[data-theme="dark"] .badge-orange { background: rgba(180,83,9,.18); color: #FCD34D; }

/* Incident status badges */
.badge-insiden-aktif     { background: #FEE2E2; color: #B91C1C; }
.badge-insiden-dispatch  { background: #FEF3C7; color: #B45309; }
.badge-insiden-ditangani { background: rgba(2,132,199,.12); color: #0284C7; }
.badge-insiden-selesai   { background: #DCFCE7; color: #15803D; }
.badge-insiden-batal     { background: #F1F5F9; color: #6B7280; }
[data-theme="dark"] .badge-insiden-aktif     { background: rgba(185,28,28,.2); color: #FCA5A5; }
[data-theme="dark"] .badge-insiden-dispatch  { background: rgba(180,83,9,.2); color: #FCD34D; }
[data-theme="dark"] .badge-insiden-ditangani { background: rgba(2,132,199,.2); color: #7DD3FC; }
[data-theme="dark"] .badge-insiden-selesai   { background: rgba(22,163,74,.2); color: #86EFAC; }
[data-theme="dark"] .badge-insiden-batal     { background: #1E293B; color: #64748B; }

/* Unit status badges */
.badge-unit-avl { background: #DCFCE7; color: #15803D; }
.badge-unit-enr { background: #FEF9C3; color: #A16207; }
.badge-unit-ons { background: #FEF3C7; color: #B45309; }
.badge-unit-hdl { background: #FEE2E2; color: #B91C1C; }
.badge-unit-clr { background: rgba(2,132,199,.12); color: #0284C7; }
.badge-unit-oos { background: #F1F5F9; color: #6B7280; }
[data-theme="dark"] .badge-unit-avl { background: rgba(22,163,74,.2); color: #86EFAC; }
[data-theme="dark"] .badge-unit-enr { background: rgba(161,98,7,.2); color: #FDE047; }
[data-theme="dark"] .badge-unit-ons { background: rgba(180,83,9,.2); color: #FCD34D; }
[data-theme="dark"] .badge-unit-hdl { background: rgba(185,28,28,.2); color: #FCA5A5; }
[data-theme="dark"] .badge-unit-clr { background: rgba(2,132,199,.2); color: #7DD3FC; }
[data-theme="dark"] .badge-unit-oos { background: #1E293B; color: #64748B; }

/* Prioritas badges */
.badge-prioritas-kritis { background: #FEE2E2; color: #B91C1C; font-weight: 700; }
.badge-prioritas-tinggi  { background: #FEF3C7; color: #B45309; }
.badge-prioritas-sedang  { background: #EFF6FF; color: #1D4ED8; }
.badge-prioritas-rendah  { background: #F1F5F9; color: #475569; }
[data-theme="dark"] .badge-prioritas-kritis { background: rgba(185,28,28,.2); color: #FCA5A5; }
[data-theme="dark"] .badge-prioritas-tinggi  { background: rgba(180,83,9,.2); color: #FCD34D; }
[data-theme="dark"] .badge-prioritas-sedang  { background: rgba(29,78,216,.18); color: #93C5FD; }
[data-theme="dark"] .badge-prioritas-rendah  { background: #1E293B; color: #94A3B8; }

/* Role badges */
.badge-role-super-admin    { background: #F5F3FF; color: #6D28D9; }
.badge-role-admin-dinas    { background: #EFF6FF; color: #1D4ED8; }
.badge-role-dispatcher     { background: #FEF3C7; color: #B45309; }
.badge-role-supervisor     { background: #DCFCE7; color: #15803D; }
.badge-role-petugas        { background: rgba(2,132,199,.12); color: #0284C7; }
.badge-role-viewer         { background: #F1F5F9; color: #6B7280; }
[data-theme="dark"] .badge-role-super-admin { background: rgba(109,40,217,.2); color: #C4B5FD; }
[data-theme="dark"] .badge-role-admin-dinas { background: rgba(29,78,216,.18); color: #93C5FD; }
[data-theme="dark"] .badge-role-dispatcher  { background: rgba(180,83,9,.2); color: #FCD34D; }
[data-theme="dark"] .badge-role-supervisor  { background: rgba(22,163,74,.2); color: #86EFAC; }
[data-theme="dark"] .badge-role-petugas     { background: rgba(2,132,199,.2); color: #7DD3FC; }
[data-theme="dark"] .badge-role-viewer      { background: #1E293B; color: #64748B; }

/* ---- 9. STATUS DOT ---- */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-avl { background: var(--status-avl); }
.status-dot-enr { background: var(--status-enr); }
.status-dot-ons { background: var(--status-ons); }
.status-dot-hdl { background: var(--status-hdl); animation: pulse-dot 1.5s infinite; }
.status-dot-clr { background: var(--status-clr); }
.status-dot-oos { background: var(--status-oos); }

/* ---- 10. ICON BOX ---- */
.icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.icon-box-primary { background: var(--color-primary-light); color: var(--color-primary); }
.icon-box-success { background: rgba(22,163,74,.12); color: var(--color-success); }
.icon-box-warning { background: rgba(217,119,6,.12); color: var(--color-warning); }
.icon-box-danger  { background: var(--color-primary-light); color: var(--color-danger); }
.icon-box-info    { background: rgba(2,132,199,.12); color: var(--color-info); }
.icon-box-gray    { background: var(--bg-secondary); color: var(--text-muted); }

/* ---- 11. DATA TABLE ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.data-table thead { background: var(--bg-secondary); }
.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-secondary); }
.data-table tbody td {
  padding: 12px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table .col-id { font-family: monospace; color: var(--text-muted); font-size: .8rem; }
.data-table .col-actions {
  text-align: right;
  white-space: nowrap;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.table-toolbar-left, .table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- 12. PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
}
.pagination-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.pagination-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.pagination-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 600;
}
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }
.pagination-info {
  font-size: .8rem;
  color: var(--text-muted);
  margin-left: auto;
}
.pagination-ellipsis { font-size: .8rem; color: var(--text-muted); padding: 0 4px; display: flex; align-items: center; }

/* ---- 13. FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }
.form-control {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: .875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { background: var(--bg-secondary); opacity: .7; cursor: not-allowed; }
select.form-control { cursor: pointer; }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-control-sm { padding: 5px 10px; font-size: .8rem; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .75rem; color: var(--color-danger); margin-top: 4px; }
.form-control.is-error { border-color: var(--color-danger); }
.form-control.is-error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.2); }
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .form-control {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  flex: 1;
}
.input-group .btn {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.input-group-text {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: none;
  color: var(--text-muted);
  font-size: .875rem;
}
.search-input-wrapper {
  position: relative;
}
.search-input-wrapper .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .8rem;
}
.search-input-wrapper .form-control { padding-left: 32px; }
.form-row {
  display: grid;
  gap: 16px;
}
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.form-check-input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.form-check-label { font-size: .875rem; color: var(--text-primary); cursor: pointer; }

/* ---- 14. MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-overlay.open .modal { transform: translateY(0); opacity: 1; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(-16px);
  opacity: 0;
  transition: transform var(--transition), opacity var(--transition);
}
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text-primary); }
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- 15. DROPDOWN ---- */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  border: 2px solid var(--border);
  transition: border-color var(--transition);
}
.avatar:hover { border-color: var(--color-primary); }
.dropdown-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dropdown-header strong { font-size: .85rem; color: var(--text-primary); }
.dropdown-header span   { font-size: .75rem; color: var(--text-muted); }
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  z-index: var(--z-dropdown);
  padding: 4px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition);
}
.dropdown-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: .85rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  width: 100%;
  border: none;
  background: none;
  text-align: left;
}
.dropdown-item:hover { background: var(--bg-secondary); }
.dropdown-item.danger { color: var(--color-danger); }
.dropdown-item.danger:hover { background: var(--color-primary-light); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ---- 16. TOAST ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: .85rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toast-in .3s ease;
}
.toast-success { background: #16A34A; color: #fff; }
.toast-error   { background: #DC2626; color: #fff; }
.toast-warning { background: #D97706; color: #fff; }
.toast-info    { background: #0284C7; color: #fff; }
.toast-icon    { font-size: 1rem; flex-shrink: 0; }
.toast-message { flex: 1; }
.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  font-size: .75rem;
  padding: 2px;
  flex-shrink: 0;
}
.toast-dispatch {
  background: var(--color-primary);
  color: #fff;
  border-left: 4px solid #B91C1C;
}

/* ---- 17. TABS ---- */
.tabs { display: flex; border-bottom: 1px solid var(--border); gap: 0; }
.tab-btn {
  padding: 10px 16px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- 18. ALERTS ---- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: .875rem;
}
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-warning { background: #FEF9C3; color: #854D0E; border: 1px solid #FDE047; }
.alert-danger  { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
[data-theme="dark"] .alert-success { background: rgba(22,163,74,.15); color: #86EFAC; border-color: rgba(22,163,74,.3); }
[data-theme="dark"] .alert-warning { background: rgba(217,119,6,.15); color: #FDE047; border-color: rgba(217,119,6,.3); }
[data-theme="dark"] .alert-danger  { background: rgba(220,38,38,.15); color: #FCA5A5; border-color: rgba(220,38,38,.3); }
[data-theme="dark"] .alert-info    { background: rgba(2,132,199,.15); color: #7DD3FC; border-color: rgba(2,132,199,.3); }

/* ---- 19. PROGRESS ---- */
.progress {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width .4s ease;
}
.progress-bar-success { background: var(--color-success); }
.progress-bar-warning { background: var(--color-warning); }
.progress-bar-info    { background: var(--color-info); }

/* ---- 20. EMPTY STATE ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 12px;
  text-align: center;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.empty-state-desc  { font-size: .875rem; color: var(--text-muted); max-width: 300px; }

/* ---- 21. GRID LAYOUTS ---- */
.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); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---- 22. DISPATCH BOARD ---- */
.dispatch-board {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.dispatch-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.dispatch-panel-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.dispatch-drop-zone {
  min-height: 120px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: var(--text-muted);
  transition: border-color var(--transition), background var(--transition);
}
.dispatch-drop-zone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.incident-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: .8rem;
  border-bottom: 1px solid var(--border);
}
.incident-info-row:last-child { border-bottom: none; }
.incident-info-label { color: var(--text-muted); }
.incident-info-value { color: var(--text-primary); font-weight: 500; }

/* ---- 23. MAP PAGE ---- */
.map-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
}
.map-placeholder {
  width: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  font-size: .875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: .75rem;
  box-shadow: var(--shadow-sm);
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: var(--text-secondary);
}

/* ---- 24. LOGIN PAGE ---- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-logo-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}
.login-logo-text { }
.login-logo-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.login-logo-sub   { font-size: .75rem; color: var(--text-muted); }
.login-heading { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.login-sub     { font-size: .85rem; color: var(--text-muted); margin-bottom: 24px; }

/* ---- 25. ANIMATIONS ---- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}
@keyframes blink-red {
  0%, 100% { background: transparent; }
  50%       { background: rgba(220,38,38,.12); }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.row-kritis { animation: blink-red 2s infinite; }

/* ---- 26. UTILITIES ---- */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.gap-4         { gap: 4px; }
.mr-4          { margin-right: 4px; }
.select-auto   { width: auto; }
.gap-8         { gap: 8px; }
.gap-12        { gap: 12px; }
.gap-16        { gap: 16px; }
.gap-24        { gap: 24px; }
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.w-full        { width: 100%; }
.h-full        { height: 100%; }
.min-w-0       { min-width: 0; }
.mt-4          { margin-top: 4px; }
.mt-8          { margin-top: 8px; }
.mt-16         { margin-top: 16px; }
.mt-24         { margin-top: 24px; }
.mb-4          { margin-bottom: 4px; }
.mb-8          { margin-bottom: 8px; }
.mb-16         { margin-bottom: 16px; }
.mb-24         { margin-bottom: 24px; }
.ml-auto       { margin-left: auto; }
.text-sm       { font-size: .8rem; }
.text-xs       { font-size: .72rem; }
.text-lg       { font-size: 1rem; }
.text-xl       { font-size: 1.1rem; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.text-primary  { color: var(--text-primary); }
.text-secondary{ color: var(--text-secondary); }
.text-muted    { color: var(--text-muted); }
.text-danger   { color: var(--color-danger); }
.text-success  { color: var(--color-success); }
.text-warning  { color: var(--color-warning); }
.text-info     { color: var(--color-info); }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden        { display: none !important; }
.sr-only       { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.divider       { height: 1px; background: var(--border); margin: 16px 0; }
.section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left { }
.page-header-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.page-header-desc  { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }
.page-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---- 26B. DISPATCH ALERT TOAST ---- */
.toast-dispatch {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 320px;
  max-width: 420px;
  padding: 14px 16px;
  background: var(--color-primary);
  color: #fff;
  border-left: 4px solid #B91C1C;
}
.toast-dispatch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}
.toast-dispatch-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .9rem;
}
.toast-dispatch-title i { animation: spin 2s linear infinite; }
.toast-dispatch-body {
  font-size: .85rem;
  opacity: .95;
  width: 100%;
}
.toast-dispatch-sub {
  opacity: .85;
  margin-top: 3px;
}
.toast-dispatch-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.toast-dispatch-btn-open {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  padding: 4px 12px;
  border-radius: var(--radius-md);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.toast-dispatch-btn-open:hover { background: rgba(255,255,255,.3); text-decoration: none; }
.toast-dispatch-btn-close {
  background: none;
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.8);
  padding: 4px 12px;
  border-radius: var(--radius-md);
  font-size: .78rem;
  cursor: pointer;
}
.toast-dispatch-btn-close:hover { background: rgba(255,255,255,.1); }
.toast-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  font-size: .8rem;
  padding: 2px 4px;
  flex-shrink: 0;
}

/* ---- 26C. MAP LEGEND ICONS ---- */
.legend-icon-insiden {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #DC2626;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(220,38,38,.8);
  font-size: 8px;
  line-height: 1;
  flex-shrink: 0;
}
.legend-dot-unit {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.7);
  box-shadow: 0 0 3px rgba(0,0,0,.4);
  flex-shrink: 0;
}
.legend-dot-avl { background: #16A34A; }
.legend-dot-enr { background: #D97706; }
.legend-dot-station {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #EF4444;
  border-radius: 2px;
  border: 1.5px solid rgba(255,255,255,.6);
  opacity: .85;
  flex-shrink: 0;
}

/* ---- 26D. MAP EXTRAS ---- */
#map { width: 100%; height: calc(100vh - 310px); min-height: 480px; border-radius: var(--radius-lg); z-index: 1; }
.leaflet-popup-content-wrapper { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.leaflet-popup-tip              { background: var(--bg-card); }
.leaflet-popup-content          { margin: 12px 16px; font-family: 'Inter', sans-serif; font-size: .85rem; }
.popup-title    { font-weight: 700; margin-bottom: 4px; }
.popup-sub      { color: var(--text-muted); font-size: .75rem; margin-top: 2px; }
.popup-coords   { margin-top: 3px; opacity: .7; }
.popup-city     { margin-top: 5px; }
.map-side-panel { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0; background: var(--bg-secondary); border-left: 1px solid var(--border); }
.map-panel-body { overflow-y: auto; max-height: calc(100vh - 370px); min-height: 200px; }
.map-panel-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.map-panel-tab  { flex: 1; padding: 8px; font-size: .8rem; font-weight: 500; text-align: center; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.map-panel-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.map-panel-section        { display: none; }
.map-panel-section.active { display: block; }
.map-unit-group       { margin-bottom: 12px; }
.map-unit-group-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.map-kpi-bar    { display: flex; gap: 10px; margin-bottom: 12px; }
.map-kpi-item   { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
.map-kpi-label  { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.map-kpi-value  { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.map-kpi-sub    { font-size: .65rem; color: var(--text-muted); }
.legend-dot-ons { background: var(--status-ons); width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.icon-box-sm    { width: 28px; height: 28px; font-size: .7rem; }
.sidebar-avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.clickable      { cursor: pointer; }
.notif-item     { padding: 16px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }

/* ---- 26E. CHARTS ---- */
.chart-bar     { display: flex; align-items: stretch; gap: 6px; }
.chart-fill    { flex: 1; min-height: 200px; }
.chart-scroll  { overflow-x: auto; overflow-y: visible; padding-bottom: 4px; }
.chart-scroll .chart-bar { min-width: max-content; }
.chart-scroll .chart-bar-col { min-width: 40px; flex: 0 0 40px; }
.chart-bar-compact.chart-bar { gap: 2px; padding: 8px 4px 4px; }
.chart-bar-compact .chart-bar-col { flex: 1; min-width: 0; cursor: default; }
.chart-bar-compact .chart-bar-fill { border-radius: 2px 2px 0 0; }
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.chart-bar-val { font-size: .65rem; color: var(--text-muted); flex-shrink: 0; }
.chart-bar-spacer { flex-shrink: 1; flex-grow: 0; }
.chart-bar-fill { width: 100%; border-radius: 4px 4px 0 0; min-height: 4px; }
.chart-bar-lbl { font-size: .65rem; color: var(--text-muted); white-space: nowrap; padding-top: 2px; flex-shrink: 0; }
.chart-donut   { flex: 1; min-height: 200px; display: flex; align-items: center; justify-content: center; }
.chart-donut svg { width: min(100%, 260px); height: min(100%, 260px); }
.min-h-0       { min-height: 0; }

/* ---- 27. SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- 28. RESPONSIVE ---- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--transition-slow), width var(--transition-slow); }
  .sidebar.mobile-open { transform: translateX(0); }
  .app-content { margin-left: 0 !important; }
  .app-header { left: 0 !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .app-main { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .modal { max-height: 95vh; }
  .login-card { padding: 28px 20px; }
}
