/* =========================================================
   NAAM ERS — Emergency Response System
   Brand Design System v3.0
   NAAM Blue #1452A3 · NAAM Green #4DB52E · Emergency Red #DC2626
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─────────────────────────────────────────────────────────
   CSS VARIABLES — NAAM Brand System
───────────────────────────────────────────────────────── */
:root {
  /* ── NAAM Brand ── */
  --nb:          #1452A3;   /* NAAM Royal Blue */
  --nb-dk:       #0E3C82;   /* NAAM Blue Dark */
  --nb-lt:       #1A68CC;   /* NAAM Blue Light */
  --nb-xl:       #EBF3FF;   /* NAAM Blue XLight bg */
  --ng:          #4DB52E;   /* NAAM Emerald Green */
  --ng-dk:       #3A8F20;   /* NAAM Green Dark */
  --ng-lt:       #E8F9DF;   /* NAAM Green Light bg */
  --ng-xl:       #F2FCF0;   /* NAAM Green XLight bg */

  /* ── Emergency Palette ── */
  --er:          #DC2626;   /* Emergency Red */
  --er-dk:       #B91C1C;
  --er-lt:       #FEF2F2;
  --ea:          #D97706;   /* Amber / Warning */
  --ea-lt:       #FFFBEB;
  --ep:          #7C3AED;   /* Purple */
  --ep-lt:       #F5F3FF;

  /* Semantic aliases → Bootstrap-compatible names */
  --brand-primary:     var(--nb);
  --brand-primary-dk:  var(--nb-dk);
  --brand-teal:        #0891B2;
  --brand-teal-lt:     #E0F2FE;
  --brand-danger:      var(--er);
  --brand-danger-lt:   var(--er-lt);
  --brand-success:     var(--ng);
  --brand-success-lt:  var(--ng-lt);
  --brand-warning:     var(--ea);
  --brand-warning-lt:  var(--ea-lt);
  --brand-purple:      var(--ep);
  --brand-purple-lt:   var(--ep-lt);

  /* ── Sidebar ── */
  --sb-bg:         #071220;   /* Deep NAAM Navy */
  --sb-bg2:        #0C1C35;
  --sb-border:     rgba(255,255,255,0.07);
  --sb-text:       #7A9DC0;
  --sb-text-hover: #D8E8F5;
  --sb-active-bg:  rgba(77,181,46,0.13);  /* NAAM Green glow */
  --sb-active:     #54C426;               /* Bright NAAM Green */
  --sb-w:          252px;
  --sb-w-sm:       64px;

  /* Sidebar legacy aliases */
  --sidebar-bg:        var(--sb-bg);
  --sidebar-text:      var(--sb-text);
  --sidebar-text-hover:var(--sb-text-hover);
  --sidebar-active-bg: var(--sb-active-bg);
  --sidebar-active:    var(--sb-active);
  --sidebar-width:     var(--sb-w);
  --sidebar-width-sm:  var(--sb-w-sm);
  --sidebar-border:    var(--sb-border);

  /* ── Surfaces ── */
  --surface:       #FFFFFF;
  --surface-2:     #F7FAFC;
  --surface-3:     #EFF4FA;
  --border:        #E2EBF3;
  --border-strong: #C9D8E8;

  /* ── Text ── */
  --text-primary:   #0F1E32;
  --text-secondary: #3D5269;
  --text-muted:     #7A93AB;

  /* ── Layout ── */
  --topbar-height: 64px;
  --content-max:   1440px;
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     22px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px rgba(10,30,60,0.05);
  --shadow-sm: 0 1px 4px rgba(10,30,60,0.07), 0 1px 2px rgba(10,30,60,0.04);
  --shadow:    0 4px 8px -2px rgba(10,30,60,0.08), 0 2px 4px -2px rgba(10,30,60,0.04);
  --shadow-md: 0 10px 20px -4px rgba(10,30,60,0.10), 0 4px 8px -4px rgba(10,30,60,0.05);
  --shadow-lg: 0 20px 40px -8px rgba(10,30,60,0.12), 0 8px 16px -8px rgba(10,30,60,0.06);
  --shadow-xl: 0 32px 64px -12px rgba(10,30,60,0.18);

  /* Legacy shadow aliases */
  --naam-shadow-soft: var(--shadow-sm);
  --naam-border:      var(--border);
  --naam-primary:     var(--nb);
  --naam-text:        var(--text-primary);

  /* ── Transitions ── */
  --tr:      all 0.18s cubic-bezier(0.4,0,0.2,1);
  --tr-slow: all 0.32s cubic-bezier(0.4,0,0.2,1);
  --transition: var(--tr);
}

/* ─────────────────────────────────────────────────────────
   BASE RESET
───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 1rem; }

a { color: var(--nb); text-decoration: none; }
a:hover { color: var(--nb-dk); }
img { max-width: 100%; }

/* ─────────────────────────────────────────────────────────
   APP SHELL
───────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sb-w);
  background: linear-gradient(180deg, var(--sb-bg) 0%, var(--sb-bg2) 100%);
  display: flex;
  flex-direction: column;
  position: fixed !important;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  transition: width 0.24s cubic-bezier(0.4,0,0.2,1),
              transform 0.24s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden !important;
  padding: 0 !important;
  gap: 0 !important;
  justify-content: flex-start !important;
  border-right: 1px solid var(--sb-border);
}

/* Accent bar at top of sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ng) 0%, var(--nb-lt) 100%);
  z-index: 1;
}

/* ── Sidebar Logo ── */
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 18px;
  border-bottom: 1px solid var(--sb-border);
  min-height: var(--topbar-height);
  height: var(--topbar-height);
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
}

.sidebar-logo-text {
  display: flex;
  align-items: center;
  min-width: 0;
  transition: opacity 0.18s;
}
.sidebar-logo-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.08em;
  line-height: 1.02;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-logo-name span {
  display: block;
}

/* ── Sidebar Navigation ── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.sidebar-section-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sb-text);
  padding: 16px 18px 5px;
  opacity: 0.45;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.18s;
}
.sidebar-section-label::before {
  content: '';
  width: 10px; height: 1px;
  background: currentColor;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 14px;
  margin: 1px 8px;
  border-radius: 8px;
  color: var(--sb-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  border-left: 2px solid transparent;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
  position: relative;
  letter-spacing: 0.005em;
}
.nav-item svg {
  width: 17px !important; height: 17px !important;
  min-width: 17px; min-height: 17px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.15s;
  display: block;
}
.nav-label { flex: 1; }
.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--sb-text-hover);
}
.nav-item:hover svg { opacity: 0.9; }
.nav-item.active {
  background: var(--sb-active-bg);
  color: var(--sb-active);
  font-weight: 600;
  border-left-color: var(--sb-active);
}
.nav-item.active svg { opacity: 1; color: var(--sb-active); }

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: var(--tr);
  overflow: hidden;
}
.sidebar-user:hover { background: rgba(255,255,255,0.04); }
.sidebar-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--nb-lt), var(--ng));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.sidebar-user-info { overflow: hidden; flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sb-text-hover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 11px; color: var(--sb-text); white-space: nowrap; }
.sidebar-logout {
  width: 28px; height: 28px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sb-text);
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: var(--tr);
  text-decoration: none;
}
.sidebar-logout:hover { background: rgba(220,38,38,0.15); color: #fca5a5; }
.sidebar-logout svg { width: 15px; height: 15px; }

/* ── Sidebar Emergency Quick-Dial ── */
.sidebar-emergency-call {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  margin-bottom: 6px;
  background: rgba(77,181,46,0.10);
  border: 1px solid rgba(77,181,46,0.22);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background .2s, border-color .2s;
  overflow: hidden;
}
.sidebar-emergency-call:hover {
  background: rgba(77,181,46,0.18);
  border-color: rgba(77,181,46,0.40);
}
.sidebar-emergency-call > svg {
  width: 15px; height: 15px;
  color: #4DB52E;
  flex-shrink: 0;
}
.sidebar-emergency-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.sidebar-emergency-num {
  font-size: 12.5px;
  font-weight: 800;
  color: #4DB52E;
  letter-spacing: 0.3px;
  line-height: 1.2;
  white-space: nowrap;
}
.sidebar-emergency-tag {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}

/* ── Sidebar Collapsed ── */
.sidebar.collapsed { width: var(--sb-w-sm); }
.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sb-w-sm);
  width: calc(100% - var(--sb-w-sm));
}
.sidebar.collapsed ~ .main-wrapper .topbar {
  left: var(--sb-w-sm);
  width: calc(100% - var(--sb-w-sm));
}
.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 0 8px;
  text-align: center;
}
.sidebar.collapsed .sidebar-logo-text {
  display: flex;
  justify-content: center;
}
.sidebar.collapsed .sidebar-logo-name {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  gap: 1px;
}
.sidebar.collapsed .sidebar-section-label { display: none; }
.sidebar.collapsed .sidebar-section-label::before { display: none; }
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  margin: 1px 6px;
  width: calc(var(--sb-w-sm) - 12px);
  gap: 0;
  border-left-width: 0;
  border-radius: 8px;
}
.sidebar.collapsed .nav-item.active { border-left: none; }
.sidebar.collapsed .nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 5px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--sb-active);
}
.sidebar.collapsed .nav-item span.nav-label { display: none; }
.sidebar.collapsed .nav-item svg {
  width: 20px !important; height: 20px !important;
  min-width: 20px; min-height: 20px;
  opacity: 0.8;
}
.sidebar.collapsed .nav-item.active svg { opacity: 1; }
.sidebar.collapsed .sidebar-nav { padding-left: 0; padding-right: 0; }
.sidebar.collapsed .sidebar-footer { padding: 8px 4px; }
.sidebar.collapsed .sidebar-emergency-call { justify-content: center; padding: 8px 4px; margin-bottom: 4px; }
.sidebar.collapsed .sidebar-emergency-text { display: none; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 8px 4px; gap: 0; }
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar.collapsed .sidebar-logout { display: none; }

/* ─────────────────────────────────────────────────────────
   MAIN WRAPPER
───────────────────────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  margin-left: var(--sb-w);
  width: calc(100% - var(--sb-w));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--topbar-height);
  transition: margin-left 0.24s cubic-bezier(0.4,0,0.2,1),
              width 0.24s cubic-bezier(0.4,0,0.2,1);
  min-width: 0;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────
   TOPBAR
───────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 14px;
  position: fixed;
  top: 0;
  left: var(--sb-w);
  right: 0;
  width: calc(100% - var(--sb-w));
  z-index: 1030;
  box-shadow: 0 1px 0 var(--border), 0 4px 20px rgba(10,30,60,0.06);
  gap: 0;
  overflow: visible;          /* must be visible so dropdowns clear the bar */
  flex-shrink: 0;
  transition: left 0.24s cubic-bezier(0.4,0,0.2,1),
              width 0.24s cubic-bezier(0.4,0,0.2,1);
}

/* NAAM blue-to-green accent bar at top */
.topbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--nb) 0%, #2570D4 40%, var(--ng) 75%, #3DA626 100%);
  pointer-events: none;
}

/* ── Topbar Left ── */
.topbar-left { display: flex; align-items: center; gap: 10px; overflow: hidden; }

.topbar-toggle {
  width: 38px; height: 38px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--tr);
  flex-shrink: 0;
}
.topbar-toggle:hover { background: var(--surface-3); color: var(--nb); }
.topbar-toggle svg { width: 20px; height: 20px; }

/* Topbar home logo */
.topbar-home-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-home-logo img {
  width: 88px;
  max-width: 100%;
  max-height: 44px;
  height: auto;
  object-fit: contain;
}

.brand-logo {
  width: 88px;
  max-width: 100%;
  max-height: 44px;
  height: auto;
  object-fit: contain;
}

/* Vertical divider between logo area and branding */
.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

/* Page title block */
.topbar-branding { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.page-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.topbar-breadcrumb .page-name { color: var(--text-primary); font-weight: 600; }

/* ── Topbar Right ── */
.topbar-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

/* Emergency quick-dial pill (xl+ only) */
.topbar-emergency {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px 0 11px;
  background: rgba(77,181,46,0.07);
  border: 1.5px solid rgba(77,181,46,0.28);
  border-radius: 20px;
  text-decoration: none;
  transition: background .18s, border-color .18s;
  flex-shrink: 0;
}
.topbar-emergency:hover {
  background: rgba(77,181,46,0.14);
  border-color: rgba(77,181,46,0.48);
}
.topbar-emergency > svg { color: #4DB52E; flex-shrink: 0; }
.topbar-emergency-label { display: flex; flex-direction: column; line-height: 1.1; }
.topbar-emergency-num  { font-size: 12.5px; font-weight: 800; color: #3A9922; letter-spacing: 0.3px; }
.topbar-emergency-tag  { font-size: 9.5px;  font-weight: 600; color: rgba(58,153,34,0.7); letter-spacing: 0.2px; }

/* Role badge */
.topbar-badge {
  height: 32px;
  padding: 0 12px;
  border-radius: 20px;
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar-badge.emergency {
  border-color: rgba(220,38,38,0.22);
  background: #fff5f5;
  color: var(--er);
}
.topbar-badge.emergency::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--er);
  animation: pulse-dot 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

/* Notification bell */
.topbar-notif { position: relative; }
.topbar-notif-btn {
  width: 36px; height: 36px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--tr);
  text-decoration: none;
  position: relative;
  flex-shrink: 0;
}
.topbar-notif-btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--nb); }
.topbar-notif-btn svg { width: 17px; height: 17px; }
.notif-dot {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px; height: 17px;
  background: var(--er);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  line-height: 1;
}

/* Fallback bare logout button (unauthenticated edge case) */
.topbar-btn {
  width: 36px; height: 36px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--tr);
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-btn:hover { background: #fff5f5; border-color: rgba(220,38,38,0.3); color: var(--er); }
.topbar-btn svg { width: 17px; height: 17px; }

/* ── User avatar + dropdown ── */
.topbar-user-wrap { position: relative; flex-shrink: 0; }
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 4px 0 2px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--tr);
}
.topbar-user-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.topbar-user-avatar {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--nb-lt), var(--ng));
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.topbar-user-meta {
  flex-direction: column;
  gap: 0;
  padding-right: 2px;
}
.topbar-user-mobile {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
}
.topbar-user-rolelabel {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.topbar-user-caret { color: var(--text-muted); transition: transform .2s; }
.topbar-user-btn[aria-expanded="true"] .topbar-user-caret { transform: rotate(180deg); }

/* User dropdown menu */
.topbar-user-dropdown {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 230px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(10,30,60,0.14), 0 2px 8px rgba(10,30,60,0.06);
  z-index: 1200;
  overflow: hidden;
  animation: fade-in-up .18s ease;
}
.topbar-user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f0f5ff 0%, #f8fff4 100%);
}
.topbar-user-dropdown-av {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--nb-lt), var(--ng));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.topbar-udrop-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.topbar-udrop-role {
  font-size: 11px;
  color: var(--text-muted);
}
.topbar-udrop-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}
.topbar-udrop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.topbar-udrop-item:hover { background: var(--surface-2); }
.topbar-udrop-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.topbar-udrop-danger { color: var(--er); }
.topbar-udrop-danger:hover { background: #fff5f5; color: #b91c1c; }
.notif-panel {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 340px;
  max-height: 400px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1150;
}
.notif-panel-header {
  padding: 14px 16px 12px;
  font-weight: 700;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: var(--tr);
}
.notif-item:hover { background: var(--surface-2); }
.notif-item-title { font-weight: 600; font-size: 13px; color: var(--text-primary); margin-bottom: 2px; }
.notif-item-msg { font-size: 12px; color: var(--text-muted); }
.notif-empty { padding: 20px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ─────────────────────────────────────────────────────────
   PAGE CONTENT
───────────────────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px 28px 40px;
  width: 100%;
  max-width: none;
}

/* ─────────────────────────────────────────────────────────
   PAGE HEADER
───────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
}
.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 3px;
  display: block !important;
}
.page-header .btn, .page-header .d-flex { align-self: center; }

/* ─────────────────────────────────────────────────────────
   CARDS & PANELS
───────────────────────────────────────────────────────── */
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.table-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
}
.table-card .card-header {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 14px 20px !important;
}
.table-card .card-header strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.card-premium {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 10px 20px;
}

/* ─────────────────────────────────────────────────────────
   KPI / METRIC CARDS
───────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--tr);
}
.metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.metric-card.text-decoration-none { color: inherit; display: block; }
.metric-card.text-decoration-none:hover { color: inherit; }
.shortcut-card .badge { align-self: center; flex-shrink: 0; }
/* NAAM brand top accent bar */
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--nb), var(--ng));
  border-radius: 3px 3px 0 0;
}
.metric-card.danger-card::before  { background: linear-gradient(90deg, var(--er), #f97316); }
.metric-card.success-card::before { background: linear-gradient(90deg, var(--ng), #34d399); }
.metric-card.warning-card::before { background: linear-gradient(90deg, var(--ea), #fbbf24); }
.metric-card.purple-card::before  { background: linear-gradient(90deg, var(--ep), #a78bfa); }
.metric-card.blue-card::before    { background: linear-gradient(90deg, var(--nb), var(--nb-lt)); }

.metric-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.metric-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}
.metric-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: block !important;
}
.metric-icon {
  position: absolute;
  top: 18px; right: 18px;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.metric-icon svg { width: 20px; height: 20px; }

/* Dark metric card */
.metric-card.dark-card {
  background: var(--sb-bg);
  border-color: transparent;
}
.metric-card.dark-card .metric-title,
.metric-card.dark-card .metric-meta { color: var(--sb-text); }
.metric-card.dark-card .metric-value { color: #fff; }

/* ─────────────────────────────────────────────────────────
   SHORTCUT CARDS
───────────────────────────────────────────────────────── */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.shortcut-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  transition: var(--tr);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--text-primary);
}
.shortcut-card:hover {
  border-color: var(--nb);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--nb);
}
.shortcut-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--nb-xl);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--tr);
}
.shortcut-card-icon svg { width: 22px; height: 22px; color: var(--nb); }
.shortcut-card:hover .shortcut-card-icon { background: var(--nb); }
.shortcut-card:hover .shortcut-card-icon svg { color: #fff; }
.shortcut-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.shortcut-card-meta { font-size: 12px; color: var(--text-muted); transition: var(--tr); }
.shortcut-card:hover .shortcut-card-meta { color: rgba(20,82,163,0.7); }
.shortcut-arrow { font-size: 1.1rem; color: var(--text-muted); transition: var(--tr); flex-shrink: 0; }
.shortcut-card:hover .shortcut-arrow { color: var(--nb); transform: translateX(3px); }
.flex-1 { flex: 1; min-width: 0; }

/* ─────────────────────────────────────────────────────────
   TABLES
───────────────────────────────────────────────────────── */
.table {
  font-size: 13.5px;
  margin: 0;
  --bs-table-bg: transparent;
}
.table thead th {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border) !important;
  background: var(--surface-2);
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border) !important;
  vertical-align: middle;
  color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none !important; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .fw-semibold { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 13.5px; }
.table .small.text-muted { font-size: 12px; color: var(--text-muted) !important; }

/* ─────────────────────────────────────────────────────────
   STATUS BADGES — semantic + live animations
───────────────────────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Live status pulse */
.status-en-route-to-pickup::before,
.status-arrived-pickup::before,
.status-patient-onboard::before,
.status-en-route-to-hospital::before,
.status-assigned::before,
.status-driver-accepted::before { animation: live-pulse 2s ease-in-out infinite; }

@keyframes live-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.7); }
}

.status-requested            { background: var(--nb-xl); color: #1344b0; }
.status-under-review         { background: var(--ea-lt); color: #92400e; }
.status-assigned             { background: #edfbf5; color: #065f46; }
.status-driver-accepted      { background: var(--ng-xl); color: var(--ng-dk); }
.status-en-route-to-pickup   { background: var(--ep-lt); color: #5b21b6; }
.status-arrived-pickup       { background: #e0f2fe; color: #0369a1; }
.status-patient-onboard      { background: #fff7ed; color: #c2410c; }
.status-en-route-to-hospital { background: #fef3c7; color: #92400e; }
.status-diverted             { background: #fefce8; color: #854d0e; }
.status-completed            { background: var(--ng-lt); color: var(--ng-dk); }
.status-cancelled            { background: var(--er-lt); color: #b91c1c; }
.status-rejected             { background: var(--surface-3); color: #475569; }
.status-pending              { background: var(--ea-lt); color: #92400e; }
.status-accepted             { background: var(--ng-lt); color: var(--ng-dk); }
.status-pending-verification { background: var(--ea-lt); color: #92400e; }
.status-approved             { background: var(--ng-lt); color: var(--ng-dk); }
.status-reverification-required { background: var(--er-lt); color: #b91c1c; }
.status-suspended            { background: var(--surface-3); color: #374151; }
.status-online               { background: var(--ng-lt); color: var(--ng-dk); }
.status-offline              { background: var(--surface-3); color: #6b7280; }
.status-no-response          { background: var(--surface-3); color: #6b7280; }

/* Bootstrap badge overrides */
.badge { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 20px; }
.text-bg-warning   { background-color: var(--ea-lt) !important; color: #92400e !important; border: 1px solid #fde68a; }
.text-bg-success   { background-color: var(--ng-lt) !important; color: var(--ng-dk) !important; border: 1px solid #bbf7d0; }
.text-bg-secondary { background-color: var(--surface-3) !important; color: #475569 !important; border: 1px solid var(--border); }
.text-bg-danger    { background-color: var(--er-lt) !important; color: #b91c1c !important; border: 1px solid #fecaca; }
.text-bg-primary   { background-color: var(--nb-xl) !important; color: var(--nb) !important; border: 1px solid #bfdbfe; }

/* ─────────────────────────────────────────────────────────
   FORMS
───────────────────────────────────────────────────────── */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control, .form-select {
  font-size: 14px;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: var(--surface);
  transition: var(--tr);
  box-shadow: none;
  min-height: auto;
}
.form-control:focus, .form-select:focus {
  border-color: var(--nb);
  box-shadow: 0 0 0 3px rgba(20,82,163,0.10);
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control-lg { font-size: 15px; padding: 12px 15px; border-radius: var(--radius); }
.form-check-input {
  border: 1.5px solid var(--border-strong);
  width: 16px; height: 16px;
  border-radius: 4px;
}
.form-check-input:checked {
  background-color: var(--nb);
  border-color: var(--nb);
}
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(20,82,163,0.12); }
.form-check-label { font-size: 13.5px; color: var(--text-secondary); }

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.form-section.clean { border: none; background: transparent; padding: 0; margin-bottom: 0; }

.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title svg { width: 16px; height: 16px; color: var(--nb); flex-shrink: 0; }

.section-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--nb-xl);
  color: var(--nb);
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.required-dot { color: var(--er); }
.input-prefix {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 9px 13px;
  font-size: 14px;
  color: var(--text-muted);
}
.input-prefix + .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.upload-tile {
  background: var(--surface-2);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--tr);
}
.upload-tile:hover { border-color: var(--nb); background: var(--nb-xl); }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.checkbox-grid .form-check {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--tr);
  margin: 0;
}
.checkbox-grid .form-check:hover { border-color: var(--nb); background: var(--nb-xl); }
.checkbox-grid .form-check-input { margin: 0; }

/* ─────────────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────────────── */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  transition: var(--tr);
  border: 1.5px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  min-height: auto;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:focus { box-shadow: none; outline: none; }

.btn-primary {
  background: var(--nb);
  border-color: var(--nb);
  color: #fff;
}
.btn-primary:hover { background: var(--nb-dk); border-color: var(--nb-dk); color: #fff; }

.btn-success {
  background: var(--ng);
  border-color: var(--ng);
  color: #fff;
}
.btn-success:hover { background: var(--ng-dk); border-color: var(--ng-dk); color: #fff; }

.btn-danger {
  background: var(--er);
  border-color: var(--er);
  color: #fff;
}
.btn-danger:hover { background: var(--er-dk); border-color: var(--er-dk); color: #fff; }

.btn-warning {
  background: var(--ea);
  border-color: var(--ea);
  color: #fff;
}
.btn-warning:hover { background: #b45309; border-color: #b45309; color: #fff; }

.btn-secondary {
  background: var(--surface-3);
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }

.btn-outline-primary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline-primary:hover {
  background: var(--nb-xl);
  border-color: var(--nb);
  color: var(--nb);
}
.btn-outline-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline-secondary:hover { background: var(--surface-2); color: var(--text-primary); }
.btn-outline-danger {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline-danger:hover { background: var(--er-lt); border-color: var(--er); color: var(--er); }
.btn-outline-success {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline-success:hover { background: var(--ng-lt); border-color: var(--ng); color: var(--ng-dk); }

.btn-lg  { font-size: 15px; padding: 12px 24px; border-radius: var(--radius); }
.btn-sm  { font-size: 12px; padding: 5px 12px; border-radius: 5px; }
.btn-xs  { font-size: 11.5px; padding: .3rem .65rem; min-height: 28px; border-radius: 8px; }
.btn-icon{ width: 36px; min-width: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* Online action buttons */
.btn-online-action  { background: var(--ng); border-color: var(--ng); color: #fff; }
.btn-online-action:hover { background: var(--ng-dk); border-color: var(--ng-dk); color: #fff; }
.btn-offline-action { background: var(--surface); border-color: var(--border-strong); color: var(--text-secondary); }
.btn-offline-action:hover { background: var(--er-lt); border-color: var(--er); color: var(--er); }

/* ─────────────────────────────────────────────────────────
   ALERTS
───────────────────────────────────────────────────────── */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  border: 1.5px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: var(--ng-lt); border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: var(--er-lt); border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--ea-lt); border-color: #fde68a; color: #92400e; }
.alert-light   { background: var(--surface-2); border-color: var(--border); color: var(--text-secondary); }
.alert-info    { background: var(--nb-xl); border-color: #bfdbfe; color: var(--nb-dk); }

/* ─────────────────────────────────────────────────────────
   TIMELINE
───────────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 0;
  width: 1.5px;
  background: var(--border);
}
.timeline-item { position: relative; padding: 0 0 16px 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -8px; top: 5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--nb);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--nb);
}
.timeline-item h6 { font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.timeline-item small { font-size: 12px; color: var(--text-muted); }

/* ─────────────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  gap: 10px;
}
.empty-state-icon {
  width: 48px; height: 48px;
  background: var(--surface-3);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.empty-state-icon svg { width: 24px; height: 24px; color: var(--text-muted); }

/* ─────────────────────────────────────────────────────────
   MAP
───────────────────────────────────────────────────────── */
.map-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 420px;
  height: 52vh;
  max-height: 680px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
}
.map-wrap > :not(span):not(p) { width: 100% !important; height: 100% !important; min-height: 420px; }

/* Status tile */
.status-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: center;
}
.status-tile .small.text-muted { font-size: 11.5px; margin-bottom: 4px; color: var(--text-muted) !important; }
.status-tile .fw-bold { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; }

/* ─────────────────────────────────────────────────────────
   AUTH PAGES — NAAM Branded
───────────────────────────────────────────────────────── */
.auth-page-wrap {
  min-height: 100vh;
  background: linear-gradient(150deg, #091A33 0%, #0D2348 45%, #091A33 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}
/* NAAM Blue radial glows */
.auth-page-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 55% at 75% 35%, rgba(20,82,163,0.22), transparent),
    radial-gradient(ellipse 45% 45% at 20% 75%, rgba(77,181,46,0.10), transparent);
  pointer-events: none;
}
/* Bottom NAAM green accent bar */
.auth-page-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--nb) 0%, var(--ng) 50%, var(--nb-lt) 100%);
}

.auth-wrap {
  display: grid;
  grid-template-columns: 1fr 410px;
  width: 100%;
  max-width: 1020px;
  min-height: 580px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 64px -12px rgba(0,0,0,0.55);
  position: relative;
  z-index: 1;
}
.auth-brand {
  background: linear-gradient(160deg, #143A75 0%, #091A33 100%);
  padding: 32px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
/* Green accent blob */
.auth-brand::before {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(77,181,46,0.12), transparent 70%);
  pointer-events: none;
}
.auth-brand::after {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(20,82,163,0.2), transparent 70%);
  pointer-events: none;
}
/* Logo in brand panel — scoped to logo only, not the ambulance photo */
.auth-brand img:not(.auth-amb-img) {
  opacity: 0.95;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
/* Brand panel header row */
.auth-brand-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative; z-index: 1;
}
.auth-logo { width: 116px; max-width: 100%; height: auto; }
.auth-hospital-name {
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 5px;
}
.auth-headline {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  position: relative; z-index: 1;
}
.auth-tagline {
  color: #94a3b8;
  font-size: 12.5px;
  line-height: 1.65;
  margin: 0;
  position: relative; z-index: 1;
}

/* Ambulance image block */
.auth-amb-wrap {
  position: relative; z-index: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  flex-shrink: 0;
}
.auth-amb-img {
  width: 100%;
  height: 158px;
  object-fit: cover;
  object-position: center 58%;
  display: block;
}

/* Emergency call CTA */
.auth-emergency-cta {
  display: block;
  padding: 14px 18px;
  background: rgba(77,181,46,0.10);
  border: 1.5px solid rgba(77,181,46,0.28);
  border-radius: 14px;
  text-decoration: none;
  position: relative; z-index: 1;
  transition: background .2s, border-color .2s;
}
.auth-emergency-cta:hover {
  background: rgba(77,181,46,0.18);
  border-color: rgba(77,181,46,0.48);
}
.auth-emergency-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.52);
  margin-bottom: 5px;
}
.auth-emergency-number {
  font-size: 27px;
  font-weight: 900;
  color: #4DB52E;
  letter-spacing: 1.5px;
  line-height: 1;
}
.auth-emergency-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  margin-top: 5px;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(77,181,46,0.2);
  color: #86E05A;
  border: 1px solid rgba(77,181,46,0.3);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 4px;
  position: relative; z-index: 1;
}
.auth-brand h1 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0;
  position: relative; z-index: 1;
}

/* Hospital address card */
.brand-stack {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 12px;
  color: var(--sb-text);
  line-height: 1.65;
  position: relative; z-index: 1;
}
.brand-stack strong { color: #fff; }
.brand-stack-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 5px;
}
.brand-stack-links a {
  color: rgba(255,255,255,0.52);
  text-decoration: none;
  font-size: 11.5px;
  transition: color .15s;
}
.brand-stack-links a:hover { color: rgba(255,255,255,0.85); }
.brand-stack-legal {
  margin-top: 6px;
  font-size: 10.5px;
  opacity: 0.42;
  line-height: 1.5;
}

/* Mobile emergency strip — shown only on small screens */
.auth-mobile-strip { display: none; }

.auth-card {
  background: var(--surface);
  padding: 36px 32px;
  overflow-y: auto;
}
.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.login-brand-lockup img { width: 96px; max-width: 100%; height: auto; }
.login-brand-lockup h2 { font-size: 1.25rem; }

.auth-wrap-tight {
  max-width: 520px;
  grid-template-columns: 1fr !important;
  min-height: auto;
}
.auth-wrap-tight .auth-brand { display: none !important; }
.auth-wrap-tight .auth-card {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.45);
  padding: 40px;
}

.otp-input {
  letter-spacing: 0.2em;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────
   DRIVER REGISTRATION
───────────────────────────────────────────────────────── */
.driver-register-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}
.register-side {
  background: linear-gradient(160deg, #102B55 0%, var(--sb-bg) 100%);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  color: var(--sb-text);
  border: 1px solid rgba(255,255,255,0.06);
}
.register-side img { width: 108px; max-width: 100%; height: auto; margin-bottom: 14px; opacity: 0.95; }
.register-side h3 { color: #fff; font-size: 1.05rem; }
.mini { font-size: 12.5px; line-height: 1.6; }
.border-light { border-color: rgba(255,255,255,0.1) !important; }
.register-side .brand-chip { font-size: 10px; margin-bottom: 12px; }
.driver-register-shell .form-section { margin-bottom: 16px; }

/* Driver public page */
.auth-page-wrap > * { position: relative; z-index: 1; }
.driver-register-shell,
.driver-register-shell form,
.driver-register-shell input,
.driver-register-shell select,
.driver-register-shell textarea,
.driver-register-shell button { position: relative; z-index: 2; }

.auth-page-wrap:has(.driver-public-page) {
  align-items: flex-start;
  justify-content: center;
  padding: 28px 20px 36px;
  overflow-y: auto;
}
.driver-public-page {
  width: min(1160px, 100%);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.driver-public-page .page-header-public {
  width: 100%;
  margin: 0 0 18px;
  align-items: center;
}
.driver-public-page .page-header-public h1  { color: #fff; }
.driver-public-page .page-header-public .page-subtitle { color: rgba(255,255,255,0.72); }
.driver-public-page .page-header-public .btn {
  border-color: rgba(255,255,255,0.18);
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.driver-public-page .page-header-public .btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
}
.driver-public-page .driver-register-shell {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px; width: 100%;
}
.driver-public-page .driver-register-shell form { min-width: 0; }
.driver-public-page .register-side {
  padding: 24px 22px;
  box-shadow: 0 18px 42px rgba(2,8,23,0.28);
}
.driver-public-page .register-side img { width: 118px; max-width: 100%; height: auto; margin-bottom: 16px; }
.driver-public-page .form-section {
  padding: 20px 22px;
  margin-bottom: 18px;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(15,23,42,0.10);
}
.driver-public-page .section-chip {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--nb); background: var(--nb-xl);
  border-radius: 999px; padding: 4px 10px; margin-bottom: 8px;
}
.driver-public-page .checkbox-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.driver-public-page .checkbox-grid .form-check {
  margin: 0; padding: 10px 12px;
  border-radius: 12px; background: #fbfdff;
  display: flex; align-items: center; min-height: 46px;
}
.driver-public-page .upload-tile {
  border-radius: 14px; padding: 14px; background: #fbfdff; height: 100%;
}
.driver-public-page .public-footer-note {
  margin-top: 18px; padding-top: 14px;
  display: flex; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.68); font-size: 12px;
}

/* ─────────────────────────────────────────────────────────
   SEARCH INLINE
───────────────────────────────────────────────────────── */
.search-inline { position: relative; }
.search-inline .form-control { padding-left: 38px; min-width: 220px; }
.search-inline::before {
  content: '';
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237A93AB' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────
   UTILITIES
───────────────────────────────────────────────────────── */
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.fw-semibold    { font-weight: 600 !important; }
.small          { font-size: 12.5px !important; }
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.15em; }
.quick-tag      { padding: .25rem .6rem; border-radius: 999px; background: var(--surface-3); color: #40516a; font-size: .8rem; font-weight: 600; }
.list-tight     { list-style: none; padding: 0; margin: 0; }
.list-tight li  { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--text-secondary); }
.list-tight li:last-child { border-bottom: none; }
.info-grid      { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.print-sheet    { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.footer-note    { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1.35rem; color: var(--text-muted); }

/* Active trip highlight */
.active-trip-card { border-left: 3px solid var(--nb); }
.table-active td  { background: var(--surface-2) !important; }
.table-active td:first-child { border-left: 3px solid var(--nb); }

/* ─────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
───────────────────────────────────────────────────────── */
.toast-container-custom {
  position: fixed;
  top: calc(var(--topbar-height) + 16px);
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.app-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--sb-bg);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  min-width: 280px;
  max-width: 360px;
  animation: toast-in 0.25s cubic-bezier(0.4,0,0.2,1) forwards;
  pointer-events: all;
  border-left: 3px solid var(--nb);
}
.app-toast.toast-success { border-left-color: var(--ng); }
.app-toast.toast-danger  { border-left-color: var(--er); }
.app-toast.toast-warning { border-left-color: var(--ea); }
.app-toast.toast-out { animation: toast-out 0.22s ease forwards; }
.app-toast svg { width: 16px; height: 16px; flex-shrink: 0; }
@keyframes toast-in  { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(32px); } }

/* ─────────────────────────────────────────────────────────
   MOBILE OVERLAY
───────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7,18,32,0.6);
  backdrop-filter: blur(2px);
  z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* ─────────────────────────────────────────────────────────
   DRIVER DASHBOARD
───────────────────────────────────────────────────────── */
.driver-status-card {
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  border: 2px solid transparent;
  transition: var(--tr);
}
.driver-status-online  { background: var(--ng-lt); border-color: #a7f3c0; }
.driver-status-offline { background: var(--surface-3); border-color: var(--border); }
.driver-status-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.driver-status-online .driver-status-dot {
  background: var(--ng);
  box-shadow: 0 0 0 4px rgba(77,181,46,0.22);
  animation: pulse-dot 2s infinite;
}
.driver-status-offline .driver-status-dot { background: var(--text-muted); }
.driver-status-label { font-weight: 700; font-size: 1.05rem; }
.driver-status-online  .driver-status-label { color: var(--ng-dk); }
.driver-status-offline .driver-status-label { color: var(--text-secondary); }
.driver-status-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.driver-toggle-btn { min-width: 120px; font-weight: 700; border-radius: var(--radius); padding: 10px 22px; font-size: 14px; }

/* ─────────────────────────────────────────────────────────
   USER ACTION STRIP
───────────────────────────────────────────────────────── */
.user-action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────
   PAGINATION
───────────────────────────────────────────────────────── */
.pagination .page-link {
  border-radius: var(--radius-sm) !important;
  font-size: 12.5px;
  padding: 4px 10px;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.pagination .page-item.active .page-link {
  background: var(--nb);
  border-color: var(--nb);
  color: #fff;
}

/* ─────────────────────────────────────────────────────────
   DISPATCH CONSOLE
───────────────────────────────────────────────────────── */
.dispatch-console-grid {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.dispatch-left-stack, .dispatch-right-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dispatch-panels-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dispatch-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.compact-panel { padding: 18px 18px 16px; }
.dispatch-map  { min-height: 300px; }
.dispatch-scroll-panel { max-height: 280px; overflow: auto; padding-right: 4px; }
.small-table-scroll    { max-height: 220px; }
.dispatch-detail-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.queue-item {
  padding: .9rem .95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: var(--tr);
}
.queue-item + .queue-item { margin-top: .75rem; }
.queue-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.queue-item.critical { border-color: #fecaca; background: #fff8f8; }
.queue-item.high     { border-color: #fde68a; background: #fffdf2; }

/* ─────────────────────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────────────────────── */
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.7); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes naam-shimmer {
  from { background-position: -200% center; }
  to   { background-position:  200% center; }
}

/* Emergency live-data refresh flash */
.live-flash {
  animation: fade-in-up 0.3s ease forwards;
}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE — Mobile / Tablet
───────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sb-w) !important;
    top: 0 !important;
    height: 100vh !important;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.4);
  }
  .sidebar.collapsed { width: var(--sb-w) !important; }
  .main-wrapper { margin-left: 0 !important; width: 100% !important; }
  .topbar { left: 0 !important; width: 100% !important; }
  .page-content { padding: 20px 16px 32px; }
  .auth-wrap    { grid-template-columns: 1fr; min-height: auto; }
  .auth-brand   { display: none; }
  /* Mobile emergency strip — show in the card instead */
  .auth-mobile-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(77,181,46,0.09);
    border: 1.5px solid rgba(77,181,46,0.28);
    border-radius: 14px;
    padding: 13px 16px;
    margin-bottom: 20px;
    text-decoration: none;
    color: inherit;
    transition: background .2s;
  }
  .auth-mobile-strip:hover { background: rgba(77,181,46,0.15); }
  .auth-mobile-strip-icon {
    width: 38px; height: 38px;
    background: rgba(77,181,46,0.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #4DB52E;
    flex-shrink: 0;
  }
  .auth-mobile-strip-num {
    font-size: 16px;
    font-weight: 800;
    color: #4DB52E;
    line-height: 1.2;
    letter-spacing: 0.5px;
  }
  .auth-mobile-strip-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
  }
  .driver-register-shell { grid-template-columns: 1fr; }
  .register-side { display: none; }
  .shortcut-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid      { grid-template-columns: 1fr 1fr; }
  .dispatch-console-grid, .dispatch-panels-grid { grid-template-columns: 1fr; }
  .dispatch-summary-grid { grid-template-columns: 1fr 1fr; }
  .dispatch-scroll-panel, .small-table-scroll, .dispatch-detail-grid { max-height: none; grid-template-columns: 1fr; }
  .btn, .form-control, .form-select, .nav-item, .topbar-btn, .topbar-toggle, .topbar-notif-btn, .topbar-user-btn { min-height: 44px; }
  .topbar-user-avatar { width: 32px; height: 32px; border-radius: 8px; }
  .topbar-user-btn { border-radius: 10px; }
  .table-card, .metric-card { border-radius: var(--radius-lg); }
  body { background: #f2f6fb; }
}

/* Mobile open — restore full sidebar nav */
@media (max-width: 991.98px) {
  .sidebar.collapsed.mobile-open .sidebar-logo {
    justify-content: flex-start;
    padding: 0 18px;
    text-align: left;
  }
  .sidebar.collapsed.mobile-open .sidebar-logo-text { display: flex; }
  .sidebar.collapsed.mobile-open .sidebar-logo-name {
    font-size: 1rem;
    letter-spacing: 0.08em;
    gap: 2px;
  }
  .sidebar.collapsed.mobile-open .sidebar-section-label { display: flex; }
  .sidebar.collapsed.mobile-open .nav-item {
    justify-content: flex-start; padding: 9px 14px;
    margin: 1px 8px; width: calc(100% - 16px);
    gap: 10px; border-left-width: 2px;
  }
  .sidebar.collapsed.mobile-open .nav-item span.nav-label { display: inline; }
  .sidebar.collapsed.mobile-open .nav-item svg { width: 17px !important; height: 17px !important; }
  .sidebar.collapsed.mobile-open .nav-item.active::after { display: none; }
  .sidebar.collapsed.mobile-open .sidebar-emergency-call { justify-content: flex-start; padding: 9px 10px; margin-bottom: 6px; }
  .sidebar.collapsed.mobile-open .sidebar-emergency-text { display: flex; }
  .sidebar.collapsed.mobile-open .sidebar-user { justify-content: flex-start; padding: 8px 10px; gap: 10px; }
  .sidebar.collapsed.mobile-open .sidebar-user-info { display: block; }
  .sidebar.collapsed.mobile-open .sidebar-logout { display: flex; }
  .sidebar.collapsed.mobile-open .sidebar-footer { padding: 10px 8px; }
}

@media (max-width: 575.98px) {
  .kpi-grid       { grid-template-columns: 1fr 1fr; }
  .shortcut-grid  { grid-template-columns: 1fr; }
  .topbar         { padding: 0 12px 0 10px !important; gap: 0; }
  .topbar-breadcrumb { display: none; }
  .topbar-divider { display: none !important; }
  .topbar-home-logo img { width: 74px; max-height: 38px; height: auto; }
  .topbar-right   { gap: 5px; }
  .topbar-badge   { display: none !important; }
  .topbar-user-dropdown { right: -8px; width: 210px; }
  .page-header    { flex-direction: column; align-items: flex-start; }
  .auth-wrap-tight .auth-card { padding: 28px 24px; }
  .auth-card { padding: 24px 20px; }
  .auth-emergency-number { font-size: 22px; }
  .auth-amb-img { height: 120px; }
}

@media (max-width: 767.98px) {
  .dispatch-summary-grid { grid-template-columns: 1fr; }
  .compact-panel { padding: 16px 14px; }
}

@media (min-width: 992px) {
  .sidebar.collapsed ~ .main-wrapper {
    margin-left: var(--sb-w-sm);
    width: calc(100% - var(--sb-w-sm));
  }
}

/* Driver public page mobile */
@media (max-width: 991.98px) {
  .auth-page-wrap:has(.driver-public-page) { padding: 20px 14px 28px; }
  .driver-public-page .driver-register-shell { grid-template-columns: 1fr; }
  .driver-public-page .register-side { position: static; top: auto; }
  .driver-public-page .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .driver-public-page .form-section { padding: 16px; }
  .driver-public-page .checkbox-grid { grid-template-columns: 1fr; }
}

/* Large dispatch override */
@media (min-width: 1200px) {
  .dispatch-layout {
    display: grid !important;
    grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1fr) minmax(520px, 1.45fr);
    gap: 24px;
    align-items: start;
  }
  .dispatch-layout > [class*="col-"] { width: auto !important; max-width: none !important; padding: 0; }
}

/* ─────────────────────────────────────────────────────────
   PRINT
───────────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .page-header .btn, .d-print-none { display: none !important; }
  .main-wrapper { margin: 0 !important; }
  .print-sheet  { border: none; box-shadow: none; padding: 0; }
  body { font-size: 12px; }
}

/* ─────────────────────────────────────────────────────────
   TOPBAR BRANDING SUPPLEMENT
───────────────────────────────────────────────────────── */
/* notif panel scrollbar */
.notif-panel::-webkit-scrollbar { width: 4px; }
.notif-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* SIDEBAR nav icon color fix */
.nav-item.active svg,
.nav-item:hover svg { color: inherit; }
.sidebar-nav .nav-item svg {
  width: 17px !important; height: 17px !important;
  color: var(--sb-text);
  stroke-width: 1.8;
}
.sidebar-section-label::before { display: none; }
.sidebar-section-label {
  padding: 14px 16px 4px;
  display: block;
  opacity: 0.4;
}

/* ─────────────────────────────────────────────────────────
   MISC COMPONENT EXTRAS
───────────────────────────────────────────────────────── */
.split-hero { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.dark-card  { background: linear-gradient(180deg, var(--sb-bg) 0%, var(--sb-bg2) 100%); color: #fff; }
.dark-card .metric-title, .dark-card .metric-meta { color: var(--sb-text); }

/* =========================================================
   LIVE TRACKING — Full-Screen Map Layout
   (user/track.php + driver/live_trip.php)
   ========================================================= */

/* ── Full-screen wrapper (bleeds out of page-content padding) ── */
.tracking-fullscreen {
  position: relative;
  /* Negate the page-content padding to reach full edge */
  margin: -28px -28px -40px;
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
  background: #e8edf2;
}

/* ── Map canvas fills everything ── */
.track-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Map loading placeholder ── */
.track-map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  color: #64748b;
  font-size: 14px;
}
.track-map-spinner {
  width: 36px; height: 36px;
  border: 3px solid #e0e7ef;
  border-top-color: var(--nb);
  border-radius: 50%;
  animation: track-spin 0.8s linear infinite;
}
@keyframes track-spin {
  to { transform: rotate(360deg); }
}
.track-map-placeholder-text { color: #94a3b8; font-size: 13px; }

/* ── Top overlay bar (back button + booking chip) ── */
.track-topbar-overlay {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.track-topbar-overlay > * { pointer-events: auto; }

.track-back-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  color: #0f172a;
  transition: box-shadow 0.15s;
}
.track-back-btn:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.24); color: #0f172a; }
.track-back-btn svg { width: 18px; height: 18px; }

.track-booking-chip {
  flex: 1;
  background: #fff;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-cancel-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  cursor: pointer;
  color: #dc2626;
  flex-shrink: 0;
}
.track-cancel-btn svg { width: 18px; height: 18px; }

/* GPS device indicator (driver view) */
.track-gps-indicator {
  background: rgba(255,255,255,0.92);
  border-radius: 16px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  display: flex; align-items: center; gap: 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
  backdrop-filter: blur(8px);
}
.track-gps-indicator.gps-active { color: #16a34a; }
.track-gps-indicator.gps-active svg { stroke: #16a34a; }

/* ── Status dot ── */
.track-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.track-dot-pending  { background: #d97706; }
.track-dot-active   { background: #16a34a; animation: dot-pulse 1.6s ease-in-out infinite; }
.track-dot-arrived  { background: #7c3aed; animation: dot-pulse 1.6s ease-in-out infinite; }
.track-dot-done     { background: #16a34a; }
.track-dot-cancel   { background: #94a3b8; }
@keyframes dot-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* ── Slide-up bottom info panel ── */
.track-bottom-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.14);
  z-index: 150;
  max-height: 62vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 12px);
}
.track-bottom-panel::-webkit-scrollbar { width: 4px; }
.track-bottom-panel::-webkit-scrollbar-thumb { background: #e0e7ef; border-radius: 2px; }

/* Drag handle */
.track-panel-handle {
  width: 36px; height: 4px;
  background: #d1d9e3;
  border-radius: 2px;
  margin: 10px auto 12px;
  cursor: grab;
  flex-shrink: 0;
}

/* ── Status row ── */
.track-status-bar {
  display: flex;
  align-items: center;
  padding: 0 16px 14px;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 2px;
}
.track-status-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fef2f2;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.track-status-icon svg { width: 18px; height: 18px; stroke: #dc2626; }
.track-status-main { flex: 1; min-width: 0; }
.track-status-text {
  font-weight: 700;
  font-size: 14.5px;
  color: #0f172a;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-status-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}
.track-eta-chip {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.track-eta-chip.eta-ok {
  background: #f0fdf4;
  color: #16a34a;
}

/* ── Driver row ── */
.track-driver-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  border-bottom: 1px solid #f8fafc;
}
.track-driver-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nb) 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.track-driver-name { font-weight: 600; font-size: 14px; color: #0f172a; }
.track-driver-meta { font-size: 11.5px; color: #64748b; margin-top: 1px; }
.track-driver-call {
  margin-left: auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #f0fdf4;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.track-driver-call svg { width: 17px; height: 17px; stroke: #16a34a; }
.track-driver-call:hover { background: #dcfce7; }

/* ── Milestone progress strip ── */
.track-milestones {
  display: flex;
  padding: 12px 10px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid #f1f5f9;
  gap: 0;
}
.track-milestones::-webkit-scrollbar { display: none; }
.track-milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 54px;
  position: relative;
}
.track-milestone:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 9px;
  left: calc(50% + 10px);
  right: calc(-50% + 10px);
  height: 2px;
  background: #e2e8f0;
}
.track-milestone.done::after { background: #16a34a; }
.track-milestone-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px #e2e8f0;
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.track-milestone.done .track-milestone-dot {
  background: #16a34a;
  box-shadow: 0 0 0 2px #16a34a;
}
.track-milestone.active .track-milestone-dot {
  background: #dc2626;
  box-shadow: 0 0 0 2px #dc2626;
  animation: ms-pulse 1.6s ease-in-out infinite;
}
@keyframes ms-pulse {
  0%,100% { box-shadow: 0 0 0 2px #dc2626; }
  50%      { box-shadow: 0 0 0 5px rgba(220,38,38,0.28); }
}
.track-milestone-label {
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 4px;
  text-align: center;
  line-height: 1.2;
}
.track-milestone.done   .track-milestone-label { color: #16a34a; }
.track-milestone.active .track-milestone-label { color: #dc2626; font-weight: 600; }

/* ── Pickup / Drop address rows ── */
.track-addresses {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.track-addr-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.track-addr-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.track-addr-dot-pickup  { background: var(--nb); }
.track-addr-dot-drop    { background: #16a34a; }
.track-addr-line {
  width: 2px;
  height: 12px;
  background: #d1d9e3;
  margin-left: 4px;
}
.track-addr-text {
  font-size: 12px;
  color: #334155;
  line-height: 1.4;
  flex: 1;
}

/* ── Timeline toggle ── */
.track-timeline-toggle {
  display: flex;
  justify-content: center;
  padding: 8px 16px 4px;
}
.track-timeline-toggle button {
  background: none;
  border: none;
  color: var(--nb);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
}
.track-timeline-toggle button:hover { background: var(--nb-xl); }
.track-timeline-toggle button svg { transition: transform 0.2s ease; }
.track-timeline-inner { padding: 8px 16px 16px; }

/* ── Terminal bar (shown on trip end) ── */
.track-terminal-bar {
  padding: 12px 16px;
  font-size: 13px;
  border-radius: 10px;
  margin: 12px 16px 4px;
  text-align: center;
}
.track-terminal-bar a { font-weight: 600; }
.track-terminal-done   { background: #f0fdf4; color: #166534; }
.track-terminal-done a { color: #16a34a; }
.track-terminal-cancel { background: #f8fafc; color: #475569; }
.track-terminal-cancel a { color: var(--nb); }

/* =========================================================
   DRIVER NAVIGATION VIEW  (driver/live_trip.php)
   ========================================================= */

.driver-nav-fullscreen { /* Same full-bleed as user tracking */ }

.driver-nav-map {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 0;
}
.driver-nav-bottom-panel { max-height: 58vh; }

.driver-nav-waypoint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.driver-nav-waypoint-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #fef2f2;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.driver-nav-waypoint-icon.nav-wp-hospital { background: #f0fdf4; }
.driver-nav-waypoint-icon svg { width: 20px; height: 20px; stroke: #dc2626; }
.driver-nav-waypoint-icon.nav-wp-hospital svg { stroke: #16a34a; }
.driver-nav-waypoint-info h3 { font-size: 14px; font-weight: 700; margin: 0 0 3px; color: #0f172a; }
.driver-nav-waypoint-info p  { font-size: 12px; color: #64748b; margin: 0; line-height: 1.4; }

.driver-nav-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.driver-nav-actions .btn { flex: 1; font-size: 13.5px; font-weight: 600; padding: 10px; }

.driver-nav-patient-bar {
  padding: 10px 16px;
  font-size: 12px;
  color: #64748b;
  border-top: 1px solid #f1f5f9;
}

/* ── GPS source badge on driver marker ── */
.gps-device-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--nb);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  pointer-events: none;
  box-shadow: 0 1px 6px rgba(20,82,163,0.35);
}

/* ── Mobile adjustments ── */
@media (max-width: 767.98px) {
  .tracking-fullscreen,
  .driver-nav-fullscreen {
    margin: -20px -16px -32px;
  }
  .track-bottom-panel,
  .driver-nav-bottom-panel {
    border-radius: 18px 18px 0 0;
    max-height: 70vh;
  }
  .track-status-text { font-size: 13.5px; }
  .track-milestone-label { font-size: 9px; }
}

@media (max-width: 991.98px) {
  .tracking-fullscreen,
  .driver-nav-fullscreen {
    height: calc(100vh - var(--topbar-height));
  }
}

/* =========================================================
   DRIVER MANAGEMENT — dm-* (driver_management.php)
   ========================================================= */

.dm-table { font-size: 13.5px; }
.dm-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .045em;
  color: #64748b;
  background: #f8fafc;
  white-space: nowrap;
  padding: 11px 14px;
}
.dm-table td { padding: 13px 14px; vertical-align: middle; }
.dm-table tbody tr:hover { background: #f8fafd; }

.dm-sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dm-sort-link:hover { color: var(--nb); }
.dm-sort-link.active { color: var(--nb); font-weight: 700; }
.dm-sort-link svg { width: 12px; height: 12px; flex-shrink: 0; opacity: .6; }

.dm-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
}
.dm-rank-top {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
}

.dm-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nb) 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dm-amb-chip {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--nb-xl);
  color: var(--nb);
  border: 1px solid #bfdbfe;
  line-height: 1.5;
}

.dm-avail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  line-height: 1;
  white-space: nowrap;
}
.dm-avail::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dm-avail-online  { background: var(--ng-lt); color: var(--ng-dk); }
.dm-avail-online::before  { background: var(--ng); box-shadow: 0 0 0 2px rgba(77,181,46,.22); animation: pulse-dot 2s infinite; }
.dm-avail-offline { background: #f8fafc; color: #64748b; }
.dm-avail-offline::before { background: #94a3b8; }
.dm-avail-busy    { background: #fff7ed; color: #c2410c; }
.dm-avail-busy::before    { background: #ea580c; box-shadow: 0 0 0 2px rgba(234,88,12,.2); }

.dm-bar-wrap {
  width: 80px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.dm-bar { height: 100%; border-radius: 3px; transition: width .3s ease; }

.dm-rating { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; }
.dm-star { color: #f59e0b; font-size: 14px; line-height: 1; }

.dm-kpi-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.dm-kpi-card {
  flex: 1 1 120px;
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  min-width: 110px;
}
.dm-kpi-card .kpi-val { font-size: 1.7rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.dm-kpi-card .kpi-lbl { font-size: 11.5px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

.dm-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.dm-filter-bar .form-control,
.dm-filter-bar .form-select { min-height: 40px; font-size: 13px; border-radius: 10px; }
.dm-filter-bar .btn { min-height: 40px; border-radius: 10px; font-size: 13px; }

.dm-doc-warn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 2px 6px;
  margin-left: 4px;
}
.dm-doc-warn svg { width: 10px; height: 10px; stroke: #b45309; flex-shrink: 0; }

/* =========================================================
   DRIVER PROFILE — dp-* (driver_profile.php)
   ========================================================= */

.page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  text-decoration: none;
  padding: 6px 12px 6px 8px;
  border-radius: 10px;
  background: #f1f5f9;
  transition: background .15s;
}
.page-back-link:hover { background: #e2e8f0; color: #1e293b; }
.page-back-link svg { width: 15px; height: 15px; }

.dp-header-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}
.dp-header-left { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }

.dp-avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nb) 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
  box-shadow: 0 4px 16px rgba(20,82,163,.22);
}

.dp-header-info { flex: 1; min-width: 0; }
.dp-name { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); margin: 0 0 4px; line-height: 1.2; }
.dp-sub  { font-size: 13px; color: #64748b; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.dp-sub-sep { color: #cbd5e1; }

.dp-header-kpis { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.dp-kpi {
  flex: 1 1 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  min-width: 80px;
}
.dp-kpi-val   { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.dp-kpi-label { font-size: 10.5px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }

.dp-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  background: #fff;
  border-radius: 16px;
  padding: 6px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.dp-tabs a {
  flex: 1;
  min-width: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.dp-tabs a:hover { background: #f1f5f9; color: #334155; }
.dp-tabs a.active {
  background: var(--nb);
  color: #fff;
  box-shadow: 0 2px 10px rgba(20,82,163,.25);
}
.dp-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  background: rgba(255,255,255,.25);
  color: inherit;
  line-height: 1;
}
.dp-tabs a:not(.active) .dp-tab-badge { background: #e2e8f0; color: #475569; }
.dp-tabs a.active .dp-tab-badge { background: rgba(255,255,255,.28); color: #fff; }

.dp-kyc-masked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 10px;
  margin-top: 4px;
  font-family: 'Courier New', monospace;
  letter-spacing: .04em;
}
.dp-kyc-masked svg { width: 12px; height: 12px; }

.dp-doc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
}
.dp-doc-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--nb-xl);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dp-doc-icon svg { width: 18px; height: 18px; stroke: var(--nb); }
.dp-doc-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.dp-doc-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
.dp-doc-expiry-warn { color: #dc2626; font-weight: 600; }
.dp-doc-link {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--nb);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: var(--nb-xl);
  flex-shrink: 0;
}
.dp-doc-link:hover { background: #dbeafe; }


.dp-status-panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}
.dp-status-panel .panel-hd {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}

/* Responsive dp-*/
@media (max-width: 767.98px) {
  .dp-header-left { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dp-header-kpis { gap: 8px; }
  .dp-kpi { flex: 1 1 80px; min-width: 70px; }
  .dp-kpi-val { font-size: 1.1rem; }
  .dp-tabs { gap: 3px; }
  .dp-tabs a { padding: 8px 10px; font-size: 12px; min-width: 80px; }
  .dm-filter-bar { flex-direction: column; }
  .dm-filter-bar .form-control,
  .dm-filter-bar .form-select { width: 100%; }
  .dm-kpi-row { gap: 8px; }
  .dm-kpi-card { padding: 14px 16px; }
  .dm-kpi-card .kpi-val { font-size: 1.4rem; }
}

/* =========================================================
   UX REFINEMENTS v3.1
   - Button-variant gap fixes (outline-dark / outline-warning)
   - Inline-form action wrapper consistency
   - Compact table cells (no awkward wraps on dates / money)
   - Mobile-first table → stacked card pattern
   - Sidebar tooltip on collapsed state
   - Misc polish
   ========================================================= */

/* ── Missing button variants ──────────────────────────────
   Without these, Bootstrap defaults rendered borderless on
   "Make Admin" / "Move to User", breaking visual consistency. */
.btn-outline-dark {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline-dark:hover,
.btn-outline-dark:focus {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff;
}

.btn-outline-warning {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline-warning:hover,
.btn-outline-warning:focus {
  background: var(--ea-lt);
  border-color: var(--ea);
  color: #92400e;
}

.btn-outline-info {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline-info:hover,
.btn-outline-info:focus {
  background: #e0f2fe;
  border-color: var(--brand-teal);
  color: #0369a1;
}

/* ── Action column: inline forms behave as flex items ────
   Each <form class="d-inline"> in a table action cell now
   sits side-by-side with consistent gap, instead of stacking. */
.table-action-group > form,
.table-action-group > form.d-inline,
.table td .d-flex.flex-wrap.gap-1 > form,
.table td .d-flex.flex-wrap.gap-1 > form.d-inline {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}
.table-action-group > form > .btn,
.table td .d-flex.flex-wrap.gap-1 > form > .btn { width: 100%; }

/* Compact, equal-feel small action buttons in tables */
.table td .btn-sm,
.table td .btn-xs {
  font-weight: 600;
  letter-spacing: 0.01em;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 7px;
}

/* Group of action buttons — let it always wrap on its own row */
.table-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ── Compact table cells (the row-height killer fix) ─────
   The Key Timings / Internal Revenue cells were wrapping
   "24 Apr 11:23 AM" mid-value. Prevent that and tighten. */
.table .small {
  font-size: 12px !important;
  line-height: 1.45;
}
/* Stacked label:value mini-lines used in many tables */
.table td > .small { white-space: nowrap; }
.table td > .small > .text-muted { margin-right: 3px; }

/* Money / time / id cells — never break inside the value */
.table .text-nowrap,
.table .nowrap,
.table .fw-semibold + .small,
.table td .small.text-muted,
.table td .small.fw-semibold {
  white-space: nowrap;
}

/* Soften address / wrap cells so they line-clamp gracefully */
.table td .text-wrap {
  white-space: normal !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

/* Tighter row padding to bring overall density down a touch */
.table thead th { padding: 10px 14px; }
.table tbody td { padding: 10px 14px; }

/* Make the responsive scroller feel native — soft right-edge fade */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.table-responsive::-webkit-scrollbar { height: 6px; }
.table-responsive::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* ── Mobile-first: stack action buttons full-width ─────── */
@media (max-width: 575.98px) {
  .table td .d-flex.flex-wrap.gap-1,
  .table td .table-action-group {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  .table td .d-flex.flex-wrap.gap-1 > form,
  .table td .d-flex.flex-wrap.gap-1 > .btn,
  .table td .table-action-group > form,
  .table td .table-action-group > .btn {
    width: 100%;
  }
  .table td .d-flex.flex-wrap.gap-1 > form > .btn { width: 100%; }
}

/* ── Mobile table → stacked card pattern ────────────────
   At <768px we transform a table inside .table-card to a
   vertical card list. Each <td> becomes its own row with
   the column header as a label. PHP/HTML stays untouched —
   we read column names from the existing thead via JS-free
   ::before fallback labels for the most common columns. */
@media (max-width: 767.98px) {
  .table-card .table-responsive { overflow-x: visible; }
  .table-card .table {
    display: block;
    width: 100%;
  }
  .table-card .table thead {
    /* Keep accessible but visually hidden */
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
  .table-card .table tbody { display: block; }
  .table-card .table tbody tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 0;
    margin: 0 12px 12px;
    box-shadow: var(--shadow-xs);
  }
  .table-card .table tbody tr:hover td { background: transparent; }
  .table-card .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 14px !important;
    border-bottom: 1px dashed var(--border) !important;
    text-align: right;
    min-height: 0;
  }
  .table-card .table tbody td:last-child {
    border-bottom: none !important;
  }
  .table-card .table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    flex-shrink: 0;
    text-align: left;
    align-self: center;
    max-width: 40%;
  }
  /* Cells WITH a label: value sits right-aligned next to it */
  .table-card .table tbody td[data-label] > * {
    text-align: right;
    margin-left: auto;
  }
  /* Cells WITHOUT a label: stack left-aligned, full width */
  .table-card .table tbody td:not([data-label]) {
    text-align: left;
    flex-direction: column;
    align-items: stretch;
  }
  /* Action cell stacks full-width below — overrides right-align for cells with data-label */
  .table-card .table tbody td.actions-cell {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 6px;
  }
  .table-card .table tbody td.actions-cell::before {
    text-align: left;
    margin-bottom: 4px;
  }
  .table-card .table tbody td.actions-cell > * {
    text-align: left;
    margin-left: 0;
    width: 100%;
  }
  .table-card .table tbody td.actions-cell .btn { width: 100%; }
  .table-card .table tbody td.actions-cell form { width: 100%; }
  .table-card .table tbody td .small { white-space: normal; }
  /* Card header tweaks for mobile */
  .table-card .card-header { padding: 12px 16px !important; }
  .table-card .card-header strong { font-size: 13px; }
}

/* ── Sidebar collapsed: hover tooltip for icon-only nav ── */
@media (min-width: 992px) {
  .sidebar.collapsed .nav-item[data-sidebar-tooltip] {
    position: relative;
  }
  .sidebar.collapsed .nav-item[data-sidebar-tooltip]::before,
  .sidebar.collapsed .nav-item[data-sidebar-tooltip]::after {
    content: '';
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .15s ease, transform .15s ease;
    z-index: 1080;
  }
  .sidebar.collapsed .nav-item[data-sidebar-tooltip]::before {
    content: attr(data-sidebar-tooltip);
    left: calc(100% + 12px);
    top: 50%;
    transform: translate(-6px, -50%);
    background: #0F1E32;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 6px 11px;
    border-radius: 7px;
    white-space: nowrap;
    box-shadow: 0 6px 22px rgba(0,0,0,0.32);
  }
  .sidebar.collapsed .nav-item[data-sidebar-tooltip]::after {
    left: calc(100% + 6px);
    top: 50%;
    transform: translate(-6px, -50%);
    border: 6px solid transparent;
    border-right-color: #0F1E32;
  }
  .sidebar.collapsed .nav-item[data-sidebar-tooltip]:hover::before,
  .sidebar.collapsed .nav-item[data-sidebar-tooltip]:hover::after {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

/* ── Sidebar collapsed: better icon centering & active glow ── */
.sidebar.collapsed .nav-item.active {
  background: var(--sb-active-bg);
  box-shadow: inset 0 0 0 1px rgba(77,181,46,0.32);
}
.sidebar.collapsed .nav-item:hover { background: rgba(255,255,255,0.06); }

/* ── Topbar: tighter on tablet so badge + emergency don't push ── */
@media (max-width: 991.98px) {
  .topbar-emergency,
  .topbar-badge { display: none !important; }
  .topbar-branding { display: flex !important; }
  .topbar-branding .topbar-meta { display: none; }
  .page-name { font-size: 14px; }
}

/* ── Filter / search bars: wrap nicely on mobile ── */
@media (max-width: 575.98px) {
  .dm-filter-bar,
  .filter-bar,
  form.row.g-2,
  form.row.g-3 {
    gap: 8px !important;
  }
  .search-inline .form-control { min-width: 0; width: 100%; }
}

/* ── Card header: action button doesn't crowd title on small screens ── */
@media (max-width: 575.98px) {
  .table-card .card-header.d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }
  .table-card .card-header .btn { align-self: stretch; }
}

/* ── Pagination footer: stack cleanly on mobile ── */
@media (max-width: 575.98px) {
  .table-card .card-footer.d-flex {
    align-items: stretch !important;
  }
  .table-card .card-footer .btn { flex: 1; }
}

/* ── Page header on tablet: keep filters from overflowing ── */
@media (max-width: 767.98px) {
  .page-header { gap: 10px; }
  .page-header h1 { font-size: 1.2rem; }
  .page-subtitle { font-size: 12.5px; }
}

/* ── Touch-friendly tap targets on mobile ── */
@media (max-width: 575.98px) {
  .btn-sm, .btn-xs {
    min-height: 38px;
    padding: 7px 14px;
    font-size: 12.5px;
  }
  .nav-item { min-height: 44px; }
  .form-control, .form-select { font-size: 15px; } /* prevents iOS zoom on focus */
}

/* ── Status badge: prevent overflow on tight tables ── */
.badge-status, .badge { white-space: nowrap; }

/* ── Topbar on small screens: hide redundant emergency, show on user dropdown ── */
@media (max-width: 575.98px) {
  .topbar-home-logo img { width: 64px; max-height: 34px; }
  .topbar { gap: 6px; }
}


/* Trip route visibility for live/completed trips */
.trip-route-map-large {
  min-height: 420px;
  height: 52vh;
}
.trip-route-map-large > :not(span):not(p) {
  min-height: 420px !important;
  height: 100% !important;
}
.dispatch-trip-map {
  min-height: 460px;
  height: 56vh;
}
.dispatch-trip-map > :not(span):not(p) {
  min-height: 460px !important;
  height: 100% !important;
}
.trip-route-card .badge,
#dispatchRouteSummary {
  border: 1px solid var(--border);
  color: var(--text-muted);
}
@media (max-width: 768px) {
  .trip-route-map-large,
  .dispatch-trip-map { min-height: 360px; height: 48vh; }
  .trip-route-map-large > :not(span):not(p),
  .dispatch-trip-map > :not(span):not(p) { min-height: 360px !important; }
}

/* ─────────────────────────────────────────────────────────────
   Mobile APK / small-screen compatibility refinements
   Keeps existing UI, removes horizontal crowding, and makes tables/maps usable
   inside the Android WebView without adding a native top app bar.
───────────────────────────────────────────────────────────── */
html.naam-mobile-webview,
body.naam-mobile-webview {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

body.naam-mobile-webview .page-content {
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

body.naam-mobile-webview .topbar {
  top: 0;
  z-index: 1030;
}

body.naam-mobile-webview table,
body.naam-mobile-webview .table {
  white-space: nowrap;
}

body.naam-mobile-webview .table-responsive,
body.naam-mobile-webview .responsive-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.naam-mobile-webview iframe,
body.naam-mobile-webview img,
body.naam-mobile-webview video,
body.naam-mobile-webview canvas {
  max-width: 100%;
}

body.naam-mobile-webview input,
body.naam-mobile-webview select,
body.naam-mobile-webview textarea,
body.naam-mobile-webview button {
  font-size: 16px;
}

@media (max-width: 768px) {
  .page-content { padding: 12px; }
  .card-premium, .dashboard-card, .form-card { border-radius: 16px; }
  .topbar-home-logo img { max-height: 34px; }
  .topbar-left { min-width: 0; }
  .topbar-right { gap: 6px; }
  .topbar-user-avatar, .sidebar-avatar { flex: 0 0 auto; }
  .auth-wrap { min-height: 100svh; }
  .auth-card { padding-left: 14px; padding-right: 14px; }
  .auth-brand { display: none; }
  .map-panel,
  .tracking-map,
  #trackingMap,
  #dispatchMap,
  #liveTripMap,
  #bookingMap,
  #driverManagementMap,
  .map-wrap,
  [data-map],
  .google-map {
    min-height: 360px !important;
    height: 52vh !important;
    max-height: 620px;
  }
  .modal-dialog { margin: 10px; }
  .btn, .form-control, .form-select { min-height: 42px; }
}

@media (max-width: 480px) {
  .page-content { padding: 10px; }
  .topbar { min-height: 58px; }
  .topbar-toggle { width: 42px; height: 42px; }
  .topbar-notif-btn, .topbar-user-btn { min-width: 42px; min-height: 42px; }
  .map-panel,
  .tracking-map,
  #trackingMap,
  #dispatchMap,
  #liveTripMap,
  #bookingMap,
  #driverManagementMap,
  .map-wrap,
  [data-map],
  .google-map {
    min-height: 330px !important;
    height: 55vh !important;
  }
}

.auth-visual-grid {
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.auth-visual-card,
.auth-number-card {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  padding: 14px 16px;
}
.auth-visual-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.auth-visual-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(77,181,46,0.18);
  border: 1px solid rgba(77,181,46,0.4);
  color: #86E05A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.auth-visual-card strong { color: #fff; display: block; margin-bottom: 2px; }
.auth-number-card {
  background: linear-gradient(135deg, rgba(77,181,46,0.18), rgba(20,82,163,0.18));
}
.auth-number-label {
  color: rgba(255,255,255,0.62);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-number-value {
  color: #86E05A;
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 900;
  margin: 4px 0;
}
.auth-number-note {
  color: #dbeafe;
  font-size: 12px;
}
.legal-consent-inline {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.legal-link {
  font-weight: 600;
  text-decoration: none;
}
.legal-link:hover { text-decoration: underline; }
.modal-legal-list {
  padding-left: 18px;
  margin: 0;
}
.modal-legal-list li {
  margin-bottom: 10px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.mini-legal-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}
@media (max-width: 991.98px) {
  .auth-number-value { font-size: 1.7rem; }
}


/* Enhanced map sizing for dispatch, booking, tracking, and driver management */
.dispatch-trip-map,
.trip-route-map-large,
#bookingMap,
#driverManagementMap {
  min-height: 440px !important;
  height: 56vh !important;
  max-height: 720px;
}
@media (min-width: 1200px) {
  .dispatch-trip-map,
  .trip-route-map-large,
  #bookingMap,
  #driverManagementMap {
    min-height: 500px !important;
    height: 60vh !important;
  }
}
@media (max-width: 768px) {
  .map-wrap { min-height: 360px; height: 52vh; }
}
@media (max-width: 480px) {
  .map-wrap { min-height: 330px; height: 55vh; }
}

/* NAAM ERS supplied login artwork */
.auth-brand img:not(.auth-amb-img):not(.auth-ers-poster) {
  opacity: 0.95;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.auth-poster-card {
  position: relative;
  z-index: 1;
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(20,82,163,0.55), rgba(7,18,32,0.9));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 42px rgba(0,0,0,0.34);
  text-decoration: none;
  max-width: 430px;
  margin: 2px auto 0;
}
.auth-poster-card:hover {
  border-color: rgba(77,181,46,0.45);
  box-shadow: 0 20px 46px rgba(0,0,0,0.42);
}
.auth-ers-poster {
  display: block;
  width: 100%;
  height: clamp(300px, 43vh, 430px);
  object-fit: contain;
  object-position: center;
  background: #084a9d;
}
.login-brand-lockup img[src*="ers-icon"] {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(20,82,163,0.18);
}
@media (max-width: 1199.98px) {
  .auth-ers-poster { height: clamp(280px, 42vh, 390px); }
}
@media (max-width: 991.98px) {
  .auth-poster-card { max-width: 360px; }
  .auth-ers-poster { height: 320px; }
}
@media (max-width: 575.98px) {
  .auth-poster-card { max-width: 100%; border-radius: 14px; }
  .auth-ers-poster { height: 300px; }
  .login-brand-lockup img[src*="ers-icon"] { width: 50px; height: 50px; border-radius: 12px; }
}
