@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #F3F4F6;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --text: #111827;
  --muted: #5f6673;
  --line: rgba(0, 0, 0, 0.08);
  --blue: #059669;
  --blue-dark: #047857;
  --danger: #b42318;
  --warning: #9a6700;
  --success: #059669;
  --purple: #10B981;
  --orange: #10B981;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.10);
  --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(5, 150, 105, 0.16), transparent 36%),
    radial-gradient(circle at bottom right, rgba(209, 250, 229, 0.55), transparent 32%),
    var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.glass-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

.landing-shell,
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.hero-card,
.auth-panel {
  width: min(100%, 520px);
  border-radius: var(--radius-xl);
  padding: 42px;
  text-align: left;
}

.hero-card { width: min(100%, 720px); }

.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #059669, #10B981);
  font-weight: 800;
  font-size: 28px;
  margin-bottom: 22px;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 18px;
  margin-bottom: 0;
}

.eyebrow {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 10px;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: -0.055em;
  line-height: 0.95;
  margin-bottom: 18px;
}

.auth-panel h1,
.topbar h1 {
  font-size: clamp(34px, 4vw, 48px);
}

h2 {
  font-size: 28px;
  letter-spacing: -0.035em;
  margin-bottom: 0;
}

h3 {
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.hero-copy,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy { font-size: 19px; max-width: 560px; }
.hero-actions { margin-top: 28px; }

.button {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 12px 30px rgba(5, 150, 105, 0.26);
}

.button-primary:hover { background: var(--blue-dark); }
.button-secondary { background: rgba(0, 0, 0, 0.06); color: var(--text); }
.full-width { width: 100%; }

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 650;
  font-size: 14px;
}

input {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  padding: 15px 16px;
  font-size: 16px;
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: rgba(5, 150, 105, 0.55);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.message { min-height: 22px; color: var(--muted); margin: 18px 0 0; }
.message.error, .danger-text { color: var(--danger); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  padding: 22px;
}

.sidebar {
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 22px;
  height: calc(100vh - 44px);
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.sidebar-brand span { display: block; color: var(--muted); font-size: 13px; }

.nav-list { display: grid; gap: 6px; flex: 1; align-content: start; }

.nav-list a {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 700;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(5, 150, 105, 0.10);
  color: var(--blue);
  transform: translateX(2px);
}

.sidebar-footer { display: grid; gap: 14px; }

.mini-profile {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
}

.mini-profile span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(5, 150, 105, 0.12);
  color: var(--blue);
  font-weight: 850;
}

.mini-profile strong,
.mini-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-profile small { color: var(--muted); margin-top: 2px; }

.main-content { display: grid; gap: 22px; align-content: start; min-width: 0; }

.topbar {
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.status-pill,
.soft-label,
.status-badge {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(18, 122, 58, 0.10);
  color: var(--success);
  font-weight: 850;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.status-pill.warning,
.status-badge.warning { background: rgba(154, 103, 0, 0.12); color: var(--warning); }
.status-pill.danger,
.status-badge.danger { background: rgba(180, 35, 24, 0.12); color: var(--danger); }
.status-badge.blue { background: rgba(5, 150, 105, 0.10); color: var(--blue); }
.status-badge.neutral { background: rgba(0,0,0,.06); color: var(--muted); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.metric-card,
.content-card,
.alert-card,
.mini-metric {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.metric-card { position: relative; overflow: hidden; min-height: 154px; }
.metric-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  right: -38px;
  bottom: -42px;
  background: rgba(0,113,227,.10);
}
.metric-card.accent-green::after { background: rgba(18,122,58,.12); }
.metric-card.accent-orange::after { background: rgba(197,106,0,.13); }
.metric-card.accent-purple::after { background: rgba(110,69,226,.12); }

.metric-card span,
.mini-metric span { color: var(--muted); font-weight: 700; }
.metric-card strong { display: block; margin-top: 12px; font-size: 46px; letter-spacing: -0.055em; }
.metric-card small,
.mini-metric small { color: var(--muted); }

.secondary-metrics .mini-metric { padding: 18px; box-shadow: var(--soft-shadow); }
.mini-metric strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -0.04em; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr); gap: 22px; align-items: start; }
.side-stack { display: grid; gap: 22px; }

.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.section-heading.compact { margin-bottom: 16px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.data-table th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 0 14px 12px; }
.data-table td { padding: 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(255,255,255,.5); }
.empty-cell { text-align: center; color: var(--muted); padding: 34px !important; }

.child-cell strong, .route-card strong { display: block; }
.child-cell small, .route-card small { color: var(--muted); }

.settings-list { display: grid; gap: 10px; }
.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.56);
  border-radius: 18px;
  padding: 14px;
}
.setting-row div span { display: block; font-weight: 800; }
.setting-row div small { color: var(--muted); }
.toggle-pill { padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.toggle-pill.on { background: rgba(18,122,58,.10); color: var(--success); }
.toggle-pill.off { background: rgba(0,0,0,.06); color: var(--muted); }
.skeleton { min-height: 54px; background: linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.72), rgba(255,255,255,.35)); }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-action {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.66);
  border-radius: 18px;
  padding: 16px 12px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.quick-action:hover { transform: translateY(-1px); background: rgba(0,113,227,.08); color: var(--blue); }

.profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.profile-grid > div,
.next-steps,
.empty-state {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.profile-grid strong { display: block; margin-top: 12px; overflow-wrap: anywhere; }
.next-steps { margin-top: 16px; }
.hidden { display: none; }

@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .metrics-grid, .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hero-card, .auth-panel { padding: 28px; }
  .topbar, .section-heading { flex-direction: column; }
  .metrics-grid, .profile-grid, .quick-actions { grid-template-columns: 1fr; }
  .app-shell { padding: 12px; }
  h1 { font-size: 38px; }
}

/* Kidtrackr brand assets */
.brand-logo {
  display: block;
  height: 46px;
  width: auto;
  object-fit: contain;
}
.sidebar-logo {
  height: 46px;
  max-width: 190px;
}
.auth-logo,
.landing-logo {
  height: auto;
  width: min(260px, 80%);
  margin-bottom: 22px;
}
.sidebar-brand.logo-only {
  align-items: center;
}


/* =========================
   KIDTRACKR LOGO SIZE LOCK
   Keeps logos from overflowing layouts.
   ========================= */

.auth-panel {
  overflow: hidden;
}

.auth-panel .auth-logo,
.auth-logo.brand-logo,
img.auth-logo {
  display: block !important;
  width: min(240px, 78%) !important;
  max-width: 240px !important;
  height: auto !important;
  max-height: 96px !important;
  object-fit: contain !important;
  margin: 0 auto 24px !important;
}

.landing-logo.brand-logo,
img.landing-logo {
  display: block !important;
  width: min(280px, 86%) !important;
  max-width: 280px !important;
  height: auto !important;
  max-height: 112px !important;
  object-fit: contain !important;
  margin: 0 auto 24px !important;
}

.sidebar-brand.logo-only {
  width: 100% !important;
  height: auto !important;
  min-height: 96px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 10px 0 18px !important;
  margin: 0 0 6px !important;
  overflow: hidden !important;
}

.sidebar-brand.logo-only .sidebar-logo,
.sidebar-logo.brand-logo,
img.sidebar-logo {
  display: block !important;
  width: 76px !important;
  max-width: 76px !important;
  height: 76px !important;
  max-height: 76px !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  flex: 0 0 auto !important;
}

.sidebar .brand-logo:not(.sidebar-logo) {
  max-width: 76px !important;
  max-height: 76px !important;
}

.soft-help {
  border-radius: 18px;
  background: rgba(209, 250, 229, .55);
  color: #065f46;
  font-weight: 800;
  line-height: 1.45;
  padding: 14px 16px;
}

/* Live Transport cleanup: filters + compact child grouped route lines */
.live-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: -6px 0 22px;
}
.live-search-group { min-width: 0; }
.live-child-list { display: grid; gap: 10px; }
.live-child-row-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
  overflow: hidden;
}
.live-child-summary-line {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.78);
}
.live-child-name-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.live-child-name-block h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-child-name-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-child-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.live-route-line-list { display: grid; }
.live-route-line {
  display: grid;
  grid-template-columns: 104px minmax(180px, 1.4fr) 112px minmax(110px, .8fr) 92px 92px minmax(190px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}
.live-route-line:last-child { border-bottom: 0; }
.live-route-line-head {
  background: rgba(5, 150, 105, .07);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-top: 8px;
  padding-bottom: 8px;
}
.live-route-cell {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.live-route-name-cell strong {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-route-name-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-route-actions-cell .row-actions {
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}
.live-route-actions-cell .mini-button { white-space: nowrap; }
.muted-row { opacity: .62; }
@media (max-width: 1180px) {
  .live-route-line {
    grid-template-columns: 92px minmax(160px, 1.2fr) 104px 84px 84px minmax(160px, auto);
  }
  .live-route-line > :nth-child(4),
  .live-route-line-head > :nth-child(4) { display: none; }
}
@media (max-width: 860px) {
  .live-filter-bar { grid-template-columns: 1fr; }
  .live-child-summary-line { grid-template-columns: 1fr; align-items: start; }
  .live-child-name-block { display: grid; gap: 2px; }
  .live-child-card-meta { justify-content: flex-start; }
  .live-route-line-head { display: none; }
  .live-route-line {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 14px;
  }
  .live-route-cell {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }
  .live-route-cell::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .live-route-name-cell strong,
  .live-route-name-cell small { white-space: normal; }
  .live-route-actions-cell .row-actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* Live Transport compact child-group table update */
.live-compact-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.76);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .05);
}

.live-compact-header,
.live-compact-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.15fr) minmax(210px, 1.35fr) minmax(130px, .9fr) 120px 92px 92px minmax(180px, auto);
  gap: 14px;
  align-items: center;
}

.live-compact-header {
  padding: 15px 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,.82);
  border-bottom: 1px solid var(--line);
}

.live-child-route-group {
  display: grid;
  border-bottom: 1px solid var(--line);
}

.live-child-route-group:last-child { border-bottom: 0; }

.live-compact-row {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.live-child-route-group .live-compact-row:last-child { border-bottom: 0; }

.live-compact-row:nth-child(even) { background: rgba(248, 250, 252, .56); }

.live-compact-cell {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.live-child-cell strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.live-child-cell small,
.live-route-name-cell small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 3px;
}

.live-route-name-cell strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-repeated-child-spacer {
  display: block;
  min-height: 1px;
}

.live-compact-cell .status-badge,
.live-compact-cell .soft-label {
  white-space: nowrap;
}

.live-route-actions-cell .row-actions {
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.live-route-actions-cell .mini-button { white-space: nowrap; }

@media (max-width: 1280px) {
  .live-compact-header,
  .live-compact-row {
    grid-template-columns: minmax(140px, 1fr) minmax(150px, 1fr) minmax(190px, 1.25fr) 112px 92px 92px minmax(160px, auto);
  }
  .live-compact-header > :nth-child(4),
  .live-compact-row > :nth-child(4) { display: none; }
}

@media (max-width: 900px) {
  .live-compact-header { display: none; }
  .live-compact-table {
    border: 0;
    background: transparent;
    box-shadow: none;
    gap: 12px;
    overflow: visible;
  }
  .live-child-route-group {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255,255,255,.78);
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
  }
  .live-compact-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 13px 14px;
  }
  .live-compact-cell {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    font-size: 14px;
  }
  .live-compact-cell::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .live-child-cell strong,
  .live-route-name-cell strong { white-space: normal; }
  .live-route-actions-cell .row-actions { justify-content: flex-start; flex-wrap: wrap; }
}


/* Live Transport final child-line table layout */
.live-line-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .05);
}
.live-line-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
.live-line-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.86);
  white-space: nowrap;
}
.live-line-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  vertical-align: middle;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.live-line-table tbody tr:last-child td { border-bottom: 0; }
.live-line-table tbody tr:nth-child(even) td:not(.live-child-main-cell):not(.live-school-main-cell) {
  background: rgba(248, 250, 252, .55);
}
.live-child-main-cell {
  width: 18%;
  min-width: 160px;
  border-right: 1px solid rgba(15, 23, 42, .05);
  background: rgba(255,255,255,.68);
}
.live-child-main-cell strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.live-child-main-cell small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}
.live-school-main-cell {
  width: 20%;
  min-width: 180px;
  border-right: 1px solid rgba(15, 23, 42, .05);
  background: rgba(255,255,255,.58);
}
.live-route-line-cell { width: 24%; min-width: 250px; }
.live-route-line-cell strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
}
.live-route-line-cell small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-line-actions {
  justify-content: flex-start;
  gap: 7px;
  flex-wrap: nowrap;
}
.live-line-actions .mini-button { white-space: nowrap; }
@media (max-width: 1100px) {
  .live-line-table { min-width: 880px; }
  .live-line-table th,
  .live-line-table td { padding: 13px 14px; }
}
@media (max-width: 760px) {
  .live-line-table-wrap {
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  .live-line-table,
  .live-line-table thead,
  .live-line-table tbody,
  .live-line-table tr,
  .live-line-table th,
  .live-line-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .live-line-table thead { display: none; }
  .live-line-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255,255,255,.82);
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
  }
  .live-line-table td {
    border-bottom: 1px solid rgba(15, 23, 42, .06);
    padding: 10px 14px;
  }
  .live-child-main-cell,
  .live-school-main-cell {
    border-right: 0;
    background: rgba(255,255,255,.72);
  }
  .live-route-line-cell small { white-space: normal; max-width: none; }
  .live-line-actions { flex-wrap: wrap; }
}

/* Build 5A: live driver route run status */
.live-route-runs-list {
  display: grid;
  gap: 14px;
}
.live-route-run-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 22px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}
.live-route-run-card.active {
  border-color: rgba(5, 150, 105, .28);
  background: linear-gradient(135deg, rgba(236, 253, 245, .92), rgba(255,255,255,.82));
}
.live-route-run-card.stale {
  border-color: rgba(245, 158, 11, .35);
}
.live-route-run-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.live-route-run-main h3 {
  margin: 5px 0 2px;
  font-size: 20px;
  letter-spacing: -.03em;
}
.live-route-run-main p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}
.live-route-run-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}
.live-route-run-grid span {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, .04);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}
.live-route-run-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 900px) {
  .live-route-run-main { flex-direction: column; }
  .live-route-run-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
}
@media (max-width: 560px) {
  .live-route-run-grid { grid-template-columns: 1fr; }
}


/* Build 5A polish: active route status table */
.live-route-run-table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: rgba(255,255,255,.86);
}
.live-route-run-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
.live-route-run-table th {
  text-align: left;
  padding: 14px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid rgba(15, 23, 42, .10);
}
.live-route-run-table td {
  padding: 15px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  vertical-align: middle;
  font-weight: 750;
}
.live-route-run-table tr:last-child td { border-bottom: 0; }
.live-route-run-table td strong { display:block; color: var(--text); font-weight: 950; }
.live-route-run-table td span { display:block; color: var(--muted); margin-top: 3px; font-weight: 750; }
.live-route-run-table .status-badge { display: inline-flex; }
.live-route-run-table .mini-button { white-space: nowrap; }
.route-active-row { background: rgba(236, 253, 245, .45); }
.route-ended-row { background: rgba(248, 250, 252, .75); }
.route-stale-row { background: rgba(255, 251, 235, .55); }

/* Build 5A: wider live route status table + clearer roster separation */
.live-route-run-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: rgba(255,255,255,.92);
}
.live-route-run-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.live-route-run-table th {
  padding: 18px 18px;
  border-bottom: 2px solid rgba(15, 23, 42, .10);
  white-space: nowrap;
}
.live-route-run-table td {
  padding: 20px 18px;
  border-bottom: 2px solid rgba(15, 23, 42, .10);
  vertical-align: top;
  line-height: 1.35;
}
.live-route-run-table tbody tr:last-child td { border-bottom: 0; }
.live-route-run-table tbody tr:nth-child(even) td { background: rgba(248, 250, 252, .62); }
.live-route-run-table td strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 950;
  line-height: 1.25;
}
.live-route-run-table td span {
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.live-route-run-table .status-badge {
  min-width: 72px;
  justify-content: center;
}
.live-route-run-table .mini-button {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 900;
}
.route-run-col-route { width: 16%; }
.route-run-col-driver { width: 20%; }
.route-run-col-status { width: 10%; }
.route-run-col-started { width: 9%; }
.route-run-col-ended { width: 9%; }
.route-run-col-location { width: 11%; }
.route-run-col-vehicle { width: 11%; }
.route-run-col-mileage { width: 11%; }
.route-run-col-map { width: 7%; }

.live-line-table {
  border-collapse: separate;
  border-spacing: 0;
}
.live-line-table td {
  border-bottom: 1px solid rgba(15, 23, 42, .10);
}
.live-line-table tbody tr.live-child-group-start td {
  border-top: 3px solid rgba(15, 23, 42, .12);
}
.live-line-table tbody tr.live-child-group-start:first-child td {
  border-top: 0;
}
.live-line-table tbody tr.live-child-group-end td {
  border-bottom: 3px solid rgba(15, 23, 42, .12);
}
.live-line-table tbody tr.live-child-group-start td:not(.live-child-main-cell):not(.live-school-main-cell) {
  padding-top: 20px;
}
.live-line-table tbody tr.live-child-group-end td:not(.live-child-main-cell):not(.live-school-main-cell) {
  padding-bottom: 20px;
}
.live-child-main-cell,
.live-school-main-cell {
  border-bottom: 3px solid rgba(15, 23, 42, .12) !important;
}
.live-child-main-cell {
  background: rgba(255,255,255,.86) !important;
}
.live-school-main-cell {
  background: rgba(248,250,252,.70) !important;
}
.live-route-line-cell {
  min-width: 320px;
}
.live-route-line-cell small {
  max-width: 620px;
}
@media (max-width: 760px) {
  .live-line-table tbody tr.live-child-group-start,
  .live-line-table tbody tr.live-child-group-end {
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 20px;
  }
  .live-child-main-cell,
  .live-school-main-cell {
    border-bottom: 0 !important;
  }
}

/* Sidebar scroll fix - July 2026
   Keeps the left navigation inside the rounded card and makes the menu/sign out reachable
   when the page has more menu items than the available viewport height. */
.sidebar {
  overflow: hidden;
  min-height: 0;
}

.sidebar .nav-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  margin-right: -6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(5, 150, 105, 0.35) transparent;
}

.sidebar .nav-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar .nav-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar .nav-list::-webkit-scrollbar-thumb {
  background: rgba(5, 150, 105, 0.32);
  border-radius: 999px;
}

.sidebar .sidebar-brand,
.sidebar .sidebar-footer {
  flex: 0 0 auto;
}

.sidebar .sidebar-footer {
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

@media (min-width: 921px) and (max-height: 860px) {
  .sidebar {
    gap: 14px;
    padding: 16px;
  }

  .sidebar-logo {
    width: 58px !important;
    height: 58px !important;
  }

  .nav-list {
    gap: 3px;
  }

  .nav-list a {
    padding: 9px 12px;
    border-radius: 12px;
  }

  .mini-profile {
    padding: 8px;
  }
}
