/* ── Кольори і розміри ───────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --bg: #f4f4f0;
  --surface: #ffffff;
  --surface-2: #f0f0ea;
  --line: #dddcd3;
  --line-strong: #c5c4b9;
  --text: #1a1c18;
  --muted: #5f6359;
  --accent: #3f4f22;
  --accent-hover: #34421b;
  --accent-soft: #e6ead9;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warn: #9a5b00;
  --warn-soft: #fbf0d9;
  --ok: #2e6b35;
  --ok-soft: #e3f1e3;
  --focus: #2f6fd6;
  --shadow: 0 1px 2px rgba(20, 22, 18, .06), 0 4px 16px rgba(20, 22, 18, .06);
  --radius: 10px;
  --radius-sm: 6px;
  --side-w: 248px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121411;
    --surface: #1b1e1a;
    --surface-2: #232721;
    --line: #2f342d;
    --line-strong: #434a40;
    --text: #e9ebe4;
    --muted: #a3a99b;
    --accent: #a6bd6a;
    --accent-hover: #b8cd80;
    --accent-soft: #2b3320;
    --accent-ink: #141810;
    --danger: #f2a49b;
    --danger-soft: #3a1f1c;
    --warn: #e9b55e;
    --warn-soft: #3a2e17;
    --ok: #8fcf95;
    --ok-soft: #1d3220;
    --focus: #7aa7ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121411;
  --surface: #1b1e1a;
  --surface-2: #232721;
  --line: #2f342d;
  --line-strong: #434a40;
  --text: #e9ebe4;
  --muted: #a3a99b;
  --accent: #a6bd6a;
  --accent-hover: #b8cd80;
  --accent-soft: #2b3320;
  --accent-ink: #141810;
  --danger: #f2a49b;
  --danger-soft: #3a1f1c;
  --warn: #e9b55e;
  --warn-soft: #3a2e17;
  --ok: #8fcf95;
  --ok-soft: #1d3220;
  --focus: #7aa7ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
}

/* ── Основа ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.danger { color: var(--danger); }
.grow { flex: 1; min-width: 0; }
.hstack { display: flex; align-items: center; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.link:hover { color: var(--accent-hover); }

/* ── Кнопки і поля ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-weight: 550; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled, .btn.busy { opacity: .55; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost.danger { color: var(--danger); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: .9rem; }
.btn-lg { min-height: 48px; padding: 0 20px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.flip .ic { transform: rotate(180deg); }

.input {
  width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.input:disabled { background: var(--surface-2); color: var(--muted); }
textarea.input { resize: vertical; min-height: 96px; }
.input-sm { min-height: 34px; padding: 5px 8px; }
.input-lg { min-height: 48px; font-size: 1.05rem; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field-label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field-err { font-size: .85rem; color: var(--danger); min-height: 0; }
.field-err:empty { display: none; }
.form-msg { color: var(--danger); font-size: .9rem; }
.form-msg:empty { display: none; }
.check-row { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check-row.inline { min-height: 40px; white-space: nowrap; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; }
.checklist { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }
.checklist-scroll { max-height: 240px; overflow: auto; display: flex; flex-direction: column; }
.check-row.all { border-bottom: 1px solid var(--line); padding-bottom: 6px; }

/* ── Оболонка ───────────────────────────────────────────────────────────── */
.shell { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.brand-name { font-weight: 700; line-height: 1.2; }
.nav { flex: 1; overflow-y: auto; padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 1px; }
.nav-group { margin: 14px 10px 4px; font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--text);
  background: none; border: 0; cursor: pointer; text-align: left; width: 100%;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-user {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--line); text-decoration: none;
}
.side-user:hover { background: var(--surface-2); }
.side-user-text { display: flex; flex-direction: column; min-width: 0; }
.side-user-text small { color: var(--muted); }
.main-col { margin-left: var(--side-w); min-width: 0; }
.topbar, .tabbar, .scrim { display: none; }
.view { outline: none; }
.page { max-width: 1100px; margin: 0 auto; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 959px) {
  .side {
    transform: translateX(-100%); transition: transform .2s ease;
    width: min(86vw, 320px); box-shadow: var(--shadow);
  }
  body.drawer-open .side { transform: none; }
  body.drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .35); }
  body.drawer-open { overflow: hidden; }
  .main-col { margin-left: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar {
    display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 20;
    height: 56px; padding: 0 8px; padding-top: env(safe-area-inset-top);
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .topbar-title { flex: 1; min-width: 0; font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; inset: auto 0 0 0; z-index: 20;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar .nav-link {
    flex-direction: column; justify-content: center; gap: 2px; min-height: 60px; padding: 4px 2px;
    font-size: .72rem; text-align: center; border-radius: 0;
  }
  .tabbar .nav-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .nav-link.on { background: none; }
  .page { padding: 18px 16px 32px; }
  h1 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ── Сторінки ───────────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }
.count { display: inline-block; margin-left: 4px; font-size: .95rem; font-weight: 600; color: var(--muted); }
.item-title { overflow-wrap: anywhere; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.card.attention { border-color: var(--warn); background: var(--warn-soft); }
.card.doc { white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .input[type="search"] { flex: 1 1 220px; }
.toolbar select.input { width: auto; flex: 0 1 220px; }

/* ── Переліки ───────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list.compact { border: 0; border-radius: 0; }
.list > .row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px;
  text-decoration: none; color: inherit; border: 0; border-bottom: 1px solid var(--line);
  background: none; width: 100%; text-align: left; cursor: pointer;
}
.list > .row:last-child { border-bottom: 0; }
.list > .row:hover { background: var(--surface-2); }
.list.compact > .row { padding: 10px 0; min-height: 48px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 600; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 700; line-height: 1; }
.badge .ic { width: 16px; height: 16px; }
.badge-ammo { background: var(--warn-soft); color: var(--warn); }
.badge-access { background: var(--surface-2); color: var(--muted); }
.hero-main .badges { margin: 4px 0; }
.stock td, .stock th { text-align: left; white-space: normal; }
.supply-tile-stock { display: block; font-weight: 700; color: var(--accent); font-size: .85rem; }
.contact-sec { margin-top: 16px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.contact-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.contact-card-head .row-title { font-size: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: 4px; }
/* Графік відпусток */
.vhelp-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); color: var(--accent); font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.vhelp { display: flex; flex-direction: column; gap: 8px; padding-left: 18px; margin: 0; }
.vcal { display: flex; flex-direction: column; gap: 8px; }
.vcal-nav { display: flex; justify-content: space-between; }
.vcal-nav .icon-btn { font-size: 1.4rem; font-weight: 700; }
.vcal-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px 24px; }
.vmonth { min-width: 0; max-width: 380px; width: 100%; justify-self: center; }
.vmonth-title { font-weight: 700; text-align: center; margin-bottom: 6px; }
.vgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.vwd { text-align: center; font-size: .75rem; color: var(--muted); }
.vday { min-width: 0; height: 40px; padding: 0; border: 0; border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; background: var(--surface-2); color: var(--text); }
.vday.vblank { background: transparent; cursor: default; }
.vday.v-free:hover { outline: 2px solid var(--accent); }
.vday.v-busy { background: #c9c9c9; color: #555; cursor: not-allowed; text-decoration: line-through; }
.vday.v-buffer { background: repeating-linear-gradient(45deg, #e4e4e4, #e4e4e4 4px, #f4f4f4 4px, #f4f4f4 8px); color: #777; cursor: not-allowed; }
.vday.v-early { opacity: .35; cursor: not-allowed; }
.vday.v-mine { background: var(--warn-soft); color: var(--warn); cursor: not-allowed; }
.vday.v-today { box-shadow: inset 0 0 0 2px var(--muted); }
.vday.v-sel { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.vday.v-start, .vday.v-end { background: var(--accent); color: var(--accent-ink); }
/* неофіційна: усі дні доступні, зайняті офіційними лише видно */
.vcal-free .vday.v-busy, .vcal-free .vday.v-buffer, .vcal-free .vday.v-mine { cursor: pointer; }
.vcal-free .vday:not(.vblank):hover { outline: 2px solid var(--accent); }
.vcal-free .vday.v-sel { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.vcal-free .vday.v-start, .vcal-free .vday.v-end { background: var(--accent); color: var(--accent-ink); }
.vkind-official { background: var(--surface-2); color: var(--muted); }
.vkind-unofficial { background: #f3e8fc; color: #6b2fa0; }
.vcal-info { font-weight: 600; margin: 0; }
.vlegend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .8rem; color: var(--muted); }
.vlg::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; background: var(--surface-2); }
.vlg.v-busy::before { background: #c9c9c9; }
.vlg.v-buffer::before { background: repeating-linear-gradient(45deg, #ddd, #ddd 2px, #f4f4f4 2px, #f4f4f4 4px); }
.vlg.v-early::before { opacity: .35; }
.vlg.v-mine::before { background: var(--warn-soft); }
.vrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line, #e5e5e5); }
.vrow-main { display: flex; flex-direction: column; gap: 4px; }
.vrules { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; margin-bottom: 8px; }
.vst-pending { background: var(--warn-soft); color: var(--warn); }
.vst-approved { background: var(--accent-soft); color: var(--accent); }
.vst-proposed { background: #e8eefc; color: #2b4fa8; }
.vst-rejected, .vst-cancelled, .vst-expired { background: var(--surface-2); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .vday.v-busy { background: #555; color: #bbb; }
  .vday.v-buffer { background: repeating-linear-gradient(45deg, #3a3a3a, #3a3a3a 4px, #2c2c2c 4px, #2c2c2c 8px); color: #999; }
}
/* Дорожній лист: бланк завжди білий, Times New Roman; на друці — лише бланк (A4 альбомний) */
.wb-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.wb-sheet { min-width: 980px; color: #000; background: #fff; font-family: 'Times New Roman', Times, serif; font-size: 11pt; line-height: 1.25; }
.wb-sheet u { text-decoration: none; border-bottom: 1px solid #000; padding: 0 6px; }
.wb-top { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: start; margin-bottom: 8px; }
.wb-title { text-align: center; font-size: 13pt; }
.wb-sub { margin-top: 4px; font-size: 11pt; }
.wb-app { text-align: right; font-size: 8.5pt; }
.wb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; margin-bottom: 8px; }
.wb-line { display: flex; gap: 8px; align-items: flex-end; margin: 4px 0; }
.wb-l { white-space: nowrap; }
.wb-v { flex: 1; border-bottom: 1px solid #000; min-height: 1.3em; position: relative; padding: 0 4px; }
.wb-v small { position: absolute; left: 0; right: 0; top: 100%; text-align: center; font-size: 7pt; color: #333; }
.wb-line + .wb-line, .wb-cols .wb-line { margin-bottom: 12px; }
.wb-date { font-size: 10pt; margin: 2px 0 8px; }
.wb-table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.wb-table th, .wb-table td { border: 1px solid #000; padding: 3px 4px; text-align: center; vertical-align: middle; }
.wb-table th { font-weight: 400; font-size: 8.5pt; }
.wb-table td { height: 22px; font-size: 10.5pt; }
.wb-h { text-align: center; margin: 10px 0 2px; }
.wb-wrap { display: flex; flex-direction: column; gap: 18px; }
.wb-front .wb-top { grid-template-columns: 1fr 1.2fr 1fr; align-items: start; }
.wb-front .wb-title { font-size: 13pt; padding-top: 14px; }
.wb-no { display: inline-block; min-width: 3.5em; text-align: left; }
.wb-unit-row { display: grid; grid-template-columns: 1fr 0.6fr 1.4fr; align-items: end; margin: 2px 0 6px; }
.wb-unit-row .wb-sub { text-align: left; font-weight: 700; }
.wb-route-line { position: relative; }
.wb-mp { font-size: 8pt; margin: -10px 0 4px 6px; }
.wb-main { table-layout: fixed; }
.wb-main th { font-size: 8.5pt; }
.wb-main td.wb-box { text-align: left; vertical-align: top; padding: 4px 8px; }
.wb-cell { display: flex; flex-direction: column; gap: 4px; min-height: 92px; }
.wb-cell .wb-v { margin-top: 6px; }
.wb-cell-l { font-size: 10pt; }
.wb-tech-l { display: flex; justify-content: space-between; }
.wb-cell .wb-date { margin: 14px 0 0; }
.wb-fuel { table-layout: fixed; }
.wb-fuel td.wb-left { text-align: left; }
.wb-calc-row td { text-align: left !important; vertical-align: top; padding: 4px 8px; }
.wb-calc-row .wb-calc { margin: 0; }
.wb-page + .wb-page { border-top: 2px dashed #bbb; padding-top: 14px; }
.wb-valid { font-size: 9pt; }
.wb-fuel td, .wb-work td { height: 20px; font-size: 10pt; }
.wb-got { text-align: left !important; white-space: nowrap; }
.wb-got b { display: inline-block; min-width: 3.2em; font-weight: 400; }
.wb-sign { display: inline-block; width: 5.5em; margin: 0 6px; border-bottom: 1px solid #999; color: transparent; font-size: 7pt; }
.wb-calc { margin-top: 6px; font-size: 10pt; line-height: 1.35; }
.wb-calc-h { text-align: center; font-weight: 700; margin-bottom: 2px; }
.wb-work { table-layout: fixed; }
.wb-work th { font-size: 7.5pt; padding: 2px; }
.wb-route { overflow-wrap: anywhere; }
.wb-work .wb-nums th { font-size: 7pt; padding: 0; }
.wb-route { text-align: left !important; white-space: normal; }
.wb-work td:nth-child(12) { font-size: 8pt; line-height: 1.1; }
.wb-work td:nth-child(2), .wb-work td:nth-child(3) { white-space: nowrap; font-size: 9pt; }
.wb-total td { font-weight: 700; }
.wb-foot { margin-top: 10px; display: grid; gap: 10px; max-width: 760px; }
.card.wb-ok { border-color: var(--accent); }
.card.wb-ok .card-title { color: var(--accent); }
.wb-tips { margin: 6px 0 0; padding-left: 20px; color: var(--warn); }
/* у формі звіту: рядки «куди їздили» */
.flegs { display: flex; flex-direction: column; gap: 6px; }
.fleg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.fleg > .fday { flex: 0 0 9.2em; }
.fleg > .ftime { flex: 0 0 5.8em; }
.fleg > .froute-in { flex: 1 1 12em; min-width: 0; }
.fleg > .fkm { flex: 0 0 4.6em; }
.fleg > .fkind { flex: 0 0 8.6em; }
@media (max-width: 760px) {
  .fleg { padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); }
  .fleg > .froute-in { flex-basis: 100%; order: -1; }
}
#wb-print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  html, body { background: #fff !important; }
  body:not(.print-sec) > *:not(#wb-print) { display: none !important; }
  #wb-print { display: block; }
  #wb-print .wb-sheet { min-width: 0; width: 100%; font-size: 10pt; }
  #wb-print .wb-page { break-after: page; page-break-after: always; border: 0; padding: 0; }
  #wb-print .wb-page:last-child { break-after: auto; page-break-after: auto; }
  #wb-print .wb-work td { height: 17px; padding: 1px 3px; }
  #wb-print .wb-route { white-space: normal; min-width: 52mm; }
  #wb-print .wb-fuel td { height: 19px; }
  #wb-print .wb-foot { gap: 8px; margin-top: 6px; }
}

/* Машини і пальне */
.fcar-img-link { display: block; margin: -16px -18px 6px; }
.fcar-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); }
.fcar-ph { display: grid; place-items: center; color: var(--muted); }
.fcar-ph .ic { width: 48px; height: 48px; opacity: .5; }
@media (max-width: 600px) { .fcar-img-link.no-photo { display: none; } }
.veh-photo { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.veh-photo img { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.photo-wide { width: 100%; max-width: 360px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.photo-wide.ph { display: grid; place-items: center; color: var(--muted); }
.vhelp-admin-title { margin: 8px 0 0; font-weight: 700; }
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.fcar { gap: 6px; }
.fcar-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fcar-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.fcar-name svg { flex: none; }
.fcar-now { font-weight: 600; }
.fst-ok { background: var(--accent-soft); color: var(--accent); }
.fst-repair { background: var(--warn-soft); color: var(--warn); }
.fst-off, .tst-cancelled { background: var(--surface-2); color: var(--muted); }
.tst-booked { background: #e8eefc; color: #2b4fa8; }
.tst-now { background: var(--accent-soft); color: var(--accent); }
.tst-done { background: var(--surface-2); color: var(--text); }
.tst-late { background: var(--warn-soft); color: var(--danger, var(--warn)); }
.froute { display: flex; flex-direction: column; gap: 6px; }
.froute-row { display: flex; align-items: center; gap: 6px; }
.froute-row .input { flex: 1 1 auto; min-width: 0; }
.froute-row .input.fkm { flex: 0 0 84px; }
.froute-row select.input { flex: 1 1 auto; }
.froute-n { flex: 0 0 52px; font-size: .85rem; color: var(--muted); }
.froute .btn { align-self: flex-start; }
.fest { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.fwarn { margin: 4px 0 0; padding-left: 18px; color: var(--danger, var(--warn)); }
.fgrid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px 16px; }
.frow { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.frow > :last-child { text-align: right; overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) {
  .tst-booked { background: #26324d; color: #a9c0f5; }
}
.stock tfoot th { font-weight: 700; }
.row-sub { font-size: .87rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-num { font-weight: 600; white-space: nowrap; }
.row .chev { transform: rotate(180deg); color: var(--muted); width: 18px; height: 18px; }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar.ph { display: inline-grid; place-items: center; font-size: .85rem; font-weight: 700; color: var(--muted); }
.avatar.xl { width: 112px; height: 112px; font-size: 1.6rem; }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.avatar-lg.ph { display: grid; place-items: center; color: var(--muted); }
.avatar-lg.ph .ic { width: 36px; height: 36px; }
.photo-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: .85rem; text-decoration: none; color: inherit; white-space: nowrap;
}
.chip-x { border: 0; background: none; padding: 0 0 0 6px; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; }
.tag-chip { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
button.chip { cursor: pointer; font: inherit; font-size: .85rem; }
button.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tag-filter { margin: 0 0 4px; }
.rel-results { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.rel-opt { display: flex; gap: 6px; align-items: center; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.rel-opt:hover { border-color: var(--accent); }
.tag-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag-row .input { flex: 1 1 160px; min-width: 0; }
.chip-strong { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; align-self: flex-start; }
.chip-off { color: var(--danger); }
.role-superadmin, .role-admin { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.st-granted, .st-done, .st-signed { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.st-requested, .st-work, .st-submitted { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.st-denied, .st-revoked, .st-cancelled { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ── Картка запису ──────────────────────────────────────────────────────── */
.dl { margin: 0; display: grid; grid-template-columns: minmax(140px, 220px) 1fr; }
.dl-row { display: contents; }
.dl dt, .dl dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.dl dt { color: var(--muted); padding-right: 16px; }
.dl dd { overflow-wrap: anywhere; min-width: 0; }
.dl .dl-row:last-child dt, .dl .dl-row:last-child dd { border-bottom: 0; }
@media (max-width: 599px) {
  .dl { grid-template-columns: 1fr; }
  .dl dt { border-bottom: 0; padding-bottom: 0; font-size: .85rem; }
}
.hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hero-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 260px; }
.hero-call { font-size: 1.1rem; font-weight: 600; }
.ok-line { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.hist { border-bottom: 1px solid var(--line); padding-bottom: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hist-diff { margin: 0; padding-left: 18px; font-size: .9rem; }
.hist-diff s { color: var(--muted); }

/* ── Форма ──────────────────────────────────────────────────────────────── */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form .field.wide, .form-foot { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .field.wide, .form-grid .form-msg { grid-column: 1 / -1; }
.form-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.form-foot .form-msg { flex: 1; }
@media (max-width: 699px) {
  .form, .form-grid { grid-template-columns: 1fr; }
}

/* ── Таблиці (доступи, табель) ──────────────────────────────────────────── */
.table-wrap { overflow: auto; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: 70vh; }
.grid-table { border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.grid-table th, .grid-table td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px 8px; text-align: center; white-space: nowrap; }
.grid-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-weight: 600; }
.grid-table .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 180px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.grid-table thead .sticky-col { z-index: 3; background: var(--surface-2); }
.grid-table th a { text-decoration: none; }
.grid-table th a:hover { text-decoration: underline; }
.matrix td { min-width: 120px; }
.acc { display: flex; flex-direction: column; align-items: center; padding: 4px 8px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; font-size: .85rem; }
.acc small { font-weight: 400; opacity: .85; }
.cell-add { display: block; color: var(--muted); text-decoration: none; font-size: 1.1rem; }
.cell-add:hover { color: var(--accent); }
.ts td.code { min-width: 34px; height: 34px; padding: 0 4px; font-weight: 600; }
.ts td.code[role="button"] { cursor: pointer; }
.ts td.code[role="button"]:hover { background: var(--accent-soft); }
.ts .we { background: var(--surface-2); }
.ts thead th.today { background: var(--accent); color: var(--accent-ink); }
.ts thead .ts-d { display: block; }
.ts thead .ts-wd { display: block; font-size: .7rem; font-weight: 500; color: var(--muted); }
.ts thead th.today .ts-wd { color: inherit; opacity: .85; }
.ts td.tot { text-align: left; color: var(--muted); }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav strong { min-width: 150px; text-align: center; }
.code-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.code-pick .btn { min-width: 52px; }

/* ── Головна ────────────────────────────────────────────────────────────── */
.home-title { font-size: 1.6rem; }
.bday { border-color: var(--accent); }
.bday .card-title .ic { color: var(--accent); }
.bday-row { display: flex; gap: 12px; flex-wrap: wrap; }
.bday-when { min-width: 190px; color: var(--muted); }
.bday-when.now { color: var(--accent); font-weight: 700; }
.task-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-row .btn { margin-left: auto; }
.dl-line { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.dl-line .date { min-width: 96px; font-weight: 600; }
.dl-line .grow { flex: 1 1 200px; min-width: 0; }
.dl-group { margin: 4px 0 0; font-weight: 600; font-size: .9rem; color: var(--muted); }
.dl-group.danger { color: var(--danger, var(--warn)); }
.subtiles { margin: 0 0 4px; }
.dl-head { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; font-size: 1.1rem; }
.dl-sum { font-size: .9rem; font-weight: 600; color: var(--muted); }
.dl-sum.danger { color: var(--danger, var(--warn)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile {
  display: flex; align-items: center; gap: 10px; padding: 14px; min-height: 60px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; font-weight: 600;
}
.tile:hover { border-color: var(--accent); }
.tile .ic { color: var(--accent); }

/* ── Інструменти для файлів ─────────────────────────────────────────────── */
.ttiles .tile { align-items: flex-start; }
.ttile-text { display: grid; gap: 2px; }
.ttile-sub { font-weight: 400; font-size: .82rem; color: var(--muted); }
.tdrop { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 18px; border: 2px dashed var(--line-strong); border-radius: var(--radius); }
.tdrop.over { border-color: var(--accent); background: var(--accent-soft); }
.tdrop label.btn { cursor: pointer; }
.tlist { display: grid; gap: 6px; }
.trow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.trow-no { color: var(--muted); min-width: 1.6em; }
.trow-name { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.topts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tpages { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.tpage { display: grid; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.tpage.del { opacity: .4; }
.tpage.del .tthumb { outline: 2px solid var(--danger, #c62828); }
.tthumb { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--surface-2); border-radius: 4px; }
.tthumb canvas { max-width: 92%; max-height: 92%; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); background: #fff; transition: transform .15s; }
.tpage-bar { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.tpage-bar .icon-btn { min-width: 34px; min-height: 34px; }
.tangle { font-size: .82rem; color: var(--muted); }
.tangle.on { color: var(--accent); font-weight: 600; }
.tres-head { justify-content: space-between; }
.tresult { border-color: var(--accent); }

/* ── Вкладки, перемикачі, довідники ─────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; align-self: flex-start; flex-wrap: wrap; }
.seg-btn { border: 0; background: var(--surface); padding: 8px 14px; cursor: pointer; min-height: 40px; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn.on { background: var(--accent); color: var(--accent-ink); }
.dict { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.dict summary { cursor: pointer; min-height: 28px; }
.dict[open] summary { margin-bottom: 8px; }
.dict-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dict-item { display: inline-flex; align-items: center; gap: 2px; padding-left: 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.dict-item .icon-btn { width: 30px; height: 30px; }
.dict-item .ic { width: 16px; height: 16px; }
.search-form { display: flex; gap: 8px; }

/* ── Порожньо, завантаження ─────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 16px; text-align: center; color: var(--muted); }
.empty .ic { width: 32px; height: 32px; }
.loading { display: flex; justify-content: center; gap: 6px; padding: 48px 0; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .loading span { animation: none; opacity: .6; } }

/* ── Вікна і повідомлення ───────────────────────────────────────────────── */
.modal {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow);
}
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(0, 0, 0, .4); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { overflow-wrap: anywhere; }
.modal-body { padding: 16px 18px; overflow: auto; max-height: calc(100vh - 180px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); box-shadow: var(--shadow); transition: opacity .4s; }
.toast.err { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.auth-card.anketa { max-width: 520px; }
.update-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* ── Вхід ───────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.auth-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); }
.auth-mark .ic { width: 24px; height: 24px; }

/* ── Значки таблиць і напрямів ──────────────────────────────────────────── */
.mark {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent);
}
.mark .ic { width: 22px; height: 22px; }
.title-row { display: flex; align-items: center; gap: 12px; }
.title-row .mark { width: 48px; height: 48px; }
.title-row .mark .ic { width: 26px; height: 26px; }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-opt {
  display: grid; place-items: center; height: 44px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.icon-opt:hover { border-color: var(--accent); }
.icon-opt:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.icon-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.icon-opt .ic { width: 22px; height: 22px; }
.icon-none { color: var(--muted); font-weight: 700; }

/* ── Забезпечення ───────────────────────────────────────────────────────── */
.supply-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.supply-tile {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px; min-height: 76px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit;
}
.supply-tile:hover { border-color: var(--accent); }
.supply-tile-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 2px; }
.supply-tile-sub { font-size: .87rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  text-decoration: none; color: inherit; font-weight: 600; background: var(--surface);
}
.link-btn:hover { border-color: var(--accent); color: var(--accent); }
.link-btn span { overflow-wrap: anywhere; }
.links-edit { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.links-edit > .stack { width: 100%; gap: 8px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
@media (max-width: 699px) {
  .link-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .link-row .input[type="url"] { grid-column: 1; grid-row: 2; }
  .link-row .icon-btn { grid-column: 2; grid-row: 1 / span 2; }
}

/* ── Рядок з посиланням: назва — на таблицю, стрілка — у картку ──────────── */
.row-linked { cursor: pointer; }
.row-ext {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%;
  color: var(--text); text-decoration: none; border-radius: 4px;
}
.row-ext span { overflow-wrap: anywhere; }
.row-ext .ext { width: 15px; height: 15px; color: var(--muted); flex: none; }
.row-ext:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.row-ext:hover .ext { color: var(--accent); }
.row-form {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 32px; margin: 2px 0;
  color: var(--accent); text-decoration: none; font-size: .92em;
}
.row-form svg { width: 15px; height: 15px; flex: none; }
.row-form:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-card { display: grid; place-items: center; width: 40px; height: 40px; margin-right: -8px; border-radius: var(--radius-sm); color: var(--muted); flex: none; }
.row-card:hover { background: var(--surface-2); color: var(--text); }

/* ── Контакти напряму ───────────────────────────────────────────────────── */
.contact-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1.2fr) 40px; gap: 8px; align-items: center; }
@media (max-width: 699px) {
  .contact-row { grid-template-columns: minmax(0, 1fr) 40px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .contact-row .input { grid-column: 1; }
  .contact-row .icon-btn { grid-column: 2; grid-row: 1 / span 3; }
}
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact:last-child { border-bottom: 0; }
.contact-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* ── Доручення: дошка ───────────────────────────────────────────────────── */
.page.page-wide { max-width: none; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
@media (max-width: 1099px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .board { grid-template-columns: minmax(0, 1fr); } }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 160px; min-width: 0; }
.col.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 12px; }
.col-head .col-add { margin-left: auto; width: 32px; height: 32px; }
.col-cards { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; flex: 1; min-height: 80px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; border: 0; padding: 0; min-height: 0; }
.dot.st-new { background: #8a8f86; }
.dot.st-work { background: #2f6fd6; }
.dot.st-review { background: #b07a00; }
.dot.st-done { background: #2e7d3a; }
.task-card {
  display: flex; flex-direction: column; gap: 8px; padding: 12px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.task-card:hover { border-color: var(--accent); }
.task-card[draggable="true"] { cursor: grab; }
.task-card.dragging { opacity: .5; }
.task-card.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-card .chip { align-self: flex-start; }
.task-title { font-weight: 600; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .85rem; }
.task-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta .ic { width: 15px; height: 15px; }
.task-people { margin-left: auto; display: inline-flex; }
.avatar.sm { width: 26px; height: 26px; font-size: .7rem; margin-left: -6px; border: 2px solid var(--surface); }
.task-people .avatar.sm:first-child { margin-left: 0; }
.pr-urgent { background: var(--danger-soft); color: var(--danger); border-color: transparent; font-weight: 600; }
.pr-high { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 600; }
.pr-low { color: var(--muted); }
.pr-elevated { color: var(--warn); border-color: var(--warn-soft); }

/* Доручення голосом */
.voice-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.voice-mic { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; }
.voice-mic .ic { width: 28px; height: 28px; }
.voice-mic.on { background: var(--danger); animation: voice-pulse 1.2s ease-in-out infinite; }
.voice-state { flex: 1; min-width: 140px; color: var(--muted); }
.voice-done { min-height: 48px; padding-inline: 20px; }
.voice-out { border-top: 1px solid var(--line); padding-top: 12px; }
.urg-seg .seg-btn { min-width: 44px; }
.field-note { font-size: .85rem; color: var(--warn); }
.field-note:empty { display: none; }
.kw summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.kw-list { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; line-height: 1.35; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
@keyframes voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--danger-soft); } 50% { box-shadow: 0 0 0 10px var(--danger-soft); } }
@media (prefers-reduced-motion: reduce) { .voice-mic.on { animation: none; } }
.task-group .dot { margin-right: 6px; }
.st-review { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* ── Доручення: сторінка задачі ─────────────────────────────────────────── */
.status-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.status-btn { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; color: var(--text); }
.status-btn:disabled { cursor: default; opacity: .55; }
.status-btn.on { opacity: 1; border-color: transparent; }
.status-btn.on.st-new { background: #8a8f86; color: #fff; }
.status-btn.on.st-work { background: #2f6fd6; color: #fff; }
.status-btn.on.st-review { background: #b07a00; color: #fff; }
.status-btn.on.st-done { background: #2e7d3a; color: #fff; }
.progress { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--ok); transition: width .2s; }
.sub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sub-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sub-item:last-child { border-bottom: 0; }
.sub-main { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.sub-main input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.sub-item.done .sub-text { text-decoration: line-through; color: var(--muted); }
.sub-meta { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.sub-row { display: grid; grid-template-columns: 28px minmax(0, 2fr) minmax(0, 1.2fr) 150px 40px; gap: 8px; align-items: center; }
.sub-check { display: grid; place-items: center; }
.sub-check input { width: 20px; height: 20px; accent-color: var(--accent); }
@media (max-width: 699px) {
  .sub-row { grid-template-columns: 28px minmax(0, 1fr) 40px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .sub-row select, .sub-row input[type="date"] { grid-column: 2; }
  .sub-row .icon-btn { grid-column: 3; grid-row: 1; }
}

/* ── Доступи Google ─────────────────────────────────────────────────────── */
.perm { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.perm:last-child { border-bottom: 0; }
.perm .input-sm { width: auto; }
.grant-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) 150px auto; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px solid var(--line); }
@media (max-width: 699px) { .grant-row { grid-template-columns: 1fr; } }
.role-g-owner { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.role-g-writer { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.role-g-commenter { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.role-g-reader { background: var(--surface-2); }
.col-res { display: inline-flex; align-items: center; gap: 6px; }
.col-res .mark { width: 26px; height: 26px; }
.col-res .mark .ic { width: 16px; height: 16px; }
.grid-table td.clickable { cursor: pointer; }
.grid-table td.clickable:hover { background: var(--accent-soft); }
.grid-table .contact-main { gap: 0; }

/* ── Головна як CRM ─────────────────────────────────────────────────────── */
.home-board { display: flex; flex-direction: column; gap: 12px; }
.home-board .page-head h2 { font-size: 1.25rem; }

/* ── Код з телефона ─────────────────────────────────────────────────────── */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.secret-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.1rem; letter-spacing: .06em; overflow-wrap: anywhere; user-select: all; }
.code-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.6rem; letter-spacing: .4em; text-align: center; }

/* Кнопка «Дорожній лист» на картці машини — перелік періодів */
.fcar { position: relative; }
.wb-menu { position: static; }
.wb-menu > summary { list-style: none; }
.wb-menu > summary::-webkit-details-marker { display: none; }
.wb-menu-list { position: absolute; z-index: 30; left: 8px; right: 8px; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; }
.wb-menu-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.wb-menu-item:hover, .wb-menu-item:focus-visible { background: var(--accent-soft); }
.wb-menu-item .wb-menu-p { font-weight: 600; white-space: nowrap; }
.wb-menu-item .muted { grid-column: 1; }
.wb-menu-item .chip { grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap; }

/* Дорожній лист: порожня клітинка, яку треба дописати (час, маршрут) — червона лише на екрані */
/* 24.11.2026 власник: усе, що треба переписати в оригінал, — підсвічено жовтим (і на екрані, і в PDF/друці) */
/* 24.11.2026 власник: місце під підпис — між званням і прізвищем; у графі 14 звороту — біля одометра */
.wb-sheet .wb-sign-gap { display: inline-block; width: 7em; }
.wb-work td.wb-odo { text-align: left !important; white-space: nowrap; }
.wb-sheet .wb-sign-odo { display: inline-block; width: 50%; margin-left: 6px; border-bottom: 1px solid #999; height: .9em; vertical-align: baseline; }
.wb-sheet .wb-fill { background: #fff3a3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.wb-sheet td.wb-miss { background: #fde4e1; box-shadow: inset 0 0 0 1.5px #c62828; } /* аркуш завжди білий — кольори сталі */
@media print { .wb-sheet td.wb-miss, #wb-print td.wb-miss { background: none !important; box-shadow: none !important; } }
/* 24.11.2026 власник: «1 в 1 як сам лист», коротко, щоб влазило від руки — дата/час «01.11/8:00»; розрахунку ПММ у листі немає */
.wb-work td.wb-when { white-space: nowrap; font-size: 9pt; padding-left: 2px; padding-right: 2px; }
@media print { #wb-print .wb-work td.wb-when { font-size: 9pt; padding: 1px 2px; } }
@media print { #wb-print .wb-work td:nth-child(12) { white-space: nowrap; font-size: 9pt; } }

/* Доручення: відмітки (стан + що зроблено) */
.checkins { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checkin { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); }
.checkin-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.checkin-text { white-space: pre-wrap; }
.tasks-new-title { margin: 16px 0 8px; }
.task-card .chip.tst-late { justify-self: start; }

/* Штат: фільтри з числами */
.facets { display: grid; gap: 10px; }
.facets-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.facet { display: grid; gap: 6px; }
.facet-title { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facet-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.facet-chip { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font: inherit; font-size: .9rem; }
.facet-chip b { font-weight: 700; }
.facet-chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.facet-chip:disabled { opacity: .45; cursor: default; }
.tok { color: var(--ok); }

/* «Звіт з безпеки» (07.11.2026) */
.sec-page { max-width: 920px; }
.sec-actions { justify-content: flex-end; margin-bottom: 8px; }
.sec-head h1 { margin: 0 0 4px; }
.sec-sub { margin: 0; color: var(--muted); }
.sec-legend { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
.sec-sum { margin: 12px 0; font-weight: 600; }
.sec-card { margin-top: 12px; }
.sec-list { display: grid; gap: 14px; }
.sec-item { border-top: 1px solid var(--line); padding-top: 12px; }
.sec-item:first-child { border-top: 0; padding-top: 0; }
.sec-row { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.sec-detail { margin: 6px 0 4px; }
.sec-proof { margin: 0; padding-left: 18px; font-size: .85rem; color: var(--muted); }
.sec-proof li { margin: 2px 0; overflow-wrap: anywhere; }
.sec-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; border: 1px solid currentColor; }
.sec-ok { color: var(--ok); }
.sec-bad { color: var(--danger); }
.sec-warn { color: var(--warn, #b26b00); }
.sec-info { color: var(--muted); }
.sec-limits { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
#sec-print { display: none; }
@page sec { size: A4 portrait; margin: 14mm; }
@media print {
  body.print-sec { background: #fff !important; }
  body.print-sec > *:not(#sec-print) { display: none !important; }
  body.print-sec #sec-print { display: block; page: sec; color: #000; font-size: 10.5pt; }
  #sec-print .card { box-shadow: none; border: 1px solid #bbb; break-inside: auto; }
  #sec-print .sec-item { break-inside: avoid; }
  #sec-print .sec-proof, #sec-print .sec-sub, #sec-print .sec-legend { color: #333; }
  #sec-print .sec-ok { color: #0a6b2e; } #sec-print .sec-bad { color: #b00020; } #sec-print .sec-warn { color: #8a5300; }
}

/* Права користувача по розділах: бачить / змінює (07.11.2026) */
.rights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 16px; }
.right-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.right-row > span { flex: 1 1 auto; min-width: 0; }
.right-row > select { flex: 0 0 auto; width: auto; min-width: 150px; }

/* Тижневий звіт психологічної служби (07.11.2026) */
.psy-subj { font-weight: 600; margin: 4px 0; }
.psy-body { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .9rem; background: var(--bg-soft, rgba(0,0,0,.03)); padding: 10px; border-radius: 8px; margin: 0; }
.psy-push { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 4px 0 10px; }
.psy-weeks { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: thin; }
.psy-weeks .chip { flex: 0 0 auto; min-height: 38px; padding: 0 14px; gap: 6px; font-size: .9rem; }
.psy-weeks .chip small { opacity: .75; }
.psy-kv { display: flex; flex-direction: column; max-width: 760px; }
.psy-kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.psy-kv-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.psy-kv-sec { margin: 14px 0 0; font-weight: 600; font-size: .85rem; color: var(--muted); }
.psy-kv-sec:first-child { margin-top: 0; }
.psy-fold > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0; }
.psy-fold > summary::-webkit-details-marker { display: none; }
.psy-fold > summary::after { content: '▾'; color: var(--muted); font-size: 1.1rem; transition: transform .15s; }
.psy-fold[open] > summary::after { transform: rotate(180deg); }
.psy-fold[open] > summary { margin-bottom: 10px; }
.psy-big { font-size: 1.6rem; font-weight: 700; margin: 0; }
.push-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.push-nag { border-color: var(--accent); }
.psy-lines { display: flex; flex-direction: column; gap: 4px; }
.psy-line { margin: 0; overflow-wrap: anywhere; }
.psy-line.sub { padding-left: 18px; }
.psy-line.head { font-weight: 600; margin-top: 6px; }
.psy-table th { white-space: pre-line; }
.psy-table .sticky-col { white-space: normal; min-width: 150px; max-width: 220px; font-weight: 400; }
.psy-table thead .sticky-col { font-weight: 600; }
.psy-table tr.psy-sec td { text-align: left; font-weight: 600; background: var(--surface-2); }
.psy-table tr.psy-sec span { position: sticky; left: 8px; }
.card-link { display: block; text-decoration: none; color: inherit; }

/* ── «Штат»: посади, вільні, склад за званням (07.11.2026) ─────────────────── */
.stf-sum { display: flex; flex-direction: column; gap: 10px; }
.stf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stf-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.stf-stat strong { font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stf-stat span { font-size: .85rem; color: var(--muted); }
.stf-stat.warn strong { color: var(--danger); }
.stf-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.stf-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.stf-grp { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.stf-grp:first-of-type { border-top: 0; padding-top: 0; }
.stf-grp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
button.chip.stf-rank { min-height: 34px; }
.stf-free-n { color: var(--danger); margin-left: 4px; }
button.chip.on .stf-free-n { color: inherit; opacity: .85; }
.stf-controls .input { width: 100%; }
.stf-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; align-self: stretch; scrollbar-width: thin; }
.stf-tabs .seg-btn { flex: 0 0 auto; white-space: nowrap; }
.stf-tabs .seg-btn small { opacity: .75; }
.stf-unit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.stf-rows { display: flex; flex-direction: column; }
.stf-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.stf-rows > .stf-row:first-child { border-top: 0; }
.stf-row:hover .stf-row-top strong, .stf-row:hover > .stf-row-main > strong { text-decoration: underline; }
.stf-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.stf-row-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.stf-num { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.stf-who { overflow-wrap: anywhere; }
.stf-free { align-self: flex-start; background: var(--danger-soft, rgba(200,40,40,.1)); color: var(--danger); border-color: transparent; font-weight: 600; }
.stf-vac-ic { color: var(--danger); background: var(--danger-soft, rgba(200,40,40,.1)); }
.stf-row.vacant .stf-row-top strong { color: var(--muted); }
@media (max-width: 420px) { .stf-stat { padding: 8px; } .stf-stat strong { font-size: 1.45rem; } }

/* ── Переписка в дорученні і «Нові повідомлення» (12.11.2026) ───────────────── */
.cmts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cmt { max-width: min(560px, 92%); padding: 8px 12px; border-radius: 12px; background: var(--surface-2); align-self: flex-start; }
.cmt.mine { align-self: flex-end; background: var(--accent-soft); }
.cmt-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 2px; }
.cmt-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.notices-card { border-color: var(--accent); }
.notices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.notice { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.notices li:first-child .notice { border-top: 0; }
.notice:hover .notice-title { text-decoration: underline; }
.notice-body { overflow-wrap: anywhere; }

/* «Хто поставив» на дошці доручень (12.11.2026) */
.pick { position: relative; }
.pick > summary { list-style: none; cursor: pointer; white-space: nowrap; }
.pick > summary::-webkit-details-marker { display: none; }
.pick-panel { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 240px;
  max-width: calc(100vw - 32px); max-height: 60vh; overflow: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.pick-people { display: flex; flex-direction: column; gap: 4px; padding-left: 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.pick-panel .btn { align-self: flex-start; margin-top: 4px; }

/* Файли в дорученні (18.11.2026) */
.task-files { margin: 0; padding: 0; list-style: none; }
.task-file { display: flex; align-items: center; gap: 8px; }
.task-file .row-btn { flex: 1; min-width: 0; text-align: left; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.task-file .row-title { overflow-wrap: anywhere; }
