:root{
    --naam-primary:#0f4c9a;
    --naam-primary-dark:#0a3872;
    --naam-accent:#cf2e3f;
    --naam-surface:#ffffff;
    --naam-bg:#f3f6fb;
    --naam-bg-soft:#eef3f9;
    --naam-border:#d9e3ef;
    --naam-text:#15263d;
    --naam-muted:#69788c;
    --naam-success:#14804a;
    --naam-warning:#b97910;
    --naam-danger:#c03b3b;
    --naam-shadow:0 10px 24px rgba(10,33,68,.08);
    --naam-shadow-soft:0 4px 12px rgba(10,33,68,.05);
    --sidebar-width:264px;
    --sidebar-collapsed:84px;
    --topbar-height:76px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
    font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
    background:var(--naam-bg);
    color:var(--naam-text);
    line-height:1.45;
}
a{text-decoration:none}
img{max-width:100%}
.bg-app,.auth-shell{background:linear-gradient(180deg,#eef3f9 0%,#f7f9fc 100%)}

/* auth */
.auth-main{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem}
.auth-wrap{width:min(1120px,100%);display:grid;grid-template-columns:1.02fr .98fr;background:#fff;border-radius:28px;overflow:hidden;box-shadow:var(--naam-shadow)}
.auth-wrap-tight{max-width:960px}
.auth-brand{background:linear-gradient(180deg,var(--naam-primary-dark) 0%,#1756aa 100%);color:#fff;padding:3rem;display:flex;flex-direction:column;justify-content:space-between}
.auth-brand img{width:220px;display:block;margin-bottom:1.5rem}
.auth-brand h1{font-size:2rem;margin:0 0 .75rem;font-weight:800;letter-spacing:.02em}
.auth-brand p{color:rgba(255,255,255,.82);max-width:30rem}
.auth-card{padding:2.5rem 2.25rem}
.brand-chip{display:inline-flex;align-items:center;padding:.45rem .8rem;border-radius:999px;background:rgba(255,255,255,.12);backdrop-filter:blur(8px);font-size:.82rem;font-weight:700;margin-bottom:1rem}
.brand-stack{display:grid;gap:.2rem;color:rgba(255,255,255,.86)}
.login-brand-lockup{display:flex;align-items:center;gap:1rem}
.login-brand-lockup img{width:66px;height:66px;object-fit:contain;border-radius:16px;background:#fff;box-shadow:0 10px 24px rgba(15,39,71,.12)}
.otp-input{letter-spacing:.35em;text-align:center;font-size:1.25rem}

/* global form */
.form-control,.form-select{
    min-height:46px;
    border-radius:14px;
    border-color:var(--naam-border);
    box-shadow:none;
    background:#fff;
}
textarea.form-control{min-height:auto}
.form-control:focus,.form-select:focus{
    border-color:#7da6da;
    box-shadow:0 0 0 .18rem rgba(15,76,154,.12);
}
.form-label{font-weight:700;color:#31455f;margin-bottom:.45rem}
.required-dot{color:var(--naam-danger)}
.form-check-input{border-color:#b9c9dc}
.form-check-input:checked{background-color:var(--naam-primary);border-color:var(--naam-primary)}
.btn{
    border-radius:14px;
    font-weight:700;
    min-height:44px;
    padding:.6rem 1rem;
}
.btn-primary{background:var(--naam-primary);border-color:var(--naam-primary)}
.btn-primary:hover,.btn-primary:focus{background:var(--naam-primary-dark);border-color:var(--naam-primary-dark)}
.btn-danger{background:var(--naam-accent);border-color:var(--naam-accent)}
.btn-outline-primary{color:var(--naam-primary);border-color:#b8cae2}
.btn-icon{width:44px;min-width:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:1.15rem}
.badge{font-size:.74rem;padding:.52em .8em;border-radius:999px}

/* layout */
.topbar{
    position:sticky;
    top:0;
    z-index:1100;
    min-height:var(--topbar-height);
    background:rgba(255,255,255,.94);
    backdrop-filter:blur(10px);
    border-bottom:1px solid var(--naam-border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1rem;
    padding:.9rem 1.25rem;
}
.topbar-left{display:flex;align-items:center;gap:.9rem;min-width:0}
.brand-link{display:flex;align-items:center;gap:.85rem;color:inherit;min-width:0}
.brand-logo{
    width:48px;
    height:48px;
    border-radius:14px;
    object-fit:contain;
    background:#fff;
    box-shadow:var(--naam-shadow-soft);
    flex:0 0 auto;
}
.brand-title{font-size:1.08rem;font-weight:800;color:var(--naam-text)}
.brand-subtitle{font-size:.83rem;color:var(--naam-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:38vw}
.topbar-actions{display:flex;align-items:center;gap:.8rem;position:relative}
.user-chip{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2}
.user-chip-role{font-size:.74rem;color:var(--naam-muted)}
.notification-panel{
    position:absolute;
    right:0;
    top:calc(100% + .6rem);
    width:360px;
    max-height:420px;
    overflow:auto;
    z-index:1150;
    border-radius:18px;
    border:1px solid var(--naam-border);
}

.app-layout{
    display:grid;
    grid-template-columns:var(--sidebar-width) minmax(0,1fr);
    min-height:calc(100vh - var(--topbar-height));
}
.app-main{
    min-width:0;
    padding:1.35rem 1.5rem 2rem;
}
.app-main-inner{
    width:100%;
    max-width:100%;
}
.sidebar-backdrop{display:none}

/* sidebar */
.sidebar{
    position:sticky;
    top:var(--topbar-height);
    height:calc(100vh - var(--topbar-height));
    background:#fff;
    border-right:1px solid var(--naam-border);
    padding:1rem .9rem;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    gap:1rem;
    overflow:auto;
}
.sidebar-section,.sidebar-footer-card{
    background:var(--naam-surface);
    border:1px solid var(--naam-border);
    border-radius:20px;
    padding:1rem .8rem;
    box-shadow:var(--naam-shadow-soft);
}
.sidebar-mini-label{
    font-size:.74rem;
    color:#8592a3;
    text-transform:uppercase;
    letter-spacing:.08em;
    font-weight:800;
    margin-bottom:.7rem;
}
.sidebar-role-card{
    border-radius:16px;
    padding:.85rem .9rem;
    background:linear-gradient(180deg,#f7fbff 0%,#eef4fb 100%);
    border:1px solid var(--naam-border);
    margin-bottom:.9rem;
}
.sidebar-role-name{font-weight:800;color:var(--naam-text)}
.sidebar-role-meta{font-size:.84rem;color:var(--naam-muted)}
.sidebar-nav .nav-link{
    display:flex;
    align-items:center;
    gap:.85rem;
    border-radius:14px;
    padding:.78rem .82rem;
    color:#233853;
    font-weight:700;
    margin-bottom:.28rem;
    transition:.18s ease;
}
.sidebar-nav .nav-link:hover{
    background:#f4f7fb;
    color:var(--naam-primary);
}
.sidebar-nav .nav-link.active{
    background:rgba(15,76,154,.08);
    color:var(--naam-primary);
    border:1px solid rgba(15,76,154,.12);
}
.nav-link-icon{
    width:34px;
    height:34px;
    border-radius:12px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#eef3f9;
    color:var(--naam-primary);
    font-size:.82rem;
    font-weight:800;
    flex:0 0 auto;
}
.nav-link-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-footer-card .small{display:block}

/* collapsed sidebar */
body.sidebar-collapsed .app-layout{grid-template-columns:var(--sidebar-collapsed) minmax(0,1fr)}
body.sidebar-collapsed .sidebar{padding:1rem .55rem}
body.sidebar-collapsed .sidebar-mini-label,
body.sidebar-collapsed .sidebar-role-meta,
body.sidebar-collapsed .sidebar-role-name,
body.sidebar-collapsed .nav-link-text,
body.sidebar-collapsed .sidebar-footer-card .small{display:none}
body.sidebar-collapsed .sidebar-section,
body.sidebar-collapsed .sidebar-footer-card{padding:.7rem .45rem}
body.sidebar-collapsed .sidebar-role-card{padding:.45rem;min-height:44px}
body.sidebar-collapsed .sidebar-nav .nav-link{justify-content:center;padding:.62rem}
body.sidebar-collapsed .nav-link-icon{margin:0}
body.sidebar-collapsed .sidebar-footer-card{min-height:56px}

/* content */
.page-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:1rem;
    margin-bottom:1.25rem;
}
.page-header h1{
    margin:0;
    font-size:1.65rem;
    font-weight:800;
    color:var(--naam-text);
}
.page-subtitle{
    color:var(--naam-muted);
    margin-top:.35rem;
    font-size:.95rem;
}
.card-premium,.metric-card,.panel-card,.table-card,.form-section,.status-tile,.print-sheet{
    background:#fff;
    border:1px solid var(--naam-border);
    border-radius:20px;
    box-shadow:var(--naam-shadow-soft);
}
.metric-card{padding:1.1rem 1.15rem;height:100%}
.metric-title{font-size:.88rem;color:var(--naam-muted);margin-bottom:.35rem;font-weight:700}
.metric-value{font-size:1.7rem;font-weight:800;line-height:1.1}
.metric-meta{font-size:.82rem;color:var(--naam-muted)}
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}
.panel-card{padding:1.1rem 1.15rem}
.panel-card .card-header,.table-card .card-header{background:#fff;border-bottom:1px solid var(--naam-border)}
.table-card{overflow:hidden}
.table-card table{margin-bottom:0}
.table td,.table th{vertical-align:middle;padding:1rem .95rem;border-color:#eef2f7}
.table thead th{
    font-size:.82rem;
    text-transform:uppercase;
    letter-spacing:.04em;
    color:#6e7f94;
    font-weight:800;
    white-space:nowrap;
}
.queue-item{
    padding:.9rem .95rem;
    border:1px solid var(--naam-border);
    border-radius:16px;
    background:#fff;
    transition:.18s ease;
}
.queue-item + .queue-item{margin-top:.75rem}
.queue-item:hover{transform:translateY(-1px);box-shadow:var(--naam-shadow-soft)}
.queue-item.critical{border-color:#f2bec4;background:#fff8f8}
.queue-item.high{border-color:#efd8a7;background:#fffaf2}
.map-wrap{
    min-height:380px;
    border-radius:18px;
    background:#eff4fa;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#58708f;
    border:1px dashed #b3c5d9;
}
.map-wrap.small{min-height:260px}
.form-section{padding:1.15rem 1.15rem;background:#fff;margin-bottom:1rem}
.section-title{font-size:1rem;font-weight:800;margin-bottom:.85rem;color:var(--naam-text)}
.search-inline{max-width:360px}
.table-search{max-width:280px}
.empty-state{
    padding:2rem 1.25rem;
    border:1px dashed var(--naam-border);
    border-radius:16px;
    background:#fafcff;
    text-align:center;
    color:var(--naam-muted);
}
.footer-note{
    border-top:1px solid var(--naam-border);
    padding-top:1rem;
    margin-top:1.35rem;
    color:var(--naam-muted);
}
.timeline{position:relative;padding-left:1.2rem}
.timeline:before{content:"";position:absolute;left:.28rem;top:.2rem;bottom:.2rem;width:2px;background:#d8e1ef}
.timeline-item{position:relative;padding-left:1rem;padding-bottom:1rem}
.timeline-item:before{content:"";position:absolute;left:-.03rem;top:.38rem;width:.65rem;height:.65rem;border-radius:999px;background:var(--naam-accent)}
.timeline-item h6{margin:0 0 .25rem;font-size:.95rem}
.timeline-item small{color:var(--naam-muted)}
.list-tight{padding-left:1rem}
.list-tight li{margin-bottom:.45rem}
.quick-tag{padding:.25rem .6rem;border-radius:999px;background:#f0f4fa;color:#40516a;font-size:.8rem;font-weight:600}
.info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.print-sheet{padding:2rem}
.dark-card{
    background:linear-gradient(180deg,var(--naam-primary-dark) 0%,var(--naam-primary) 100%);
    color:#fff;
}
.dark-card .metric-title,.dark-card .metric-meta{color:rgba(255,255,255,.8)}
.status-tile{padding:1rem}
.stat-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}
.split-hero{display:grid;grid-template-columns:1fr auto;gap:1rem;align-items:center}
.driver-register-shell{display:grid;grid-template-columns:300px 1fr;gap:1.25rem}
.register-side{
    position:sticky;
    top:96px;
    height:fit-content;
    background:linear-gradient(180deg,var(--naam-primary-dark) 0%,var(--naam-primary) 100%);
    color:#fff;
    border-radius:24px;
    padding:1.5rem;
}
.register-side img{width:150px;margin-bottom:1rem}
.register-side .mini{color:rgba(255,255,255,.78);font-size:.88rem}
.section-chip{display:inline-flex;padding:.35rem .7rem;border-radius:999px;background:#f0f4fb;color:#28466d;font-size:.76rem;font-weight:700;margin-bottom:.75rem}
.checkbox-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem 1rem}
.upload-tile{border:1px dashed #c5d3e6;border-radius:16px;padding:1rem;background:#fbfdff}
.shortcut-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin-bottom:1rem}
.shortcut-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1rem;
    padding:1rem 1.05rem;
    border-radius:18px;
    border:1px solid var(--naam-border);
    background:#fff;
    box-shadow:var(--naam-shadow-soft);
    color:var(--naam-text);
}
.shortcut-card:hover{border-color:#c7d8ea;color:var(--naam-primary)}
.shortcut-card-title{font-weight:800}
.shortcut-card-meta{font-size:.84rem;color:var(--naam-muted)}
.shortcut-arrow{font-size:1.15rem;color:var(--naam-primary)}
.form-check-inline{margin-right:1rem}

/* status */
.badge-status{
    display:inline-flex;
    align-items:center;
    gap:.35rem;
    padding:.48rem .78rem;
    border-radius:999px;
    font-size:.73rem;
    font-weight:800;
    letter-spacing:.02em;
    border:1px solid transparent;
    text-transform:capitalize;
    white-space:nowrap;
}
.status-requested,.status-under-review,.status-pending,.status-pending-verification{background:#fff5df;color:#996a00;border-color:#efcf7c}
.status-assigned,.status-driver-accepted,.status-en-route-to-pickup,.status-arrived-pickup,.status-patient-onboard,.status-en-route-to-hospital{background:#e7f0ff;color:#1b4ea1;border-color:#9cbaf2}
.status-completed,.status-approved,.status-accepted,.status-online{background:#e5f7ee;color:#0d7a49;border-color:#9ed2b4}
.status-cancelled,.status-rejected,.status-suspended,.status-no-response,.status-offline{background:#fdebec;color:#ad2230;border-color:#efb0b6}
.status-reassigned,.status-diverted,.status-reverification-required{background:#eef4ff;color:#355b9b;border-color:#bfd0ef}

/* tidy spacing */
.page-subtitle{display:none}
.metric-meta{display:none}

/* responsive */
@media (max-width: 1280px){
    .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .shortcut-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 992px){
    .auth-wrap{grid-template-columns:1fr}
    .app-layout{grid-template-columns:1fr}
    .sidebar{
        position:fixed;
        top:var(--topbar-height);
        left:0;
        width:min(88vw,300px);
        height:calc(100vh - var(--topbar-height));
        transform:translateX(-100%);
        transition:transform .22s ease;
        z-index:1200;
    }
    body.sidebar-open .sidebar{transform:translateX(0)}
    .sidebar-backdrop{
        display:block;
        position:fixed;
        inset:var(--topbar-height) 0 0 0;
        background:rgba(13,26,45,.28);
        opacity:0;
        visibility:hidden;
        transition:.18s ease;
        z-index:1190;
    }
    body.sidebar-open .sidebar-backdrop{opacity:1;visibility:visible}
    .app-main{padding:1rem}
    .split-hero,.info-grid,.shortcut-grid{grid-template-columns:1fr}
    .driver-register-shell{grid-template-columns:1fr}
    .register-side{position:static}
    .topbar{padding:.85rem 1rem;flex-wrap:wrap}
    .topbar-actions{margin-left:auto}
    .brand-subtitle{max-width:unset}
}
@media (max-width: 768px){
    .kpi-grid,.stat-strip,.checkbox-grid{grid-template-columns:1fr}
    .notification-panel{width:min(92vw,360px)}
    .page-header{flex-direction:column}
    .user-chip{align-items:flex-start}
}
@media print{
    .topbar,.sidebar,.sidebar-backdrop,.btn,.toast-container,.notification-panel,.page-header,.footer-note{display:none !important}
    .app-main{padding:0}
    body{background:#fff}
    .print-sheet{box-shadow:none;border:0}
}


/* ===== UI Refresh Overlay ===== */
/* =========================================================
   NAAM ERS — Healthcare Dispatch Platform
   Design System & Application Styles
   ========================================================= */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* --- CSS Variables --- */
:root {
  /* Brand */
  --brand-primary:     #1a56db;
  --brand-primary-dk:  #1344b8;
  --brand-teal:        #0891b2;
  --brand-teal-lt:     #e0f2fe;
  --brand-danger:      #dc2626;
  --brand-danger-lt:   #fef2f2;
  --brand-success:     #16a34a;
  --brand-success-lt:  #f0fdf4;
  --brand-warning:     #d97706;
  --brand-warning-lt:  #fffbeb;
  --brand-purple:      #7c3aed;
  --brand-purple-lt:   #f5f3ff;

  /* Sidebar */
  --sidebar-bg:        #0d1b2e;
  --sidebar-bg-2:      #132035;
  --sidebar-border:    rgba(255,255,255,0.07);
  --sidebar-text:      #94a3b8;
  --sidebar-text-hover:#cbd5e1;
  --sidebar-active-bg: rgba(26,86,219,0.20);
  --sidebar-active:    #60a5fa;
  --sidebar-width:     260px;
  --sidebar-width-sm:  72px;

  /* Surfaces */
  --surface:           #ffffff;
  --surface-2:         #f8fafc;
  --surface-3:         #f1f5f9;
  --border:            #e2e8f0;
  --border-strong:     #cbd5e1;

  /* Text */
  --text-primary:      #0f172a;
  --text-secondary:    #475569;
  --text-muted:        #94a3b8;

  /* Layout */
  --topbar-height:     60px;
  --content-max:       1400px;
  --radius:            10px;
  --radius-lg:         14px;
  --radius-sm:         6px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow:      0 4px 6px -1px rgba(15,23,42,.07), 0 2px 4px -2px rgba(15,23,42,.05);
  --shadow-md:   0 10px 15px -3px rgba(15,23,42,.08), 0 4px 6px -4px rgba(15,23,42,.05);
  --shadow-lg:   0 20px 25px -5px rgba(15,23,42,.1), 0 8px 10px -6px rgba(15,23,42,.06);

  /* Transitions */
  --transition:  all 0.18s ease;
}

/* --- Base Reset & Typography --- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-2);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

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.55rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1rem; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-primary-dk); }

/* =========================================================
   LAYOUT — Shell, Sidebar, Topbar
   ========================================================= */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  transition: width 0.22s ease, transform 0.22s ease;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: var(--topbar-height);
  text-decoration: none;
}
.sidebar-logo-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--brand-danger);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-logo-icon svg { width: 22px; height: 22px; color: #fff; }
.sidebar-logo-text {
  overflow: hidden;
  transition: opacity 0.18s;
}
.sidebar-logo-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.0rem;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.sidebar-logo-tag {
  font-size: 10.5px;
  color: var(--sidebar-text);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-text);
  padding: 16px 20px 6px;
  opacity: 0.65;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px 9px 20px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
}
.nav-item svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: var(--transition);
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-hover);
}
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; color: var(--sidebar-active); }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  overflow: hidden;
}
.sidebar-user:hover { background: rgba(255,255,255,0.05); }
.sidebar-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-teal));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info {
  overflow: hidden;
  transition: opacity 0.18s;
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sidebar-text-hover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--sidebar-text);
  white-space: nowrap;
}
.sidebar-logout {
  width: 28px; height: 28px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sidebar-text);
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
}
.sidebar-logout:hover { background: rgba(220,38,38,0.15); color: #fca5a5; }
.sidebar-logout svg { width: 16px; height: 16px; }

/* --- Main Content Wrapper --- */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.22s ease;
  min-width: 0;
}

/* --- Topbar --- */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: var(--shadow-sm);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-toggle {
  width: 36px; height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}
.topbar-toggle:hover { background: var(--surface-3); color: var(--text-primary); }
.topbar-toggle svg { width: 20px; height: 20px; }
.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;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-badge {
  height: 34px;
  padding: 0 12px;
  border-radius: 20px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
}
.topbar-badge.emergency {
  border-color: rgba(220,38,38,0.3);
  background: var(--brand-danger-lt);
  color: var(--brand-danger);
}
.topbar-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.topbar-badge .dot.pulse { animation: pulse-dot 1.8s ease-in-out infinite; }

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

.topbar-btn {
  width: 34px; height: 34px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  text-decoration: none;
}
.topbar-btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text-primary); }
.topbar-btn svg { width: 17px; height: 17px; }

/* --- Page Content --- */
.page-content {
  flex: 1;
  padding: 28px 28px 40px;
  max-width: var(--content-max);
  width: 100%;
}

/* --- 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.45rem;
  font-weight: 800;
  color: var(--text-primary);
}
.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 400;
}
.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);
}
.panel-card + .panel-card { margin-top: 0; }

.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: 16px 20px !important;
  font-size: 14px;
}
.table-card .card-header strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
}

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

/* =========================================================
   METRIC / KPI GRID
   ========================================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 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(--transition);
}
.metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-teal));
  border-radius: 3px 3px 0 0;
}
.metric-card.danger-card::before { background: linear-gradient(90deg, var(--brand-danger), #f97316); }
.metric-card.success-card::before { background: linear-gradient(90deg, var(--brand-success), #34d399); }
.metric-card.warning-card::before { background: linear-gradient(90deg, var(--brand-warning), #fbbf24); }
.metric-card.purple-card::before { background: linear-gradient(90deg, var(--brand-purple), #a78bfa); }

.metric-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  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);
}
.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(--sidebar-bg);
  border-color: transparent;
}
.metric-card.dark-card .metric-title,
.metric-card.dark-card .metric-meta { color: var(--sidebar-text); }
.metric-card.dark-card .metric-value { color: #fff; }

/* =========================================================
   SHORTCUT GRID
   ========================================================= */

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.shortcut-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--text-primary);
}
.shortcut-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--brand-primary);
}
.shortcut-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.shortcut-card-icon svg { width: 22px; height: 22px; color: var(--brand-primary); }
.shortcut-card:hover .shortcut-card-icon { background: var(--brand-primary); }
.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(--transition);
}
.shortcut-card:hover .shortcut-card-meta { color: rgba(26,86,219,0.7); }
.shortcut-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.shortcut-card:hover .shortcut-arrow { color: var(--brand-primary); transform: translateX(3px); }

/* =========================================================
   TABLES
   ========================================================= */

.table {
  font-size: 13.5px;
  margin: 0;
  --bs-table-bg: transparent;
}
.table thead th {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  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
   ========================================================= */

.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;
}

.status-requested        { background: #eff6ff; color: #1d4ed8; }
.status-under-review     { background: #fffbeb; color: #b45309; }
.status-assigned         { background: #ecfdf5; color: #065f46; }
.status-driver-accepted  { background: #f0fdf4; color: #166534; }
.status-en-route-to-pickup    { background: #f5f3ff; 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: #f0fdf4; color: #15803d; }
.status-cancelled             { background: #fef2f2; color: #b91c1c; }
.status-rejected              { background: #f1f5f9; color: #475569; }
.status-pending               { background: #fffbeb; color: #b45309; }
.status-accepted              { background: #ecfdf5; color: #065f46; }
.status-pending-verification  { background: #fffbeb; color: #b45309; }
.status-approved              { background: #f0fdf4; color: #15803d; }
.status-reverification-required { background: #fef2f2; color: #b91c1c; }
.status-suspended             { background: #f1f5f9; color: #374151; }
.status-online                { background: #f0fdf4; color: #15803d; }
.status-offline               { background: #f1f5f9; color: #6b7280; }

/* Bootstrap badge overrides */
.badge { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 20px; }
.text-bg-warning { background-color: #fffbeb !important; color: #b45309 !important; border: 1px solid #fde68a; }
.text-bg-success { background-color: #f0fdf4 !important; color: #15803d !important; border: 1px solid #bbf7d0; }
.text-bg-secondary { background-color: #f1f5f9 !important; color: #475569 !important; border: 1px solid #e2e8f0; }
.text-bg-danger { background-color: #fef2f2 !important; color: #b91c1c !important; border: 1px solid #fecaca; }
.text-bg-primary { background-color: #eff6ff !important; color: #1d4ed8 !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(--transition);
  box-shadow: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
  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(--brand-primary);
  border-color: var(--brand-primary);
}
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(26,86,219,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: 14.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: 17px; height: 17px; color: var(--brand-primary); 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: #eff6ff;
  color: var(--brand-primary);
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.required-dot { color: var(--brand-danger); }
.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 */
.upload-tile {
  background: var(--surface-2);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--transition);
}
.upload-tile:hover { border-color: var(--brand-primary); background: #eff6ff; }

/* Checkbox grid for facilities */
.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(--transition);
}
.checkbox-grid .form-check:hover { border-color: var(--brand-primary); background: #eff6ff; }
.checkbox-grid .form-check-input { margin: 0; }

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  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;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:focus { box-shadow: none; outline: none; }

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

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

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

.btn-outline-primary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline-primary:hover {
  background: #eff6ff;
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.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(--brand-danger-lt); border-color: var(--brand-danger); color: var(--brand-danger); }

.btn-outline-success {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline-success:hover { background: var(--brand-success-lt); border-color: var(--brand-success); color: var(--brand-success); }

.btn-lg {
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius);
}
.btn-sm {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 5px;
}

/* =========================================================
   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(--brand-success-lt);
  border-color: #bbf7d0;
  color: #166534;
}
.alert-danger {
  background: var(--brand-danger-lt);
  border-color: #fecaca;
  color: #991b1b;
}
.alert-warning {
  background: var(--brand-warning-lt);
  border-color: #fde68a;
  color: #92400e;
}
.alert-light {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-secondary);
}
.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* =========================================================
   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(--brand-primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--brand-primary);
}
.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: 260px;
  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: 260px; }

/* 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
   ========================================================= */

.auth-page-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d1b2e 0%, #132035 40%, #0d1b2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}
.auth-page-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 70% 40%, rgba(26,86,219,0.15), transparent),
              radial-gradient(ellipse 50% 50% at 20% 80%, rgba(8,145,178,0.12), transparent);
}

.auth-wrap {
  display: grid;
  grid-template-columns: 1fr 420px;
  width: 100%;
  max-width: 900px;
  min-height: 540px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 64px -12px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}

.auth-brand {
  background: linear-gradient(160deg, #1a3a6b 0%, #0d1b2e 100%);
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.auth-brand::after {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(26,86,219,0.18), transparent 70%);
  pointer-events: none;
}
.auth-brand img {
  width: 80px;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.brand-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(220,38,38,0.25);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,0.3);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.auth-brand h1 {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0;
}
.brand-stack {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 12.5px;
  color: var(--sidebar-text);
  line-height: 1.7;
}
.brand-stack strong { color: #fff; }

.auth-card {
  background: var(--surface);
  padding: 40px 36px;
  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: 44px;
}
.login-brand-lockup h2 { font-size: 1.25rem; }

.auth-wrap-tight { max-width: 420px; }
.auth-wrap-tight .auth-brand { display: none; }
.auth-wrap-tight .auth-card {
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.4);
  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: var(--sidebar-bg);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  color: var(--sidebar-text);
}
.register-side img {
  width: 60px;
  margin-bottom: 14px;
  filter: brightness(0) invert(1);
  opacity: 0.8;
}
.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;
}

/* Form sections in registration */
.driver-register-shell .form-section {
  margin-bottom: 16px;
}

/* =========================================================
   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='%2394a3b8' 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;
}

/* =========================================================
   PRINT SHEET
   ========================================================= */

.print-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.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; }

/* =========================================================
   MISCELLANEOUS 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 override */
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.15em; }

/* Toast container */
.toast-container-custom {
  position: fixed;
  top: 80px;
  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(--sidebar-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 ease forwards;
  pointer-events: all;
  border-left: 3px solid var(--brand-primary);
}
.app-toast.toast-success { border-left-color: var(--brand-success); }
.app-toast.toast-danger { border-left-color: var(--brand-danger); }
.app-toast.toast-warning { border-left-color: var(--brand-warning); }
.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(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(30px); }
}

/* Sidebar collapse state */
.sidebar.collapsed { width: var(--sidebar-width-sm); }
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .main-wrapper { margin-left: var(--sidebar-width-sm); }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 20px 16px 32px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .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; }
}

@media (max-width: 575.98px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .topbar-breadcrumb { display: none; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   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; }
}



/* ===== AUTH TIGHT LAYOUT FIX ===== */
.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.4);
  padding: 40px;
}


/* ===== AUTH PAGE INTERACTION FIX ===== */
.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;
}


/* ===== DRIVER PUBLIC REGISTRATION POLISH ===== */
.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%;
  max-width: none;
  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;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 42px rgba(2, 8, 23, 0.28);
}
.driver-public-page .register-side img {
  width: 72px;
  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(--brand-primary);
  background: #eef4ff;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 8px;
}
.driver-public-page .checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.driver-public-page .checkbox-grid .form-check {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfdff;
  display: flex;
  align-items: center;
  min-height: 46px;
}
.driver-public-page .upload-tile {
  border: 1px dashed var(--border);
  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;
}
@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, minmax(0, 1fr));
  }
}
@media (max-width: 575.98px) {
  .driver-public-page .page-header-public {
    align-items: flex-start;
  }
  .driver-public-page .form-section {
    padding: 16px;
  }
  .driver-public-page .checkbox-grid {
    grid-template-columns: 1fr;
  }
}
