/* Prognoz — оформление поверх Bootstrap 5 */
:root {
  --brand: #0e6655;
  --brand-strong: #0a4f42;
  --brand-soft: #e3f1ed;
  --surface: #fcfcfb;
  --page: #f4f5f2;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-muted: #6f6e69;
  --hairline: #e1e0d9;
  --axis: #c3c2b7;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --good: #0ca30c;
  --critical: #d03b3b;
  --bs-body-bg: var(--page);
  --bs-body-color: var(--ink);
  --bs-link-color: #1c5cab;
  --bs-link-color-rgb: 28, 92, 171;
  --bs-border-color: var(--hairline);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #3fb59a;
    --brand-strong: #6dcbb5;
    --brand-soft: #13302a;
    --surface: #1a1a19;
    --page: #0f0f0e;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --ink-muted: #9a9890;
    --hairline: #2c2c2a;
    --axis: #383835;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --bs-link-color: #86b6ef;
    --bs-link-color-rgb: 134, 182, 239;
  }
}
:root[data-theme="dark"] {
  --brand: #3fb59a;
  --brand-strong: #6dcbb5;
  --brand-soft: #13302a;
  --surface: #1a1a19;
  --page: #0f0f0e;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --ink-muted: #9a9890;
  --hairline: #2c2c2a;
  --axis: #383835;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --bs-link-color: #86b6ef;
  --bs-link-color-rgb: 134, 182, 239;
}

body { background: var(--page); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.app-nav { background: var(--brand-strong); }
:root[data-bs-theme="dark"] .app-nav { background: #12352d; }
.app-nav .navbar-brand { font-weight: 700; letter-spacing: .02em; }
.app-nav .nav-link { color: rgba(255,255,255,.82); }
.app-nav .nav-link.active, .app-nav .nav-link:hover { color: #fff; }
.app-nav .scope { color: rgba(255,255,255,.75); font-size: .85rem; }

main { padding-bottom: 4rem; }
.page-title { font-size: 1.5rem; font-weight: 650; margin: 0; }
.page-sub { color: var(--ink-2); margin: .25rem 0 0; }

.card { background: var(--surface); border-color: var(--hairline); }
.card-header { background: transparent; border-bottom-color: var(--hairline); font-weight: 600; }
.table { --bs-table-bg: var(--surface); --bs-table-color: var(--ink); --bs-table-border-color: var(--hairline); }
.table thead th { color: var(--ink-2); font-weight: 600; font-size: .8rem; text-transform: none; vertical-align: bottom; }
.table-num td.n, .table-num th.n, td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-sticky thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.table-wrap { overflow-x: auto; }
.table-compact td, .table-compact th { padding: .3rem .45rem; font-size: .85rem; }
tr.total td, tr.total th { font-weight: 650; border-top: 2px solid var(--axis); }
.muted { color: var(--ink-muted); }

.stat { background: var(--surface); border: 1px solid var(--hairline); border-radius: .6rem; padding: .9rem 1rem; height: 100%; }
.stat .label { color: var(--ink-2); font-size: .85rem; }
.stat .value { font-size: 1.65rem; font-weight: 650; line-height: 1.2; margin-top: .2rem; }
.stat .note { color: var(--ink-muted); font-size: .8rem; margin-top: .25rem; }
.stat.hero .value { font-size: 2.4rem; color: var(--brand); }

.status-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.badge-status { font-weight: 600; }

.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 420px; }
.legend-note { font-size: .8rem; color: var(--ink-muted); }

.grid-input input { max-width: 6.5rem; text-align: right; }
.sub-nav .nav-link { color: var(--ink-2); }
.sub-nav .nav-link.active { color: var(--brand); border-bottom: 2px solid var(--brand); font-weight: 600; background: transparent; }
.sub-nav { border-bottom: 1px solid var(--hairline); }
.demo-banner { background: #fff6dd; border: 1px solid #f2d78a; color: #5b4500; }
:root[data-bs-theme="dark"] .demo-banner { background: #2d2610; border-color: #6b5718; color: #f3dc9a; }
.issue-list { max-height: 420px; overflow-y: auto; }
.login-wrap { max-width: 420px; margin: 8vh auto; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; background: var(--brand-soft); padding: .15rem .4rem; border-radius: .25rem; }

@media (max-width: 576px) {
  .stat .value { font-size: 1.35rem; }
  .stat.hero .value { font-size: 1.9rem; }
  .chart-box { height: 240px; }
}
@media print {
  .app-nav, .no-print, .btn { display: none !important; }
  body { background: #fff; }
}
tr.group-start td { border-top: 2px solid var(--axis); }
