:root {
  color-scheme: light;
  --ink: #12211d;
  --muted: #66746f;
  --line: #dbe4df;
  --paper: #fbfbf7;
  --panel: #ffffff;
  --green: #145c4a;
  --green-2: #1e7a63;
  --green-soft: #e2f3eb;
  --saffron: #d99120;
  --blue: #286c83;
  --blue-soft: #e7f1f5;
  --rose: #f7e7e2;
  --shadow: 0 18px 45px rgba(18, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(20, 92, 74, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(217, 145, 32, 0.12), transparent 30%),
    repeating-linear-gradient(90deg, rgba(18, 33, 29, 0.035) 0 1px, transparent 1px 58px),
    var(--paper);
  color: var(--ink);
  font-family: "Aptos Display", "Bahnschrift", "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

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

h1 {
  margin-bottom: 4px;
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  line-height: 1.05;
}

h2,
h3 {
  margin-bottom: 4px;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.launch-shell,
.app-frame {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.launch-shell {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 26px;
  padding: 40px 0;
}

.launch-hero {
  min-height: 310px;
  border-radius: 8px;
  padding: clamp(24px, 5vw, 52px);
  color: white;
  background:
    linear-gradient(120deg, rgba(16, 35, 31, 0.96), rgba(20, 92, 74, 0.82)),
    url("assets/icon.svg") right 42px center / 220px 220px no-repeat;
  box-shadow: var(--shadow);
}

.launch-hero h1 {
  max-width: 700px;
  margin-top: 42px;
  font-size: clamp(2.2rem, 7vw, 5rem);
}

.launch-hero p {
  max-width: 650px;
  color: #d9e7e2;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row strong,
.brand-row small {
  display: block;
}

.brand-row small {
  color: var(--muted);
}

.launch-hero .brand-row small {
  color: #bed1cc;
}

.brand-mark,
.app-card-icon,
.section-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: var(--saffron);
  color: #10231f;
  font-weight: 900;
  flex: 0 0 auto;
}

.section-icon {
  width: 34px;
  height: 34px;
  background: var(--green-soft);
  color: var(--green);
}

.launch-actions,
.top-actions,
.driver-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-action,
.secondary-action,
.text-action {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 850;
}

.primary-action {
  background: var(--green);
  color: white;
}

.primary-action:hover {
  background: var(--green-2);
}

.secondary-action {
  background: white;
  border-color: var(--line);
  color: var(--green);
}

.text-action {
  min-height: 34px;
  background: transparent;
  color: var(--green);
  padding-inline: 0;
}

.use-location {
  justify-self: start;
  margin-top: -2px;
}

.wide {
  width: 100%;
}

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

.app-card {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  align-content: start;
  gap: 12px;
}

.app-card:hover {
  border-color: rgba(20, 92, 74, 0.42);
  transform: translateY(-2px);
}

.app-card small {
  color: var(--muted);
  line-height: 1.45;
}

.customer-card .app-card-icon {
  background: var(--green-soft);
  color: var(--green);
}

.driver-card .app-card-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.admin-card .app-card-icon {
  background: #fff0d9;
  color: #87510f;
}

.app-frame {
  padding: 20px 0 40px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.app-header .brand-row {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 228, 223, 0.8);
  border-radius: 8px;
  padding: 10px 12px;
}

.app-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.app-switcher a {
  min-height: 40px;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
}

.app-switcher a.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.sync-pill {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.launch-hero .sync-pill {
  width: fit-content;
  margin-top: 14px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #d9e7e2;
}

.sync-pill[data-state="synced"] {
  border-color: rgba(20, 92, 74, 0.22);
  background: var(--green-soft);
  color: var(--green);
}

.sync-pill[data-state="checking"] {
  border-color: rgba(40, 108, 131, 0.24);
  background: var(--blue-soft);
  color: var(--blue);
}

.sync-pill[data-state="offline"] {
  border-color: #e7b2a2;
  background: #fff8f5;
  color: #9b3b1f;
}

.customer-workspace,
.driver-workspace,
.admin-workspace {
  display: grid;
  gap: 18px;
}

.customer-workspace {
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  align-items: start;
}

.booking-panel,
.map-panel,
.driver-console,
.operations-table,
.settings-panel,
.data-strip article,
.metric-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.booking-panel,
.map-panel,
.driver-console,
.operations-table,
.settings-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-heading p {
  margin-bottom: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  margin-bottom: 14px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(20, 92, 74, 0.23);
  outline-offset: 2px;
}

.location-field {
  margin-bottom: 16px;
}

.maps-connection {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
  margin-bottom: 16px;
}

.maps-connection label {
  margin-bottom: 10px;
}

.maps-connection p {
  min-height: 22px;
  margin: 0;
  font-size: 0.86rem;
}

.google-api-checks {
  list-style: none;
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 12px 0 0;
}

.google-api-checks[hidden] {
  display: none;
}

.google-api-checks li {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.google-api-checks strong {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.google-api-checks li[data-state="checking"] strong {
  color: var(--blue);
}

.google-api-checks li[data-state="ready"] {
  border-color: rgba(20, 92, 74, 0.22);
  background: #f4fbf8;
}

.google-api-checks li[data-state="ready"] strong {
  color: var(--green);
}

.google-api-checks li[data-state="error"] {
  border-color: #e7b2a2;
  background: #fff8f5;
}

.google-api-checks li[data-state="error"] strong {
  color: #9b3b1f;
}

.google-search-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.google-search-grid > div {
  display: grid;
  gap: 7px;
}

.google-search-grid span,
.route-source {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.google-autocomplete-slot {
  min-height: 48px;
}

.google-autocomplete-slot input {
  width: 100%;
}

.google-autocomplete-slot gmp-place-autocomplete,
.google-autocomplete-slot gmpx-place-picker,
.google-autocomplete-slot gmp-place-autocomplete,
.google-autocomplete-slot gmp-place-autocomplete-place {
  width: 100%;
  display: block;
}

.google-selection-summary {
  min-height: 36px;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.google-geocode-empty {
  min-height: 36px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.google-mode .booking-form > .location-field {
  display: none;
}

.location-field label {
  margin-bottom: 7px;
}

.location-options {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-height: 260px;
  overflow: auto;
}

.location-option {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
}

.location-option span,
.location-option small {
  color: var(--muted);
}

.location-option.selected {
  border-color: var(--green);
  background: var(--green-soft);
}

.location-options.google-active {
  min-height: 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 750;
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ride-options {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
}

.ride-option-card {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  text-align: left;
}

.ride-option-card.selected {
  border-color: var(--green);
  background: #f4fbf8;
}

.ride-option-icon,
.driver-mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.ride-option-card strong,
.ride-option-card small {
  display: block;
}

.ride-option-card small,
.ride-option-price small {
  color: var(--muted);
  margin-top: 3px;
  font-size: 0.78rem;
}

.ride-option-price {
  text-align: right;
}

.fare-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 14px;
}

.fare-card div {
  min-height: 78px;
  border-radius: 8px;
  background: var(--green-soft);
  padding: 13px;
}

.fare-card span,
.data-strip span,
.metric-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.fare-card strong,
.data-strip strong,
.metric-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.28rem;
}

.coordinate-note {
  min-height: 42px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.route-source {
  min-height: 22px;
  margin: 0 0 8px;
}

.matched-driver-panel {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 14px;
}

.matched-driver-panel[hidden] {
  display: none;
}

.matched-driver-panel p,
.matched-driver-panel small {
  margin: 2px 0 0;
}

.matched-driver-panel small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.map-surface {
  height: 430px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #c9dce4;
  background:
    linear-gradient(90deg, rgba(40, 108, 131, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(40, 108, 131, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 70% 25%, rgba(255, 255, 255, 0.9), transparent 28%),
    var(--blue-soft);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.google-map {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.google-map .leaflet-control-attribution {
  font-size: 0.68rem;
}

.map-surface.maps-ready .route-line,
.map-surface.maps-ready .pin,
.map-surface.maps-ready .map-label {
  display: none;
}

.route-line {
  position: absolute;
  left: 12%;
  top: 56%;
  width: 76%;
  height: 5px;
  border-radius: 99px;
  background: rgba(40, 108, 131, 0.72);
  transform: rotate(-17deg);
  transform-origin: left center;
}

.pin {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 5px 16px rgba(18, 33, 29, 0.28);
  transition: left 250ms ease, top 250ms ease;
}

.pickup-pin {
  background: var(--green);
}

.destination-pin {
  background: var(--saffron);
}

.driver-pin {
  background: #2b2f65;
}

.map-label {
  position: absolute;
  max-width: 165px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.pickup-label {
  left: 7%;
  bottom: 20px;
}

.destination-label {
  right: 7%;
  top: 20px;
}

.ride-status-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 16px;
  margin-top: 16px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.timeline li {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-weight: 750;
}

.timeline li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--line);
  flex: 0 0 auto;
}

.timeline li.done {
  color: var(--ink);
}

.timeline li.done::before {
  background: var(--green);
}

.data-strip,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.data-strip {
  grid-column: 1 / -1;
}

.data-strip article,
.metric-grid article {
  padding: 16px;
  min-height: 96px;
}

.driver-workspace {
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  align-items: start;
}

.driver-profile {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--blue-soft);
  border-radius: 8px;
  margin-bottom: 16px;
}

.driver-profile span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #2b2f65;
  color: white;
  font-weight: 900;
}

.switch {
  margin: 0;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  width: 54px;
  height: 32px;
  border-radius: 99px;
  background: #b8c4c0;
  position: relative;
  display: block;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  left: 3px;
  top: 3px;
  border-radius: 99px;
  background: white;
  transition: transform 200ms ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(22px);
}

.request-box {
  min-height: 180px;
  border: 1px dashed #b9c7c2;
  border-radius: 8px;
  background: #fbfdfb;
  padding: 16px;
}

.request-box strong {
  display: block;
  margin-bottom: 8px;
}

.request-box small {
  color: var(--muted);
  display: block;
  line-height: 1.45;
}

.driver-actions {
  margin-top: 14px;
}

.driver-actions button {
  flex: 1;
}

.admin-workspace {
  align-items: start;
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-pill {
  min-height: 28px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  background: #10231f;
  color: white;
  padding: 13px 14px;
  box-shadow: var(--shadow);
}

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

@media (max-width: 980px) {
  .app-cards,
  .customer-workspace,
  .driver-workspace,
  .admin-columns {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .launch-shell,
  .app-frame {
    width: min(100% - 22px, 1180px);
  }

  .app-header,
  .ride-status-panel {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .app-header {
    display: grid;
  }

  .app-switcher {
    justify-content: stretch;
  }

  .sync-pill {
    width: 100%;
  }

  .app-switcher a,
  .driver-actions button {
    flex: 1;
  }

  .inline-fields,
  .fare-card,
  .metric-grid,
  .data-strip,
  .driver-actions {
    grid-template-columns: 1fr;
  }

  .map-surface {
    height: 320px;
  }

  .launch-hero {
    background:
      linear-gradient(120deg, rgba(16, 35, 31, 0.96), rgba(20, 92, 74, 0.82)),
      var(--green);
  }
}
