/* Кабинет: сайт, кабинет, админка. Системные шрифты (внешние шрифты отдали бы адрес посетителя чужому серверу).
   Палитра: чернильный текст, холодный серо-синий фон, акцент — глубокий синий; статусы — зелёный/янтарный/красный. */
:root {
  color-scheme: light;
  --bg: #f5f7fa; --surface: #ffffff; --soft: #eef1f6; --line: #dbe1ea;
  --ink: #18202b; --muted: #5b6677; --accent: #2851a3; --accent-ink: #ffffff; --accent-soft: #e5ecfa;
  --good: #1d7a4a; --good-soft: #e3f3ea; --warn: #9a5b00; --warn-soft: #fbf0dc; --bad: #b3261e; --bad-soft: #fbe4e2;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #11161d; --surface: #18202a; --soft: #1f2833; --line: #2c3745;
    --ink: #e6ebf2; --muted: #9aa6b6; --accent: #7aa2f0; --accent-ink: #0d1420; --accent-soft: #1e2b44;
    --good: #5cc28a; --good-soft: #17301f; --warn: #e3b05c; --warn-soft: #33270f; --bad: #f08a80; --bad-soft: #3a1b18;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; margin-top: 2.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
code { font-family: var(--mono); font-size: .85em; word-break: break-all; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); font-size: .93rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--muted); margin-bottom: .4rem; }

/* шапка и подвал */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.top nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--ink); font-size: .95rem; }
.foot { margin-top: 4rem; border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { padding-block: 1.5rem; font-size: .9rem; color: var(--muted); }
main.wrap { padding-block: 1.5rem 0; }

/* кнопки и поля */
.btn, .btn-sm, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: 8px; padding: .65rem 1.1rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-sm { padding: .35rem .8rem; font-size: .9rem; }
.top nav a.btn-sm { color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.quiet { background: var(--soft); border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn[disabled] { opacity: .55; cursor: default; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; width: 100%; }
label.f { display: grid; gap: 4px; font-size: .92rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > .btn, .row > button { flex: 0 0 auto; }

/* витрина */
.hero { padding-block: 2rem 1rem; max-width: 760px; }
.hero.small { padding-block: 1rem; }
.lede { font-size: 1.1rem; color: var(--muted); }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1.2rem; }
.svcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.svc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; }
.svc p { color: var(--muted); font-size: .95rem; }
.svc-price { margin-top: auto; color: var(--ink) !important; }
.price { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.per { color: var(--muted); }
.plus { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .92rem; color: var(--muted); }
.steps { padding-left: 1.2rem; max-width: 70ch; }
.steps li { margin-bottom: .5rem; }
ul.plain { padding-left: 1.1rem; }

/* документы */
.docnav { font-size: .92rem; }
.docnav a[aria-current] { font-weight: 700; color: var(--ink); text-decoration: none; }
.docbody { max-width: 72ch; }
.docbody h2 { font-size: 1.1rem; margin-top: 1.6rem; }
.table-wrap { overflow-x: auto; margin: .5rem 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: top; }
th { background: var(--soft); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* кабинет и админка */
.app { padding-block: 1rem 2rem; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 1rem 0; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: .6rem .8rem; font: inherit; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.panel + .panel { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.kpi b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: .88rem; }
.sub { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; padding: .9rem 0; border-top: 1px solid var(--line); }
.sub:first-child { border-top: 0; padding-top: 0; }
.sub h3 { margin: 0; }
.sub .meta { color: var(--muted); font-size: .9rem; grid-column: 1; }
.sub .act { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
@media (max-width: 560px) { .sub { grid-template-columns: 1fr; } .sub .act { grid-column: 1; grid-row: auto; justify-content: start; } }
.pill { display: inline-block; border-radius: 99px; padding: .1rem .55rem; font-size: .8rem; font-weight: 600; vertical-align: middle; }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.off { background: var(--soft); color: var(--muted); }
.note { padding: .7rem .9rem; border-radius: 8px; background: var(--accent-soft); font-size: .95rem; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg);
  padding: .6rem 1rem; border-radius: 8px; font-size: .95rem; z-index: 20; max-width: calc(100% - 32px); }
.login { max-width: 420px; margin: 2rem auto; }
.login .panel { display: grid; gap: 12px; }
.amount-pos { color: var(--good); }
.mono { font-family: var(--mono); font-size: .85rem; }
.hidden, [hidden] { display: none !important; }
.list-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-align: left; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
