:root {
  color-scheme: light;
  --bg: #f6f3ed;
  --panel: #fffdfa;
  --panel-soft: #f1eadf;
  --ink: #18212c;
  --muted: #697586;
  --line: #ded5c9;
  --teal: #0f8f7a;
  --blue: #2f6fbd;
  --tomato: #df5038;
  --gold: #d99a24;
  --green: #23975f;
  --shadow: 0 24px 70px rgba(45, 35, 23, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 243, 237, 0.86)),
    radial-gradient(circle at 12% 8%, rgba(223, 80, 56, 0.12), transparent 28%),
    radial-gradient(circle at 86% 4%, rgba(47, 111, 189, 0.14), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.dashboard-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 36px);
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 8px 0 28px;
}

.masthead-copy {
  max-width: 880px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--tomato);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(44px, 7.4vw, 104px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.lede {
  max-width: 660px;
  margin-bottom: 0;
  color: #445366;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.35;
}

.refresh-module {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #cabfb3;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 850;
  box-shadow: 0 12px 26px rgba(24, 33, 44, 0.17);
}

.refresh-glyph {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.refresh-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.86);
  box-shadow: 0 10px 30px rgba(24, 33, 44, 0.07);
}

.refresh-status div {
  display: grid;
  gap: 1px;
}

.refresh-status span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(217, 154, 36, 0.13);
}

.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(35, 151, 95, 0.13);
}

.status-dot.error {
  background: var(--tomato);
  box-shadow: 0 0 0 5px rgba(223, 80, 56, 0.13);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: stretch;
}

.total-panel,
.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.92);
  box-shadow: var(--shadow);
}

.total-panel {
  display: grid;
  gap: clamp(20px, 3vw, 34px);
  min-height: 440px;
  padding: clamp(22px, 3vw, 36px);
  overflow: hidden;
  position: relative;
}

.total-panel::after {
  content: "";
  position: absolute;
  inset: auto -12% -52% 40%;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 143, 122, 0.13), transparent 64%);
  pointer-events: none;
}

.total-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.updated-at,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-transform: none;
  white-space: nowrap;
}

.total-number-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  gap: clamp(18px, 4vw, 38px);
  align-items: end;
  position: relative;
  z-index: 1;
}

.total-number-row strong {
  font-size: clamp(96px, 15vw, 210px);
  line-height: 0.78;
  letter-spacing: 0;
}

.total-number-row div {
  display: grid;
  gap: 10px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: clamp(17px, 1.8vw, 22px);
  font-weight: 760;
}

.total-number-row span:first-child {
  color: var(--ink);
  font-weight: 900;
}

.city-constellation {
  display: grid;
  grid-template-columns: repeat(12, minmax(12px, 1fr));
  gap: 10px;
  align-content: end;
  min-height: 152px;
  position: relative;
  z-index: 1;
}

.city-dot {
  aspect-ratio: 1;
  min-width: 12px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(24, 33, 44, 0.1), 0 9px 18px rgba(15, 143, 122, 0.18);
}

.city-dot:nth-child(3n) {
  background: var(--blue);
}

.city-dot:nth-child(4n) {
  background: var(--tomato);
}

.city-dot:nth-child(5n) {
  background: var(--gold);
}

.metric-stack {
  display: grid;
  gap: 18px;
}

.metric-card {
  display: grid;
  align-content: space-between;
  min-height: 134px;
  padding: 20px;
}

.card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  margin: 10px 0 4px;
  font-size: clamp(38px, 4.6vw, 62px);
  line-height: 0.95;
}

.metric-card span:last-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.metric-card.active {
  background: linear-gradient(135deg, rgba(35, 151, 95, 0.14), rgba(255, 253, 250, 0.92));
}

.metric-card.live {
  background: linear-gradient(135deg, rgba(47, 111, 189, 0.14), rgba(255, 253, 250, 0.92));
}

.metric-card.top {
  background: linear-gradient(135deg, rgba(223, 80, 56, 0.13), rgba(255, 253, 250, 0.92));
}

.metric-card.top strong {
  font-size: clamp(27px, 3.2vw, 43px);
  line-height: 1.02;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.55fr);
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}

.panel {
  padding: clamp(18px, 2vw, 24px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

.city-bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 210px) minmax(0, 1fr) 64px;
  gap: 14px;
  align-items: center;
}

.bar-label {
  min-width: 0;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.bar-track {
  height: 18px;
  border-radius: 999px;
  background: #ece3d8;
  overflow: hidden;
}

.bar-fill {
  width: 0%;
  min-width: 8px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 260ms ease;
}

.bar-count {
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
  text-align: right;
}

.insight-panel {
  display: grid;
  align-content: start;
  gap: 20px;
}

.donut-wrap {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.donut {
  display: grid;
  place-items: center;
  width: min(242px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, var(--green) 0deg, #eadfce 0deg 360deg);
  box-shadow: inset 0 0 0 1px rgba(24, 33, 44, 0.08), 0 20px 48px rgba(24, 33, 44, 0.12);
}

.donut span {
  display: grid;
  place-items: center;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font-size: 34px;
  font-weight: 950;
}

.legend,
.cuisine-list {
  display: grid;
  gap: 9px;
  width: 100%;
}

.legend span,
.cuisine-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #344256;
  font-size: 13px;
  font-weight: 820;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: -1px;
}

.legend-dot.active {
  background: var(--green);
}

.legend-dot.inactive {
  background: #cbbfb1;
}

.legend-dot.live {
  background: var(--blue);
}

.city-detail-panel {
  margin-top: 18px;
}

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

.city-card {
  display: grid;
  gap: 12px;
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.city-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.city-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.city-card strong {
  font-size: 32px;
  line-height: 1;
}

.city-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.truck-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: end;
}

.truck-pill {
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f3eadb;
  color: #39465a;
  font-size: 12px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 24px;
  border: 1px dashed #b9aa9b;
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 850;
}

@media (max-width: 1040px) {
  .masthead,
  .hero-grid,
  .content-grid,
  .city-cards {
    grid-template-columns: 1fr;
  }

  .refresh-module {
    justify-items: stretch;
  }

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

@media (max-width: 720px) {
  .dashboard-shell {
    padding: 16px;
  }

  .metric-stack {
    grid-template-columns: 1fr;
  }

  .total-number-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .city-constellation {
    grid-template-columns: repeat(7, minmax(10px, 1fr));
    gap: 8px;
  }

  .bar-row {
    grid-template-columns: 1fr 56px;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .panel-header,
  .total-topline {
    display: grid;
  }
}
