/* Завод роботов — панель управления */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-hover: #f8f9fb;
  --border: #e4e7ec;
  --border-strong: #cbd2dd;
  --grid: rgba(16, 24, 40, 0.07);

  --text: #0f172a;
  --text-2: #475467;
  --text-3: #667085;

  --ink: #0f172a;
  --ink-text: #ffffff;

  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;

  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --blue-border: #bfdbfe;
  --cobalt: #2563eb;

  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;

  --red: #e11d48;
  --red-bg: #fff1f2;
  --red-border: #fecdd3;
  --signal: #e11d48;

  --s1: #2563eb;
  --s2: #f59e0b;
  --s3: #059669;
  --s4: #0f172a;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 20px -6px rgba(16, 24, 40, 0.08);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #12151d;
  --surface-2: #191d28;
  --surface-hover: #1e2330;
  --border: #242938;
  --border-strong: #373f54;
  --grid: rgba(255, 255, 255, 0.07);

  --text: #f3f5f9;
  --text-2: #a5afc2;
  --text-3: #6c768a;

  --ink: #f3f5f9;
  --ink-text: #0b0d12;

  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.13);
  --emerald-border: rgba(16, 185, 129, 0.32);

  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, 0.14);
  --blue-border: rgba(96, 165, 250, 0.34);
  --cobalt: #60a5fa;

  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.13);
  --amber-border: rgba(251, 191, 36, 0.32);

  --red: #fb7185;
  --red-bg: rgba(251, 113, 133, 0.14);
  --red-border: rgba(251, 113, 133, 0.34);
  --signal: #fb7185;

  --s1: #60a5fa;
  --s2: #fbbf24;
  --s3: #34d399;
  --s4: #e2e8f0;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 28px -8px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* ---------- Каркас ---------- */
.layout {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Боковая панель ---------- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.brand {
  height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-logo span {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--emerald);
}

.brand-name {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-3);
}

.sb-section {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sb-caption {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin: 0 0 10px 6px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font: 500 13.5px/1.2 "Inter", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
}

.nav-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
  color: var(--text-3);
}

.nav-item.active .nav-icon {
  color: var(--emerald);
}

.nav-text {
  flex: 1;
}

.nav-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
}

.nav-item.active .nav-badge {
  color: var(--text);
  border-color: var(--border-strong);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field > span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
}

select,
input[type="number"] {
  width: 100%;
  font: 500 13px/1.3 "Inter", sans-serif;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

select:hover,
input[type="number"]:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

select:focus,
input[type="number"]:focus {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.btn-primary {
  width: 100%;
  margin-top: 2px;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--ink-text);
  font: 600 13px/1.2 "Inter", sans-serif;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-ghost {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font: 500 12.5px/1.2 "Inter", sans-serif;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.sb-footer {
  margin-top: auto;
  padding: 16px;
}

.status-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 13px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}

.status-dot.on {
  background: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-bg);
}

.status-label {
  font-size: 12.5px;
  font-weight: 600;
}

.status-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-progress {
  margin-top: 10px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.status-progress-fill {
  height: 100%;
  background: var(--emerald);
  transition: width 0.2s ease;
}

/* ---------- Верхняя панель ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 60px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.crumb-muted { color: var(--text-3); }
.crumb-sep { color: var(--border-strong); }
.crumb-active { font-weight: 600; color: var(--text); }

.run-pill {
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.sync-indicator {
  font-size: 11.5px;
  color: var(--text-3);
}

/* ---------- Контейнер ---------- */
.container {
  padding: 24px 28px 52px;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.empty-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}

/* ---------- Таймлайн ---------- */
.timeline-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.timeline-bar[hidden] {
  display: none;
}

.play-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.play-btn:hover {
  background: var(--ink);
  color: var(--ink-text);
  border-color: var(--ink);
}

.timeline-slider {
  flex: 1;
  display: flex;
  align-items: center;
}

.timeline-bar input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.timeline-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
}

.timeline-bar input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
}

.tick-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  min-width: 96px;
  text-align: center;
}

.follow-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.follow-check input {
  accent-color: var(--emerald);
  cursor: pointer;
}

/* ---------- Разделы ---------- */
.view {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.view.active {
  display: flex;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
}

.kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 4px;
}

.section-head h1 {
  margin: 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 10px;
}

.accent-num {
  color: var(--emerald);
}

.head-note {
  margin: 0;
  max-width: 520px;
  font-size: 13px;
  color: var(--text-3);
}

.floor-summary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--r-sm);
}

/* ---------- Вторичные метрики ---------- */
.metric-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}

.chip-k {
  color: var(--text-3);
}

.chip-v {
  font-weight: 600;
  color: var(--text);
}

.chip.chip-bad {
  background: var(--red-bg);
  border-color: var(--red-border);
}

.chip.chip-bad .chip-v {
  color: var(--red);
}

/* ---------- Карточки KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi.kpi-profit { border-top-color: var(--emerald); }
.kpi.kpi-produced { border-top-color: var(--blue); }
.kpi.kpi-sold { border-top-color: var(--amber); }
.kpi.kpi-price { border-top-color: var(--ink); }

.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.kpi-val {
  margin-top: 8px;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.kpi.kpi-profit .kpi-val {
  color: var(--emerald);
}

.kpi-sub {
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Графики ---------- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

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

.card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-tag {
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: var(--r-sm);
}

canvas {
  width: 100%;
  height: 224px;
  display: block;
  cursor: crosshair;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--text-2);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

/* ---------- Цех ---------- */
.floor-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.cell {
  position: relative;
  height: 62px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cell-idx {
  position: absolute;
  top: 4px;
  left: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  color: var(--text-3);
  opacity: 0.7;
}

.cell.full {
  border-style: solid;
  border-color: var(--border);
  border-bottom: 3px solid var(--c, var(--blue));
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.cell.reserved {
  background: repeating-linear-gradient(
    -45deg,
    var(--surface-2) 0 6px,
    var(--surface) 6px 12px
  );
  border-color: var(--border-strong);
  color: var(--text-3);
  font-size: 11px;
}

.cell .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.state-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
}

.badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
}

.badge-ok {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald);
}

.badge-busy {
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--blue);
}

.badge-warn {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: var(--amber);
}

/* ---------- Таблицы ---------- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  background: var(--surface-2);
}

tbody tr:hover td {
  background: var(--surface-hover);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.best {
  background: var(--emerald-bg);
}

td.best .p-num {
  color: var(--emerald);
  font-weight: 700;
}

.best-tag {
  margin-left: 5px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--emerald);
  color: #ffffff;
  vertical-align: middle;
}

.price-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 136px;
}

.price-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.p-num {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
}

.p-rng {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-3);
}

.price-bar {
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.price-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
}

td.best .price-bar > i {
  background: var(--emerald);
}

.row-meta td {
  background: var(--surface-2);
  font-size: 12.5px;
}

.ok { color: var(--emerald); font-weight: 600; }
.no { color: var(--red); font-weight: 600; }

/* ---------- Журнал сделок ---------- */
.title-count {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.sales-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tool-select {
  width: auto;
  min-width: 155px;
  padding: 7px 10px;
  font-size: 12.5px;
  background: var(--surface);
}

.segmented {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
}

.seg {
  padding: 5px 11px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-2);
  font: 500 12.5px/1.2 "Inter", sans-serif;
  cursor: pointer;
}

.seg:hover {
  color: var(--text);
}

.seg.active {
  background: var(--ink);
  color: var(--ink-text);
  font-weight: 600;
}

.pill-ok {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald);
  font-size: 12px;
  font-weight: 600;
}

.pill-no {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
}

.sales-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.sw {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}

.empty-note {
  margin: 0;
  padding: 12px 0;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- Тултип ---------- */
.tip {
  position: fixed;
  pointer-events: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: var(--shadow-md);
  z-index: 40;
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-item {
    width: auto;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .charts-grid,
  .floor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 14px;
  }
  .container {
    padding: 16px 14px 40px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .section-head h1 {
    font-size: 22px;
  }
  .run-pill {
    display: none;
  }
}
