:root {
  --ink: #18211c;
  --muted: #69736d;
  --paper: #f4efe4;
  --panel: rgba(255, 252, 244, 0.86);
  --line: rgba(24, 33, 28, 0.11);
  --forest: #234a36;
  --moving: #22b45f;
  --moss: #819464;
  --amber: #c88736;
  --red: #b84d35;
  --slate: #5f6862;
  --shadow: 0 28px 80px rgba(37, 45, 38, 0.14);
  --soft-shadow: 0 12px 40px rgba(37, 45, 38, 0.09);
  --report-viewport-height: calc(100vh - 92px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 14% 18%, rgba(200, 135, 54, 0.16), transparent 27rem),
    radial-gradient(circle at 86% 8%, rgba(35, 74, 54, 0.14), transparent 24rem),
    linear-gradient(135deg, #f4efe4 0%, #ece7db 48%, #f7f1e7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 32, 26, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 26, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), transparent);
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero,
.toolbar,
.panel,
.vehicle-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 26px 30px;
  border-radius: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--moss);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4.9rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.panel {
  margin-top: 24px;
  padding: 24px;
  border-radius: 26px;
}

.detail-panel {
  min-height: 220px;
}

.login-panel {
  max-width: 460px;
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
  font: inherit;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input,
select,
textarea {
  width: 100%;
}

select {
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  font: inherit;
  font-weight: 800;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  color: #fff;
  background: var(--forest);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(36, 74, 54, 0.22);
}

.ghost {
  border: 1px solid var(--line);
  color: var(--forest);
  background: rgba(255, 255, 255, 0.55);
}

.hidden {
  display: none !important;
}

.error {
  min-height: 1.2em;
  color: var(--red);
  font-weight: 800;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: 26px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  font-weight: 800;
}

.stat-chip {
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.stat-chip.is-muted {
  opacity: 0.38;
  text-decoration: line-through;
}

.chip-moving {
  color: var(--moving);
}

.chip-idle {
  color: var(--amber);
}

.chip-offline,
.chip-no_data {
  color: var(--slate);
}

.dashboard-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 22px;
  align-items: stretch;
}

.map-card,
.fleet-panel {
  min-height: 650px;
}

.map-head,
.fleet-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.map-canvas {
  position: relative;
  overflow: hidden;
  min-height: 535px;
  margin-top: 18px;
  border: 1px solid rgba(35, 74, 54, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 22% 24%, rgba(129, 148, 100, 0.28), transparent 16rem),
    radial-gradient(circle at 76% 64%, rgba(200, 135, 54, 0.16), transparent 18rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(232, 226, 211, 0.72));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.map-canvas::before,
.map-canvas::after,
.map-grid-lines {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-canvas::before {
  background:
    linear-gradient(115deg, transparent 0 26%, rgba(35, 74, 54, 0.08) 26% 27%, transparent 27% 54%, rgba(35, 74, 54, 0.07) 54% 55%, transparent 55%),
    linear-gradient(30deg, transparent 0 34%, rgba(200, 135, 54, 0.08) 34% 35%, transparent 35% 72%, rgba(35, 74, 54, 0.07) 72% 73%, transparent 73%);
}

.map-canvas::after {
  border-radius: 28px;
  background: radial-gradient(circle at center, transparent 45%, rgba(24, 33, 28, 0.08));
}

.map-grid-lines {
  background-image:
    linear-gradient(rgba(24, 33, 28, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 28, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
}

.map-marker {
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid rgba(255, 252, 244, 0.95);
  border-radius: 999px;
  padding: 0;
  background: var(--slate);
  box-shadow: 0 10px 24px rgba(24, 33, 28, 0.2);
}

.map-marker:hover {
  transform: translateY(-1px) scale(1.12);
}

.map-marker span {
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 1px solid currentColor;
  opacity: 0.22;
}

.map-marker.moving {
  background: var(--moving);
  color: var(--moving);
}

.map-marker.idle {
  background: var(--amber);
  color: var(--amber);
}

.map-marker.selected {
  z-index: 3;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border-width: 5px;
  box-shadow: 0 16px 30px rgba(24, 33, 28, 0.28);
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.search-input {
  max-width: 180px;
  border-radius: 999px;
  padding: 11px 14px;
}

.vehicle-grid {
  display: grid;
  gap: 10px;
  max-height: 535px;
  margin-top: 18px;
  overflow: auto;
  padding-right: 4px;
}

.vehicle-card {
  position: relative;
  overflow: hidden;
  min-height: auto;
  padding: 16px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
}

.vehicle-card::after {
  display: none;
}

.vehicle-card.selected {
  border-color: rgba(36, 74, 54, 0.42);
  box-shadow: 0 22px 70px rgba(36, 74, 54, 0.24);
}

.vehicle-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.vehicle-title {
  margin-bottom: 5px;
  font-size: 1.08rem;
  letter-spacing: -0.04em;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  height: 30px;
  color: #fff;
  background: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status.moving {
  background: var(--moving);
}

.status.idle {
  background: var(--amber);
}

.status.offline {
  background: #6d746d;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metric {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.metric small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-empty,
.muted {
  color: var(--muted);
  font-weight: 800;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
}

.period-picker {
  min-width: 220px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.summary-card small,
.trip-row small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  letter-spacing: -0.05em;
}

.trip-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.trip-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.36);
}

.report-trip-row {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.report-trip-row:hover,
.report-trip-row:focus-visible {
  border-color: rgba(242, 165, 26, 0.72);
  background: rgba(255, 250, 232, 0.82);
  box-shadow: 0 0 0 2px rgba(242, 165, 26, 0.14);
  outline: none;
}

.report-trip-row.selected {
  border-color: #f2a51a;
  background: #fff8df;
  box-shadow: 0 0 0 2px rgba(242, 165, 26, 0.24);
}

.trip-row strong {
  display: block;
  font-size: 1.02rem;
}

.config-form {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

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

.checkbox-line {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  align-self: end;
  min-height: 48px;
}

.checkbox-line input {
  width: auto;
}

.module-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.module-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
}

.module-strip strong {
  color: var(--ink);
}

.form-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}

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

  .map-card,
  .fleet-panel {
    min-height: auto;
  }

  .map-canvas {
    min-height: 440px;
  }

  .vehicle-grid {
    max-height: none;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.brand-link {
  display: inline-block;
  color: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
}

.brand-link:hover {
  color: #bcebf1;
}

.map-marker.stopped {
  background: var(--red);
  color: var(--red);
}

.vehicle-card.moving {
  border-left: 4px solid var(--moving);
}

.vehicle-card.stopped {
  border-left: 4px solid var(--red);
}

.vehicle-card.idle {
  border-left: 4px solid var(--amber);
}

.vehicle-card.offline,
.vehicle-card.no_data {
  border-left: 4px solid var(--slate);
}

.status.stopped {
  background: var(--red);
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 20px 0;
  }

  .hero,
  .toolbar,
  .map-head,
  .fleet-head,
  .detail-head,
  .trip-row,
  .section-title,
  .form-actions {
    display: grid;
  }

  .search-input {
    max-width: none;
  }

  .summary-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Compact operations dashboard */
body {
  background: #f2f0e8;
}

body::before {
  display: none;
}

.shell {
  width: 100%;
  min-height: 100vh;
  padding: 0;
}

.hero {
  position: sticky;
  top: 0;
  z-index: 10;
  align-items: center;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 10px 18px;
  color: #eef8f4;
  background: #123f5a;
  box-shadow: none;
}

.hero .eyebrow {
  display: none;
}

.hero h1 {
  margin: 0;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero .lead {
  margin-top: 2px;
  color: #9ed4df;
  font-size: 0.9rem;
}

.hero .ghost {
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

#appPanel {
  padding: 8px;
}

.toolbar {
  margin-top: 0;
  border-radius: 4px;
  padding: 10px 14px;
  box-shadow: none;
}

.toolbar .eyebrow {
  display: none;
}

.toolbar h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.stats {
  gap: 6px;
}

.chip {
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 0.82rem;
}

.dashboard-home {
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.panel {
  margin-top: 0;
  border-radius: 4px;
  padding: 10px;
  box-shadow: none;
}

.map-card,
.fleet-panel {
  min-height: calc(100vh - 126px);
}

.map-head,
.fleet-head {
  align-items: center;
}

.map-head .eyebrow,
.fleet-head .eyebrow {
  display: none;
}

.map-head h2,
.fleet-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.map-canvas {
  min-height: calc(100vh - 178px);
  margin-top: 10px;
  border-radius: 3px;
  background: #d9e6dc;
}

.map-canvas::after {
  border-radius: 3px;
}

.map-canvas::before,
.map-canvas::after,
.map-grid-lines {
  display: none;
}

.leaflet-container {
  color: var(--ink);
  font-family: inherit;
}

.leaflet-control-zoom a {
  color: var(--ink);
}

.leaflet-vehicle-marker {
  display: block;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.leaflet-vehicle-marker.icon-marker {
  display: grid;
  place-items: center;
  overflow: visible;
}

.leaflet-vehicle-marker.icon-marker img {
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.34));
}

.leaflet-vehicle-marker.selected {
  width: 40px;
  height: 40px;
  transform: translate(-3px, -3px);
}

.leaflet-vehicle-marker.selected img {
  max-width: 42px;
  max-height: 42px;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.9)) drop-shadow(0 5px 7px rgba(0, 0, 0, 0.36));
}

.map-popup {
  display: grid;
  gap: 3px;
  min-width: 180px;
  font-size: 0.82rem;
}

.map-popup strong {
  font-size: 0.95rem;
  font-weight: 650;
}

.map-popup small,
.map-popup span {
  color: var(--muted);
}

.fleet-panel {
  order: 1;
}

.map-card {
  order: 2;
}

.search-input {
  max-width: 155px;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.vehicle-grid {
  max-height: calc(100vh - 178px);
  gap: 6px;
  margin-top: 10px;
}

.vehicle-card {
  border-radius: 4px;
  padding: 10px;
  box-shadow: none;
}

.density-compact .vehicle-card {
  padding: 7px 9px;
}

.density-compact .vehicle-grid {
  gap: 4px;
}

.density-compact .metrics {
  margin-top: 5px;
}

.density-compact .metric {
  padding-top: 4px;
}

.density-compact .metric small {
  display: none;
}

.vehicle-card.selected {
  border-color: #123f5a;
  box-shadow: inset 3px 0 0 #123f5a;
}

.vehicle-head {
  align-items: flex-start;
}

.vehicle-title {
  margin-bottom: 2px;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.vehicle-card .lead {
  font-size: 0.9rem;
}

.status {
  height: auto;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.66rem;
}

.metrics {
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 8px;
}

.metric {
  padding-top: 6px;
}

.metric small {
  font-size: 0.72rem;
}

.metric strong {
  font-size: 0.82rem;
}

.detail-panel {
  display: none;
}

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

  .fleet-panel,
  .map-card {
    order: initial;
    min-height: auto;
  }

  .map-canvas,
  .vehicle-grid {
    min-height: 420px;
    max-height: none;
  }
}

/* Thin, expandable fleet rows */
body {
  font-family: "Helvetica Neue", "Avenir Next", "Trebuchet MS", sans-serif;
  font-weight: 400;
}

.brand-link {
  font-weight: 550;
}

.toolbar h2,
.map-head h2,
.fleet-head h2 {
  font-weight: 500;
}

.chip,
.status,
.metric small {
  font-weight: 500;
}

.vehicle-card {
  padding: 8px 10px;
  transition: background 160ms ease, border-color 160ms ease;
}

.vehicle-main {
  min-width: 0;
}

.vehicle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.vehicle-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 22px;
}

.vehicle-title {
  margin: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-report-button {
  padding: 4px 7px;
  color: #123f5a;
  background: rgba(213, 240, 234, 0.52);
  font-size: 0.76rem;
  line-height: 1.1;
}

.vehicle-report-button:hover,
.vehicle-report-button:focus-visible {
  color: #fff;
  background: #123f5a;
}

.metrics {
  display: none;
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.vehicle-card.selected .metrics {
  display: grid;
}

.metric {
  padding-top: 8px;
}

.metric strong {
  font-weight: 400;
  white-space: normal;
}

.metric-wide {
  grid-column: 1 / -1;
}

.vehicle-card.stopped {
  border-left-color: var(--red);
}

.status.stopped {
  background: var(--red);
}

.vehicle-card.idle {
  border-left-color: var(--amber);
}

.status.idle {
  background: var(--amber);
}

.main-nav {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

.main-nav a {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  padding: 8px 11px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active {
  color: #123f5a;
  background: #d5f0ea;
}

.report-view {
  height: var(--report-viewport-height);
  margin-top: 8px;
  overflow: hidden;
}

.report-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.report-sidebar {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(190px, 0.75fr) auto minmax(150px, 0.55fr);
  gap: 8px;
  align-items: center;
  min-height: auto;
  padding: 8px 10px;
  font-size: 0.88rem;
}

.report-sidebar:has(.custom-period-field:not(.hidden)) {
  grid-template-columns: minmax(230px, 1fr) minmax(150px, 0.62fr) repeat(2, minmax(165px, 0.72fr)) auto minmax(110px, 0.42fr);
}

.report-filter-title {
  display: none;
}

.report-sidebar h2,
.report-head h2 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0;
}

.report-sidebar label {
  gap: 0;
  font-size: 0.82rem;
  font-weight: 500;
}

.report-sidebar select,
.report-sidebar input,
.report-sidebar button {
  min-width: 0;
  height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 0.88rem;
}

.report-sidebar input {
  border-radius: 4px;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.report-sidebar .eyebrow,
.report-head .eyebrow {
  display: none;
}

.report-main {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.report-head {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(430px, 1.4fr);
  gap: 12px;
  align-items: center;
  min-height: 32px;
}

.report-head .lead {
  margin: 2px 0 0;
  font-size: 0.82rem;
}

.report-map {
  flex: 0 0 clamp(360px, 48vh, 500px);
  min-height: 0;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(35, 74, 54, 0.12);
  border-radius: 3px;
  background: #d9e6dc;
}

.report-summary-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
  min-width: 0;
}

.report-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 34px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.34);
}

.report-summary-item small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.report-summary-item strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: right;
}

.report-map.empty {
  display: grid;
  place-items: center;
}

.report-trips {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  margin-top: 12px;
  min-height: 0;
  overflow: hidden;
}

.report-trips .trip-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.detail-trip-list {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.detail-trip-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.46);
}

.detail-trip-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: #123f5a;
  font-size: 0.8rem;
  font-weight: 650;
}

.detail-trip-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.94rem;
}

.detail-trip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(92px, 0.45fr) minmax(112px, 0.55fr);
  gap: 8px;
  margin-top: 8px;
}

.detail-trip-grid span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-trip-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.mini-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
}

@media (min-width: 1180px) {
  .report-main {
    display: grid;
    grid-template-columns: minmax(340px, 0.68fr) minmax(520px, 1.32fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }

  .report-head {
    grid-column: 2;
    grid-row: 1;
  }

  .report-trips {
    grid-column: 1;
    grid-row: 1 / 3;
    margin-top: 0;
  }

  .report-map {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    height: auto;
    margin-top: 0;
  }

  .detail-trip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero {
    display: grid;
  }

  .main-nav {
    margin-left: 0;
  }

  .report-shell {
    grid-template-columns: 1fr;
  }

  .report-sidebar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .report-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .report-summary-list {
    grid-template-columns: 1fr;
  }

  .report-sidebar,
  .report-main {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .report-map {
    flex-basis: 360px;
  }

  .report-trips .trip-list,
  .detail-trip-list {
    max-height: none;
  }

  .detail-trip-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Unified square controls and status strip in the top bar */
.hero {
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(0, 1fr) auto auto;
  gap: 10px;
}

.top-stats {
  justify-content: center;
  min-width: 0;
}

.top-stats .stat-chip {
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.top-stats .stat-chip:hover,
.top-stats .stat-chip:focus-visible {
  color: #123f5a;
  background: #d5f0ea;
}

.top-stats .chip-moving {
  color: #8af0b5;
}

.top-stats .chip-idle {
  color: #ffd28a;
}

.top-stats .chip-stopped {
  color: #ffab9c;
}

.top-stats .chip-offline,
.top-stats .chip-no_data {
  color: #d9e1df;
}

.main-nav {
  margin-left: 0;
}

button,
.main-nav a,
.chip,
.status,
input,
select,
textarea,
.panel,
.vehicle-card,
.summary-card,
.detail-trip-card,
.report-map,
.map-canvas,
.leaflet-control a {
  border-radius: 4px;
}

.settings-view {
  margin-top: 8px;
}

.clients-view {
  margin-top: 8px;
}

.module-view {
  margin-top: 8px;
}

.clients-panel,
.module-panel {
  min-height: calc(100vh - 126px);
  font-size: 0.86rem;
}

.clients-view button,
.clients-view input,
.clients-view select,
.clients-view .chip,
.module-view button,
.module-view input,
.module-view select,
.module-view textarea,
.module-view .chip,
.module-view .module-strip span,
.module-view .report-summary-item {
  border-radius: 2px;
}

.clients-head,
.module-head,
.module-summary-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.clients-head h2,
.module-head h2,
.module-summary-card h3 {
  margin: 0;
  font-size: 0.96rem;
  letter-spacing: 0;
}

.module-head select {
  min-width: 320px;
}

.module-content {
  margin-top: 14px;
}

.clients-content {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.clients-list,
.client-detail,
.client-block,
.client-create-form,
.client-user-create-form,
.client-access-form,
.client-edit-form {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.38);
}

.clients-list {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
}

.client-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.54);
}

.client-list-item.active {
  border-color: var(--forest);
  background: rgba(20, 76, 102, 0.12);
}

.client-list-item strong,
.client-row strong,
.client-vehicle-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.client-list-item small,
.client-row small,
.client-vehicle-row small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.client-count {
  min-width: 28px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  text-align: center;
  background: rgba(255, 255, 255, 0.68);
}

.client-create-form,
.client-user-create-form,
.client-access-form {
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
}

.client-create-form h3,
.client-user-create-form h3,
.client-access-form h3,
.client-block h3 {
  margin: 0;
  font-size: 0.92rem;
}

.client-detail {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
}

.client-edit-form {
  grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
}

.client-edit-title {
  min-width: 0;
}

.client-edit-form h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.client-edit-form .muted,
.client-create-form .muted,
.client-user-create-form .muted,
.client-access-form .muted,
.client-user-card .muted,
.client-vehicle-row .muted {
  margin: 0;
}

.client-columns {
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
}

.client-block {
  padding: 10px;
}

.client-block-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.client-user-list,
.client-vehicle-list {
  display: grid;
  gap: 6px;
}

.client-row,
.client-user-card,
.client-vehicle-row {
  display: grid;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.44);
}

.client-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
}

.client-user-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  padding: 10px;
}

.client-user-card input,
.client-user-card select,
.client-user-create-form input,
.client-user-create-form select,
.client-access-form select {
  width: 100%;
  min-width: 0;
}

.client-user-identity {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  min-width: 0;
}

.client-user-identity strong,
.client-user-identity small {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-user-identity strong {
  flex: 1 1 160px;
}

.client-user-identity small {
  flex: 1 1 180px;
}

.client-user-identity .chip {
  margin-top: 0;
}

.client-user-active {
  align-self: center;
  min-height: 0;
  margin: 0;
}

.client-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-self: center;
}

.client-user-actions button {
  min-width: 92px;
}

.client-user-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

.client-user-create-form h3 {
  grid-column: 1 / -1;
}

.client-user-card .form-status,
.client-user-create-form .form-status,
.client-access-form .form-status {
  grid-column: 1 / -1;
}

.client-user-card .form-status:empty,
.client-user-create-form .form-status:empty,
.client-access-form .form-status:empty {
  display: none;
}

.client-access-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.5fr) auto;
  align-items: end;
}

.client-access-form h3 {
  grid-column: 1 / -1;
}

.client-access-note {
  margin: 10px 0 0;
}

.client-vehicle-row {
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 0.7fr) auto minmax(150px, 0.5fr);
}

.module-summary-card {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.38);
}

.module-config-form {
  margin-top: 12px;
}

.module-warning {
  border-left: 3px solid var(--amber);
  margin: 14px 0 0;
  padding: 9px 10px;
  color: var(--muted);
  background: rgba(200, 135, 54, 0.08);
  font-size: 0.86rem;
  font-weight: 500;
}

.module-config-form {
  font-size: 0.86rem;
}

.module-config-form .section-title h2,
.odometer-panel .section-title h2 {
  margin: 0;
  font-size: 0.96rem;
}

.module-config-form input,
.module-config-form select,
.module-config-form textarea,
.odometer-panel input {
  border-radius: 2px;
  font-size: 0.86rem;
}

.icon-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.icon-select-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.icon-preview,
.icon-choice {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.72);
}

.icon-preview {
  display: grid;
  place-items: center;
  min-height: 42px;
}

.icon-preview img {
  max-width: 34px;
  max-height: 34px;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 6px;
  max-height: 178px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.34);
}

.icon-choice {
  display: grid;
  grid-template-rows: 34px auto;
  justify-items: center;
  gap: 3px;
  min-height: 64px;
  padding: 5px;
  color: var(--ink);
  cursor: pointer;
}

.icon-choice img {
  max-width: 38px;
  max-height: 34px;
  object-fit: contain;
}

.icon-choice span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
}

.icon-choice.active {
  border-color: var(--forest);
  background: rgba(20, 76, 102, 0.12);
  box-shadow: inset 0 0 0 1px rgba(20, 76, 102, 0.36);
}

.odometer-panel {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.odometer-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.odometer-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(150px, 0.6fr) minmax(220px, 1fr) auto auto minmax(180px, 0.8fr);
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.odometer-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.odometer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.34);
}

.odometer-row strong {
  font-weight: 550;
}

.odometer-row small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.odometer-actions {
  display: flex;
  gap: 6px;
}

.logout-icon {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1rem;
}

.settings-panel {
  min-height: calc(100vh - 126px);
}

.settings-head,
.settings-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.settings-head h2,
.settings-card h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.settings-forms {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.settings-tenant-picker {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  background: rgba(18, 63, 90, 0.06);
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.38);
}

.settings-card .muted {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.settings-grid .checkbox-line {
  justify-content: flex-start;
  min-height: 34px;
}

.settings-grid .checkbox-line input {
  width: auto;
}

button,
.chip,
.status {
  border: 1px solid var(--line);
}

button,
.main-nav a,
.chip,
.status {
  font-weight: 500;
}

button {
  padding: 8px 11px;
  background: #123f5a;
  box-shadow: none;
}

button:hover,
button:focus-visible {
  color: #123f5a;
  background: #d5f0ea;
  box-shadow: none;
}

.ghost {
  border-color: rgba(255, 255, 255, 0.22);
}

input,
select,
textarea {
  padding: 8px 10px;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  }

  .top-stats {
    justify-content: flex-start;
  }

  #logoutButton {
    grid-column: 3;
  }

  .main-nav {
    grid-column: 3;
    grid-row: 1;
  }

  .clients-content,
  .client-columns {
    grid-template-columns: 1fr;
  }

  .client-edit-form,
  .client-access-form,
  .client-user-create-form,
  .client-user-card,
  .client-vehicle-row {
    grid-template-columns: 1fr;
  }
}

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

  .top-stats,
  .main-nav {
    grid-column: auto;
    grid-row: auto;
    justify-content: flex-start;
  }

  .settings-head,
  .settings-card-head,
  .clients-head,
  .module-head,
  .module-summary-card {
    display: grid;
  }

  .settings-grid,
  .clients-content,
  .client-columns,
  .client-edit-form,
  .client-access-form,
  .client-user-create-form,
  .client-user-card,
  .client-row,
  .client-vehicle-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .odometer-summary-grid,
  .odometer-form,
  .odometer-row {
    grid-template-columns: 1fr;
  }

.module-head select {
    min-width: 0;
  }

  #logoutButton {
    grid-column: auto;
  }
}

body.login-screen {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 20%, rgba(129, 148, 100, 0.18), transparent 26rem),
    radial-gradient(circle at 82% 78%, rgba(18, 63, 90, 0.12), transparent 28rem),
    linear-gradient(135deg, #f6f2ea 0%, #ebe6da 100%);
}

body.login-screen .shell {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
}

body.login-screen .hero {
  position: relative;
  display: flex;
  justify-content: flex-start;
  padding: 18px 24px;
  border: 0;
  color: var(--ink);
  background: transparent;
}

body.login-screen .hero .lead {
  color: var(--muted);
}

body.login-screen .brand-link {
  color: var(--ink);
}

body.login-screen .brand-link:hover {
  color: var(--forest);
}

.login-panel {
  align-self: center;
  width: min(430px, calc(100vw - 32px));
  max-width: none;
  margin: clamp(24px, 8vh, 88px) auto auto;
  padding: 30px;
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.94);
  box-shadow: 0 24px 70px rgba(24, 33, 28, 0.12);
}

.login-card-head {
  margin-bottom: 22px;
}

.login-card-head .eyebrow {
  display: block;
  margin-bottom: 10px;
}

.login-card-head h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  letter-spacing: -0.035em;
}

.login-card-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-panel form {
  gap: 14px;
}

.login-panel label {
  gap: 8px;
  font-size: 0.9rem;
}

.login-panel input {
  border-radius: 6px;
  padding: 12px 13px;
  background: #fffdf8;
}

.login-panel button {
  width: 100%;
  margin-top: 4px;
  border-radius: 6px;
  padding: 12px 16px;
}

.login-panel .error {
  margin: 14px 0 0;
  min-height: 1.2em;
  font-size: 0.92rem;
}

@media (max-width: 760px) {
  body.login-screen .shell {
    display: block;
  }

  body.login-screen .hero {
    padding: 16px;
  }

  .login-panel {
    width: calc(100% - 24px);
    margin-top: 32px;
    padding: 24px;
  }
}
