/* site/design2.css — Design 2.0: the override layer. It must stay the LAST stylesheet. Order: wwwroot/README.md. */
/* ==========================================================================================================
   Design 2.0 (2026-10-24, the owner: «дорого, але в міру»): the same layout, density and Poster order, on a calmer
   surface — Inter, a light canvas with white cards, a sidebar of icons and soft pills, quiet tables whose names read
   as text until pointed at, 8 px buttons instead of pills. Only tokens and these overrides; no page markup changes.
   ========================================================================================================== */
body { font-feature-settings: "cv05", "cv08"; }   /* Inter: l with a tail, flat-topped 1 — fewer look-alikes in codes */
h1 { font-size: 24px; line-height: 32px; letter-spacing: -.022em; }
h2, h3 { letter-spacing: -.012em; }
::selection { background: var(--accent-active); }

/* top bar: brand left, quiet utilities right */
.topnav { padding: 0 16px 0 18px; box-shadow: var(--shadow-xs); }
.tn-logo { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; letter-spacing: .01em; }
.tn-name { font-size: 16px; font-weight: 650; letter-spacing: -.012em; }
.tn-context { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--border); color: var(--muted); }
.tn-link { font-weight: 500; color: var(--text-2); border-radius: var(--radius-sm); }
.tn-link:hover { background: var(--surface-2); color: var(--heading); }

/* side navigation: an icon per section, soft pills, the caret on the right, sub-links on a hairline */
.sb-head { min-height: 44px; padding: 6px 8px 0 18px; border-bottom: 0; justify-content: flex-end; }
.sb-title { display: none; }                     /* the brand is in the top bar already */
.nav { gap: 1px; padding: 2px 10px 28px; }
.nav .icon { display: block; color: var(--sb-icon); }
.nav-link, .nav-group > summary { gap: 10px; min-height: 34px; padding: 6px 10px; font-size: 14px; font-weight: 500; color: var(--sb-text); }
.nav-link:hover, .nav-group > summary:hover { background: var(--sb-hover); color: var(--heading); text-decoration: none; }
.nav-link:hover .icon, .nav-group > summary:hover .icon { color: var(--heading); }
.nav-link.active { background: var(--accent-soft); color: var(--sb-active); font-weight: 600; }
.nav-link.active .icon { color: currentColor; }
.nav-group { margin-top: 0; }
.nav-group > summary { padding-left: 10px; }
.nav-group[open] > summary, .nav-group:has(.nav-link.active) > summary { color: var(--heading); }
.nav-group:has(.nav-link.active) > summary .icon { color: var(--sb-active); }
.nav .nav-group > summary .caret { order: 3; margin-left: auto; width: 14px; height: 14px; color: var(--decor); }
.nav-sub { gap: 1px; margin: 2px 0 6px 19px; padding: 0 0 0 10px; border-left: 1px solid var(--sb-border); }
.nav-sub .nav-link { min-height: 30px; padding: 5px 10px; font-weight: 400; }
.nav-sub .nav-link.active { font-weight: 600; }
/* a sub-heading inside a long section (VB Admin): quiet caps, air above, no hover — it is not a link */
.nav-heading { padding: 10px 10px 2px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.nav-heading:first-child { padding-top: 4px; }

/* the canvas and its cards */
.content { padding: 20px var(--gutter) 48px; }
.card, .panel { border-color: var(--border); box-shadow: var(--shadow-xs); }
.page-head { margin-bottom: 16px; }

/* tables: quiet headers, no column dividers, names read as text until pointed at */
thead th { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .005em; }
thead th + th:not(:empty) { background-image: none; }
td.name a, td a.row-link, a.row-link { color: var(--heading); font-weight: 600; }
td.name a:hover, td a.row-link:hover, a.row-link:hover { color: var(--accent); }
tfoot td, tfoot th { font-weight: 650; }

/* buttons: 8 px corners, a 1 px border, the primary solid */
.btn { border-width: 1px; font-weight: 600; padding: 5px 14px; border-color: var(--border-strong); color: var(--heading); }
.btn:hover { background: var(--surface-2); border-color: var(--text-2); color: var(--heading); }
.btn:active { background: var(--surface-3); }
.btn-primary { border-color: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.btn-primary:hover { color: var(--on-accent); }
.btn-secondary, .btn-outline { border-color: var(--accent); color: var(--accent); }
.btn-ghost { border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--heading); }
.btn-ghost .icon { color: var(--muted); }
.btn-ghost:hover .icon { color: currentColor; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 2px 10px; }
.btn-lg { padding: 8px 20px; }
.btn-icon, .icon-btn { border-radius: var(--radius-sm); }
.btn-icon:focus-visible, .icon-btn:focus-visible { border-radius: var(--radius-sm); }

/* fields: upright placeholders, a soft focus ring */
input::placeholder, textarea::placeholder { font-style: normal; color: var(--decor); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-ring); }

/* breadcrumbs: a quiet path, the current page in ink */
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }

/* segmented controls: a grey track, the chosen segment a raised white pill (the iOS / Linear look) */
div.seg, form.seg, .page-tabs, .switch, .segmented { border: 0; background: var(--surface-3); padding: 3px; border-radius: 10px; gap: 2px; }
div.seg label, form.seg label, .page-tabs a, .switch a, .segmented .seg { border-radius: 7px; font-weight: 500; color: var(--text-2); padding: 3px 12px; }
div.seg label:hover, form.seg label:hover, .page-tabs a:hover, .switch a:hover, .segmented .seg:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--heading); }
div.seg label:has(input:checked), form.seg label:has(input:checked),
.page-tabs a.active, .page-tabs a[aria-current], .switch a.active, .segmented .seg.active {
  background: var(--surface); color: var(--heading); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .10), 0 0 0 1px rgba(16, 24, 40, .04);
}
div.seg label.in:has(input:checked) { background: var(--ok-fill); color: #fff; }
div.seg label.out:has(input:checked) { background: var(--danger-fill); color: #fff; }

/* badges: soft tints instead of solid fills (the meaning stays in the words) */
.badge { font-weight: 500; border-radius: var(--radius-badge); }
.badge-neutral { background: var(--surface-3); color: var(--text-2); }

/* sign-in: a graphite brand panel with a soft accent glow (both themes); its heading in white, not --heading */
.login-hero {
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #2f5bea 38%, transparent), transparent 60%),
              linear-gradient(160deg, #1b2030, #0d1017);
  color: #e9ecf2;
}
.login-hero h2 { color: #ffffff; letter-spacing: -.02em; }
.login-hero li { color: #c9cfda; opacity: 1; }
.login-hero li .icon { color: #9db2ff; }

/* --- review fixes (art-director pass over all 96 pages) --- */
/* quick-filter toggles: neutral until on; counts as soft tints */
a.chip, button.chip, label.chip { border: 1px solid var(--border-strong); color: var(--heading); font-weight: 500; padding: 5px 12px; border-radius: var(--radius-sm); }
a.chip:hover, button.chip:hover, label.chip:hover { background: var(--surface-2); border-color: var(--text-2); color: var(--heading); text-decoration: none; }
a.chip.on, button.chip.on, a.chip[aria-pressed="true"], button.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; box-shadow: none; }
.chip .chip-count, .chip .count { background: var(--surface-3); color: var(--text-2); font-weight: 600; }
.chip.warn .chip-count { background: var(--warn-soft); color: var(--warn); }
.chip.danger .chip-count { background: var(--danger-soft); color: var(--danger); }
.chip.on .chip-count { background: var(--accent); color: var(--on-accent); }
summary.chip.on, summary.chip[aria-pressed="true"], .chip-select.on { box-shadow: none; border-color: var(--accent); background-color: var(--accent-soft); font-weight: 500; }
.chips .chip, span.chip { border: 0; background: var(--surface-3); }
/* outline buttons (the period picker, «Застосувати переходи») match their neutral neighbours */
.btn-secondary, .btn-outline { border-color: var(--border-strong); color: var(--heading); }
.btn-secondary:hover, .btn-outline:hover { background: var(--surface-2); border-color: var(--text-2); color: var(--heading); }
/* row text actions whisper until the row is pointed at */
table.list td.act .btn-link { color: var(--text-2); font-weight: 500; }
table.list td.act .btn-link:hover, table.list tr:hover td.act .btn-link { color: var(--accent); }
.btn-link { font-weight: 600; }
/* the pinned actions column: a soft edge shadow instead of a divider */
:where(.table-scroll > table.list) :where(th.act:last-child, td.act:last-child),
.table-scroll > table.list.receipts :is(th, td).act, .table-scroll > table.list.pin-act :is(th, td).act { box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .12); border-left: 0; }
/* tabs: one quiet language with the segmented controls */
.tabs a { font-size: 14px; font-weight: 500; padding: 8px 12px 10px; }
.tabs a + a::before { display: none; }
.tabs a.active, .tabs a[aria-current] { color: var(--heading); font-weight: 600; }
.tabs a.active::after, .tabs a[aria-current]::after { left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--heading); }
/* alerts: hairline borders, the meaning in the tint and the glyph */
.alert { border-width: 1px; border-color: color-mix(in srgb, var(--info-border) 35%, transparent); }
.alert-warn { border-color: color-mix(in srgb, var(--warn-border) 30%, transparent); }
.alert-error { border-color: color-mix(in srgb, var(--danger-border) 35%, transparent); }
.alert-ok { border-color: color-mix(in srgb, var(--ok-border) 35%, transparent); }
/* the sticky save bar spans the content exactly */
.savebar { margin: 24px calc(-1 * var(--gutter)) -48px; padding: 12px var(--gutter); border-top: 0; box-shadow: 0 -1px 0 var(--border), 0 -6px 12px -8px rgba(16, 24, 40, .10); }
/* a card bar inside a padded card does not pad twice */
.card:not(.flush):not(.table-card) > .card-bar { padding: 0 0 12px; }
/* statistics tables line up with their card and keep whole words in headers */
.card table.list.stats-dense :is(th, td):first-child { padding-left: 20px; }
.card table.list.stats-dense :is(th, td):last-child { padding-right: 20px; }
table.list.stats-dense thead th, table.list.receipts thead th { hyphens: manual; overflow-wrap: normal; }
/* empty states: calm, not an error */
.empty > p:first-child, .empty .empty-title { font-weight: 500; color: var(--text-2); }
.empty { padding: 40px 24px; }
/* the help (ⓘ) button: a quiet white disc */
.rail-btn { background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.rail-btn:hover { background: var(--surface-2); color: var(--heading); }

/* === area: palette (the command palette: «Пошук або перехід…» in the top bar, Ctrl K / ⌘ K; site.js «palette») === */
.tn-search {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 1 320px; min-width: 200px; height: 34px; margin-left: auto; padding: 0 6px 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 14px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.tn-search:hover { border-color: var(--border-strong); background: var(--surface); color: var(--text-2); text-decoration: none; }
.tn-search:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tn-search > .icon { flex: none; width: 16px; height: 16px; color: var(--decor); }
.tn-search-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-kbd, .palette kbd {
  flex: none; min-width: 20px; padding: 0 5px; font-family: inherit; font-size: 11px; line-height: 18px; font-weight: 500; text-align: center; letter-spacing: .02em;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; box-shadow: 0 1px 0 var(--border);
}
.tn-search + .tn-utils { margin-left: 8px; }

dialog.palette {
  width: min(640px, calc(100vw - 32px)); max-height: min(580px, calc(100vh - 128px)); margin: max(64px, 12vh) auto auto; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); overflow: hidden;
}
dialog.palette[open] { display: flex; flex-direction: column; animation: modal-in var(--dur-slow) var(--ease); }
dialog.palette::backdrop { background: color-mix(in srgb, var(--backdrop) 55%, transparent); }
:root[data-theme="dark"] dialog.palette::backdrop { background: var(--backdrop); }   /* a dark dialog needs the full dimming to stand out */
.pal-head { position: relative; display: flex; align-items: center; gap: 12px; flex: none; min-height: 60px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.pal-glass { flex: none; width: 20px; height: 20px; color: var(--muted); }
.pal-input, .pal-input:focus {
  flex: 1; min-width: 0; height: 58px; padding: 0; border: 0; outline: 0; box-shadow: none; background: transparent;
  color: var(--heading); font: inherit; font-size: 17px; line-height: 24px; letter-spacing: -.005em;
}
.pal-input::placeholder { color: var(--decor); }
.pal-close { display: inline-flex; align-items: center; flex: none; padding: 4px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer; }
.pal-close:hover { background: var(--surface-3); }
.pal-close:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.pal-close .pal-x { display: none; width: 20px; height: 20px; }
/* A thin bar under the field while the records load (the pages are already there) */
.pal-head.is-busy::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 28%; height: 2px; border-radius: 2px; background: var(--accent);
  animation: pal-busy 1s var(--ease) infinite;
}
@keyframes pal-busy { from { transform: translateX(-100%); } to { transform: translateX(360%); } }
.pal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 8px; }
.pal-group { margin: 12px 10px 4px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .01em; color: var(--muted); }
.pal-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; cursor: pointer; scroll-margin: 32px 0 8px;
}
.pal-item:hover { text-decoration: none; color: var(--text); }
.pal-item.is-active { background: var(--accent-soft); }
.pal-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); }
.pal-icon .icon { width: 16px; height: 16px; }
.pal-item.is-active .pal-icon { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-xs); }
.pal-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pal-title, .pal-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-title { font-weight: 500; color: var(--heading); }
.pal-sub { font-size: 13px; line-height: 18px; color: var(--muted); }
.pal-title mark { padding: 0; background: none; color: var(--accent-text); font-weight: 600; }
.pal-go { flex: none; visibility: hidden; }
.pal-item.is-active .pal-go { visibility: visible; }
.pal-note { margin: 0; padding: 28px 16px 32px; text-align: center; color: var(--muted); }
.pal-note b { color: var(--heading); font-weight: 600; }
.pal-foot {
  display: flex; align-items: center; gap: 18px; flex: none; padding: 9px 16px; border-top: 1px solid var(--line);
  background: var(--surface-2); font-size: 12px; line-height: 18px; color: var(--muted);
}
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }
/* The no-JavaScript search page reuses the rows */
.search-results { padding: 4px 12px 12px; }
.pal-plain { margin: 0; padding: 0; list-style: none; }
.pal-plain .pal-item:hover { background: var(--accent-soft); }
@media (max-width: 1100px) { .tn-search { flex-basis: 240px; min-width: 160px; } .tn-search .tn-kbd { display: none; } }
@media (max-width: 900px) {
  .tn-search { flex: none; width: 40px; min-width: 0; height: 40px; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: none; }
  .tn-search > .icon { width: 20px; height: 20px; color: var(--text-2); }
  .tn-search-text, .tn-search .tn-kbd { display: none; }
  .tn-search + .tn-utils { margin-left: 0; }
}
/* Phones: a full-screen sheet; no keyboard hints (there is no keyboard), a close cross instead of «Esc» */
@media (max-width: 640px) {
  dialog.palette { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  dialog.palette[open] { animation: none; }
  .pal-head { padding: 0 6px 0 16px; }
  .pal-close kbd, .pal-foot, .pal-go { display: none; }
  .pal-close .pal-x { display: block; }
  .pal-close { padding: 10px; }
  .pal-item { min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .pal-head.is-busy::after { animation: none; width: 100%; opacity: .5; } }
/* === end area: palette === */

/* phones: the list search takes the whole row (a chip bar otherwise squeezes it to 260 px); quick actions wrap their label */
@media (max-width: 900px) {
  .filterbar .search, .filterbar:has(.fchip) .search { flex: 1 1 100%; max-width: none; }
}
.quick-action > span:last-child { min-width: 0; overflow-wrap: anywhere; }
