:root {
  --bg: #0d1b23;
  --panel: rgba(10, 27, 36, 0.72);
  --panel-solid: #122633;
  --panel-soft: #183646;
  --text: #f2f5f7;
  --muted: #9fb4bf;
  --accent: #1db0a2;
  --accent-soft: rgba(29, 176, 162, 0.16);
  --warm: #e0a04b;
  --danger: #d96a5f;
  --success: #6ed0a3;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(29, 176, 162, 0.22), transparent 32%),
    radial-gradient(circle at left 15%, rgba(224, 160, 75, 0.16), transparent 28%),
    linear-gradient(180deg, #0a151d 0%, #0d1b23 46%, #101f29 100%);
  color: var(--text);
  font-family: "Segoe UI Variable Display", "Bahnschrift", "Trebuchet MS", sans-serif;
}

code {
  font-family: "Cascadia Code", "Consolas", monospace;
  color: #d7efe8;
}

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

button,
input,
select {
  font: inherit;
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 90%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill,
.refresh-button,
.pill,
.badge,
.filter-chip {
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid transparent;
}

.status-pill {
  font-size: 0.9rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.status-live {
  color: #d7fff2;
  background: rgba(29, 176, 162, 0.18);
  border-color: rgba(29, 176, 162, 0.28);
}

.refresh-button {
  cursor: pointer;
  background: linear-gradient(135deg, #1db0a2, #278bb9);
  color: #06212a;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(29, 176, 162, 0.22);
}

.refresh-button:hover {
  transform: translateY(-1px);
}

.hero,
.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.95fr);
  gap: 22px;
  margin-bottom: 22px;
}

.hero-copy,
.card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 34px;
}

.hero-copy h1,
.detail-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
  max-width: 11ch;
}

.hero-copy p,
.detail-subtitle,
.empty-copy,
.warning-box p,
.metric-foot,
.client-cell span,
.subtle-text {
  color: var(--muted);
}

.hero-meta,
.detail-meta,
.metric-card,
.card {
  padding: 24px;
}

.hero-meta-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.hero-meta-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.eyebrow,
.section-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.stats-grid,
.overview-grid,
.leaders-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

.overview-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
}

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

.metric-card {
  background: linear-gradient(160deg, rgba(18, 38, 51, 0.92), rgba(10, 27, 36, 0.88));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.metric-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}

.metric-value {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
}

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

.section-header h2,
.section-header-spread h2 {
  margin: 0;
  font-size: 1.35rem;
}

.bar-chart {
  display: flex;
  align-items: stretch;
  gap: 14px;
  min-height: 0;
  padding-top: 6px;
}

.bar-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 54px;
}

.bar-shell {
  width: 100%;
  height: 132px;
  display: flex;
  align-items: flex-end;
  padding: 0 6px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.bar-column {
  width: 100%;
  min-height: 14px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, #6ed0a3 0%, #1db0a2 72%, #116071 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.bar-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bar-value {
  font-weight: 700;
}

.bar-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.info-card {
  min-height: 100%;
}

.pill-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.pill-good,
.badge-good {
  background: rgba(110, 208, 163, 0.16);
  color: #d4ffeb;
  border-color: rgba(110, 208, 163, 0.32);
}

.pill-warn,
.badge-warn {
  background: rgba(224, 160, 75, 0.16);
  color: #ffe5c1;
  border-color: rgba(224, 160, 75, 0.3);
}

.pill-bad,
.badge-bad {
  background: rgba(217, 106, 95, 0.16);
  color: #ffd7d0;
  border-color: rgba(217, 106, 95, 0.3);
}

.badge-muted {
  background: rgba(159, 180, 191, 0.12);
  color: var(--muted);
  border-color: rgba(159, 180, 191, 0.18);
}

.warning-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(224, 160, 75, 0.1);
  border: 1px solid rgba(224, 160, 75, 0.2);
}

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-list-row strong,
.client-cell strong {
  display: block;
  margin-bottom: 4px;
}

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

.search-input,
.sort-select {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.search-input {
  min-width: 260px;
}

.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-chip {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.08);
}

.filter-chip.is-active {
  background: var(--accent-soft);
  color: var(--text);
  border-color: rgba(29, 176, 162, 0.32);
}

.table-wrap {
  overflow: auto;
}

.fleet-table {
  width: 100%;
  border-collapse: collapse;
}

.fleet-table th,
.fleet-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.fleet-table thead th {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.clickable-row {
  cursor: pointer;
  transition: background 0.16s ease;
}

.clickable-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mix-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mix-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mix-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.mix-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.mix-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1db0a2, #6ed0a3);
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
}

.detail-pills {
  margin-top: 18px;
}

@media (max-width: 1120px) {
  .stats-grid,
  .leaders-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero,
  .detail-hero,
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 16px 16px 42px;
  }

  .topbar,
  .controls,
  .section-header-spread {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid,
  .leaders-grid {
    grid-template-columns: 1fr;
  }

  .search-input {
    min-width: 0;
    width: 100%;
  }

  .bar-chart {
    gap: 8px;
    min-height: 210px;
  }
}
