/* app.css — компоненти поверх токенів (структура на хайрлайн-бордерах, не на тінях).
   Екранні стилі (сцена, таймлайн, карта…) — у pages.css. Кольори/розміри — лише через var(--…) з tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.4; }
a { color: var(--link); } a:hover { color: var(--link-hover); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
svg { flex: none; }

/* ── Типографічні атоми ── */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
.code { font-family: var(--font-mono); font-size: .92em; }
.disp { font-family: var(--font-sans); letter-spacing: -.015em; }
.cap { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); }
.unit { font-weight: 500; color: var(--ink-4); }
.muted { color: var(--ink-4); } .dim { color: var(--ink-5); } .sec { color: var(--ink-3); }
.ok { color: var(--green-ink); } .err { color: var(--red-ink); } .warn { color: var(--amber-ink); } .link-blue { color: var(--blue-ink); }
.nowrap { white-space: nowrap; } .right { text-align: right; } .grow { flex: 1 1 0; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-flex { display: flex; align-items: center; gap: var(--sp-2); }
.stack { display: flex; flex-direction: column; gap: var(--sp-2); }

/* ── Тони: змінні, які читають пігулки, крапки, плашки ── */
.t-blue   { --p-bg: var(--blue-bg);   --p-ink: var(--blue-ink);  --p-dot: var(--blue);   --p-line: var(--blue-line); }
.t-amber  { --p-bg: var(--amber-bg);  --p-ink: var(--amber-ink); --p-dot: var(--amber);  --p-line: var(--amber-line); }
.t-red    { --p-bg: var(--red-bg);    --p-ink: var(--red-ink);   --p-dot: var(--red);    --p-line: var(--red-line); }
.t-green  { --p-bg: var(--green-bg);  --p-ink: var(--green-ink); --p-dot: var(--green);  --p-line: var(--green-line); }
.t-teal   { --p-bg: var(--teal-bg);   --p-ink: var(--teal-ink);  --p-dot: var(--teal);   --p-line: var(--teal-bg); }
.t-slate  { --p-bg: var(--slate-bg);  --p-ink: var(--slate-ink); --p-dot: var(--slate);  --p-line: var(--line); }
.t-off    { --p-bg: var(--off-bg);    --p-ink: var(--off-ink);   --p-dot: var(--off);    --p-line: var(--off-line); }
.t-free   { --p-bg: var(--free-bg);   --p-ink: var(--free-ink);  --p-dot: var(--free);   --p-line: var(--line); }
.t-purple { --p-bg: var(--purple-bg); --p-ink: var(--purple);    --p-dot: var(--purple); --p-line: var(--purple-bg); }
.t-neutral{ --p-bg: var(--soft);      --p-ink: var(--ink-2);     --p-dot: var(--free);   --p-line: var(--line); }
/* Статуси порту: C заряджається · P підключено · F вільний · E помилка · O офлайн */
.st-C { --p-bg: var(--blue-bg);  --p-ink: var(--blue-ink);  --p-dot: var(--blue);  --p-line: var(--blue-line); --p-fill: var(--blue-d); }
.st-P { --p-bg: var(--amber-bg); --p-ink: var(--amber-ink); --p-dot: var(--amber); --p-line: var(--amber-line); --p-fill: var(--amber-fill); }
.st-F { --p-bg: var(--green-bg); --p-ink: var(--green-ink); --p-dot: var(--green); --p-line: var(--green-line); --p-fill: var(--green); }
.st-E { --p-bg: var(--red-bg);   --p-ink: var(--red-ink);   --p-dot: var(--red);   --p-line: var(--red-line);   --p-fill: var(--red-fill); }
.st-O { --p-bg: var(--off-bg);   --p-ink: var(--off-ink);   --p-dot: var(--off);   --p-line: var(--off-line);   --p-fill: var(--off); }
/* Серйозність алерту */
.sev-crit { --p-bg: var(--red-bg);   --p-ink: var(--red-ink);   --p-dot: var(--red-ink); --p-line: var(--red-line); }
.sev-high { --p-bg: var(--red-bg);   --p-ink: #C4281D;          --p-dot: var(--red);     --p-line: var(--red-line); }
.sev-warn { --p-bg: var(--amber-bg); --p-ink: var(--amber-ink); --p-dot: var(--amber);   --p-line: var(--amber-line); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p-dot, var(--free)); flex: none; }
.dot.sq { border-radius: 3px; width: 10px; height: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--p-bg, var(--soft)); color: var(--p-ink, var(--ink-2)); font-size: var(--fs-sm); font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; background: var(--p-dot); }
.pill.lg { padding: 4px 10px; }
.pill.wrap { white-space: normal; max-width: 100%; line-height: 1.35; border-radius: var(--r); }
.badge-count { background: var(--red); color: #fff; font-size: var(--fs-xs); padding: 1px 7px; border-radius: var(--r-pill); font-weight: 700; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); background: var(--p-bg, var(--soft)); color: var(--p-ink, var(--ink-2)); white-space: nowrap; }
.tag .dot { width: 6px; height: 6px; }
.prov { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--soft); color: var(--ink-3); border: 1px solid var(--line); white-space: nowrap; }

/* ── Оболонка: шапка, навігація, пошук ── */
.app-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 12px 32px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-logo { width: 36px; height: 36px; border-radius: var(--r); background: var(--ink); display: flex; align-items: center; justify-content: center; color: #fff; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -.015em; line-height: 1.25; }
.brand-sub { font-size: var(--fs-sm); color: var(--ink-4); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r); color: var(--ink); font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--field); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav .badge-count { line-height: 1.5; }
.hdr-right { flex: 1 1 300px; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px 18px; }
.search { position: relative; flex: 0 1 380px; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 12px; color: var(--ink-4); pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--line-input); border-radius: var(--r); background: var(--field); text-overflow: ellipsis; }
/* Пошук у шапці стискається (до 150 px), а не переносить чип «Інтеграції» на другий рядок: шапка лишається в один рядок від ~1280 px. */
.hdr-right .search { flex: 1 1 150px; min-width: 150px; max-width: 380px; }
.hdr-chip { white-space: nowrap; }
.hdr-chip { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); color: var(--ink-3); background: none; border: none; padding: 6px 8px; border-radius: var(--r); }
.hdr-chip:hover { background: var(--field); }
.hdr-user { cursor: pointer; font-family: inherit; }
.hdr-user-name { display: none; font-weight: 600; }
@media (min-width: 1500px) { .hdr-user-name { display: inline; } }
.hdr-chip.demo { color: var(--amber-ink); font-weight: 700; }

.main { max-width: var(--maxw); margin: 0 auto; padding: var(--sp-6) var(--sp-8) 48px; display: flex; flex-direction: column; gap: var(--sp-4); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.page-head h1 { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.02em; }
.page-sub { font-size: var(--fs-base); color: var(--ink-3); margin-top: 2px; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--fs-base); color: var(--ink-4); margin-bottom: 4px; }
.crumbs a { color: var(--ink-4); text-decoration: none; } .crumbs a:hover { color: var(--ink); text-decoration: underline; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.toolbar .search { flex: 1 1 280px; max-width: 420px; }
.toolbar .search input { background: var(--card); }

/* ── Картки, KPI, колонки ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); }
.card.clip { overflow: hidden; }
.card.pad { padding: var(--sp-5); }
.card.r14 { border-radius: var(--r-lg); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); }
.card-head.bordered { border-bottom: 1px solid var(--line-soft); }
.card-head h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.015em; }
.card-foot { padding: var(--sp-3) var(--sp-5); font-size: var(--fs-sm); color: var(--ink-4); border-top: 1px solid var(--line-soft); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: var(--sp-3); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); color: var(--ink-3); }
.kpi-val { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.kpi-val b { font-size: var(--fs-kpi); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.kpi-val .unit { font-size: var(--fs-md); }
.kpi-sub { font-size: var(--fs-sm); color: var(--ink-4); }
/* Клікабельна плитка (фільтр): та сама картка, але кнопка зі станом «вибрано». */
.kpi-btn { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color var(--tr), box-shadow var(--tr); }
.kpi-btn:hover { border-color: var(--line-strong); }
.kpi-btn.on, .kpi-btn[aria-pressed="true"] { border-color: var(--ink); box-shadow: var(--sh-select); }
.cols { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-start; }
.cols > .main-col { flex: 999 1 640px; min-width: 0; }
.cols > .side-col { flex: 1 1 360px; min-width: 0; }
.aside { display: flex; flex-direction: column; gap: var(--sp-4); }
.aside-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.aside h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.015em; }
.sec-title { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.015em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: var(--fs-base); align-items: baseline; }
.kv > :nth-child(odd) { color: var(--ink-4); }
.kv > :nth-child(even) { font-weight: 600; text-align: right; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--r); }
.fact > span:first-child { font-size: var(--fs-sm); color: var(--ink-4); }
.fact.hl { border-color: var(--blue-line); background: var(--blue-wash); } .fact.hl > span:first-child { color: var(--blue-ink); }
.note-box { padding: 14px; border-radius: var(--r-md); background: var(--field); color: var(--ink-3); }
.note-box.amber { background: var(--amber-wash); border: 1px solid var(--amber-line); color: var(--amber-ink); }
.note-box.red { background: var(--red-wash); border: 1px solid var(--red-line); color: var(--ink); }
.note-box.blue { background: var(--blue-wash); border: 1px solid var(--blue-line); }
.divider { border: none; border-top: 1px solid var(--line-soft); margin: 0; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-radius: var(--r-md); font-size: var(--fs-base); background: var(--blue-wash); border: 1px solid var(--blue-line); color: var(--ink); }
.banner.warn { background: var(--amber-wash); border-color: var(--amber-line); }
.banner.err { background: var(--red-wash); border-color: var(--red-line); }
.banner .grow { min-width: 200px; }

/* ── Кнопки й поля ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-input); background: var(--card); color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; transition: border-color var(--tr), background var(--tr); }
.btn:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2a3641; border-color: #2a3641; color: #fff; }
.btn-danger { border-color: var(--red-line); color: var(--red-ink); }
.btn-danger:hover:not(:disabled) { background: var(--red-wash); border-color: var(--red); color: var(--red-ink); }
.btn-ok { background: var(--green-ink); border-color: var(--green-ink); color: #fff; }
.btn-ok:hover:not(:disabled) { background: #185636; color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-lg { height: 44px; }
.btn-block { width: 100%; }
.btn-ghost { border-color: transparent; background: none; }
.btn-ghost:hover:not(:disabled) { background: var(--field); border-color: transparent; }
.btn-icon { width: 40px; padding: 0; } .btn-icon.btn-sm { width: 32px; }
.link-btn { border: none; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--blue-ink); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.fld { height: 40px; padding: 0 12px; border: 1px solid var(--line-input); border-radius: var(--r); background: var(--card); font-size: var(--fs-base); color: var(--ink); }
.fld:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
textarea.fld { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.fld.mono-f { font-family: var(--font-mono); }
.fld-label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); color: var(--ink-4); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-input); background: var(--card); color: var(--ink); font-size: var(--fs-base); font-weight: 700; white-space: nowrap; transition: border-color var(--tr); }
.chip:hover { border-color: var(--line-strong); }
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.sm { height: 32px; padding: 0 12px; }
.chip.xs { height: 28px; padding: 0 10px; font-size: var(--fs-sm); }
.chip .n { font-weight: 600; opacity: .8; font-variant-numeric: tabular-nums; }
.chip .dot { background: var(--p-dot, var(--free)); }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: var(--r); }
.seg button { height: 32px; padding: 0 12px; border: none; border-radius: var(--r-sm); background: transparent; color: var(--ink); font-size: var(--fs-base); font-weight: 700; }
.seg button.on, .seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--card); box-shadow: var(--sh-seg); }
.seg button .n { margin-left: 4px; font-weight: 600; opacity: .7; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { height: 44px; padding: 0 14px; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; font-weight: 700; color: var(--ink-4); }
.tabs button.on, .tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.switch { position: relative; width: 44px; height: 24px; padding: 0; border: none; border-radius: var(--r-pill); background: var(--line-input); transition: background var(--tr); flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--tr); }
.switch[aria-checked="true"] { background: var(--green-ink); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.check { display: flex; align-items: center; gap: 10px; font-size: var(--fs-base); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line-input); background: var(--card); font-weight: 700; font-size: var(--fs-lg); }
.stepper b { min-width: 32px; text-align: center; font-variant-numeric: tabular-nums; }

/* ── Таблиці: сітка колонок задається --cols на .tbl ──
   Кожен рядок — окрема сітка, тож не може бути вужчим за суму мінімумів власних колонок (min-content): інакше колонки
   виступають за фон рядка, а шапка й рядки розходяться при горизонтальному скролі. Ручні min-width на таблицях не потрібні. */
.tbl-scroll { overflow-x: auto; }
.tbl { font-size: var(--fs-base); }
.thead, .trow { display: grid; grid-template-columns: var(--cols); gap: 0 12px; align-items: center; padding: 8px 20px; min-width: min-content; }
.thead { padding-top: 12px; padding-bottom: 12px; background: var(--field); }
.trow { min-height: 56px; border: none; border-top: 1px solid var(--line-soft); background: var(--card); color: var(--ink); text-align: left; width: 100%; text-decoration: none; }
.trow:hover { background: var(--field); color: var(--ink); }
.trow.sel, .trow[aria-pressed="true"] { background: var(--blue-wash); }
.trow.dim-row { opacity: .6; }
.cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell small { font-size: var(--fs-sm); color: var(--ink-4); }
.cell b { font-weight: 700; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-4); }
.empty h3 { font-size: var(--fs-lg); color: var(--ink); margin-bottom: 4px; }

/* ── Аватар, прогрес, лінія подій ── */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--av, var(--ink)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: var(--fs-md); letter-spacing: -.015em; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; } .avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.progress { height: 10px; background: var(--blue-bg); border-radius: 5px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--w, 0%); background: var(--bar, var(--blue)); border-radius: 5px; }
.progress.slim { height: 8px; background: var(--soft); }
.events { display: flex; flex-direction: column; gap: 10px; }
.event { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-base); }
.event .time { font-variant-numeric: tabular-nums; color: var(--ink-4); min-width: 44px; }
.event .dot { margin-top: 5px; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-base); }
.step .num { width: 22px; height: 22px; border-radius: 50%; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 700; flex: none; }

/* ── Оверлеї: модалка, тост, меню, підказка ── */
.modal-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border-radius: var(--r-xl); box-shadow: var(--sh-modal); padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4); }
.modal.wide { width: min(760px, 100%); }
.modal h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.015em; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r); box-shadow: var(--sh-pop); font-size: var(--fs-base); max-width: 380px; }
.toast.ok { border-left: 4px solid #4FD1A5; } .toast.err { border-left: 4px solid #FF8C8C; } .toast.warn { border-left: 4px solid #F5B971; }
.menu-pop { position: fixed; z-index: var(--z-overlay); min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-pop); padding: 6px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; border-radius: var(--r-sm); background: none; text-align: left; font-weight: 600; font-size: var(--fs-base); }
.menu-item:hover { background: var(--field); } .menu-item.danger { color: var(--red-ink); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 4px 2px; }
.tip { position: fixed; z-index: var(--z-tooltip); max-width: 320px; padding: 6px 10px; background: var(--ink); color: #fff; border-radius: var(--r-sm); font-size: var(--fs-sm); line-height: 1.35; pointer-events: none; white-space: pre-line; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-input); border-top-color: var(--ink); animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px; color: var(--ink-4); }

/* ── Адаптив ── */
/* Ноутбуки (1280–1440 px): трохи вужчі поля й бічна панель, щоб таблиці поміщались без горизонтальної прокрутки. */
@media (max-width: 1440px) {
  .app-header { padding-left: 24px; padding-right: 24px; gap: 12px 20px; }
  .nav a { padding: 0 10px; gap: 6px; }
  .main { padding-left: 24px; padding-right: 24px; }
  .cols > .side-col { flex-basis: 320px; }
}
/* 9 пунктів меню (з «Незатверджено») на 1280–1400 px: підпис чипа інтеграцій ховаємо (є час, крапка й підказка) — шапка лишається в один рядок. */
@media (max-width: 1400px) {
  .hdr-chip #hdr-text { display: none; }
  .hdr-right { flex-basis: 236px; column-gap: 8px; }   /* пошук ≥150 + чип ≈68 + «Вийти» ≈28 + проміжки — інакше блок переноситься на другий рядок */
  .hdr-user { padding: 6px; }
}
@media (max-width: 720px) {
  .app-header { padding: 12px 16px; gap: 12px; }
  .main { padding: 16px 16px 40px; }
  .page-head h1 { font-size: 22px; }
  .thead, .trow { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
