/* LEGI check: the page's one stylesheet; the look follows 1C:Enterprise 8.3 "Taxi" (always light).
   Part 1 is the base (layout, components). Part 2, once a separate "1C skin" file behind <html data-skin="1c">,
   overrides it and holds the pages' own rules (2026-11-17 code audit L-5: merged).
   ":root " before a part-2 selector (57 of them) is the old skin prefix, kept where a part-2 rule must still
   beat a part-1 rule of the same weight on a real element (checked on every page); new rules go without it. */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6b7686;
  --line: #e2e6eb;
  --accent: #1f4e79;
  --accent-soft: #e6eef6;
  --ok: #1e7a46;
  --ok-soft: #e5f4ea;
  --warn: #9a6200;
  --warn-soft: #fdf3dc;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --sel: #fff7d6;
  font-family: "Noto Sans Georgian", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c; --card: #1a2028; --text: #e3e8ee; --muted: #93a0b0; --line: #2c3540;
    --accent: #7fb2e5; --accent-soft: #1f2d3c; --ok: #6fcf97; --ok-soft: #173024;
    --warn: #e6b450; --warn-soft: #33290f; --bad: #f28b82; --bad-soft: #3a1d1b; --sel: #3a3415;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
[hidden] { display: none !important; }
h1, h2, h3 { font-weight: 600; margin: 0 0 12px; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--bad); } .warn-c { color: var(--warn); }

/* Both header bars stick as one block, so no gap opens between them at any width. */
.head { position: sticky; top: 0; z-index: 5; }
.top { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--accent); letter-spacing: .5px; }
.brand span { font-weight: 500; color: var(--text); }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav a { padding: 6px 9px; white-space: nowrap; border-radius: 6px; text-decoration: none; color: var(--text); }
nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.subnav { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.subnav a { padding: 4px 12px; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: 13px; }
.subnav a.active { color: var(--accent); background: var(--card); border: 1px solid var(--line); }
.me { display: flex; gap: 12px; align-items: center; color: var(--muted); }

main { padding: 20px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 60px auto; }

label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
label > input, label > select { display: block; margin-top: 4px; width: 100%; }
input, select, button { font: inherit; }
input, select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); }
button { padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { button.primary { color: #0d1620; } }
button.danger { color: var(--bad); }
button.small { padding: 3px 8px; font-size: 12px; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > label { margin-bottom: 0; }
.grow { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 18px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat.ok { border-color: var(--ok); } .stat.bad { border-color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--card); }
tr.sel td { background: var(--sel); }
tr.click { cursor: pointer; }
td .sub { color: var(--muted); font-size: 12px; }
.scroll { overflow-x: auto; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; background: var(--accent-soft); color: var(--accent); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }

.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pair:last-child { border-bottom: 0; }
.pair > div, .pair .side { min-width: 0; overflow-wrap: anywhere; }
.pair .side .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pair .actions { display: flex; gap: 6px; }

.selbar { position: sticky; bottom: 0; background: var(--card); border: 1px solid var(--accent); border-radius: 10px; padding: 10px 14px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }

.secret { font-family: ui-monospace, Consolas, monospace; background: var(--accent-soft); padding: 10px; border-radius: 6px; word-break: break-all; user-select: all; }
.error { color: var(--bad); margin: 8px 0; }

#toast { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
#toast div { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; max-width: 420px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
#toast div.bad { background: var(--bad); color: #fff; }

.msbtn { display: block; text-align: center; padding: 10px 14px; margin: 8px 0 16px; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; }
@media (prefers-color-scheme: dark) { .msbtn { color: #0d1620; } }
details > summary { cursor: pointer; padding: 4px 0; }
.stat.click { cursor: pointer; }
.stat.click:hover { border-color: var(--accent); }
.stat.picked { outline: 2px solid var(--accent); }
/* Page lock while a request runs (see act() in app.js). */
body.busy { cursor: progress; }
body.busy main, body.busy #nav, body.busy .subnav, body.busy .me { pointer-events: none; }
/* A control that must work while the page is busy (stopping a long AI run). */
body.busy .live { pointer-events: auto; }
body.busy main { opacity: .7; }
body.busy::before { content: ""; position: fixed; top: 0; left: 0; height: 3px; width: 30%; background: var(--accent); z-index: 50; animation: busybar 1.1s ease-in-out infinite; }
@keyframes busybar { 0% { left: -30%; } 100% { left: 100%; } }
tr.group td { background: var(--accent-soft); font-size: 13px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal .card { width: min(520px, 100%); margin: 0; }
textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
/* Inline label+control pairs (sort, checkboxes): keep on one line. */
label.row > select, label.row > input { display: inline-block; width: auto; margin-top: 0; }
/* Suggestions: grouped tables. */
.sgroup { margin-top: 14px; }
.sgroup + .sgroup { border-top: 1px solid var(--line); padding-top: 12px; }
.stable { margin-top: 6px; table-layout: fixed; }
.stable th:nth-child(1), .stable th:nth-child(2) { width: 36%; }
.stable th:nth-child(3) { width: 16%; }
.stable th:nth-child(4) { width: 12%; }
.pside + .pside { margin-top: 4px; }
.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrap { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.ids { font-size: 12px; margin: 2px 0; }
.ids .tag { margin-right: 4px; font-variant-numeric: tabular-nums; }
/* Icon buttons (search / note) */
.ibtns, .sbtns { white-space: nowrap; width: 1%; }
.sbtns { display: flex; flex-direction: column; gap: 4px; align-items: stretch; white-space: normal; width: auto; }
.ibtns .ibtn + .ibtn { margin-left: 4px; }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--muted); cursor: pointer; vertical-align: middle; }
.ibtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ibtn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.ibtn.on.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.ibtn.on.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.ibtn.on.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
tr.taxdiff td:first-child, tr.taxdiff td:nth-child(2) { box-shadow: inset 3px 0 0 var(--bad); }
button.warnbtn { color: var(--bad); border-color: var(--bad); }
/* Names found in the bank text: green = same, yellow = nearly the same */
mark.same, mark.near { border-radius: 3px; padding: 0 2px; color: inherit; }
mark.same { background: var(--ok-soft); box-shadow: inset 0 -2px 0 var(--ok); }
mark.near { background: var(--warn-soft); box-shadow: inset 0 -2px 0 var(--warn); }
.ids .tag .idl { opacity: .7; font-size: 10px; }
/* Overview: currency accounts of one account drawn as one block */
tr.fam td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
tr.fam td { background: var(--accent-soft); }
tr.fam-first td { border-top: 2px solid var(--accent); }
tr.fam-last td { border-bottom: 2px solid var(--accent); }
tr.fam-mid td, tr.fam-last td { border-top-color: transparent; }
.tag.cur { min-width: 34px; text-align: center; font-weight: 600; }
/* Invoices: service lines */
tr.svc td { background: var(--warn-soft); }
table.inner { margin: 4px 0 8px; }

/* Page toolbar: groups (period | show | update | export) with captions and separators */
.toolbar { display: flex; flex-wrap: wrap; gap: 14px 0; align-items: stretch; margin-top: 8px; }
.tgroup { display: flex; flex-direction: column; gap: 6px; padding: 0 20px; border-left: 1px solid var(--line); min-width: max-content; }
.tgroup:first-child { padding-left: 0; border-left: 0; }
.tright { display: flex; flex-wrap: wrap; gap: 14px 0; margin-left: auto; }
.tright:empty { display: none; }
.tright > .tgroup:first-child { border-left: 1px solid var(--line); padding-left: 20px; }
.tcap { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tbody { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.tbody > label { margin-bottom: 0; }
.tperiod .tbody { flex-direction: column; align-items: flex-start; }
.tdates { display: flex; gap: 10px; }
.tdates label { margin-bottom: 0; }
.tfilter .tbody > label.grow { min-width: 260px; max-width: 380px; }
.tfilter .tbody > label > select, .tfilter .tbody > label > input { max-width: 100%; box-sizing: border-box; }
.tupdate .tbody, .texport .tbody { align-items: center; }
label.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--text); font-size: 13px; white-space: nowrap; }
label.check > input { width: auto; margin: 0; display: inline-block; }
@media (max-width: 760px) {
  .tgroup { padding: 0; border-left: 0; width: 100%; }
  .tright { margin-left: 0; width: 100%; }
  .tright > .tgroup:first-child { border-left: 0; padding-left: 0; }
}
.tfilter select { max-width: 380px; }
input.wide { min-width: 280px; width: 100%; }

/* Key/value details (waybill card) */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0 0 12px; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Balances: one day's movements under its row */
.daybox { padding: 8px 4px 12px; }
.daybox h3 { margin: 6px 0; font-size: 13px; }

/* Language switch in the header: two-part pill */
.langsw { display: inline-flex; padding: 2px; border-radius: 999px; background: #e9e9e9; border: 1px solid #d0d0d0; vertical-align: middle; }
.langsw button { border: 0 !important; background: transparent !important; padding: 2px 10px !important; border-radius: 999px !important;
  font-size: 12px; font-weight: 600; color: #777 !important; cursor: pointer; line-height: 18px; box-shadow: none !important; }
.langsw button.on { background: #fff !important; color: #222 !important; box-shadow: 0 1px 2px rgba(0,0,0,.18) !important; }
.langsw button:hover:not(.on) { color: #333 !important; }

/* Unposted / deleted 1C document in the waybill detail */
.unposted { background: #fff4c2; border: 1px solid #e0b400; border-radius: 3px; padding: 8px 10px; margin-bottom: 12px; }
.unposted-head { font-weight: 700; color: #7a5b00; margin-bottom: 6px; }
.unposted dl.kv { margin-bottom: 0; }

/* Side drawer for details */
.drawer-shade { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1100px, 96vw); background: var(--bg, #f2f2f2); z-index: 51;
  box-shadow: -6px 0 24px rgba(0,0,0,.25); display: flex; flex-direction: column; animation: drawer-in .15s ease-out; }
.drawer-body { overflow-y: auto; padding: 12px 16px 24px; flex: 1; }
.drawer-body > .card { margin: 0; }
/* The close button sits in its own strip above the scrolling body, so a sticky table head never runs under it. */
.drawer-top { flex: none; display: flex; justify-content: flex-end; align-items: center; height: 34px; padding: 0 8px; border-bottom: 1px solid #e2e2dc; }
.drawer-x { border: 0 !important; background: transparent !important;
  font-size: 20px; line-height: 1; cursor: pointer; color: #555 !important; padding: 4px 8px !important; box-shadow: none !important; }
.drawer-x:hover { color: #000 !important; }
body.drawer-open { overflow: hidden; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Table heads stick to the body edge itself, over its top padding, so no row shows above them. */
.drawer-body th { top: -12px; }
/* A border-collapsed head does not paint its top border, and at a fractional zoom a pixel of the row
   under it shows: the head covers a few pixels above itself in its own colour. */
.drawer-body thead th::before { content: ""; position: absolute; left: 0; right: 0; top: -4px; height: 5px; background: inherit; }

/* Details opened under a table row */
tr.detail-row > td { background: #fbfbf4; padding: 10px 12px 14px; border-left: 3px solid #f2c200; }
tr.detail-row > td > .card, .detail-in > .card { margin: 0; box-shadow: none; }
/* An opened row's content is as wide as its table and adds nothing to the table's width (toggleRowDetail). */
.detail-in { container-type: inline-size; }
@container (max-width: 760px) { .docs2 { grid-template-columns: 1fr; } }
tr.open > td { background: #fdf3c7 !important; }
.nested { background: #fff; border: 1px solid #ddd; border-radius: 3px; padding: 10px 12px; }
.nested h3 { margin-top: 0; }

/* Copyable IBAN and two-line account names */
button.copy { background: none !important; border: 0 !important; padding: 0 !important; font: inherit; color: inherit !important;
  cursor: copy; box-shadow: none !important; text-align: left; }
button.copy:hover { color: var(--accent) !important; text-decoration: underline dotted; }
.acc-name + .acc-name { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #ddd; }
button.big { font-size: 16px; padding: 10px 22px !important; }
a.sync-link { display: inline-block; padding: 6px 12px; border: 1px solid #d1a900; border-radius: 3px; background: #fffbe6; color: #333; text-decoration: none; font-weight: 600; }
a.sync-link:hover { background: #fce9a5; }

/* Waybill card: RS + invoice = 1C check line */
.check-ok, .check-bad { margin: 6px 0 10px; padding: 6px 10px; border-radius: 3px; font-weight: 600; }
.check-ok { background: var(--ok-soft); color: var(--ok); }
.check-bad { background: var(--bad-soft); color: var(--bad); }
.check-warn { margin: 6px 0 10px; padding: 6px 10px; border-radius: 3px; font-weight: 600; background: #fff4c4; color: #7a5a00; }
th.center { text-align: center; }

/* Key/value lists stay compact at the top, also next to a long column */
dl.kv { align-content: start; align-self: start; }

/* Sortable table headers */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { text-decoration: underline; }
th[data-sort="asc"]::after { content: " ▲"; font-size: 9px; }
th[data-sort="desc"]::after { content: " ▼"; font-size: 9px; }

/* The "Show" button of a page toolbar: easy to find */
button.show-btn { padding: 5px 18px; font-size: 13px; font-weight: 700; min-width: 110px; }
button.show-btn::before { content: "▶ "; font-size: 10px; }

/* "Show more" row of a long table */
tr.more-row td { text-align: center; padding: 10px; background: var(--card); }

/* Salary composition: one line, opens into the accrual kinds */
details.mix { margin-top: 4px; font-size: 12px; color: var(--muted); }
details.mix > summary { cursor: pointer; }
details.mix > summary:hover { color: var(--accent); }
details.mix table { margin-top: 4px; }

/* Wide tables: headers wrap, the name column does not grow without end */
th.sortable { white-space: normal; }
td.who { min-width: 160px; max-width: 240px; }

/* Today's work */
.wcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; margin: 12px 0; }
.wcard { border: 1px solid var(--line); border-top: 3px solid var(--line); background: var(--card); padding: 6px 9px 7px; cursor: pointer; min-width: 0; }
.wcard .k { font-size: 11.5px; color: var(--muted); line-height: 1.25; min-height: 2.5em; }
.wcard .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wcard .s { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcard.bad { border-top-color: var(--bad); } .wcard.warn { border-top-color: #e0a800; } .wcard.ok { border-top-color: var(--ok); }
.wcard.empty { opacity: .55; } .wcard.empty .v { color: var(--ok); }
.wcard:hover { border-color: var(--accent); } .wcard.picked { outline: 2px solid #f2c200; }
.wsum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 8px; }
.wsum .grow { margin-left: auto; }
.wtable { width: 100%; }
.wtable td { vertical-align: top; padding-top: 5px; padding-bottom: 5px; }
.wtable .wsev { width: 14px; padding-right: 0; }
.wtable .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #bbb; margin-top: 5px; }
.wtable .dot.bad { background: var(--bad); } .wtable .dot.warn { background: #e0a800; }
.wtable .wwhat .t { font-weight: 500; }
.wtable .wnote { font-size: 12px; color: #6a5a00; margin-top: 2px; }
.wtable td.num { white-space: nowrap; width: 1%; }
.wtable .wact { white-space: nowrap; width: 1%; text-align: right; }
.wtable .wact button { margin-left: 4px; opacity: .5; }
.wtable tr:hover .wact button, .wtable .wact button:focus { opacity: 1; }
.wtable tr.reviewed td { color: var(--muted); }
.wtable tr.wgroup td { padding-top: 7px; padding-bottom: 7px; }
@media (max-width: 700px) { .wtable .wact button { opacity: 1; } .wtable .wact { white-space: normal; } }

/* "Why this status" at the top of an opened row */
.why { background: #fffdf2; border: 1px solid #efe3b0; border-radius: 3px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.why-line { padding-left: 14px; position: relative; margin-top: 3px; }
.why-line::before { content: ""; position: absolute; left: 2px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: #bbb; }
.why-line.ok::before { background: var(--ok); } .why-line.warn::before { background: #e0a800; } .why-line.bad::before { background: var(--bad); }

/* Top-bar search */
#gsearch { display: inline-flex; margin-right: 10px; }
#gsearch input { width: 170px; height: 28px; box-sizing: border-box; border: 1px solid #d8d8d0; border-radius: 14px; padding: 0 12px; font-size: 12.5px; background: #fafaf7; }
#gsearch input:focus { width: 260px; background: #fff; border-color: #d1a900; outline: none; }
@media (max-width: 1300px) { #gsearch input, #gsearch input:focus { width: 130px; } }

/* Month close */
.close-table td.close-cell { text-align: center; font-variant-numeric: tabular-nums; }
.close-table td.close-cell.ok { color: var(--ok); font-weight: 600; background: #f3faf5; }
.close-table td.close-cell.warn { background: #fff8e1; }
.close-table td.close-cell.bad { background: #fdeeee; }
.close-table td.close-cell.click { cursor: pointer; }
.close-table td.close-cell.click:hover { outline: 2px solid #f2c200; outline-offset: -2px; }
.close-table th { white-space: normal; font-size: 11.5px; }
.link { color: var(--accent, #1a5fb4); font-size: 11.5px; margin-top: 2px; }
tr.click:hover .link { text-decoration: underline; }
/* Setup at the far end of the menu */
#nav a.nav-settings { margin-left: 6px; color: var(--muted); }
#nav a.nav-settings.active { color: inherit; }
/* User block in the top bar: the name, and password / log out under it */
.me .who { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; margin-left: 10px; }
.me .who #me-name { font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.me .who-actions { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.me .who-actions .link { font-size: 11.5px; padding: 0; }
.why-fix { margin-top: 3px; }
/* AI month analysis: verdict, numbered problems, order of fixes */
.ai-verdict h2 .tag { font-size: 13px; vertical-align: middle; }
.ai-lead { font-size: 15px; margin: 8px 0 12px; }
.ai-points { margin: 0 0 12px; padding-left: 22px; line-height: 1.55; }
.ai-points > li { margin: 0 0 10px; }
.ai-steps { background: var(--bg-soft, #f6f6f2); border-radius: 6px; padding: 8px 14px; margin: 0 0 12px; }
.ai-steps h3 { font-size: 13px; margin: 4px 0 6px; }
.ai-steps ol { margin: 0; padding-left: 20px; line-height: 1.5; }
/* AI audit: the rows the AI saw */
.audit-ev { padding: 4px 2px; }
.audit-ev h3 { font-size: 13px; margin: 10px 0 4px; }
.audit-ev h4 { font-size: 12px; margin: 8px 0 4px; color: var(--muted, #666); }
.audit-ev table.small td, .audit-ev table.small th { font-size: 11.5px; padding: 3px 6px; }
.audit-ev .kv { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; }
/* A copy button says so: a small drawn sign after the number, a green tick for a moment once copied */
button.copy svg { width: 13px; height: 13px; margin-left: 5px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.4; transition: opacity 0.12s; }
button.copy:hover svg { opacity: 1; }
button.copy.done svg { opacity: 1; stroke: #1d7a46; }
/* Recon: the account the page is on, in full */
.acc-banner { font-size: 16px; margin: 4px 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pside-sum { margin-bottom: 4px; }
.tfilter .tupd { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.tfilter .tupd { flex: 1 0 100%; }
/* Brand: the scales icon and the name, a link to the day's work. */
a.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
a.brand img { display: block; border-radius: 5px; }
/* Top menu: each section drops down its pages on hover or keyboard focus. */
.navitem { position: relative; display: inline-flex; }
.navdrop { display: none; position: absolute; top: 100%; left: 0; z-index: 50; min-width: 220px; padding: 4px 0; background: var(--card); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.12); flex-direction: column; }
.navitem.has-drop:hover > .navdrop, .navitem.has-drop:focus-within > .navdrop { display: flex; }
nav .navdrop a { padding: 7px 14px; border-radius: 0; font-weight: 400; background: none; }
nav .navdrop a:hover { background: var(--accent-soft); }
nav .navdrop a.active { font-weight: 700; }
.navitem:last-child .navdrop, .navitem:nth-last-child(2) .navdrop { left: auto; right: 0; }
/* Section icons in the top menu; a section with several pages only opens its menu. */
nav a.navtop { display: inline-flex; align-items: center; gap: 5px; padding-left: 7px; padding-right: 7px; cursor: pointer; user-select: none; }
nav a.navtop svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.navitem.open > .navdrop { display: flex; }
nav { gap: 2px; }
.top { gap: 16px; }
nav .navdrop a { display: flex; align-items: center; gap: 9px; }
nav .navdrop a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .75; }
/* Settings menu by the user's name, apart from the work sections. */
.me nav.navme { flex: none; }
.me nav.navme a.navtop { padding: 6px; }
.me nav.navme a.navtop svg { width: 19px; height: 19px; }
/* Brand as a small card. */
a.brand { padding: 4px 12px 4px 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
a.brand:hover { box-shadow: 0 2px 6px rgba(0,0,0,.14); }
.me { gap: 8px; }
.me .who { margin-left: 4px; }
/* Layout switch (by the user's name): the menu on top, or down the left side as in 1C. */
.me nav.navme { display: flex; align-items: center; gap: 2px; }
.layout-btn { width: 30px; height: 30px; }
@media (min-width: 760px) {
  html[data-layout="side"] #nav { position: fixed; left: 0; top: var(--toph, 48px); bottom: 0; width: 200px; z-index: 4;
    flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 8px 0; background: #fbec9f; border-right: 1px solid #e3cf6e; box-sizing: border-box; }
  html[data-layout="side"] #nav .navitem { display: flex; }
  html[data-layout="side"] #nav a.navtop { flex: 1; gap: 12px; padding: 10px 16px; border-radius: 0; font-size: 13.5px; color: #333; }
  html[data-layout="side"] #nav a.navtop svg { width: 22px; height: 22px; stroke-width: 1.6; color: #b5541b; }
  html[data-layout="side"] #nav a.navtop:hover, html[data-layout="side"] #nav .navitem.open > a.navtop { background: #f7df7c; }
  html[data-layout="side"] #nav a.navtop.active { background: #f3d25a; font-weight: 700; }
  /* The pages open to the right of their section. */
  html[data-layout="side"] #nav .navdrop, html[data-layout="side"] #nav .navitem:last-child .navdrop, html[data-layout="side"] #nav .navitem:nth-last-child(2) .navdrop { top: 0; left: 100%; right: auto; }
  html[data-layout="side"] main, html[data-layout="side"] .subnav { margin-left: 200px; }
  html[data-layout="side"] .top { background: #fbec9f; border-bottom-color: #e3cf6e; }
}
@media (min-width: 760px) { html[data-layout="side"] .top > .me { margin-left: auto; } }
/* Room for the layout switch: the search box is narrower until it is used. */
#gsearch { margin-right: 4px; }
#gsearch input { width: 140px; }
/* The brand is the icon alone. */
a.brand { padding: 0; border: 0; background: none; box-shadow: none; }
a.brand img { border-radius: 7px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
a.brand:hover img { box-shadow: 0 2px 6px rgba(0,0,0,.25); }
/* Side menu as narrow as its longest name. */
@media (min-width: 760px) {
  html[data-layout="side"] #nav { width: max-content; }
  html[data-layout="side"] #nav a.navtop { gap: 9px; padding: 9px 14px 9px 12px; font-size: 13px; }
  html[data-layout="side"] #nav a.navtop svg { width: 20px; height: 20px; }
  html[data-layout="side"] main, html[data-layout="side"] .subnav { margin-left: var(--sidew, 170px); }
}
/* Fold button: only in the side menu, at its bottom; folded = icons only. */
.navfold { display: none; }
@media (min-width: 760px) {
  html[data-layout="side"] .navfold { display: flex; align-items: center; justify-content: center; margin-top: auto; border: 0; border-top: 1px solid #e3cf6e; background: none; padding: 10px 0; cursor: pointer; color: #8a6d00; border-radius: 0; }
  html[data-layout="side"] .navfold:hover { background: #f7df7c; }
  html[data-layout="side"] .navfold svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  html[data-layout="side"][data-fold="1"] #nav a.navtop > span { display: none; }
  html[data-layout="side"][data-fold="1"] #nav a.navtop { padding: 10px 13px; }
}
/* Side menu: the section's pages in the top bar, lined up with the page under them. */
html[data-layout="side"] .top > .subnav, .top > .subnav { flex: 1; min-width: 0; background: none; border: 0; padding: 0; margin-left: max(0px, calc(var(--sidew, 0px) - 62px)); }
/* Side menu: settings at its bottom, just above the fold button; its pages open upwards. */
@media (min-width: 760px) {
  html[data-layout="side"] #nav .nav-settings-item { margin-top: auto; border-top: 1px solid #e3cf6e; }
  html[data-layout="side"] #nav .nav-settings-item + .navfold { margin-top: 0; }
  html[data-layout="side"] #nav .navitem.nav-settings-item.has-drop .navdrop { top: auto; bottom: 0; }
  html[data-layout="side"] #nav a.nav-settings { margin-left: 0; color: #333; }
}
/* Kept pages: one shows at a time. */
main > .page[hidden] { display: none; }
.seen-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 6px 12px; font-size: 12.5px; color: #6b5a00; background: #fff6cc; border: 1px solid #ecd77a; border-radius: 4px; }
/* Second row = recently viewed pages (icon + name, the current one in bold). */
.subnav a.rec { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; }
.subnav a.rec span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subnav a.rec svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.subnav { flex-wrap: nowrap; overflow: hidden; }
/* Right-click menu of a tab. */
.tabmenu { position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 190px; padding: 4px 0; background: #fff; border: 1px solid #c8c8c8; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.tabmenu button { border: 0 !important; background: none !important; text-align: left; padding: 7px 14px !important; border-radius: 0 !important; font-size: 13px; color: #333; cursor: pointer; height: auto !important; }
.tabmenu button:hover:not(:disabled) { background: #fce9a5 !important; }
.tabmenu button:disabled { color: #aaa; cursor: default; }
/* Side menu: the open section in colour only, the same weight as the rest. */
@media (min-width: 760px) { html[data-layout="side"] #nav a.navtop.active { font-weight: 400; } }
/* The second row starts right by the logo. */
html[data-layout="side"] .top > .subnav, .top > .subnav { margin-left: 6px; }
/* Reload of the page open now, by the logo. */
.reload-btn { width: 30px; height: 30px; margin-left: -8px; }
.reload-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* A record opened from the day's work: marked for a few seconds. */
tr.focus-hit > td { background: #ffe58a !important; transition: background .6s; }
/* A small table inside a detail (e.g. the goods of a stock document). */
table.mini { width: auto; min-width: 480px; margin-top: 10px; font-size: 12.5px; }
table.mini th, table.mini td { padding: 3px 10px; }
.docs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .docs2 { grid-template-columns: 1fr; } }

/* ---------- part 2: the 1C look and the pages' own rules ---------- */

:root {
  --bg: #f2f2f2;
  --card: #ffffff;
  --text: #333333;
  --muted: #7f7f7f;
  --line: #d4d4d4;
  --accent: #3a6ea5;
  --accent-soft: #eef3f8;
  --ok: #3d8c40;
  --ok-soft: #e6f2e6;
  --warn: #9a6c00;
  --warn-soft: #fff4cc;
  --bad: #c0392b;
  --bad-soft: #fbe5e2;
  --sel: #fdf6d3;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 13px;
  color-scheme: light;
}
body { background: var(--bg); color: var(--text); }

/* Top bar: like the 1C sections panel. */
.top { background: #fbfbfb; border-bottom: 1px solid #c8c8c8; padding: 6px 16px; }
.brand { color: #333; }
.brand span { color: #c8a100; }
:root nav a { border-radius: 2px; color: #333; }
:root nav a.active { background: #fce9a5; color: #333; font-weight: 700; }
.subnav { background: #ececec; border-bottom: 1px solid #c8c8c8; }
:root .subnav a { color: #3a6ea5; text-decoration: underline; border-radius: 0; }
:root .subnav a.active { color: #333; text-decoration: none; font-weight: 700; background: transparent; border: 0; }

/* Forms: square, grey frames. */
.card { border-radius: 2px; border-color: #d4d4d4; box-shadow: none; padding: 12px; }
h1 { font-size: 17px; color: #333; }
h2 { font-size: 14px; color: #333; }
input, select, textarea {
  border-radius: 2px; border-color: #b8b8b8; padding: 4px 6px; background: #fff; color: #333;
}
:root input:focus, select:focus, textarea:focus { outline: 1px solid #f2c200; border-color: #f2c200; }

/* Buttons: light grey gradient; the main one yellow, like "Записать и закрыть". */
:root button {
  border-radius: 3px; border: 1px solid #b8b8b8; color: #333;
  background: linear-gradient(#ffffff, #e9e9e9); padding: 4px 12px;
}
:root button:hover:not(:disabled) { border-color: #8f8f8f; background: linear-gradient(#ffffff, #dedede); }
/* The export buttons: flat and quiet, Excel's green only on its sign. */
:root button.xlsx-btn, :root button.pdf-btn, .tbline .tsec.tend button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; box-sizing: border-box; padding: 0 12px; border: 1px solid #d8d8d0; border-radius: 8px; background: #fff; color: #444; font-weight: 500; white-space: nowrap; }
button.xlsx-btn svg, button.pdf-btn svg { width: 20px; height: 18px; flex: none; }
button.xlsx-btn.small, button.pdf-btn.small { height: 26px; padding: 0 8px; gap: 4px; }
button.xlsx-btn.small svg, button.pdf-btn.small svg { width: 17px; height: 15px; }
button.xlsx-btn:hover:not(:disabled) { border-color: #1d7a46; background: #eef7f1; color: #14573a; }
button.pdf-btn:hover:not(:disabled) { border-color: #c0392b; background: #fdf1ef; color: #8e2a1f; }
.tbline .tsec.tend button:not(.xlsx-btn):not(.pdf-btn):hover:not(:disabled) { border-color: #b8b8b0; background: #f6f6f2; }
:root button.primary { background: linear-gradient(#ffe680, #f9d23c); border-color: #d1a900; color: #333; font-weight: 700; }
button.primary:hover:not(:disabled) { background: linear-gradient(#ffec99, #f5c900); }
button.danger { color: #c0392b; }
:root button.link { background: none; border: 0; color: #3a6ea5; text-decoration: underline; padding: 0; font-weight: 400; }
.msbtn { border-radius: 3px; background: linear-gradient(#ffe680, #f9d23c); color: #333; border: 1px solid #d1a900; }

/* Tables: grid lines, grey header, yellow selection. */
/* Tables: lines between the rows only, a quiet head (solid, it sticks when scrolling), figures in even columns. */
table { border: 0; }
:root th { background: #f7f7f4; color: #6b6b66; font-size: 12px; font-weight: 400; border: 0; border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: bottom; }
:root td { border: 0; border-bottom: 1px solid #ecece8; padding: 5px 8px; }
td.num { font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: #fbfbf7; }
tr.click:hover td { background: #fdf3c7; }
tr.sel td { background: var(--sel) !important; }
table.all-sel tr.sel td { background: none !important; }
table.all-sel tr.sel.click:hover td { background: #fdf3c7 !important; }
th.num { white-space: normal; }
tr.group td { background: #e8eef5 !important; }

/* Summary cards: flat panels. */
.stat { border-radius: 2px; padding: 8px 10px; background: #fff; }
.stat .v { font-size: 16px; }
.stat { border: 1px solid #e2e2dc; border-top: 3px solid #e2e2dc; }
.stat .k { font-size: 11.5px; line-height: 1.25; }
.stat.ok { border-top-color: var(--ok); }
.stat.warn { border-top-color: #e0a800; }
.stat.bad { border-top-color: var(--bad); }
.stat.picked { outline: 2px solid #f2c200; }
.tag { border-radius: 2px; }
.selbar { border-radius: 2px; border-color: #d1a900; background: #fffbe6; }
#toast div { border-radius: 2px; background: #fffbe6; color: #333; border: 1px solid #d1a900; }
#toast div.bad { background: #fbe5e2; color: #c0392b; border-color: #c0392b; }
body.busy::before { background: #f2c200; }
:root .ibtn { border-radius: 2px; background: linear-gradient(#ffffff, #ececec); border-color: #b8b8b8; color: #555; padding: 0; }
:root .ibtn:hover { background: linear-gradient(#fffbe6, #fce9a5); border-color: #d1a900; color: #333; }
tbody tr.fam td { background: #eef3f8; }
tbody tr.fam.click:hover td { background: #fdf3c7; }

/* 1C skin: the page toolbar is one light bar; its groups are split by thin lines and sit on
   one baseline. Update and export keep to the right; on a narrow screen they wrap inside the bar. */
.toolbar { background: #f7f7f4; border: 1px solid #e2e2dc; border-radius: 4px; padding: 8px 14px 10px; gap: 10px 0; align-items: flex-end; margin-top: 10px; }
.tgroup { border: 0; border-left: 1px solid #e2e2dc; background: none; padding: 0 16px; border-radius: 0; justify-content: flex-end; gap: 4px; }
.tgroup:first-child { padding-left: 0; border-left: 0; }
.tright { gap: 10px 0; align-items: flex-end; }
.tright > .tgroup:first-child { border-left: 1px solid #e2e2dc; padding-left: 16px; }
.tright > .tgroup:last-child { padding-right: 0; }
.tcap { text-transform: uppercase; letter-spacing: .05em; color: #9a9a92; font-size: 10.5px; font-weight: 600; }
.tbody { gap: 6px 8px; align-items: flex-end; }
.tbody label, .tdates label { font-size: 11.5px; color: #77776f; gap: 2px; }
.tbody input, .tbody select, .tdates input { height: 30px; box-sizing: border-box; }
.tbody button, .tbody a.sync-link { height: 30px; box-sizing: border-box; display: inline-flex; align-items: center; }
.tperiod .tbody { gap: 6px; }
.chips { gap: 4px; }
:root .chips button.small { padding: 2px 9px; height: 24px; font-size: 12px; border-radius: 12px; background: #fff; border: 1px solid #d8d8d0; color: #555; }
.chips button.small:hover { background: #fffbe6; border-color: #d1a900; color: #333; }
.card > .toolbar:last-child { margin-bottom: 0; }
@media (max-width: 760px) {
  .tgroup, .tright > .tgroup:first-child { border-left: 0; padding: 0; }
}
/* Wide screens: one row; the filter group gives way (its controls wrap inside it) so update
   and export stay on the right of the same row. */
@media (min-width: 1000px) {
  .toolbar { flex-wrap: nowrap; }
  .tgroup { flex: 0 0 auto; }
  .tgroup.tfilter { flex: 0 1 auto; min-width: 200px; }
  .tright { flex: 0 0 auto; flex-wrap: nowrap; }
  .tfilter select { max-width: 240px; }
  /* A wide field shrinks with its group instead of spilling into the next one. */
  .tfilter .tbody > label.grow { min-width: 0; max-width: 100%; flex: 1 1 100%; }
  .tfilter .tbody > label > select { max-width: 100%; width: 100%; }
  .tfilter input[type="search"] { max-width: 220px; }
}
/* Toolbar proportions (every page). The dates span the width of the quick buttons under them; on a
   wide screen the bar is a grid: period | filter (takes the room left, never under 220px) | update +
   export, one row, with a wide filter field (an account) and its "show" button side by side, as tall
   as the other buttons. */
.tperiod .tbody { align-items: stretch; }
.tdates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tdates input { width: 100%; }
@media (min-width: 1000px) {
  .toolbar { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; grid-template-areas: "p f r"; align-items: end; }
  .tgroup.tperiod { grid-area: p; }
  .tgroup.tfilter { grid-area: f; min-width: 0; }
  .toolbar > .tright { grid-area: r; margin-left: 0; }
  .tperiod .chips { display: grid; grid-template-columns: 1fr 1fr; }
  .tperiod .chips button.small { width: 100%; justify-content: center; }
  /* Beside its button when there is room (200px and more), above it when there is not. */
  .tfilter .tbody { flex-wrap: wrap; }
  .tfilter .tbody > label.grow { flex: 1 1 200px; min-width: 200px; max-width: 520px; }
  .tfilter .tbody > label > select { width: 100%; max-width: 100%; }
}
/* Show and update in one group: the update buttons after the filters, a little apart. */
.tfilter .tupd { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: flex-end; margin-left: 10px; }
/* Button text on one line; on a narrower screen the update buttons go under the filters in the same
   group, on a wide one they stay on the filters row. */
.toolbar button, .toolbar a.sync-link { white-space: nowrap; }
@media (min-width: 1000px) {
  .tfilter .tbody { flex-wrap: wrap; }
  .tfilter .tupd { flex-wrap: nowrap; }
}
/* Two rows on every screen: the filters with "show" on the first, the update buttons on the second. */
.tfilter .tbody { flex-wrap: wrap; }
.tfilter .tupd { flex: 1 0 100%; margin-left: 0; }
/* Wide screen: "show and update" rows line up with the period's rows - the account with the
   dates, the update buttons at the bottom with the quick period buttons. */
@media (min-width: 1000px) {
  .tgroup.tfilter { align-self: stretch; justify-content: flex-start; }
  .tfilter .tbody { flex: 1 1 auto; align-content: space-between; }
}
/* Period in two rows (all widths): the dates, then the four quick buttons in one row, as tall as
   the update buttons beside them. */
.tperiod .chips { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; flex-wrap: nowrap; }
.tperiod .chips button.small { width: 100%; height: 30px; box-sizing: border-box; justify-content: center; display: inline-flex; align-items: center; white-space: nowrap; }
@media (max-width: 640px) {
  .tperiod .chips { grid-template-columns: 1fr 1fr; }
}
/* Not enough room for three groups side by side: export moves under them, on the right. */
@media (min-width: 1000px) and (max-width: 1249px) {
  .toolbar { grid-template-columns: auto minmax(220px, 1fr); grid-template-areas: "p f" "r r"; }
  .toolbar > .tright { justify-self: end; }
}
/* Wide screen: export lines up too - its caption with the other captions, its buttons with the
   update buttons. A filter row without a captioned field (only "show" or a tick box) drops to the
   level of the dates. */
@media (min-width: 1000px) {
  .toolbar > .tright { align-self: stretch; }
  .tright > .tgroup.texport { align-self: stretch; justify-content: space-between; }
  .tfilter .tbody:not(:has(> label:not(.check))) { padding-top: 20px; }
}
.navdrop { background: #fff; border-color: #c8c8c8; border-radius: 2px; }
:root nav .navdrop a { color: #333; }
nav .navdrop a:hover { background: #fce9a5; }
nav .navdrop a.active { background: none; }
a.brand { background: #fffbe8; border-color: #e8cf6a; }
@media (min-width: 760px) {
  :root[data-layout="side"] .top { background: #fbec9f; border-bottom-color: #e3cf6e; }
}
a.brand { background: none; border: 0; }
.top > .subnav { background: none; border: 0; }
/* Recently viewed pages as small cards; the current one stands out in yellow. */
.subnav { gap: 6px; align-items: center; }
:root .subnav a.rec { padding: 4px 10px; background: #fff; border: 1px solid #d9d4bd; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.08);
  color: #333; text-decoration: none; font-weight: 400; font-size: 12.5px; }
:root .subnav a.rec:hover { border-color: #d1a900; box-shadow: 0 2px 5px rgba(0,0,0,.12); }
:root .subnav a.rec.active { background: #fce9a5; border-color: #d1a900; font-weight: 700; }
.subnav a.rec svg { color: #b5541b; opacity: 1; }
/* ✕ on a tab. */
.subnav a.rec .rec-x { border: 0; background: none; padding: 0 2px; margin-left: 2px; height: auto; font-size: 11px; line-height: 1; color: #9a9a8f; cursor: pointer; border-radius: 3px; }
.subnav a.rec .rec-x:hover { color: #fff; background: #c0392b; }
/* Tabs: the same weight for all (no size change); the open one in colour, the rest faded. */
:root .subnav a.rec, :root .subnav a.rec.active { font-weight: 400; }
:root .subnav a.rec { color: #8a8a80; background: #fafaf6; border-color: #e2ded0; box-shadow: none; }
.subnav a.rec svg { color: #b0aa95; }
:root .subnav a.rec:hover { color: #333; background: #fff; }
.subnav a.rec:hover svg { color: #b5541b; }
:root .subnav a.rec.active { color: #222; background: #fce9a5; border-color: #d1a900; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.subnav a.rec.active svg { color: #b5541b; }
.subnav a.rec.dragging { opacity: .4; }
.subnav a.rec.drop { outline: 2px dashed #d1a900; outline-offset: 1px; }
.subnav a.rec { cursor: pointer; }
/* The pinned tab (the day's work): a pin instead of the x. */
.subnav a.rec .rec-pin { display: inline-flex; margin-left: 2px; }
.subnav a.rec .rec-pin svg { width: 11px; height: 11px; opacity: .55; }

/* "showing only: <card>" bar under the cards, with a way back to the full list */
.pick-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 6px 10px; background: #fffbe6; border: 1px solid #f2c200; border-radius: 4px; font-size: 13px; }
.pick-bar button.small { margin-left: auto; }

/* One-line toolbar (toolbarLine): month picker | filters | update | export, all 32px, no group captions */
.tbline { display: flex; flex-wrap: wrap; align-items: center; row-gap: 8px; background: #f7f7f4; border: 1px solid #e2e2dc; border-radius: 4px; padding: 8px 4px; margin-top: 10px; }
.tbline .tsec { display: flex; align-items: center; gap: 6px; padding: 0 10px; border-left: 1px solid #e2e2dc; }
.tbline .tsec:first-child { border-left: 0; }
.tbline .tsec.tend { margin-left: auto; }
:root .tbline button, .tbline a.sync-link { height: 32px; box-sizing: border-box; white-space: nowrap; display: inline-flex; align-items: center; }
/* a field with its caption inside the box */
label.fld { margin: 0; display: inline-flex; align-items: center; gap: 6px; height: 32px; box-sizing: border-box; padding: 0 8px; background: #fff; border: 1px solid #c9c9bf; border-radius: 4px; font-size: 13px; }
label.fld > span { font-size: 11.5px; color: #8a887f; white-space: nowrap; }
:root label.fld input, label.fld select { border: 0; outline: 0; background: none; height: 28px; padding: 0; margin: 0; font: inherit; box-shadow: none; min-width: 0; }
label.fld:focus-within { border-color: #d1a900; }
/* month picker */
.mp { position: relative; display: inline-flex; gap: 4px; align-items: center; }
:root .mp-arrow { width: 28px; padding: 0; justify-content: center; font-size: 16px; }
:root .mp-main { width: 270px; gap: 6px; justify-content: space-between; font-weight: 600; background: #fff; }
.mp-main svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: #b5541b; }
.mp-label { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-caret { color: #8a887f; font-size: 11px; }
.mp-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 350px; background: #fff; border: 1px solid #c9c9bf; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 12px; }
.mp-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; user-select: none; }
:root .mp-mon { height: 34px; justify-content: center; background: #f6f6f1; border: 1px solid transparent; }
:root .mp-mon:hover { border-color: #d1a900; }
:root .mp-mon.in { background: #fff6cc; border-color: #f0dc8a; }
:root .mp-mon.end { background: #f2c200; border-color: #d1a900; font-weight: 600; }
.mp-mon.fut { color: #b8b6ad; }
.mp-hint { font-size: 11.5px; color: #8a887f; margin: 8px 0; }
.mp-pop .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.mp-pop .chips button.small { height: 26px; }
.mp-exact { display: flex; gap: 6px; align-items: center; border-top: 1px solid #e2e2dc; padding-top: 8px; font-size: 12px; color: #8a887f; }
.mp-exact input { height: 28px; width: 128px; }
.mp-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
/* status segmented control + view, on the table's top-left */
.tbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 8px; }
.seg { display: inline-flex; flex-wrap: wrap; min-height: 32px; box-sizing: border-box; border: 1px solid #c9c9bf; border-radius: 4px; overflow: hidden; background: #fff; }
:root .seg button { height: 30px; border: 0; border-left: 1px solid #e2e2dc; border-radius: 0; background: none; padding: 0 11px; gap: 6px; display: inline-flex; align-items: center; white-space: nowrap; font-weight: 400; color: #333; }
.seg button:first-child { border-left: 0; }
:root .seg button:hover { background: #fffbe6; }
:root .seg button.on { background: #f2c200; font-weight: 600; }
.seg .n { font-variant-numeric: tabular-nums; font-weight: 600; }
.seg .s { font-size: 11.5px; color: #8a887f; font-variant-numeric: tabular-nums; }
.seg button.on .s { color: #6b5300; }
.seg .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #b8b6ad; }
.seg .dot.bad { background: #c0392b; } .seg .dot.ok { background: #2e7d32; } .seg .dot.warn { background: #d68910; }
/* status bar: "differences | all" segment, then error pills, then quiet neutral pills; the view goes right */
.statusbar { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px 6px; align-items: center; }
.tbar { gap: 8px 14px; flex-wrap: nowrap; align-items: flex-start; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill-sep { width: 1px; height: 22px; background: #d8d8d0; }
:root .statusbar button.pill { height: 32px; box-sizing: border-box; padding: 0 10px; gap: 6px; border: 1px solid #d8d8d0; border-radius: 16px; background: #fff; font-weight: 400; color: #333; display: inline-flex; align-items: center; white-space: nowrap; }
.statusbar button.pill:hover { background: #fffbe6; border-color: #d1a900; }
.statusbar button.pill.on { background: #f2c200; border-color: #d1a900; font-weight: 600; }
.statusbar button.pill.calm:not(.on) { color: #77756c; background: #fafaf6; }
.statusbar .n, .seg .n { font-variant-numeric: tabular-nums; font-weight: 600; }
.statusbar .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #b8b6ad; }
.statusbar .dot.bad { background: #c0392b; } .statusbar .dot.warn { background: #d68910; } .statusbar .dot.ok { background: #2e7d32; }
:root .seg button { gap: 6px; }
/* note beside a page title (h1 data-note) */
h1 .h1-note { font-size: 13px; font-weight: 400; color: #8a887f; margin-left: 14px; }
/* checkboxes and plain buttons in the one-line bar sit on the same 32px line */
.tbline label.check { margin: 0; height: 32px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; color: #333; }
.tbline .tsec { flex-wrap: wrap; row-gap: 6px; }
label.fld select { max-width: 340px; }
/* table card head: "last update" on the left, the view on the right */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head > p { margin: 0; }
/* pills made from filter cards (pillBars) */
.statusbar.pillbar { margin: 4px 0 12px; }
:root .statusbar button.pill { gap: 6px; }
.statusbar button.pill .n { margin-left: 2px; }
/* a pill that only informs (no click) */
.statusbar span.pill.static { height: 32px; box-sizing: border-box; padding: 0 10px; gap: 6px; border: 1px dashed #d8d8d0; border-radius: 16px; color: #77756c; background: #fafaf6; display: inline-flex; align-items: center; white-space: nowrap; cursor: default; }
/* two-line bar (rows: 2): period + filters, then update + export; rows share the section rules */
.tbline.two { flex-direction: column; align-items: stretch; gap: 8px; }
.tbline.two .tbrow { display: flex; flex-wrap: wrap; align-items: center; row-gap: 8px; }
.tbline.two .tbrow .tsec:first-child { border-left: 0; }
.tbline .tsec label.grow { flex: 1; min-width: 260px; }
.tbline.two .tbrow:first-child > .tsec:nth-child(2) { flex: 1; }
.tbline .tsec label.grow select { max-width: none; flex: 1; }
/* (i) by the page title: shows / hides the page description */
:root .info-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; margin-left: 8px; vertical-align: middle; border: 0; border-radius: 50%; background: none; color: #8a887f; cursor: pointer; }
.info-btn:hover, .info-btn.on { background: #fff6cc; color: #b5541b; }
.info-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
:is(h1, h2, h3, .th-tip, b):has(> .info-btn) { position: relative; }
:is(h1, h2, h3, .th-tip) > p.page-info { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: min(720px, calc(100vw - 48px)); margin: 0; background: #fffbe6; border: 1px solid #e8cf6a; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px 14px; color: #444; font-size: 13px; font-weight: 400; line-height: 1.55; white-space: normal; }
/* summary cards as one quiet line (pillBars) */
.sumline { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: baseline; margin: 6px 0 10px; font-size: 13px; color: #666; }
.sumline .sum-item { white-space: nowrap; }
.sumline .sum-item + .sum-item::before { content: "·"; margin: 0 10px; color: #b8b6ad; }
.sumline .k { color: #8a887f; }
.sumline .v { color: #333; font-weight: 600; font-variant-numeric: tabular-nums; }
.sumline .v.bad { color: #c0392b; } .sumline .v.warn { color: #b9770e; }

/* (i) on a table column head: the pop-over opens to the left, under the head */
.th-tip { position: relative; display: inline-flex; align-items: center; }
.th-tip .info-btn { width: 18px; height: 18px; margin-left: 4px; }
.th-tip .info-btn svg { width: 14px; height: 14px; }
.th-tip > p.page-info { left: auto; right: 0; width: min(520px, calc(100vw - 48px)); text-align: left; text-transform: none; }
/* VAT declaration typed in its cell */
.decl-form { display: grid; gap: 6px; min-width: 210px; }
.decl-form label { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; font-size: 12px; }
.decl-form label span { color: #8a887f; font-size: 11.5px; }
.decl-form input { height: 28px; text-align: right; }
.decl-form small { color: #8a887f; font-size: 11px; }
.decl-form .row { gap: 6px; }
/* the global search: narrow (about the word "search") until clicked, wide while typing */
:root #gsearch input { width: 98px; transition: width .15s; }
#gsearch input:focus, #gsearch input:not(:placeholder-shown) { width: 200px; }

/* Printing a page (Ctrl+P / Save as PDF): A4, only the page's content. Exports with their own
   print window (act, month close) use printDoc in app.js. */
@page { size: A4; margin: 12mm 10mm 14mm; @bottom-center { content: counter(page) " / " counter(pages); font: 8pt "Segoe UI", Sylfaen, Arial, sans-serif; color: #666; } }
@media print {
  html, body { background: #fff !important; }
  body { font-size: 9pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header.top, #subnav, #nav, .navdrop, #toast, .modal, .seen-bar, .tbline, .toolbar, .tbar, .pillbar, .info-btn, .page-info, .more-row, button, .sync-link { display: none !important; }
  main, #main, html[data-layout] main, html[data-layout] #main { margin: 0 !important; padding: 0 !important; max-width: none !important; width: auto !important; }
  .card { border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 0 8px !important; background: none !important; }
  .scroll { overflow: visible !important; max-height: none !important; }
  table { width: 100% !important; font-size: 8pt !important; border-collapse: collapse !important; }
  thead { display: table-header-group; } tr { break-inside: avoid; }
  th, td { padding: 2px 4px !important; position: static !important; border: 1px solid #bbb !important; }
  thead th { background: #ececec !important; }
  h1 { font-size: 13pt !important; margin: 0 0 6px !important; } h2, h3 { font-size: 10.5pt !important; break-after: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}
/* mail settings: one option per block */
.mail-opt { margin: 6px 0 10px; }
.mail-opt p.sub { margin: 2px 0 0 26px; max-width: 900px; }

/* Mail page: who gets a manager's clients' payments, typed in place. */
.mail-to-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
input.mail-to { flex: 1; min-width: 220px; height: 26px; padding: 2px 6px; margin: 0; }

/* Users page: avatar + name, edit row, buttons on one line. */
table.users td { vertical-align: middle; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #e8e8e8; color: #555; font-weight: 700; font-size: 12px; position: relative; }
.avatar.on { background: #fce9a5; color: #333; }
.avatar.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; }
tr.user-off td { color: var(--muted); }
tr.user-off .avatar { opacity: .5; }
.ubtns { white-space: nowrap; text-align: right; width: 1%; }
.ubtns button + button { margin-left: 4px; }
.nowrap { white-space: nowrap; }
.user-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; align-items: end; padding: 4px 0; }
.user-edit label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #666; }
/* Access rights (users page): a profile per column, a right per row; one user's rights under their row. */
table.rights th.chk, table.rights td.chk { text-align: center; }
table.rights th.chk input[type="text"], table.rights th.chk input:not([type]) { width: 9em; }
table.rights th.chk .row { justify-content: center; gap: 4px; margin-top: 3px; }
.rights-edit { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.rights-edit > .row { flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.user-add { background: var(--accent-soft); border: 1px solid var(--line); padding: 10px 12px; margin-bottom: 10px; }
button.linklike { background: none; border: 0; padding: 0; height: auto; color: var(--accent); cursor: pointer; text-decoration: underline dotted; }

/* E-mail page: one card per automatic mail with an on / off switch. */
.mail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; }
.mail-card { border-left: 4px solid #d4d4d4; }
.mail-card.on { border-left-color: var(--ok); }
.mail-card h2 { margin: 0; }
.mail-card > p { margin: 4px 0 10px; color: #555; }
.mail-meta { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #eee; padding-top: 8px; }
.switch { flex-direction: row; white-space: nowrap; margin: 0; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .knob { width: 36px; height: 20px; border-radius: 10px; background: #c9c9c9; position: relative; transition: background .15s; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
.switch.on .knob { background: var(--ok); }
.switch.on .knob::after { left: 18px; }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .sw-text { font-size: 12px; color: #666; }
.switch.on .sw-text { color: var(--ok); font-weight: 600; }
.chips { gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { flex-direction: row; white-space: nowrap; width: auto; margin: 0; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #ccc; border-radius: 12px; padding: 2px 10px; cursor: pointer; font-size: 12px; background: #fff; }
.chip input { margin: 0; }
.chip.on { background: #fce9a5; border-color: #e0c45c; }
/* A card that folds (backup ways on the sync page). */
details.card.fold > summary { cursor: pointer; list-style: revert; padding: 2px 0; }
details.card.fold[open] > summary { margin-bottom: 8px; }

/* System check page: a banner with the verdict, then one foldable line per check. */
.hc-banner { display: flex; align-items: center; gap: 16px; border-left: 5px solid var(--ok); }
.hc-banner.warn { border-left-color: #d68910; }
.hc-banner.bad { border-left-color: var(--bad); }
.hc-banner h2 { margin: 0 0 2px; }
.hc-big { flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff; background: var(--ok); }
.hc-banner.warn .hc-big { background: #d68910; }
.hc-banner.bad .hc-big { background: var(--bad); }
.hc-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.hc-list > .hc { border: 1px solid var(--line); border-left: 4px solid var(--ok); background: #fff; }
.hc-list > .hc.warn { border-left-color: #d68910; }
.hc-list > .hc.bad { border-left-color: var(--bad); }
.hc-list > .hc > .hc-head { padding: 8px 12px; }
.hc-title[title] { cursor: help; }
.hc-items { list-style: none; padding-left: 0; }
.hc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hc-title { flex: 1; min-width: 200px; }
.hc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.hc-dot.warn { background: #d68910; } .hc-dot.bad { background: var(--bad); }
.hc-body { padding: 0 12px 10px 31px; }
.hc-body > p { margin: 0 0 6px; }
.hc-ex { margin: 4px 0 8px; padding-left: 18px; font-variant-numeric: tabular-nums; }
.hc-fix { background: var(--warn-soft); padding: 6px 10px; border-radius: 2px; }

input.mgr-search { flex: 1; min-width: 220px; max-width: 360px; height: 30px; }
/* Mail page: typed recipients as chips with ✕, an explicit add form. */
.mail-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 4px 1px 9px; border: 1px solid #c9d6e5; border-radius: 12px; background: var(--accent-soft); color: #234; font-size: 12px; }
.mail-chip .chip-x { border: 0; background: none; padding: 0 4px; height: auto; min-width: 0; color: #7a8899; cursor: pointer; font-size: 11px; }
.mail-chip .chip-x:hover { color: var(--bad); }
.mail-add { display: inline-flex; gap: 6px; align-items: center; flex: 1; min-width: 300px; }
/* Managers table: columns keep their width when the add form opens. */
table.mgr-table { table-layout: fixed; width: 100%; }
table.mgr-table col.c-name { width: 260px; }
table.mgr-table col.c-n { width: 90px; }
table.mgr-table td { vertical-align: middle; overflow-wrap: anywhere; }
.mail-add { flex: 0 1 auto; min-width: 0; }
.mail-add input.mail-to { flex: 0 1 260px; width: 260px; min-width: 160px; }
/* 1C users: documents per day as small bars. */
.daybars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 16px; overflow-x: auto; }
.daybar { position: relative; flex: 1 0 18px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.daybar i { display: block; width: 100%; background: #f2c200; border-radius: 2px 2px 0 0; min-height: 2px; }
.daybar.we i { background: #d9c48a; }
.daybar .n { font-size: 10px; color: #777; }
.daybar .d { font-size: 10px; color: #777; margin-top: 2px; }
.daybars.hours { height: 110px; }
tr.picked-row td { background: #fff4cc; }
/* Tables whose columns must not move when the content changes (1C users). */
table.fixed-cols { table-layout: fixed; width: 100%; min-width: 900px; }
table.fixed-cols th { white-space: normal; overflow-wrap: anywhere; }
td.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* On/off filter button (returns: wooden pallets only). */
:root button.toggle-btn { height: 32px; box-sizing: border-box; padding: 0 12px; border: 1px solid #d8d8d0; border-radius: 16px; background: #fff; color: #333; font-weight: 400; white-space: nowrap; }
:root button.toggle-btn.on { background: #f2c200; border-color: #d1a900; font-weight: 600; }
button.toggle-btn.on::before { content: "✓ "; }
.cp-sides { display: inline-flex; gap: 6px; flex: none; }
.stack-doc { padding: 6px 0; border-bottom: 1px solid #e6e6df; }

/* "Update all": one line per source, compact rows; the head row: button, start date, last automatic run. */
.upd-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upd-head > p { margin: 0; flex: 1; min-width: 260px; }
table.upd-table td { padding-top: 3px; padding-bottom: 3px; vertical-align: middle; }
table.upd-table .tag { white-space: nowrap; }
table.upd-table .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b8b6ad; vertical-align: middle; }
table.upd-table .dot.ok { background: #2e7d32; } table.upd-table .dot.warn { background: #d68910; } table.upd-table .dot.bad { background: #c0392b; }

/* System check: checks grouped by what they look at, one line each. */
.hc-group { margin-top: 10px; }
.hc-gname { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 4px 2px; }
.hc-group .hc-list { margin-top: 0; gap: 4px; }
/* Returns: a sale with nothing left to return. */
.tag.done { background: #4a4a4a; color: #fff; border-color: #4a4a4a; }

/* Balances: one account's days under its row. */
.bal-days { padding: 6px 4px 8px; }
table.bal-table { min-width: 0; max-width: 900px; }
table.bal-table td { padding-top: 3px; padding-bottom: 3px; }

/* Conversions: a leg on one line (amount, then the account small). */
.conv-leg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.conv-table td { vertical-align: top; }


/* Costs: category path ("all > tiles > 6 cm") and the next level as pills, instead of a long drop-down. */
.catnav { margin: 4px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.catnav .crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.catnav .crumb { background: none; border: 0; padding: 2px 4px; color: #2a5db0; cursor: pointer; font: inherit; min-height: 0; }
.catnav .crumb:hover { text-decoration: underline; }
.catnav .crumb.on { color: inherit; font-weight: 600; cursor: default; text-decoration: none; }
.catnav .sep { color: var(--muted); }
.catnav .catpills { display: flex; flex-wrap: wrap; gap: 6px; }

/* A table with grouped columns: the parent cell over its children. */
table.grouped thead th.group-head { text-align: center; border-bottom: 1px solid #d8d6cc; font-weight: 600; }

/* Costs: production check against 1C (numbers, then both totals as bars on one scale). */
.cost-cmp .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.kpi { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfbf8; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi.bad { border-color: #e8b4ad; background: var(--bad-soft); } .kpi.bad .v { color: var(--bad); }
.kpi.ok { border-color: #b9d9ba; background: var(--ok-soft); } .kpi.ok .v { color: var(--ok); }
.cmp-rows { display: flex; flex-direction: column; gap: 8px; }
.cmp-row { display: grid; grid-template-columns: 48px 1fr 120px; align-items: center; gap: 10px; }
.cmp-name { font-size: 12px; color: var(--muted); font-weight: 600; }
.cmp-sum { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cmp-bar { display: flex; height: 18px; border-radius: 5px; background: #efeee9; overflow: hidden; }
.cmp-bar .seg { height: 100%; } .cmp-bar .seg + .seg { border-left: 2px solid #fff; }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 2px 58px; font-size: 12px; color: #555; }
.cmp-legend .lg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cmp-legend b { font-variant-numeric: tabular-nums; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.s0 { background: #3a6ea5; } .s1 { background: #6fa0d0; } .s2 { background: #9cc0e2; }
.s3 { background: #c4daef; } .s4 { background: #d9a520; } .s5 { background: #ecd28a; }
.cost-cmp p.warn { color: var(--warn); margin-top: 8px; }
@media (max-width: 600px) { .cmp-row { grid-template-columns: 40px 1fr; } .cmp-sum { display: none; } .cmp-legend { margin-left: 0; } }

/* Costs: categories as tiles (sales and share, margin, check against 1C); a click filters the table. */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.cat-tile { display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; min-height: 0; transition: border-color .12s, box-shadow .12s; }
.cat-tile:hover, .cat-tile:focus-visible { border-color: #d9a520; box-shadow: 0 2px 8px rgba(0,0,0,.08); outline: none; }
.ct-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ct-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-n { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ct-rev { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; }
.ct-share { font-size: 12px; font-weight: 400; color: var(--muted); }
.ct-bar { height: 5px; border-radius: 3px; background: #efeee9; overflow: hidden; }
.ct-bar span { display: block; height: 100%; background: #d9a520; }
.ct-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.ct-foot b { font-variant-numeric: tabular-nums; }

/* Costs: the category picker in the toolbar (path on a button, folder tree in a popover). */
.cp-main { width: 240px; }
.cp-main.picked { background: #fff6cc; border-color: #d1a900; }
.cp-pop { width: 380px; padding: 8px; }
.cp-pop input[type=search] { width: 100%; margin-bottom: 6px; }
.cp-list { max-height: 360px; overflow: auto; display: flex; flex-direction: column; }
.cp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%; height: auto; min-height: 30px;
  padding: 5px 8px; border: 0; border-radius: 4px; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cp-row:hover { background: #f6f6f1; }
.cp-row.on { background: #fff6cc; font-weight: 600; }
.cp-row.cp-top { font-weight: 600; } .cp-row.cp-sub { padding-left: 24px; }
.cp-row.cp-all { color: #2a5db0; border-bottom: 1px solid #eee; border-radius: 0; }
.cp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-n { font-size: 11.5px; color: var(--muted); font-weight: 400; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Tiles: the chosen subcategory among its siblings; back to all. */
.cat-tile.on { border-color: #d1a900; background: #fffaf0; box-shadow: inset 0 0 0 1px #d1a900; }
.crumb-back { background: none; border: 0; color: #2a5db0; cursor: pointer; font: inherit; padding: 2px 4px; min-height: 0; height: auto; }
.crumb-back:hover { text-decoration: underline; }
/* Products table: quiet dashes, the sales amount stronger, a line between the column groups. */
.dash { color: #c9c7be; }
td.num.strong { font-weight: 600; }
table.grouped td.gstart { border-left: 1px solid #e6e4dc; }

/* Costs: a unit cost by recipe far from 1C's. */
td.num.warn { color: #9a6c00; font-weight: 600; }

/* Delivery request form (logistics): one column on a phone, the goods as cards with big number fields. */
.lg-form h2 { margin-top: 0; }
.lg-form .row { flex-wrap: wrap; gap: 8px; align-items: center; }
.lg-pick { display: block; width: 100%; text-align: left; margin: 4px 0; padding: 8px 10px; }
.lg-order { padding: 8px 10px; background: #fff8d6; border: 1px solid #e6d27a; border-radius: 4px; margin: 8px 0; }
.lg-lines { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.lg-line { display: grid; grid-template-columns: 1fr 96px 120px; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid #ecece8; }
.lg-line-head { padding: 0 2px 4px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.lg-lab { display: none; }
.lg-line label, .lg-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #666; }
.lg-num { width: 100%; font-size: 16px; padding: 6px; }
.lg-wide { width: 100%; box-sizing: border-box; }
.lg-field { margin: 8px 0; }
.lg-row { display: flex; gap: 12px; flex-wrap: wrap; }
.lg-time { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.lg-check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.lg-sum { margin: 10px 0; padding: 8px 10px; background: #f4f7fb; border-left: 3px solid #4a78b5; display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 640px) {
  .lg-line { grid-template-columns: 1fr 1fr; }
  .lg-line .lg-goods { grid-column: 1 / -1; }
  .lg-form input, .lg-form select, .lg-form textarea { font-size: 16px; }
  .lg-row > .lg-field { flex: 1 1 140px; }
}

/* The preliminary plan: a column per vehicle, a card per trip (the board's start). */
/* The vehicles of a day: columns keep their size when a status changes; details only for a vehicle that works. */
.lg-daybar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 12px 16px; }
.lg-dayname { display: flex; flex-direction: column; padding-right: 8px; }
.lg-dayname b { font-size: 15px; }
.lg-dayname span, .lg-stat span { font-size: 12px; color: var(--muted); }
.lg-stat { display: flex; flex-direction: column; }
.lg-stat b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lg-statsep { width: 1px; align-self: stretch; background: var(--line); }
.lg-dayhint { margin-left: auto; font-size: 12px; color: #7a5a00; text-align: right; }
table.lg-days { table-layout: fixed; width: calc(100% - 2px); min-width: 1200px; border-collapse: collapse; }
table.lg-days .w-veh { width: 150px; }
table.lg-days .w-cap { width: 310px; }
table.lg-days .w-radio { width: 395px; }
table.lg-days th { background: none; border: 0; border-bottom: 1px solid var(--line); padding: 4px 12px 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
table.lg-days td { background: none; border: 0; border-bottom: 1px solid #eeeee8; padding: 9px 12px; vertical-align: middle; overflow-wrap: anywhere; }
table.lg-days tbody tr:hover td { background: #fbfbf6; }
table.lg-days tbody tr:last-child td { border-bottom: 0; }
table.lg-days tr.st-ok td:first-child { box-shadow: inset 3px 0 0 #2e8b3d; }
table.lg-days tr.st-warn td:first-child { box-shadow: inset 3px 0 0 #f2c200; }
table.lg-days tr.st-bad td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
table.lg-days tr.st-bad .lg-plate, table.lg-days tr.st-bad td.sub { color: var(--muted); }
.lg-plate { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg-radio { display: inline-flex; gap: 4px; vertical-align: middle; }
.lg-radio label { position: relative; display: flex; align-items: center; height: 28px; box-sizing: border-box; margin: 0; padding: 0 11px; border: 1px solid #dcdcd4; border-radius: 14px; background: #fff; color: #666; font-size: 12px; cursor: pointer; white-space: nowrap; }
.lg-radio label:hover { border-color: #b5b5aa; color: #222; }
.lg-radio input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lg-radio input:disabled { cursor: default; }
.lg-radio label:focus-within { outline: 2px solid #4a78b5; outline-offset: 1px; }
.lg-radio label.on { font-weight: 600; border-color: transparent; }
.lg-radio label.on.ok { background: #2e8b3d; color: #fff; }
.lg-radio label.on.warn { background: #f2c200; color: #222; }
.lg-radio label.on.bad { background: #c0392b; color: #fff; }
.lg-det { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lg-det input, .lg-det select { height: 28px; box-sizing: border-box; font-size: 12px; }
.lg-det .lg-t { width: 96px; }
span.time24 { display: inline-flex; align-items: center; gap: 3px; flex: none; font-variant-numeric: tabular-nums; }
.lg-det span.time24.lg-t { width: auto; }
.lg-det .lg-load { width: auto; flex: none; }
.lg-plants { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.lg-plants label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
span.time24 select { width: auto; min-width: 58px; }
.lg-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.lg-acts-sep { width: 1px; align-self: stretch; background: #ddd; margin: 0 4px; }
.lg-det .lg-p { width: 90px; }
.lg-det .lg-tr { width: 165px; }
.lg-det .lg-n { flex: 1 1 120px; min-width: 100px; }
@media (max-width: 759px) {
  table.lg-days, table.lg-days tbody, table.lg-days tr, table.lg-days td { display: block; width: auto; min-width: 0; }
  table.lg-days thead { display: none; }
  table.lg-days tr { padding: 8px 0; border-bottom: 1px solid #eeeee8; }
  table.lg-days td { border: 0; padding: 3px 10px; }
  .lg-det input, .lg-det select { height: 34px; font-size: 16px; }
  .lg-radio { flex-wrap: wrap; }
  .lg-det .lg-t { width: 130px; }
}
/* The panel's vehicles and places: short lists, what is filled most is edited in place. */
table.lg-ref td { padding: 7px 12px; vertical-align: middle; }
table.lg-ref th { padding-left: 12px; padding-right: 12px; }
table.lg-ref .tag { margin-right: 4px; }
.lg-in input, .lg-in select { height: 28px; box-sizing: border-box; font-size: 12px; max-width: 190px; }
.lg-in.lg-short input { width: 84px; font-size: 12px; padding: 3px 6px; }
.saved { box-shadow: 0 0 0 2px #7cc48a; }
.lg-in input.need { border-color: #e0a400; background: #fffbea; }
.lg-src { white-space: nowrap; }
/* The delivery requests: a short list and a form that reads top to bottom. */
table.lg-req td { padding: 7px 10px; vertical-align: middle; }
table.lg-req th { padding-left: 10px; padding-right: 10px; }
table.lg-req .lg-plate { font-weight: 500; }
.lg-act { white-space: nowrap; text-align: right; }
.lg-reqform .lg-order { background: #fafaf4; border: 0; border-left: 3px solid #f2c200; border-radius: 0; }
.lg-reqform .lg-num { font-size: 14px; padding: 5px 6px; box-sizing: border-box; }
.lg-pickrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 0; }
.lg-lab2 { width: 110px; font-size: 12px; color: var(--muted); }
.lg-check input { width: auto; flex: none; margin: 0; }
.lg-check { justify-content: flex-start; font-size: 13px; }
.lg-pickrow input[type="date"], .lg-pickrow input[type="time"] { height: 28px; box-sizing: border-box; }
.lg-radio label.on.pick { background: #f2c200; color: #222; }
.lg-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px -14px -12px; padding: 10px 14px; background: #fffdf2; border-top: 1px solid #e6dfb8; }
.lg-foot-sum { font-size: 12px; color: #555; }
.lg-foot-main { font-size: 13px; color: #222; }
.lg-foot-main b { font-size: 16px; }
@media (max-width: 759px) {
  .lg-lab { display: inline; font-size: 12px; color: var(--muted); }
  table.lg-ref, table.lg-ref tbody, table.lg-ref tr, table.lg-ref td { display: block; width: auto; min-width: 0; }
  table.lg-ref thead { display: none; }
  table.lg-ref tr { padding: 8px 0; border-bottom: 1px solid #ecece8; }
  table.lg-ref td { border: 0; padding: 3px 8px; }
  table.lg-ref td:empty { display: none; }
  table.lg-ref td.num { text-align: left; }
  table.lg-ref .lg-lab { display: block; margin-bottom: 2px; }
  .lg-in input, .lg-in select { height: 36px; font-size: 16px; max-width: none; width: 100%; }
  .lg-in.lg-short input { width: 120px; font-size: 16px; }
  .lg-line-head { display: none; }
  .lg-lab2 { width: 100%; }
  .lg-reqform .lg-num { font-size: 16px; padding: 8px; }
  .lg-reqform .lg-radio { flex-wrap: wrap; }
  .lg-reqform .lg-radio label { height: 34px; }
}
table.users td { padding: 4px 10px; }
table.users tr.group td { padding: 3px 10px; }
table.users .avatar { width: 26px; height: 26px; line-height: 26px; font-size: 11px; }
td.fold-cell { cursor: pointer; user-select: none; }
/* ⋯: rare actions in a menu over the page (moreMenu). */
:root .more-btn { width: 26px; height: 26px; padding: 0; line-height: 22px; text-align: center; font-weight: 700; color: #666; background: #fff; border: 1px solid #dcdcd4; border-radius: 4px; cursor: pointer; }
.more-btn:hover, .more-btn.on { background: #f0f0ea; color: #222; }
.more-menu { display: flex; flex-direction: column; gap: 2px; padding: 6px; min-width: 150px; }
.more-menu .lg-tools { margin: 0; display: flex; flex-direction: column; gap: 2px; align-items: stretch; }
.more-menu .lg-tools + .lg-tools { margin-top: 4px; padding-top: 4px; border-top: 1px solid #eee; }
.more-menu button, .more-menu select { width: 100%; max-width: none; height: 28px; box-sizing: border-box; text-align: left; justify-content: flex-start; background: #fff; border: 0; border-radius: 4px; padding: 0 8px; cursor: pointer; }
.more-menu button:hover, .more-menu select:hover { background: #f4f1dc; }
.more-menu button:disabled { color: #bbb; background: none; cursor: default; }
.more-menu button.danger { color: var(--bad); }
/* Long text in a list row: at most one or two lines, the whole text in its tooltip and under the row. */
.clamp1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
td.sbtns.inline { flex-direction: row; flex-wrap: nowrap; align-items: center; white-space: nowrap; }
table.fixed-cols.grouped { min-width: 0; }
.lg-warn { font-size: 12px; color: #7a5a00; }
.lg-tools { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.lg-tools select { max-width: 90px; }
pre.lg-mail { white-space: pre-wrap; font: inherit; background: #fffdf2; border: 1px solid #e0d9b8; padding: 10px; max-width: 640px; }
pre.audit-json { white-space: pre-wrap; font: 12px/1.4 Consolas, monospace; background: #fffdf2; border: 1px solid #e0d9b8; padding: 8px; max-height: 360px; overflow: auto; }
/* Mail events (⚙ → ელფოსტა): a row per event. */
.events-table td { vertical-align: middle; padding-top: 8px; padding-bottom: 8px; }
.events-table td:first-child { width: 48px; }
.events-table tr.ev-detail td { background: #fafaf6; padding: 10px 14px 14px; vertical-align: top; }
.events-table .ev-when { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.events-table .ev-btns { display: flex; flex-direction: row; gap: 6px; margin-top: 10px; }
.events-table .ev-btns button { width: auto; }
.events-table .mail-to { max-width: 520px; }
.events-table td .sub { max-width: 46em; }
.events-table .mail-to { width: 100%; min-width: 16em; margin-top: 4px; box-sizing: border-box; }
.events-table .chips { flex-wrap: wrap; }
.events-table tr.muted-row td:not(:first-child):not(:last-child) { opacity: .6; }
.events-table .ev-btns button { white-space: nowrap; }
.events-table td > .sub { margin-top: 4px; }

/* Returns: the chain's documents folded (the sale and each return), one unfolds on a click. */
.doc-folds { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); align-content: start; }
.doc-fold { border: 1px solid #d8d8d0; border-radius: 4px; background: #fff; }
.doc-fold > summary { cursor: pointer; padding: 6px 10px; list-style: revert; }
.doc-fold[open] > summary { background: #fff7d1; border-bottom: 1px solid #e8e2c0; }
.doc-fold > summary .tag { margin-left: 6px; }
.doc-fold-body { padding: 8px 10px; overflow-x: auto; }
.docs2 > * { min-width: 0; }
/* Adds nothing to the width of what holds it: uses the width there is. */
.doc-fold-fit > .doc-fold-body { width: 0; min-width: 100%; box-sizing: border-box; }
/* Inside a half-width panel: a card loses its box and its two panels stack. */
.docs2 .doc-fold-body .card { border: 0; padding: 0; margin: 0; box-shadow: none; }
.docs2 .doc-fold-body .docs2 { grid-template-columns: 1fr; }

/* Columns of any table (tableCols): the ☰ on the table's top right corner (outside its scroll box, so it stays),
   the grip that drags a width, the small window with the ticks. */
th.col-th { position: relative; }
table.has-cols > thead th:last-child { padding-right: 30px; }
:root .col-grip { position: absolute; top: 0; right: 0; width: 6px; height: 100%; cursor: col-resize; z-index: 2; }
.col-grip:hover { background: rgba(200, 160, 0, .35); }
/* Always visible: a thin mark in the header where a column can be dragged wider. */
.col-grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 0; width: 1px; background: #cfccbd; }
.col-grip:hover::after { background: #b08d00; }
.col-anchor { position: relative; height: 0; z-index: 3; }
:root .col-btn { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; padding: 0; border: 1px solid #d0cdb8; border-radius: 4px;
  background: #fffdf2; color: #6b6b60; font-size: 13px; line-height: 20px; text-align: center; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
:root .col-btn:hover { border-color: #c8a800; background: #fff3b0; color: #333; }
.col-pop { position: absolute; z-index: 1000; background: #fff; border: 1px solid #d8d4c0; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.16);
  padding: 8px; width: 240px; text-align: left; font-size: 13px; }
.col-pop-head { font-weight: 600; padding: 2px 6px 6px; border-bottom: 1px solid #eee9d6; margin-bottom: 4px; }
.col-pop-list { max-height: 55vh; overflow: auto; display: grid; }
.col-pop label { display: grid; grid-template-columns: 12px 18px 1fr 20px 20px; gap: 8px; align-items: center; margin: 0; padding: 4px 6px; border-radius: 4px;
  width: auto; text-align: left; white-space: nowrap; cursor: pointer; font-weight: normal; }
.col-pop label:hover { background: #fff7d1; }
.col-pop .col-drag { color: #bbb7a0; font-size: 10px; letter-spacing: -2px; cursor: grab; }
.col-pop .col-mv { width: 20px; height: 20px; padding: 0; border: 1px solid transparent; border-radius: 3px; background: none; color: #8a8a80; cursor: pointer; line-height: 18px; }
.col-pop .col-mv:hover:not(:disabled) { border-color: #d0cdb8; background: #fff; color: #000; }
.col-pop .col-mv:disabled { opacity: .25; cursor: default; }
.col-pop label.dragging { opacity: .4; }
.col-pop label.drop { box-shadow: inset 0 2px 0 #c8a800; }
.col-pop { width: 280px; }
.col-pop label input { margin: 0; width: 15px; height: 15px; }
.col-pop label span { overflow: hidden; text-overflow: ellipsis; }
.col-pop-sep { margin: 6px 6px 2px; padding-top: 6px; border-top: 1px solid #eee9d6; color: #8a8a80; font-size: 11px; text-transform: none; }
.col-pop label.extra span { color: #555; }
.col-pop-reset { display: block; width: 100%; margin-top: 6px; padding: 5px 6px; border: 0; border-top: 1px solid #eee9d6; background: none;
  color: #6b6b60; text-align: left; cursor: pointer; font-size: 12px; }
.col-pop-reset:hover { color: #000; background: #faf7ea; }
@media print { .col-btn, .col-grip { display: none; } }

/* ---------- Phone (narrower than the side menu needs, 2026-11-03, the user's request) ----------
   Top bar: logo, ☰, reload, then search and the user's icons; the sections are a panel from the left
   opened by ☰ (app.js setMenu); tables scroll sideways inside their own box (phoneScroll). */
.menu-btn { display: none; }
.mscroll { min-width: 0; }
@media (max-width: 759px) {
  .menu-btn { display: inline-flex; width: 36px; height: 36px; }
  .menu-btn svg { width: 20px; height: 20px; }
  .reload-btn { width: 36px; height: 36px; margin-left: 0; }
  .top { gap: 8px; padding: 6px 10px; flex-wrap: wrap; }
  .top > .me { flex: 1 1 100%; min-width: 0; gap: 6px; order: 5; }
  .top > .me #gsearch { flex: 1; min-width: 0; margin: 0; }
  .top > .me #gsearch input, .top > .me #gsearch input:focus { width: 100%; }
  .top > .me .who #me-name, .top > .me .layout-btn { display: none; }
  .top > .me .who { margin-left: 0; }
  /* The sections: a panel from the left under the top bar. */
  #nav { display: none; }
  html[data-menu="1"] #nav { display: flex; position: fixed; top: var(--toph, 96px); left: 0; bottom: 0; z-index: 55; width: min(330px, 88vw);
    flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 6px 0 24px; overflow-y: auto; background: #fbec9f; border-right: 1px solid #e3cf6e;
    box-shadow: 6px 0 24px rgba(0,0,0,.2); }
  /* The shade sits in the top bar's own layer (.head is sticky with its own z-index), under the panel. */
  html[data-menu="1"] .head::before { content: ""; position: fixed; inset: var(--toph, 96px) 0 0 0; background: rgba(0,0,0,.28); z-index: 54; }
  html[data-menu="1"] #nav .navitem { display: flex; flex-direction: column; }
  html[data-menu="1"] #nav a.navtop { gap: 12px; padding: 12px 18px; font-size: 15px; border-radius: 0; color: #333; }
  html[data-menu="1"] #nav a.navtop svg { width: 22px; height: 22px; color: #b5541b; }
  html[data-menu="1"] #nav a.navtop.active { background: #f3d25a; }
  html[data-menu="1"] #nav .navitem.open > a.navtop { background: #f7df7c; }
  /* A section's pages open under it (a tap), not beside it; hover does nothing on a phone. */
  html[data-menu="1"] #nav .navitem.has-drop:not(.open):hover > .navdrop, html[data-menu="1"] #nav .navitem.has-drop:not(.open):focus-within > .navdrop { display: none; }
  html[data-menu="1"] #nav .navitem.open > .navdrop { display: flex; position: static; min-width: 0; box-shadow: none; border: 0; border-radius: 0; background: #fffbe6; padding: 2px 0 6px; }
  html[data-menu="1"] #nav .navdrop a { padding: 11px 18px 11px 52px; font-size: 14px; }
  #nav .navfold { display: none; }
  /* The pages seen last: one row scrolled sideways. */
  .subnav { overflow-x: auto; padding: 4px 8px; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a.rec { flex: none; max-width: 200px; }
  /* Page: narrower margins, cards edge to edge. */
  main { padding: 10px 8px; }
  .card { padding: 10px 8px; margin-bottom: 10px; }
  h1 { font-size: 16px; }
  .mscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .mscroll > table { min-width: 100%; }
  /* Toolbar: each part on its own row, the fields as wide as the screen allows. */
  .tbline { padding: 6px 2px; }
  .tbline .tsec { flex-wrap: wrap; padding: 0 6px; border-left: 0; max-width: 100%; }
  .tbline .tsec.tend { margin-left: 0; }
  label.fld { max-width: 100%; }
  .tbar { flex-wrap: wrap; }
  /* Fields at 16px: a phone does not zoom in on them. */
  :root input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
  /* Grids of cards and two-column blocks: one column. */
  .split, .docs2 { grid-template-columns: 1fr !important; }
  .stats { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  /* Windows over the page: the whole width. */
  .drawer { width: 100vw; }
  .drawer-body { padding: 8px 8px 24px; }
  .modal { padding: 8px; }
  .col-pop { width: min(300px, calc(100vw - 16px)); }
  .col-pop label { padding: 8px 6px; }
  .col-pop .col-mv { width: 28px; height: 28px; }
  .col-pop label { grid-template-columns: 12px 18px 1fr 28px 28px; }
  .tabmenu { max-width: calc(100vw - 16px); }
  /* A long total's label wraps instead of widening the page. */
  .sumline .sum-item { white-space: normal; }
  /* Touch: bigger tap targets in the tables' rows of buttons and the pills. */
  :root .statusbar button.pill { height: 34px; }
  .col-grip { width: 12px; }
}
.own-status { padding: 12px 16px; border-radius: 6px; margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.own-status.ok { background: #eaf6ec; color: #1e6b2c; }
.own-status.warn { background: #fff4d6; color: #7a5300; }
.own-status .own-sub { font-weight: 400; color: #444; }
.own-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 8px; }
.own-card { background: #fff; border: 1px solid #e3dcc0; border-radius: 6px; padding: 14px 16px; }
.own-label { font-size: 14px; color: #666; }
.own-value { font-size: 30px; font-weight: 700; margin: 4px 0; }
.own-card.pos .own-value { color: #1e6b2c; }
.own-card.neg .own-value { color: #b3261e; }
.own-sub { font-size: 13px; color: #666; }
.own-chg { font-weight: 600; }
.own-note { font-size: 13px; color: #555; margin: 6px 0 14px; }
.own-table { width: 100%; font-size: 15px; }
.own-table td, .own-table th { padding: 6px 8px; }
.own-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; }
.own-bar { background: #f1ecd8; height: 8px; border-radius: 4px; min-width: 90px; flex: 1; }
.own-bar span { display: block; height: 8px; border-radius: 4px; background: #d9a400; }
.own-bar.profit span { background: #3f9a52; }
.own-share { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.own-pc { width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.own-stack { display: flex; height: 26px; border-radius: 5px; overflow: hidden; margin: 8px 0; }
.own-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; }
.own-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; }
.s-materials { background: #8d99ae; }
.s-labour { background: #d9a400; }
.s-overhead { background: #c97b3f; }
.s-left { background: #3f9a52; }
.own-signal { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid #eee7cf; font-size: 15px; }
.own-signal:first-child { border-top: 0; }
.own-signal-side { text-align: right; white-space: nowrap; }
.own-table tr.own-sum td { font-weight: 600; border-top: 1px solid #d9d1b0; }
.own-table tr.own-net td { font-size: 17px; font-weight: 700; color: #1e6b2c; }
.own-table tr.own-net td.neg { color: #b3261e; }
.own-netline { font-size: 15px; font-weight: 600; color: #333; margin-top: 6px; }
.own-netline .neg { color: #b3261e; }
.own-lead { font-size: 16px; font-weight: 600; margin: 4px 0 12px; }
/* Any table sorts by a click on a column's header (app.js, the document's click listener). */
thead th:not(.group-head):not(:empty) { cursor: pointer; user-select: none; }
thead th:not(.group-head):not(:empty):hover { color: #222; text-decoration: underline; }
table[data-sort="off"] thead th { cursor: default; text-decoration: none; }
th[data-sort="asc"], th[data-sort="desc"] { color: #222; font-weight: 600; }
th[data-sort="asc"]::after { content: " ▲"; font-size: 9px; }
th[data-sort="desc"]::after { content: " ▼"; font-size: 9px; }
@media print { th[data-sort]::after { content: none !important; } }
/* Month close: checks as rows, months as columns; it fits the page, no sideways scroll. */
.close-pivot { width: 100%; table-layout: fixed; }
.close-pivot.few { width: auto; max-width: 860px; table-layout: auto; }
.close-pivot th.close-name, .close-pivot td.close-name { width: 300px; text-align: left; white-space: normal; }
.close-pivot th.close-month { text-align: center; white-space: normal; font-size: 12px; color: #333; vertical-align: top; }
.close-pivot.few th.close-month { min-width: 130px; }
.close-pivot th.close-month .tag { display: inline-block; margin-top: 3px; font-size: 11px; white-space: nowrap; }
.close-pivot th.close-month button { padding: 0 4px; min-height: 0; height: 20px; line-height: 1; }
.close-pivot td.close-cell { text-align: center; padding: 5px 4px; overflow-wrap: anywhere; }
.close-pivot .close-sum { display: block; font-size: 11px; color: #666; white-space: nowrap; }
.close-pivot.dense .close-sum { display: none; }
.close-pivot.dense th.close-month .tag { white-space: normal; }
@media (max-width: 759px) {
  .close-pivot th.close-name, .close-pivot td.close-name { width: 130px; font-size: 12px; }
  .close-pivot { min-width: 100%; }
}

/* Filters under the column names, as in Excel (colFilters, app.js). */
tr.col-fl th { padding: 2px 4px 8px; font-weight: 400; cursor: default; }
tr.col-fl th:hover { background: inherit; }
:root .cfl { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; min-width: 70px; height: 28px; padding: 0 7px; border: 1px solid #e3e1d8; border-radius: 5px; background: #fff; font-size: 12.5px; color: inherit; font-weight: 400; cursor: pointer; }
:root input.cfl { display: block; cursor: text; }
tr.col-fl th.num input.cfl { text-align: right; }
.cfl::placeholder { color: #a8a699; }
:root .cfl:hover { border-color: #c4c0ae; }
:root .cfl-idle, :root .cfl-idle:hover { background: #f6f5f0; border-color: #ecebe4; cursor: default; }
tr.fold-off { display: none; }
table.cfl-on tr.fold-off:not([hidden]) { display: table-row; }
tr.more-cut { display: none; }
table.cfl-on tr.more-cut:not([hidden]) { display: table-row; }
.cfl.on { background: #fff3bf; border-color: #e6c200; }
.cfl.on .cfl-lab { color: #5c4b00; font-weight: 600; }
.cfl-lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8f8d82; }
.cfl-lab.neg { color: #c0392b; font-weight: 600; }
.cfl-car { color: #a8a699; font-size: 10px; }
.cfl-pop { position: fixed; z-index: 60; width: min(320px, calc(100vw - 16px)); display: grid; gap: 6px; padding: 8px; background: #fff; border: 1px solid #cfccbd; border-radius: 8px; box-shadow: 0 8px 24px rgba(40, 36, 20, .18); }
.cfl-pop input[type="search"] { width: 100%; height: 30px; }
.cfl-acts { display: flex; gap: 12px; font-size: 12.5px; }
.cfl-acts button { border: 0; background: none; padding: 0; color: #8a6d00; text-decoration: underline; cursor: pointer; height: auto; }
.cfl-list { max-height: 280px; overflow: auto; }
.cfl-opt { display: flex; align-items: center; gap: 7px; padding: 4px; margin: 0; border-radius: 4px; cursor: pointer; font-size: 13px; }
.cfl-opt:hover { background: #fafaf6; }
.cfl-opt .dot { flex: none; }
.cfl-t { flex: 1; min-width: 0; }
.cfl-n { color: #7d7b72; font-size: 12px; font-variant-numeric: tabular-nums; }
.cfl-only { border: 0; background: none; padding: 0 2px; height: auto; color: #8a6d00; font-size: 12px; cursor: pointer; opacity: 0; }
.cfl-opt:hover .cfl-only, .cfl-only:focus-visible { opacity: 1; }
.cfl-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.clear-filters { background: #fff3bf; border-color: #e6c200; color: #5c4b00; font-weight: 600; }
@media print { tr.col-fl { display: none; } }

/* The list under a filter cell and a filtered table: the general label > input rule (full width) does not apply here. */
.cfl-opt { display: flex; }
.cfl-opt > input[type="checkbox"] { display: inline-block; flex: none; width: auto; margin: 0; }
.cfl-t { line-height: 1.3; color: #333; }
.cfl-t .sub { display: block; }
.cfl-n { flex: none; min-width: 26px; text-align: right; }
.cfl-only { flex: none; }
table.cfl-table thead tr:first-child th { vertical-align: bottom; }
table.cfl-table th.cfl-w { min-width: 180px; }
table.cfl-table .cfl { min-width: 0; }
table.cfl-table tr.col-fl th.num { min-width: 78px; }
.cfl-sum .live-stamp { margin: 0 0 0 auto; }
table.cfl-table button.copy svg { opacity: 0; }
table.cfl-table tr:hover button.copy svg { opacity: .45; }
table.cfl-table button.copy:hover svg, table.cfl-table button.copy.done svg { opacity: 1; }
.cfl-opt .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9c7bb; }
.cfl-opt .dot.bad { background: #c0392b; }
.cfl-opt .dot.warn { background: #d98a00; }
.cfl-opt .dot.ok { background: #2e8b43; }
tr[hidden] { display: none; }
table.cfl-auto .cfl { min-width: 0; }
table.cfl-auto tr.col-fl th.num { min-width: 70px; }
tr.cfl-total td { font-weight: 600; background: #fafaf6; border-top: 1px solid #d9d6c9; white-space: nowrap; }
tr.cfl-total .clear-filters { margin-left: 8px; }
table[data-frozen] > tbody > tr > td { overflow: hidden; text-overflow: ellipsis; }
tr.cfl-total td.cfl-lbl { white-space: normal; }
.cfl-period:not(:empty) { display: block; }
.cfl-period:not(:empty) + .cfl { display: none; }
.mp.mp-cell { display: flex; gap: 2px; width: 100%; min-width: 124px; }
.mp-cell .mp-arrow { flex: none; width: 18px; height: 28px; font-size: 13px; }
.mp-cell .mp-main { flex: 1; width: auto; min-width: 0; height: 28px; padding: 0 3px; font-size: 12.5px; font-weight: 400; }
.mp-cell .mp-main svg, .mp-cell .mp-caret { display: none; }
.col-guide { position: fixed; z-index: 40; width: 1px; background: #b08d00; pointer-events: none; }
@media print { .col-guide { display: none; } }
/* A faint line between the columns of a list (2026-11-05, the user's wish); the edge's stronger line shows while dragging. */
table.has-cols > thead > tr > th:not(:last-child), table.has-cols > tbody > tr > td:not(:last-child) { border-right: 1px solid #efede5; }
/* Column-filter tables take less room, so a list fits a 1500 px screen. */
table.cfl-table th.cfl-w { min-width: 130px; }
table.cfl-table tr.col-fl th.num { min-width: 52px; }
table.cfl-table tr.col-fl th { padding-left: 3px; padding-right: 3px; }
table.cfl-table tr.col-fl input.cfl { padding: 0 4px; }
table.cfl-table td.sub.nowrap { font-size: 11.5px; }
.mp.mp-cell { min-width: 106px; }
.mp-cell .mp-arrow { width: 15px; }
.detail-fit { position: sticky; left: 8px; }
.detail-fit .docs2 { min-width: 0; }
/* An opened row: its content keeps a readable width on a large screen, its tables as wide as their text. */
tr.detail-row > td > *, .detail-fit > *, .detail-in > * { max-width: 1500px; }
tr.detail-row table:not(.cfl-table) { width: auto; min-width: 480px; }
/* A list inside an opened row whose rows open too is as wide as its panel from the start: what opens in it has room
   and nothing moves (2026-11-18, the user's note on a counterparty's act). */
tr.detail-row table:not(.cfl-table):has(> tbody > tr.click) { width: 100%; }
tr.detail-row table td, tr.detail-row table th { min-width: 0; }
/* An employee's statements: fixed columns, so an opened explanation or payment does not move them. */
tr.detail-row table.stmt-cols { width: 100%; table-layout: fixed; }
table.stmt-cols > tbody > tr > td { overflow-wrap: anywhere; }
table.stmt-cols table { overflow-wrap: normal; }
/* The "view" select stands on the right of its line, whatever is on the left. */
.card-head > .sumline, .card-head > .cfl-sum { flex: 1 1 0; min-width: 0; margin: 0; }
.card-head > label.fld { margin-left: auto; flex: none; }
/* A filtered table with nothing left (filterEmpty, app.js). */
tr.cfl-none td { padding: 0; border: 0; background: none; white-space: normal; }
tr.cfl-none:hover td { background: none; }
.cfl-none-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 44px 16px 48px; text-align: center; }
.cfl-none-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 50%; background: #f6f1dc; color: #8a7a35; }
.cfl-none-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cfl-none-title { font-size: 16px; font-weight: 600; color: #333; overflow-wrap: anywhere; }
.cfl-none-sub { font-size: 13px; color: #777; }
.cfl-none-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.cfl-none-acts button { height: 34px; padding: 0 16px; border-radius: 6px; }
tr.cfl-total .cfl-x { width: 18px; height: 18px; min-height: 0; padding: 0; margin-left: 6px; border: 0; border-radius: 50%; background: #efe8cc; color: #5c4b00; font-size: 10px; line-height: 18px; cursor: pointer; vertical-align: 1px; }
tr.cfl-total .cfl-x:hover { background: #e6c200; }
@media print { tr.cfl-none { display: none; } }
/* The owner's page: one sentence, four figures, then what to look at beside the ladder; two columns where there is room. */
.own-hero { background: #fff; border: 1px solid #e3dcc0; border-left: 4px solid #3f9a52; border-radius: 6px; padding: 14px 18px; margin: 0 0 12px; }
.own-hero-title { font-size: 19px; font-weight: 600; color: #333; line-height: 1.35; }
.own-hero-title b { color: #1e6b2c; font-size: 22px; }
.own-hero .own-netline { font-size: 14px; font-weight: 400; color: #555; margin-top: 4px; }
.own-card { padding: 12px 16px; }
.own-label { font-size: 13px; }
.own-value { font-size: 27px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.own-delta { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.own-delta.good { color: #1e6b2c; }
.own-delta.bad { color: #b3261e; }
.own-note { font-size: 12.5px; color: #777; margin: 4px 0 12px; }
.own-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(560px, 100%), 1fr)); gap: 12px; align-items: start; margin-bottom: 12px; }
.own-grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(760px, 100%), 1fr)); }
.own-grid > .card { margin: 0; min-width: 0; }
.own-table { font-size: 14px; font-variant-numeric: tabular-nums; }
.own-stack span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; }
.own-signals { counter-reset: own-sig; }
.own-signal { font-size: 14px; padding: 10px 0; counter-increment: own-sig; }
.own-signal > div:first-child { position: relative; padding-left: 28px; min-width: 0; }
.own-signal > div:first-child::before { content: counter(own-sig); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: #f4efd9; color: #7a6a1f; font-size: 12px; font-weight: 600; text-align: center; line-height: 20px; }
.own-signal .own-sub { font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.own-signal-side b { font-size: 15px; font-variant-numeric: tabular-nums; }
.own-who { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 10px; background: #f6f3e6; color: #6b6450; font-size: 12px; }
@media (max-width: 759px) { .own-value { font-size: 23px; } .own-hero-title { font-size: 16px; } }
/* When the page's data was last read, in its header (headStamp, app.js). */
.card.has-stamp { position: relative; }
.head-stamp { position: absolute; top: 18px; right: 16px; font-size: 12px; color: #777; white-space: nowrap; }
@media (max-width: 1100px) { .head-stamp { position: static; margin-top: 8px; white-space: normal; } }
/* A delivery day: a row per request, a line per trip. */
.lg-mytrip + .lg-mytrip { margin-top: 4px; }
.lg-mytrip .tag { margin-left: 6px; }
/* The panel's day: its head, then one card per request: who, where, what and when on the left, its trips on the right.
   The card's left edge says where it stands. */
.lg-dayhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 12px 16px; }
.lg-dayhead .lg-dayname b { font-size: 16px; }
.lg-daystats { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-dayhead .lg-stat { flex-direction: row; align-items: baseline; gap: 5px; padding: 3px 10px; background: #f4f4ee; border-radius: 12px; }
.lg-dayhead .lg-stat b { font-size: 14px; }
.lg-dayhead .lg-stat span { color: #555; }
.lg-dayhead .lg-stat.bad { background: #fdecea; }
.lg-dayhead .lg-stat.bad b { color: var(--bad); }
.lg-dayhead .lg-stat.warn { background: #fff4c4; }
.lg-dayhead .lg-stat.warn b { color: #7a5a00; }
.lg-dayacts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.lg-daynote { flex: 0 0 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-top: 8px; border-top: 1px solid #eeeee8; font-size: 12px; }
button.lg-daynote-b { height: auto; padding: 0; font-size: 13px; font-weight: 400; color: #7a5a00; background: none; border: 0; }
button.lg-daynote-b:hover { text-decoration: underline; background: none; }
.lg-rqs { display: grid; gap: 8px; margin-bottom: 12px; }
.lg-rq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, 520px); background: #fff; border: 1px solid var(--line); border-left: 4px solid #d9d9d2; border-radius: 4px; }
.lg-rq.s-open, .lg-rq.s-warn { border-left-color: #e6c200; }
.lg-rq.s-ok { border-left-color: #2e8b3d; }
.lg-rq.s-bad { border-left-color: #c0392b; }
.lg-rq-main { min-width: 0; padding: 12px 16px; }
.lg-rq-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.lg-rq-who .lg-move { padding: 0 8px; }
.lg-move-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
button.lg-rq-name { font-size: 15px; font-weight: 600; color: #222; text-decoration: none; border: 0; }
button.lg-rq-name:hover { text-decoration: underline; }
.lg-facts { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 16px; margin-top: 10px; }
.lg-fact-l { display: block; margin-bottom: 3px; font-size: 11px; color: var(--muted); }
.lg-rq-trip { min-width: 0; padding: 12px 14px; background: #fafaf6; border-left: 1px solid #eeeee8; border-radius: 0 4px 4px 0; }
.lg-rq.s-open .lg-rq-trip { background: #fff8e1; }
.lg-trip-line + .lg-trip-line { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e8e8e0; }
.lg-trip-line .lg-veh { flex: 1 1 170px; min-width: 0; width: auto; }
.lg-rq .lg-warn { margin-top: 6px; padding: 3px 8px; background: #fff4c4; border-radius: 3px; }
button.lg-more { display: block; margin-top: 8px; font-weight: 400; background: none; }
.lg-place { display: block; width: 100%; max-width: 240px; height: 24px; margin-top: 2px; padding-left: 0; font-size: 12px; color: var(--muted); background-color: transparent; border-color: transparent; }
.lg-place:hover, .lg-place:focus { padding-left: 4px; border-color: var(--line); }
.lg-rq-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 4px 0; }
.lg-rq-group b { font-size: 14px; }
.lg-rq-group .lg-link { margin-left: auto; }
/* The card's head: the client on the left, when the client wants it on the right; the load as chips; the comment as a note. */
.lg-rq-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 16px; }
.lg-rq-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; }
.lg-rq-sub .lg-move { height: 22px; padding: 0 8px; font-weight: 400; color: #555; background: none; }
.lg-want { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.lg-want span { font-size: 11px; color: var(--muted); }
.lg-want b { font-size: 13px; }
.lg-want em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--bad); }
.lg-rqs { max-width: 1440px; }
.lg-cmt-l { color: var(--muted); }
td.wauthor, td.wday { white-space: nowrap; color: #444; }
td.wparty { min-width: 140px; max-width: 260px; }
.lg-day-group { padding: 14px 4px 2px; border-bottom: 2px solid #e6c200; }
.lg-day-group:first-child { padding-top: 2px; }
.lg-day-group button.linklike { font-size: 15px; font-weight: 700; color: #222; }
.lg-day-group { gap: 8px 16px; padding-left: 6px; }
.lg-dhead { display: flex; align-items: center; gap: 10px; height: auto; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.lg-dtile { display: flex; flex-direction: column; align-items: center; width: 44px; border: 1px solid #d8c060; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.lg-dtile b { font-size: 19px; line-height: 26px; color: #222; }
.lg-dtile span { width: 100%; text-align: center; font-size: 11px; line-height: 16px; background: #f5d93b; color: #5a4600; }
.lg-dhead.today .lg-dtile { border-color: #c79a00; box-shadow: 0 0 0 2px #f5d93b; }
.lg-dname { display: flex; flex-direction: column; line-height: 1.25; }
.lg-dname b { font-size: 15px; color: #222; }
.lg-dname span { font-size: 12px; color: #777; }
.lg-dhead.today .lg-dname span { color: #7a5a00; font-weight: 600; }
.lg-dhead:hover .lg-dname b { text-decoration: underline; }
.lg-dchips { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-dchip { padding: 2px 10px; border-radius: 12px; background: #f4f4ee; color: #555; font-size: 12px; white-space: nowrap; }
.lg-dchip b { color: #222; font-size: 13px; }
.lg-dchip.bad { background: #fdecea; }
.lg-dchip.bad b { color: var(--bad); }
.lg-dchip.ok { background: #eaf6ea; color: #2d6a2d; }
.lg-dchip.ok b { color: #2d6a2d; }
.lg-dchip.warn { background: #fff4c4; }
.lg-dchip.warn b { color: #7a5a00; }
.lg-dayhead .lg-dtile { width: 50px; }
.lg-dayhead .lg-dtile b { font-size: 22px; line-height: 30px; }
.lg-rq-cols { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.6fr) minmax(110px, 0.6fr); gap: 8px 20px; }
.lg-rq-where { margin-top: 8px; }
.lg-rq-whocol .sub { margin-top: 3px; }
b.lg-want { display: block; font-size: 13px; }
.lg-rq-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 2px; }
.lg-rq-foot button.lg-more { display: inline-flex; flex: 1 1 auto; justify-content: center; margin: 0; }
.lg-rq-foot .lg-move { font-weight: 400; background: none; }
.lg-move-at { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lg-move-at .lg-move { height: auto; min-height: 24px; padding: 3px 8px; line-height: 1.25; white-space: normal; text-align: center; font-weight: 400; }
@media (max-width: 1150px) { .lg-rq-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 759px) { .lg-rq-cols { grid-template-columns: minmax(0, 1fr); } }
.lg-load-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 3px; }
.lg-load-chip { padding: 1px 8px; background: #f1f1ea; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.lg-load-chip b { font-size: 13px; }
.lg-rq-cmt { margin-top: 10px; padding: 5px 9px; font-size: 12px; color: #444; background: #f7f7f2; border-left: 3px solid #ddd; border-radius: 0 3px 3px 0; }
/* A trip as a ticket: departure time and the plate large, the way planned → departed → delivered, the buttons below. */
.lg-rq-trip { display: grid; align-content: start; gap: 8px; }
.lg-tk { padding: 10px 12px; background: #fff; border: 1px solid #e3e3da; border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.lg-tk.st-delivered { border-color: #b9dcc0; background: #f6fbf6; }
.lg-tk.st-failed { border-color: #ecc1bb; background: #fdf5f4; }
.lg-tk.st-departed { border-color: #ead48a; }
.lg-tk-top { display: flex; align-items: center; gap: 12px; }
.lg-tk-time { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 4px 6px; background: #fff3b0; border-radius: 4px; line-height: 1.1; }
.lg-tk-time b { font-size: 18px; font-variant-numeric: tabular-nums; }
.lg-tk-time span { font-size: 10px; color: #6b5a00; }
.lg-tk-veh { display: flex; flex-direction: column; min-width: 0; }
.lg-tk-plate { align-self: flex-start; padding: 1px 7px; font-size: 14px; letter-spacing: 0.04em; border: 1.5px solid #333; border-radius: 3px; background: #fff; }
.lg-tk-n { margin-left: auto; align-self: flex-start; font-size: 11px; color: var(--muted); white-space: nowrap; }
.lg-steps { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 10px; font-size: 12px; color: #999; }
.lg-step { display: flex; align-items: center; gap: 5px; }
.lg-step + .lg-step::before { content: ""; width: 22px; height: 2px; margin: 0 6px; background: #ddd; }
.lg-step i { width: 9px; height: 9px; border: 2px solid #ccc; border-radius: 50%; box-sizing: border-box; }
.lg-step.done { color: #2e6b37; }
.lg-step.done i { background: #2e8b3d; border-color: #2e8b3d; }
.lg-step.done + .lg-step.done::before { background: #2e8b3d; }
.lg-step.cur { font-weight: 600; }
.lg-step.bad { color: var(--bad); font-weight: 600; }
.lg-step.bad i { background: var(--bad); border-color: var(--bad); }
.lg-tk .lg-acts { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e3e3da; }
.lg-acts-grow { flex: 1; }
.lg-tk-edit { font-weight: 400; background: none; }
.lg-tk-new { padding: 10px 12px; background: #fff8e1; border: 1px dashed #e6c200; border-radius: 6px; }
.lg-tk-need { margin-bottom: 6px; font-size: 12px; font-weight: 600; color: #7a5a00; }
.lg-rq.s-open .lg-rq-trip { background: #fafaf6; }
.lg-rq-trip button.lg-more { margin-top: 0; }
table.lg-trips td { vertical-align: top; }
@media (max-width: 1150px) {
  .lg-rq { grid-template-columns: minmax(0, 1fr); }
  .lg-rq-trip { border-left: 0; border-top: 1px solid #eeeee8; border-radius: 0 0 4px 0; }
}
@media (max-width: 759px) {
  .lg-facts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lg-dayacts { margin-left: 0; }
}
/* The delivery request's form: who it is for, what goes on the left, where and when on the right. */
.lg-reqform .lg-order-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.lg-reqform h3 { margin: 0 0 6px; font-size: 13px; color: #555; font-weight: 600; }
.lg-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lg-two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; margin-top: 12px; }
.lg-reqform .lg-line { grid-template-columns: minmax(0, 1fr) 84px 100px 86px; }
.lg-reqform .lg-pickrow { flex-wrap: wrap; }
.lg-reqform .lg-need { border-color: #e0a400; background: #fffdf2; }
.lg-reqform .lg-field { margin-top: 10px; }
.lg-missing { font-size: 12px; color: #9a7400; }
@media (max-width: 1100px) { .lg-two { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
@media (max-width: 759px) {
  .lg-reqform .lg-line { grid-template-columns: 1fr 1fr; }
  .lg-reqform .lg-all { grid-column: 1 / -1; }
}
/* The panel's calendar: months side by side, a day's requests under its number; amber where a coming one has no vehicle. */
.lg-flt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 0 0 8px; }
.lg-flt label.fld select { max-width: 260px; }
.lg-flt label.fld.on { border-color: #d1a900; background: #fff8d6; }
.lg-fltnote { margin: 0 0 6px; }
.lg-strip { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 8px; padding: 2px 0 10px; }
.lg-cal-ms { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px 22px; }
.lg-cal-t { font-weight: 600; font-size: 13px; text-align: center; padding: 4px 0 6px; }
.lg-cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.lg-cal-w { font-size: 11px; color: #999; text-align: center; padding-bottom: 2px; }
:root .lg-cal-a { flex: none; width: 28px; height: 28px; padding: 0; font-size: 16px; line-height: 1; }
.lg-cal-later { flex-basis: 100%; height: auto; padding: 2px 8px; font-size: 12px; font-weight: 400; color: #7a5a00; background: none; border: 0; text-decoration: underline; text-align: right; }
:root .lg-dc { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0; height: 34px; min-width: 0; padding: 2px 0; font-size: 11px; font-weight: 400; color: #777; background: none; border: 1px solid transparent; border-radius: 4px; }
.lg-dc b { font-size: 13px; font-weight: 400; line-height: 16px; color: #222; }
.lg-dc .n { font-size: 11px; line-height: 12px; color: #666; font-weight: 600; }
.lg-dc.past b { color: #aaa; }
.lg-dc.past .n { color: #aaa; font-weight: 400; }
.lg-dc.has { background: #f3f3ee; }
.lg-dc.need { background: #fff4c4; border-color: #e6c200; }
.lg-dc.need .n { color: #7a5a00; }
.lg-dc.today b { font-weight: 700; text-decoration: underline; }
.lg-dc.on { outline: 2px solid #c79a00; outline-offset: -1px; }
.lg-dc:hover { background: #f8f8f2; }
.lg-dc.need:hover { background: #ffedA6; }
/* The requests page: orders on the left, the requests by day on the right; an open form takes the list's place. */
.lg-split { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.lg-split > .card { margin: 0; }
.lg-orders { position: sticky; top: calc(var(--toph, 60px) + 8px); max-height: calc(100vh - var(--toph, 60px) - 24px); overflow-y: auto; padding: 0 10px 10px; }
.lg-ord-head { position: sticky; top: 0; z-index: 1; background: #fff; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 0 8px; border-bottom: 1px solid #e4e4de; }
.lg-ord-head input { width: 100%; box-sizing: border-box; }
.lg-ord-head .seg { align-self: flex-start; }
.lg-ord-sub { display: flex; justify-content: space-between; gap: 8px; margin-top: 1px; }
.lg-ord-sub .clamp1 { min-width: 0; }
.lg-rq-tools-r { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lg-right { min-width: 0; }
.lg-right > div:first-child > .card { margin: 0 0 14px; }
.lg-sec-title { margin: 0 0 8px; font-size: 15px; }
.lg-form-hint p { margin: 0; }
.lg-rq-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.lg-rq-tools .tbar { margin: 0; }
input.lg-rq-q { width: 280px; max-width: 100%; box-sizing: border-box; }
.lg-rq-r { grid-template-columns: minmax(0, 1fr) minmax(200px, 280px); }
.lg-rq-r.click { cursor: pointer; }
.lg-rq-r:hover { border-color: #cfcfc6; }
.lg-rq-r .lg-rq-name { color: #222; }
.lg-rq-edit { margin-left: auto; font-weight: 400; }
.lg-facts-r { grid-template-columns: minmax(0, 1.8fr) minmax(60px, 0.4fr) minmax(0, 0.8fr); }
.lg-rq-note { margin-top: 8px; }
.lg-rq-detail { grid-column: 1 / -1; padding: 10px 14px 14px; border-top: 1px solid #eeeee8; cursor: auto; }
.lg-rq-off { border-left-color: #d9d9d2; opacity: 0.65; }
.lg-rq.focus-hit { outline: 2px solid #c79a00; outline-offset: 1px; }
.lg-rq-r .lg-mytrip .tag { margin-left: 0; }
.lg-ord-group { font-size: 12px; color: #777; margin: 10px 0 2px; }
.lg-ord-group.w { color: #9a7400; }
button.lg-ord { display: block; width: 100%; height: auto; text-align: left; padding: 6px 8px; font-weight: 400; color: #222; background: none; border: 0; border-top: 1px solid #efefea; border-radius: 0; white-space: normal; }
button.lg-ord:hover { background: #f8f8f2; }
button.lg-ord.on { background: #fff4c4; }
.lg-ord-top { display: flex; justify-content: space-between; gap: 8px; }
.lg-has { font-size: 12px; color: var(--ok, #2e8b3d); }
@media (max-width: 1500px) { .lg-two { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
@media (max-width: 1000px) { .lg-split { grid-template-columns: minmax(0, 1fr); } .lg-orders { position: static; max-height: 340px; } }
button.lg-ord-fold { display: block; width: 100%; height: auto; margin: 12px 0 2px; padding: 4px 0; text-align: left; font-size: 12px; font-weight: 400; color: #777; background: none; border: 0; border-top: 1px solid #e4e4de; border-radius: 0; }
button.lg-ord-fold:hover { color: #222; background: none; }
.lg-ord-seg { margin: 0; }
@media (max-width: 1150px) { .lg-rq-r { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 759px) { .lg-facts-r { grid-template-columns: minmax(0, 1fr); } }
.lg-link { margin-left: 10px; }

/* The form of a task, in the side panel. */
.task-form { display: flex; flex-direction: column; gap: 10px; }
.task-form h2 { margin: 0; }
.task-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #6f6d64; }
.task-form select, .task-form textarea, .task-form input { width: 100%; box-sizing: border-box; font-size: 14px; }
.task-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
/* The mark of a row that has a task. */
tr.task-given > td:first-child { box-shadow: inset 3px 0 0 #e0a100; }
/* The right-click menu of a row: long labels on one line. */
.row-menu button { white-space: nowrap; max-width: 360px; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.row-menu button span { overflow: hidden; text-overflow: ellipsis; }
.row-menu svg { width: 17px; height: 17px; flex: none; fill: none; stroke: #8a887f; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.row-menu button:hover svg { stroke: #333; }

.doc-history:not(:empty) { margin-top: 10px; }
.doc-history table.mini, .docs2 table.mini.fit { min-width: 0; }

/* An employee's money way: accrual → statement → payment in 1C → bank (payrollDetail, 2026-11-11). */
table.pay-path { width: 100%; table-layout: fixed; }
table.pay-path td { overflow-wrap: anywhere; vertical-align: top; }
table.pay-path table { overflow-wrap: normal; }
table.pay-path td.pay-step { color: #555; white-space: nowrap; }
table.pay-path tr.pay-lvl2 td.pay-step { padding-left: 18px; }
table.pay-path tr.pay-lvl3 td.pay-step { padding-left: 34px; }
table.pay-path tr.pay-lvl4 td.pay-step { padding-left: 50px; }
table.pay-path tr.pay-lvl2 td.pay-step::before, table.pay-path tr.pay-lvl3 td.pay-step::before, table.pay-path tr.pay-lvl4 td.pay-step::before { content: "└ "; color: #aaa; }
/* A 1C document's attached files, from 1C's own note (fileSlot, 2026-11-11). */
.file-note { font-size: 12px; color: #555; margin-top: 2px; overflow-wrap: anywhere; }
.doc-files:not(:empty) { margin: 4px 0; }

/* Tasks: the menu's count and the pages "mine" / "the ones I gave" as cards (renderMyTasks, 2026-11-11). */
.nav-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 6px; border-radius: 9px; background: #c0392b; color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.tc-summary { margin: 4px 0 10px; }
.tcards { display: grid; gap: 10px; }
.tcard { background: #fff; border: 1px solid var(--line); border-left: 4px solid #d9d9d2; border-radius: 6px; padding: 12px 16px; cursor: pointer; transition: box-shadow .15s; }
.tcard:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .07); }
.tcard.open { cursor: default; box-shadow: 0 2px 10px rgba(0, 0, 0, .09); }
.tcard.s-warn { border-left-color: #e6c200; }
.tcard.s-bad { border-left-color: #c0392b; }
.tcard.s-ok { border-left-color: #2e8b3d; }
.tc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: #777; }
.tc-right { display: flex; align-items: center; gap: 8px; }
.tc-due { font-size: 12px; color: #555; }
.tc-due.warn { color: #9a6b00; font-weight: 600; }
.tc-due.bad { color: #c0392b; font-weight: 600; }
.tc-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 4px; }
.tc-text { min-width: 0; }
.tc-title { font-size: 15px; font-weight: 600; color: #222; overflow-wrap: anywhere; }
.tc-amount { font-size: 15px; font-weight: 600; white-space: nowrap; }
.tc-doc { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 8px; padding: 6px 10px; background: #fafaf6; border-radius: 4px; font-size: 13px; }
.tc-author { color: #555; }
.tc-note { margin-top: 8px; padding: 6px 10px; border-left: 3px solid #e6c200; background: #fffbea; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 12px; color: #777; }
.tc-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eeeee8; cursor: default; }
.tc-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.tc-sub-h { font-size: 12px; font-weight: 600; color: #777; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.tc-reply { display: grid; gap: 6px; margin-top: 10px; }
.tc-reply textarea { width: 100%; box-sizing: border-box; }
.tc-reply button { justify-self: start; }
ol.tl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #eeeee8; }
ol.tl li { position: relative; padding: 0 0 10px 10px; font-size: 13px; }
ol.tl li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #c9c9bf; border: 2px solid #fff; }
ol.tl li.tl-give::before { background: #3b6fb6; }
ol.tl li.tl-comment::before { background: #8a8a80; }
ol.tl li.tl-change::before, ol.tl li.tl-amount::before { background: #e6c200; }
ol.tl li.tl-back::before { background: #c0392b; }
ol.tl li.tl-fixed::before { background: #2e8b3d; }
ol.tl li.tl-cancel::before { background: #555; }
.tl-when { font-size: 11px; color: #999; }
.tl-text { color: #444; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 759px) { .tc-cols { grid-template-columns: 1fr; } .tc-main { flex-direction: column; gap: 4px; } }
/* The day's work: one table per kind with only its own columns; fixed widths keep them in line from table to table. */
/* The day's work stops at 1480px (2026-11-13, the user's remark: on a wide screen the record's column stretched and the
   author and difference stood far from it); a narrower screen keeps the full width. */
.wgroups { display: grid; gap: 14px; max-width: 1480px; }
.wgroup-h { padding: 8px 10px; background: #eef1f6; border-radius: 4px 4px 0 0; cursor: pointer; }
.wgroup-h b { font-size: 14px; }
.wgroup-more { padding: 8px 0 2px; text-align: center; }
table.wtable { table-layout: fixed; width: 100%; }
table.wtable th.wsev { width: 22px; }
table.wtable th.wday { width: 100px; }
table.wtable th.wparty { width: 220px; }
table.wtable th.wauthor { width: 180px; }
table.wtable th.num { width: 120px; }
table.wtable th.wact { width: 210px; }
table.wtable td.wauthor { white-space: normal; }

/* Outside programs (API keys, 2026-11-13): the new key, shown once; the form on one line. */
.key-new { border: 2px solid #e6b800; background: #fffbe6; }
.key-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.key-code { font: 14px/1.4 Consolas, monospace; background: #fff; border: 1px solid #e0d9b8; padding: 6px 10px; word-break: break-all; user-select: all; }
.key-form { display: flex; gap: 8px; flex-wrap: wrap; }
.key-form input[type="text"] { min-width: 240px; flex: 1 1 240px; }
.lg-cargo { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 12px; }
.lg-cargo-l { line-height: 1.35; }
.lg-art { display: inline-block; margin-right: 6px; padding: 0 4px; border-radius: 3px; background: #f1efe6; color: #444; font-family: Consolas, monospace; font-size: 11px; white-space: nowrap; }
button.lg-art { border: 0; height: auto; min-height: 0; line-height: 1.5; cursor: copy; vertical-align: baseline; }
button.lg-art svg { width: 10px; height: 10px; margin-left: 3px; opacity: .55; }
button.lg-art:hover { background: #e6e2d2; }
.lg-addr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; }
.lg-addr .lg-addr-edit { height: 20px; padding: 0 5px; font-size: 11px; background: none; opacity: .6; }
.lg-addr .lg-addr-edit:hover { opacity: 1; }
.lg-addr-in { flex-basis: 100%; width: 100%; font: inherit; }
.lg-where-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: baseline; gap: 6px; margin-top: 3px; }
.lg-where-l { font-size: 11px; color: var(--muted); }
.lg-where-row select.lg-place { width: 100%; }

/* Sales → send invoice (2026-11-16) */
.inv-sender { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.inv-chip { display: inline-block; padding: 3px 10px; border-radius: 12px; background: #f1f1ec; color: #555; font-size: 12px; }
.inv-chip.ok { background: #eaf6ea; color: #2d6a2d; }
.inv-chip.bad { background: #fdecea; color: #a00; }
.inv-acts { display: flex; gap: 6px; justify-content: flex-end; }
.inv-table td { vertical-align: middle; }
.inv-btn { height: 26px; padding: 0 10px; font-size: 12px; }
.inv-dialog { max-width: 560px; }
.inv-to { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.inv-to span { color: #666; font-size: 12px; }
.inv-to input { width: 100%; height: 32px; }
.inv-to-hint { margin: 4px 0 10px; }
.inv-checks p { margin: 4px 0; }
.inv-checks .warn { background: #fff4c4; border-radius: 4px; padding: 6px 10px; margin: 6px 0; }
.inv-checks ul { margin: 4px 0 0 18px; padding: 0; }
.inv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
button.inv-mail { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; height: auto; padding: 4px 10px; border: 1px solid #d8d8d0; border-radius: 6px; background: #fafaf6; color: #333; font-size: 12px; text-align: left; cursor: pointer; }
button.inv-mail b { font-size: 10px; font-weight: normal; color: #888; }
button.inv-mail.on { border-color: #e6c200; background: #fff6cc; }
.inv-state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }


/* The send dialog's letter preview: subject, attachment, body. */
.inv-letter { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line, #ddd); border-radius: 6px; display: grid; gap: 4px; }
.inv-letter svg { width: 18px; height: 16px; vertical-align: -3px; }

/* Icon buttons in the invoice list: the send one in the primary colour, the PDF sign its size. */
.inv-acts .ibtn { width: 30px; height: 28px; margin-right: 3px; }
.inv-acts .ibtn.primary { background: linear-gradient(#fff6c8, #fbd85c); border-color: #d1a900; color: #333; }
.inv-acts .ibtn > svg { width: 18px; height: 16px; }

/* Send invoice: the orders the last update brought from 1C. */
table.inv-table tbody tr.inv-new > td { background: #e8f4ff; }
table.inv-table tbody tr.inv-new:hover > td { background: #dcecfb; }

/* The act by mail: like the .xlsx / .pdf buttons beside it. */
button.mail-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 26px; box-sizing: border-box; padding: 0 8px; border: 1px solid #d8d8d0; border-radius: 8px; background: #fff; color: #444; font-weight: 500; white-space: nowrap; }
button.mail-btn svg { width: 17px; height: 15px; flex: none; fill: none; stroke: #2f6db5; stroke-width: 1.8; }
button.mail-btn:hover:not(:disabled) { border-color: #2f6db5; background: #eef4fb; color: #1f4e86; }

/* ⚙ → ხელმოწერა და ბეჭედი */
.stamp-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.stamp-prev { width: 280px; height: 200px; border: 1px dashed #ccc; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#f4f4f4 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.stamp-prev img { max-width: 260px; max-height: 185px; }
.stamp-docs { display: grid; gap: 0; max-width: 720px; }
.stamp-doc { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee; }
.stamp-doc:last-child { border-bottom: 0; }
.stamp-doc.off b { color: #888; }

/* ⚙ → 1C ბაზები */
.base-edit { max-width: 980px; }
.base-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.base-edit-head h2 { margin: 0; }
.base-group { border-top: 1px solid var(--line, #e3e3e3); padding: 12px 0 4px; }
.base-group-t { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #888); margin-bottom: 8px; }
.base-row { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 12px 16px; }
.base-group:nth-of-type(3) .base-row { grid-template-columns: 1fr 1fr 1fr; }
.base-fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; }
.base-lbl { font-weight: 600; }
.base-path { display: flex; align-items: center; gap: 4px; min-width: 0; }
.base-path input { flex: 1; min-width: 80px; }
.base-path .sub { white-space: nowrap; }
.base-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line, #e3e3e3); margin-top: 8px; }
.base-span { white-space: nowrap; }
.base-missing { max-width: 520px; max-height: 180px; overflow: auto; word-break: break-word; }
@media (max-width: 760px) { .base-row, .base-group:nth-of-type(3) .base-row { grid-template-columns: 1fr; } .base-path .sub { display: none; } }

/* კომპანია → 1C: ნაშთების გადატანა */
.transfer-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.transfer-head > div:not(.transfer-arrow) { display: flex; flex-direction: column; gap: 2px; }
.transfer-head b { font-size: 16px; }
.transfer-arrow { font-size: 22px; color: var(--muted, #888); }
.transfer-run { margin-left: auto; align-items: flex-end; }
.transfer-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.transfer-area { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 6px; border-left: 4px solid #c9c9c9; background: #fafafa; }
.transfer-area.ok { border-left-color: var(--ok); }
.transfer-area.bad { border-left-color: var(--bad); }
.transfer-area.failed { border-left-color: var(--warn); }
.transfer-errs { margin-top: 10px; }
.hc-top { align-items: center; gap: 12px; flex-wrap: wrap; }
.hc-top > h2 { margin: 0; }
.hc-top > button { margin-left: auto; }

/* Customer orders: the invoice icons stay on screen however wide the table (2026-11-18, the user's complaint: the
   order chain's columns pushed them off the right edge). */
:where(.inv-table) .inv-pin, :where(.inv-table) tr.col-fl > :last-child { position: sticky; right: 0; z-index: 1; background: var(--card); box-shadow: -8px 0 8px -8px rgba(0, 0, 0, 0.25); }

/* ⚙ → განახლება და შემოწმება: the editable timetable (one line per run, then four settings tiles) */
.sched-note { max-width: 1100px; }
.sched-rows { border: 1px solid var(--line, #e3e3e3); border-radius: 8px; overflow: hidden; margin: 12px 0 14px; }
.sched-row { display: grid; grid-template-columns: minmax(170px, 230px) 260px 1fr; gap: 16px; padding: 12px 14px; border-top: 1px solid var(--line, #e3e3e3); align-items: start; }
.sched-row:first-child { border-top: 0; }
.sched-head { background: #fafafa; padding: 7px 14px; font-size: 12px; color: var(--muted, #888); }
.sched-row.is-off .sched-name, .sched-row.is-off .sched-what { opacity: .5; }
.sched-name { display: flex; flex-direction: column; gap: 2px; }
.sched-period { margin-top: 4px; font-size: 12px; color: var(--muted, #888); }
.sched-when { display: flex; flex-direction: column; gap: 6px; }
:root .sched-when select { height: 30px; width: 100%; }
.sched-hours { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.sched-hours.idle { opacity: .4; }
.sched-what { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sched-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
:root .sched-src { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12.5px; border: 1px solid #b9dcc0; background: #f1faf2; color: #1d6b2b; cursor: pointer; }
:root .sched-src .tick { width: 10px; font-size: 11px; }
:root .sched-src.off { border: 1px dashed #c9c9c9; background: transparent; color: #999; text-decoration: line-through; }
:root .sched-src:not(:disabled):hover { border-color: #7fbf8a; }
:root .sched-src.off:not(:disabled):hover { border-color: #999; color: #666; }
:root .sched-src:disabled { cursor: default; }
.sched-count { margin-left: 4px; }
.sched-common { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0 0 12px; }
.sched-tile { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line, #e3e3e3); border-radius: 8px; background: #fcfcfa; }
.sched-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
:root .sched-ctl select { height: 30px; }
.sched-pair { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin: 0; }
.sched-days { width: 64px; height: 30px; }
.sched-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sched-foot p { margin: 0; }
.sched-wdays { display: flex; gap: 3px; }
.sched-wdays.idle { opacity: .4; }
:root .sched-wday { flex: 1; height: 26px; padding: 0; font-size: 11.5px; border-radius: 4px; border: 1px solid #d6d6d6; background: #fff; color: #999; cursor: pointer; }
:root .sched-wday.on { border-color: #b9dcc0; background: #f1faf2; color: #1d6b2b; font-weight: 600; }
:root .sched-wday:disabled { cursor: default; }
:root .sched-dirty { outline: 2px solid #f0b400; outline-offset: 1px; }
.sched-save { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border: 1px solid #f0d27a; border-radius: 8px; background: #fff8dc; box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
.sched-save-btns { display: flex; gap: 8px; }
@media (max-width: 900px) { .sched-row { grid-template-columns: 1fr; gap: 8px; } .sched-head { display: none; } }

/* Customer orders, an opened row: the order, its chain and a waybill's card on the left; the invoice's sendings in a
   narrow column on the right (2026-11-18); one column on a narrow screen. */
.inv-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 28%); gap: 12px; align-items: start; }
.inv-detail > * { min-width: 0; }
.inv-detail-wide { grid-column: 1 / -1; }
tr.detail-row table.mini.inv-chain { width: 100%; }
tr.detail-row table.mini.inv-sends { width: 100%; min-width: 0; }
.inv-sends td, table.inv-chain td { vertical-align: top; }
.inv-sends .sub { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .inv-detail { grid-template-columns: minmax(0, 1fr); } }
/* The staging copy (wrangler.jsonc env.staging): always visible, so nobody takes it for the real program. */
.staging-bar { position: sticky; top: 0; z-index: 2000; background: #b3261e; color: #fff; font-weight: 600; text-align: center; padding: 6px 12px; }

