/* Рабочий инструмент: плотно, спокойно, читается сканированием. Цвета графиков — из эталонной палитры dataviz */
:root {
  color-scheme: light;
  --bg: #f6f7f6;
  --surface: #fcfcfb;
  --line: #e4e6e3;
  --grid: #ebecea;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7a7974;
  --accent: #21a038; /* фирменный зелёный — только для бренда и активной вкладки */
  --series-1: #2a78d6;
  --good: #0ca30c;
  --critical: #d03b3b;
  --hover: #f0f2ef;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --line: #2c2c2a;
    --grid: #262624;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #8f8e86;
    --series-1: #3987e5;
    --hover: #222221;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; }
code { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
button, select, input { font: inherit; color: inherit; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); font-weight: 500; }
nav { display: flex; gap: 4px; }
nav a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--text-2); }
nav a.on { color: var(--text); background: var(--hover); box-shadow: inset 0 -2px 0 var(--accent); }
.controls { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.period { color: var(--text-2); display: flex; align-items: center; gap: 6px; }
select, input { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
button { cursor: pointer; border-radius: 6px; padding: 6px 12px; border: 1px solid var(--line); background: var(--surface); }
button.ghost { color: var(--text-2); }

main { max-width: 1240px; margin: 0 auto; padding: 20px 24px 60px; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 10px; }
.crumbs { color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--text-2); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid2 .panel { margin: 0; }

/* Плитки показателей */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.tile .k { color: var(--muted); font-size: 12px; }
.tile .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .s { color: var(--text-2); font-size: 12px; }

/* Графики: одна ось, тонкие столбцы со скруглённым верхом, приглушённая сетка */
.chart svg { display: block; width: 100%; height: 200px; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--series-1); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.hl { opacity: .8; }
.chart details { margin-top: 8px; color: var(--text-2); }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

.tip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--text); color: var(--surface); border-radius: 6px; padding: 6px 9px;
  font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}

/* Таблицы */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
td.n, th.n { text-align: right; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--hover); }
.scroll { overflow-x: auto; }
.id { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* Лента сессии */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 74px 170px 1fr; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); align-items: start; }
.timeline .t { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 1px; }
.timeline .what { font-weight: 600; }
.timeline .what .kind { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.timeline .props { display: flex; flex-wrap: wrap; gap: 6px; }
.timeline li.req { background: color-mix(in srgb, var(--series-1) 6%, transparent); }
.status { font-weight: 600; white-space: nowrap; }
.status.ok { color: var(--good); }
.status.err { color: var(--critical); }

.login { max-width: 380px; margin: 60px auto; display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.login label { display: grid; gap: 4px; color: var(--text-2); font-size: 13px; }
.login button { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.error { color: var(--critical); margin: 0; }
.notice { border: 1px solid var(--line); border-left-width: 1px; background: var(--surface); padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; color: var(--text-2); }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  main { padding: 14px; }
  .timeline li { grid-template-columns: 64px 1fr; }
  .timeline .props { grid-column: 2; }
}
