:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --acc: #2a78d6; --up: #138a4b; --down: #c4352b; --sub: #f3f5f8;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 8px 16px; background: #1d2330; color: #fff; }
.top a { color: #cfd6e2; }
.top .brand { color: #fff; font-weight: 600; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1; }
.top nav a.on { color: #fff; border-bottom: 2px solid #fff; }
.me { display: flex; gap: 12px; align-items: center; font-size: 12px; color: #aab3c2; }
.me form { margin: 0; }
button.link { background: none; border: 0; color: #cfd6e2; cursor: pointer; padding: 0; font: inherit; }
main { padding: 16px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 18px 0 6px; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; }
.head .sub { color: var(--muted); }
.btn { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.btn.xl { margin-left: auto; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; background: var(--card); padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.filters label.chk { flex-direction: row; align-items: center; gap: 4px; color: var(--ink); padding-bottom: 6px; }
.filters input, .filters select, .login input { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.filters button, .login button, form.inline button { font: inherit; padding: 5px 12px; border: 0; border-radius: 6px; background: var(--acc); color: #fff; cursor: pointer; }
.quick { display: flex; gap: 10px; font-size: 12px; padding-bottom: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.tile .t { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 20px; font-weight: 600; margin: 2px 0; white-space: nowrap; }
.tile .c { font-size: 12px; color: var(--muted); }
.tbl { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px 10px; margin-bottom: 14px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; position: sticky; top: 0; background: var(--card); }
td { padding: 4px 8px; border-bottom: 1px solid #f0f2f5; white-space: nowrap; }
td:first-child { white-space: normal; min-width: 180px; }
.n { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
tr.sub td { background: var(--sub); }
td.ind { padding-left: 24px; }
tr.total td, tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
tr.warn td { background: #fff5f4; }
tr.muted td { color: var(--muted); }
tr.ok td:first-child::before { content: "● "; color: var(--up); }
tr.bad td:first-child::before { content: "● "; color: var(--down); }
tr.warnc td:first-child::before { content: "● "; color: #e0a100; }
.note { color: var(--muted); font-size: 12px; margin: 4px 0; }
.flash { padding: 8px 12px; border-radius: 6px; background: #e8f4ec; margin-bottom: 10px; }
.flash.err { background: #fdecea; }
.chart { width: 100%; height: 180px; margin: 6px 0 0; }
.chart text { font-size: 9px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.info { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.login { max-width: 320px; margin: 12vh auto; display: flex; flex-direction: column; gap: 12px; background: var(--card); padding: 24px; border: 1px solid var(--line); border-radius: 10px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
form.inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
form.inline select, form.inline input { font: inherit; padding: 3px 5px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 700px) {
  main { padding: 10px; }
  .tile .v { font-size: 17px; }
  .me .asof { display: none; }
}
@media print { .top, .filters, .btn { display: none; } }

/* группы строк */
tr.grp { cursor: pointer; font-weight: 600; background: var(--grp, rgba(127,127,127,.08)); }
tr.grp td:first-child::before { content: "▸ "; display: inline-block; width: 1.1em; }
tr.grp.opened td:first-child::before, table.open tr.grp td:first-child::before { content: "▾ "; }
tr.child { display: none; }
tr.child.shown, table.open tr.child { display: table-row; }
tr.child td:first-child { padding-left: 1.6em; }
