/* Эксформ — интерфейс. Адаптивно от 360 px. */
:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --panel: #ffffff;
  --ink: #0f1d33;
  --muted: #5d6b82;
  --line: #dde3ec;
  --line-strong: #c3cddb;
  --accent: #1e3a6b;
  --accent-hover: #172f58;
  --accent-ink: #ffffff;
  --accent-soft: #e6edf8;
  --accent-soft-line: #c4d3ea;
  --accent-soft-ink: #1b3561;
  --link: #1f4b99;
  --focus: #7da2dc;
  --warn: #8a5300;
  --warn-soft: #fff4dd;
  --warn-line: #f0d9a8;
  --warn-ink: #6d4300;
  --bad: #b3261e;
  --bad-soft: #fde8e6;
  --bad-line: #f2c0bb;
  --good: #1d6b3d;
  --good-soft: #e3f3e8;
  --good-line: #b9dfc6;
  /* левое меню в дневном режиме — светлое, пункты чуть жирнее и темнее основного текста */
  --side: #ffffff;
  --side-ink: #071328;
  --side-strong: #071328;
  --side-muted: #5b6b84;
  --side-line: #cfd8e5;
  --side-hover: #eef2f8;
  --side-active: #dfe8f6;
  --side-active-ink: #1e3a6b;
  --side-ico-filter: none;
  --side-weight: 600;
  --side-fs: 11px;
  --logo-bg: #1e3a6b;
  --logo-ink: #ffffff;
  --th-bg: #f7f9fc;
  --row-hover: #f9fbfd;
  --total-bg: #f1f4f9;
  --group-bg: #ebf0f7;
  --chip-bg: #edf1f6;
  --input-bg: #ffffff;
  --btn-bg: #ffffff;
  --btn-hover-line: #9fb0c8;
  --line-bg: #f9fbfd;
  --overlay: rgba(10, 20, 40, .5);
  --radius: 8px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
/* Ночной режим: выбран вручную или (если не выбран) по настройке системы */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #121b2c;
  --ink: #e4eaf4;
  --muted: #94a3bb;
  --line: #22304a;
  --line-strong: #33445f;
  --accent: #3d6fd6;
  --accent-hover: #4b7de0;
  --accent-ink: #ffffff;
  --accent-soft: #16294a;
  --accent-soft-line: #24406f;
  --accent-soft-ink: #bcd0f3;
  --link: #8db2f5;
  --focus: #5c87dd;
  --warn: #f0b75a;
  --warn-soft: #2e2412;
  --warn-line: #5a4419;
  --warn-ink: #f3cf8e;
  --bad: #ff8a80;
  --bad-soft: #3a1717;
  --bad-line: #6b2a26;
  --good: #7fd49e;
  --good-soft: #13301f;
  --good-line: #23523a;
  --side: #08101f;
  --side-ink: #cfd9ea;
  --side-strong: #ffffff;
  --side-muted: #7f92b0;
  --side-line: #1c2840;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(255, 255, 255, .12);
  --side-active-ink: #ffffff;
  --side-ico-filter: grayscale(1) brightness(1.5);
  --side-weight: 400;
  --side-fs: 10px;
  --logo-bg: #3d6fd6;
  --logo-ink: #ffffff;
  --th-bg: #0f1828;
  --row-hover: #16213a;
  --total-bg: #172238;
  --group-bg: #1a2742;
  --chip-bg: #1d2a42;
  --input-bg: #0d1626;
  --btn-bg: #17233a;
  --btn-hover-line: #4a5f82;
  --line-bg: #0f1828;
  --overlay: rgba(0, 0, 0, .6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1220; --panel: #121b2c; --ink: #e4eaf4; --muted: #94a3bb; --line: #22304a; --line-strong: #33445f;
    --accent: #3d6fd6; --accent-hover: #4b7de0; --accent-ink: #ffffff; --accent-soft: #16294a;
    --accent-soft-line: #24406f; --accent-soft-ink: #bcd0f3; --link: #8db2f5; --focus: #5c87dd;
    --warn: #f0b75a; --warn-soft: #2e2412; --warn-line: #5a4419; --warn-ink: #f3cf8e;
    --bad: #ff8a80; --bad-soft: #3a1717; --bad-line: #6b2a26; --good: #7fd49e; --good-soft: #13301f; --good-line: #23523a;
    --side: #08101f; --side-ink: #cfd9ea; --side-strong: #ffffff; --side-muted: #7f92b0; --side-line: #1c2840;
    --side-hover: rgba(255, 255, 255, .06); --side-active: rgba(255, 255, 255, .12); --side-active-ink: #ffffff;
    --side-ico-filter: grayscale(1) brightness(1.5); --logo-bg: #3d6fd6; --logo-ink: #ffffff;
    --side-weight: 400; --side-fs: 10px;
    --th-bg: #0f1828; --row-hover: #16213a; --total-bg: #172238; --group-bg: #1a2742; --chip-bg: #1d2a42;
    --input-bg: #0d1626; --btn-bg: #17233a; --btn-hover-line: #4a5f82; --line-bg: #0f1828; --overlay: rgba(0, 0, 0, .6);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 11px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 18px; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 14px; margin: 24px 0 10px; font-weight: 650; }
h3 { font-size: 12px; margin: 16px 0 8px; font-weight: 650; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Каркас */
.layout { display: grid; grid-template-columns: 186px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink); padding: 13px 9px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; border-right: 1px solid var(--side-line);
}
.brand { display: flex; align-items: center; gap: 8px; padding: 3px 6px 14px; font-size: 10.5px; color: var(--side-strong); font-weight: 700; }
.brand .logo {
  width: 24px; height: 24px; border-radius: 6px; background: var(--logo-bg); color: var(--logo-ink);
  display: grid; place-items: center; font-weight: 800;
}
.brand small { display: block; color: var(--side-muted); font-weight: 400; font-size: 9px; }
.nav a {
  display: flex; align-items: center; gap: 8px; color: var(--side-ink); padding: 7px 8px;
  border-radius: 6px; margin-bottom: 1px; font-size: var(--side-fs, 10px); font-weight: var(--side-weight, 400);
}
.nav a:hover { background: var(--side-hover); text-decoration: none; }
.nav a.active { background: var(--side-active); color: var(--side-active-ink); font-weight: 700; }
.nav .ico { width: 14px; text-align: center; opacity: .8; font-size: 10px; }
.side .who { margin-top: 18px; border-top: 1px solid var(--side-line); padding: 10px 8px 0; font-size: 9.5px; color: var(--side-muted); }
.side .who form { margin-top: 6px; }
.side .who button { background: none; border: 0; color: var(--side-ink); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.main { padding: 22px 28px 60px; min-width: 0; }
.topbar { display: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); font-size: 11px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* Панели и сетки */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.metric .label { font-size: 10.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.metric .value { font-size: 17px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .note { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.metric.accent { border-color: var(--accent); }
a.metric { display: block; color: inherit; }
a.metric:hover { text-decoration: none; border-color: var(--line-strong); }
.hint {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line-strong); font-size: 10px; color: var(--muted); cursor: help; flex: none;
}

/* Вкладки */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 9px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 11px; }
.tabs a.active { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* Таблицы */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 11px; }
th, td { padding: 6px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 10.5px; background: var(--th-bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--row-hover); }
tr.total td { font-weight: 650; background: var(--total-bg); border-top: 1px solid var(--line-strong); }
tr.group td { background: var(--group-bg); font-weight: 600; }
tr.sub td:first-child { padding-left: 26px; }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }
td.wrap { white-space: normal; min-width: 160px; }
.bad { color: var(--bad); }
.good { color: var(--good); }
.warnc { color: var(--warn); }
td.over { background: var(--bad-soft) !important; color: var(--bad); font-weight: 600; }

/* Бейджи */
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 10px; background: var(--chip-bg); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent); }

/* Сообщения */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }
.flash.error { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.flash.warn, .note-warn { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.note-info { background: var(--accent-soft); border: 1px solid var(--accent-soft-line); color: var(--accent-soft-ink); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 11px; }

/* Кнопки и формы */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
  border-radius: 7px; border: 1px solid var(--line-strong); background: var(--btn-bg); color: var(--ink);
  font: inherit; font-size: 11px; cursor: pointer; white-space: nowrap; min-height: 34px;
}
.btn:hover { text-decoration: none; border-color: var(--btn-hover-line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 10.5px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; }
.btn[disabled] { opacity: .55; cursor: wait; }
form.inline { display: inline; }
.form { display: grid; gap: 12px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.field .err { color: var(--bad); font-size: 10.5px; }
.field .help { color: var(--muted); font-size: 10.5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search],
input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit;
  background: var(--input-bg); color: var(--ink); min-height: 38px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.field.has-err input, .field.has-err select { border-color: var(--bad); }
input.money { text-align: right; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 8px; align-items: center; font-size: 11px; }
.check input { width: 18px; height: 18px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.seg label { padding: 7px 12px; cursor: pointer; font-size: 11px; border-right: 1px solid var(--line-strong); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { font-weight: 600; color: var(--accent); }
.seg label:has(input:checked) { background: var(--accent-soft); }

/* Строки документа */
.lines { display: grid; gap: 10px; }
.line { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--line-bg); display: grid; gap: 10px;
        grid-template-columns: 170px minmax(140px, 1.2fr) minmax(140px, 1.2fr) minmax(130px, 1fr) minmax(140px, 1.4fr) 130px 34px; align-items: end; }
.line .field label { font-size: 10px; }
.line .rm { border: 0; background: none; color: var(--muted); font-size: 16.5px; cursor: pointer; height: 38px; }
.line.overhead .proj-only { visibility: hidden; }
.line.asset .proj-only { visibility: hidden; }
.doc-total { display: flex; justify-content: flex-end; gap: 16px; font-weight: 650; font-size: 13px; padding: 4px 2px; }

/* Фильтры */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filters .field { min-width: 140px; flex: 1 1 140px; max-width: 240px; }
.filters .btn { align-self: flex-end; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 11px; flex-wrap: wrap; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .btn { margin-top: 10px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 11px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.list-plain li:last-child { border-bottom: 0; }
details.more summary { cursor: pointer; color: var(--accent); font-size: 11px; }
.login { max-width: 380px; margin: 10vh auto; }
.dialog-bg { position: fixed; inset: 0; background: var(--overlay); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.dialog-bg.open { display: flex; }
.dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 18px; width: min(460px, 100%); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Мобильная версия */
@media (max-width: 1100px) {
  .line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line .scope-f, .line .desc-f { grid-column: 1 / -1; }
  .line .rm { grid-column: 2; justify-self: end; }
  .line.overhead .proj-only, .line.asset .proj-only { display: none; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--side); color: var(--side-strong); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--side-line); }
  .topbar button { background: none; border: 1px solid var(--side-line); color: var(--side-strong); border-radius: 6px; padding: 5px 10px; font-size: 14.5px; }
  .topbar .t { font-weight: 650; }
  .main { padding: 14px 12px 60px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  h1 { font-size: 15.5px; }
  .metric .value { font-size: 14.5px; }
  th, td { padding: 7px 8px; }
  .hide-sm { display: none; }
  .filters .field { max-width: none; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 10px; }
  .metric .value { font-size: 13px; }
  .line { grid-template-columns: 1fr; }
  .line .rm { grid-column: 1; }
  .fields { grid-template-columns: 1fr; }
  .btn { padding: 8px 11px; }
}
@media print {
  .side, .topbar, .actions, .filters, .btn { display: none !important; }
  .layout { display: block; }
}
.mt0 { margin-top: 0; } .mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; } .mb0 { margin-bottom: 0; }
.right { text-align: right; } .nowrap { white-space: nowrap; } .w100 { width: 100%; }
.login .brand { color: var(--ink); padding-left: 0; }
.login .brand small { color: var(--muted); }
.form { grid-template-columns: minmax(0, 1fr); }
.main, .panel, .grid > * { min-width: 0; }
/* Фото объектов */
.head-with-photo { display: flex; gap: 14px; align-items: center; min-width: 0; }
.cover-sm { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.name-with-photo { display: flex; gap: 10px; align-items: center; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.obj-photo-link { flex: none; display: block; line-height: 0; }
.obj-photo { width: 120px; height: 90px; border-radius: 10px; }
.obj-photo.thumb-empty { font-size: 26px; line-height: 1; }
.obj-photo-link:hover .obj-photo { filter: brightness(1.05); box-shadow: 0 0 0 2px var(--accent); }
.obj-name { font-weight: 600; font-size: 12px; }
.obj-price strong { font-size: 12px; }
@media (max-width: 700px) { .obj-photo { width: 84px; height: 63px; } }
.thumb-empty { display: inline-grid; place-items: center; background: var(--chip-bg); color: var(--muted); font-size: 14.5px; }
.photo-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.photo { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.photo.is-cover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--chip-bg); }
.photo figcaption { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; padding: 8px 10px; font-size: 10.5px; }
@media (max-width: 420px) { .photo-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .cover-sm { width: 48px; height: 48px; } }
.photo-meta { width: 100%; }
.photo-caption { width: 100%; margin: 2px 0 0; white-space: pre-line; font-size: 11px; }
.photo figcaption details { width: 100%; }
h2 .btn.small { margin-left: 8px; vertical-align: middle; }
.tbl-mid td { vertical-align: middle; }

/* Переключатель дневного / ночного режима */
.theme-toggle { margin-left: auto; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--side-line); color: var(--side-strong); font-size: 14px; line-height: 1; flex: none; }
.theme-toggle:hover { background: var(--side-hover); text-decoration: none; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ico-sun { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .ico-moon { display: none; }
}
.brand .theme-toggle { margin-left: auto; }
.bare-top { display: flex; justify-content: flex-end; padding: 12px 16px 0; }
.bare-top .theme-toggle { color: var(--ink); border-color: var(--line-strong); }
.nav .ico { filter: var(--side-ico-filter); }

/* Раздел «Фото» */
.project-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.project-card { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; align-items: center; }
.pc-photo { flex: none; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; background: var(--chip-bg); display: grid; place-items: center; }
.pc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-empty { font-size: 24.5px; opacity: .55; }
.pc-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pc-name { font-weight: 600; color: var(--ink); }
.pc-meta { font-size: 10.5px; }
.quick-upload { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.quick-upload label.btn { cursor: pointer; }

/* Операции */
.ops-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 16px; }
.ops-actions .btn { min-width: 150px; font-weight: 600; border: 0; color: #ffffff; }
.btn.op-in { background: #2d4f8a; }
.btn.op-out { background: #1e3a6b; }
.btn.op-tr { background: #2d4f8a; }
.btn.op-in:hover, .btn.op-out:hover, .btn.op-tr:hover { filter: brightness(1.08); }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 280px; background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 30px rgba(10, 20, 40, .18); padding: 6px; }
.dropdown-menu > a { display: block; padding: 9px 10px; border-radius: 7px; color: var(--ink); }
.dropdown-menu > a:hover { background: var(--row-hover); text-decoration: none; }
.dropdown-menu > a.sel { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; }
.dropdown-menu small { display: block; color: var(--muted); font-size: 10.5px; }
.filter-pick .dropdown-menu { left: auto; right: 0; width: min(360px, 92vw); padding: 14px; }
.ops-panel { padding: 0; overflow: visible; }
.ops-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ops-toolbar .filter-pick { margin-left: auto; }
.period-nav { display: flex; align-items: center; background: var(--accent-soft); border-radius: 8px; height: 38px; }
.period-nav .pn-arrow { padding: 0 12px; font-size: 16.5px; line-height: 38px; color: var(--accent-soft-ink); }
.period-nav .pn-arrow:hover { text-decoration: none; background: var(--accent-soft-line); border-radius: 8px; }
.period-pick > summary { padding: 0 10px; line-height: 38px; font-weight: 600; color: var(--accent-soft-ink); white-space: nowrap; }
.period-custom { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 6px 4px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 10.5px; }
.period-custom input { width: auto; min-height: 32px; padding: 4px 6px; }
.seg-tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg-tabs a { padding: 8px 14px; color: var(--ink); border-right: 1px solid var(--line-strong); font-size: 11px; }
.seg-tabs a:last-child { border-right: 0; }
.seg-tabs a.active { background: var(--accent); color: var(--accent-ink); }
.seg-tabs a:hover { text-decoration: none; }
.chip-btn { padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); font-size: 11px; white-space: nowrap; }
.chip-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-ink); }
.chip-btn:hover { text-decoration: none; }
.ops-summary { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 16px; font-size: 11px; border-bottom: 1px solid var(--line); }
.neg { color: #8e1a33; }
:root[data-theme="dark"] .neg { color: #ff9b5e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .neg { color: #ff9b5e; } }
.ops-search { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.ops-search input { background: var(--th-bg); }
.ops-head-row, .op-row { display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(0, 300px); gap: 16px; padding: 12px 16px; }
.ops-head-row { font-size: 10.5px; font-weight: 600; color: var(--muted); padding-top: 8px; padding-bottom: 8px; background: var(--th-bg); border-bottom: 1px solid var(--line); }
.ops-day { display: flex; justify-content: space-between; gap: 10px; padding: 9px 16px; background: var(--group-bg); font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--line); }
.ops-day .muted { font-weight: 500; }
.op-row { color: var(--ink); border-bottom: 1px solid var(--line); align-items: start; }
.op-row:hover { background: var(--row-hover); text-decoration: none; }
.op-row.is-cancelled { opacity: .55; }
.op-row.is-cancelled .amt { text-decoration: line-through; }
.op-amount, .op-main, .op-target { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.amt { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.out { color: #d9480f; }
.amt.in { color: var(--good); }
.amt.tr { color: var(--ink); }
:root[data-theme="dark"] .amt.out { color: #ff9b5e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .amt.out { color: #ff9b5e; } }
.op-acc { font-size: 11px; color: var(--muted); }
.op-cp { font-weight: 650; overflow-wrap: anywhere; }
.op-desc { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.op-target { font-size: 11px; }
.op-t { display: block; line-height: 1.35; }
.op-t + .op-t { padding-top: 4px; border-top: 1px dashed var(--line); }
@media (max-width: 860px) {
  .ops-head-row { display: none; }
  .op-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .op-amount { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
  .op-target { background: var(--th-bg); border-radius: 6px; padding: 6px 8px; }
  .op-target:empty { display: none; }
  .ops-toolbar .filter-pick { margin-left: 0; }
  .ops-actions .btn { min-width: 0; flex: 1 1 30%; }
  .seg-tabs { width: 100%; }
  .seg-tabs a { flex: 1; text-align: center; padding: 8px 6px; font-size: 10.5px; }
  .filter-pick .dropdown-menu { right: auto; left: 0; }
}

/* ДДС и диаграммы. Палитра проверена на различимость при нарушениях цветового зрения (светлая и тёмная тема). */
:root {
  --c1: #1e3a6b; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #8e1a33;
  --c-other: #a3abb8; --c-in: #1baf7a; --c-out: #8e1a33;
}
:root[data-theme="dark"] {
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #0ca30c; --c7: #9085e9; --c8: #e66767;
  --c-other: #5b6678; --c-in: #199e70; --c-out: #d95926;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #0ca30c; --c7: #9085e9; --c8: #e66767;
    --c-other: #5b6678; --c-in: #199e70; --c-out: #d95926;
  }
}
.dn-seg.c1, .sw.c1 { stroke: var(--c1); background: var(--c1); }
.dn-seg.c2, .sw.c2 { stroke: var(--c2); background: var(--c2); }
.dn-seg.c3, .sw.c3 { stroke: var(--c3); background: var(--c3); }
.dn-seg.c4, .sw.c4 { stroke: var(--c4); background: var(--c4); }
.dn-seg.c5, .sw.c5 { stroke: var(--c5); background: var(--c5); }
.dn-seg.c6, .sw.c6 { stroke: var(--c6); background: var(--c6); }
.dn-seg.c7, .sw.c7 { stroke: var(--c7); background: var(--c7); }
.dn-seg.c8, .sw.c8 { stroke: var(--c8); background: var(--c8); }
.dn-seg.c-other, .sw.c-other { stroke: var(--c-other); background: var(--c-other); }
.dn-seg { transition: stroke-width .12s; cursor: default; }
.dn-seg:hover { stroke-width: 36; }
.dn-empty { stroke: var(--line); }
.donut { flex: 0 0 auto; max-width: 100%; height: auto; }
.donut text { fill: var(--ink); }
.dn-total { font-size: 16.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dn-label { font-size: 11px; fill: var(--muted) !important; }
.viz-card h2 { margin: 0 0 10px; font-size: 14px; }
.viz-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.viz-head h2 { margin: 0; }
.viz-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.viz-tabs > label { display: inline-block; padding: 6px 12px; border: 1px solid var(--line-strong); font-size: 11px; cursor: pointer; color: var(--ink); margin-right: -1px; }
.viz-tabs > label:first-of-type { border-radius: 8px 0 0 8px; }
.viz-tabs > label:last-of-type { border-radius: 0 8px 8px 0; }
.viz-tabs > input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.viz-tabs > input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.viz-pane { display: none; margin-top: 14px; }
.viz-tabs > input:nth-of-type(1):checked ~ .p1, .viz-tabs > input:nth-of-type(2):checked ~ .p2 { display: block; }
.viz-pane-in { display: flex; gap: 18px; align-items: center; }
.viz-empty { padding: 30px 0; }
.viz-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; font-size: 11px; }
.viz-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 42px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.viz-legend li:last-child { border-bottom: 0; }
.viz-legend .sw, .viz-legend.inline .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-name { overflow-wrap: anywhere; }
.lg-val { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.lg-pct { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.viz-legend.inline { display: flex; gap: 16px; flex: 0 0 auto; }
.viz-legend.inline li { display: flex; gap: 6px; border: 0; padding: 0; }
.sw.bar-in { background: var(--c-in); } .sw.bar-out { background: var(--c-out); }
.bars-wrap { overflow-x: auto; }
.bars { width: 100%; min-width: 640px; height: auto; max-height: 260px; }
.bars .bar-in { fill: var(--c-in); } .bars .bar-out { fill: var(--c-out); }
.bars .hit { fill: transparent; }
.bars .hit:hover { fill: var(--row-hover); fill-opacity: .35; }
.bars .grid { stroke: var(--line); stroke-width: 1; }
.bars .baseline { stroke: var(--line-strong); stroke-width: 1; }
.bars .axis { fill: var(--muted); font-size: 10.5px; }

/* Аналитика на «Сводке» */
.an-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.an-kpi-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.an-kpi-item .k { display: block; font-size: 10.5px; color: var(--muted); }
.an-kpi-item b { display: block; font-size: 15.5px; margin-top: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-kpi-item small { display: block; font-size: 10px; margin-top: 2px; }
.an-alerts { list-style: none; margin: 0; padding: 0; }
.an-alerts li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.an-alerts li:last-child { border-bottom: 0; }
.an-alerts li a { font-weight: 600; }
.an-alerts li small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.an-alerts li.bad a { color: var(--c-out); }
.an-alerts li.warn a { color: var(--warn); }
.om-margin { font-size: 10px; color: var(--muted); margin-top: 2px; font-weight: 400; white-space: nowrap; }
@media (max-width: 700px) {
  .an-kpi { grid-template-columns: 1fr 1fr; }
  .an-kpi-item:last-child { grid-column: 1 / -1; }
}
.dds-toolbar { border-radius: var(--radius); }
.dds-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.dds-filters select { width: auto; min-width: 180px; max-width: 280px; }
.dds-kpi { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric.good-metric .value { color: var(--good); }
.metric.neg-metric .value { color: var(--c-out); }
.mt8 { margin-top: 8px; }
.small { font-size: 10.5px; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px -16px; }
.dds-table { font-size: 11px; }
.dds-table td.num, .dds-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dds-table .stick { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 220px; max-width: 300px; white-space: normal; }
.dds-table th.stick { background: var(--th-bg); }
.dds-table .tot { font-weight: 650; background: var(--total-bg); }
.dds-table td.l1 { padding-left: 22px; }
.dds-table td.l2 { padding-left: 36px; }
.dds-table tr.sec td { font-weight: 700; background: var(--group-bg); }
.dds-table tr.sec.in td.num { color: var(--good); }
.dds-table tr.grp td { font-weight: 600; background: var(--th-bg); }
.dds-table tr.bal td { font-weight: 600; color: var(--muted); }
.dds-table tr.net td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.dds-table td.neg { color: var(--c-out); }
.dds-table a { color: var(--ink); }
.dds-table a:hover { color: var(--link); }
@media (max-width: 1100px) { .dds-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .dds-kpi { grid-template-columns: 1fr 1fr; }
  .viz-pane-in { flex-direction: column; align-items: stretch; }
  .donut { align-self: center; }
  .dds-filters select { min-width: 0; max-width: none; flex: 1 1 100%; }
  .dds-table .stick { min-width: 150px; }
}

/* Загрузка выписки */
.btn.op-import { background: var(--btn-bg); color: var(--ink); border: 1px solid var(--line-strong); }
.help-panel ul.plain { padding-left: 18px; margin: 8px 0; }
.help-panel li { margin: 4px 0; }
.map-panel summary { cursor: pointer; }
.map-fields { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important; }
.imp-top { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; z-index: 5; }
.imp-summary { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 11px; }
.imp-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11px; }
.imp-bulk select { width: auto; max-width: 220px; min-height: 34px; padding: 4px 8px; }
.imp-list { padding: 0; overflow: hidden; }
.imp-head, .imp-row { display: grid; grid-template-columns: 28px 170px minmax(0, 1fr) minmax(0, 380px); gap: 14px; padding: 12px 16px; }
.imp-row { border-bottom: 1px solid var(--line); align-items: start; }
.imp-row:last-child { border-bottom: 0; }
.imp-row.has-err { background: var(--bad-soft); }
.imp-row.is-skip .op-amount, .imp-row.is-skip .op-main { opacity: .5; }
.imp-sel { padding-top: 4px; }
.imp-sel input { width: 18px; height: 18px; }
.imp-act { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.imp-act select, .imp-act input { min-height: 34px; padding: 5px 8px; font-size: 11px; }
.imp-act [hidden] { display: none !important; }
.imp-hint { font-size: 10.5px; color: var(--accent-soft-ink); background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.imp-row .err { color: var(--bad); font-size: 11px; font-weight: 600; }
.imp-row .op-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.imp-footer { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; position: sticky; bottom: 0; z-index: 5;
  box-shadow: 0 -6px 18px rgba(10, 20, 40, .08); }
td.good { color: var(--good); } td.neg { color: var(--c-out); }
@media (max-width: 860px) {
  .imp-head { display: none; }
  .imp-row { grid-template-columns: 26px minmax(0, 1fr); gap: 8px 10px; }
  .imp-row .op-amount { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
  .imp-row .op-main, .imp-row .imp-act { grid-column: 2; }
  .imp-sel { grid-row: 1; }
  .imp-top { position: static; }
  .imp-bulk select { max-width: none; flex: 1 1 45%; }
}
@media (max-width: 860px) { .imp-footer { position: static; box-shadow: none; } }
.note-sample { background: var(--th-bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 10.5px; white-space: pre-wrap; margin: 8px 0; }
.imp-source { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.imp-source img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.imp-source pre { margin: 0; max-height: 420px; overflow: auto; background: var(--th-bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 10.5px; white-space: pre-wrap; }
.imp-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.imp-edit input { min-height: 34px; padding: 5px 8px; font-size: 11px; }
.imp-edit .wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .imp-source { grid-template-columns: 1fr; } }
.imp-desc { min-height: 34px; padding: 5px 8px; font-size: 11px; width: 100%; }
.acc-panel.need { border-color: var(--warn-line); background: var(--warn-soft); }
.acc-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.acc-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acc-form select { width: auto; min-width: 220px; }
.acc-new .fields { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.link-like { color: var(--link); cursor: pointer; font-weight: 600; }
.imp-act select.need-val { border-color: var(--warn); background: var(--warn-soft); }
.catalog-link { margin: -6px 0 6px; }

/* Статьи и этапы */
.cat-list { list-style: none; margin: 0 0 12px; padding: 0; }
.cat-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list li.is-hidden input[type=text], .cat-list li.is-hidden .fixed-name { color: var(--muted); text-decoration: line-through; }
.cat-row { display: flex; gap: 6px; align-items: center; }
.cat-row input[type=text] { flex: 1 1 auto; min-width: 0; min-height: 34px; padding: 5px 8px; }
.cat-row .btn.small { flex: 0 0 auto; }
.btn.icon { width: 32px; padding-left: 0; padding-right: 0; justify-content: center; }
.cat-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.cat-del[open] { flex-basis: 100%; }
.cat-del form { margin-top: 6px; align-items: center; }
.cat-del select { width: auto; max-width: 220px; }
.cat-add { display: flex; gap: 6px; }
.cat-add input { flex: 1; min-width: 0; min-height: 34px; padding: 5px 8px; }
.num-badge { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--chip-bg); color: var(--muted); font-size: 10.5px;
  display: inline-flex; align-items: center; justify-content: center; }
.fixed-name { flex: 1; padding: 0 4px; }
.cat-grid h2 { margin-bottom: 2px; }
.cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cat-del > summary { list-style: none; }
.cat-del > summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) { .cat-grid { grid-template-columns: 1fr; } }

/* Операции: строки с отметкой для удаления */
.ops-head-row { grid-template-columns: 24px 210px minmax(0, 1fr) minmax(0, 300px); align-items: center; }
.op-row { display: flex; gap: 12px; align-items: flex-start; padding: 0 0 0 16px; }
.op-sel { flex: 0 0 24px; display: flex; align-items: center; padding-top: 14px; }
.ops-head-row .op-sel { padding-top: 0; }
.op-sel input { width: 17px; height: 17px; margin: 0; }
.op-link { flex: 1; min-width: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(0, 300px); gap: 16px;
  padding: 12px 16px 12px 0; color: var(--ink); }
.op-link:hover { text-decoration: none; }
.ops-delbar { position: sticky; bottom: 12px; z-index: 6; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--panel); border: 1px solid var(--bad-line); border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(10, 20, 40, .18); margin-top: 12px; }
.ops-delbar.js { display: none; }
.ops-delbar.js.show { display: flex; }
.ops-delbar input[type=text] { width: auto; flex: 1 1 200px; min-height: 36px; }
@media (max-width: 860px) {
  .op-row { padding-left: 10px; gap: 8px; }
  .op-link { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-right: 12px; }
  .op-link .op-amount { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
  .op-link .op-target { background: var(--th-bg); border-radius: 6px; padding: 6px 8px; }
  .op-link .op-target:empty { display: none; }
}

/* Полосы «Сводка» и «Расходы» */
.ops-charts { margin-bottom: 16px; align-items: start; }
.ops-charts .panel { margin-bottom: 0; }
.hb-hint { margin: -4px 0 6px; }
.hbars { width: 100%; height: auto; display: block; }
.hb-label { fill: var(--muted); font-size: 11px; }
.hb-val { fill: #ffffff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hb-val.out { fill: var(--ink); }
.hb-pct { font-size: 11px; font-variant-numeric: tabular-nums; }
.hb-tick { fill: var(--muted); font-size: 10.5px; }
.hb-axis { stroke: var(--line-strong); }
.hb-axis-title { fill: var(--muted); font-size: 11px; font-style: italic; }
.hb-track { fill-opacity: .12; }
.hb-row:hover .hb-bar { filter: brightness(1.08); }
.hb-money { fill: var(--c1); } .hb-pay { fill: var(--c7); } .hb-rec { fill: var(--c6); }
.hb-total { fill: #a51f3e; } .hb-neg { fill: #a51f3e; } .hb-spend { fill: var(--c1); } .hb-other { fill: var(--c-other); }
:root[data-theme="dark"] .hb-total { fill: #c97a8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hb-total { fill: #c97a8a; } }
:root[data-theme="dark"] .hb-track { fill-opacity: .2; }
.hb-pct.hb-money, .hb-pct.hb-pay, .hb-pct.hb-rec, .hb-pct.hb-total, .hb-pct.hb-neg, .hb-pct.hb-spend, .hb-pct.hb-other { fill-opacity: 1; }
.op-sel-cell { width: 34px; padding-right: 0; }
.op-sel-cell input { width: 17px; height: 17px; margin: 0; vertical-align: middle; }
.op-edit summary { cursor: pointer; }
.edit-line { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.edit-line-head { font-weight: 600; margin-bottom: 6px; }
.edit-line-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.edit-line-fields [hidden] { display: none !important; }
@media (max-width: 760px) { .edit-line-fields { grid-template-columns: 1fr; } }

/* ДДС: «Движение денег» */
.cf { --cf-in: #1d7a46; --cf-out: #8e1a33; --cf-bal: #2d4f8a; }
:root[data-theme="dark"] .cf { --cf-in: #6fd39a; --cf-out: #ff8f78; --cf-bal: #7fb0ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cf { --cf-in: #6fd39a; --cf-out: #ff8f78; --cf-bal: #7fb0ff; } }
.cf .good { color: var(--cf-in); } .cf .neg { color: var(--cf-out); }
.cf-head { margin-bottom: 10px; }
.cf-filters { padding: 0; margin-bottom: 10px; }
.cf-fbox > summary { list-style: none; cursor: pointer; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cf-fbox > summary::-webkit-details-marker { display: none; }
.cf-fbox[open] > summary { display: none; }
.cf-fsum-title { font-weight: 650; margin-right: 4px; }
.cf-fsum-title::before { content: "⚙ "; color: var(--muted); }
.chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--chip-bg); font-size: 11px; color: var(--ink); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.cf-fields { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 12px 16px; }
.cf-fields .field { margin: 0; min-width: 150px; flex: 0 1 200px; }
.cf-fields .field select, .cf-fields .field input { min-height: 36px; }
.cf-dates.is-off { display: none; }
.cf-fbtns { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.cf-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; font-size: 14px; }
.cf-period .pn-arrow { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); color: var(--ink); background: var(--panel); }
.cf-period .pn-arrow:hover { text-decoration: none; border-color: var(--line-strong); }
.cf-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cf-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cf-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--ink); min-width: 0; }
a.cf-card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(15, 30, 60, .06); }
.cf-lbl { font-size: 11px; color: var(--muted); }
.cf-val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin: 4px 0 2px; overflow-wrap: anywhere; }
.cf-sub { font-size: 11px; color: var(--muted); }
.cf-card.in .cf-val { color: var(--cf-in); }
.cf-card.out .cf-val { color: var(--cf-out); }
.cf-card.end { border-color: color-mix(in srgb, var(--cf-bal) 35%, var(--line)); background: color-mix(in srgb, var(--cf-bal) 6%, var(--panel)); }
.cf-card.end .cf-val { color: var(--cf-bal); font-size: 24px; }
.cf-card.end.neg { border-color: color-mix(in srgb, var(--cf-out) 50%, var(--line)); background: color-mix(in srgb, var(--cf-out) 7%, var(--panel)); }
.cf-card.end.neg .cf-val { color: var(--cf-out); }
.cf-warn { color: var(--cf-out); font-weight: 600; }
.cf-change { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 11px; margin: 10px 2px 16px; }
.cf-ok { cursor: help; }
.cf-escrow { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 10px; padding: 9px 14px; font-size: 11px; margin-bottom: 16px; }
.cf-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cf-two-wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.cf-block { margin-bottom: 16px; }
.cf-bh { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.cf-bh h2 { margin: 0; font-size: 14.5px; }
.cf-bh p { margin: 3px 0 0; }
.cf-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.flow-list { display: flex; flex-direction: column; }
.flow-row, .flow-more > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; grid-template-areas: "name amt pct" "bar bar bar"; gap: 3px 12px;
  padding: 8px 6px; border-radius: 8px; color: var(--ink); align-items: baseline; }
.flow-row:hover { background: var(--row-hover); text-decoration: none; }
.fr-name { grid-area: name; overflow-wrap: anywhere; font-size: 11px; }
.fr-amt { grid-area: amt; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.fr-pct { grid-area: pct; text-align: right; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.fr-bar { grid-area: bar; }
.share { display: block; width: 100%; height: 6px; }
.share-track { fill: var(--chip-bg); }
.share.in .share-fill { fill: var(--cf-in); } .share.out .share-fill { fill: var(--cf-out); }
.flow-more > summary { list-style: none; cursor: pointer; grid-template-areas: "name amt pct"; }
.flow-more > summary::-webkit-details-marker { display: none; }
.flow-more > summary .link-like { grid-area: pct; text-align: right; white-space: nowrap; }
.flow-more[open] > summary { color: var(--muted); }
.flow-foot { margin: 8px 6px 0; font-size: 11px; color: var(--muted); }
.cf-empty-line { padding: 12px 6px; }
.obj-tree { font-size: 11px; }
.ot-head, .obj-tree summary, .ot-total { display: grid; grid-template-columns: minmax(0, 1fr) 130px 52px minmax(60px, 160px); gap: 12px; align-items: center; padding: 8px 8px; }
.ot-head { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); padding-top: 0; }
.obj-tree summary { list-style: none; cursor: pointer; border-radius: 8px; }
.obj-tree summary::-webkit-details-marker { display: none; }
.obj-tree summary:hover { background: var(--row-hover); }
.ot-name { overflow-wrap: anywhere; }
.ot-name::before { content: "›"; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
details[open] > summary > .ot-name::before { transform: rotate(90deg); }
.ot-l1 { border-bottom: 1px solid var(--line); }
.ot-l1 > summary .ot-name { font-weight: 650; }
.ot-amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ot-pct { color: var(--muted); font-size: 11px; }
.ot-body { padding: 0 0 8px 16px; }
.ot-l2 > summary { font-size: 11px; }
.ot-l3 > summary { font-size: 11px; color: var(--muted); }
.ot-l2 .ot-l3 { margin-left: 14px; }
.ot-ops { list-style: none; margin: 2px 0 8px 22px; padding: 0; border-left: 2px solid var(--line); }
.ot-ops a { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 10px; padding: 6px 10px; color: var(--ink); font-size: 11px; align-items: baseline; border-radius: 6px; }
.ot-ops a:hover { background: var(--row-hover); text-decoration: none; }
.ot-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.ot-what { overflow-wrap: anywhere; }
.ot-what small { display: block; }
.ot-ops .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ot-total { font-weight: 700; border-top: 2px solid var(--line-strong); }
.ot-total .num { text-align: right; }
.obj-tree .num { text-align: right; }
.top-pay { list-style: none; margin: 0; padding: 0; counter-reset: tp; }
.top-pay li { border-bottom: 1px solid var(--line); }
.top-pay li:last-child { border-bottom: 0; }
.top-pay a { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 9px 4px; color: var(--ink); }
.top-pay a:hover { background: var(--row-hover); text-decoration: none; }
.tp-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 11px; }
.tp-main .muted { font-size: 11px; overflow-wrap: anywhere; }
.tp-place { font-size: 11px; color: var(--accent-soft-ink); }
.tp-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-bars .hit, .cf-line .hit { fill: transparent; }
.cf-g:hover .hit { fill: var(--row-hover); fill-opacity: .6; }
.cf-line .lvl { stroke: var(--cf-bal); stroke-width: 2; }
.cf-line .lvl-dot { fill: var(--panel); stroke: var(--cf-bal); stroke-width: 2; }
.cf-line .lvl-dot.neg { stroke: var(--cf-out); }
.cf-line .zero { stroke: var(--cf-out); stroke-dasharray: 3 3; stroke-width: 1; }
.cf .bars .bar-in, .cf .sw.bar-in { fill: var(--cf-in); background: var(--cf-in); }
.cf .bars .bar-out, .cf .sw.bar-out { fill: var(--cf-out); background: var(--cf-out); }
.small-tabs a { padding: 5px 11px; font-size: 11px; }
.cf-scroll { overflow: auto; max-height: 75vh; margin: 0 -16px -16px; border-top: 1px solid var(--line); }
.cf-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.cf-table th, .cf-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cf-table thead th { position: sticky; top: 0; z-index: 2; background: var(--th-bg); font-size: 11px; color: var(--muted); font-weight: 600; }
.cf-table .stick { position: sticky; left: 0; z-index: 1; background: var(--panel); white-space: normal; min-width: 240px; max-width: 340px; }
.cf-table thead .stick { z-index: 3; background: var(--th-bg); }
.cf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cf-table .tot { font-weight: 650; }
.cf-table tr.grp td { background: var(--group-bg); font-weight: 700; }
.cf-table tr.cf-side td { font-weight: 650; background: var(--total-bg); }
.cf-table tr.cf-side.in td.num { color: var(--cf-in); } .cf-table tr.cf-side.out td.num { color: var(--cf-out); }
.cf-table td.l1 { padding-left: 22px; } .cf-table td.l2 { padding-left: 36px; }
.cf-table tr.row-link a { color: var(--ink); }
.cf-table tr.row-link:hover td { background: var(--row-hover); }
.cf-table tr.row-link a:hover { color: var(--link); }
.cf-table tr.net td { font-weight: 700; border-top: 2px solid var(--line-strong); background: var(--total-bg); }
.cf-table tr.bal td { color: var(--cf-bal); font-weight: 650; }
.cf-sheet { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.cf-sheet-bg { position: absolute; inset: 0; background: var(--overlay); }
.cf-sheet-box { position: relative; width: min(640px, 100%); height: 100%; overflow: auto; background: var(--panel); padding: 18px 18px 30px; box-shadow: -10px 0 40px rgba(0, 0, 0, .2); }
.drill-ops { margin-left: 0; border-left: 0; }
.drill-ops li { border-bottom: 1px solid var(--line); }
.cf-empty { text-align: center; padding: 30px 16px; }
.cf-empty h2 { margin-top: 0; }
body.is-loading::before { content: ""; position: fixed; left: 0; top: 0; height: 3px; width: 40%; background: var(--accent); z-index: 100; animation: cf-load 1s ease-in-out infinite; }
@keyframes cf-load { 0% { left: -40%; } 100% { left: 100%; } }
@media (max-width: 1100px) { .cf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cf-two-wide { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cf-two { grid-template-columns: 1fr; }
  .cf-cards.three { grid-template-columns: 1fr 1fr; }
  .cf-cards.three .cf-card.end { grid-column: 1 / -1; }
  .cf-val { font-size: 17.5px; } .cf-card.end .cf-val { font-size: 19.5px; }
  .cf-card { padding: 11px 12px; }
  .cf-fields .field { flex: 1 1 100%; }
  .cf-fbtns { margin-left: 0; width: 100%; } .cf-fbtns .btn { flex: 1; }
  .ot-head, .obj-tree summary, .ot-total { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .ot-head span:last-child, .obj-tree summary > span:last-child, .ot-total span:last-child { display: none; }
  .ot-ops a { grid-template-columns: minmax(0, 1fr) auto; }
  .ot-ops .ot-date { grid-column: 1 / -1; }
  .ot-body { padding-left: 4px; }
  .ot-ops { margin-left: 8px; }
  .cf-table .stick { min-width: 160px; }
}
@media (max-width: 400px) { .cf-cards { grid-template-columns: 1fr; } .cf-cards.three { grid-template-columns: 1fr; } }

/* Объекты: расходы по объектам за период */
.obj-spend { margin-top: 18px; }
.obj-spend-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.obj-spend-head h2 { margin: 0; }
.obj-spend-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.obj-spend-period strong { min-width: 110px; text-align: center; }
.per-arrow { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); font-size: 14.5px; }
.per-arrow:hover { background: var(--group-bg); text-decoration: none; }
.obj-spend-empty { padding: 14px 0; }
.obj-spend-totals { margin-top: 14px; }
.metric.neg-metric .value { color: var(--c-out); }
tfoot .total-row td { font-weight: 650; border-top: 2px solid var(--line-strong); background: var(--group-bg); }
/* фон полос расходов — нейтральный, без светло-синего */
.hb-track.hb-spend, .hb-track.hb-money { fill: #8a94a6; fill-opacity: .16; }
.obj-spend .hbars { max-width: 1000px; display: block; }
.name-with-photo > span { min-width: 150px; }
.sp-mob { display: none; }
@media (max-width: 700px) { .sp-desk { display: none; } .sp-mob { display: block; } }

/* Сводка: объекты — куда ушли деньги (строки этапов свёрнуты) */
.om-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.om-head h2 { margin: 0; }
.om-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.om-period strong { min-width: 110px; text-align: center; }
.om-table td, .om-table th { white-space: nowrap; }
.om-name { display: flex; align-items: center; gap: 8px; }
.om-tgl { width: 26px; height: 26px; flex: none; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel); color: var(--ink); cursor: pointer; display: inline-grid; place-items: center; font-size: 10px; padding: 0; }
.om-tgl:hover { background: var(--group-bg); }
.om-tgl span { transition: transform .15s; }
.om-tgl[aria-expanded="true"] span { transform: rotate(90deg); }
.om-tgl-sp { width: 26px; flex: none; }
.om-obj td { font-weight: 650; }
.om-obj td .badge, .om-obj td .status { font-weight: 500; }
.om-grp td { font-weight: 650; background: var(--group-bg); }
.om-sub td:first-child { padding-left: 46px; color: var(--muted); }
.om-table td.in { color: var(--cf-in, #1d7a46); }
.om-table td.out { color: var(--c-out); }
.om-tot td { font-weight: 750; border-top: 2px solid var(--line-strong); background: var(--group-bg); }
.om-mini { display: inline-block; width: 60px; height: 7px; border-radius: 4px; background: var(--line); margin-left: 8px; vertical-align: middle; overflow: hidden; }
.om-mini > span { display: block; height: 7px; border-radius: 4px; background: var(--c1); }
.om-foot { margin: 10px 0 0; }
.om-mini > .p0 { width: 0%; }
.om-mini > .p5 { width: 5%; }
.om-mini > .p10 { width: 10%; }
.om-mini > .p15 { width: 15%; }
.om-mini > .p20 { width: 20%; }
.om-mini > .p25 { width: 25%; }
.om-mini > .p30 { width: 30%; }
.om-mini > .p35 { width: 35%; }
.om-mini > .p40 { width: 40%; }
.om-mini > .p45 { width: 45%; }
.om-mini > .p50 { width: 50%; }
.om-mini > .p55 { width: 55%; }
.om-mini > .p60 { width: 60%; }
.om-mini > .p65 { width: 65%; }
.om-mini > .p70 { width: 70%; }
.om-mini > .p75 { width: 75%; }
.om-mini > .p80 { width: 80%; }
.om-mini > .p85 { width: 85%; }
.om-mini > .p90 { width: 90%; }
.om-mini > .p95 { width: 95%; }
.om-mini > .p100 { width: 100%; }
.om-table tr[hidden] { display: none; }

/* Операции: изменение прямо в списке */
.op-click { font: inherit; color: inherit; text-align: left; background: none; border: 0; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; cursor: pointer; min-width: 0; }
.op-click:hover { background: var(--group-bg); }
.op-click:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.op-click[aria-expanded="true"] { background: var(--group-bg); }
.op-pen { font-size: 10px; color: var(--accent); opacity: 0; transition: opacity .12s; }
.op-row:hover .op-pen, .op-click:focus-visible .op-pen, .op-click[aria-expanded="true"] .op-pen { opacity: 1; }
a.op-amount { color: inherit; }
a.op-amount:hover { text-decoration: none; }
a.op-amount:hover .op-acc { text-decoration: underline; }
.op-editor { border-bottom: 1px solid var(--line); background: var(--group-bg); padding: 14px 16px 14px 52px; }
.op-editor .op-edit-form { max-width: 980px; display: flex; flex-direction: column; gap: 10px; }
.op-ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; }
.op-editor .edit-line-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.op-editor .edit-line { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.op-ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
@media (max-width: 860px) {
  .op-pen { opacity: 1; }
  .op-editor { padding: 12px; }
  .op-ed-grid, .op-editor .edit-line-fields { grid-template-columns: minmax(0, 1fr); }
}
.op-ed-grid .field.wide { grid-column: auto; }

.scope-pick { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.scope-pick legend { font-size: 10.5px; color: var(--muted); padding: 0; margin-bottom: 6px; width: 100%; }
.scope-opt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 12px; cursor: pointer; background: var(--panel); font-size: 11px; }
.scope-opt:has(input:checked) { border-color: var(--accent); background: var(--group-bg); font-weight: 600; }
.scope-opt input { margin: 0; }
.op-editor .edit-line-fields { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Автозагрузка из банков */
.bank-card { display: flex; flex-direction: column; gap: 12px; }
.bank-head { display: flex; align-items: center; gap: 12px; }
.bank-head h2 { margin: 0; }
.bank-head .badge { margin-left: auto; }
.bank-logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 16.5px; color: #fff; flex: none; }
.bank-logo.tochka { background: #6a35ff; }
.bank-logo.domrf { background: #0f1e36; }
.bank-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.bank-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.bank-more { flex: 1 1 100%; }
.bank-more form { margin-top: 8px; }
.bank-kv { margin: 0; }
.bank-note { display: flex; flex-direction: column; gap: 6px; background: var(--group-bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.bank-card textarea { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; width: 100%; box-sizing: border-box; }
.bank-logo.mail { background: #0a5bd3; }
.acc-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.adjust-box summary { cursor: pointer; }

/* Материалы и инструменты */
.inv-tabs { margin-top: 4px; }
.inv-tabs a { padding: 9px 18px; font-size: 12px; }
.inv-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 9px; background: var(--group-bg); color: var(--muted); font-size: 10px; text-align: center; }
.inv-tabs a.active .inv-count { background: rgba(255,255,255,.2); color: inherit; }
.inv-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; margin-top: 14px; align-items: start; }
.inv-act summary, .inv-add summary { cursor: pointer; }
.inv-table tr.inv-low td { background: var(--bad-bg, rgba(165, 31, 62, .06)); }
.inv-hist li { align-items: center; }
.inv-hist form { margin: 0; }
.inv-cancelled strong { text-decoration: line-through; }
@media (max-width: 700px) { .inv-actions { grid-template-columns: minmax(0, 1fr); } }
/* фото материалов и инструментов */
.inv-thumb-link { flex: none; display: block; line-height: 0; }
.inv-thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; }
.inv-thumb.thumb-empty { font-size: 16.5px; line-height: 1; }
.inv-thumb-link:hover .inv-thumb { box-shadow: 0 0 0 2px var(--accent); }
.inv-head { justify-content: flex-start; gap: 16px; align-items: center; }
.inv-head-text { flex: 1; min-width: 0; }
.inv-cover-link { flex: none; line-height: 0; }
.inv-cover { width: 132px; height: 99px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.inv-photos { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-bottom: 4px; }
.inv-photos figcaption .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inv-photos form { margin: 0; }
@media (max-width: 700px) { .inv-cover { width: 96px; height: 72px; } .inv-thumb { width: 52px; height: 39px; } }
.inv-table td { vertical-align: middle; }
.phone-url { font-size: 14px; user-select: all; }
.m-version-link { color: inherit; opacity: .8; font-size: 11px; text-decoration: none; } .m-version-link:hover { opacity: 1; text-decoration: underline; }
.siri-steps { padding-left: 20px; margin: 0; } .siri-steps li { margin: 6px 0; }
.siri-icon-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.siri-icon { width: 96px; height: 96px; border-radius: 22px; display: block; }
.siri-say { font-size: 13px; font-weight: 600; margin: 4px 0 8px; }
/* график работ */
.gantt { width: 100%; height: auto; display: block; }
.gt-month { fill: var(--muted); font-size: 10.5px; }
.gt-grid { stroke: var(--line); stroke-width: 1; }
.gt-stripe { fill: var(--ink); fill-opacity: .025; }
.gt-label { fill: var(--ink); font-size: 11.5px; }
.gantt a .gt-label { fill: var(--accent); }
.gantt a:hover .gt-label { text-decoration: underline; }
.gt-plan { fill: var(--c1); fill-opacity: .16; stroke: var(--c1); stroke-opacity: .35; }
.gt-fill { fill: var(--c1); }
.gt-plan.done, .gt-fill.done { fill: #1d7a46; stroke: #1d7a46; }
.gt-plan.done { fill-opacity: .16; }
.gt-plan.late { fill: #a51f3e; fill-opacity: .12; stroke: #a51f3e; stroke-opacity: .6; }
.gt-fill.late { fill: #a51f3e; }
.gt-pct { fill: var(--ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gt-pct.late { fill: #a51f3e; } .gt-pct.done { fill: #1d7a46; }
.gt-none { fill: var(--muted); font-size: 11px; font-style: italic; }
.gt-today { stroke: #a51f3e; stroke-width: 1.5; stroke-dasharray: 4 3; }
.gt-today-t { fill: #a51f3e; font-size: 9.5px; font-weight: 600; }
.gt-row:hover .gt-fill { filter: brightness(1.12); }
.sched-table td { vertical-align: middle; }
.sched-table input[type=date] { min-width: 140px; }
.sched-pct { display: flex; align-items: center; gap: 8px; }
.sched-pct input[type=range] { flex: 1; min-width: 120px; accent-color: var(--c1); }
.sched-pct output { min-width: 42px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.sched-kpi { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }
.sched-kpi .big { font-size: 24px; font-weight: 750; }
.sched-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 6px; }
.sched-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sched-legend .lg-plan { background: rgba(30,58,107,.18); border: 1px solid rgba(30,58,107,.4); }
.sched-legend .lg-done { background: var(--c1); } .sched-legend .lg-late { background: #a51f3e; } .sched-legend .lg-ok { background: #1d7a46; }
.sched-table .sched-w { width: 84px; min-width: 0; text-align: right; }
/* план и факт по этапам (перерасходы) */
.planfact { width: 100%; height: auto; display: block; }
.pf-label { fill: var(--ink); font-size: 11.5px; }
.planfact a .pf-label { fill: var(--accent); } .planfact a:hover .pf-label { text-decoration: underline; }
.pf-plan { fill: var(--c1); fill-opacity: .13; stroke: var(--c1); stroke-opacity: .3; }
.pf-fact { fill: var(--c1); }
.pf-over { fill: #a51f3e; }
.pf-noplan { fill: #8a94a6; fill-opacity: .7; }
.pf-mark { stroke: var(--ink); stroke-width: 2; }
.pf-t { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-t.over { fill: #a51f3e; } .pf-t.ok { fill: #1d7a46; } .pf-t.none { fill: var(--muted); font-weight: 400; font-style: italic; }
.pf-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 6px; }
.pf-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.pf-legend .l-plan { background: rgba(30,58,107,.15); border: 1px solid rgba(30,58,107,.35); }
.pf-legend .l-fact { background: var(--c1); } .pf-legend .l-over { background: #a51f3e; } .pf-legend .l-none { background: #8a94a6; }
.pf-legend .l-mark { width: 2px; height: 14px; background: var(--ink); vertical-align: -3px; }
.pf-sum { display: flex; gap: 22px; flex-wrap: wrap; margin: 4px 0 10px; font-size: 12px; }
.pf-sum b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.pf-proj + .pf-proj { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.pf-sub { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.plan-note { min-width: 240px; width: 100%; }
.plan-note-text { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--chip-bg); }
/* объекты: раскрывающийся график работ под названием */
.obj-sched-tgl { margin-top: 6px; padding: 3px 10px 3px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--chip-bg); color: var(--accent); font: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer; }
.obj-sched-tgl::before { content: "▸"; display: inline-block; margin-right: 5px; transition: transform .15s; }
.obj-sched-tgl[aria-expanded="true"]::before { transform: rotate(90deg); }
.obj-sched-tgl:hover { border-color: var(--accent); }
.obj-gantt-row > td { background: var(--panel); padding: 12px 14px 16px; }
.obj-gantt-sum { display: flex; gap: 20px; flex-wrap: wrap; align-items: baseline; margin-bottom: 8px; font-size: 12px; }
.obj-gantt-sum a { margin-left: auto; }
/* календарь затрат */
.cashplan { width: 100%; height: auto; display: block; }
.cp-grid { stroke: var(--line); } .cp-grid.zero { stroke: var(--line-strong); }
.cp-tick, .cp-month { fill: var(--muted); font-size: 10.5px; }
.cp-month { fill: var(--ink); }
.cp-proj { fill: var(--c1); } .cp-oh { fill: #8a94a6; } .cp-in { fill: #1d7a46; }
.cp-neg { fill: #a51f3e; fill-opacity: .07; }
.cp-line { fill: none; stroke: #c27a12; stroke-width: 2.5; stroke-linejoin: round; }
.cp-dot { fill: #c27a12; stroke: var(--panel); stroke-width: 2; } .cp-dot.neg { fill: #a51f3e; }
.cp-hit { fill: transparent; } .cp-col:hover .cp-hit { fill: var(--ink); fill-opacity: .04; }
.cp-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 6px; }
.cp-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cp-legend .l-proj { background: var(--c1); } .cp-legend .l-oh { background: #8a94a6; } .cp-legend .l-in { background: #1d7a46; }
.cp-legend .l-line { height: 3px; background: #c27a12; vertical-align: 2px; } .cp-legend .l-neg { background: rgba(165,31,62,.15); }
.cp-table td, .cp-table th { white-space: nowrap; }
.cp-table td:first-child { white-space: normal; min-width: 220px; }
.cp-money td { background: var(--group-bg); }
.cp-stage td:first-child { padding-left: 28px; }
.cp-how li { padding: 4px 0; }

/* Тестовый раздел */
.beta-head { margin-bottom: 18px; }
.beta-tabs { flex-wrap: wrap; max-width: 100%; }
.beta-tabs a { border-bottom: 1px solid var(--line-strong); margin-bottom: -1px; }
table.kv td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv td.num { white-space: nowrap; width: 1%; }
table.kv tr.total td { border-top: 2px solid var(--line-strong); border-bottom: 0; font-size: 13px; }
ol.steps { margin: 0; padding-left: 22px; }
ol.steps > li { padding: 10px 0; border-bottom: 1px solid var(--line); line-height: 1.6; }
ol.steps > li:last-child { border-bottom: 0; }
ol.steps > li.done::marker { color: var(--good, #2e7d32); }
.tg-preview { white-space: pre-wrap; font-size: 12px; line-height: 1.55; background: var(--group-bg); border-radius: var(--radius); padding: 14px 16px; max-width: 560px; }
form.tax-plan input.small-input { width: 110px; }
form.tax-plan input[type=date] { width: 140px; }
form.tax-plan input { padding: 5px 7px; font-size: 11px; }
td.nowrap { white-space: nowrap; }
.advisor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.advisor-layout > .panel:only-child { grid-column: 1 / -1; }
.advisor-body { line-height: 1.6; font-size: 12px; max-width: 900px; }
.advisor-body h3 { margin: 18px 0 6px; } .advisor-body h4 { margin: 14px 0 4px; }
.advisor-body ul, .advisor-body ol { padding-left: 22px; } .advisor-body li { margin: 3px 0; }
.advisor-list li { padding: 4px 0; } .advisor-list li.active a { font-weight: 600; }
@media (max-width: 900px) { .advisor-layout { grid-template-columns: 1fr; } }
.advisor-body ul.sub { margin: 2px 0 8px 22px; }

/* План-факт: понятные плитки и переключатель */
.pf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.pf-head h2 { margin: 0; }
.pf-toggle { margin: 0; }
.pf-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 8px; }
.pf-tile { background: var(--group-bg); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.pf-tile .k { font-size: 11px; color: var(--muted); }
.pf-tile b { font-size: 18.5px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.pf-tile small { font-size: 10.5px; color: var(--muted); }
.pf-tile.bad-tile { box-shadow: inset 3px 0 0 #a51f3e; }
.pf-bottom { font-size: 12px; margin: 4px 0 10px; }
.pf-pct { font-size: 10.5px; font-weight: 600; fill: var(--muted); font-variant-numeric: tabular-nums; }
.pf-pct.in { fill: #fff; }
.pf-label.total { font-weight: 700; font-size: 12.5px; }
.pf-sep { stroke: var(--line-strong); stroke-width: 1; }
@media (max-width: 900px) { .pf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
tr.plan-new td { background: var(--group-bg); }
input.plan-new-name { width: 100%; min-width: 200px; font-weight: 500; }
.fin-tabs { margin-bottom: 16px; }
.inv-place { display: inline-block; margin: 0 10px 2px 0; white-space: nowrap; }
