:root {
  --bg: #eef1f5; --panel: #ffffff; --ink: #17212b; --muted: #5b6876; --line: #d6dce3; --line-soft: #e7ebf0;
  --head: #141d27; --head-ink: #e9eef4; --side: #1d2936; --side-ink: #c5cfda; --side-active: #2b3b4d;
  --gold: #c9a227; --accent: #2c5c8c; --accent-dark: #234a71; --accent-soft: #e6eef7;
  --ok: #2e7d4f; --ok-soft: #e5f3ea; --warn: #8a5800; --warn-soft: #fbf1dc; --bad: #b3261e; --bad-soft: #fbe7e5;
  --code: #f1f4f7;
  --mono: Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --sans: "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 2px 0 0; font-weight: 600; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.pilot-banner { background: var(--gold); color: #1a1300; font-size: 12px; text-align: center; padding: 3px 8px; font-weight: 600; letter-spacing: .02em; }
.topbar { height: 52px; background: var(--head); color: var(--head-ink); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--head-ink); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 2px solid var(--gold); color: var(--gold); font-weight: 700; font-size: 13px; border-radius: 4px; letter-spacing: .04em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: .1em; }
.brand-text small { font-size: 11px; color: #9fb0c2; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.unit-chip { font-size: 12px; border: 1px solid #3a4b5e; padding: 3px 8px; border-radius: 3px; color: #d6dee7; white-space: nowrap; }
.user-box { display: flex; flex-direction: column; text-align: right; line-height: 1.2; }
.user-name { font-size: 13px; }
.user-role { font-size: 11px; color: #9fb0c2; }
.topbar form { margin: 0; }

.shell { display: flex; min-height: calc(100vh - 74px); }
.sidebar { width: 224px; flex: 0 0 224px; background: var(--side); color: var(--side-ink); padding: 8px 0; display: flex; flex-direction: column; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7f91a5; padding: 14px 18px 6px; }
.sidebar a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 8px 18px; border-left: 3px solid transparent; }
.sidebar a:hover { background: #243243; text-decoration: none; }
.sidebar a.active { background: var(--side-active); border-left-color: var(--gold); color: #fff; }
.sidebar svg { width: 16px; height: 16px; flex: 0 0 16px; }
.side-foot { margin-top: auto; font-size: 11px; color: #6f8195; padding: 16px 18px; line-height: 1.5; }

.content { flex: 1; min-width: 0; padding: 18px 22px 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.page-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); gap: 8px; flex-wrap: wrap; }
.panel-body { padding: 12px 14px; }
.panel-note { font-size: 12px; color: var(--muted); }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.cols-2 > .panel { margin-bottom: 0; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 4px; padding: 10px 12px; }
.kpi-gold { border-top-color: var(--gold); }
.kpi-warn { border-top-color: #d08b00; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 11px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th { background: #f4f6f9; color: #3c4a59; font-weight: 600; text-align: left; font-size: 12px; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.grid tbody tr:nth-child(even) { background: #fafbfc; }
.grid tbody tr:hover { background: var(--accent-soft); }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid tfoot td { font-weight: 600; border-top: 2px solid var(--line); background: #f4f6f9; }
.grid td.wrap { min-width: 260px; }

.code { font-family: var(--mono); font-size: 12px; background: var(--code); border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 3px; white-space: nowrap; color: var(--ink); }
a.code:hover { text-decoration: none; border-color: var(--accent); }
.code-sys { color: var(--accent-dark); font-weight: 600; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-muted { background: #eceff3; color: #56636f; }
.b-info { background: var(--accent-soft); color: var(--accent-dark); }
.b-bad { background: var(--bad-soft); color: var(--bad); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 14px; }
.filters .field { margin: 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.field input, .field select { font: inherit; font-size: 14px; color: var(--ink); padding: 7px 9px; border: 1px solid #b9c3ce; border-radius: 3px; background: #fff; min-width: 0; }
.field input:focus, .field select:focus { outline: 2px solid #8fb3d9; outline-offset: 0; border-color: var(--accent); }
.field-grow { flex: 1 1 320px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; padding-bottom: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border: 1px solid #b9c3ce; border-radius: 3px; background: #fff; color: var(--ink); cursor: pointer; }
.btn:hover { background: #f3f5f8; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent-dark); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: #3a4b5e; color: #d6dee7; }
.btn-ghost:hover { background: #223040; }
.btn-block { width: 100%; }

.alert { padding: 9px 12px; border-radius: 3px; margin-bottom: 14px; font-size: 13px; border: 1px solid; }
.alert-info { background: var(--accent-soft); border-color: #c3d5e9; color: var(--accent-dark); }
.alert-warn { background: var(--warn-soft); border-color: #ecd49c; color: #6e4700; }
.form-error { color: var(--bad); font-size: 13px; margin: -4px 0 12px; }

.codes3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.codebox { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; background: #fbfcfd; }
.codebox-sys { border-color: #b7cbe0; background: #f3f7fb; }
.codebox-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.codebox-value { font-family: var(--mono); font-size: 18px; font-weight: 600; margin: 4px 0; word-break: break-all; }
.codebox-empty { color: #a7b1bb; font-weight: 400; }
.codebox-hint { font-size: 11px; color: var(--muted); }

.dl { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 6px 14px; font-size: 13px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .count { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

progress.bar { -webkit-appearance: none; appearance: none; width: 100%; min-width: 80px; height: 8px; border: 0; background: #e6eaef; border-radius: 4px; overflow: hidden; display: block; }
progress.bar::-webkit-progress-bar { background: #e6eaef; }
progress.bar::-webkit-progress-value { background: var(--accent); }
progress.bar::-moz-progress-bar { background: var(--accent); }

.pager { display: flex; align-items: center; gap: 14px; padding: 10px 14px; font-size: 13px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager-info { color: var(--muted); margin-right: auto; }
.pager .disabled { color: #a7b1bb; }

.matrix th.role { white-space: normal; min-width: 92px; text-align: center; vertical-align: bottom; line-height: 1.25; }
.matrix td.mark { text-align: center; font-weight: 700; color: var(--ok); }
.matrix td.none { text-align: center; color: #c2c9d1; }
.matrix tr.special td { background: #f7f9fb; font-size: 12px; }

.impl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 24px; }
.impl li { padding: 4px 0; }
.hash { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.integrity { display: flex; gap: 12px; flex-wrap: wrap; }
.integrity .cell { flex: 1 1 280px; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; border-left-width: 4px; }
.integrity .ok { border-left-color: var(--ok); }
.integrity .bad { border-left-color: var(--bad); }
.integrity .title { font-weight: 600; margin-bottom: 4px; }
.integrity .meta { font-size: 12px; color: var(--muted); }

.print-only, .signatures { display: none; }

/* auth screens */
.auth-body { background: #141d27; min-height: 100vh; }
.auth-wrap { max-width: 460px; margin: 0 auto; padding: 48px 16px; }
.auth-brand { display: flex; align-items: center; gap: 14px; color: #e9eef4; margin-bottom: 18px; }
.brand-mark-lg { width: 48px; height: 48px; font-size: 18px; }
.auth-title { font-size: 22px; font-weight: 700; letter-spacing: .14em; }
.auth-sub { font-size: 12px; color: #9fb0c2; }
.auth-card { background: #fff; border-radius: 4px; padding: 22px; border-top: 3px solid var(--gold); }
.auth-h { font-size: 17px; margin: 0 0 14px; }
.auth-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.auth-warning { margin-top: 14px; font-size: 12px; color: #c9d3de; border: 1px solid #33465a; padding: 9px 12px; border-radius: 3px; }
.auth-foot { margin-top: 10px; font-size: 11px; color: #6f8195; text-align: center; }
.steps { padding-left: 18px; font-size: 13px; margin: 0 0 12px; }
.steps li { margin-bottom: 4px; }
.qr { display: flex; justify-content: center; margin: 8px 0; }
.qr svg { width: 200px; height: 200px; }
.secret { font-size: 12px; text-align: center; margin-bottom: 14px; color: var(--muted); }
.secret code { font-family: var(--mono); color: var(--ink); font-size: 13px; }
input.otp { font-family: var(--mono); font-size: 20px; letter-spacing: .3em; text-align: center; }
.codes { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes code { display: block; text-align: center; font-family: var(--mono); font-size: 15px; padding: 6px; border: 1px dashed #9aa6b2; border-radius: 3px; }
.actions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; }

@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; flex: none; flex-direction: row; flex-wrap: wrap; padding: 4px 8px; }
  .nav-section, .side-foot { display: none; }
  .sidebar a { border-left: 0; border-bottom: 3px solid transparent; padding: 8px 10px; }
  .sidebar a.active { border-bottom-color: var(--gold); }
  .cols-2, .codes3, .impl { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-box, .unit-chip { display: none; }
  .content { padding: 14px 16px 30px; }
  .dl { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  body { background: #fff; font-size: 11px; }
  .pilot-banner, .topbar, .sidebar, .filters, .no-print, .pager { display: none !important; }
  .content { padding: 0; }
  .panel { border: 0; margin-bottom: 8px; }
  .panel-head { border-bottom: 1px solid #000; padding: 4px 0; }
  .panel-body { padding: 6px 0; }
  .print-only { display: block; }
  .signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 36px; }
  .sig-line { border-top: 1px solid #000; padding-top: 4px; font-size: 11px; }
  .grid th { background: #fff; border-bottom: 1px solid #000; color: #000; }
  .grid td { border-bottom: 1px solid #999; }
  .grid tbody tr:nth-child(even) { background: #fff; }
  .badge { border: 1px solid #999; background: #fff !important; color: #000 !important; }
  .code { border: 0; background: none; padding: 0; }
  a { color: #000; }
}

/* forms (block 1) */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-wide { grid-column: 1 / -1; }
.field textarea { font: inherit; font-size: 14px; color: var(--ink); padding: 7px 9px; border: 1px solid #b9c3ce; border-radius: 3px; min-height: 70px; resize: vertical; }
.field input:disabled { background: #f1f4f7; color: var(--muted); }
.field input.mono { font-family: var(--mono); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.alert-bad { background: var(--bad-soft); border-color: #efc2bd; color: var(--bad); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.btn-danger { color: var(--bad); border-color: #e2b4af; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
form.inline { display: inline; margin: 0; }
.secret-box { font-family: var(--mono); font-size: 22px; padding: 14px; border: 1px dashed #9aa6b2; border-radius: 4px; text-align: center; letter-spacing: .06em; margin: 12px 0; user-select: all; }
@media (max-width: 900px) { .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* settings and reference lists */
.cell-input { font: inherit; font-size: 13px; color: var(--ink); padding: 4px 6px; border: 1px solid #c9d1da; border-radius: 3px; background: #fff; width: 100%; min-width: 70px; }
.cell-input:focus { outline: 2px solid #8fb3d9; border-color: var(--accent); }
.cell-input.mono { font-family: var(--mono); }
.cell-wide { min-width: 280px; }
.row-end { display: inline-flex; gap: 6px; align-items: center; }
.row-end input[type=date] { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid #c9d1da; border-radius: 3px; }
details summary { cursor: pointer; margin-bottom: 8px; }

/* заявки */
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.request-body { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: #2c3a48; }
.reject-form { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.cell-narrow { width: 70px; min-width: 60px; }
.match-cell { min-width: 300px; }
.match-cell .cell-input + .cell-input { margin-top: 4px; }

/* printed documents: A4 sheet */
.print-body { background: #e9ecef; }
.print-toolbar { max-width: 210mm; margin: 12px auto; display: flex; gap: 12px; align-items: center; }
.sheet { background: #fff; color: #000; width: 210mm; min-height: 297mm; margin: 0 auto 24px; padding: 15mm 12mm 15mm 25mm;
  font-family: "Times New Roman", Times, serif; font-size: 13pt; line-height: 1.3; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.doc-top { display: flex; justify-content: space-between; gap: 20px; min-height: 30mm; }
.doc-resolution { width: 75mm; font-size: 11pt; font-style: italic; }
.doc-resolution .res-text { font-weight: bold; margin-bottom: 4px; }
.doc-addressee { width: 80mm; font-size: 14pt; text-align: left; }
.doc-title { text-align: center; font-size: 14pt; font-weight: bold; margin: 8mm 0 4mm; letter-spacing: .05em; }
.doc-sub { font-size: 12pt; font-weight: normal; letter-spacing: 0; }
.doc-draft { text-align: center; color: #b3261e; font-weight: bold; font-family: var(--sans); font-size: 10pt; }
.doc-body { text-indent: 12mm; text-align: justify; margin: 0 0 4mm; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 11pt; }
.doc-table th, .doc-table td { border: 1px solid #000; padding: 2px 4px; vertical-align: middle; }
.doc-table th { font-weight: normal; text-align: center; }
.doc-table .c-n { width: 10mm; text-align: center; }
.doc-table .c-code { width: 34mm; text-align: center; }
.doc-table .c-name { text-align: center; }
.doc-table .c-u { width: 14mm; text-align: center; }
.doc-table .c-q { width: 14mm; text-align: center; }
.doc-table .c-note { width: 20mm; }
.doc-table tr { page-break-inside: avoid; }
.doc-signer { display: grid; grid-template-columns: 1fr 45mm auto; gap: 8mm; align-items: end; margin-top: 10mm; }
.sign-line { border-bottom: 1px solid #000; height: 10mm; }
.sign-right { white-space: nowrap; }
.sheet-foot { margin-top: 12mm; font-family: var(--sans); font-size: 8pt; color: #666; }
@media print {
  @page { size: A4; margin: 0; }
  .print-body { background: #fff; }
  .sheet { box-shadow: none; margin: 0; width: auto; min-height: 0; }
}
.nav-count { margin-left: auto; background: var(--gold); color: #1a1300; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 0 7px; line-height: 18px; }

/* catalogue picker */
.ac-box { position: fixed; z-index: 100; min-width: 460px; max-width: 680px; max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid #b9c3ce; border-radius: 4px; box-shadow: 0 6px 18px rgba(20, 29, 39, .18); }
.ac-item { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.ac-item:last-child { border-bottom: 0; }
.ac-item.on, .ac-item:hover { background: var(--accent-soft); }
.ac-name { font-size: 13px; }
.ac-codes { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.ac-empty { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.link-chip { display: inline-block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.link-chip.linked { color: var(--accent-dark); font-weight: 600; font-family: var(--mono); }
.add-line { display: grid; grid-template-columns: 180px minmax(240px, 1fr) 70px 80px 160px auto; gap: 8px; align-items: end; padding: 12px 14px; border-top: 1px solid var(--line); }
.add-line .field { margin: 0; }
.add-line .hint { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .add-line { grid-template-columns: minmax(0, 1fr); } .ac-box { min-width: 0; left: 8px !important; right: 8px; } }

/* action rows: attachments, issue, receipt */
.act-line { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }
.act-line .field { margin: 0; flex: 1 1 240px; }
.act-line .hint { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.form-actions form.inline input[type=text] { min-width: 220px; }

/* login warning, AC-8 */
.legal-notice { background: #3a0d0a; border: 1px solid #b3261e; border-left: 4px solid #e0473c; color: #fbe9e7; padding: 12px 14px; border-radius: 3px; margin-bottom: 16px; }
.legal-notice-title { font-weight: 700; letter-spacing: .03em; font-size: 13px; margin-bottom: 6px; }
.legal-notice p { margin: 0 0 4px; font-size: 13px; }
.legal-notice-sub { color: #f2c1bb; font-size: 12px !important; }
.legal-accept { margin-top: 4px; }

/* Додаток 25, landscape */
.sheet.sheet-landscape { width: 297mm; min-height: 210mm; padding: 10mm 10mm 10mm 20mm; font-size: 11pt; page: land; }
.print-body:has(.sheet-landscape) .print-toolbar { max-width: 297mm; }
@page land { size: A4 landscape; margin: 0; }
.f25-head { display: grid; grid-template-columns: 1fr 1.2fr .8fr; gap: 8mm; align-items: start; margin-bottom: 4mm; }
.f25-right { text-align: right; font-size: 10pt; }
.f25-center { text-align: center; }
.f25-title { font-size: 13pt; font-weight: bold; margin-bottom: 2mm; }
.f25-row { display: flex; justify-content: space-around; gap: 6mm; }
.f25-u { border-bottom: 1px solid #000; padding: 0 2mm; min-width: 20mm; display: inline-block; }
.f25-box { min-width: 30mm; text-align: center; }
.f25-cap { font-size: 8pt; color: #000; }
.f25-meta { width: 100%; border-collapse: collapse; margin-bottom: 3mm; font-size: 10.5pt; }
.f25-meta td { padding: 1mm 2mm 0 0; vertical-align: bottom; }
.f25-meta td.f25-u { display: table-cell; }
.f25-table { font-size: 10pt; }
.f25-table .c-m { width: 24mm; text-align: right; }
.f25-table .f25-name { text-align: left; }
.f25-table .f25-nums th { font-size: 8pt; padding: 0; }
.f25-total { margin-top: 3mm; }
.f25-total-cap { display: flex; justify-content: space-around; }
.f25-signs { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8mm; margin-top: 4mm; font-size: 10.5pt; }
.f25-sign { margin-top: 3mm; }
/* Signature rows: label | name on a line | signature line, captions under each line */
.f25-signtab { width: 100%; border-collapse: separate; border-spacing: 3mm 0; margin-left: -3mm; align-self: start; }
.f25-signtab td { padding: 0; vertical-align: bottom; }
.f25-signtab td.sl { white-space: nowrap; padding-top: 4mm; width: 16mm; }
.f25-signtab td.sl.sl-long { white-space: normal; width: 44mm; line-height: 1.2; }
.f25-signtab + .f25-signtab { margin-top: 1mm; }
.f25-signtab td.sn { border-bottom: 1px solid #000; padding: 4mm 1mm 0.5mm; }
.f25-signtab td.ss { border-bottom: 1px solid #000; width: 32mm; }
.f25-signtab tr.sc td { font-size: 7.5pt; text-align: center; vertical-align: top; padding: 0.5mm 0 0; border: 0; }
.f25-signtab-in td.sn { padding-top: 6mm; }
.doc-table .f25-signtab td { border: 0; }
.doc-table .f25-signtab td.sn, .doc-table .f25-signtab td.ss { border-bottom: 1px solid #000; }
.f25-fin { font-size: 9pt; }

/* Military request (shortage) */
.mr-top { display: flex; justify-content: space-between; align-items: flex-start; }
.mr-sedo { font-style: italic; font-size: 11pt; }
.mr-addressee { margin-left: auto; width: 95mm; font-size: 13pt; }
.mr-sign { display: grid; grid-template-columns: 1fr auto; margin-top: 10mm; }
.mr-exec { margin-top: 10mm; font-size: 10pt; }
.mr-dist { margin-top: 8mm; font-size: 11pt; }
.mr-form { max-width: 210mm; margin: 0 auto 12px; display: flex; flex-wrap: wrap; gap: 6px 10px; font-family: var(--sans); font-size: 12px; }
.mr-form input { width: 180px; }

/* income import preview */
.grid-compact td, .grid-compact th { font-size: 11px; padding: 3px 6px; }
.row-head td { background: var(--accent-soft); font-weight: 600; }
.match-cell form.inline { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* stock count */
.row-plus td { background: #eaf6ec; }
.row-minus td { background: #fbeceb; }

/* approval route */
.route { list-style: none; margin: 0; padding: 0; }
.route-step { border-left: 3px solid var(--line); padding: 6px 0 10px 14px; position: relative; }
.route-step.done { border-left-color: #2e7d32; }
.route-step.current { border-left-color: var(--gold); background: #fffaf0; }
.route-title { font-weight: 600; }
.route-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.route-form input { flex: 1 1 220px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 4px 0; }
.checklist li.ok { color: #2e7d32; }
.checklist li.miss { color: var(--bad); font-weight: 600; }

/* reports */
.report-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.report-card { display: block; padding: 16px 18px; color: inherit; text-decoration: none; margin: 0; }
.report-card:hover { border-color: var(--accent); }
.report-card h2 { margin: 0 0 6px; font-size: 16px; }
.report-card p { margin: 0; color: var(--muted); font-size: 13px; }
.row-group td { background: var(--accent-soft); font-weight: 600; }
.row-subtotal td { font-weight: 600; border-top: 1px solid var(--line); }
.page-break { break-before: page; page-break-before: always; padding-top: 6mm; }
@media (max-width: 900px) { .report-cards { grid-template-columns: minmax(0, 1fr); } }

/* Scan beside the lines */
.scan-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 14px; align-items: start; }
.scan-split > .panel { margin-bottom: 0; }
.scan-split + * { margin-top: 14px; }
.scan-pane { position: sticky; top: 8px; display: flex; flex-direction: column; max-height: calc(100vh - 16px); }
.scan-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scan-head select { max-width: 220px; }
.scan-tools { margin-left: auto; display: inline-flex; gap: 4px; }
.scan-view { overflow: auto; background: #5b6876; padding: 9px; min-height: 240px; flex: 1 1 auto; }
.scan-page { display: block; margin: 0 auto 9px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.scan-msg { color: #e9eef4; padding: 12px; }
.scan-show { grid-column: 1 / -1; justify-self: start; }
.scan-show[hidden] { display: none; }
.scan-split.scan-off { grid-template-columns: minmax(0, 1fr); }
.scan-split.scan-off .scan-pane { display: none; }
.scan-split .add-line { grid-template-columns: 140px minmax(0, 1fr) 60px 70px 110px; }
.scan-split .add-line > .btn { grid-column: 1 / 3; justify-self: start; }
.scan-split .add-line > label:nth-of-type(6) { grid-column: 3 / -1; }
@media (max-width: 1400px) {
  .scan-split { grid-template-columns: minmax(0, 1fr); }
  .scan-pane { position: static; max-height: none; }
  .scan-view { max-height: 65vh; }
}
@media print { .scan-pane, .scan-show { display: none !important; } .scan-split { display: block; } }
.backup-line { font-size: 12px; color: var(--ok); margin: -6px 0 12px; }

/* Main-page tiles: one button block per document and operation */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 6px; min-height: 150px; }
.tile:hover { box-shadow: 0 2px 8px rgba(20, 29, 39, .12); }
.tile-attn { border-top-color: var(--gold); }
.tile-main { display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 8px; color: var(--ink); text-decoration: none; flex: 1 1 auto; }
.tile-icon { flex: 0 0 42px; height: 42px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tile-icon svg { width: 24px; height: 24px; }
.tile-attn .tile-icon { background: var(--warn-soft); color: var(--warn); }
.tile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile-title { font-weight: 600; font-size: 15px; }
.tile-note { font-size: 12px; color: var(--muted); }
.tile-counts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.tile-count { font-size: 12px; padding: 2px 8px; border-radius: 10px; text-decoration: none; background: var(--code); color: var(--muted); }
.tile-count b { font-weight: 700; }
.tc-warn { background: var(--warn-soft); color: var(--warn); }
.tc-info { background: var(--accent-soft); color: var(--accent-dark); }
.tile-actions { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line-soft); }
.section-title { font-size: 15px; font-weight: 600; margin: 4px 0 10px; color: var(--muted); }
@media (max-width: 600px) { .tiles { grid-template-columns: minmax(0, 1fr); } }
.tile-actions .btn { white-space: nowrap; }

/* Warehouse or person on a document side */
.side-pick { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.side-pick legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.side-switch { display: flex; gap: 16px; margin-bottom: 6px; font-size: 13px; }
.side-switch input { margin-right: 4px; }
input.picked { border-color: var(--ok); background: var(--ok-soft); }

/* Help page, "Що далі" box, password rules */
.btn-help { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.btn-help svg { width: 16px; height: 16px; flex: none; }
.help-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.help-toc { position: sticky; top: 12px; padding: 8px 0; display: flex; flex-direction: column; }
.help-toc a { padding: 5px 14px; color: var(--ink); font-size: 13px; }
.help-toc a:hover { background: var(--accent-soft); text-decoration: none; }
.help-sec { padding: 12px 16px; scroll-margin-top: 12px; }
.help-sec h2 { margin-bottom: 8px; }
.help-sec:target { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.help-sec ol, .help-sec ul { padding-left: 20px; margin: 6px 0; }
.help-sec li { margin: 3px 0; }
.help-sec table.tbl { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.help-sec table.tbl th, .help-sec table.tbl td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.help-sec table.tbl th { background: var(--code); font-weight: 600; }
@media (max-width: 800px) { .help-wrap { grid-template-columns: 1fr; } .help-toc { position: static; } }
.next-step { background: var(--accent-soft); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 4px; padding: 9px 12px; margin-bottom: 14px; }
.next-step.next-mine { background: var(--warn-soft); border-left-color: var(--gold); }
.next-help { margin-left: 8px; white-space: nowrap; font-size: 12px; }
.pw-rules { list-style: none; padding: 0; margin: 6px 0 8px; font-size: 13px; color: var(--bad); }
.pw-rules li::before { content: "✗ "; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "✓ "; }

/* Elements switched off with the hidden attribute stay off whatever their display rule. */
[hidden] { display: none !important; }

/* Approvals (phone-friendly) */
.ap-card { padding: 12px 14px; }
.ap-title { font-size: 16px; font-weight: 600; }
.ap-what { margin-top: 3px; }
.ap-lines { list-style: none; margin: 10px 0 6px; padding: 0; border-top: 1px solid var(--line-soft); }
.ap-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.ap-lines li b { white-space: nowrap; }
.ap-note { font-size: 12px; color: var(--warn); margin: 6px 0 0; }
.ap-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.ap-actions form { display: flex; flex-direction: column; gap: 6px; }
.ap-actions input[type=text] { width: 100%; padding: 9px 10px; font-size: 15px; }
.ap-btn { width: 100%; padding: 12px; font-size: 16px; }
.ap-no { color: var(--bad); border-color: var(--bad); }
.nav-approvals { font-weight: 600; }
@media (max-width: 700px) {
  .ap-actions { grid-template-columns: 1fr; }
  .sidebar .nav-approvals { order: -1; }
}
.ap-banner { display: block; background: var(--warn-soft); border: 1px solid var(--gold); border-left: 5px solid var(--gold); border-radius: 4px; padding: 12px 14px; margin-bottom: 14px; color: var(--ink); font-size: 15px; }
.ap-banner:hover { text-decoration: none; background: #f7e7c4; }

/* Phones: one-line scrolling menu, compact top bar, nothing wider than the screen */
@media (max-width: 700px) {
  html, body { overflow-x: hidden; }
  .topbar { height: auto; min-height: 48px; padding: 6px 10px; flex-wrap: wrap; gap: 6px; }
  .brand-text small { display: none; }
  .topbar-right { gap: 6px; flex-wrap: wrap; }
  .topbar .btn { padding: 6px 9px; font-size: 13px; }
  .sidebar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar a { white-space: nowrap; flex: none; }
  .content { padding: 12px 10px 30px; min-width: 0; }
  .page-head { flex-wrap: wrap; gap: 8px; }
  .page-head p { margin: 4px 0 0; }
  .ap-card { padding: 12px; }
}

/* Додаток 25 on one A4 landscape sheet: tighter spacing, visible grid, wide note column */
.sheet.sheet-landscape { padding: 7mm 8mm 6mm 15mm; font-size: 10pt; }
.sheet-landscape .f25-head { margin-bottom: 2mm; gap: 6mm; }
.sheet-landscape .f25-title { font-size: 12pt; margin-bottom: 1mm; }
.sheet-landscape .f25-meta { font-size: 9.5pt; margin-bottom: 2mm; }
.sheet-landscape .f25-meta td { padding-top: 0.6mm; }
.sheet-landscape .doc-table th, .sheet-landscape .doc-table td { border: 0.75pt solid #000; padding: 1px 3px; }
.sheet-landscape .f25-table { font-size: 9.5pt; }
.sheet-landscape .f25-table .c-note { width: 46mm; font-size: 8pt; text-align: left; line-height: 1.15; }
.sheet-landscape .f25-table .c-code { width: 28mm; }
.sheet-landscape .f25-total { margin-top: 2mm; }
.sheet-landscape .f25-signs { margin-top: 2mm; font-size: 9.5pt; gap: 6mm; break-inside: avoid; page-break-inside: avoid; }
.sheet-landscape .f25-signtab td.sn { padding-top: 2.5mm; }
.sheet-landscape .f25-signtab td.sl { padding-top: 2.5mm; }
.sheet-landscape .f25-fin { font-size: 8pt; }
.sheet-landscape .f25-fin th, .sheet-landscape .f25-fin td { padding: 1px 3px; }
.sheet-landscape .f25-signtab-in td.sn { padding-top: 4mm; }
@media print { .sheet.sheet-landscape { padding: 6mm 7mm 5mm 14mm; } }
.sheet-landscape .doc-table .f25-signtab td { border: 0; }
.sheet-landscape .doc-table .f25-signtab td.sn, .sheet-landscape .doc-table .f25-signtab td.ss { border-bottom: 0.75pt solid #000; }

/* Безпека */
.security-banner .hash { color: inherit; }
.sec-approve { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.sec-approve .field { flex: 1 1 280px; margin: 0; }
.sec-output { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; max-height: 300px; overflow: auto; background: #f6f8fa; border: 1px solid var(--line); padding: 8px; margin: 6px 0 0; }
.inline-decide { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-decide input { font: inherit; font-size: 13px; padding: 5px 7px; border: 1px solid #b9c3ce; border-radius: 3px; min-width: 120px; }

/* Міжпідрозділові заявки */
.iu-steps { list-style: none; margin: 0 0 12px; padding: 0; }
.iu-steps li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0 6px 22px; border-bottom: 1px solid var(--line, #e3e7ec); position: relative; }
.iu-steps li::before { content: ''; position: absolute; left: 4px; top: 12px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #9aa6b2; }
.iu-steps li.done::before { background: #2e7d32; border-color: #2e7d32; }
.iu-ask { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.iu-ask input[name=purpose] { min-width: 180px; }
.next-step { margin: 0 0 16px; padding: 10px 14px; border-left: 4px solid #c9a227; background: rgba(201,162,39,.08); border-radius: 4px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0; }

/* Технічний стан і ремонт */
.tech-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.tech-tile { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #fff; border: 1px solid var(--line, #e3e7ec); border-radius: 4px; }
.tech-tile strong { font-size: 20px; }
.span-all, .span-2 { grid-column: 1 / -1; }
.form-grid > h2 { font-size: 15px; margin: 14px 0 6px; }
.pre { white-space: pre-wrap; }
.filters .grow { flex: 1 1 260px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
