/* Дзеркало Veritas One — у вигляді самого One: тема «Світла» (client/src/theme-vo.css, тема за замовчуванням):
   світло-сірий фон, білі блоки з тонкою рамкою, бірюзовий акцент #1f6f68, Montserrat, світла бічна панель з бірюзовим виділенням.
   Від One відрізняє лише підпис «дзеркало · лише перегляд» і смуга зверху. */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/montserrat-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/montserrat-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/montserrat-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/montserrat-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --page: #f5f6f7;  --card: #ffffff;  --sunk: #eef0f2;  --sunk2: #dcdee2;
  --line: #dcdee2;  --line2: #dcdee2;
  --ink: #1d1f24;   --text: #1d1f24;  --soft: #4b4f57;  --muted: #5c6069;
  --acc: #1f6f68;   --acc-strong: #1d5a55;  --acc-bg: #e8f4f2;  --acc-line: #c9e5e1;
  --ok: #4d7c5f;    --ok-bg: #edf4ef;  --bad: #a33b26;  --bad-bg: #f8ebe8;  --warn: #7a5214;  --warn-bg: #f8f0e3;
  --side: #ffffff;  --side-text: #1d1f24;  --side-muted: #5c6069;  --side-hover: #eef0f2;  --side-line: #dcdee2;
  --ring: 0 0 0 1px #e2e4e7, 0 1px 2px rgba(20,24,30,.04);
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px;
  --pop: 0 0 0 1px #dcdee2, 0 8px 24px rgba(20,24,30,.1);  --modal: 0 0 0 1px #c9ccd1, 0 16px 40px rgba(20,24,30,.14);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 500 13px/1.45 var(--font); font-feature-settings: 'tnum' 1; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--acc-strong); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Вхід */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login__box { width: 100%; max-width: 380px; background: var(--card); box-shadow: var(--ring); border-radius: var(--r-lg); padding: 28px 26px 24px; }
.brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.brand b { font-size: 20px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.seal { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--acc-bg); color: var(--acc-strong); border: 1px solid var(--acc-line); font-size: 12px; font-weight: 500; white-space: nowrap; }
.seal::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.login p { color: var(--soft); margin: 6px 0 20px; }
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--soft); }
.input { height: 38px; padding: 0 11px; border: 1px solid var(--line2); border-radius: var(--r-md); background: var(--card); outline: none; width: 100%; }
.input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-bg); }
.input--code { letter-spacing: .35em; font-size: 20px; text-align: center; height: 46px; }
.btn { height: 34px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line2); background: var(--card); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: background-color 120ms, border-color 120ms; }
.btn:hover { background: var(--sunk); }
.btn--primary { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 500; }
.btn--primary:hover { background: var(--acc-strong); border-color: var(--acc-strong); }
.btn--wide { width: 100%; justify-content: center; height: 40px; }
.btn--ghost { border-color: transparent; background: transparent; }
.btn[disabled] { opacity: .55; cursor: default; }
.err { color: var(--bad); background: var(--bad-bg); border-radius: var(--r-md); padding: 8px 11px; margin-bottom: 14px; font-size: 13px; }
.qr { display: grid; place-items: center; margin: 4px 0 10px; }
.qr svg { width: 196px; height: 196px; }
.secret { text-align: center; font-size: 13px; color: var(--soft); margin-bottom: 14px; word-break: break-all; }
.secret code { font-family: inherit; color: var(--ink); font-weight: 500; letter-spacing: .04em; }
.steps { margin: 0 0 14px; padding-left: 20px; color: var(--soft); font-size: 13px; }

/* ── Каркас */
.shell { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--side-text); border-right: 1px solid var(--side-line); display: flex; flex-direction: column; padding: 16px 10px 12px; min-height: 0; }
.side__brand { padding: 2px 8px 14px; border-bottom: 1px solid var(--side-line); margin-bottom: 10px; }
.side__brand b { display: block; font-size: 20px; font-weight: 500; color: var(--ink); letter-spacing: -.015em; }
.side__brand span { font-size: 12px; color: var(--side-muted); }
.nav { display: grid; gap: 1px; }
.nav__head { font-size: 13px; font-weight: 500; color: var(--ink); padding: 12px 10px 4px; }
.nav button { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--side-text); font-size: 13px; }
.nav button:hover { background: var(--side-hover); }
.nav button.on { background: var(--acc-bg); color: var(--acc); }
.nav button:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.nav button.sub { padding-left: 22px; font-size: 13px; }
.nav i { font-style: normal; font-size: 12px; color: var(--side-muted); }
.nav button.on i { color: var(--acc); }
.side__foot { margin-top: auto; border-top: 1px solid var(--side-line); padding: 12px 8px 0; font-size: 13px; display: grid; gap: 6px; }
.side__foot .who { color: var(--ink); }
.side__foot button { all: unset; cursor: pointer; color: var(--side-muted); font-size: 13px; }
.side__foot button:hover { color: var(--acc); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.band { display: flex; align-items: center; gap: 10px; padding: 7px 20px; background: var(--acc-bg); border-bottom: 1px solid var(--acc-line); color: var(--acc-strong); font-size: 12px; }
.band strong { font-weight: 600; }
.band .stale { color: var(--bad); font-weight: 500; }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px 10px; }
.head h1 { margin: 0 8px 0 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search .input { height: 34px; padding-left: 32px; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search kbd { position: absolute; right: 8px; top: 7px; font: 11px var(--font); color: var(--muted); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; background: var(--sunk); }
.sel, .date { height: 34px; border: 1px solid var(--line2); border-radius: var(--r-md); background: var(--card); padding: 0 8px; }
.date { width: 138px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 10px; }
.chip { height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: #2f3239; cursor: pointer; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--acc); color: var(--acc); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip i { font-style: normal; color: var(--muted); font-size: 12px; }
.chip.on i { color: #bcc0c6; }
.totals { display: flex; gap: 4px 22px; flex-wrap: wrap; padding: 0 20px 10px; font-size: 13px; color: var(--soft); }
.totals b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.totals .debt b { color: var(--bad); }

.work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 12px; padding: 0 20px 16px; }
.work.nopv { grid-template-columns: minmax(0, 1fr); }
.tablewrap { overflow: auto; min-height: 0; background: var(--card); box-shadow: var(--ring); border-radius: var(--r-lg); }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 1; background: var(--card); color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: help; }
.grid td { padding: 9px 10px; border-bottom: 1px solid var(--sunk); vertical-align: top; }
.grid tbody tr { cursor: default; }
.grid tbody tr:hover td { background: var(--page); }
.grid tbody tr.sel td { background: var(--acc-bg); }
.grid tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--acc); }
.grid .num { text-align: right; white-space: nowrap; }
.grid .nw { white-space: nowrap; }
.grid .clip { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid .mut { color: var(--muted); }
.grid .no { font-weight: 700; color: var(--acc); white-space: nowrap; }
.empty { padding: 48px 20px; text-align: center; color: var(--soft); }
.more { padding: 10px 20px; color: var(--soft); font-size: 13px; background: var(--sunk); border-top: 1px solid var(--line); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: #8a8fa3; }
.g-positive { background: #4da3e0; } .g-done { background: #4d9b6b; } .g-neutral { background: #8a8fa3; } .g-negative { background: #d4685a; } .g-waiting { background: #e0b43a; } .g-new { background: #4da3e0; } .g-test { background: #a48ad8; } .g-request { background: #4da3e0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--sunk); color: var(--soft); white-space: nowrap; }
.tag--ok { background: var(--ok-bg); color: var(--ok); } .tag--bad { background: var(--bad-bg); color: var(--bad); } .tag--warn { background: var(--warn-bg); color: var(--warn); } .tag--acc { background: var(--acc-bg); color: var(--acc-strong); }
.av { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; vertical-align: -5px; margin-right: 6px; background: var(--sunk2); }
.link { all: unset; color: var(--acc-strong); cursor: pointer; text-decoration: underline; text-decoration-color: var(--acc-line); text-underline-offset: 2px; }
.link:hover { text-decoration-color: currentColor; }

/* ── Панель перегляду праворуч */
.pv { background: var(--card); box-shadow: var(--ring); border-radius: var(--r-lg); overflow: auto; min-height: 0; display: flex; flex-direction: column; }
.pv__head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.pv__head h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--ink); }
.pv__head .meta { color: var(--soft); font-size: 13px; }
.pv__body { padding: 12px 16px 16px; display: grid; gap: 12px; }
.pv__hint { padding: 40px 20px; color: var(--muted); text-align: center; font-size: 13px; }
.kv { display: grid; grid-template-columns: 128px 1fr; gap: 5px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.frame { width: 100%; flex: 1; min-height: 520px; border: 0; background: var(--sunk); }
.pv img.prev { max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; }
.filelist { display: grid; gap: 4px; }
.file { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); font-size: 13px; min-width: 0; }
.file .nm { flex: 1 1 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.file .acts { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.file a { font-size: 12px; }
.pane .file .nm { flex: 1 1 auto; }
.file .k { color: var(--muted); font-size: 12px; white-space: nowrap; }
.file button { all: unset; cursor: pointer; color: var(--acc-strong); font-size: 12px; padding: 2px 4px; }
.file button:hover { text-decoration: underline; }
.sect { font-size: 13px; font-weight: 600; color: var(--ink); margin: 4px 0 2px; }

/* ── Картка (поверх списку) */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(29,31,36,.32); display: flex; justify-content: flex-end; }
.sheet__in { width: min(1180px, 100%); height: 100%; background: var(--page); box-shadow: var(--modal); display: flex; flex-direction: column; animation: slide 200ms cubic-bezier(.16,1,.3,1); }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet__in { animation: none; } }
.sheet__top { display: flex; align-items: flex-start; gap: 12px; padding: 16px 22px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.sheet__top h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.sheet__top .meta { color: var(--soft); font-size: 13px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sheet__top .x { margin-left: auto; }
.sheet__body { overflow: auto; padding: 16px 22px 28px; display: grid; gap: 14px; align-content: start; }
.blocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.block { background: var(--card); box-shadow: var(--ring); border-radius: var(--r-lg); padding: 14px 16px; }
.block h3 { margin: 0 0 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--acc); }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; background: var(--sunk); border-radius: var(--r-md) var(--r-md) 0 0; border-bottom: 1px solid var(--sunk2); padding: 6px 6px 0; margin-bottom: -14px; box-shadow: var(--ring); }
.tabs button { all: unset; cursor: pointer; padding: 8px 14px; color: var(--soft); border-radius: var(--r-md) var(--r-md) 0 0; font-size: 13px; font-weight: 600; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); background: var(--card); box-shadow: 0 0 0 1px var(--sunk2); }
.tabs button i { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--sunk); font-weight: 600; }
.pane { background: var(--card); box-shadow: var(--ring); border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: auto; }
.pane .grid th { position: static; }
.pane__pad { padding: 12px 14px; display: grid; gap: 10px; }
.hist { display: grid; gap: 0; }
.hist__row { display: grid; grid-template-columns: 132px 170px 1fr; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.hist__row:last-child { border-bottom: 0; }
.hist__row .t { color: var(--muted); white-space: nowrap; }
.hist__row .w { color: var(--soft); }
.who-mgr { color: #7a4fb0 !important; } .who-oko { color: #2f7a6a !important; } .who-proc { color: #9a6a2c !important; } .who-sys { color: var(--muted) !important; }
.hist__row s { color: var(--muted); }
.thumb { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.sumrow td { background: var(--sunk); font-weight: 600; }

/* ── Перегляд файлу на весь екран */
.viewer { position: fixed; inset: 0; z-index: 30; background: rgba(20,20,19,.72); display: flex; flex-direction: column; }
.viewer__bar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.viewer__bar b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.viewer iframe { flex: 1; border: 0; background: #525659; }
.viewer .img { flex: 1; overflow: auto; display: grid; place-items: center; padding: 20px; }
.viewer .img img { max-width: 100%; background: #fff; }

.tip { position: fixed; z-index: 50; pointer-events: none; background: #2f3239; color: #fff; font-size: 12px; padding: 5px 8px; border-radius: var(--r-sm); max-width: 320px; box-shadow: var(--pop); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 1180px) { .work { grid-template-columns: minmax(0, 1fr); } .pv { display: none; } .blocks { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .work { padding: 0 12px 12px; } .side { border-right: 0; border-bottom: 1px solid var(--side-line); }
  .shell { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100vh; }
  .main, .side { min-width: 0; } .work { display: block; } .tablewrap { overflow-x: auto; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 10px 12px; align-items: center; gap: 6px; }
  .side__brand { border: 0; margin: 0; padding: 0 8px 0 0; } .side__brand span { display: none; }
  .nav { display: flex; flex-wrap: nowrap; overflow-x: auto; order: 3; width: 100%; gap: 4px; padding-bottom: 2px; } .nav__head { display: none; }
  .nav button, .nav button.sub { flex: none; padding: 6px 10px; font-size: 13px; }
  .side__foot { margin: 0 0 0 auto; border: 0; padding: 0; } .side__foot .who { display: none; }
  .head, .chips, .totals { padding-left: 16px; padding-right: 16px; } .band { padding: 7px 16px; }
  .blocks { grid-template-columns: 1fr; } .hist__row { grid-template-columns: 1fr; gap: 2px; }
  .sheet__top, .sheet__body { padding-left: 16px; padding-right: 16px; }
  .tablewrap { max-height: none; }
}

/* заказ лише з 1С (січень–липень 2026) */
.tag--1c { background: var(--sunk); color: var(--soft); border: 1px solid var(--line); font-size: 11px; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
.note1c { margin: 12px 0; padding: 8px 10px; border-radius: 6px; background: var(--sunk); color: var(--soft); font-size: 13px; }
