:root {
  --bg: #f4f7f8;
  --bg-elev: #ffffff;
  --ink: #0b1c22;
  --muted: #5b6f78;
  --line: #d7e3e7;
  --teal: #0f766e;
  --teal-deep: #115e59;
  --cyan: #0891b2;
  --pearl: #f0f9fa;
  --gold: #b45309;
  --danger: #b91c1c;
  --ok: #047857;
  --warn: #b45309;
  --sidebar: #071318;
  --sidebar-text: #c5d6db;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(7, 19, 24, 0.08);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--cyan); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }

.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: inherit; text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 18%, transparent 19%),
    radial-gradient(circle at 50% 55%, #99f6e4 0%, #0d9488 45%, #0e7490 100%);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.25), inset 0 -4px 8px rgba(0,0,0,.2);
}
.brand-text { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-sm .brand-mark { width: 22px; height: 22px; }

/* Public header / landing */
.public-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(244, 247, 248, 0.78);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s, color .25s;
}
.public-header.scrolled { border-bottom-color: var(--line); background: rgba(244,247,248,.92); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; }
.public-nav { display: flex; align-items: center; gap: 1.25rem; }
.public-nav a { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.public-nav a:hover { color: var(--ink); }

body.landing .public-header {
  position: fixed; inset-inline: 0; top: 0;
  background: transparent; backdrop-filter: none;
}
body.landing .public-header .brand-text,
body.landing .public-header .public-nav > a:not(.btn) { color: rgba(237, 247, 248, 0.88); }
body.landing .public-header .public-nav > a:not(.btn):hover { color: #fff; }
body.landing .public-header.scrolled {
  background: rgba(7, 19, 24, 0.88);
  backdrop-filter: blur(16px);
  border-bottom-color: rgba(255,255,255,.06);
}
body.landing .public-header.scrolled .brand-text,
body.landing .public-header.scrolled .public-nav > a:not(.btn) { color: #e8f4f6; }

.brand-mark-lg {
  width: 42px; height: 42px;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.28), inset 0 -6px 12px rgba(0,0,0,.25);
}

/* Hero — full-bleed atmosphere */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #edf7f8;
  isolation: isolate;
}
.hero-media {
  position: absolute; inset: 0; z-index: -2;
  background:
    url("https://images.unsplash.com/photo-1469854523086-cc02fe5d8800?auto=format&fit=crop&w=2400&q=80")
    center / cover no-repeat;
  transform: scale(1.04);
  animation: hero-ken 28s ease-in-out alternate infinite;
}
.hero-veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(105deg, rgba(7,19,24,.82) 0%, rgba(7,19,24,.45) 48%, rgba(7,19,24,.55) 100%),
    linear-gradient(180deg, rgba(7,19,24,.35) 0%, rgba(7,19,24,.15) 35%, rgba(7,19,24,.88) 100%),
    radial-gradient(ellipse 70% 50% at 70% 40%, rgba(14,116,144,.28), transparent 60%);
}
@keyframes hero-ken {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}
.hero-inner {
  position: relative;
  padding: 8rem 0 5.75rem;
  max-width: 36rem;
}
.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.6rem;
  color: #fff;
  animation: rise .9s cubic-bezier(.22,1,.36,1) both;
}
.hero-brand .brand-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.5rem, 6.5vw, 3.75rem);
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-shadow: 0 10px 48px rgba(0,0,0,.4);
}
.hero h1 {
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  font-weight: 500;
  line-height: 1.28;
  margin: 0 0 1rem;
  max-width: 20ch;
  color: rgba(245, 250, 251, 0.96);
  animation: rise .9s .08s cubic-bezier(.22,1,.36,1) both;
}
.hero p.lead {
  font-size: clamp(1.02rem, 1.8vw, 1.15rem);
  color: #b4ccd2;
  max-width: 36ch;
  margin: 0 0 2rem;
  line-height: 1.55;
  animation: rise .9s .16s cubic-bezier(.22,1,.36,1) both;
}
.hero-cta {
  display: flex; gap: 0.7rem; flex-wrap: wrap;
  animation: rise .9s .24s cubic-bezier(.22,1,.36,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.btn-pearl {
  background: #f3fafb;
  color: #0b1c22;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
.btn-pearl:hover { background: #fff; color: #0b1c22; filter: none; }
.btn-ghost-light {
  background: transparent;
  color: #edf7f8;
  border-color: rgba(255,255,255,.3);
}
.btn-ghost-light:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.55);
}

/* Landing sections */
body.landing { background: #f6f9fa; }
body.landing .site-footer {
  background: #071318;
  border-top: none;
  color: #8ba3ab;
  margin-top: 0;
  padding: 2.25rem 0;
}
body.landing .site-footer .brand-text { color: #fff; }
body.landing .site-footer p { color: #7a939c; }

.section { padding: 5.5rem 0; }
.section-head { max-width: 38rem; margin-bottom: 2.75rem; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.25rem); line-height: 1.18; margin-bottom: 0.65rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; line-height: 1.6; }
.section-head-center { margin-inline: auto; text-align: center; max-width: 36rem; }

.section-story {
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(13,148,136,.07), transparent 55%),
    #f6f9fa;
}

.product-frame {
  max-width: 980px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 118, 110, 0.12);
  box-shadow:
    0 1px 0 rgba(255,255,255,.8) inset,
    0 24px 64px rgba(7, 19, 24, 0.12);
}
.product-chrome {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  background: #f0f5f6;
  border-bottom: 1px solid var(--line);
}
.product-dots { display: flex; gap: 0.35rem; }
.product-dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: #c5d4d8;
}
.product-dots span:nth-child(1) { background: #f1b5b0; }
.product-dots span:nth-child(2) { background: #e8d09a; }
.product-dots span:nth-child(3) { background: #a8d4b8; }
.product-title {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.product-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 340px;
}
.product-fleet {
  padding: 1rem 0.85rem;
  background: #f8fbfb;
  border-right: 1px solid var(--line);
}
.product-fleet-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0.35rem 0.75rem;
}
.product-car {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
}
.product-car.is-live {
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.15);
  background: linear-gradient(180deg, #f0fdfa, #fff);
}
.product-car-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.product-car-top strong {
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.product-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #0f766e;
  background: #ccfbf1;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.product-car-name {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.product-car-meta {
  font-size: 0.78rem;
  color: var(--teal-deep);
  font-weight: 500;
  margin-top: 0.45rem;
}
.product-car-meta .pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #14b8a6; margin-right: 5px;
  box-shadow: 0 0 0 0 rgba(20,184,166,.5);
  animation: pulse 1.8s infinite;
}
.product-map {
  position: relative;
  background: #dce8ec;
  overflow: hidden;
}
.product-svg { display: block; width: 100%; height: 100%; min-height: 340px; }
.route-line {
  stroke-dasharray: 820;
  stroke-dashoffset: 820;
}
[data-reveal].is-in .route-line {
  animation: draw-route 2s ease forwards .25s;
}
@keyframes draw-route {
  to { stroke-dashoffset: 0; }
}
.route-dot { opacity: 0; }
[data-reveal].is-in .route-dot {
  animation: pop-dot .45s ease forwards 1.7s;
}
[data-reveal].is-in .route-dot.d2 { animation-delay: 1.9s; }
[data-reveal].is-in .route-dot.d3 { animation-delay: 2.1s; }
@keyframes pop-dot {
  from { opacity: 0; }
  to { opacity: 1; }
}
.product-hud {
  position: absolute;
  right: 1rem;
  top: 1rem;
  min-width: 150px;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(7, 19, 24, 0.88);
  color: #e8f4f6;
  box-shadow: 0 10px 28px rgba(0,0,0,.2);
}
.product-hud .hud-kicker {
  display: block;
  font-size: 0.65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7dd3c7;
  margin-bottom: 0.15rem;
}
.product-hud strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}
.product-hud .hud-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: #a8c5cb;
}

.section-features { padding-top: 1.5rem; }
.feature-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.feature {
  padding: 2rem 1.35rem 2.25rem 0;
  border-top: none;
  border-right: 1px solid var(--line);
}
.feature:last-child { border-right: none; padding-right: 0; }
.feature:not(:first-child) { padding-left: 1.35rem; }
.feature-index {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--teal);
  margin-bottom: 0.9rem;
}
.feature h3 {
  font-size: 1.15rem;
  margin-bottom: 0.55rem;
  line-height: 1.25;
}
.feature p {
  color: var(--muted);
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.58;
}

.section-close {
  padding-bottom: 5.5rem;
  background: #f6f9fa;
}
.close-stage {
  text-align: center;
  padding: 4.25rem 2rem;
  border-radius: 28px;
  background:
    linear-gradient(155deg, #061216 0%, #0c3d42 52%, #0e7490 100%);
  color: #edf7f8;
  box-shadow: 0 28px 64px rgba(7,19,24,.2);
  position: relative;
  overflow: hidden;
}
.close-stage::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 78% 18%, rgba(45,212,191,.2), transparent 42%);
  pointer-events: none;
}
.close-kicker {
  position: relative;
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: #99f6e4;
  letter-spacing: -0.01em;
}
.close-stage h2 {
  position: relative;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin: 0 0 0.75rem;
  color: #fff;
  font-weight: 600;
}
.close-stage > p:not(.close-kicker) {
  position: relative;
  max-width: 34ch;
  margin: 0 auto 1.75rem;
  color: #a8c5cb;
  font-size: 1.05rem;
  line-height: 1.5;
}
.close-stage .btn { position: relative; }

.auth-title {
  font-size: 1.55rem;
  margin: 0 0 0.35rem;
}
.auth-lead {
  color: var(--muted);
  margin: 0 0 1.35rem;
  font-size: 0.95rem;
}
.auth-form { display: flex; flex-direction: column; gap: 0.85rem; }
.auth-submit { width: 100%; margin-top: 0.5rem; }

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .75s cubic-bezier(.22,1,.36,1), transform .75s cubic-bezier(.22,1,.36,1);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}
.feature-rail [data-reveal]:nth-child(2) { transition-delay: .07s; }
.feature-rail [data-reveal]:nth-child(3) { transition-delay: .14s; }
.feature-rail [data-reveal]:nth-child(4) { transition-delay: .21s; }

.band {
  background: linear-gradient(160deg, #0b1c22, #115e59 70%);
  color: #e0f2f1;
  border-radius: 28px;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.band::after {
  content: "";
  position: absolute; right: -10%; top: -30%;
  width: 50%; height: 160%;
  background: radial-gradient(circle, rgba(45,212,191,.25), transparent 65%);
  pointer-events: none;
}
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; margin-top: 2rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1.15rem; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: transform .15s, filter .15s, background .15s, color .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #0d9488, #0891b2); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); color: #fff; }
.btn-secondary { background: var(--bg-elev); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: rgba(0,0,0,.04); }
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.85rem; border-radius: 10px; }
.btn-lg { padding: 0.9rem 1.4rem; font-size: 1rem; }
.btn-light { background: #fff; color: var(--teal-deep); }
.btn-light:hover { color: var(--cyan); }

/* App shell */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 1.25rem 1rem;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 4px 0 24px rgba(7,19,24,.12);
}
.sidebar .brand { color: #fff; margin: 0.25rem 0.5rem 1.5rem; }
.side-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.side-nav a {
  color: var(--sidebar-text); padding: 0.7rem 0.9rem; border-radius: 10px;
  font-weight: 500; font-size: 0.95rem;
}
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active {
  background: linear-gradient(135deg, rgba(13,148,136,.35), rgba(8,145,178,.25));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(45,212,191,.25);
}
.sidebar-foot { padding: 1rem 0.5rem 0.25rem; border-top: 1px solid rgba(255,255,255,.08); margin-top: 1rem; }
.user-chip { display: flex; flex-direction: column; margin-bottom: 0.75rem; font-size: 0.85rem; }
.user-chip strong { color: #fff; }
.user-chip span { color: #7a939c; overflow: hidden; text-overflow: ellipsis; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem; background: rgba(255,255,255,.8); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-family: var(--display); font-weight: 600; font-size: 1.2rem; flex: 1; }
.topbar-meta { color: var(--muted); font-size: 0.9rem; }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 6px 0; border-radius: 2px; }
.content { padding: 1.5rem; }
.content-full { padding: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* Breadcrumbs */
.breadcrumbs { margin-bottom: 1rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; font-size: 0.85rem; color: var(--muted); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 0.35rem; opacity: .5; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--teal); }
.breadcrumbs li[aria-current] { color: var(--ink); font-weight: 500; }

/* Cards / panels */
.panel {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0; box-shadow: var(--shadow);
  overflow: hidden;
}
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.15rem; }
.panel > .form-actions,
.panel > form > .form-actions,
.panel > form:not(.filters),
.panel > p,
.panel > pre,
.panel > .hint,
.panel > .empty { margin-bottom: 1.25rem; }
.panel > form.filters { margin-bottom: 1rem; }
.panel > .pagination,
.panel > form > .pagination { padding: 0 0 1.25rem; margin-top: 0; }
.panel > form { padding-bottom: 1.25rem; }
.panel > form:has(.table-wrap) { padding-bottom: 0; }
.panel > form:has(.table-wrap) .table-wrap { margin-bottom: 0; }
.panel > form:has(.table-wrap) .filters { padding-inline: 0; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem;
}
.stat {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -20%; top: -40%; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(13,148,136,.15), transparent 70%);
}
.stat .label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-family: var(--display); font-size: 1.7rem; font-weight: 700; margin-top: 0.2rem; }

/* Tables — full bleed inside panel, no last-row step */
.table-wrap {
  overflow-x: auto;
  margin-inline: -1.25rem;
  border-top: 1px solid var(--line);
}
.panel > .table-wrap:last-child,
.panel > form > .table-wrap:last-child {
  margin-bottom: 0;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 600;
  background: var(--pearl);
  border-bottom-color: var(--line);
}
table.data tbody tr:last-child td {
  border-bottom: none;
}
table.data tr:hover td { background: rgba(15,118,110,.04); }
table.data .actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  white-space: nowrap;
}

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
label.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 0.65rem 0.8rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(13,148,136,.35); border-color: var(--teal); }
textarea { min-height: 100px; resize: vertical; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 1.25rem; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-bottom: 1rem; }
.filters .field { min-width: 140px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-work { background: #ccfbf1; color: #115e59; }
.badge-personal { background: #ffedd5; color: #9a3412; }
.badge-unclassified { background: #e2e8f0; color: #475569; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-err { background: #fee2e2; color: #991b1b; }

/* Alerts */
.alert { padding: 0.85rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-size: 0.95rem; }
.alert-success, .alert-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #ecfeff; color: #155e75; border: 1px solid #a5f3fc; }

/* Pagination */
.pagination ul { list-style: none; display: flex; gap: 0.35rem; padding: 0; margin: 1rem 0 0; flex-wrap: wrap; }
.pagination a {
  display: inline-flex; min-width: 36px; height: 36px; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line); color: var(--ink); background: #fff; padding: 0 0.5rem;
}
.pagination li.active a { background: var(--teal); color: #fff; border-color: var(--teal); }

/* Empty */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

/* Login */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem;
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(13,148,136,.25), transparent 50%),
    radial-gradient(700px 400px at 100% 100%, rgba(8,145,178,.2), transparent 45%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 2rem; box-shadow: var(--shadow);
}
.auth-card .brand { margin-bottom: 1.5rem; }

/* Live map — full-bleed map + floating glass panels */
.live-layout {
  flex: 1;
  min-height: calc(100vh - 65px);
  display: flex;
  position: relative;
  background: #dbe4e8;
}
.live-map { position: relative; flex: 1; min-height: inherit; }
#map { position: absolute; inset: 0; background: #dbe4e8; }

.live-fleet {
  position: absolute;
  z-index: 500;
  left: 1rem;
  top: 4.25rem;
  bottom: 1.25rem;
  width: min(300px, calc(100% - 2rem));
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(7, 19, 24, 0.18);
  overflow: hidden;
  pointer-events: auto;
}
.live-fleet-head {
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(240,249,250,.95), rgba(255,255,255,.6));
}
.live-fleet-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}
.live-fleet-head p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.live-fleet-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.live-fleet-empty {
  margin: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.live-fleet-empty a { color: var(--teal); font-weight: 600; }

.live-vehicle {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
}
.live-vehicle:hover {
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.1);
}
.live-vehicle.active {
  background: linear-gradient(135deg, #f0fdfa, #ecfeff);
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.25);
}
.live-vehicle .reg { font-weight: 700; color: var(--ink); letter-spacing: 0.02em; }
.live-vehicle .name { font-size: 0.85rem; color: var(--muted); margin-top: 0.1rem; }
.live-vehicle .meta { font-size: 0.8rem; color: var(--teal-deep); margin-top: 0.4rem; font-weight: 500; }
.live-vehicle .pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #14b8a6;
  box-shadow: 0 0 0 0 rgba(20,184,166,.55); animation: pulse 1.8s infinite; margin-right: 6px;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(20,184,166,.55); }
  70% { box-shadow: 0 0 0 10px rgba(20,184,166,0); }
  100% { box-shadow: 0 0 0 0 rgba(20,184,166,0); }
}

.live-hud {
  position: absolute; z-index: 500; right: 1rem; top: 1rem; left: auto;
  background: rgba(7,19,24,.88); color: #e0f2f1; backdrop-filter: blur(12px);
  border: 1px solid rgba(45,212,191,.3); border-radius: 16px; padding: 0.95rem 1.1rem;
  min-width: 200px; pointer-events: none; box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
.live-hud .hud-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .07em; color: #7dd3c7; }
.live-hud .hud-value { font-family: var(--display); font-size: 1.35rem; font-weight: 700; margin-top: 0.1rem; }
.live-hud .hud-stats { display: flex; gap: 1.25rem; margin-top: 0.55rem; font-size: 0.92rem; }

.live-basemap {
  position: absolute; z-index: 500; left: 1rem; top: 1rem;
  display: flex; gap: 0.35rem; pointer-events: auto;
}
.live-basemap button {
  font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  padding: 0.5rem 0.9rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.92); color: var(--ink);
  backdrop-filter: blur(10px); box-shadow: 0 6px 18px rgba(7,19,24,.12);
}
.live-basemap button:hover { border-color: var(--teal); color: var(--teal); }
.live-basemap button.active {
  background: linear-gradient(135deg, #0d9488, #0891b2); color: #fff; border-color: transparent;
}
.leaflet-container { font: inherit; }
.leaflet-bottom.leaflet-right { margin-bottom: 10px; margin-right: 10px; }
.vehicle-marker {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(145deg, #2dd4bf, #0891b2);
  border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.35), 0 0 0 6px rgba(45,212,191,.2);
  display: flex; align-items: center; justify-content: center;
  color: #042f2e; font-weight: 800; font-size: 0.65rem;
  transform-origin: center center;
}
.vehicle-marker.selected { box-shadow: 0 4px 20px rgba(0,0,0,.4), 0 0 0 8px rgba(251,191,36,.35); }

.trip-map { height: 280px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-top: 1rem; }

/* Responsive */
@media (max-width: 960px) {
  .feature-rail { grid-template-columns: 1fr 1fr; border-top: none; }
  .feature, .feature:not(:first-child) {
    border-top: 1px solid var(--line);
    border-right: none;
    padding: 1.75rem 0;
  }
  .feature:nth-child(odd) { padding-right: 1rem; }
  .feature:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--line); }
  .product-body { grid-template-columns: 1fr; }
  .product-fleet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .product-fleet-label { grid-column: 1 / -1; margin-bottom: 0.25rem; }
  .product-car { margin-bottom: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-105%);
    transition: transform .25s ease; width: min(280px, 86vw);
  }
  .sidebar.open { transform: none; }
  .nav-toggle { display: inline-block; }
  .live-fleet {
    top: auto;
    bottom: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-height: 38vh;
  }
  .live-basemap { left: 0.75rem; top: 0.75rem; }
  .live-hud { right: 0.75rem; top: 0.75rem; max-width: calc(100% - 1.5rem); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .feature-rail { grid-template-columns: 1fr; }
  .feature, .feature:nth-child(odd), .feature:nth-child(even) {
    padding: 1.5rem 0;
    border-left: none;
  }
  .product-fleet { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .hero-inner { padding: 6.75rem 0 4.5rem; }
  .hero-brand .brand-text { font-size: 2.35rem; }
  .close-stage { padding: 3rem 1.35rem; border-radius: 22px; }
  .band { padding: 1.75rem; }
  .public-nav a:not(.btn) { display: none; }
}
