:root {
  --bg:#F4F2EE; --surface:#FFFFFF; --surface-2:#ECE9E3; --ink:#23292D;
  --ink-2:#6B7176; --line:#E0DCD4; --accent:#14655A; --accent-soft:#E3EEEB;
  --on-accent:#F5FAF8; --warn:#9A6A14; --warn-soft:#F5EAD3; --neg:#B04A3E;
  --shadow:0 1px 2px rgba(35,41,45,.06),0 8px 24px rgba(35,41,45,.07);
  --radius:14px;
  /* палитра серий графика (валидирована dataviz-скриптом на светлой теме) */
  --viz-0:#2a78d6; --viz-1:#eb6834; --viz-2:#1baf7a;
  --viz-3:#eda100; --viz-4:#e87ba4; --viz-5:#008300;
}
/* Тёмный набор переменных подключается двумя путями (v1.3):
   1) системная тёмная тема, если пользователь не форсировал светлую;
   2) явный выбор «Тёмная» в переключателе (data-theme="dark"). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#14181B; --surface:#1D2327; --surface-2:#262D32; --ink:#E9E5DE;
    --ink-2:#9AA1A6; --line:#313940; --accent:#46A38F; --accent-soft:#21332F;
    --on-accent:#0E1F1B; --warn:#D9A854; --warn-soft:#37301F; --neg:#D97D70;
    --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.35);
    --viz-0:#3987e5; --viz-1:#d95926; --viz-2:#199e70;
    --viz-3:#c98500; --viz-4:#d55181; --viz-5:#008300;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:#14181B; --surface:#1D2327; --surface-2:#262D32; --ink:#E9E5DE;
  --ink-2:#9AA1A6; --line:#313940; --accent:#46A38F; --accent-soft:#21332F;
  --on-accent:#0E1F1B; --warn:#D9A854; --warn-soft:#37301F; --neg:#D97D70;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.35);
  --viz-0:#3987e5; --viz-1:#d95926; --viz-2:#199e70;
  --viz-3:#c98500; --viz-4:#d55181; --viz-5:#008300;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; background:var(--bg); color:var(--ink);
  font:16px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
.stage { max-width:760px; margin:0 auto; padding:12px 12px 48px; }
/* v1.3: табличные страницы (журнал/отчёт/проверки/табель/аналитика) на
   десктопе расширяются; поля фильтров при этом не растягиваются бессмысленно */
@media (min-width: 1000px) {
  .stage.wide { max-width:min(1520px, 96vw); }
  .stage.wide .filters { grid-template-columns:repeat(auto-fit, minmax(150px, 215px));
    justify-content:start; }
  .stage.wide .filters .btn-2 { min-width:130px; }
  /* v1.8: узкая форма на широкой странице -- карточки ПВЗ/сотрудника
     не «прыгают» по ширине относительно своих списков */
  .stage.wide .narrow-in-wide { max-width:736px; margin:0 auto; }
}
.num { font-variant-numeric:tabular-nums; white-space:nowrap;
  font-family:ui-monospace,"Cascadia Mono",Consolas,monospace; }
.topbar { display:flex; flex-direction:column; gap:6px; padding:8px 4px 14px; }
.topbar-top { display:flex; align-items:center; justify-content:space-between;
  gap:14px; }
.topbar-actions { display:flex; align-items:center; gap:6px; }
.topbar-min { display:flex; justify-content:flex-end; padding:10px 4px 0; }
.theme-btn svg { display:none; }
.theme-btn[data-mode="light"] .th-light { display:block; }
.theme-btn[data-mode="dark"] .th-dark { display:block; }
.theme-btn[data-mode="auto"] .th-auto,
.theme-btn:not([data-mode]) .th-auto { display:block; }
.wordmark { font-weight:800; font-size:20px; letter-spacing:-.02em;
  color:var(--ink); text-decoration:none; }
.wordmark.big { font-size:26px; }
.wordmark em { color:var(--accent); font-style:normal; }
.mainnav { display:flex; gap:2px; flex-wrap:wrap; }
.mainnav a { color:var(--ink-2); text-decoration:none; font-weight:600;
  font-size:14px; padding:7px 10px; border-radius:999px; }
.mainnav a:hover { background:var(--surface-2); color:var(--ink); }
.mainnav a.on { background:var(--accent-soft); color:var(--accent); }
.linklike { border:0; background:none; color:var(--ink-2); font:600 14px/1
  system-ui,sans-serif; cursor:pointer; padding:7px 10px; flex:0 0 auto; }
.card { background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow); padding:18px;
  margin-bottom:14px; }
.auth-card { max-width:420px; margin:8vh auto 0; text-align:center; }
.auth-card form { text-align:left; margin-top:14px; }
.stack { display:grid; gap:12px; }
.field { display:grid; gap:6px; }
.label { font-size:12px; letter-spacing:.07em; text-transform:uppercase;
  color:var(--ink-2); font-weight:600; }
input, select, textarea { width:100%; background:var(--surface-2);
  border:1px solid var(--line); border-radius:var(--radius);
  padding:12px 14px; font:inherit; color:var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible,
a:focus-visible {
  outline:2px solid var(--accent); outline-offset:1px; }
.cta { border:0; width:100%; padding:14px; border-radius:var(--radius);
  background:var(--accent); color:var(--on-accent); font:700 16px/1
  system-ui,sans-serif; cursor:pointer; }
.cta:hover { filter:brightness(1.07); }
.btn-2 { display:inline-flex; align-items:center; justify-content:center;
  gap:8px; border:1.5px solid var(--accent); background:none;
  color:var(--accent); padding:11px 16px; border-radius:var(--radius);
  font:700 14px/1 system-ui,sans-serif; cursor:pointer; text-decoration:none; }
.btn-2:hover { background:var(--accent-soft); }
.btn-danger { border-color:var(--neg); color:var(--neg); }
.btn-danger:hover { background:color-mix(in srgb, var(--neg) 12%, transparent); }
.del-form { margin-top:10px; }
.inline-del { display:inline; }
.muted { color:var(--ink-2); }
.small { font-size:13px; }
.error { background:var(--warn-soft); color:var(--warn);
  border-radius:var(--radius); padding:11px 14px; font-weight:600; }
.ok { background:var(--accent-soft); color:var(--accent);
  border-radius:var(--radius); padding:11px 14px; font-weight:600; }
.seg { display:grid; grid-template-columns:1fr 1fr; gap:4px;
  background:var(--surface-2); border-radius:var(--radius); padding:4px; }
.seg label { text-align:center; padding:10px 6px; border-radius:10px;
  font-weight:600; color:var(--ink-2); cursor:pointer; }
.seg input { display:none; }
.seg input:checked + span { display:block; margin:-10px -6px; padding:10px 6px;
  border-radius:10px; background:var(--surface); color:var(--accent);
  box-shadow:var(--shadow); }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.checkline { display:flex; align-items:center; gap:10px;
  background:var(--surface-2); border:1px solid var(--line);
  border-radius:var(--radius); padding:12px 14px; }
.checkline input { width:20px; height:20px; accent-color:var(--accent); }
.checkline .hint { color:var(--ink-2); font-size:13px; }
table.data { width:100%; border-collapse:collapse; font-size:14px; }
table.data th { text-align:left; font-size:11px; letter-spacing:.06em;
  text-transform:uppercase; color:var(--ink-2); padding:8px 8px;
  border-bottom:1px solid var(--line); }
table.data td { padding:9px 8px; border-bottom:1px solid var(--line);
  vertical-align:top; }
table.data td.r, table.data th.r { text-align:right; white-space:nowrap; }
table.data td.actions, table.data th.actions { width:1%; white-space:nowrap; }
.nowrap { white-space:nowrap; }
.ellip { display:inline-block; max-width:320px; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; vertical-align:bottom; }
@media (max-width:560px) { .ellip { max-width:200px; } }
.tablewrap { overflow-x:auto; }
/* v1.12: первый столбец («Точка») закреплён при горизонтальной прокрутке */
table.sticky-col th:first-child, table.sticky-col td:first-child {
  position:sticky; left:0; background:var(--surface); z-index:2;
  box-shadow:1px 0 0 var(--line); }
/* значение из ручного плана (карточка «План ЗП и налогов») */
.plan-mark { border-bottom:1px dashed var(--warn); cursor:help; }
/* v1.13: раскрытие неучтённых расходов в «Итогах точек» */
.row-toggle { background:none; border:0; padding:0 4px; cursor:pointer;
  color:var(--ink-2); font:inherit; }
tr.unp-detail td.sub { padding-left:28px; color:var(--ink-2); }
details.unp-month { margin-top:8px; }
details.unp-month > summary { cursor:pointer; color:var(--ink-2);
  font-size:13px; }
/* v1.13: обязательный выбор типа траты (учтённая/неучтённая) */
.type-choice { display:flex; gap:14px; align-items:center; padding:12px 2px; }
.type-choice label { display:flex; gap:6px; align-items:center;
  white-space:nowrap; cursor:pointer; }
.type-choice input { width:18px; height:18px; accent-color:var(--accent); }
.neg { color:var(--neg); }
.pill { display:inline-block; font-size:12px; font-weight:600;
  background:var(--accent-soft); color:var(--accent); border-radius:999px;
  padding:3px 9px; margin-left:8px; vertical-align:middle; white-space:nowrap; }
.pill.warn { background:var(--warn-soft); color:var(--warn); }
/* v1.18: строка пополнения остатка в журнале трат */
.spend-journal .plus { color:var(--accent); }
/* v1.18.1: выбор точек — выпадающий список с галочками (details);
   без min-width: ширину задаёт ячейка грида .filters (иначе распирает
   колонку 1fr на мобиле — горизонтальный скролл) */
.pvz-dd { position:relative; min-width:0; }
.pvz-dd > summary { list-style:none; cursor:pointer; display:block;
  background:var(--surface-2); border:1px solid var(--line);
  border-radius:var(--radius); padding:12px 38px 12px 14px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  position:relative; }
.pvz-dd > summary::-webkit-details-marker { display:none; }
.pvz-dd > summary::after { content:""; position:absolute; right:14px;
  top:50%; width:8px; height:8px; margin-top:-6px;
  border-right:2px solid var(--ink-2); border-bottom:2px solid var(--ink-2);
  transform:rotate(45deg); }
.pvz-dd[open] > summary::after { transform:rotate(-135deg); margin-top:-2px; }
.pvz-dd .pvz-choice { position:absolute; z-index:30; left:0; right:0;
  top:calc(100% + 4px); display:flex; flex-direction:column; gap:8px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius); padding:12px 14px; min-width:260px;
  box-shadow:0 8px 24px rgba(0,0,0,.18); max-height:320px; overflow:auto; }
.pvz-dd .pvz-choice .checkline { white-space:nowrap; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px; }
.tile { background:var(--surface-2); border-radius:var(--radius);
  padding:12px 14px; }
.tile .v { font-size:19px; font-weight:700; margin-top:2px; white-space:nowrap; }
.inline-form { display:flex; gap:8px; flex-wrap:wrap; align-items:end; }
.inline-form .field { flex:1; min-width:120px; }
h1 { font-size:22px; margin:6px 0 12px; letter-spacing:-.01em; }
h2 { font-size:16px; margin:14px 0 8px; }
/* v1.3: денежные ячейки шире -- 9 знаков помещаются целиком */
input.cell { padding:6px 9px; border-radius:8px; min-width:112px;
  max-width:150px; text-align:right; }
input.cell.note { display:block; max-width:150px; margin-top:4px;
  padding:5px 8px; font-size:12px; text-align:left; }
.backlink { display:inline-block; padding:8px 14px; border:1px solid var(--line);
  border-radius:999px; background:var(--surface); color:var(--ink-2);
  font-size:13px; font-weight:600; text-decoration:none; margin:0 0 12px; }
.backlink:hover { background:var(--surface-2); color:var(--ink); }
.tabs { display:inline-flex; gap:4px; background:var(--surface-2);
  border-radius:var(--radius); padding:4px; margin-bottom:14px; }
.tab-pill { padding:8px 14px; border-radius:10px; font-weight:600;
  font-size:14px; color:var(--ink-2); text-decoration:none; }
.tab-pill.on { background:var(--surface); color:var(--accent);
  box-shadow:var(--shadow); }
.btn-mini { display:inline-block; padding:6px 12px; border-radius:10px;
  border:1px solid var(--line); background:var(--surface-2); color:var(--ink);
  font-size:13px; font-weight:600; text-decoration:none; cursor:pointer; }
.btn-mini.danger { background:none; color:var(--neg); border-color:var(--neg); }
.btn-mini.danger:hover { background:color-mix(in srgb, var(--neg) 12%, transparent); }

/* ---- заголовок раздела: h1 слева, основное действие справа ---- */
.page-head { display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.page-head h1 { margin:0; }
.head-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.btn-solid { display:inline-flex; align-items:center; justify-content:center;
  gap:8px; border:0; background:var(--accent); color:var(--on-accent);
  padding:0 18px; height:40px; border-radius:var(--radius);
  font:700 14px/1 system-ui,sans-serif; cursor:pointer; text-decoration:none;
  white-space:nowrap; flex:0 0 auto; }
.btn-solid:hover { filter:brightness(1.07); }

/* ---- карточка фильтров: поля в ряд, кнопка той же высоты, что инпуты ---- */
.filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:12px 14px; align-items:end; }
.filters .field { min-width:0; }
.filters .btn-2 { height:47px; white-space:nowrap; }
.inline-form .btn-2 { height:47px; }
@media (max-width:560px) {
  .filters { grid-template-columns:1fr 1fr; gap:10px 12px; }
  .filters .field.wide { grid-column:1 / -1; }
  .filters .btn-2 { grid-column:1 / -1; }
}

/* ---- квадратные иконки-кнопки: править / удалить в одной ячейке ---- */
.icon-actions { display:flex; align-items:center; gap:6px; flex-wrap:nowrap;
  white-space:nowrap; }
.icon-actions form { margin:0; }
.icon-btn { display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; flex:0 0 36px; padding:0; border-radius:10px;
  border:1px solid var(--line); background:var(--surface-2); color:var(--ink-2);
  cursor:pointer; text-decoration:none; }
.icon-btn svg { width:18px; height:18px; stroke:currentColor; stroke-width:1.8;
  stroke-linecap:round; stroke-linejoin:round; fill:none; }
.icon-btn:hover { background:var(--accent-soft); color:var(--accent);
  border-color:var(--accent); }
.icon-btn.danger { color:var(--neg); }
.icon-btn.danger:hover { background:color-mix(in srgb, var(--neg) 14%, transparent);
  color:var(--neg); border-color:var(--neg); }

/* ---- список людей (owner/users): карточки-строки вместо тесной таблицы ---- */
.person-row { padding:14px 0; border-bottom:1px solid var(--line); }
.person-row:last-child { border-bottom:0; padding-bottom:2px; }
.person-row:first-child { padding-top:2px; }
.person-top { display:flex; align-items:center; gap:10px; }
.person-id { display:flex; align-items:center; min-width:0; flex:1 1 auto; }
.person-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-weight:600; }
.person-top .icon-actions { flex:0 0 auto; }
.person-meta { color:var(--ink-2); font-size:13px; margin-top:3px; }
.reset-form { display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin-top:10px; }
.reset-form input.cell { flex:1 1 140px; max-width:260px; text-align:left; }
.reset-form .btn-mini { flex:0 0 auto; }

/* ---- лист проверок: смены-ссылки, метки ШК, сортируемые заголовки ---- */
.shift-line { margin:2px 0; }
.shift-link { color:var(--accent); font-weight:600; text-decoration:none;
  border-bottom:1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  padding-bottom:1px; }
.shift-link:hover { border-bottom-style:solid;
  background:color-mix(in srgb, var(--accent) 10%, transparent); }
.shk-tag { display:inline-block; font-size:12px; font-weight:600;
  color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line);
  border-radius:999px; padding:2px 8px; margin-left:6px;
  vertical-align:middle; white-space:nowrap; }
table.data th[data-sort] { cursor:pointer; user-select:none; }
table.data th[data-sort]::after { content:"↕"; opacity:.4; margin-left:5px;
  font-size:10px; }
table.data th[data-sort].sorted-asc::after { content:"↑"; opacity:1; }
table.data th[data-sort].sorted-desc::after { content:"↓"; opacity:1; }
table.data th[data-sort]:hover { color:var(--ink); }
/* ---- модальное окно конфликтов (v1.3) ---- */
.modal-back { position:fixed; inset:0; z-index:100; padding:16px;
  background:rgba(10, 14, 16, .5); display:flex; align-items:center;
  justify-content:center; }
.modal { width:min(470px, 100%); max-height:88vh; overflow-y:auto;
  margin:0; }
.modal h2 { margin:0 0 8px; }
.modal ul { margin:8px 0 14px; padding-left:20px; }
.modal li { margin:5px 0; }
.modal-actions { display:flex; gap:10px; margin-top:16px; }
.modal-actions .cta { flex:1; }
.modal-actions .btn-2 { flex:0 0 auto; }
body.modal-open { overflow:hidden; }

/* ---- комбобокс ФИО ---- */
.combo { position:relative; }
.combo-list { position:absolute; z-index:40; top:calc(100% + 4px); left:0;
  right:0; margin:0; padding:6px; list-style:none; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); max-height:264px; overflow-y:auto; }
.combo-list li { padding:9px 11px; border-radius:9px; cursor:pointer;
  font-size:14px; }
.combo-list li:hover, .combo-list li.act { background:var(--accent-soft);
  color:var(--accent); }
.combo-error .combo-input { outline:2px solid var(--neg); outline-offset:1px; }
.combo-hint { display:none; color:var(--neg); font-size:12px; font-weight:600;
  margin-top:5px; }
.combo-error .combo-hint { display:block; }

.th-sort { color:inherit; text-decoration:none; }
.th-sort::after { content:" ↕"; opacity:.4; font-size:10px; }
.th-sort.on::after { content:""; }
.th-sort:hover { color:var(--ink); }
.th-sort.on { color:var(--accent); }

/* ---- аналитика ШК: чипы-чекбоксы ПВЗ, легенда, SVG-график ---- */
.chip-checks { display:flex; gap:8px; flex-wrap:wrap; }
/* position:relative удерживает спрятанный чекбокс внутри чипа -- иначе
   absolute-инпут шириной 100% растягивался за окно (скролл страницы) */
.chip-check { display:inline-flex; position:relative; }
.chip-check input { position:absolute; opacity:0; pointer-events:none; }
.chip-check span { display:inline-block; padding:8px 14px; border-radius:999px;
  border:1.5px solid var(--line); background:var(--surface-2);
  color:var(--ink-2); font-size:13px; font-weight:600; cursor:pointer;
  user-select:none; }
.chip-check input:checked + span { border-color:var(--accent);
  background:var(--accent-soft); color:var(--accent); }
.chip-check input:focus-visible + span { outline:2px solid var(--accent);
  outline-offset:1px; }
.legend { display:flex; gap:14px; flex-wrap:wrap; margin:0 2px 10px; }
.legend-chip { display:inline-flex; align-items:center; gap:7px;
  font-size:13px; font-weight:600; color:var(--ink); }
.viz-swatch { width:12px; height:12px; border-radius:4px; display:inline-block; }
.viz-bg0 { fill:var(--viz-0); background:var(--viz-0); }
.viz-bg1 { fill:var(--viz-1); background:var(--viz-1); }
.viz-bg2 { fill:var(--viz-2); background:var(--viz-2); }
.viz-bg3 { fill:var(--viz-3); background:var(--viz-3); }
.viz-bg4 { fill:var(--viz-4); background:var(--viz-4); }
.viz-bg5 { fill:var(--viz-5); background:var(--viz-5); }
.viz-c0 { stroke:var(--viz-0); } .viz-c1 { stroke:var(--viz-1); }
.viz-c2 { stroke:var(--viz-2); } .viz-c3 { stroke:var(--viz-3); }
.viz-c4 { stroke:var(--viz-4); } .viz-c5 { stroke:var(--viz-5); }
.chartwrap { overflow-x:auto; }
.viz { display:block; width:100%; min-width:640px; height:auto; }
.viz-grid { stroke:var(--line); stroke-width:1; }
.viz-axis { stroke:var(--ink-2); stroke-width:1; opacity:.55; }
.viz-lab { fill:var(--ink-2); font-size:12px;
  font-family:ui-monospace,"Cascadia Mono",Consolas,monospace; }
.viz-line { fill:none; stroke-width:2.5; stroke-linejoin:round;
  stroke-linecap:round; }
.viz-avg { fill:none; stroke-width:7; stroke-linecap:round;
  stroke-linejoin:round; opacity:.3; }
.viz-tip-row span.viz-tip-avg { min-width:62px; }
.viz-dot { stroke:var(--surface); stroke-width:2; }
.viz-hit { fill:transparent; }
.viz-hit:hover + * , .viz-hit:hover { cursor:crosshair; }
/* Аналитика v1.5.3: режимы графика, закреплённая шкала Y, перекрестие */
.chartwrap { position:relative; }
.chartwrap.mode-days { display:grid; }
.chartwrap.mode-days > .viz-yaxis,
.chartwrap.mode-days > .viz { grid-area:1/1; }
.chartwrap.mode-days .viz { width:auto; max-width:none; min-width:0; }
.viz-yaxis { display:none; }
.chartwrap.mode-days .viz-yaxis { display:block; position:sticky; left:0;
  z-index:2; justify-self:start; }
.viz-yaxis-bg { fill:var(--surface); opacity:.85; }
.lab-days { display:none; }
.mode-days .lab-days { display:initial; }
.mode-days .lab-fit, .mode-days .lab-y { display:none; }
.viz-tools { display:flex; justify-content:flex-end; margin-bottom:8px; }
.viz-cross { pointer-events:none; }
.viz-cross line { stroke:var(--ink-2); stroke-width:1;
  stroke-dasharray:4 4; opacity:.6; }
.viz-tag { position:absolute; z-index:3; pointer-events:none;
  background:var(--surface); border:1px solid var(--line);
  border-radius:6px; padding:1px 6px; font-size:12px;
  white-space:nowrap; color:var(--ink); }
.viz-tag-x { transform:translate(-50%, 4px); }
.viz-tag-y { transform:translateY(-50%); }
.viz-tip { position:absolute; z-index:4; pointer-events:none;
  background:var(--surface); border:1px solid var(--line);
  border-radius:8px; padding:6px 10px; font-size:12px;
  box-shadow:0 4px 14px rgba(0,0,0,.12); }
.viz-tip-row { display:flex; gap:6px; align-items:center; }
.viz-tip-row b { min-width:30px; text-align:right; }
.viz-tip-row span { color:var(--ink-2); }
.viz-key { width:12px; height:3px; border-radius:2px; display:inline-block; }
/* ---- финансы (v1.6): подвкладки, матрица расходов, лента прогноза ---- */
.subnav { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 14px; }
.subnav a { padding:6px 12px; border-radius:999px; font-size:14px;
  font-weight:600; color:var(--ink-2); text-decoration:none;
  background:var(--surface-2); }
.subnav a.on { background:var(--accent); color:#fff; }
#fin-norms input.cell { width:88px; text-align:right; }
#fin-norms .totrow td { border-top:2px solid var(--line); }
table.data tr.row-off td { opacity:.5; }
.day-cell { width:64px; }
.fin-cushion { stroke:var(--warn); stroke-width:1.5; stroke-dasharray:6 4;
  opacity:.8; }
.fin-danger { fill:var(--neg); opacity:.08; }
.fin-today { stroke:var(--accent); stroke-width:1.5; stroke-dasharray:3 3;
  opacity:.7; }
.fin-feed tr.month-sep td { background:var(--surface-2); font-weight:700;
  text-transform:capitalize; }
tr.ahead-row td { background:var(--accent-soft); }
.small-h { margin:0 0 8px; font-size:15px; }
.chip-del { display:inline-block; }
#fin-norms .day-cell { width:64px; }
.fin-feed tr.past td { opacity:.62; }
.fin-feed td.neg { color:var(--neg); }
/* v1.9: правки прогноза в ленте -- компактные поля в тысячах */
.fin-feed input.fc-amount, .fin-feed input.fc-balance {
  width:96px; min-width:0; text-align:right; }
.fin-feed input.fc-balance { font-weight:700; }
.fin-feed input.err { border-color:var(--neg); }
.fin-feed .fc-sign { color:var(--ink-2); margin-right:2px; }
/* v1.9.1: копилка налога правится прямо в плитке */
.tile input.fc-tax { width:120px; min-width:0; font-size:17px;
  font-weight:700; padding:4px 8px; text-align:right; }
.tile input.fc-tax.err { border-color:var(--neg); }
.tile .v .muted { margin-left:6px; font-weight:400; }
/* v1.9.1: месяцы ленты сворачиваются по заголовку */
.fin-feed form.month-toggle { display:inline; }
.fin-feed .month-btn { background:none; border:0; padding:0; margin:0;
  font:inherit; font-weight:700; color:inherit; cursor:pointer;
  text-transform:capitalize; }
.fin-feed .month-btn .arrow { display:inline-block; width:1.1em;
  color:var(--ink-2); }
.fin-feed .month-end { margin-left:12px; font-weight:400;
  text-transform:none; white-space:nowrap; }
.fin-feed tr[hidden] { display:none; }
/* v1.10: части зарплатных строк по точкам */
.fin-feed .fc-toggle { background:none; border:0; padding:0 4px; cursor:pointer;
  color:var(--ink-2); font:inherit; }
.fin-feed tr.fc-part td.sub { padding-left:28px; color:var(--ink-2); }
.fin-feed .fc-total { font-weight:600; }
/* v1.11.1: булавка «база» рядом с суммой поступления/оценки */
.fin-feed .fc-base { vertical-align:middle; margin-left:4px; color:var(--ink-2); }
.fin-feed .fc-base.on { color:var(--accent); }
.fin-feed .fc-base.on svg { fill:currentColor; }
/* v1.14: галочка «оплачено» и зачёркнутая зафиксированная сумма */
.fin-feed .fc-paid { color:var(--ink-2); }
.fin-feed .fc-paid.on { color:var(--accent); }
.fin-feed s.paid-amt { color:var(--ink-2); }

/* v1.17: «Траты» -- заполняются с телефона */
.spend-balance { display:flex; gap:6px; align-items:center; }
.spend-balance input { max-width:130px; font-size:18px; font-weight:600; }
@media (max-width: 640px) {
  .spend-form.filters { flex-direction:column; align-items:stretch; }
  .spend-form.filters .field { width:100%; }
  /* v1.18.1: выпадающему списку точек нужна вся строка */
  .spend-form .pvz-field { grid-column:1 / -1; }
  /* v1.18.2: чекбоксы в панели списка -- компактные (правило
     «input {width:100%; min-height:44px}» выше их растягивало
     в гигантские квадраты) */
  .spend-form.filters .pvz-choice input { width:20px; height:20px;
    min-height:0; flex:0 0 auto; }
  .spend-form.filters input, .spend-form.filters select {
    width:100%; min-height:44px; font-size:16px; }
  .spend-form .type-choice { display:flex; gap:18px; padding:8px 0; }
  .spend-form .type-choice input { width:20px; height:20px; }
  .spend-form button.btn-2 { width:100%; min-height:46px; font-size:16px; }
  /* журнал -- карточками: шапка прячется, ячейки подписаны data-label */
  table.spend-journal, table.spend-journal tbody { display:block; }
  table.spend-journal tr { display:block; border-bottom:1px solid var(--line);
    padding:8px 0; }
  table.spend-journal tr:first-child { display:none; }
  table.spend-journal td { display:flex; justify-content:space-between;
    gap:12px; border:none; padding:2px 4px; text-align:left; }
  table.spend-journal td.r { text-align:left; }
  table.spend-journal td[data-label]::before { content:attr(data-label);
    color:var(--ink-2); font-size:12px; flex:0 0 90px; }
  table.spend-journal td.actions { justify-content:flex-end;
    flex-direction:row; gap:14px; padding-top:8px; width:auto; }
  table.spend-journal td.actions form,
  table.spend-journal td.actions a.icon-btn { flex:0 0 auto; }
  table.spend-journal td.actions .icon-btn { width:42px; height:42px; }
}
/* v1.21: статьи трат -- справочник владельца, выбор статьи старой траты
   прямо в журнале, свод по статьям */
.spend-cats summary { cursor:pointer; font-weight:600; }
.cat-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center;
  padding:6px 0; border-bottom:1px solid var(--line); }
.cat-row:last-child { border-bottom:none; }
.cat-row .cat-name { display:flex; gap:6px; align-items:center;
  flex:1 1 220px; min-width:0; }
.cat-row input.cell { flex:1 1 auto; min-width:0; max-width:260px;
  text-align:left; }
.cat-row.off input.cell { color:var(--ink-2); }
.cat-set { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
select.spend-cat { width:auto; max-width:180px; padding:6px 9px;
  border-radius:8px; border-color:var(--warn); }
.spend-nocat { margin:4px 2px 10px; }
.spend-sum th { white-space:nowrap; }
.spend-sum tr.sum-row td { border-top:2px solid var(--line); }
.spend-sum tr.unp-detail td.sub { white-space:normal; }
/* v1.9: карточки видов расходов */
.cards-grid { display:grid; gap:12px;
  grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); }
.tile.bad .v { color:var(--neg); }
.fin-forms { display:grid; gap:12px;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); }
.fin-forms summary { cursor:pointer; font-weight:600; color:var(--ink-2); }
.viz-table summary { cursor:pointer; font-weight:600; color:var(--ink-2); }
.viz-table[open] summary { margin-bottom:10px; color:var(--ink); }

/* v1.5: отчёт по сотрудникам -- раскрывающиеся строки.
   table-layout:fixed -- колонки НЕ пересчитываются при раскрытии строк
   (ширины заданы на шапке); поля ввода растягиваются на ширину колонки,
   основания премий/вычетов и кнопка сохранения безнала -- блоком ПОД
   полем значения, на горизонталь не влияют. */
#report-emp { table-layout:fixed; min-width:1000px; }
/* v1.8: столбца «Смены» больше нет -- 3-я колонка «Часы», с 4-й деньги */
#report-emp tr:first-child th:nth-child(3) { width:64px; }
#report-emp tr:first-child th:nth-child(n+4) { width:128px; }
#report-emp input.cell { width:100%; min-width:0; box-sizing:border-box; }
#report-emp input.cell.note { max-width:none; }
#report-emp .paid-save { display:block; margin-top:4px; }
#report-emp .paid-reset { display:inline-block; margin-top:4px; margin-right:6px; }
#report-emp tr.paid-row td.sub { font-style:italic; }
#report-emp .paid-hint { text-align:right; }
.pill.hourly { background:var(--accent-soft); color:var(--accent);
  margin-left:6px; }
.save-flash { display:none; font-size:11px; color:var(--accent);
  white-space:nowrap; }
.save-flash.on { display:block; }
.save-flash.err { color:#C0392B; font-weight:600; }
#report-emp td .muted.small { white-space:normal; text-align:right; }
#report-emp tr.emp-row { cursor:pointer; }
#report-emp tr.emp-row:hover td { background:var(--surface-2); }
#report-emp .chev-col { width:22px; }
#report-emp td.chev { color:var(--ink-2); width:22px; }
#report-emp tr.emp-row.open td.chev { transform:rotate(90deg); }
#report-emp tr.emp-detail td.sub { padding-left:18px; color:var(--ink-2); }
#report-emp td.nowrap { overflow:hidden; text-overflow:ellipsis; }

/* v1.5: переключатель метрики (наличными / общая сумма) */
.metric-head { display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap; }
.metric-head h2 { margin:0; }
.seg { display:inline-flex; border:1px solid var(--line);
  border-radius:10px; overflow:hidden; background:var(--surface); }
.seg-btn { border:0; background:transparent; padding:7px 14px; cursor:pointer;
  font:inherit; color:var(--ink); }
.seg-btn.on { background:var(--accent); color:#fff; }
#metric-block .m-total { display:none; }
#metric-block[data-metric="total"] .m-total { display:inline; }
#metric-block[data-metric="total"] .m-cash { display:none; }

@media (prefers-reduced-motion: reduce) { * { transition:none !important; } }
