/* =====================================================================
   Монолит — дизайн-система (концепция Г, фирменный стиль)
   Фирменные цвета из брендбука: тёмно-синий #15242F, серо-голубой #B0BBC3, белый.
   Все пары «текст / фон» проверены на контраст WCAG 2.2 AA (≥ 4,5:1).
   ===================================================================== */

/* Фирменный шрифт по брендбуку — Stolzl: заголовки, меню, кнопки. Inter — таблицы и суммы (цифры одной ширины). */
@font-face { font-family: 'Stolzl'; font-weight: 400; font-display: swap; src: url('fonts/Stolzl-Book.woff') format('woff'); }
@font-face { font-family: 'Stolzl'; font-weight: 500; font-display: swap; src: url('fonts/Stolzl-Regular.woff') format('woff'); }
@font-face { font-family: 'Stolzl'; font-weight: 600; font-display: swap; src: url('fonts/Stolzl-Medium.woff') format('woff'); }
@font-face { font-family: 'Stolzl'; font-weight: 700; font-display: swap; src: url('fonts/Stolzl-Bold.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/Inter-Regular.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('fonts/Inter-Medium.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/Inter-SemiBold.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('fonts/Inter-Bold.woff') format('woff'); }

:root {
  /* фирменные */
  --brand: #15242F; --brand-2: #22384A; --brand-line: #B0BBC3; --brand-tint: #EEF1F4;
  /* поверхности и текст */
  --bg: #F4F6F8; --panel: #fff; --text: #15242F; --muted: #5B6475; --line: #E3E7EC; --line2: #858E9E;
  /* ссылки и фокус — оттенки фирменного тёмно-синего (брендбук: #15242F, #B0BBC3, белый) */
  --accent: #2B5373; --accent-weak: #E8EEF2; --focus: 0 0 0 3px rgba(43, 83, 115, .35);
  --font-brand: Stolzl, Inter, "Segoe UI", system-ui, Arial, sans-serif;
  /* смысловые */
  --ok: #067647; --ok-bg: #DCFAE6; --warn: #B54708; --warn-bg: #FEF0C7; --err: #B42318; --err-bg: #FEE4E2;
  --radius: 10px; --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(21, 36, 47, .06);
  --side: 232px; --ctl: 36px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg);
  font-feature-settings: "tnum" 1, "case" 1;   /* равноширинные цифры: суммы выравниваются по разрядам */
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; overflow-y: scroll; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
h1, h2, h3, h4, .brand-big, .side-nav, .side-label, .tabs, .seg, .btn, .modal-head h2, .stat-label, .page-title .sub, .bottom-nav { font-family: var(--font-brand); }
h1 { font-size: 22px; margin: 2px 0 12px; font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; letter-spacing: -.2px; }
h2 { font-size: 18px; margin: 0 0 8px; font-weight: 600; }
h3 { font-size: 15px; margin: 18px 0 10px; font-weight: 600; }
.card h3:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.pad { padding: 16px; }
.err-text { color: var(--err); font-weight: 600; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.nowrap { white-space: nowrap; }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- каркас: боковое меню + рабочая область ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--brand); color: var(--brand-line); display: flex; flex-direction: column; padding: 16px 12px; gap: 2px; }
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: #fff; }
.logo-full { display: flex; flex-direction: column; gap: 6px; padding: 4px 8px 20px; }
.logo-full img { width: 176px; height: auto; display: block; }
.logo-full small { font-family: var(--font-brand); color: var(--brand-line); font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; padding-left: 2px; }
.logo-mark { width: 30px; height: 30px; display: block; }
.login-brand .logo-v { width: min(260px, 70%); height: auto; }
.logo:hover { text-decoration: none; }
.logo-word { display: flex; flex-direction: column; line-height: 1.1; }
.logo-word b { font-weight: 700; letter-spacing: 2.5px; font-size: 15px; }
.logo-word small { color: var(--brand-line); font-size: 12px; letter-spacing: .3px; margin-top: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--brand-line); font-weight: 500; min-height: 40px; }
.side-nav a:hover { background: rgba(176, 187, 195, .12); color: #fff; text-decoration: none; }
.side-nav a.on { background: rgba(176, 187, 195, .2); color: #fff; }
.side-label { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; margin: 18px 10px 6px; color: var(--brand-line); }
.side select { width: 100%; background: var(--brand-2); color: #fff; border: 1px solid rgba(176, 187, 195, .45); }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(176, 187, 195, .2); display: flex; flex-direction: column; gap: 6px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot .who small { display: block; color: var(--brand-line); font-weight: 400; font-size: 12px; }
.side-foot .links { display: flex; gap: 14px; }
.side-foot a, .side-foot button { color: var(--brand-line); background: none; border: 0; padding: 4px 0; font: inherit; cursor: pointer; min-height: 32px; min-width: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.side-foot a:hover, .side-foot button:hover { color: #fff; text-decoration: none; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.work { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: rgba(244, 246, 248, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; padding-left: 34px; background: #fff; }
.search .ico { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search kbd { position: absolute; right: 8px; top: 7px; font: 12px Inter, sans-serif; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; background: #fff; }
.search-res { position: absolute; top: 42px; left: 0; right: 0; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(21, 36, 47, .16); max-height: 60vh; overflow: auto; z-index: 30; }
.search-res button { display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; font: inherit; cursor: pointer; min-height: 40px; }
.search-res button:hover, .search-res button:focus { background: var(--accent-weak); }
.search-res .grp { font-size: 12px; color: var(--muted); padding: 8px 12px 2px; text-transform: uppercase; letter-spacing: .6px; }
.main { padding: 20px 24px 32px; }
/* одна ширина и центровка у всех страниц — при переходе блоки не «прыгают»; шире только шахматка и конструкторы */
.page, .page-wide { max-width: 1440px; margin: 0 auto; width: 100%; }
.page-full { max-width: none; }
.mobile-only { display: none !important; }

/* ---------- элементы управления ---------- */
input, select, textarea { font: inherit; min-height: var(--ctl); padding: 7px 10px; border: 1px solid var(--line2); border-radius: var(--radius-sm); background: #fff; color: var(--text); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input.ro { background: var(--brand-tint); font-weight: 600; }
textarea { resize: vertical; width: 100%; }
.btn { font: inherit; font-weight: 600; min-height: var(--ctl); padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid #C9D0D8; background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--brand-tint); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-danger { background: #fff; border-color: #F4A79F; color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-danger-solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-weak); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); font-weight: 500; }
.btn-quiet:hover { background: var(--brand-tint); color: var(--text); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 4px 0; min-height: 24px; }
.back { display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px; margin: 0 0 8px -4px; font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); overflow-x: auto; }
.card.narrow { max-width: 420px; margin: 40px auto; display: flex; flex-direction: column; gap: 10px; }
.subcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; background: #FAFBFC; }
.subcard.warn { background: #FFF8E6; border-color: #F5D58A; }
.subcard summary { cursor: pointer; font-weight: 600; }
.alert { padding: 10px 12px; border-radius: var(--radius-sm); margin: 8px 0; }
.alert-info { background: #EEF4FA; color: #15242F; border: 1px solid #C9D8E6; }
.alert-warn { background: var(--warn-bg); color: #93370D; border: 1px solid #F5D58A; }
.backup-ok { color: var(--ok); font-size: 13px; margin: -4px 0 10px; }
.alert-err { background: var(--err-bg); color: #912018; border: 1px solid #F9C6C0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; align-items: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.more { width: auto; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field-hint { font-size: 12px; color: var(--muted); }
.field input, .field select { width: 100%; }
.grid2, .grid3, .grid4 { display: grid; gap: 0 12px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-wide { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); cursor: pointer; min-height: 28px; }
.check input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid #C9D0D8; border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 14px; min-height: 34px; font: inherit; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }   /* без смены толщины — соседние кнопки не сдвигаются */
.w140 { width: 140px; }
.grow { flex: 1; min-width: 200px; }
.amount-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.amount-chips button { border: 1px solid #C9D0D8; background: #fff; border-radius: 999px; padding: 5px 12px; min-height: 32px; font: inherit; font-size: 13px; cursor: pointer; }
.amount-chips button:hover, .amount-chips button.on { border-color: var(--brand); background: var(--brand-tint); }
.amount-chips b { font-weight: 600; }

/* ---------- показатели ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 2px; letter-spacing: -.3px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-ok .stat-value { color: var(--ok); }
.stat-warn .stat-value { color: var(--warn); }
.stat-err .stat-value { color: var(--err); }
.stat.link-stat { cursor: pointer; }
.stat.link-stat:hover { border-color: var(--brand-line); }
/* группы денег: договоры / деньги (факт) / долги — не смешиваются */
.money-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.mg { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.mg-title { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.mg-title i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.mg-main { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.mg-sub { color: var(--muted); font-size: 13px; }
.mg-rows { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; }
.mg-rows span:nth-child(odd) { color: var(--muted); }
.mg.contracts .mg-title i { background: var(--brand-line); }
.mg.cash { border-left: 3px solid var(--ok); }
.mg.cash .mg-title i { background: var(--ok); }
.mg.debt .mg-title i { background: var(--err); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.page-title, .page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; min-height: 40px; }
.page-title h1, .page-head h1 { margin: 0; }
.page-title .sub { color: var(--muted); }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; background: #F7F8FA; border-bottom: 1px solid var(--line); padding: 9px 10px; white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #EEF1F4; vertical-align: middle; }
.tbl tfoot td { font-weight: 700; background: #F7F8FA; border-top: 1px solid var(--line); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #F3F6FA; }
.tbl tr.row-err td { background: #FEF3F2; }
.tbl tr.row-dim td { color: #6B7280; text-decoration: line-through; }
.tbl select { min-height: 30px; padding: 4px 6px; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: 8px 0; border-bottom: 1px solid #EEF1F4; display: flex; gap: 10px; align-items: baseline; }
.feed .t { color: var(--muted); font-size: 12.5px; white-space: nowrap; flex: none; min-width: 70px; }
.feed a { display: inline-block; padding: 3px 0; }
.feed .amt { margin-left: auto; font-weight: 600; white-space: nowrap; }
.props { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 12px 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.kv { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.subtle-list { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.totals { align-self: center; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- статусы помещений: цвет всегда вместе со словом (контраст ≥ 6:1) ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.st-free { background: #F3FBF6; border-color: #A6E3BD; color: var(--text); }
.badge.st-free { background: #DCFAE6; color: #085D3A; }
.st-reserved { background: #FEF0C7; border-color: #F5C451; color: #93370D; }
.st-sold { background: #E0EAFF; border-color: #A4BCF0; color: #1F3E8A; }
.st-sold.debt { background: #FEE4E2; border-color: #F49C92; color: #912018; }
.st-gifted, .st-transferred { background: #EBE9FE; border-color: #BDB4F6; color: #4A1FB8; }
.st-offset { background: #F6EEE4; border-color: #D2AE84; color: #6B4423; }
.st-withdrawn, .st-blocked { background: #F2F4F7; border-color: #CDD3DB; color: #344054; }
.st-active { background: #DCFAE6; color: #085D3A; }
.st-terminated { background: #FEE4E2; color: #912018; }
.st-completed { background: #F2F4F7; color: #344054; }

/* ---------- шахматка ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs a { padding: 6px 12px; min-height: 34px; display: inline-flex; align-items: center; border: 1px solid #C9D0D8; border-radius: 999px; background: #fff; color: var(--text); font-weight: 600; }
.tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a:hover { text-decoration: none; border-color: var(--brand); }
.subtitle { color: var(--muted); margin-bottom: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .field { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.lg { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #C9D0D8; background: #fff; border-radius: 999px; padding: 4px 12px; min-height: 32px; font: inherit; cursor: pointer; color: var(--text); }
.lg i { width: 12px; height: 12px; border-radius: 50%; border-width: 1px; border-style: solid; display: inline-block; }
.lg b { font-weight: 600; color: var(--muted); }
.lg.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.find-no { width: 110px; }
.selbar { position: sticky; top: 58px; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--brand-tint); border: 1px solid var(--brand-line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
.chess-wrap { overflow-x: auto; padding-bottom: 8px; }
.chess { display: grid; gap: 5px; min-width: max-content; grid-template-columns: 44px repeat(var(--cols), minmax(92px, 1fr)); }
.floor { position: sticky; left: 0; z-index: 2; background: var(--bg); border: 0; font: inherit; color: var(--muted); font-weight: 700; text-align: right; padding-right: 8px; align-self: stretch; display: flex; align-items: center; justify-content: flex-end; }
.floor-sel { cursor: pointer; color: var(--accent); text-decoration: underline; }
.cell { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 62px; padding: 6px 8px; border-width: 1px; border-style: solid; border-radius: 8px; font: inherit; cursor: pointer; text-align: left; }
.cell:hover { box-shadow: 0 0 0 2px var(--brand-line); }
.cell-empty { border: 1px dashed #DDE2E8; background: transparent; cursor: default; }
.cell-no { font-weight: 700; font-size: 14px; display: flex; align-items: baseline; gap: 6px; width: 100%; }
.cell-no small { font-weight: 500; font-size: 12px; opacity: .85; }
.cell-a { font-size: 12.5px; }
.cell-b { font-size: 12px; font-weight: 600; }
.st-free .cell-b { font-weight: 500; color: var(--muted); }
.cell.st-withdrawn { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(21,36,47,.05) 6px 12px); }
.cell.dim { opacity: .22; }
.cell.sel { box-shadow: 0 0 0 3px var(--brand); }
.cell.hit { box-shadow: 0 0 0 3px var(--accent); animation: hit 1.2s ease 2; }
@keyframes hit { 50% { box-shadow: 0 0 0 6px rgba(31,79,184,.25); } }

/* ---------- конструктор объектов ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--pw, 1fr)); gap: 16px; align-items: start; }
.pv-size { display: inline-flex; gap: 2px; }
@media (max-width: 1300px) { .pv-size { display: none; } }
.ref-pick { display: flex; gap: 6px; align-items: center; }
.ref-pick select { flex: 1; min-width: 0; }
.ref-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ref-add input { flex: 1; min-width: 160px; }
.builder > * { min-width: 0; }
.builder-preview { position: sticky; top: 70px; }
.builder-preview .chess-wrap { max-height: 62vh; overflow: auto; max-width: 100%; }
.builder .tbl-wrap { overflow-x: auto; max-width: 100%; }
.tbl.risers td { padding: 4px 6px; }
.tbl.risers input, .tbl.risers select { width: 100%; min-width: 64px; min-height: 34px; }
.cell.pv-changed { outline: 2px dashed var(--accent); outline-offset: -3px; }
.cell.pv-skip { color: var(--muted); align-items: center; justify-content: center; font-size: 18px; cursor: pointer; }
.cell:disabled { cursor: default; opacity: 1; }
@media (max-width: 1300px) { .builder { grid-template-columns: minmax(0, 1fr); } .builder-preview { position: static; } }

/* ---------- окна ---------- */
.modal-back, .drawer-back { position: fixed; inset: 0; background: rgba(21, 36, 47, .45); z-index: 50; display: flex; }
.modal-back { align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: min(560px, 100%); min-width: 0; box-shadow: 0 24px 56px rgba(21,36,47,.28);
  /* высокое окно: прокручивается содержимое, заголовок и кнопки всегда видны */
  display: flex; flex-direction: column; max-height: 88vh; }
.modal > .modal-head, .modal > .modal-foot { flex: none; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.hist-d { font-weight: 600; }
textarea[wrap=off] { white-space: pre; overflow-x: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #FAFBFC; border-radius: 0 0 12px 12px; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); min-width: 36px; min-height: 36px; border-radius: 8px; }
.x:hover { background: var(--brand-tint); }
.drawer-back { justify-content: flex-end; }
.drawer { background: #fff; width: 520px; max-width: 100%; height: 100%; overflow: auto; padding: 18px 22px; position: relative; box-shadow: -12px 0 32px rgba(21,36,47,.18); }
.drawer-x { position: absolute; top: 10px; right: 12px; }
.unit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-right: 36px; }
.unit-head h2 { font-size: 22px; margin: 2px 0 0; }
.confirm-sum { font-size: 26px; font-weight: 700; margin: 4px 0 2px; letter-spacing: -.3px; }

.picker { display: flex; flex-direction: column; gap: 6px; position: relative; }
.picker > input { width: 100%; }
.picker-list { border: 1px solid var(--line2); border-radius: var(--radius-sm); max-height: 240px; overflow: auto; }
.picker-list button { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-bottom: 1px solid #EEF1F4; background: #fff; font: inherit; cursor: pointer; }
.picker-list button:hover { background: var(--accent-weak); }
.picker > .btn { align-self: flex-start; }
.picked { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border: 1px solid var(--brand-line); background: var(--brand-tint); border-radius: var(--radius-sm); }

.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { padding: 11px 14px; border-radius: 10px; color: #fff; box-shadow: 0 8px 24px rgba(21,36,47,.25); max-width: 380px; background: var(--brand); display: flex; gap: 10px; align-items: center; }
.toast-ok::before { content: '✓'; color: #75E0A7; font-weight: 700; }
.toast-err { background: var(--err); }

/* ---------- вход ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-brand { background: var(--brand); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; }
.login-brand p { color: var(--brand-line); max-width: 360px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 6px; }
.brand-big { font-size: 22px; font-weight: 700; color: var(--brand); }

/* ---------- сотрудники, права, закрытие периода ---------- */
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag-warn { color: var(--warn); font-weight: 600; }
.obj-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.obj-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; }
.modal-foot .grow { flex: 1; }
.lock-panel { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 10px 14px; margin-bottom: 12px; }
.lock-panel .lock-obj { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- нижняя панель (телефон) ---------- */
.bottom-nav { display: none; }
.sheet-back { position: fixed; inset: 0; background: rgba(21,36,47,.45); z-index: 60; display: flex; align-items: flex-end; }
.sheet { background: #fff; width: 100%; border-radius: 16px 16px 0 0; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.sheet a, .sheet button { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 48px; border: 0; background: none; font: inherit; color: var(--text); border-radius: 10px; text-align: left; }
.sheet a:hover, .sheet button:hover { background: var(--brand-tint); text-decoration: none; }

/* ---------- планшет ---------- */
@media (max-width: 1100px) {
  :root { --side: 76px; }
  .side { padding: 14px 8px; align-items: center; }
  .logo-word, .side-label, .side-nav a span, .side-foot .who, .side-foot .links span { display: none; }
  .logo { padding: 2px 0 16px; }
  .side-nav a { justify-content: center; padding: 10px; }
  .side select { font-size: 12px; padding: 6px 4px; }
  .side-foot { padding: 10px 0 0; align-items: center; }
  .side-foot .links { flex-direction: column; gap: 4px; align-items: center; }
  .cols, .grid4 { grid-template-columns: 1fr 1fr; }
  .money-groups { grid-template-columns: 1fr 1fr; }
}

/* ---------- телефон: своё представление, а не уменьшенный компьютер ---------- */
@media (max-width: 760px) {
  :root { --ctl: 44px; font-size: 15px; }
  .shell { display: block; }
  .side { display: none; }
  .mobile-only { display: flex !important; }
  .topbar { padding: 8px 12px; gap: 8px; background: var(--brand); border-bottom: 0; }
  .topbar .logo { padding: 0; }
  .topbar select { background: var(--brand-2); color: #fff; border-color: rgba(176,187,195,.45); max-width: 44vw; }
  .search kbd { display: none; }
  .main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; font: inherit; font-size: 12px; color: var(--muted); background: none; border: 0; }
  .bottom-nav .on { color: var(--brand); }
  .bottom-nav .ico { width: 22px; height: 22px; }
  .bottom-nav a:hover { text-decoration: none; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .link, .back { min-height: 44px; display: inline-flex; align-items: center; }
  .grid2, .grid3, .grid4, .cols, .money-groups { grid-template-columns: 1fr; }
  .props { grid-template-columns: 120px 1fr; }
  .filters { margin-left: 0; }
  .drawer { padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }
  /* окно снизу, как на телефоне принято; высокое окно прокручивается и не обрезается сверху */
  .modal-back { padding: 0; align-items: flex-start; }
  .modal { border-radius: 16px 16px 0 0; margin-top: auto; max-height: 94vh; max-height: 94dvh; }
  .toasts { left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  /* панель выбора цены — компактно внизу, над нижним меню, шахматка остаётся видна */
  .selbar { position: fixed; top: auto; left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 30; margin: 0; padding: 8px; gap: 6px; box-shadow: 0 6px 20px rgba(21,36,47,.18); }
  .selbar > span { flex-basis: 100%; font-size: 13px; }
  .page.sel-on { padding-bottom: 130px; }
  .selbar input { flex: 1; min-width: 0; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; margin-left: -12px; margin-right: -12px; padding: 0 12px 2px; }
  .tabs a { flex: none; }
  .modal { max-width: 100% !important; }
  .page, .page-wide { max-width: 100%; overflow-x: clip; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 19px; }
  h1 { font-size: 20px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 24px; min-height: 150px; }
  .login-brand p { display: none; }
  /* шахматка на телефоне: весь этаж в ширину экрана, номер + буква статуса */
  .chess-wrap.fit .chess { min-width: 0; gap: 3px; grid-template-columns: 26px repeat(var(--cols), minmax(0, 1fr)); }
  .chess-wrap.fit .cell-no { flex-direction: column; align-items: center; gap: 0; }
  .chess-wrap.fit .cell { min-height: 44px; padding: 4px 3px; align-items: center; justify-content: center; }
  .chess-wrap.fit .cell-a, .chess-wrap.fit .cell-b, .chess-wrap.fit .cell-m, .chess-wrap.fit .cell-no small { display: none; }
  .chess-wrap.fit .cell-no { font-size: 13px; justify-content: center; }
  .chess-wrap.fit .cell-no::after { content: attr(data-s); font-size: 11px; font-weight: 600; }
  .tabs.desktop-only { display: none; }
  /* таблицы на телефоне — карточками */
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tbl.cards td { border: 0; padding: 2px 4px; text-align: left !important; }
  .tbl.cards td[data-l]::before { content: attr(data-l) ': '; color: var(--muted); }
}
@media (min-width: 761px) { .desktop-hide { display: none !important; } }
@media (max-width: 760px) { .mobile-hide { display: none !important; } .tbl.cards tfoot td { display: block; } .tbl.cards tfoot tr { display: block; } }
.ver { font-size: 12px; color: #8A99A6; margin-top: 6px; }
.login-brand .ver { color: rgba(255,255,255,.6); display: block; margin-top: 16px; }
input::placeholder, textarea::placeholder { color: #A9B4BE; font-style: italic; opacity: 1; }
.tbl.risers input.need { border-color: #E9A23B; background: #FFFBF2; }

/* ---------- свои статусы ---------- */
.mark-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--mk); background: color-mix(in srgb, var(--mk) 12%, #fff); border: 1px solid color-mix(in srgb, var(--mk) 40%, #fff); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mark-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--mk); flex: none; }
.mark-chip b { font-size: 11px; }
.mark-chip.small { font-size: 12px; padding: 1px 7px 1px 6px; }
.mark-group { margin-top: 16px; }
.mark-group-h { margin-bottom: 6px; }
.examples { margin-top: 18px; padding-top: 14px; border-top: 1px dashed #D5DCE2; }
.examples .chips { margin-top: 8px; }
.chip-btn { border: 1px dashed #C9D0D8; background: #fff; border-radius: 999px; padding: 4px 10px 4px 5px; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 4px; }
.chip-btn:hover { border-color: var(--brand); }
.mark-preview { margin-bottom: 14px; padding: 10px 12px; background: #F5F7F9; border-radius: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg.wrap { flex-wrap: wrap; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #C9D0D8; cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--brand); }
.swatch-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #6B7A86); cursor: pointer; }
.swatch-custom input { width: 30px; height: 30px; padding: 0; border: 0; background: none; min-height: 0; }
/* в шахматке: цветная полоска слева и строка со своим статусом */
.cell.marked { box-shadow: inset 4px 0 0 var(--mk); }
.cell-m { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--mk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cell-m i { width: 6px; height: 6px; border-radius: 50%; background: var(--mk); flex: none; }
.lg i.mk { background: var(--mk) !important; }
.legend-sep { width: 1px; align-self: stretch; background: #D5DCE2; margin: 0 4px; }
.unit-st { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mark-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 12px; padding: 8px 10px; background: #F5F7F9; border-radius: 8px; }
.mark-pick select { width: auto; min-width: 180px; }

/* ---------- редактор блока и обмеры ---------- */
.edit-wrap { max-height: calc(100vh - 300px); overflow: auto; }
.edit-tbl { font-size: 13px; }
.edit-tbl th { position: sticky; top: 0; background: #F5F7F9; z-index: 1; white-space: nowrap; }
.edit-tbl td { padding: 3px 4px; vertical-align: middle; }
.edit-tbl input, .edit-tbl select { min-height: 30px; height: 30px; padding: 2px 6px; font-size: 13px; width: 100%; min-width: 0; }
.edit-tbl input[type=checkbox] { width: 16px; height: 16px; min-height: 16px; }
.edit-tbl .w-s { width: 54px; } .edit-tbl .w-m { width: 84px; }
.edit-tbl td:nth-child(3) input { width: 70px; }
.edit-tbl td:nth-child(12) input { min-width: 140px; }
.edit-tbl input:disabled, .edit-tbl select:disabled { background: #F2F4F6; color: #6B7A86; cursor: not-allowed; }
input.chg, select.chg { border-color: #E9A23B; background: #FFF6E5; }
input.bad { border-color: var(--err); background: #FFF1F0; }
tr.row-new td { background: #F1FAF4; }
tr.row-del td { background: #FFF1F0; } tr.row-del input, tr.row-del select { text-decoration: line-through; }
tr.row-chg td { background: #FFFBF2; }
.badge.st-new { background: #E8F6EE; color: #1E7A46; }
.icon-btn { border: 0; background: none; font-size: 18px; line-height: 1; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; color: #6B7A86; }
.icon-btn:hover:not(:disabled) { background: #EEF1F4; color: var(--err); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.filters.bulk { background: #EEF4FA; border-radius: 8px; padding: 4px 8px; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 -4px 16px rgba(21,36,47,.08); }
.save-bar.on { border-color: #E9A23B; }
.save-bar .alert { margin: 0; flex-basis: 100%; }
.diff-list h4 { margin: 10px 0 4px; } .diff-list ul { margin: 0; padding-left: 18px; max-height: 260px; overflow: auto; } .diff-list li { margin: 2px 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.measure-tbl input { width: 90px; text-align: right; }
@media (max-width: 760px) {
  .edit-wrap { max-height: none; }
  .save-bar { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
.changes-list .chg-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.changes-list .chg-row:last-child { border-bottom: 0; }
.cell-pm { font-style: normal; font-weight: 500; color: var(--muted); }
.w180 { width: 180px; }
.w80 { width: 80px; }
.kinds-tbl td, .kinds-tbl th { white-space: nowrap; }

/* ---------- касса ---------- */
.cash-actions { margin: 0 0 12px; flex-wrap: wrap; }
.cash-sum { display: flex; gap: 20px; flex-wrap: wrap; padding: 10px 14px; background: #F5F7F9; border-radius: 8px; margin-bottom: 10px; }
.cash-amount { font-size: 26px; font-weight: 700; margin: 4px 0 10px; }
.cash-amount.in { color: var(--ok); } .cash-amount.out { color: var(--err); }
.pick-list { border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; max-height: 240px; overflow: auto; }
.pick-list button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 8px 10px; cursor: pointer; font: inherit; }
.pick-list button:hover { background: #EEF4FA; }
.files { margin-top: 16px; } .files h4 { margin: 0 0 6px; } .files ul { list-style: none; padding: 0; margin: 0 0 8px; } .files li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; display: inline-flex; align-items: center; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.adv-lines { padding-left: 18px; } .adv-lines li { margin: 4px 0; }
.grow { flex: 1; }

/* ---------- печатные формы КО-1 / КО-2 ---------- */
.print-page { background: #fff; color: #000; padding: 16px; font-family: Arial, sans-serif; font-size: 11px; }
.print-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.ko { max-width: 190mm; margin: 0 auto; }
.ko1 { display: flex; gap: 0; max-width: 277mm; }
.ko1 .ko-main { flex: 1.45; padding-right: 8mm; } .ko-cut { border-left: 1px dashed #000; } .ko1 .ko-receipt { flex: 1; padding-left: 8mm; }
.ko-uni { text-align: right; font-size: 8px; margin-bottom: 4px; }
.ko-codes { margin-left: auto; border-collapse: collapse; font-size: 10px; }
.ko-codes td { padding: 1px 4px; } .ko-codes .r { text-align: right; } .ko-box { border: 1px solid #000; min-width: 70px; text-align: center; }
.ko-org { margin: 4px 0; } .ko-line { display: inline-block; border-bottom: 1px solid #000; min-height: 15px; position: relative; padding-bottom: 1px; }
.ko-org .ko-line { width: 100%; }
.ko-sub { display: block; font-size: 7.5px; text-align: center; color: #000; line-height: 1.1; }
.ko-title { width: 100%; margin: 8px 0; } .ko-name { font-weight: 700; font-size: 13px; } .ko-name.c { text-align: center; margin: 6px 0; }
.ko-grid { border-collapse: collapse; width: 100%; } .ko-grid th, .ko-grid td { border: 1px solid #000; padding: 2px 4px; font-size: 9px; text-align: center; font-weight: 400; vertical-align: middle; }
.ko-grid td { height: 18px; font-size: 11px; } .ko-grid .r { text-align: right; }
.ko-acc { margin-bottom: 8px; }
.ko-l { display: flex; align-items: flex-end; gap: 6px; margin: 7px 0; } .ko-lab { white-space: nowrap; } .ko-line.grow { flex: 1; }
.ko-sign .w-sig { width: 28mm; } .ko-sign .w-name { width: 40mm; } .ko-sign .w-pos { width: 38mm; }
.ko-mp { margin: 8px 0; font-size: 9px; } .ko-signs2 { margin: 8px 0; }
@page ko2 { size: A4 portrait; margin: 10mm; }
.ko2 { page: ko2; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  .no-print { display: none !important; }
  .print-page { padding: 0; }
  body { background: #fff !important; }
}
.bar { height: 10px; background: #EEF1F4; border-radius: 5px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
tr.tot td { border-top: 2px solid var(--line); }
.small-tabs a { cursor: pointer; }
/* ---------- подсказки при вводе ---------- */
.suggest { position: relative; }
.suggest-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 2px); background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(21,36,47,.16); max-height: 280px; overflow: auto; min-width: 240px; }
.suggest-list button { display: flex; flex-direction: column; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #EEF1F4; background: #fff; padding: 7px 10px; cursor: pointer; font: inherit; }
.suggest-list button:last-child { border-bottom: 0; }
.suggest-list button.on, .suggest-list button:hover { background: #EEF4FA; }
.s-name { font-weight: 600; } .s-meta { font-size: 12px; color: var(--muted); }
.inn-note { font-size: 13px; margin-top: 4px; }
.dup-hint { margin-top: 4px; font-size: 13px; background: #FFF6E5; border: 1px solid #F1D39A; border-radius: 8px; padding: 6px 10px; }
.dup-hint button { margin-left: 6px; }

.print-page { position: relative; }
.ko-stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); border: 4px solid #C0392B; color: #C0392B; font-size: 34px; font-weight: 800;
  padding: 8px 20px; opacity: .55; pointer-events: none; white-space: nowrap; z-index: 2; }

.decisions { border-color: #F1D39A; }
.dec-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- доступность: заметная рамка фокуса, контраст подсказок, шахматка не растягивается ---------- */
:focus-visible { outline: 3px solid #2E6BD8; outline-offset: 2px; }
.side :focus-visible, .bottom-nav :focus-visible { outline-color: #FFD25C; }
tr.click:focus-visible td { background: #EEF4FA; }
input::placeholder, textarea::placeholder { color: #7A8794; }
.chess .cell { min-width: 0; overflow: hidden; }
.chess .cell > span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.chess .cell .cell-no { display: flex; }
.mark-chip { color: color-mix(in srgb, var(--mk) 72%, #000); }
.cash-tbl thead th, .tbl-wrap .tbl thead th { position: sticky; top: 0; background: #F5F7F9; z-index: 1; }
.pad.c { text-align: center; }

/* ---------- CRM ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board .col { flex: 1 0 190px; max-width: 320px; background: #EEF1F4; border-radius: var(--radius); padding: 8px; min-height: 120px; }
.board .col.droppable { outline: 2px dashed #B9C3CF; outline-offset: -2px; }
.col-h { padding: 4px 6px 8px; border-top: 3px solid var(--st, #7C8B96); border-radius: 3px; display: flex; justify-content: space-between; gap: 6px; font-size: 14px; }
.col-empty { text-align: center; padding: 16px 0; }
.lead-card { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 2px rgba(21,36,47,.06); }
.lead-card:hover { border-color: var(--accent); }
.lead-card:focus-visible { outline: none; box-shadow: var(--focus); }
.lc-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.lc-wish { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-task { margin-top: 4px; }
.lc-foot { margin-top: 4px; }
.stage-pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--st, #7C8B96) 15%, #fff); color: color-mix(in srgb, var(--st, #7C8B96) 75%, #000); border: 1px solid color-mix(in srgb, var(--st, #7C8B96) 40%, #fff); }
.stages { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.stage-step { font: inherit; font-size: 13px; font-weight: 500; padding: 6px 10px; border: 1px solid var(--line2); background: #fff; border-radius: 99px; cursor: pointer; min-height: 32px; }
.stage-step.on { background: var(--st, var(--accent)); border-color: var(--st, var(--accent)); color: #fff; }
.stage-step.k-lost:not(.on) { color: #A33; }
.contact { margin: 8px 0; }
.lead-sec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }
.lead-sec h4 { margin: 0 0 8px; }
.lead-sec textarea { width: 100%; margin: 6px 0; }
.task-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #F0F2F5; }
.task-row > :nth-child(2) { flex: 1; }
.task-add { margin-top: 8px; flex-wrap: wrap; }
.task-add input { flex: 1 1 220px; }
.icon-btn.ok { color: #1E7B45; border-color: #9BCDAE; }
a.link-row { color: var(--text); display: flex; }
a.link-row:hover { background: var(--accent-weak); }
.timeline { list-style: none; padding: 0; margin: 12px 0 0; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F0F2F5; white-space: pre-wrap; }
.timeline .ev-i { width: 22px; flex: 0 0 22px; text-align: center; }
.timeline li.ev-system, .timeline li.ev-stage { color: var(--muted); font-size: 14px; }
.seg.wrap { flex-wrap: wrap; }
.funnel .f-row { display: grid; grid-template-columns: 160px 1fr 90px; gap: 10px; align-items: center; padding: 4px 0; }
.funnel .f-bar { background: #EEF1F4; border-radius: 4px; height: 18px; overflow: hidden; }
.funnel .f-bar span { display: block; height: 100%; border-radius: 4px; }
@media (max-width: 760px) {
  .board .col { flex-basis: 82vw; }
  .funnel .f-row { grid-template-columns: 110px 1fr 70px; }
}
.drop-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; padding: 12px; justify-content: center; background: rgba(21,36,47,.85); z-index: 60; }
.drop-zone { flex: 0 1 280px; text-align: center; padding: 18px; border: 2px dashed #fff; border-radius: var(--radius); color: #fff; font-weight: 700; background: color-mix(in srgb, var(--st, #7C8B96) 60%, transparent); }
.alert-ok { background: #E8F6EE; color: #155B33; border: 1px solid #A9D8BC; }
.pay-last { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pay-done { text-align: center; padding: 8px 0; }
.pay-done .row-gap { justify-content: center; }
/* ---------- Подбор ---------- */
.pick-filters { display: grid; gap: 10px; overflow: visible; }
.pf-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.pf-row > label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pf-l { display: block; font-size: 13px; color: var(--muted); width: 100%; }
.pf-range { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pf-range input { width: 110px; }
.pf-rooms { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pf-rooms button { font: inherit; min-width: 44px; min-height: var(--ctl); padding: 4px 10px; border: 1px solid var(--line2); background: #fff; border-radius: var(--radius-sm); cursor: pointer; }
.pf-rooms button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pf-foot { align-items: center; }
.pf-foot .grow { flex: 1; }
.center { text-align: center; margin: 12px 0; }
@media (max-width: 760px) { .pf-range input { width: 96px; } }
/* ---------- CRM: долги, WhatsApp, звонки ---------- */
.debt-box { border-color: #F2C3BD; background: #FFF8F7; }
.debt-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.debt-nums > div { display: grid; gap: 2px; }
.debt-nums b { font-size: 16px; }
.wa-msgs { max-height: 320px; overflow-y: auto; background: #EFEAE2; border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.wa-m { max-width: 85%; padding: 6px 10px; border-radius: 8px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.08); white-space: pre-wrap; word-break: break-word; }
.wa-m.out { align-self: flex-end; background: #D9FDD3; }
.wa-m.in { align-self: flex-start; }
.wa-m.failed { background: #FDE2DF; }
.wa-meta { font-size: 12px; color: var(--muted); text-align: right; margin-top: 2px; }
.wa-tag { font-size: 12px; color: #7A5B00; }
audio.rec { display: block; height: 32px; max-width: 100%; margin-top: 4px; }
.timeline li.ev-missed b { color: #B42318; }
.live-pop { position: fixed; right: 16px; bottom: 16px; z-index: 80; width: min(360px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(21,36,47,.22); padding: 12px 14px; }
.live-pop.debt { border-left-color: #C0392B; }
.live-pop h4 { margin: 0 0 4px; }
.live-pop .x { position: absolute; top: 6px; right: 8px; }
@media (max-width: 760px) { .debt-nums { grid-template-columns: 1fr 1fr; } .live-pop { bottom: 72px; } }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 14px 0; display: flex; justify-content: flex-end; }
@media (max-width: 760px) { .sticky-save { bottom: 60px; } }

/* брендбук: логотип в узком меню (планшет) — только знак */
.logo-full .logo-mark-wrap { display: none; }
@media (max-width: 1100px) { .logo-full > img, .logo-full small { display: none; } .logo-full .logo-mark-wrap { display: block; } .logo-full { padding: 2px 0 16px; align-items: center; } }
.logo-full .logo-mark { width: 36px; height: 36px; }
.debt-nums.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .debt-nums.four { grid-template-columns: 1fr 1fr; } }
/* ---------- витрина для риэлторов ---------- */
.pub { min-height: 100vh; background: var(--bg); }
.pub-head { background: var(--brand); color: var(--brand-line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; }
.pub-head img { height: 40px; width: auto; }
.pub-right { font-size: 14px; }
.pub-right b { color: #fff; }
.pub-body { padding: 18px 24px; max-width: 1400px; margin: 0 auto; }
.pub-legend { display: flex; gap: 12px; margin: 6px 0 12px; font-size: 13px; }
.pl::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pl.free::before { background: #DCFAE6; border: 1px solid #75C69A; } .pl.reserved::before { background: #FEF0C7; border: 1px solid #E9B949; } .pl.sold::before { background: #E6E9ED; border: 1px solid #B9C1CA; }
.pub-chess { overflow-x: auto; padding-bottom: 8px; }
.pub-floor { display: flex; gap: 6px; margin-bottom: 6px; align-items: stretch; }
.pub-fl { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--muted); }
.pub-cell { flex: 0 0 104px; text-align: left; font: inherit; font-size: 12px; border-radius: 6px; padding: 6px 8px; display: grid; grid-template-columns: 1fr auto; gap: 0 4px; border: 1px solid; cursor: pointer; }
.pub-cell b { font-size: 14px; } .pub-cell .r { color: var(--muted); } .pub-cell span:not(.r) { grid-column: 1 / -1; } .pub-cell .p { font-weight: 600; }
.pub-cell.free { background: #F1FBF4; border-color: #9FD8B5; } .pub-cell.free:hover { border-color: var(--brand); }
.pub-cell.reserved { background: #FFF8E6; border-color: #F0CF7E; cursor: default; color: #7A5B00; }
.pub-cell.sold { background: #EEF0F3; border-color: #D3D8DE; cursor: default; color: #7C8592; }
.pub-cell.dim { opacity: .3; }
@media (max-width: 760px) { .pub-body { padding: 12px; } .pub-head { padding: 10px 12px; } .pub-head img { height: 30px; } .pub-cell { flex-basis: 86px; } }

/* ---------- конструктор шаблона договора ---------- */
.tb-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.tb-name { font: 600 16px var(--font-brand); min-width: 240px; flex: 0 1 380px; }
.tb-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.tb-main { min-width: 0; overflow-x: auto; }
.tb-tools { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 10px; }
.tb-tools button { min-width: 32px; height: 30px; border: 1px solid transparent; background: none; border-radius: 4px; cursor: pointer; font-size: 14px; color: var(--text); padding: 0 6px; }
.tb-tools button:hover { background: var(--accent-weak); border-color: var(--line); }
.tb-tools select { height: 30px; width: auto; }
.tb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.tb-paper { width: 210mm; max-width: none; min-height: 297mm; margin: 0 auto 24px; background: #fff; color: #000; box-shadow: 0 1px 4px rgba(21, 36, 47, .18); box-sizing: border-box; position: relative; }
.tb-paper.preview { margin-top: 10px; }
.tb-doc { outline: none; min-height: 120mm; white-space: pre-wrap; word-wrap: break-word; tab-size: 8; }
.tb-doc .tf { background: #E8EEF4; border: 1px solid #B8C6D3; border-radius: 4px; padding: 0 4px; color: #1D3B55; font: .84em var(--font-ui, Inter, sans-serif); white-space: nowrap; cursor: default; user-select: all; }
.tb-doc .tif { border-left: 3px solid #D9A400; background: #FFFBEA; padding: 2px 8px 4px; margin: 6px 0; }
.tb-doc .tif::before { content: attr(data-label); display: block; font: 600 11px Inter, sans-serif; color: #8A6A00; white-space: normal; }
.tb-doc .tpb { border-top: 1px dashed #8A93A3; color: #8A93A3; font: 11px Inter, sans-serif; text-align: center; margin: 8px 0; user-select: none; }
.tb-doc table.tt td { min-width: 20px; }
.tb-doc tr[data-repeat] td { background: #EEF6FF; }
.tb-doc tr[data-repeat] td:first-child::before { content: '↻ '; color: #2B5373; font: 600 11px Inter, sans-serif; }
.tb-doc tr.thead td { background: #F4F6F8; }
.tb-paper.preview tr.thead td { background: none; }
.tb-head { cursor: pointer; } .tb-paper.preview .tb-head { cursor: default; }
.tb-head-empty { border: 1px dashed var(--line); color: var(--muted); font: 12px Inter, sans-serif; text-align: center; padding: 6px; margin-bottom: 4mm; }
.tb-foot { margin-top: 8mm; font-size: 9pt; color: #404040; cursor: pointer; border-top: 1px dashed #E3E7EC; padding-top: 2mm; white-space: pre-line; }
.tb-foot-pg { text-align: right; }
.tb-side { position: sticky; top: 8px; max-height: calc(100vh - 24px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.tb-tabs { margin: 0 0 8px; }
.tb-search { width: 100%; margin-bottom: 6px; }
.tb-group { margin-bottom: 10px; }
.tb-group-h { font: 600 11px var(--font-brand); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 6px 0 4px; }
.tb-field { display: block; width: 100%; text-align: left; padding: 6px 8px; margin: 0 0 3px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.tb-field:hover { border-color: var(--accent); background: var(--accent-weak); }
.tb-ctx { border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 8px; margin-bottom: 10px; background: #F7FAFC; }
.tb-ctx-if { border-color: #D9A400; background: #FFFBEA; }
.tb-ctx-h { font: 600 13px var(--font-brand); margin-bottom: 6px; }
.tb-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 6px; }
.tb .notice { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 10px; }
.chip-on { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-weak); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
@media (max-width: 1100px) { .tb-body { grid-template-columns: 1fr; } .tb-side { position: static; max-height: none; } }
@media (max-width: 860px) { .tb-paper { transform-origin: top left; } }
.pub-cell.hidden { background: transparent; border: 1px dashed #E3E7EC; cursor: default; min-height: 54px; }
.chip-t { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12px; cursor: pointer; color: var(--muted); }
.chip-t.on { background: var(--ok-bg); border-color: #9FD8B5; color: var(--ok); }
.link-objs { display: grid; gap: 6px; } .link-obj .chips { margin: 4px 0 2px 26px; }
.link-url { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; } .link-url code { background: var(--bg); padding: 6px 8px; border-radius: 6px; word-break: break-all; flex: 1 1 300px; font-size: 12px; }
.tb-tools button svg { vertical-align: middle; }

/* CRM: переключатель Продажи / Долги / Звонки стоит на месте при любой вкладке */
.crm-head-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.crm-head-left h1 { margin: 0; }
.pub-cell.mine { background: #E8F1FB; border-color: #6FA3D8; color: #1D4F80; cursor: pointer; }
.pl.mine::before { background: #E8F1FB; border: 1px solid #6FA3D8; }
.pub-gate { max-width: 640px; margin-bottom: 14px; } .pub-gate input { max-width: 240px; }
.pub-cab { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pub-head .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }

/* ===================== 1.7 — визуальная доработка (по аудиту дизайнеров) ===================== */
:root {
  --brand-2: #1F3342; --bg: #F5F7F9; --surface-1: #FAFBFC; --surface-2: #EEF1F4;
  --text-2: #3C4A57; --text-3: #5B6676; --muted: #5B6676;
  --line: #E4E8EC; --line-soft: #EEF1F4; --line-strong: #D3D9DF;
  --accent-weak: #E9EFF4; --focus: 0 0 0 3px rgba(43, 83, 115, .28);
  --ok-bg: #E3F6EA; --warn-bg: #FEF3D7; --err-bg: #FDECEA;
  --radius: 12px; --radius-sm: 8px;
  --shadow-xs: 0 1px 1px rgba(21, 36, 47, .04);
  --shadow: 0 1px 2px rgba(21, 36, 47, .05), 0 1px 3px rgba(21, 36, 47, .03);
  --shadow-lg: 0 12px 32px rgba(21, 36, 47, .14);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.side :focus-visible, .bottom-nav :focus-visible { outline-color: #fff; }
input::placeholder, textarea::placeholder { font-style: normal; color: #8A93A1; }
input, select, textarea { border-color: var(--line-strong); }
input:hover, select:hover, textarea:hover { border-color: #B9C2CC; }

/* заголовки */
h1 { font-size: 24px; letter-spacing: -.4px; }
.page-title, .page-head { margin-bottom: 18px; }
.page-title .sub { font-family: Inter, sans-serif; font-size: 13.5px; }
.card p, .subtitle, .field-hint { max-width: 90ch; }

/* меню */
.side-nav a { font-size: 14px; color: #C5CDD3; }
.side-nav a:hover { background: rgba(255, 255, 255, .05); }
.side-nav a.on { background: rgba(255, 255, 255, .08); box-shadow: inset 3px 0 0 var(--brand-line); color: #fff; }
@media (min-width: 761px) {
  .topbar { background: rgba(255, 255, 255, .92); min-height: 56px; }
  .search input { background: var(--surface-2); border-color: transparent; min-height: 38px; }
  .search input:focus { background: #fff; border-color: var(--accent); }
  .search .ico { top: 10px; }
}

/* кнопки */
.btn { border-color: var(--line-strong); box-shadow: var(--shadow-xs); font-weight: 500; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { border-color: #B9C2CC; }
.btn-sm { font-family: Inter, sans-serif; font-size: 13px; }
.btn-primary { font-weight: 600; box-shadow: 0 1px 2px rgba(21, 36, 47, .2), inset 0 1px 0 rgba(255, 255, 255, .06); }
.btn-primary:hover { border-color: var(--brand-2); }
.btn-primary:disabled { background: var(--surface-2); border-color: var(--line); color: var(--text-3); opacity: 1; box-shadow: none; }
.btn-ghost, .btn-quiet { box-shadow: none; }
.tbl td .btn:not(.btn-primary):not(.btn-danger):not(.btn-danger-solid) { box-shadow: none; }

/* вкладки: на компьютере — сегменты на сером фоне, активная — белая */
@media (min-width: 761px) {
  .tabs:not(.small-tabs):not(.tb-tabs) { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; gap: 2px; margin-bottom: 14px; }
  .page > .tabs:not(.small-tabs), .page-wide > .tabs:not(.small-tabs) { display: flex; width: fit-content; max-width: 100%; }
  .tabs:not(.small-tabs):not(.tb-tabs) a { border-color: transparent; background: transparent; color: var(--text-2); font-weight: 500; border-radius: 8px; min-height: 32px; }
  .tabs:not(.small-tabs):not(.tb-tabs) a:hover { background: rgba(255, 255, 255, .65); border-color: transparent; }
  .tabs:not(.small-tabs):not(.tb-tabs) a.on { background: #fff; color: var(--text); border-color: var(--line); box-shadow: var(--shadow-xs); font-weight: 600; }
}
@media (max-width: 760px) { .tabs a.on { background: var(--brand-tint); color: var(--brand); border-color: var(--brand); } }
.tabs.small-tabs { gap: 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs.small-tabs a { border: 0; border-radius: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs.small-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); background: none; box-shadow: none; }
.tabs button { font: inherit; font-weight: 500; padding: 4px 12px; min-height: 30px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.tb-tabs { display: flex; background: var(--surface-2); padding: 3px; border-radius: 10px; gap: 2px; }
.tb-tabs button { flex: 1; }
.tabs button.on { background: #fff; border-color: var(--line); color: var(--text); box-shadow: var(--shadow-xs); font-weight: 600; }

/* переключатели: дорожка и белая активная кнопка (тёмной остаётся только главная кнопка) */
.seg { border: 0; background: var(--surface-2); padding: 3px; border-radius: 10px; gap: 2px; }
.seg button { background: transparent; border-radius: 8px; min-height: 32px; color: var(--text-2); font-weight: 500; }
.seg button:hover { background: rgba(255, 255, 255, .65); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(21, 36, 47, .1), 0 0 0 1px var(--line); font-weight: 500; }

/* карточки и показатели */
.card, .mg, .stat, .tbl-wrap { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }
.card { padding: 20px 22px; }
.card h3 { font-size: 16px; }
.mg { padding: 18px 20px; }
.mg.cash { border-left: 1px solid var(--line); }
.mg-title i { border-radius: 50%; }
.mg-main { font-size: 28px; font-weight: 600; letter-spacing: -.6px; line-height: 1.15; margin: 4px 0; }
.stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { padding: 14px 16px; }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -.5px; }
.stat-label { font-size: 12.5px; color: var(--text-2); }
.stats-cash { display: flex; }
.stats-cash .stat { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.stats-cash .stat-value { margin: 0; }
.pay-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: -6px 0 18px; }
.pay-bar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }

/* таблицы */
.tbl th, .tbl-wrap .tbl thead th { background: var(--surface-1); font-size: 12px; font-weight: 500; color: var(--text-3); padding: 10px 12px; }
.tbl td { padding: 11px 12px; border-bottom-color: var(--line-soft); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.click:hover td { background: #F4F7FA; }
.tbl tfoot td { background: var(--surface-1); }
tr.tot td { border-top: 2px solid var(--brand-line); background: #F7F8FA; }
.badge { font-family: Inter, sans-serif; font-weight: 500; font-size: 12px; padding: 2px 9px; }
.empty { padding: 40px 16px; }
.empty b { font-family: var(--font-brand); font-weight: 600; font-size: 15px; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }

/* фильтры: слева, подписи «с/по» рядом с датами */
.toolbar > .filters:first-child { margin-left: 0; flex: 1 1 auto; }
.filters > label.small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.filters input[type=date] { width: 150px; }
.filters input.w180 { width: 240px; }

/* статусы помещений в гамме бренда (контраст текста ≥ 5,8:1) */
.st-free { background: #F1FAF5; border-color: #7CC49A; color: var(--text); }
.badge.st-free { background: #DCFAE6; border-color: #A6E3BD; color: #085D3A; }
.st-reserved { background: #FFF3D1; border-color: #E0A82E; color: #7A3A06; }
.st-sold { background: #E4EAF0; border-color: #9AA8B4; color: #22384A; }
.st-sold.debt { background: #FDECEA; border-color: #E0857A; color: #8F1D14; }
.st-gifted, .st-transferred { background: #EFEBFB; border-color: #A996E4; color: #43248F; }
.st-offset { background: #F5ECE1; border-color: #C99E6E; color: #643F1E; }
.st-withdrawn, .st-blocked { background: #F2F4F7; border-color: #C3CAD3; color: #475467; }
.st-terminated { background: #FDECEA; color: #8F1D14; }

/* шахматка */
.st-free .cell-b { font-weight: 700; font-size: 13px; color: var(--text); }
.cell { transition: box-shadow .12s, transform .12s; }
.cell:hover { box-shadow: 0 0 0 2px var(--accent); }
.cell.marked:hover { box-shadow: inset 4px 0 0 var(--mk), 0 0 0 2px var(--accent); }
.cell.marked.sel { box-shadow: inset 4px 0 0 var(--mk), 0 0 0 3px var(--brand); }
.cell.dim, .pub-cell.dim { opacity: .35; }
.floor { color: var(--brand-2); font-family: var(--font-brand); }
@keyframes hit { 50% { box-shadow: 0 0 0 6px rgba(43, 83, 115, .3); } }
@media (max-width: 760px) {
  .chess-head .row-gap { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .chess-head .btn { white-space: normal; font-size: 13px; }
}

/* CRM */
.board .col { background: #E9EDF1; }
@media (min-width: 761px) { .board .col { min-height: calc(100vh - 260px); } }
.col-h b { font-family: var(--font-brand); }
.col-h .muted { background: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; }
.lead-card { padding: 10px 12px; box-shadow: var(--shadow); }
.lc-top b { font-size: 15px; }
.lc-foot { border-top: 1px solid var(--line-soft); padding-top: 4px; margin-top: 6px; }

/* касса */
.cash-sum { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); padding: 12px 16px; }

/* конструктор */
.tb-name { flex: 1 1 420px; }
.tb-field { border-color: transparent; background: none; }
.tb-field:hover { border-color: var(--accent); }

/* витрина для риэлторов — лицо компании */
.pub-head { padding: 16px 32px; box-shadow: 0 1px 0 rgba(176, 187, 195, .2); }
.pub-body { padding: 26px 32px; }
.pub-cell { flex: 1 0 104px; max-width: 160px; min-height: 64px; padding: 8px 10px; border-radius: 8px; transition: box-shadow .12s, border-color .12s; }
.pub-cell b { font: 600 15px var(--font-brand); }
.pub-cell .p { font-size: 14px; font-weight: 700; color: var(--brand); }
.pub-cell.free { background: #F1FAF5; border-color: #7CC49A; }
.pub-cell.free:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(21, 36, 47, .12); }
.pub-cell.sold { background: #E4EAF0; border-color: #C3CBD3; color: #4A5A68; }
.pub-cell.sold .p, .pub-cell.reserved .p, .pub-cell.mine .p { color: inherit; font-weight: 600; font-size: 12px; }
.pub-cell.reserved { background: #FFF3D1; border-color: #E0A82E; color: #7A3A06; }
.pub-cell.mine { background: #DCE8F3; border-color: #2B5373; color: #16324A; }
.pl.free::before { background: #F1FAF5; border-color: #7CC49A; } .pl.reserved::before { background: #FFF3D1; border-color: #E0A82E; }
.pl.sold::before { background: #E4EAF0; border-color: #9AA8B4; } .pl.mine::before { background: #DCE8F3; border-color: #2B5373; }
.pub-gate { border-left: 3px solid var(--accent); }
@media (max-width: 760px) {
  .pub-head { padding: 10px 12px; } .pub-body { padding: 12px; }
  .pub-floor { gap: 3px; margin-bottom: 3px; } .pub-fl { flex-basis: 24px; }
  .pub-cell { flex: 1 1 0; min-width: 0; max-width: none; padding: 4px 3px; min-height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .pub-cell span:not(.p), .pub-cell .r { display: none; }
  .pub-cell .p { font-size: 10.5px; }
  .pub-right { font-size: 12px; text-align: right; }
}

/* телефон: главная, списки, фильтры */
@media (max-width: 760px) {
  .mg { padding: 14px 16px; } .mg-main { font-size: 24px; } .money-groups { gap: 8px; }
  .links-card .tbl td:nth-child(4) { display: none; }
  .feed li { display: grid; grid-template-columns: 44px 1fr auto; gap: 2px 8px; } .feed .t { min-width: 0; }
  .toolbar > .filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 8px; }
  .toolbar > .filters > * { width: 100%; min-width: 0; }
  .toolbar > .filters > input:not([type=date]), .toolbar > .filters > .seg { grid-column: 1 / -1; }
  .filters > label.small input { flex: 1; width: auto; }
  .seg button { flex: 1; }
  .cash-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .tbl.cards tr { padding: 10px 12px; }
  .tbl.cards tfoot tr { background: #F7F8FA; }
  .tbl.cards tfoot td { background: none; border: 0; padding: 2px 0; }
  .mobile-hide { display: none !important; }
}
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; } .stat-value { font-size: 19px; }
  .task-row:nth-of-type(n+5) { display: none; }
  .pub-cell b { font-size: 12.5px; }
  .pub-cell .p { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: clip; max-width: 100%; }
  .pub-cell.sold .p { display: none; }
}
@media (max-width: 760px) { .pub-cell .p { font-size: 9px; letter-spacing: -.2px; } }

/* ---------- форма покупателя / контрагента: вид и обязательные поля ---------- */
.client-form { display: flex; flex-direction: column; gap: 10px; }
.kind-sel { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; gap: 2px; align-self: flex-start; flex-wrap: wrap; }
.kind-sel button { border: 0; background: transparent; border-radius: 8px; padding: 6px 14px; min-height: 34px; font: 500 14px var(--font-brand); color: var(--text-2); cursor: pointer; }
.kind-sel button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(21, 36, 47, .1), 0 0 0 1px var(--line); font-weight: 600; }
.fx-h { font: 600 12px var(--font-brand); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 8px 0 2px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.fx-h:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.fx { min-width: 0; }
.fx .field { margin: 0; }
.fx-err input, .fx-err select, .fx-err textarea { border-color: var(--err); background: #FFF8F7; }
.fx-more { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 6px 10px; }
.fx-more summary { cursor: pointer; color: var(--accent); font-size: 13.5px; }
.fx-more[open] summary { margin-bottom: 8px; }
@media (max-width: 760px) { .kind-sel { width: 100%; } .kind-sel button { flex: 1; } }

input.invalid, select.invalid, textarea.invalid { border-color: var(--err); background: #FFF8F7; }
.transfer-card { border-left: 3px solid #A996E4; }

/* заголовок страницы стоит на одном месте на всех страницах, как бы он ни был свёрстан */
.page > h1:first-child, .page > .row-between:first-child { min-height: 40px; margin: 0 0 18px; display: flex; align-items: center; }
.page > .row-between:first-child h1 { margin: 0; }
.page > .link.back:first-child { display: inline-block; margin-bottom: 8px; }

/* ---------- касса: рабочее место кассира ---------- */
kbd { display: inline-block; font: 600 11px/1 Inter, sans-serif; padding: 3px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .55; margin-left: 6px; vertical-align: 1px; }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.desk-main { padding: 18px 20px; min-height: 520px; }
.payer-search { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line-strong, #D3D9DF); border-radius: 12px; padding: 0 14px; background: #fff; transition: border-color .15s; }
.payer-search:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.payer-search svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.payer-search input { border: 0 !important; box-shadow: none !important; outline: none; font-size: 18px; min-height: 54px; flex: 1; background: transparent; padding: 0; }
.payer-cap { margin: 12px 2px 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.payer-empty { padding: 40px 12px; text-align: center; color: var(--text-2, #3C4A57); }
.payer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.payer-list li { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1fr) 130px; gap: 12px; align-items: center; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.payer-list li.on { border-color: var(--accent); background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent); }
.pl-who, .pl-what { display: flex; flex-direction: column; min-width: 0; }
.pl-what span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-who b { line-height: 1.3; }
.pl-over { color: var(--err); font-weight: 600; }
.pl-debt { display: flex; flex-direction: column; align-items: flex-end; }
.pl-debt b { font-size: 15px; }
.pay-panel .back { margin-bottom: 8px; }
.pp-head h2 { font-size: 22px; margin: 0 0 2px; }
.pp-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 8px; }
.pp-nums > div { background: var(--surface-1, #FAFBFC); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.pp-nums span { font-size: 12.5px; color: var(--muted); }
.pp-nums b { font-size: 17px; }
.pp-nums small { color: var(--err); font-weight: 600; }
.pp-nums .over { background: var(--err-bg); border-color: #F4B4AC; }
.pp-nums .over b { color: var(--err); }
.pp-bar { position: relative; height: 8px; background: var(--surface-2, #EEF1F4); border-radius: 99px; margin: 4px 0 4px; }
.pp-bar i { position: absolute; inset: 0 auto 0 0; background: var(--ok); border-radius: 99px; }
.pp-bar span { position: absolute; right: 0; top: 10px; font-size: 12px; color: var(--muted); }
.pp-sched { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 4px; font-size: 13px; }
.pp-sched span { border: 1px dashed var(--line-strong, #D3D9DF); border-radius: 8px; padding: 4px 9px; }
.pp-sched span.over { border-color: var(--err); color: var(--err); background: var(--err-bg); border-style: solid; }
.pp-sched em { font-style: normal; color: var(--muted); }
.pp-form { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.big-amount { display: flex; flex-direction: column; gap: 4px; }
.big-amount span { font-size: 13px; color: var(--muted); font-family: var(--font-brand); }
.big-amount input { font-size: 30px; font-weight: 700; min-height: 62px; padding: 6px 14px; letter-spacing: -.3px; max-width: 420px; }
.words { min-height: 18px; font-size: 13px; color: var(--text-2, #3C4A57); }
.pp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pp-date { width: auto; }
.pp-go { align-self: flex-start; min-height: 48px; font-size: 16px; padding: 0 22px; }
.pay-ok { text-align: center; padding: 40px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ok-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); display: grid; place-items: center; }
.ok-mark svg { width: 34px; height: 34px; fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pay-ok .confirm-sum { font-size: 34px; }
.desk-today { padding: 16px 18px; position: sticky; top: 76px; }
.desk-today h3 { margin: 0; }
.today-sum { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 12px 0 8px; }
.today-sum dt { color: var(--muted); } .today-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.today-sum dt:nth-last-of-type(1), .today-sum dd:last-of-type { border-top: 1px solid var(--line); padding-top: 6px; color: var(--text); font-size: 15px; }
.today-list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.today-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-soft, #EEF1F4); }
.today-list li.dim { opacity: .55; }
.tl-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2, #3C4A57); }
.day-rep { padding: 18px 20px; }
.day-title { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 15px; }
.day-tbl .day-bal td { background: var(--surface-1, #FAFBFC); }
.day-tbl tfoot td { font-weight: 500; }
.day-sign { display: flex; justify-content: space-between; margin-top: 36px; gap: 20px; flex-wrap: wrap; }
@media (max-width: 1100px) { .desk-grid { grid-template-columns: minmax(0, 1fr); } .desk-today { position: static; } }
@media (max-width: 760px) {
  .desk-main { padding: 14px; min-height: 0; }
  .payer-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .payer-list .pl-what, .payer-list .pl-due { grid-column: 1 / -1; }
  .payer-list .pl-debt { grid-row: 1; grid-column: 2; }
  .pp-nums { grid-template-columns: 1fr 1fr; }
  .big-amount input { max-width: none; font-size: 26px; }
  .pp-go { align-self: stretch; }
  kbd { display: none; }
}
@media print {
  .side, .topbar, .tabs, .no-print, .bottom-nav, .page-head { display: none !important; }
  .shell { display: block; } .main { padding: 0; } .day-rep { border: 0; box-shadow: none; }
}
.page-title h1, .page-head h1, .page > h1:first-child, .page > .row-between:first-child h1 { min-height: 40px; display: flex; align-items: center; margin-top: 0; }
.page-title, .page-head { align-items: flex-start; }
.borrow-box { border: 1px solid var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.desk-debt-note label { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.debt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.debt-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.debt-sum { font-size: 22px; font-weight: 700; color: var(--err); }

/* ---------- терминал оплаты (сенсорный киоск) ---------- */
.kio { min-height: 100vh; background: #F3F5F7; display: flex; flex-direction: column; font-size: 18px; user-select: none; -webkit-user-select: none; }
.kio-head { background: var(--brand); color: #fff; display: flex; align-items: center; gap: 16px; padding: 14px 28px; }
.kio-head img { height: 34px; }
.kio-name { margin-left: auto; color: var(--brand-line); font-size: 15px; }
.kio-home { margin-left: auto; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 10px; padding: 10px 18px; font: inherit; font-size: 16px; }
.kio-home + .kio-name { margin-left: 16px; }
.kio-body { flex: 1; display: flex; padding: 28px; }
.kio-center { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; max-width: 820px; }
.kio-col { margin: 0 auto; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 760px; }
.kio-big { font-family: var(--font-brand); font-size: 40px; font-weight: 600; color: var(--brand); }
.kio-title { font-family: var(--font-brand); font-size: 30px; font-weight: 600; color: var(--brand); }
.kio-sub { color: var(--muted); font-size: 18px; margin: 0; }
.kio-qr { display: flex; align-items: center; gap: 24px; background: #fff; border: 2px dashed var(--accent); border-radius: 20px; padding: 26px 34px; font-size: 22px; text-align: left; }
.kio-qr svg { width: 84px; height: 84px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.kio-or { color: var(--muted); }
.kio-btns { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.kio-btn { min-height: 72px; min-width: 260px; padding: 0 30px; border-radius: 16px; border: 2px solid var(--brand); background: #fff; color: var(--brand); font: 600 22px var(--font-brand); cursor: pointer; }
.kio-btn.primary { background: var(--brand); color: #fff; }
.kio-btn.ghost { border-color: #C9D0D8; color: var(--text-2, #3C4A57); }
.kio-btn:disabled { opacity: .5; }
.kio-btn:active, .kio-pad button:active, .kio-keys button:active, .kio-item:active { transform: scale(.98); }
.kio-err { background: var(--err-bg); color: var(--err); border-radius: 12px; padding: 12px 18px; font-weight: 600; }
.kio-display { background: #fff; border: 2px solid #C9D0D8; border-radius: 14px; font-size: 40px; font-weight: 700; letter-spacing: 6px; text-align: center; padding: 14px; min-height: 76px; }
.kio-padwrap { max-width: 480px; }
.kio-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kio-pad button { min-height: 78px; font-size: 32px; font-weight: 600; border-radius: 14px; border: 1px solid #C9D0D8; background: #fff; color: var(--brand); }
.kio-keys { display: flex; flex-direction: column; gap: 8px; }
.kio-keys > div { display: flex; gap: 6px; justify-content: center; }
.kio-keys button { flex: 1; max-width: 62px; min-height: 64px; font-size: 24px; font-weight: 600; border-radius: 10px; border: 1px solid #C9D0D8; background: #fff; color: var(--brand); }
.kio-keys button.wide { max-width: 360px; flex: 6; font-size: 18px; }
.kio-item { text-align: left; min-height: 72px; padding: 0 22px; border-radius: 14px; border: 1px solid #C9D0D8; background: #fff; font: 500 21px Inter, sans-serif; color: var(--text); }
.kio-pay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; width: 100%; align-items: start; }
.kio-who, .kio-insert { background: #fff; border-radius: 20px; padding: 26px 28px; box-shadow: 0 1px 3px rgba(21,36,47,.08); display: flex; flex-direction: column; gap: 10px; }
.kio-nums { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.kio-nums > div { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 10px; }
.kio-nums span { color: var(--muted); } .kio-nums b { font-size: 24px; }
.kio-nums .over b { color: var(--err); }
.kio-insert { align-items: center; text-align: center; }
.kio-sum { font-size: 64px; font-weight: 700; color: var(--brand); letter-spacing: -1px; }
.kio-words { color: var(--text-2, #3C4A57); min-height: 24px; }
.kio-bills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.kio-bills span { background: var(--ok-bg); color: var(--ok); border-radius: 8px; padding: 4px 10px; font-size: 15px; font-weight: 600; }
.kio-sim { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; border: 1px dashed var(--warn); border-radius: 12px; padding: 10px; font-size: 14px; color: var(--warn); }
.kio-sim button { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--warn); background: var(--warn-bg); font: 600 15px Inter, sans-serif; color: #7A3A06; }
.kio-ok { width: 110px; height: 110px; border-radius: 50%; background: var(--ok-bg); display: grid; place-items: center; }
.kio-ok svg { width: 60px; height: 60px; fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.kio-receipt { display: none; }
@media (max-width: 900px) { .kio-pay { grid-template-columns: 1fr; } .kio-big { font-size: 30px; } .kio-sum { font-size: 48px; } }
@media print {
  .kio > *:not(.kio-body), .kio-center > *:not(.kio-receipt) { display: none !important; }
  .kio { background: #fff; min-height: 0; } .kio-body { padding: 0; }
  .kio-receipt { display: block !important; width: 72mm; font: 12px/1.5 Inter, sans-serif; text-align: left; color: #000; }
}
@media (max-height: 860px) {
  .kio-body { padding: 18px 28px; }
  .kio-col { gap: 10px; }
  .kio-pad button { min-height: 58px; font-size: 26px; }
  .kio-display { min-height: 58px; font-size: 30px; padding: 8px; }
  .kio-keys button { min-height: 52px; }
  .kio-btn { min-height: 60px; }
  .kio-title { font-size: 26px; }
}
@media (orientation: portrait) and (min-width: 700px) {
  .kio { font-size: 22px; }
  .kio-pay { grid-template-columns: 1fr; max-width: 900px; margin: 0 auto; }
  .kio-body { padding-top: 60px; }
  .kio-sum { font-size: 84px; }
  .kio-pad button { min-height: 110px; font-size: 40px; }
  .kio-padwrap { max-width: 640px; }
  .kio-keys button { min-height: 84px; max-width: 80px; }
  .kio-btn { min-height: 90px; font-size: 26px; }
}
.kio-pay { align-content: start; }
.kio-padwrap .kio-btns .kio-btn, .kio-col > .kio-btns .kio-btn { min-width: 0; flex: 1; }
/* настройки терминала */
.ks { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; min-height: 420px; }
.ks-nav { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); padding-right: 10px; }
.ks-nav button { text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; font: inherit; cursor: pointer; color: var(--text-2, #3C4A57); }
.ks-nav button.on { background: var(--accent-weak); color: var(--brand); font-weight: 600; }
.ks-body { display: flex; flex-direction: column; gap: 10px; }
.ks-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ks-card { text-align: left; border: 1px solid var(--line-strong, #D3D9DF); border-radius: 10px; padding: 10px 12px; background: #fff; display: flex; flex-direction: column; gap: 4px; cursor: pointer; font: inherit; }
.ks-card span { font-size: 12.5px; color: var(--muted); }
.ks-card.on { border-color: var(--accent); background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--accent); }
.ks-bills { display: flex; flex-wrap: wrap; gap: 6px; }
.ks-bills button { border: 1px solid var(--line-strong, #D3D9DF); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; cursor: pointer; }
.ks-bills button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chk-row { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; cursor: pointer; }
.chk-row input { margin-top: 3px; }
.input-suffix { display: flex; align-items: center; gap: 6px; }
.input-suffix input { flex: 1; }
.input-suffix span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.cas-bar { position: relative; width: 100%; height: 22px; background: var(--surface-2, #EEF1F4); border-radius: 6px; overflow: hidden; font-size: 12px; }
.cas-bar i { position: absolute; inset: 0 auto 0 0; background: #CFE8DA; }
.cas-bar.warn i { background: #F6C7C0; }
.cas-bar span { position: relative; padding: 0 8px; line-height: 22px; }
@media (max-width: 760px) { .ks { grid-template-columns: 1fr; } .ks-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; } .ks-cards { grid-template-columns: 1fr; } }
.kio-nums .cap b { color: var(--accent); }
.kio .small-note { font-size: 15px; }
.kio-cap-done { background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 10px 16px; font-weight: 600; }
.kio-sim button:disabled { opacity: .35; }

/* ---------- админка (2.5) ---------- */
.admin-nav { margin-bottom: 14px; }
.admin-groups { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.admin-groups a { padding: 8px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: var(--font-brand); }
.admin-groups a.on { color: var(--brand); border-bottom-color: var(--brand); }
.admin-groups a:hover { text-decoration: none; color: var(--brand); }
.admin-find { margin-left: auto; max-width: 240px; min-height: 34px; padding: 5px 10px; }
.role-matrix th.role-col { text-align: center; min-width: 110px; vertical-align: bottom; }
.role-matrix th.role-col .link { font-weight: 700; white-space: normal; }
.role-matrix tr.grp td { background: #F4F6F8; padding-top: 8px; }
.role-matrix td.num { text-align: center; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; }
.perm-group legend { font-weight: 700; padding: 0 6px; font-size: 13px; color: var(--muted); }
.perm-group .check { display: flex; padding: 3px 0; }
.audit-ch { margin: 0; padding-left: 16px; font-size: 13px; }
.audit-ch li { margin: 1px 0; word-break: break-word; }
.audit-ch s { color: var(--muted); }
.audit-tbl td { vertical-align: top; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.stat-grid b { font-size: 20px; }
@media (max-width: 720px) {
  .admin-groups { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .admin-groups a { white-space: nowrap; }
  .admin-find { margin-left: 8px; min-width: 160px; }
}
.card.filters { margin-left: 0; align-items: flex-end; margin-bottom: 12px; }
.role-matrix th:first-child, .role-matrix td:first-child { min-width: 280px; }
.role-matrix td { padding-top: 6px; padding-bottom: 6px; }
.perm-group .check input, .check input[type=checkbox] { flex: none; }

/* 2.5.4: подсказка «как это работает» в правом верхнем углу страниц настроек */
.help-box { float: right; width: 320px; margin: 0 0 12px 16px; border: 1px solid #C9D8E6; background: #F4F8FC; border-radius: var(--radius); font-size: 13px; line-height: 1.45; position: relative; z-index: 1; }
.help-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 9px 12px; font: inherit; font-weight: 600; color: #15242F; cursor: pointer; text-align: left; }
.help-head > span:first-child { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #15242F; color: #fff; font-size: 12px; flex: none; }
.help-chev { margin-left: auto; color: #5B6676; }
.help-body { padding: 0 12px 10px; }
.help-body ol, .help-body ul { margin: 4px 0 8px; padding-left: 18px; }
.help-body li { margin: 3px 0; }
.help-body p { margin: 6px 0; }
.help-body code { font-size: 12px; background: #fff; border: 1px solid #DDE5EE; border-radius: 4px; padding: 0 3px; word-break: break-all; }
@media (max-width: 900px) { .help-box { float: none; width: auto; margin: 0 0 12px; } }
/* 2.5.5: подсказка во всю ширину (шахматка, конструктор), «первые шаги», следующий шаг */
.help-box.help-inline { float: none; width: auto; margin: 0 0 12px; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: st; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line, #E3E8EE); }
.steps li:first-child { border-top: 0; }
.steps .st-n { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #15242F; font-weight: 600; font-size: 13px; }
.steps li.done .st-n { background: #2E7D32; border-color: #2E7D32; color: #fff; }
.steps li.done .st-t { color: var(--muted); text-decoration: line-through; }
.steps .st-body { flex: 1; min-width: 0; }
.steps .st-t { font-weight: 600; }
.next-step { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.price-steps { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.news-preview { white-space: pre-wrap; font: inherit; font-size: 13px; background: #F4F8FC; border: 1px solid #DDE5EE; border-radius: var(--radius); padding: 10px 12px; margin: 8px 0 12px; }
.danger-zone { border-top: 1px solid var(--line, #E3E8EE); margin-top: 16px; padding-top: 12px; }

/* 2.6.0: центр уведомлений */
.bell { position: relative; flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); cursor: pointer; }
.bell:hover { border-color: var(--accent); }
.bell .ico { width: 20px; height: 20px; }
.bell-n { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.bell.act .bell-n { background: #C0392B; }
.note-center h2 { margin: 0; }
.note-center .chips { margin: 12px 0; }
.note-center .chips button { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.note-center .chips button.on { background: var(--text); color: #fff; border-color: var(--text); }
.note-day { margin-bottom: 12px; }
.note-day-t { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 0 4px; }
.note-item { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 4px; font: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
.note-item:hover { background: rgba(0,0,0,.03); }
.note-item .dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; }
.note-item.unread .dot { background: var(--accent); }
.note-item.unread.p-action .dot, .note-item.unread.p-critical .dot { background: #C0392B; }
.note-item.unread .note-title { font-weight: 700; }
.note-item.done { opacity: .6; }
.note-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.note-title { display: flex; gap: 6px; align-items: baseline; }
.note-count { font-size: 12px; font-weight: 700; color: var(--accent); }
.note-body { font-size: 14px; overflow-wrap: anywhere; }
.note-meta { font-size: 12px; color: var(--muted); }
.note-toasts { position: fixed; right: 16px; top: 64px; z-index: 85; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.note-toast { position: relative; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(21,36,47,.22); }
.note-toast.p-action, .note-toast.p-critical { border-left-color: #C0392B; }
.note-toast .x { position: absolute; right: 6px; top: 4px; }
.note-toast-body { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; border: 0; background: none; padding: 12px 28px 12px 14px; font: inherit; color: inherit; cursor: pointer; }
@media (max-width: 760px) { .note-toasts { top: auto; bottom: 76px; } .bell { width: 36px; height: 36px; } }

/* 2.6.1: push на устройство */
.push-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.push-panel.s-on { background: #F1F8F3; border-color: #CFE7D6; }
.push-panel details summary { cursor: pointer; color: var(--muted); }
.note-offer { position: fixed; right: 16px; top: 64px; z-index: 86; width: min(380px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(21,36,47,.22); padding: 14px 28px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.note-offer .x { position: absolute; right: 6px; top: 4px; }
@media (max-width: 760px) { .note-offer { top: auto; bottom: 76px; } }
.note-center > .row-between { padding-right: 40px; }

/* 2.6.2: настройки уведомлений */
.prefs h4 { margin: 16px 0 6px; }
.pref-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.pref-row input[type=time] { width: auto; min-height: 32px; padding: 2px 6px; }

/* Э1: «Войти как» — полоса режима просмотра; «Требует внимания» */
.viewas-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 24px; background: var(--warn-bg); color: var(--text); border-bottom: 1px solid var(--line); }
.viewas-bar .muted { font-size: 13px; }
.card.attention { border-left: 3px solid var(--warn); }
@media (max-width: 760px) { .viewas-bar { padding: 8px 12px; } }
.nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--err); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }

/* Э3 (проект «а»): меню по группам с заголовками; компактнее, чтобы на 1366×768 всё было видно без прокрутки */
.side-nav.grouped { gap: 0; }
.side-nav.grouped a { min-height: 30px; padding: 5px 10px; }
.side-grp { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.side-grp-h { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 2px 10px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: rgba(197, 205, 211, .6); min-height: 20px; }
.side-grp-h::after { content: '▾'; font-size: 10px; opacity: .7; }
.side-grp.closed .side-grp-h::after { content: '▸'; }
.side-grp-h:hover, .side-grp-h:focus-visible { color: #fff; }
.sheet-grp { padding: 10px 12px 2px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sheet { max-height: 85vh; overflow-y: auto; }
.bottom-nav a.bn-main { color: var(--brand, #15242F); font-weight: 600; }
.bottom-nav a.bn-main .ico { width: 30px; height: 30px; padding: 4px; border-radius: 50%; background: var(--brand, #15242F); color: #fff; }
.bottom-nav a { position: relative; }
.bottom-nav a .nav-badge { position: absolute; top: 4px; left: 55%; margin: 0; }
@media (max-width: 1100px) { .side-grp-h { justify-content: center; font-size: 0; min-height: 8px; padding: 0; border-top: 1px solid rgba(197, 205, 211, .2); margin: 4px 8px 0; } .side-grp-h::after { content: ''; } }

/* Э3: заявки ПТО */
.st { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; background: var(--brand-tint, #eef2f5); color: var(--text); white-space: nowrap; }
.st-draft { background: #eef0f2; color: #4a5560; } .st-wait { background: #fff3d6; color: #7a5200; } .st-pto { background: #e2eefb; color: #164a7a; }
.st-ret { background: #fde4e1; color: #8c1d12; } .st-ok { background: #e2f4e6; color: #1d6b2f; } .st-del { background: #e9e9e9; color: #666; text-decoration: line-through; }
.nav-badge.static { margin-left: 4px; display: inline-block; }
.chain { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 10px 0; }
.chain li { padding: 4px 10px; border-radius: 8px; background: #f2f4f6; font-size: 13px; }
.chain li.done { background: #e2f4e6; } .chain li.now { background: #fff3d6; font-weight: 600; }
.chain li + li::before { content: '→ '; color: var(--muted); }
.req-head { margin: 8px 0; } .req-place { margin: 6px 0; }
.chip { border: 1px solid var(--line, #d5dbe0); background: #fff; border-radius: 12px; padding: 2px 10px; font: inherit; cursor: pointer; }
.chip.on { background: var(--brand, #15242F); color: #fff; border-color: transparent; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.photo-tile { position: relative; aspect-ratio: 1; border: 1px solid var(--line, #d5dbe0); border-radius: 8px; overflow: hidden; background: #f4f6f8; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile.removed { opacity: .5; cursor: default; } .photo-tile.error { border-color: var(--err, #c0392b); }
.photo-state { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .55); color: #fff; padding: 2px 4px; }
.photo-state:empty { display: none; }
.photo-x { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; }
.photo-full { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; }
.req-actions { margin: 14px 0; } .history { padding-left: 18px; } .history li { margin: 4px 0; }
.link-btn { all: unset; cursor: pointer; } .docs { padding-left: 18px; }
.line-card { margin: 8px 0; } .row-gap.wrap { flex-wrap: wrap; }
.w100 { width: 100px; } .w120 { width: 120px; } .w80 { width: 80px; }
.pick-list { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; margin-top: 8px; }
.pick-list button { text-align: left; padding: 10px; border: 0; border-bottom: 1px solid var(--line, #e3e7ea); background: none; font: inherit; cursor: pointer; }
.pick-list button:hover { background: var(--brand-tint, #eef2f5); } .pick-list button:disabled { opacity: .5; cursor: default; }
.tabel-wrap { max-height: 60vh; overflow: auto; } .tabel th, .tabel td { padding: 2px; text-align: center; } .tabel td:first-child input { width: 160px; }
.tabel td.busy { background: #d9d9d9; }
.sign-panel { position: sticky; bottom: 0; background: #fff; padding: 10px 0; border-top: 1px solid var(--line, #e3e7ea); z-index: 5; }
body.task-mode .bottom-nav { display: none; }
body.kb-open .sign-panel { display: none; }
@media (max-width: 760px) { body.task-mode .main { padding-bottom: 16px; } .sign-panel { padding-bottom: calc(10px + env(safe-area-inset-bottom)); } .sign-panel .btn { flex: 1; } }

/* Э3: компактная боковая панель для меню по группам — на 1366×768 всё видно без прокрутки */
@media (min-width: 761px) {
  .side.compact { padding: 10px 10px; }
  .side.compact .logo-full { padding: 2px 8px 6px; }
  .side.compact .logo-full img { width: 140px; }
  .side.compact .side-label { margin: 8px 10px 3px; font-size: 11px; }
  .side.compact select { padding-top: 4px; padding-bottom: 4px; min-height: 32px; }
  .side.compact .side-foot { padding-top: 6px; gap: 0; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 10px; }
  .side.compact .side-foot .who { font-size: 13px; flex-basis: 100%; }
  .side.compact .side-foot .ver { font-size: 11px; }
  .side.compact .side-foot a, .side.compact .side-foot button { min-height: 26px; padding: 2px 0; }
}
@media (min-width: 761px) {
  .side-nav.grouped a { min-height: 28px; padding: 4px 10px; font-size: 13.5px; }
  .side-grp { margin-top: 4px; }
  .side.compact .side-foot .who small { display: inline; margin-left: 6px; }
  .top-objsel select { max-width: 260px; }
}

/* Э4: наряды */
.was { color: #8c1d12; } .accept-tbl input { width: 100%; min-width: 80px; } .accept-tbl td { vertical-align: top; }
.seg { display: inline-flex; gap: 4px; } .seg button { min-width: 36px; min-height: 36px; border: 1px solid var(--line, #d5dbe0); background: #fff; border-radius: 8px; cursor: pointer; font: inherit; }
.seg button.on { background: var(--brand, #15242F); color: #fff; }
@media print { .no-print, .side, .topbar, .bottom-nav, .page-head .btn, .toasts { display: none !important; } .main { padding: 0 !important; } }
/* Э4: ещё компактнее — запас под пункты следующих этапов (критерий 1366×768) */
@media (min-width: 761px) {
  .side-nav.grouped a { min-height: 26px; padding: 3px 10px; }
  .side-grp { margin-top: 2px; } .side-grp-h { min-height: 17px; padding: 1px 10px; }
  .side.compact .side-foot { flex-wrap: nowrap; padding-top: 4px; }
  .side.compact .side-foot .who { flex-basis: auto; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side.compact .side-foot .who small, .side.compact .side-foot .ver { display: none; }
  .side.compact .side-foot .links span { display: none; }
}

/* Э5: договоры подряда */
.contract-lines td { vertical-align: top; }
.contract-lines td input:not(.w100), .contract-lines td select { width: 100%; min-width: 150px; }
.contract-card .stat-grid { margin: 10px 0 16px; }
.nav-badge.static { position: static; display: inline-block; margin-right: 4px; }
@media (max-width: 640px) { .contract-lines thead { display: none; } .contract-lines tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line, #d5dbe0); } .contract-lines td { border: 0; padding: 2px 0; } .contract-lines td:first-child { grid-column: 1 / -1; } }
/* Э7: «резерв под передачу подрядчику» — как «в счёт работ», но светлее и со штриховкой (ждёт утверждения) */
.st-pto_reserve { background: #FBF6F0; border-color: #D9BB98; border-style: dashed; color: #643F1E; }
.cell.st-pto_reserve { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(201,158,110,.18) 6px 12px); }
.badge.st-pto_reserve { background: #F6EEE4; color: #643F1E; }

/* ---------- Э8: кабинет и отчёты ПТО (PtoReports.tsx) ---------- */
.period-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 14px; }
.period-bar .period-label { flex-basis: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: inherit; font-weight: 600; font-size: 14px; min-height: 34px; padding: 5px 12px; border: 1px solid #C9D0D8; border-radius: 999px; background: #fff; color: var(--text); cursor: pointer; }
.chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chips button:focus-visible { box-shadow: var(--focus); outline: none; }
.pay-status { margin-bottom: 10px; }
.month-chart { margin: 0 0 6px; }
.month-chart svg { width: 100%; height: 170px; display: block; }
.month-chart .axis { stroke: var(--line); stroke-width: 1; }
.month-chart .lbl { font-size: 11px; fill: var(--muted); }
.month-chart .legend { margin-left: 10px; color: var(--muted); }
.month-chart .legend span { margin-right: 12px; white-space: nowrap; }
.month-chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.c-acc { fill: var(--accent); background: var(--accent); }
.c-paid { fill: #9DB4C6; background: #9DB4C6; }
/* Г-647: столбики кабинета — по нарядам, авансами, помещением */
.c-ord { fill: #2E7D6B; background: #2E7D6B; }
.c-adv { fill: #C98A2B; background: #C98A2B; }
.c-unit { fill: #7A5BA8; background: #7A5BA8; }
.boss-grid { gap: 0 16px; align-items: start; }
.boss-grid > .card { min-width: 0; }
.delta-up { color: var(--ok); } .delta-down { color: var(--warn); }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.report-card { display: flex; flex-direction: column; gap: 4px; color: var(--text); margin: 0; }
.report-card:hover { text-decoration: none; border-color: var(--brand-line); }
.stage-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; margin: 6px 0; }
.stage-row b { text-align: right; }
.saldo-box { margin: 8px 0; }
@media (max-width: 760px) {
  .boss-grid { grid-template-columns: minmax(0, 1fr); }
  .stage-row { grid-template-columns: 110px 1fr 60px; }
  .period-bar select { max-width: 100%; }
}
/* Э8: у администратора и руководителя пункты «Кабинет ПТО» и «Отчёты ПТО» — на невысоких экранах (1366×768) меню по группам чуть плотнее:
   подпись в одну строку (полное название — во всплывающей подсказке), пункт 25 px (не меньше 24 px по WCAG 2.2) */
@media (min-width: 1101px) and (max-height: 820px) {
  .side-nav.grouped a { min-height: 25px; padding-top: 2px; padding-bottom: 2px; }
  .side-nav.grouped a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}
.month-chart svg { height: 130px; }
.month-labels { display: grid; text-align: center; font-size: 11px; color: var(--muted); margin-top: 4px; }
.month-labels span { overflow: hidden; white-space: nowrap; }

/* Э9: объявление администратора, удаление уведомления, сводка, настройки напоминаний; «уменьшить движение» (Е-098) */
.announce-bar { display: flex; align-items: flex-start; gap: 10px; padding: 8px 24px; background: #EAF2FB; border-bottom: 1px solid var(--line); color: var(--text); }
.announce-bar.warn { background: var(--warn-bg); border-left: 4px solid #C0392B; }
.announce-bar .announce-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.announce-bar .x { flex: none; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; min-width: 32px; min-height: 32px; }
@media (max-width: 760px) { .announce-bar { padding: 8px 12px; } }
.note-row { display: flex; align-items: stretch; gap: 2px; }
.note-row .note-item { flex: 1; min-width: 0; }
.note-del { flex: none; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--muted, #6b7785); font-size: 18px; width: 36px; cursor: pointer; border-radius: 6px; }
.note-del:hover { background: rgba(0,0,0,.05); color: #C0392B; }
.note-body { white-space: pre-line; }
.digest-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 6px 0 10px; background: #F7F9FB; display: flex; flex-direction: column; gap: 4px; }
.remind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; }
.remind-days { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.row-hl td { background: #FFF6D6 !important; }
@media (prefers-reduced-motion: reduce) { .note-toast, .note-offer, .announce-bar { animation: none !important; transition: none !important; } }
.field-bad input, .field-bad select, .remind-days.field-bad { outline: 2px solid #C0392B; outline-offset: 1px; }

/* ---------- Э10: полоса «Нет связи» (обычный вид) и «Исходящие» ---------- */
.net-band { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 8px 16px; background: #FEF0C7; color: #7A2E0E; border-bottom: 1px solid #F5D58A; font-weight: 600; }
.net-band a { color: #7A2E0E; text-decoration: underline; }
.net-band .net-err { color: #912018; }
.phone-link { display: grid; gap: 8px; }
.phone-qr { display: block; margin: 4px auto; background: #fff; border: 1px solid var(--line); }

/* ---------- Э10: простой вид. Размеры в rem от системного шрифта: текст ≥ 18 px, кнопки ≥ 56 px, зоны ≥ 48 px ---------- */
html.sv-root { font-size: 100%; }
.sv { font-size: 1.25rem; line-height: 1.4; min-height: 100vh; background: var(--bg); color: var(--text); overflow-wrap: anywhere; }
.sv-top { display: flex; align-items: center; gap: .5rem; padding: .375rem .75rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.sv-home { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; min-width: 3rem; color: var(--brand); margin-right: auto; }
.sv-home:hover { text-decoration: none; }
.sv-me { display: inline-flex; align-items: center; gap: .375rem; min-height: 3rem; min-width: 3rem; padding: 0 .75rem; border: 2px solid var(--brand); border-radius: .5rem; color: var(--brand); font-weight: 700; font-size: 1.125rem; white-space: nowrap; }
.sv-me .ico { width: 1.25em; height: 1.25em; }
/* «Сообщения: N» — колокольчик основы (notifications.tsx) с подписью; вся плашка нажимается */
.sv-bell { position: relative; display: inline-flex; align-items: center; gap: .25rem; min-height: 3rem; padding: 0 .75rem; border: 2px solid var(--brand); border-radius: .5rem; color: var(--brand); font-weight: 700; font-size: 1.125rem; white-space: nowrap; }
.sv-bell .bell { position: absolute; inset: -2px; width: auto; height: auto; border: 0; background: transparent; opacity: 1; justify-content: flex-end; padding-right: .75rem; }
.sv-bell .bell .ico { display: none; }
.sv-bell .bell-n { position: static; box-shadow: none; background: #B42318; color: #fff; font-size: 1.125rem; height: auto; line-height: 1.4; min-width: 1.75rem; padding: 0 .375rem; border-radius: 1rem; }
.sv-bell { padding-right: 3rem; }
html.sv-compact .sv-bell { padding: 0 .75rem 0 0; min-width: 3.5rem; }
html.sv-compact .sv-bell-t { display: none; }
html.sv-compact .sv-bell .bell .ico { display: block; width: 1.5rem; height: 1.5rem; margin-right: auto; margin-left: .75rem; }
html.sv-compact .sv-bell .bell { justify-content: space-between; padding: 0 .5rem; }
html.sv-compact .sv-me-t, html.sv-compact1 .sv-me-t { display: none; }
/* в простом виде всплывающие плашки и окно уведомлений основы не закрывают кнопки — своё предложение на главном экране */
html.sv-root .note-offer, html.sv-root .note-toasts { display: none !important; }
html.sv-root .modal { font-size: 1.125rem; }
html.sv-root .modal .btn { min-height: 3rem; font-size: 1.125rem; }
.net-band.big { font-size: 1.25rem; font-weight: 700; padding: .75rem 1rem; gap: .25rem 1rem; }
.net-band.big a { display: inline-flex; align-items: center; min-height: 3rem; font-size: 1.125rem; }
.sv-main { max-width: 40rem; margin: 0 auto; padding: 1rem .75rem 5rem; }
.sv-main.sv-plain { max-width: none; font-size: 14px; padding: 0; }
.sv-title { font-size: 1.625rem; line-height: 1.25; margin: .5rem 0 1rem; display: block; }
.sv-h { font-size: 1.375rem; margin: .75rem 0 .5rem; }
.sv-note { font-size: 1.125rem; margin: .5rem 0; }
.sv-sub { display: block; font-size: 1.125rem; color: var(--muted); font-weight: 400; }
.sv-err { color: #912018; background: #FEE4E2; border: 1px solid #F9C6C0; padding: .75rem; border-radius: .5rem; font-size: 1.125rem; font-weight: 600; margin: .5rem 0; }
.sv-off, .sv-big-note { background: #FEF0C7; color: #7A2E0E; padding: .875rem 1rem; border-radius: .75rem; font-weight: 700; }
.sv-big-note { font-size: 1.375rem; }
.sv-ico { width: 1.4em; height: 1.4em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sv-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 3.5rem; padding: .625rem 1rem; font: inherit; font-family: var(--font-brand); font-size: 1.25rem; font-weight: 700; line-height: 1.2;
  border-radius: .75rem; border: 2px solid var(--brand); background: #fff; color: var(--brand); text-align: center; white-space: normal; cursor: pointer; }
.sv-btn:hover { text-decoration: none; background: var(--brand-tint); }
.sv-btn-main { background: var(--brand); color: #fff; }
.sv-btn-main:hover { background: var(--brand-2); }
.sv-btn-danger { border-color: var(--err); color: var(--err); }
.sv-btn-light { border-color: var(--brand-line); }
.sv-btn:disabled, .sv-choice:disabled { background: #EEF1F4; color: #4A5363; border-color: #B0BBC3; cursor: default; }
.sv-neednet-t { font-size: 1.125rem; font-weight: 600; }
.sv-big-btns { display: grid; gap: .75rem; margin-top: 1rem; }
.sv-big-btns .sv-btn { min-height: 4.5rem; font-size: 1.375rem; }
.sv-count { background: #B42318; color: #fff; border-radius: 1rem; padding: .125rem .625rem; font-size: 1.125rem; }
.sv-card { display: block; background: #fff; border: 1px solid #CDD3DB; border-radius: .75rem; padding: 1rem; margin: .75rem 0; color: var(--text); }
a.sv-card:hover { text-decoration: none; border-color: var(--brand); }
.sv-card-ret { border: 2px solid #B42318; }
.sv-card-h { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; margin-bottom: .375rem; }
.sv-line { margin: .25rem 0; }
.sv-reason { font-size: 1.375rem; font-weight: 700; color: #912018; margin: .5rem 0; }
.sv-reason ul { font-size: 1.125rem; margin: .25rem 0; }
.sv-label { color: var(--text); font-weight: 600; }
.sv-prop { margin: .5rem 0; padding: .5rem .75rem; background: #E8EEF2; border-radius: .5rem; }
.sv-works { margin: .25rem 0; padding-left: 1.25rem; }
.sv-st { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .625rem; border-radius: 999px; font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
.sv-st-gray { background: #F2F4F7; color: #344054; }
.sv-st-blue { background: #E0EAFF; color: #1F3E8A; }
.sv-st-red { background: #FEE4E2; color: #912018; }
.sv-st-green { background: #DCFAE6; color: #085D3A; }
.sv-st-orange { background: #FEF0C7; color: #93370D; }
.sv-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.sv-actions > * { flex: 1 1 9rem; }
.sv-actions.col { flex-direction: column; }
.sv-actions.col > * { flex: none; }
.sv-choices { display: grid; gap: .5rem; margin: .5rem 0; }
.sv-choice { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .125rem; width: 100%; min-height: 3.5rem; padding: .625rem 1rem; font: inherit; font-size: 1.25rem; font-weight: 600;
  text-align: left; border: 2px solid #858E9E; border-radius: .75rem; background: #fff; color: var(--text); cursor: pointer; position: relative; }
.sv-choice.on { border-color: var(--brand); background: #E8EEF2; padding-right: 2.75rem; }
.sv-choice.on .sv-ico { position: absolute; right: .75rem; top: .875rem; color: #067647; }
.sv-last { border: 3px solid #067647; background: #F3FBF6; }
.sv-last-t { color: #085D3A; font-weight: 700; font-size: 1.125rem; }
.sv-field { display: block; margin: .75rem 0; }
.sv-field > span { display: block; font-weight: 600; margin-bottom: .25rem; font-size: 1.125rem; }
.sv-field input, .sv-field textarea, .sv-input { width: 100%; font: inherit; font-size: 1.25rem; min-height: 3.5rem; padding: .5rem .75rem; border: 2px solid #858E9E; border-radius: .5rem; background: #fff; color: var(--text); }
.sv-input { min-height: 3rem; margin-top: .25rem; }
.sv-qty { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
.sv-qty input { flex: 1; min-width: 0; font: inherit; font-size: 2.25rem; font-weight: 700; min-height: 4.5rem; padding: .25rem .75rem; border: 3px solid var(--brand); border-radius: .75rem; }
.sv-unit { font-size: 1.5rem; font-weight: 700; }
.sv-work-name { font-size: 1.375rem; font-weight: 700; }
.sv-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sv-cam { min-height: 5rem; font-size: 1.375rem; }
.sv-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .5rem; margin: .75rem 0; }
.sv-photos.big { grid-template-columns: 1fr 1fr; }
.sv-photos.big .sv-photo:first-child { grid-column: 1 / -1; }
.sv-photos.wide { grid-template-columns: 1fr; }
.sv-photo-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; min-height: 3rem; }
.sv-photo-btn img { width: 100%; max-height: 20rem; object-fit: cover; border-radius: .5rem; display: block; }
.sv-viewer { position: fixed; inset: 0; z-index: 120; background: rgba(10, 18, 24, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; }
.sv-viewer img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; }
.sv-viewer .sv-btn { max-width: 20rem; }
.sv-sticky { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding: .5rem 0 .75rem; margin-top: .5rem; box-shadow: 0 -8px 12px -8px rgba(21, 36, 47, .18); }
.sv-check-choice { flex-direction: row; align-items: center; gap: .75rem; }
.sv-check-choice .sv-choice-t { display: flex; flex-direction: column; gap: .125rem; }
.sv-box-check { flex: none; width: 2.25rem; height: 2.25rem; border: 3px solid var(--brand); border-radius: .375rem; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.sv-choice.on .sv-box-check { background: var(--brand); }
.sv-choice.on .sv-box-check .sv-ico { position: static; color: #fff; stroke-width: 3; }
.sv-choice.sv-check-choice.on { padding-right: 1rem; }
.sv-free { font-size: 1.125rem; color: var(--text); font-weight: 600; }
.sv-done { background: #DCFAE6; color: #085D3A; border: 2px solid #067647; border-radius: .75rem; padding: 1rem; font-size: 1.25rem; margin: .5rem 0; }
.sv-done-top { position: sticky; top: 4rem; z-index: 6; }
.sv-flash { background: #DCFAE6; color: #085D3A; font-weight: 700; font-size: 1.25rem; padding: .75rem 1rem; border-bottom: 2px solid #067647; }
.sv-no { white-space: nowrap; }
.sv-no-l { font-weight: 800; padding: 0 .2em; margin-right: .05em; background: #E8EEF2; border-radius: .25em; }
.sv-kv-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.sv-ask { border: 2px solid var(--accent); }
.sv-busy { opacity: .6; pointer-events: none; }
.sv-back-simple { padding: .75rem; max-width: 40rem; margin: 0 auto; font-size: 1.25rem; }
.sv-back-simple .ico { width: 1.4em; height: 1.4em; }
/* экран входа на телефоне — крупно (простой вход): текст ≥ 18 px, поля и кнопки ≥ 48 px */
.login-help { margin: 4px 0 0; }
.login-reg { align-self: center; font-size: 14px; color: var(--accent); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 8px; }
.login-pending { display: grid; gap: 8px; }
.login-pending .login-call { justify-self: start; }
.login-drop { justify-self: start; background: none; border: 0; padding: 8px 0; color: #912018; text-decoration: underline; cursor: pointer; font: inherit; }
@media (pointer: coarse) {
  .login-form, .login-form input, .login-form .btn, .login-form .muted, .login-form label, .login-form .hint, .login-form .alert, .login-form .err { font-size: 18px; }
  .login-form input { min-height: 48px; }
  .login-form .btn { min-height: 52px; }
  .login-reg { font-size: 16px; }
}
.sv-photo { display: flex; flex-direction: column; gap: .25rem; }
.sv-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .5rem; background: #EEF1F4; }
.sv-photo-x { min-height: 3rem; font: inherit; font-size: 1.125rem; border: 2px solid #858E9E; background: #fff; color: var(--text); border-radius: .5rem; cursor: pointer; }
.sv-kv { display: grid; gap: .125rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.sv-kv:last-child { border-bottom: 0; }
.sv-kv > span { color: var(--muted); font-size: 1.125rem; }
.sv-link { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; min-height: 3rem; min-width: 3rem; padding: 0 .25rem; background: none; border: 0; font: inherit; font-size: 1.125rem; color: var(--accent); text-decoration: underline; cursor: pointer; }
.sv-link:disabled { color: #4A5363; }
.sv-wiz-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.sv-stepno { font-size: 1.125rem; color: var(--muted); }
.sv-seg { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.sv-login { max-width: 30rem; margin: 0 auto; padding: 1.25rem 1rem; }
.sv-logo { display: block; width: 100%; max-height: 9rem; object-fit: contain; background: var(--brand); padding: 1rem; border-radius: .75rem; margin-bottom: 1rem; }
.sv .alert, .sv .toast { font-size: 1.125rem; }
.sv .muted.pad { font-size: 1.125rem; }
@media (max-width: 400px) { .sv-seg { grid-template-columns: 1fr; } .sv-main { padding-left: .5rem; padding-right: .5rem; } }

/* Э11 (проверка «новичка» по снимкам): пока открыто окно подтверждения, всплывающие уведомления его не закрывают —
   они остаются в колокольчике; короткие сообщения программы на телефоне — сверху */
body:has(.modal-back) .note-toasts, body:has(.sheet-back) .note-toasts { display: none; }   /* звонки и сообщения CRM (.live-pop) — не скрываются: в колокольчик они не попадают */
@media (max-width: 760px) { body:has(.modal-back) .toasts { top: calc(10px + env(safe-area-inset-top)); bottom: auto; } }
/* причины, предупреждения и ошибки переносятся, а не обрезаются (причина скидки, «укажите причину…») */
.alert, .tag-warn, .tbl td .muted.small, .tbl td .small { white-space: normal; overflow-wrap: anywhere; }
