:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #5e6865;
  --line: #dbe5df;
  --paper: #f7faf7;
  --surface: #ffffff;
  --teal: #0f766e;
  --teal-dark: #0b4f4a;
  --coral: #e46d53;
  --gold: #f2bd45;
  --sky: #5a93c8;
  --shadow: 0 12px 28px rgba(24, 42, 38, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.12), transparent 300px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo-full {
  width: clamp(180px, 34vw, 330px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(24, 42, 38, 0.12));
}

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

.eyebrow,
.metric-label,
.land {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 8vw, 4.8rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal-dark);
  box-shadow: var(--shadow);
  font-size: 1.4rem;
}

.text-button {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.status-band {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.status-band > div {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.status-band strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: clamp(1rem, 3vw, 1.45rem);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 18px 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

.tab {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--teal);
  color: white;
}

.toolbar {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 170px;
  gap: 10px;
  margin-bottom: 18px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search input,
.toolbar select {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.toolbar select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.recommendations {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.recommendation {
  min-height: 112px;
  padding: 14px;
  border-radius: 8px;
  background: var(--teal-dark);
  color: white;
}

.recommendation:nth-child(2) {
  background: #315f8a;
}

.recommendation:nth-child(3) {
  background: #8c553d;
}

.recommendation:nth-child(4) {
  background: #6b6543;
}

.recommendation p,
.recommendation h3 {
  margin: 0;
}

.recommendation p {
  opacity: 0.82;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.recommendation h3 {
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.16;
}

.ride-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ride-card {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(24, 42, 38, 0.06);
}

.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 1.15rem;
}

.favorite-button.active {
  border-color: rgba(242, 189, 69, 0.7);
  background: rgba(242, 189, 69, 0.22);
  color: #8b6200;
}

.ride-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding-right: 30px;
}

.wait-pill {
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #e8f4f1;
  color: var(--teal-dark);
}

.wait-pill strong {
  font-size: 1.7rem;
  line-height: 1;
}

.wait-pill span {
  margin-top: -14px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.ride-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.ride-meta span {
  padding: 6px 8px;
  border-radius: 999px;
  background: #edf2ef;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ride-meta .closed {
  background: rgba(228, 109, 83, 0.14);
  color: #9b3d28;
}

.sparkline-wrap {
  margin: 12px 0 14px;
  padding: 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.sparkline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sparkline-head strong {
  color: var(--teal-dark);
  white-space: nowrap;
}

.sparkline {
  display: block;
  width: 100%;
  height: 58px;
  overflow: visible;
}

.sparkline text {
  fill: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.sparkline-fill {
  fill: rgba(15, 118, 110, 0.09);
  stroke: none;
}

.sparkline-line {
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.sparkline-line.up {
  stroke: var(--coral);
}

.sparkline-line.down {
  stroke: #315f8a;
}

.sparkline-dot {
  fill: white;
  stroke: currentColor;
  stroke-width: 3;
  color: var(--teal-dark);
}

.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.card-actions label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.threshold-input {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.alert-button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--coral);
  color: white;
  font-weight: 800;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-rows {
  display: grid;
  gap: 10px;
}

.notification-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.notification-bar p {
  margin: 2px 0 0;
  color: var(--muted);
}

.alert-row,
.empty-state {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.alert-row p {
  margin: 2px 0 0;
  color: var(--muted);
}

.alert-actions {
  display: flex;
  gap: 8px;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 12px;
  margin-top: 16px;
}

.admin-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

.admin-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.status-list,
.fact-list {
  display: grid;
  gap: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.status-row p {
  margin: 3px 0 0;
  color: var(--muted);
}

.error-text {
  color: #9b3d28 !important;
}

.health-pill {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.health-pill.ok {
  background: #e8f4f1;
  color: var(--teal-dark);
}

.health-pill.warn {
  background: rgba(228, 109, 83, 0.14);
  color: #9b3d28;
}

.fact-list {
  margin: 0;
}

.fact-list div {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.fact-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fact-list dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-logo-full {
    width: min(260px, 72vw);
  }

  .status-band,
  .recommendations,
  .admin-grid,
  .ride-list {
    grid-template-columns: 1fr;
  }

  .status-band {
    display: flex;
    overflow-x: auto;
  }

  .status-band > div {
    min-width: 190px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .recommendations {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .recommendation {
    min-width: 220px;
    scroll-snap-align: start;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .alert-button {
    width: 100%;
  }
}
