:root {
  color-scheme: light;
  --bg: #f4fbf6;
  --bg-2: #eaf7ee;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-2: rgba(244, 252, 247, 0.98);
  --line: rgba(38, 115, 72, 0.12);
  --line-strong: rgba(38, 115, 72, 0.22);
  --text: #163425;
  --muted: #648270;
  --primary: #39b56a;
  --primary-2: #88d96d;
  --danger: #df5a64;
  --warning: #d89631;
  --good: #229c68;
  --shadow: 0 20px 60px rgba(39, 96, 65, 0.10);
  --radius: 22px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(76, 197, 115, 0.18), transparent 26%),
    radial-gradient(circle at right center, rgba(130, 224, 170, 0.24), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  min-height: 100vh;
}
.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.hero-card, .toolbar, .panel, .table-wrap, .config-card {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.hero-card {
  padding: 28px;
  flex: 1 1 760px;
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(57, 181, 106, 0.22), transparent 70%);
}
h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}
.subtitle {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 860px;
}
.status-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(57, 181, 106, 0.08);
  border: 1px solid rgba(57, 181, 106, 0.10);
  font-size: 13px;
  color: var(--muted);
}
.toolbar {
  flex: 0 0 360px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.toolbar label, .config-card label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
.toolbar input, .toolbar select, .config-card input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(245, 252, 248, 0.96);
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}
.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
button:hover { transform: translateY(-1px); }
.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.ghost-btn {
  color: var(--text);
  background: rgba(22, 52, 37, 0.05);
  border: 1px solid rgba(22, 52, 37, 0.08);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}
.metric {
  grid-column: span 3;
  padding: 20px;
  min-height: 148px;
  position: relative;
  overflow: hidden;
}
.metric::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(57, 181, 106, 0.06), transparent 45%);
  pointer-events: none;
}
.metric-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}
.metric-value {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 10px;
}
.metric-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.panel {
  padding: 22px;
  grid-column: span 6;
  min-height: 380px;
}
.panel.wide { grid-column: span 12; }
.panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
.panel-desc {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.7;
}
.chart {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 220px;
  padding-top: 12px;
}
.bar-group {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.bars {
  height: 190px;
  display: flex;
  align-items: end;
  gap: 6px;
  justify-content: center;
}
.bar {
  width: 18px;
  min-height: 3px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #33b864, rgba(51, 184, 100, 0.18));
}
.bar.error {
  background: linear-gradient(180deg, var(--danger), rgba(223, 90, 100, 0.18));
}
.bar.route {
  width: 24px;
  background: linear-gradient(180deg, #7acb53, rgba(122, 203, 83, 0.18));
}
.chart-label {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-wrap {
  overflow: hidden;
  margin-top: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 14px 16px;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid rgba(22, 52, 37, 0.06);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(57, 181, 106, 0.04);
}
tr:last-child td { border-bottom: 0; }
.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.mini-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(57, 181, 106, 0.04);
  border: 1px solid rgba(57, 181, 106, 0.08);
}
.mini-title {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.mini-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.ok { color: var(--good); }
.warn { color: var(--warning); }
.danger { color: var(--danger); }
.hidden { display: none !important; }
.config-mask {
  position: fixed;
  inset: 0;
  background: rgba(27, 70, 43, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
  backdrop-filter: blur(10px);
}
.config-card {
  width: min(560px, 100%);
  padding: 28px;
}
.config-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
}
.config-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}
.help {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 16px 0 4px;
}
@media (max-width: 1180px) {
  .metric { grid-column: span 6; }
  .panel { grid-column: span 12; }
}
@media (max-width: 760px) {
  .shell { padding: 16px; }
  .metric { grid-column: span 12; }
  .hero-card, .toolbar, .panel { padding: 18px; }
  h1 { font-size: 28px; }
  .mini-grid { grid-template-columns: 1fr; }
  .bars { gap: 4px; }
  .bar { width: 12px; }
  .bar.route { width: 16px; }
  th:nth-child(4), td:nth-child(4), th:nth-child(5), td:nth-child(5) { display: none; }
}
