:root {
  --navy-950: #111a2a;
  --navy-900: #172235;
  --navy-850: #1c2a40;
  --navy-800: #22324a;
  --red-600: #df1f2d;
  --red-500: #ed2b38;
  --red-100: #ffe8eb;
  --cyan-500: #14b8d4;
  --cyan-100: #dff8fc;
  --green-600: #198a63;
  --green-100: #e1f6ed;
  --amber-600: #b87505;
  --amber-100: #fff1cf;
  --blue-600: #2e67d1;
  --blue-100: #e7efff;
  --ink-900: #1b2433;
  --ink-700: #3f4a5c;
  --ink-500: #697588;
  --ink-400: #8994a6;
  --line: #e5e9ef;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --surface-tint: #f0f4f8;
  --shadow-sm: 0 6px 18px rgba(26, 39, 61, 0.08);
  --shadow-md: 0 18px 46px rgba(26, 39, 61, 0.14);
  --shadow-lg: 0 26px 70px rgba(14, 24, 40, 0.23);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --sidebar-width: 264px;
  --topbar-height: 80px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* v2 operational journeys */
.journey-control-card { border-top: 3px solid var(--blue-600); }
.journey-control-card.is-active { border-top-color: var(--green-600); box-shadow: 0 14px 34px rgba(22,130,93,.12); }
.journey-start-actions { display: grid; gap: 9px; margin: 14px 0 10px; }
.next-stop-card { display: grid; gap: 4px; margin: 15px 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.next-stop-card > span, .next-stop-card > small { color: var(--ink-500); font-size: 10px; }
.next-stop-card > strong { color: var(--ink-900); font-size: 14px; }
.journey-eta-list { display: grid; gap: 9px; margin-top: 14px; }
.journey-eta-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; }
.journey-eta-item strong, .journey-eta-item span { display: block; }
.journey-eta-item strong { font-size: 11px; }
.journey-eta-item span { margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.navigation-steps { display: grid; gap: 8px; }
.navigation-summary { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 14px; border-radius: 12px; color: #fff; background: var(--ink-900); }
.navigation-summary strong { font-size: 18px; }
.navigation-summary span { font-size: 10px; opacity: .8; }
.navigation-step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; }
.navigation-step > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--red-500); font-size: 10px; font-weight: 850; }
.navigation-step strong, .navigation-step small { display: block; }
.navigation-step strong { font-size: 11px; }
.navigation-step small { margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.manifest-list { display: grid; gap: 9px; margin-bottom: 14px; }
.manifest-student { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.manifest-student:has(input:checked) { border-color: rgba(22,130,93,.55); background: rgba(22,130,93,.05); }
.manifest-student input { width: 18px; height: 18px; accent-color: var(--green-600); }
.manifest-student strong, .manifest-student small { display: block; }
.manifest-student small { margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.planner-stop-fields-four { display: grid; grid-template-columns: 72px 105px 78px 105px; gap: 7px; }
.planner-stop-fields-four label { color: var(--ink-500); font-size: 8px; font-weight: 750; }
.planner-stop-fields-four input { display: block; width: 100% !important; margin-top: 4px; }
.history-load-field { justify-content: end; }
.history-load-field .btn { min-height: 42px; }
.history-map, .geofence-map { min-height: 460px; }
.history-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.history-summary > div { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.history-summary strong, .history-summary span { display: block; }
.history-summary strong { font-size: 13px; }
.history-summary span { margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.history-ride-selector { display: grid; grid-template-columns: minmax(180px,1fr) minmax(260px,420px) auto; align-items: center; gap: 16px; padding: 16px 18px; }
.history-ride-selector h4 { margin: 5px 0 0; font-size: 13px; }
.history-playback-card { overflow: hidden; }
.history-playback-controls { display: grid; grid-template-columns: auto minmax(140px,1fr) auto 72px; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); background: #fff; }
.history-playback-controls input[type="range"] { width: 100%; accent-color: var(--red-500); }
.history-playback-controls select { min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-900); background: #fff; font-size: 10px; font-weight: 800; }
.history-playback-reading { min-width: 95px; text-align: right; }
.history-playback-reading strong,.history-playback-reading span { display: block; }
.history-playback-reading strong { font-size: 11px; }
.history-playback-reading span { margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.history-playback-bus > div { box-shadow: 0 10px 24px rgba(223,31,45,.24),0 0 0 5px rgba(223,31,45,.12); }
.history-stop-list { display: grid; gap: 9px; }
.history-stop-item { width: 100%; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: inherit; background: #fff; font: inherit; text-align: left; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.history-stop-item:hover { border-color: rgba(32,98,184,.42); box-shadow: 0 8px 22px rgba(23,34,53,.08); transform: translateY(-1px); }
.history-stop-item:focus-visible { outline: 3px solid rgba(32,98,184,.22); outline-offset: 2px; }
.history-stop-order { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink-900); font-size: 10px; font-weight: 900; }
.history-stop-item strong,.history-stop-item span,.history-stop-item small { display: block; }
.history-stop-item > div:nth-child(2) > strong { font-size: 11px; }
.history-stop-item > div:nth-child(2) > span { margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.history-stop-item > div:nth-child(2) > small { margin-top: 4px; color: var(--ink-400); font-size: 8px; }
.history-dwell { min-width: 95px; padding: 8px 10px; border-radius: 9px; text-align: right; background: var(--surface-soft); }
.history-dwell strong { color: var(--green-600); font-size: 12px; }
.history-dwell span { margin-top: 2px; color: var(--ink-400); font-size: 8px; }
.history-stop-map-icon { overflow: visible !important; border: 0; background: transparent; pointer-events: none !important; }
.history-stop-label.leaflet-tooltip { pointer-events: auto; }
.history-stop-node { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--green-600); box-shadow: 0 8px 20px rgba(23,34,53,.25); font: inherit; cursor: pointer; pointer-events: auto; }
.history-stop-node::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; border-right: 3px solid #fff; border-bottom: 3px solid #fff; background: inherit; transform: translateX(-50%) rotate(45deg); }
.history-stop-node:focus-visible { outline: 3px solid rgba(32,98,184,.32); outline-offset: 3px; }
.history-stop-node.is-school { background: var(--navy-900); }
.history-stop-node span { position: relative; z-index: 1; font-size: 11px; font-weight: 950; }
.history-stop-popup-title { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.history-stop-popup-title > span { width: 30px; height: 30px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--blue-600); font-size: 10px; font-weight: 950; }
.history-stop-popup-title small,.history-stop-popup-title strong { display: block; }
.history-stop-popup-title small { color: var(--ink-400); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.history-stop-popup-title strong { margin-top: 2px; color: var(--ink-900); font-size: 13px; }
.history-stop-popup-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.history-stop-popup-metrics > div { min-width: 0; padding: 8px; border-radius: 9px; background: var(--surface-soft); }
.history-stop-popup-metrics span,.history-stop-popup-metrics strong { display: block; }
.history-stop-popup-metrics span { color: var(--ink-400); font-size: 7px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.history-stop-popup-metrics strong { overflow: hidden; margin-top: 3px; color: var(--ink-900); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.geofence-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.geofence-card { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: start; }
.geofence-card > .btn { grid-column: 1 / -1; }
.geofence-card h4 { margin: 8px 0 5px; }
.geofence-card p { margin: 0 0 5px; color: var(--ink-600); font-size: 10px; }
.geofence-card small { color: var(--ink-400); font-size: 9px; }
.geofence-radius-visual { width: 78px; height: 78px; display: grid; place-items: center; align-content: center; gap: 3px; border: 2px dashed rgba(22,130,93,.55); border-radius: 50%; color: var(--green-600); background: rgba(22,130,93,.07); }
.geofence-radius-visual.is-school { border-color: rgba(23,34,53,.5); color: var(--ink-900); background: rgba(23,34,53,.06); }
.geofence-radius-visual .icon { width: 20px; height: 20px; }
.geofence-radius-visual span { font-size: 10px; font-weight: 850; }
.language-switcher { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-500); font-size: 9px; font-weight: 800; white-space: nowrap; }
.language-switcher select { min-height: 38px; width: auto; padding: 7px 28px 7px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-900); background: #fff; font-size: 10px; font-weight: 750; }
.auth-language { position: absolute; z-index: 4; top: 20px; right: 24px; }
.management-toolbar { display: flex; flex-wrap: wrap; gap: 9px; }
.management-section + .management-section { margin-top: 18px; }
.management-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.management-table .data-table td:last-child { min-width: 145px; }
.danger-zone-note { margin-top: 14px; padding: 11px 13px; border: 1px solid #ffd2d7; border-radius: 11px; color: #8d2730; background: #fff3f4; font-size: 10px; line-height: 1.5; }

html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .sidebar { left: auto; right: 0; }
html[dir="rtl"] .app-workspace { margin-left: 0; margin-right: var(--sidebar-width); }
html[dir="rtl"] .auth-language { right: auto; left: 24px; }
html[dir="rtl"] .sidebar-logout, html[dir="rtl"] .nav-badge { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .input-wrap > .icon, html[dir="rtl"] .global-search .icon, html[dir="rtl"] .search-box .icon { left: auto; right: 12px; }
html[dir="rtl"] .input-wrap input, html[dir="rtl"] .input-wrap select { padding-left: 13px; padding-right: 41px; }
html[dir="rtl"] .global-search input, html[dir="rtl"] .search-box input { padding-left: 13px; padding-right: 40px; }
html[dir="rtl"] .entity-card::before { left: auto; right: 0; }
html[dir="rtl"] .alert-card { border-left: 1px solid var(--line); border-right: 4px solid var(--cyan-500); }
html[dir="rtl"] .inline-warning { border-left: 0; border-right: 3px solid var(--amber-600); }
html[dir="rtl"] .contact-item { border-left: 0; border-right: 3px solid transparent; text-align: right; }
html[dir="rtl"] .chat-details { border-left: 0; border-right: 1px solid var(--line); }
html[dir="rtl"] .form-actions, html[dir="rtl"] .page-actions { direction: rtl; }

@media (max-width: 1100px) {
  .planner-stop-fields-four { grid-template-columns: repeat(2,minmax(90px,1fr)); grid-column: 2 / -1; }
  .geofence-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .planner-stop-fields-four, .geofence-grid { grid-template-columns: 1fr; }
  .manifest-student { grid-template-columns: auto auto 1fr; }
  .manifest-student > .badge { grid-column: 2 / -1; justify-self: start; }
  .history-map, .geofence-map { min-height: 360px; }
  .history-ride-selector { grid-template-columns: 1fr; }
  .history-playback-controls { grid-template-columns: 1fr 70px; }
  .history-playback-controls input[type="range"] { grid-column: 1 / -1; grid-row: 1; }
  .history-playback-reading { text-align: left; }
  .history-stop-item { grid-template-columns: 34px minmax(0,1fr); }
  .history-dwell { grid-column: 2; text-align: left; }
  .language-switcher > span { display: none; }
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--surface-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.is-hidden { display: none !important; }
.muted { color: var(--ink-500); }
.text-red { color: var(--red-600); }
.text-green { color: var(--green-600); }
.text-amber { color: var(--amber-600); }
.text-blue { color: var(--blue-600); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(540px, 1.12fr) minmax(430px, .88fr);
  background: var(--surface);
}
.auth-showcase {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 42px 54px 34px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 20%, rgba(20,184,212,.24), transparent 24%),
    radial-gradient(circle at 18% 75%, rgba(237,43,56,.23), transparent 28%),
    linear-gradient(145deg, var(--navy-950), var(--navy-900) 55%, #20334c);
}
.auth-showcase::before,
.auth-showcase::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 50%;
  pointer-events: none;
}
.auth-showcase::before { width: 460px; height: 460px; top: -240px; right: -160px; }
.auth-showcase::after { width: 310px; height: 310px; bottom: -150px; left: -90px; }
.brand-row, .mobile-brand, .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--red-500), #bd1220);
  box-shadow: 0 10px 26px rgba(223,31,45,.32);
}
.brand-mark .icon { width: 25px; height: 25px; stroke-width: 2; }
.brand-row strong, .sidebar-brand strong { display: block; font-size: 20px; letter-spacing: -.35px; }
.brand-row span, .sidebar-brand span { display: block; margin-top: 2px; font-size: 11px; color: rgba(255,255,255,.62); }
.showcase-copy {
  position: relative;
  z-index: 2;
  width: min(650px, 94%);
  margin-top: clamp(68px, 11vh, 122px);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  font-weight: 800;
  color: #8ee9f7;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--cyan-500); border-radius: 3px; }
.showcase-copy h1 {
  margin: 17px 0 18px;
  max-width: 620px;
  font-size: clamp(42px, 5vw, 66px);
  line-height: 1.02;
  letter-spacing: -.045em;
}
.showcase-copy p {
  max-width: 600px;
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 17px;
  line-height: 1.75;
}
.showcase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.showcase-actions span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
}
.showcase-actions .icon { width: 16px; height: 16px; color: #8ee9f7; }
.route-illustration {
  position: relative;
  z-index: 2;
  height: 170px;
  margin-top: auto;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 26px;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    rgba(255,255,255,.045);
  background-size: 26px 26px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), 0 30px 70px rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
}
.route-road {
  position: absolute;
  left: 8%;
  right: 9%;
  top: 83px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red-500) 0 54%, rgba(255,255,255,.22) 54% 100%);
  box-shadow: 0 0 0 6px rgba(255,255,255,.025);
}
.route-node { position: absolute; top: 66px; text-align: center; }
.route-node--a { left: 10%; }
.route-node--b { left: 48%; }
.route-node--c { right: 8%; }
.route-node span {
  display: block;
  width: 19px;
  height: 19px;
  margin: 0 auto 11px;
  border-radius: 50%;
  border: 5px solid var(--navy-900);
  background: #fff;
  box-shadow: 0 0 0 3px var(--cyan-500);
}
.route-node--a span { box-shadow: 0 0 0 3px var(--red-500); }
.route-node small { font-weight: 700; color: rgba(255,255,255,.72); }
.moving-bus {
  position: absolute;
  left: 51.5%;
  top: 53px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--red-500);
  box-shadow: 0 10px 24px rgba(237,43,56,.38);
  animation: busPulse 2.2s ease-in-out infinite;
}
.moving-bus::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(237,43,56,.45);
  border-radius: 18px;
  animation: ringPulse 2.2s ease-out infinite;
}
.map-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  background: rgba(17,26,42,.78);
  box-shadow: 0 12px 28px rgba(0,0,0,.2);
  backdrop-filter: blur(12px);
}
.map-card--eta { top: 15px; right: 4%; flex-direction: column; align-items: flex-start; gap: 0; }
.map-card--eta strong { font-size: 18px; }
.map-card--eta span { font-size: 10px; color: rgba(255,255,255,.58); }
.map-card--safe { bottom: 12px; left: 4%; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.8); }
.map-card--safe .icon { width: 16px; color: #76e0bd; }
.showcase-metrics {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.showcase-metrics div { padding: 10px 0; }
.showcase-metrics strong { display: block; font-size: 18px; }
.showcase-metrics span { display: block; margin-top: 3px; font-size: 11px; color: rgba(255,255,255,.55); }
@keyframes busPulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes ringPulse { 0% { opacity: .7; transform: scale(.86); } 70%,100% { opacity: 0; transform: scale(1.25); } }

.auth-panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px clamp(28px, 6vw, 88px);
  background:
    radial-gradient(circle at 100% 0%, rgba(20,184,212,.08), transparent 28%),
    linear-gradient(180deg, #fff, #fbfcfe);
}
.mobile-brand { display: none; color: var(--navy-900); margin-bottom: 28px; align-self: flex-start; }
.auth-card { width: min(490px, 100%); }
.auth-card-head { margin-bottom: 28px; }
.auth-card-head h2 { margin: 0; font-size: 34px; letter-spacing: -.04em; color: var(--navy-900); }
.auth-card-head p { margin: 10px 0 0; color: var(--ink-500); line-height: 1.6; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin-bottom: 26px;
  border-radius: 14px;
  background: var(--surface-tint);
}
.auth-tab {
  border: 0;
  padding: 11px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-500);
  font-weight: 750;
}
.auth-tab.is-active { background: #fff; color: var(--navy-900); box-shadow: var(--shadow-sm); }
.auth-footer { margin: 25px 0 0; font-size: 11px; color: var(--ink-400); text-align: center; }
.demo-box {
  margin-top: 20px;
  padding: 14px;
  border: 1px dashed #cfd6e0;
  border-radius: 13px;
  background: #fafbfd;
}
.demo-box-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.demo-box-head strong { font-size: 12px; color: var(--ink-700); }
.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.demo-account {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-700);
}
.demo-account:hover { border-color: #b8c2cf; transform: translateY(-1px); }
.demo-account strong { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.demo-account span { font-size: 11px; color: var(--ink-500); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12px; font-weight: 750; color: var(--ink-700); }
.form-field label .required { color: var(--red-500); margin-left: 2px; }
.input-wrap { position: relative; }
.input-wrap > .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--ink-400);
  pointer-events: none;
}
.input-wrap input, .input-wrap select { padding-left: 41px; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #dce1e8;
  border-radius: 11px;
  background: #fff;
  color: var(--ink-900);
  padding: 11px 13px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { min-height: 92px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a1aabb; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan-500); box-shadow: 0 0 0 4px rgba(20,184,212,.12); }
input:disabled, select:disabled { background: #f3f5f8; color: var(--ink-400); cursor: not-allowed; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 800;
  padding: 8px;
}
.help-text { font-size: 11px; line-height: 1.5; color: var(--ink-500); }
.error-text { min-height: 16px; margin-top: -2px; font-size: 11px; color: var(--red-600); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-actions.split { justify-content: space-between; }
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 16px;
  font-weight: 780;
  font-size: 13px;
  transition: transform .17s ease, box-shadow .17s ease, background .17s ease, border-color .17s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--red-500), #ca1624); box-shadow: 0 10px 22px rgba(223,31,45,.22); }
.btn-primary:hover { box-shadow: 0 13px 28px rgba(223,31,45,.28); }
.btn-secondary { color: var(--navy-900); background: #fff; border-color: #d8dee7; }
.btn-secondary:hover { border-color: #b8c2cf; box-shadow: var(--shadow-sm); }
.btn-soft { color: var(--blue-600); background: var(--blue-100); }
.btn-ghost { color: var(--ink-700); background: transparent; }
.btn-ghost:hover { background: var(--surface-tint); }
.btn-danger-soft { color: var(--red-600); background: var(--red-100); }
.btn-success { color: #fff; background: var(--green-600); }
.btn-sm { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: 11px; }
.btn-block { width: 100%; }
.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-700);
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.icon-button:hover { color: var(--red-600); border-color: #d5dce6; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.link-button { border: 0; background: transparent; color: var(--red-600); padding: 0; font-weight: 750; }
.role-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.role-card {
  position: relative;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.role-card:hover { transform: translateY(-3px); border-color: rgba(20,184,212,.55); box-shadow: var(--shadow-md); }
.role-card .role-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--red-600); background: var(--red-100); }
.role-card:nth-child(2) .role-icon { color: var(--blue-600); background: var(--blue-100); }
.role-card:nth-child(3) .role-icon { color: var(--green-600); background: var(--green-100); }
.role-card strong { font-size: 14px; }
.role-card span { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-500); line-height: 1.45; }
.role-card .icon-arrow { position: absolute; top: 15px; right: 15px; color: var(--ink-400); }
.auth-stepper { display: flex; align-items: center; gap: 8px; margin: -8px 0 22px; }
.step-dot { height: 5px; flex: 1; border-radius: 999px; background: #e5e9ef; }
.step-dot.is-active { background: var(--red-500); }
.registration-scroll { max-height: min(650px, calc(100vh - 230px)); padding-right: 5px; overflow: auto; scrollbar-width: thin; }
.section-label { display: flex; align-items: center; gap: 9px; margin: 20px 0 12px; padding-top: 4px; color: var(--navy-900); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.section-label:first-child { margin-top: 0; }
.section-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.upload-card {
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px;
  border: 1px dashed #cbd3df;
  border-radius: 14px;
  background: #fafbfd;
}
.upload-preview {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, #e9edf3, #f6f8fb);
  color: var(--ink-400);
}
.upload-preview.round { border-radius: 50%; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-copy { min-width: 0; }
.upload-copy strong { display: block; font-size: 12px; }
.upload-copy span { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-500); }
.upload-copy input { display: none; }
.upload-copy .btn { margin-top: 10px; }
.map-picker {
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
}
.map-frame { position: relative; height: 190px; background: #eaf0f4; }
.osm-picker-map { width: 100%; height: 230px; }
.map-frame.leaflet-container, .osm-route-map.leaflet-container { font-family: inherit; background: #eaf0f4; }
.leaflet-container img.leaflet-tile,.leaflet-container img.leaflet-marker-icon,.leaflet-container img.leaflet-marker-shadow { max-width: none !important; max-height: none !important; }
.leaflet-control-attribution { font-size: 9px; }
.leaflet-popup-content { color: var(--ink-700); font: 11px/1.45 inherit; }
.leaflet-popup-content strong { color: var(--ink-900); font-size: 12px; }
.map-unavailable { min-height: 100%; display: grid; place-items: center; padding: 28px; color: var(--ink-500); background: #eef3f5; text-align: center; font-size: 11px; line-height: 1.5; }
.map-overlay-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17,26,42,.78);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 750;
}
.coordinate-entry { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: #fafbfd; }
.coordinate-entry label span { display: block; margin-bottom: 5px; color: var(--ink-500); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.coordinate-entry input { height: 36px; padding: 8px 10px; font-size: 11px; }
.map-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.map-coords { font-size: 10px; color: var(--ink-500); }

.osm-route-map-shell { position: relative; overflow: hidden; min-height: 430px; background: #e9eff1; }
.osm-route-map-shell.is-compact { min-height: 320px; }
.osm-route-map { width: 100%; height: 430px; }
.osm-route-map-shell.is-compact .osm-route-map { height: 320px; }
.idle-map-status { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--white, #fff); }
.idle-map-lock { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--blue-600); background: rgba(32,98,184,.1); }
.idle-map-lock svg { width: 17px; height: 17px; }
.idle-map-status strong,.idle-map-status small { display: block; }
.idle-map-status strong { color: var(--ink-900); font-size: 11px; }
.idle-map-status small { margin-top: 2px; color: var(--ink-500); font-size: 9px; line-height: 1.45; }
.legend-neutral { background: #98a5b5; }
.gps-map-status { position: absolute; top: 16px; right: 16px; z-index: 700; display: flex; align-items: center; gap: 9px; max-width: min(280px,calc(100% - 90px)); padding: 10px 12px; border: 1px solid rgba(255,255,255,.75); border-radius: 13px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-md); backdrop-filter: blur(12px); pointer-events: none; }
.gps-map-status strong,.gps-map-status small { display: block; }
.gps-map-status strong { font-size: 11px; }
.gps-map-status small { margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.gps-pulse { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #98a5b5; box-shadow: 0 0 0 5px rgba(152,165,181,.16); }
.gps-live .gps-pulse { background: var(--green-600); box-shadow: 0 0 0 5px rgba(24,135,90,.16); animation: ringPulse 1.8s ease-out infinite; }
.gps-delayed .gps-pulse { background: var(--amber-600); box-shadow: 0 0 0 5px rgba(205,138,10,.15); }
.gps-offline .gps-pulse { background: var(--red-500); box-shadow: 0 0 0 5px rgba(223,31,45,.13); }
.osm-map-legend { position: absolute; left: 12px; bottom: 28px; z-index: 700; display: flex; flex-wrap: wrap; gap: 9px; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-sm); color: var(--ink-600); font-size: 9px; pointer-events: none; }
.osm-map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.osm-map-legend i { width: 9px; height: 9px; display: inline-block; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(23,34,53,.18); }
.legend-bus { background: var(--red-500); }.legend-home { background: var(--green-600); }.legend-school { background: var(--navy-900); }
.schooltrack-bus-map-icon { overflow: visible !important; background: transparent; border: 0; }
.vehicle-marker-pro { position: relative; width: 72px; height: 82px; display: grid; justify-items: center; align-content: start; filter: drop-shadow(0 11px 12px rgba(15,25,40,.25)); }
.vehicle-marker-pulse { position: absolute; top: 11px; width: 48px; height: 48px; border: 2px solid rgba(223,31,45,.35); border-radius: 50%; background: rgba(223,31,45,.12); }
.vehicle-marker-pro.is-live .vehicle-marker-pulse { animation: vehiclePulse 2s ease-out infinite; }
.vehicle-marker-direction { position: absolute; z-index: 3; top: -4px; color: var(--navy-900); font-size: 13px; line-height: 1; text-shadow: 0 1px 2px #fff; transform: rotate(var(--vehicle-heading)); transform-origin: 50% 27px; }
.vehicle-marker-shell { position: relative; z-index: 2; width: 48px; height: 48px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 17px 17px 20px 20px; color: #fff; background: linear-gradient(145deg,#ff4854 0%,var(--red-500) 52%,#a90d1a 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,.28),0 8px 22px rgba(223,31,45,.38); }
.vehicle-marker-shell::after { content: ''; position: absolute; right: 6px; bottom: 4px; left: 6px; height: 3px; border-radius: 4px; background: rgba(255,255,255,.72); }
.vehicle-marker-shell .icon { width: 25px; height: 25px; }
.vehicle-marker-speed { position: relative; z-index: 4; min-width: 48px; margin-top: -2px; padding: 3px 7px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: var(--navy-900); box-shadow: 0 4px 10px rgba(15,25,40,.22); font-size: 8px; font-weight: 900; line-height: 1.1; text-align: center; white-space: nowrap; }
.vehicle-marker-pro.is-offline { filter: grayscale(.3) drop-shadow(0 8px 9px rgba(15,25,40,.2)); opacity: .86; }
.vehicle-marker-pro.is-offline .vehicle-marker-pulse { display: none; }
.vehicle-marker-pro.is-playback .vehicle-marker-shell { background: linear-gradient(145deg,#3185ff,#1751af); box-shadow: inset 0 2px 0 rgba(255,255,255,.28),0 8px 22px rgba(36,105,205,.34); }
@keyframes vehiclePulse { 0% { transform: scale(.7); opacity: .9; } 75%,100% { transform: scale(1.45); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vehicle-marker-pro.is-live .vehicle-marker-pulse { animation: none; } }
.driver-route-selector { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,420px); align-items: center; gap: 24px; padding: 22px; border: 1px solid rgba(32,98,184,.2); background: linear-gradient(135deg,#fff 0%,#f5f9ff 100%); }
.driver-route-selector-copy h4 { margin: 4px 0 5px; font-size: 17px; }
.driver-route-selector-copy p { margin: 0; color: var(--ink-500); font-size: 11px; line-height: 1.55; }
.driver-route-select-control label { display: block; margin-bottom: 7px; color: var(--ink-500); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.driver-map-locked { min-height: 330px; display: grid; place-items: center; border: 1px dashed #c7d3df; background: radial-gradient(circle at 50% 30%,#fff 0%,#f5f8fb 72%); }
.route-permission-card { overflow: hidden; }
.route-permission-list { display: grid; gap: 0; }
.route-permission-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.route-permission-row:last-child { border-bottom: 0; }
.route-permission-row > span { display: flex; align-items: center; gap: 11px; }
.route-permission-row strong,.route-permission-row small { display: block; }
.route-permission-row small { margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.route-permission-row small span + span::before { content: ' · '; }
.route-permission-toggle { justify-content: flex-end; }
@media (max-width:760px) { .driver-route-selector { grid-template-columns: 1fr; } .route-permission-row { align-items: flex-start; } .route-permission-toggle { flex-direction: column-reverse; align-items: flex-end !important; } }
.schooltrack-map-label.leaflet-tooltip { padding: 4px 8px; border: 1px solid rgba(255,255,255,.9); border-radius: 8px; color: #fff; background: rgba(23,34,53,.9); box-shadow: 0 5px 16px rgba(23,34,53,.2); cursor: pointer; font-size: 9px; font-weight: 850; pointer-events: auto; white-space: nowrap; }
.schooltrack-map-label.leaflet-tooltip::before { border-top-color: rgba(23,34,53,.9); }
.schooltrack-map-label.is-home.leaflet-tooltip { background: rgba(22,130,93,.92); }
.schooltrack-map-label.is-home.leaflet-tooltip::before { border-top-color: rgba(22,130,93,.92); }
.schooltrack-map-label.is-driver.leaflet-tooltip { background: rgba(223,31,45,.94); }
.schooltrack-map-label.is-driver.leaflet-tooltip::before { border-bottom-color: rgba(223,31,45,.94); border-top-color: transparent; }
.ride-map-status { position: absolute; left: 52px; top: 14px; z-index: 700; display: grid; gap: 2px; max-width: min(300px,calc(100% - 140px)); padding: 9px 12px; border: 1px solid rgba(255,255,255,.8); border-radius: 12px; color: var(--ink-700); background: rgba(255,255,255,.94); box-shadow: var(--shadow-md); backdrop-filter: blur(12px); pointer-events: none; }
.ride-map-status span { color: var(--ink-400); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.ride-map-status strong { font-size: 11px; }
.ride-map-status small { color: var(--ink-500); font-size: 9px; }
.ride-map-status.is-in_progress { border-left: 4px solid var(--green-600); }
.ride-map-status.is-arrived_school,.ride-map-status.is-completed { border-left: 4px solid var(--blue-600); }
.ride-map-status.is-cancelled { border-left: 4px solid var(--red-500); }
.map-popup-card { min-width: 250px; display: grid; gap: 10px; }
.map-popup-head,.map-popup-child { display: flex; align-items: center; gap: 10px; }
.map-popup-head > div:last-child,.map-popup-child > div:last-child { min-width: 0; }
.map-popup-head span,.map-popup-child span { display: block; color: var(--ink-400); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.map-popup-head strong,.map-popup-child strong { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-900); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.map-popup-head small,.map-popup-child small { display: block; margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.map-popup-child { padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.map-popup-avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 13px; color: #fff; background: var(--blue-600); font-size: 11px; font-weight: 900; }
.map-popup-avatar.is-school { background: var(--navy-900); }
.map-popup-avatar img { width: 100%; height: 100%; object-fit: cover; }
.map-popup-child .map-popup-avatar { width: 34px; height: 34px; border-radius: 10px; }
.map-popup-list { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.map-popup-list span { display: flex; align-items: center; gap: 6px; color: var(--ink-600); font-size: 9px; }
.map-popup-list .icon { width: 13px; height: 13px; color: var(--blue-600); }
.map-popup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.map-popup-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-700); background: #fff; font-size: 9px; font-weight: 800; text-decoration: none; }
.map-popup-actions a:last-child { color: #087a47; border-color: #bde7d2; background: #eefaf4; }
.map-popup-actions .icon { width: 13px; height: 13px; }
.map-popup-actions.is-contact-pin { grid-template-columns: minmax(0, 1fr); }
.map-popup-actions.is-contact-pin .parent-contact-actions { display: block; margin: 0; }
.map-popup-actions.is-contact-pin .btn-contact-pin { width: 100%; justify-content: center; }
.map-popup-muted { color: var(--ink-400); font-size: 9px; }
.map-popup-speed { display: flex; align-items: end; gap: 6px; padding: 9px 10px; border-radius: 10px; color: #fff; background: linear-gradient(135deg,var(--red-500),#b81221); }
.map-popup-speed strong { color: #fff !important; font-size: 22px !important; line-height: 1; }
.map-popup-speed span { font-size: 9px; font-weight: 750; }
.gps-control-card,.gps-viewer-card { display: grid; gap: 12px; }
.gps-control-head { display: flex; align-items: center; gap: 10px; }
.gps-control-head > div:last-child { min-width: 0; }
.gps-control-head strong { display: block; margin-bottom: 5px; font-size: 12px; }
.gps-control-card p,.gps-viewer-card p { margin: 0; color: var(--ink-600); font-size: 10px; line-height: 1.55; }
.gps-control-card > small { color: var(--ink-500); font-size: 9px; line-height: 1.5; }
.inline-warning { padding: 9px 10px; border-left: 3px solid var(--amber-600); border-radius: 8px; color: #76530d; background: var(--amber-100); font-size: 9px; line-height: 1.45; }

/* App shell */
.app-shell { min-height: 100vh; background: var(--surface-soft); }
.sidebar {
  position: fixed;
  z-index: 50;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 0% 0%, rgba(20,184,212,.13), transparent 26%),
    linear-gradient(180deg, var(--navy-950), var(--navy-900));
  box-shadow: 10px 0 30px rgba(15, 23, 38, .09);
  transition: transform .25s ease;
}
.sidebar-brand { min-height: var(--topbar-height); padding: 17px 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-brand .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
.sidebar-brand strong { font-size: 18px; }
.sidebar-nav { flex: 1; padding: 18px 12px; overflow-y: auto; }
.nav-section-label { margin: 12px 11px 8px; color: rgba(255,255,255,.35); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  margin: 3px 0;
  border: 0;
  border-radius: 11px;
  color: rgba(255,255,255,.67);
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 680;
  transition: color .18s, background .18s, transform .18s;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-item.is-active { color: #fff; background: linear-gradient(90deg, rgba(237,43,56,.98), rgba(223,31,45,.82)); box-shadow: 0 9px 22px rgba(223,31,45,.2); }
.nav-item .icon { width: 19px; height: 19px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; font-size: 9px; }
.nav-item.is-active .nav-badge { background: rgba(255,255,255,.22); }
.sidebar-profile {
  margin: 10px 12px 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}
.profile-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.profile-row .avatar { flex: 0 0 auto; }
.profile-meta { min-width: 0; flex: 1; }
.profile-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.profile-meta span { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; color: rgba(255,255,255,.45); text-transform: capitalize; }
.sidebar-logout { width: 32px; height: 32px; border: 0; border-radius: 9px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.65); }
.sidebar-logout:hover { color: #fff; background: rgba(237,43,56,.22); }
.sidebar-logout .icon { width: 16px; height: 16px; }
.sidebar-overlay { display: none; position: fixed; z-index: 45; inset: 0; background: rgba(11,18,30,.52); backdrop-filter: blur(2px); }
/* Contain map panes, controls and fullscreen layers below the shared navigation drawer. */
.app-workspace { position: relative; z-index: 0; isolation: isolate; min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 30px;
  border-bottom: 1px solid rgba(222,227,234,.8);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-left h2 { margin: 2px 0 0; font-size: 21px; letter-spacing: -.025em; color: var(--navy-900); }
.breadcrumb { font-size: 10px; font-weight: 700; color: var(--ink-400); text-transform: uppercase; letter-spacing: .07em; }
.menu-button { display: none; }
.global-search { position: relative; width: min(330px, 29vw); }
.global-search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--ink-400); }
.global-search input { min-height: 42px; padding-left: 40px; border-color: transparent; background: var(--surface-soft); }
.notification-button { border-color: transparent; background: var(--surface-soft); }
.notification-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--red-500);
  font-size: 8px;
  font-weight: 900;
}
.top-profile { display: flex; align-items: center; gap: 9px; padding-left: 4px; }
.top-profile .profile-meta strong { color: var(--ink-900); }
.top-profile .profile-meta span { color: var(--ink-500); }
.view-root { max-width: 1600px; margin: 0 auto; padding: 26px 30px 50px; outline: none; }

/* Shared app UI */
.avatar {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #526278, #28374d);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 10px; }
.avatar.lg { width: 58px; height: 58px; font-size: 16px; }
.avatar.xl { width: 86px; height: 86px; font-size: 22px; }
.avatar.school { border-radius: 13px; background: linear-gradient(145deg, var(--blue-600), #17408d); }
.status-dot { position: absolute; right: 1px; bottom: 1px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: #21b67a; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h3 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.page-head p { margin: 7px 0 0; color: var(--ink-500); line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(20,30,45,.02);
}
.card.pad { padding: 20px; }
.card-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
}
.card-header h4 { margin: 0; font-size: 15px; color: var(--navy-900); }
.card-header p { margin: 3px 0 0; font-size: 11px; color: var(--ink-500); }
.card-body { padding: 19px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .8fr); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.welcome-card {
  position: relative;
  overflow: hidden;
  min-height: 184px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 26px 28px;
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(20,184,212,.35), transparent 24%),
    linear-gradient(135deg, var(--navy-900), #233b5b);
  box-shadow: var(--shadow-md);
}
.welcome-card::after { content: ""; position: absolute; width: 190px; height: 190px; right: -60px; bottom: -100px; border: 30px solid rgba(255,255,255,.05); border-radius: 50%; }
.welcome-copy { position: relative; z-index: 2; max-width: 650px; }
.welcome-copy .eyebrow { color: #8ee9f7; }
.welcome-copy h3 { margin: 10px 0 9px; font-size: 28px; letter-spacing: -.035em; }
.welcome-copy p { max-width: 580px; margin: 0; color: rgba(255,255,255,.66); line-height: 1.6; }
.welcome-actions { display: flex; gap: 10px; margin-top: 19px; flex-wrap: wrap; }
.welcome-actions .btn-secondary { border-color: rgba(255,255,255,.16); color: #fff; background: rgba(255,255,255,.09); }
.welcome-visual { position: relative; z-index: 2; width: 170px; height: 120px; flex: 0 0 auto; }
.welcome-visual .big-bus { position: absolute; right: 8px; bottom: 4px; width: 92px; height: 92px; display: grid; place-items: center; border-radius: 28px; color: #fff; background: linear-gradient(145deg, var(--red-500), #c51422); box-shadow: 0 20px 38px rgba(0,0,0,.23); transform: rotate(-4deg); }
.welcome-visual .big-bus .icon { width: 51px; height: 51px; }
.welcome-visual .mini-pin { position: absolute; left: 2px; top: 5px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: var(--cyan-500); background: rgba(255,255,255,.1); backdrop-filter: blur(10px); }
.stat-card { padding: 18px; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--red-600); background: var(--red-100); }
.stat-card:nth-child(2) .stat-icon { color: var(--blue-600); background: var(--blue-100); }
.stat-card:nth-child(3) .stat-icon { color: var(--green-600); background: var(--green-100); }
.stat-card:nth-child(4) .stat-icon { color: var(--amber-600); background: var(--amber-100); }
.stat-trend { font-size: 10px; font-weight: 800; color: var(--green-600); }
.stat-value { margin-top: 15px; font-size: 28px; font-weight: 850; letter-spacing: -.04em; }
.stat-label { margin-top: 3px; font-size: 11px; color: var(--ink-500); }
.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.quick-action {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-align: left;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.quick-action:hover { transform: translateY(-2px); border-color: #c8d1dd; box-shadow: var(--shadow-sm); }
.quick-action .icon-box { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--red-600); background: var(--red-100); }
.quick-action strong { font-size: 11px; }
.quick-action span { display: block; margin-top: 2px; font-size: 9px; color: var(--ink-500); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; }
.badge-success { color: var(--green-600); background: var(--green-100); }
.badge-pending { color: var(--amber-600); background: var(--amber-100); }
.badge-danger { color: var(--red-600); background: var(--red-100); }
.badge-info { color: var(--blue-600); background: var(--blue-100); }
.badge-neutral { color: var(--ink-700); background: var(--surface-tint); }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { padding: 11px 13px; border-bottom: 1px solid var(--line); background: #fafbfd; color: var(--ink-500); font-size: 9px; font-weight: 850; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
.data-table td { padding: 13px; border-bottom: 1px solid var(--line); color: var(--ink-700); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfe; }
.table-entity { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.table-entity strong { display: block; color: var(--ink-900); font-size: 12px; }
.table-entity span { display: block; margin-top: 2px; color: var(--ink-500); font-size: 10px; }
.empty-state { display: grid; place-items: center; min-height: 270px; padding: 32px; text-align: center; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 20px; color: var(--red-600); background: var(--red-100); }
.empty-icon .icon { width: 30px; height: 30px; }
.empty-state h4 { margin: 0; font-size: 17px; }
.empty-state p { max-width: 390px; margin: 8px auto 18px; color: var(--ink-500); line-height: 1.55; }

/* Route / tracking */
.tracking-card { overflow: hidden; }
.route-map-viewport { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.tracking-map {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.63), rgba(255,255,255,.63)),
    radial-gradient(circle at 25% 22%, #cfe8d9 0 4%, transparent 4.5%),
    radial-gradient(circle at 74% 34%, #d7ecdb 0 5%, transparent 5.5%),
    linear-gradient(32deg, transparent 46%, #dbe4ec 47% 49%, transparent 50%),
    linear-gradient(-25deg, transparent 44%, #dbe4ec 45% 47%, transparent 48%),
    #eef3f5;
}
.tracking-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(59,81,105,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(59,81,105,.06) 1px, transparent 1px);
  background-size: 38px 38px;
}
.track-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 52%;
  height: 8px;
  border-radius: 999px;
  background: #c9d2dc;
  transform: rotate(-5deg);
  box-shadow: 0 0 0 7px rgba(255,255,255,.8);
}
.track-line-progress { height: 100%; width: var(--progress, 44%); border-radius: inherit; background: linear-gradient(90deg, var(--red-500), #ff6370); transition: width .55s ease; }
.track-station { position: absolute; left: var(--station-left, 10%); top: calc(52% - 9px); transform: translate(-50%, -50%) rotate(5deg); text-align: center; }
.station-dot { width: 22px; height: 22px; margin: 0 auto; border: 5px solid #fff; border-radius: 50%; background: #aeb9c6; box-shadow: 0 0 0 2px #aeb9c6, 0 5px 12px rgba(0,0,0,.12); }
.track-station.is-complete .station-dot { background: var(--red-500); box-shadow: 0 0 0 2px var(--red-500), 0 5px 12px rgba(223,31,45,.2); }
.track-station.is-school .station-dot { width: 28px; height: 28px; background: var(--navy-900); box-shadow: 0 0 0 2px var(--navy-900); }
.station-label { width: 110px; margin: 12px 0 0 50%; transform: translateX(-50%); padding: 7px 8px; border: 1px solid rgba(218,224,232,.9); border-radius: 9px; background: rgba(255,255,255,.95); box-shadow: var(--shadow-sm); }
.station-label strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.station-label span { display: block; margin-top: 2px; color: var(--ink-500); font-size: 8px; }
.bus-marker {
  position: absolute;
  left: var(--bus-left, 45%);
  top: calc(52% - 4px);
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 16px;
  color: #fff;
  background: var(--red-500);
  box-shadow: 0 12px 24px rgba(223,31,45,.32);
  transform: translate(-50%, -50%) rotate(5deg);
  transition: left .55s ease;
  z-index: 4;
}
.bus-marker::after { content: ""; position: absolute; inset: -12px; border: 1px solid rgba(223,31,45,.35); border-radius: 22px; animation: ringPulse 2.1s ease-out infinite; }
.bus-marker .icon { width: 25px; height: 25px; }
.map-info-panel { position: absolute; top: 18px; left: 18px; min-width: 220px; padding: 15px; border: 1px solid rgba(255,255,255,.7); border-radius: 15px; background: rgba(255,255,255,.9); box-shadow: var(--shadow-md); backdrop-filter: blur(14px); }
.map-info-panel .route-title { display: flex; align-items: center; gap: 10px; }
.map-info-panel h4 { margin: 0; font-size: 14px; }
.map-info-panel p { margin: 4px 0 0; color: var(--ink-500); font-size: 10px; }
.route-mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 13px; }
.route-mini-stats div { padding: 8px; border-radius: 9px; background: var(--surface-soft); }
.route-mini-stats strong { display: block; font-size: 12px; }
.route-mini-stats span { display: block; margin-top: 2px; font-size: 8px; color: var(--ink-500); }
.map-controls-floating { position: absolute; top: 18px; right: 18px; display: flex; gap: 8px; }
.alert-card { border-left: 4px solid var(--cyan-500); }
.alert-row { display: flex; align-items: center; gap: 14px; }
.alert-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; color: var(--blue-600); background: var(--blue-100); }
.alert-copy { flex: 1; min-width: 0; }
.alert-copy strong { display: block; font-size: 13px; }
.alert-copy span { display: block; margin-top: 3px; color: var(--ink-500); font-size: 11px; line-height: 1.5; }
.arrival-lead-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; color: var(--ink-700); font-size: 12px; font-weight: 750; }
.arrival-lead-control input { width: 82px; min-height: 38px; padding: 8px 10px; text-align: center; font-weight: 800; }
.alert-card > small, .profile-arrival-lead + small { display: block; margin-top: 8px; color: var(--ink-500); font-size: 10px; line-height: 1.45; }
.profile-arrival-lead { padding-top: 16px; border-top: 1px solid var(--line); }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cbd3dd; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: .2s; }
.switch input:checked + span { background: var(--green-600); }
.switch input:checked + span::after { transform: translateX(20px); }
.timeline-list { display: flex; flex-direction: column; }
.timeline-item { position: relative; display: grid; grid-template-columns: 34px 1fr auto; gap: 11px; padding: 0 0 18px; }
.timeline-item::before { content: ""; position: absolute; left: 16px; top: 27px; bottom: 0; width: 2px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 34px; height: 34px; display: grid; place-items: center; z-index: 1; border-radius: 50%; color: var(--ink-500); background: var(--surface-tint); }
.timeline-dot.done { color: var(--green-600); background: var(--green-100); }
.timeline-dot.active { color: var(--red-600); background: var(--red-100); box-shadow: 0 0 0 5px rgba(237,43,56,.08); }
.timeline-dot .icon { width: 15px; height: 15px; }
.timeline-copy strong { display: block; font-size: 12px; }
.timeline-copy span { display: block; margin-top: 4px; color: var(--ink-500); font-size: 10px; line-height: 1.5; }
.timeline-time { font-size: 10px; font-weight: 750; color: var(--ink-500); }
.form-help { margin: -4px 0 12px; color: var(--ink-500); font-size: 10px; line-height: 1.55; }
.planner-list { display: grid; gap: 9px; }
.planner-stop { display: grid; grid-template-columns: auto 28px 38px minmax(150px,1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .18s, background .18s; }
.planner-stop:has(input[type="checkbox"]:checked) { border-color: rgba(20,184,212,.55); background: #f8fdfe; }
.planner-stop > input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--red-500); }
.planner-stop-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--blue-600); background: var(--blue-100); font-size: 10px; font-weight: 850; }
.planner-stop-copy { min-width: 0; }
.planner-stop-copy strong, .planner-stop-copy small { display: block; }
.planner-stop-copy strong { font-size: 11px; }
.planner-stop-copy small { margin-top: 3px; overflow: hidden; color: var(--ink-500); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.planner-stop-fields { display: flex; gap: 7px; }
.planner-stop-fields input { width: 92px; height: 36px; padding: 7px 8px; font-size: 10px; }
.planner-stop-fields input[type="number"] { width: 58px; }
.planner-empty { padding: 18px; border: 1px dashed #cbd3df; border-radius: 12px; color: var(--ink-500); background: #fafbfd; font-size: 11px; text-align: center; }

/* Entities */
.entity-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; }
.entity-card { position: relative; overflow: hidden; padding: 18px; }
.entity-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red-500); }
.entity-card.school-card::before { background: var(--blue-600); }
.entity-card.driver-card::before { background: var(--green-600); }
.entity-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.entity-main { display: flex; gap: 12px; min-width: 0; }
.entity-main h4 { margin: 4px 0 0; font-size: 14px; }
.entity-main p { margin: 4px 0 0; color: var(--ink-500); font-size: 10px; }
.entity-info { display: grid; gap: 8px; margin-top: 17px; }
.info-line { display: flex; align-items: center; gap: 8px; color: var(--ink-700); font-size: 11px; }
.info-line .icon { width: 15px; height: 15px; color: var(--ink-400); }
.entity-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.assignment-change-warning { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 12px 14px; }
.assignment-change-warning .icon { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; }
.assignment-change-warning span { display: grid; gap: 3px; }
.assignment-change-warning strong { color: #5f4108; font-size: 10px; }
.child-detail-actions { padding-top: 4px; }
.rating-stars { display: inline-flex; gap: 1px; color: #f2ad1e; }
.rating-stars .icon { width: 13px; height: 13px; fill: currentColor; stroke-width: 1; }
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; flex-wrap: wrap; }
.filter-bar .search-box { position: relative; flex: 1; min-width: 230px; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--ink-400); }
.search-box input { padding-left: 38px; }
.filter-bar select { width: auto; min-width: 150px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface-tint); }
.segmented button { border: 0; padding: 8px 11px; border-radius: 8px; background: transparent; color: var(--ink-500); font-size: 10px; font-weight: 800; }
.segmented button.is-active { color: var(--navy-900); background: #fff; box-shadow: var(--shadow-sm); }

/* Chat */
.chat-shell { height: calc(100vh - 150px); min-height: 620px; display: grid; grid-template-columns: 300px minmax(0,1fr) 260px; overflow: hidden; }
.chat-sidebar { border-right: 1px solid var(--line); background: #fbfcfe; }
.chat-details { border-left: 1px solid var(--line); background: #fbfcfe; }
.chat-panel-head { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-panel-head h4 { margin: 0; font-size: 14px; }
.chat-search { padding: 12px; }
.contact-list { overflow-y: auto; height: calc(100% - 130px); }
.contact-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 0; border-left: 3px solid transparent; background: transparent; text-align: left; }
.contact-item:hover { background: #f3f6f9; }
.contact-item.is-active { border-left-color: var(--red-500); background: #fff; }
.contact-copy { min-width: 0; flex: 1; }
.contact-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.contact-copy span { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; color: var(--ink-500); }
.contact-time { align-self: flex-start; font-size: 8px; color: var(--ink-400); }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-conversation-head { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.chat-conversation-head .entity-main h4 { margin-top: 2px; }
.chat-contacts-button { display: none; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; border: 0; border-radius: 10px; color: var(--red-600); background: var(--red-100); }
.chat-sidebar [data-action="hide-chat-contacts"] { display: none; }
.chat-messages { flex: 1; overflow-y: auto; padding: 22px 20px; background: linear-gradient(rgba(255,255,255,.82),rgba(255,255,255,.82)), radial-gradient(circle at 8% 5%, #e7efff, transparent 25%), radial-gradient(circle at 90% 88%, #ffe7ea, transparent 24%); }
.message-row { display: flex; align-items: flex-end; gap: 8px; margin: 10px 0; }
.message-row.mine { justify-content: flex-end; }
.message-bubble { max-width: min(72%, 540px); padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; background: #fff; box-shadow: 0 3px 10px rgba(22,34,52,.04); }
.message-row.mine .message-bubble { border-color: transparent; border-radius: 14px 14px 4px 14px; color: #fff; background: var(--navy-900); }
.message-bubble p { margin: 0; font-size: 11px; line-height: 1.55; }
.message-bubble time { display: block; margin-top: 5px; font-size: 8px; color: var(--ink-400); text-align: right; }
.message-row.mine .message-bubble time { color: rgba(255,255,255,.5); }
.chat-composer { display: flex; align-items: flex-end; gap: 9px; padding: 13px 15px; border-top: 1px solid var(--line); background: #fff; }
.chat-composer textarea { min-height: 42px; max-height: 110px; resize: none; }
.chat-details-content { padding: 20px; text-align: center; }
.chat-details-content .avatar { margin: 0 auto; }
.chat-details-content h4 { margin: 12px 0 4px; }
.chat-details-content p { margin: 0; color: var(--ink-500); font-size: 10px; }
.chat-detail-list { display: grid; gap: 8px; margin-top: 22px; text-align: left; }
.chat-detail-item { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 10px; background: #fff; color: var(--ink-700); font-size: 10px; }
.chat-detail-item .icon { width: 15px; color: var(--ink-400); }

/* Notifications */
.notification-list { display: flex; flex-direction: column; }
.notification-item { display: grid; grid-template-columns: 45px minmax(0,1fr) auto; gap: 13px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.notification-item:last-child { border-bottom: 0; }
.notification-item.is-unread { background: #fbfdff; }
.notification-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--blue-600); background: var(--blue-100); }
.notification-item:nth-child(3n+2) .notification-icon { color: var(--red-600); background: var(--red-100); }
.notification-item:nth-child(3n+3) .notification-icon { color: var(--green-600); background: var(--green-100); }
.notification-copy h4 { margin: 1px 0 4px; font-size: 12px; }
.notification-copy p { margin: 0; color: var(--ink-500); font-size: 10px; line-height: 1.5; }
.notification-time { font-size: 9px; color: var(--ink-400); white-space: nowrap; }
.unread-dot { width: 7px; height: 7px; margin: 8px auto 0; border-radius: 50%; background: var(--red-500); }

/* Payments */
.balance-card { position: relative; overflow: hidden; padding: 24px; color: #fff; background: linear-gradient(135deg, var(--navy-900), #2c486c); }
.balance-card::after { content: ""; position: absolute; width: 210px; height: 210px; right: -80px; top: -105px; border: 35px solid rgba(255,255,255,.055); border-radius: 50%; }
.balance-card .label { color: rgba(255,255,255,.58); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.balance-card .amount { margin-top: 8px; font-size: 37px; font-weight: 850; letter-spacing: -.04em; }
.balance-card .amount small { font-size: 13px; color: rgba(255,255,255,.55); }
.balance-card .balance-meta { display: flex; gap: 25px; margin-top: 22px; }
.balance-card .balance-meta strong { display: block; font-size: 13px; }
.balance-card .balance-meta span { display: block; margin-top: 2px; font-size: 9px; color: rgba(255,255,255,.54); }
.payment-method { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.payment-card-icon { width: 42px; height: 32px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: linear-gradient(135deg, #1a56a5, #133769); }
.payment-method-copy { flex: 1; }
.payment-method-copy strong { display: block; font-size: 11px; }
.payment-method-copy span { display: block; margin-top: 2px; font-size: 9px; color: var(--ink-500); }
.invoice-card { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.invoice-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--red-600); background: var(--red-100); }
.invoice-copy { flex: 1; min-width: 0; }
.invoice-copy strong { display: block; font-size: 11px; }
.invoice-copy span { display: block; margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.invoice-amount { text-align: right; }
.invoice-amount strong { display: block; font-size: 12px; }
.invoice-amount span { display: block; margin-top: 3px; font-size: 9px; color: var(--ink-500); }

/* Modules */
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.module-card { position: relative; padding: 18px; overflow: hidden; }
.module-number { position: absolute; right: 13px; top: 9px; font-size: 36px; font-weight: 900; color: #edf0f4; }
.module-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--red-600); background: var(--red-100); }
.module-card:nth-child(3n+2) .module-icon { color: var(--blue-600); background: var(--blue-100); }
.module-card:nth-child(3n+3) .module-icon { color: var(--green-600); background: var(--green-100); }
.module-card h4 { position: relative; margin: 14px 0 7px; font-size: 13px; }
.module-card p { position: relative; margin: 0; color: var(--ink-500); font-size: 10px; line-height: 1.55; }
.module-status { position: relative; margin-top: 13px; }

/* Profile / settings */
.profile-layout { display: grid; grid-template-columns: 310px minmax(0,1fr); gap: 18px; }
.profile-card { padding: 24px; text-align: center; }
.profile-card .avatar { margin: 0 auto; }
.profile-card h3 { margin: 14px 0 4px; }
.profile-card p { margin: 0; color: var(--ink-500); font-size: 11px; text-transform: capitalize; }
.profile-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 20px; }
.profile-stats div { padding: 12px 8px; border-radius: 11px; background: var(--surface-soft); }
.profile-stats strong { display: block; font-size: 15px; }
.profile-stats span { display: block; margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.preference-list { display: flex; flex-direction: column; }
.preference-item { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.preference-item:last-child { border-bottom: 0; }
.preference-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; color: var(--blue-600); background: var(--blue-100); }
.preference-copy { flex: 1; }
.preference-copy strong { display: block; font-size: 11px; }
.preference-copy span { display: block; margin-top: 3px; color: var(--ink-500); font-size: 9px; line-height: 1.4; }

/* Modals and toasts */
.modal-backdrop { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(12,20,33,.58); backdrop-filter: blur(4px); animation: fadeIn .16s ease; }
.modal { width: min(680px, 100%); max-height: calc(100vh - 38px); overflow: hidden; border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); animation: modalIn .2s ease; }
.modal.wide { width: min(950px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head p { margin: 4px 0 0; color: var(--ink-500); font-size: 10px; }
.modal-body { max-height: calc(100vh - 175px); overflow-y: auto; padding: 20px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfe; }
.parent-contact-cell { display: grid; gap: 5px; min-width: 210px; }
.parent-contact-cell > span, .user-phone-cell > span { display: flex; align-items: center; gap: 5px; color: var(--ink-500); font-size: 10px; }
.parent-contact-cell > span .icon { width: 13px; height: 13px; }
.parent-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.parent-contact-actions.is-compact { gap: 5px; margin-top: 3px; }
.parent-contact-actions.is-compact .btn { min-height: 28px; padding: 5px 8px; font-size: 9px; }
.btn-contact-pin {
  gap: 7px;
  color: var(--blue-600);
  border-color: rgba(46,103,209,.22);
  background: linear-gradient(135deg, #fff, var(--blue-100));
  box-shadow: 0 5px 14px rgba(46,103,209,.08);
}
.btn-contact-pin:hover {
  color: #2455ae;
  border-color: rgba(46,103,209,.42);
  background: #f4f7ff;
  box-shadow: 0 8px 18px rgba(46,103,209,.14);
  transform: translateY(-1px);
}
.btn-contact-pin .icon { width: 14px; height: 14px; }
.contact-choice-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(135deg, #fff, var(--surface-soft));
}
.contact-choice-profile > div:last-child { min-width: 0; }
.contact-choice-profile strong,
.contact-choice-profile span { display: block; }
.contact-choice-profile strong { color: var(--ink-900); font-size: 13px; }
.contact-choice-profile span { margin-top: 4px; color: var(--ink-500); font-size: 10px; direction: ltr; unicode-bidi: embed; }
.contact-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.contact-choice {
  position: relative;
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 30px 13px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-700);
  background: #fff;
  box-shadow: 0 6px 18px rgba(26,39,61,.05);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.contact-choice > .icon:first-child {
  width: 38px;
  height: 38px;
  padding: 10px;
  border-radius: 11px;
  color: var(--blue-600);
  background: var(--blue-100);
}
.contact-choice > .icon:last-child {
  position: absolute;
  right: 11px;
  width: 14px;
  height: 14px;
  color: var(--ink-400);
}
html[dir="rtl"] .contact-choice { padding: 13px 13px 13px 30px; text-align: right; }
html[dir="rtl"] .contact-choice > .icon:last-child { right: auto; left: 11px; transform: scaleX(-1); }
.contact-choice span { min-width: 0; }
.contact-choice strong,
.contact-choice small { display: block; }
.contact-choice strong { color: var(--ink-900); font-size: 11px; }
.contact-choice small { margin-top: 4px; overflow: hidden; color: var(--ink-500); font-size: 8.5px; line-height: 1.35; text-overflow: ellipsis; }
.contact-choice:hover {
  border-color: rgba(46,103,209,.36);
  box-shadow: 0 12px 26px rgba(26,39,61,.1);
  transform: translateY(-2px);
}
.contact-choice:focus-visible { outline: 3px solid rgba(46,103,209,.2); outline-offset: 2px; }
.contact-choice.is-call > .icon:first-child { color: var(--blue-600); background: var(--blue-100); }
.contact-choice.is-whatsapp > .icon:first-child { color: var(--green-600); background: var(--green-100); }
.contact-choice.is-whatsapp:hover { border-color: rgba(25,138,99,.38); background: #fbfffd; }
.contact-choice.is-message > .icon:first-child { color: var(--red-600); background: var(--red-100); }
.contact-choice.is-message:hover { border-color: rgba(223,31,45,.32); background: #fffdfd; }
.contact-choice.is-disabled {
  color: var(--ink-400);
  background: var(--surface-soft);
  box-shadow: none;
  cursor: not-allowed;
  opacity: .65;
}
.contact-choice.is-disabled:hover { border-color: var(--line); box-shadow: none; transform: none; }
.contact-choice.is-disabled > .icon:first-child { color: var(--ink-400); background: var(--surface-tint); }
.btn-whatsapp { color: #fff; background: #16825d; border: 1px solid #16825d; text-decoration: none; }
.btn-whatsapp:hover { color: #fff; background: #116b4c; border-color: #116b4c; }
.user-phone-cell { display: grid; gap: 5px; min-width: 205px; }
.approval-driver-name { display: block; margin-top: 6px; }
.approval-row-actions { min-width: 235px; }
.approval-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.approval-profile-hero { display: flex; align-items: center; gap: 14px; }
.approval-profile-hero h4 { margin: 4px 0; font-size: 16px; }
.approval-profile-hero p { margin: 0; color: var(--ink-500); font-size: 11px; }
.approval-person-card .entity-info { margin-top: 16px; }
.approval-contact-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.approval-contact-block > strong { display: block; font-size: 11px; }
.approval-map-card { grid-column: 1 / -1; overflow: hidden; }
.approval-parent-map { height: 330px; border-radius: 0; }
.approval-address-strip { display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.approval-address-strip .icon { flex: 0 0 auto; color: var(--green-600); }
.approval-address-strip div { display: grid; gap: 3px; }
.approval-address-strip strong { font-size: 11px; }
.approval-address-strip span { color: var(--ink-500); font-size: 10px; }
.approval-school-card { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.approval-review-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.approval-review-footer > div:first-child { display: grid; gap: 4px; }
.approval-review-footer > div:first-child span { color: var(--ink-500); font-size: 10px; }
.approval-decision-actions { justify-content: flex-end; }
.notification-review { margin-top: 9px; }
.toast-host { position: fixed; z-index: 3000; right: 20px; top: 20px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { min-width: 290px; max-width: 420px; display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid rgba(255,255,255,.15); border-radius: 14px; color: #fff; background: rgba(23,34,53,.95); box-shadow: var(--shadow-md); backdrop-filter: blur(14px); animation: toastIn .24s ease; pointer-events: auto; }
.toast.success { background: rgba(25,138,99,.96); }
.toast.error { background: rgba(198,33,47,.96); }
.toast .toast-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: rgba(255,255,255,.12); }
.toast strong { display: block; font-size: 11px; }
.toast span { display: block; margin-top: 3px; font-size: 9px; color: rgba(255,255,255,.72); line-height: 1.45; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Responsive */
@media (max-width: 1180px) {
  .auth-shell { grid-template-columns: 1fr 1fr; }
  .auth-showcase { padding: 36px; }
  .showcase-copy h1 { font-size: 46px; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .module-grid { grid-template-columns: repeat(2,1fr); }
  .entity-grid { grid-template-columns: repeat(2,1fr); }
  .chat-shell { grid-template-columns: 260px minmax(0,1fr); }
  .chat-details { display: none; }
}
@media (max-width: 960px) {
  :root { --sidebar-width: 255px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-showcase { display: none; }
  .auth-panel { min-height: 100vh; padding: 34px 24px; }
  .mobile-brand { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-overlay.is-open { display: block; }
  .app-workspace { margin-left: 0; }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  html[dir="rtl"] .sidebar.is-open { transform: translateX(0); }
  html[dir="rtl"] .app-workspace { margin-right: 0; }
  .menu-button { display: inline-grid; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .global-search { width: 260px; }
}
@media (max-width: 760px) {
  .topbar { min-height: 70px; padding: 11px 15px; }
  .topbar-left h2 { font-size: 17px; }
  .breadcrumb { display: none; }
  .global-search { display: none; }
  .top-profile .profile-meta { display: none; }
  .view-root { padding: 18px 15px 35px; }
  .page-head { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .grid-2, .grid-3, .grid-4, .grid-5, .entity-grid, .module-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .role-picker { grid-template-columns: 1fr; }
  .role-card { min-height: 100px; flex-direction: row; align-items: center; justify-content: flex-start; }
  .role-card > div:nth-child(2) { flex: 1; }
  .role-card .icon-arrow { top: 50%; transform: translateY(-50%); }
  .demo-grid { grid-template-columns: 1fr; }
  .welcome-card { align-items: flex-start; padding: 22px; }
  .welcome-visual { display: none; }
  .welcome-copy h3 { font-size: 23px; }
  .tracking-map { min-height: 430px; }
  .osm-route-map-shell,.osm-route-map { min-height: 390px; height: 390px; }
  .osm-route-map-shell.is-compact,.osm-route-map-shell.is-compact .osm-route-map { min-height: 300px; height: 300px; }
  .gps-map-status { top: 10px; right: 10px; max-width: calc(100% - 64px); padding: 8px 10px; }
  .idle-map-status { padding: 12px; }
  .idle-map-status small { font-size: 10px; }
  .osm-map-legend { left: 8px; right: 8px; bottom: 30px; justify-content: center; }
  .route-map-viewport::after { content: "Swipe to view every station"; position: sticky; left: 12px; bottom: 8px; display: inline-block; margin: 0 0 8px 12px; padding: 5px 8px; border-radius: 999px; color: var(--ink-500); background: rgba(255,255,255,.88); font-size: 8px; }
  .map-info-panel { top: 12px; left: 12px; right: 12px; min-width: 0; }
  .map-controls-floating { top: auto; right: 12px; bottom: 12px; }
  .coordinate-entry { grid-template-columns: 1fr 1fr; }
  .coordinate-entry .btn { grid-column: 1 / -1; }
  .planner-stop { grid-template-columns: auto 28px 38px minmax(0,1fr); }
  .planner-stop-fields { grid-column: 2 / -1; }
  .chat-shell { height: calc(100vh - 118px); min-height: 560px; grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .chat-shell.show-contacts .chat-sidebar { display: block; }
  .chat-shell.show-contacts .chat-main { display: none; }
  .chat-contacts-button { display: grid; }
  .chat-sidebar [data-action="hide-chat-contacts"] { display: grid; }
  .balance-card .amount { font-size: 31px; }
  .toast-host { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; width: 100%; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-body { max-height: calc(92vh - 132px); }
  .contact-choice-grid { grid-template-columns: 1fr; }
  .contact-choice { min-height: 72px; }
  .approval-detail-grid { grid-template-columns: 1fr; }
  .approval-map-card, .approval-school-card { grid-column: auto; }
  .approval-school-card, .approval-review-footer { align-items: stretch; flex-direction: column; }
  .approval-parent-map { min-height: 280px; height: 280px; }
  .approval-decision-actions { width: 100%; }
}
@media (max-width: 460px) {
  .auth-panel { padding: 25px 18px; justify-content: flex-start; }
  .mobile-brand { margin-top: 5px; }
  .auth-card-head h2 { font-size: 29px; }
  .sidebar { width: min(86vw, 290px); }
  .topbar-actions { gap: 8px; }
  .notification-button, .menu-button { width: 38px; height: 38px; }
  .view-root { padding-inline: 12px; }
  .welcome-actions .btn { width: 100%; }
  .quick-grid { grid-template-columns: 1fr; }
  .map-controls { align-items: stretch; }
  .map-controls .btn { width: 100%; }
  .gps-map-status small { display: none; }
  .notification-item { grid-template-columns: 40px minmax(0,1fr); }
  .notification-time { grid-column: 2; }
  .contact-choice-profile { align-items: flex-start; }
  .contact-choice { padding-block: 11px; }
}

.muted-text { color: var(--text-muted, #718096); font-size: 0.78rem; font-weight: 600; }

