/* SOLO's design system (2026-10-23, the user: "one design for every page — background #071322, menu #0B1B32, cards
   #112139 with a thin #24354E edge, blue #367AF6, turquoise #16CAB5, text #EDF3FF / #B4C2D7; red only for errors,
   overdue and warnings; gradients sparingly, mostly in the page's title bar; light shadows; Noto Sans Georgian").
   Every colour, size and space of the interface comes from the tokens below — the components use them, nothing else.
   The dark design is the default; „ღია“ (the top bar's switch, settings → „გარეგნობა“) and „როგორც Windows-ში“ stay:
   data-theme on <html> = light | dark | system, set by theme.js before the page is drawn. */

/* the interface's font, served by SOLO itself (no network): Noto Sans Georgian, SIL OFL (public/fonts/OFL.txt) */
@font-face {
  font-family: 'Noto Sans Georgian'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('/fonts/noto-sans-georgian-georgian.woff2') format('woff2');
  unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31;
}
@font-face {
  font-family: 'Noto Sans Georgian'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('/fonts/noto-sans-georgian-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Noto Sans Georgian'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('/fonts/noto-sans-georgian-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 {
  /* type, space, shape — one scale for every page */
  --font: 'Noto Sans Georgian', 'Segoe UI', 'Sylfaen', system-ui, sans-serif;
  --font-mono: ui-monospace, Consolas, 'Cascadia Mono', monospace;
  --fs-xs: 12.5px;      /* small notes, table captions */
  --fs-sm: 13.5px;      /* labels, secondary lines */
  --fs: 15px;           /* body text, tables, fields */
  --fs-md: 16px;        /* the menu, buttons, actions */
  --fs-lg: 18px;        /* a card's heading */
  --fs-xl: 22px;
  --fs-title: 28px;     /* a page's title */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 32px;
  --radius: 12px;       /* cards */
  --radius-sm: 8px;     /* fields, buttons */
  --radius-lg: 16px;    /* dialogs, the title bar */
  --control-h: 40px;
  --control-h-sm: 32px;
  --sidebar-w: 272px;
  --focus-ring: 0 0 0 3px var(--focus-soft);

  /* the dark design — the default */
  color-scheme: dark;
  --bg: #071322;
  --surface: #112139;          /* cards */
  --surface-2: #152843;        /* table heads, hover, raised parts of a card */
  --surface-3: #1a304f;
  --field: #0c1a2f;            /* inside a field */
  --text: #edf3ff;
  --muted: #b4c2d7;
  --faint: #8798b3;
  --border: #24354e;
  --border-strong: #34496a;
  --accent: #367af6;           /* blue: marks, rings, charts, the active menu */
  --accent-fill: #2f6fe8;      /* blue under white words (primary buttons): the same blue, a shade deeper to read well */
  --accent-hover: #3d7ff3;
  --accent-soft: rgba(54, 122, 246, 0.16);
  --accent-text: #ffffff;      /* words on --accent-fill */
  --accent-shadow: rgba(54, 122, 246, 0.32);
  --link: #7aa9ff;             /* blue words on a dark card */
  --mint: #16cab5;             /* turquoise: the active mark, done, good */
  --mint-soft: rgba(22, 202, 181, 0.14);
  --brand-gradient: linear-gradient(90deg, #367af6, #16cab5);
  --ok: #16cab5;
  --ok-soft: rgba(22, 202, 181, 0.14);
  --bad: #ff6b7a;              /* red: errors, overdue, warnings that matter */
  --bad-soft: rgba(255, 107, 122, 0.14);
  --warn: #f2b25c;
  --warn-soft: rgba(242, 178, 92, 0.14);
  --focus: #16cab5;
  --focus-soft: rgba(54, 122, 246, 0.45);
  --sidebar: #0b1b32;
  --sidebar-2: #0b1b32;
  --sidebar-text: #c9d5e8;
  --sidebar-muted: #8b9cb6;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(54, 122, 246, 0.4);
  --sidebar-mark: #16cab5;
  --title-bar: linear-gradient(115deg, #17396d 0%, #112139 52%, #0f2c3d 100%);
  --chart-in: #16cab5;
  --chart-out: #367af6;
  --chart-cash: #edf3ff;
  --backdrop: rgba(2, 8, 18, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 6px 18px rgba(1, 6, 16, 0.32);
  --shadow-lg: 0 18px 44px rgba(1, 6, 16, 0.5);
}
/* the light design: the same system on white */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f4f7fc;
  --surface-3: #e9eff8;
  --field: #ffffff;
  --text: #0e1b30;
  --muted: #4b5c78;
  --faint: #6f809b;
  --border: #dbe3ee;
  --border-strong: #c2cddd;
  --accent: #367af6;
  --accent-fill: #2f6fe8;
  --accent-hover: #2563d9;
  --accent-soft: #e7f0ff;
  --accent-text: #ffffff;
  --accent-shadow: rgba(54, 122, 246, 0.28);
  --link: #1f5fd6;
  --mint: #0fa898;
  --mint-soft: #e0f7f3;
  --ok: #0b8a7b;
  --ok-soft: #e0f6f2;
  --bad: #d23a4e;
  --bad-soft: #fdecef;
  --warn: #b05f06;
  --warn-soft: #fef3e2;
  --focus: #2f6fe8;
  --focus-soft: rgba(54, 122, 246, 0.35);
  --chart-in: #16cab5;
  --chart-out: #367af6;
  --chart-cash: #0e1b30;
  --backdrop: rgba(7, 19, 34, 0.5);
  --shadow: 0 1px 2px rgba(14, 27, 48, 0.06), 0 2px 8px rgba(14, 27, 48, 0.05);
  --shadow-md: 0 6px 18px rgba(14, 27, 48, 0.12);
  --shadow-lg: 0 18px 44px rgba(14, 27, 48, 0.24);
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --bg: #f2f5fa;
    --surface: #ffffff;
    --surface-2: #f4f7fc;
    --surface-3: #e9eff8;
    --field: #ffffff;
    --text: #0e1b30;
    --muted: #4b5c78;
    --faint: #6f809b;
    --border: #dbe3ee;
    --border-strong: #c2cddd;
    --accent: #367af6;
    --accent-fill: #2f6fe8;
    --accent-hover: #2563d9;
    --accent-soft: #e7f0ff;
    --accent-text: #ffffff;
    --accent-shadow: rgba(54, 122, 246, 0.28);
    --link: #1f5fd6;
    --mint: #0fa898;
    --mint-soft: #e0f7f3;
    --ok: #0b8a7b;
    --ok-soft: #e0f6f2;
    --bad: #d23a4e;
    --bad-soft: #fdecef;
    --warn: #b05f06;
    --warn-soft: #fef3e2;
    --focus: #2f6fe8;
    --focus-soft: rgba(54, 122, 246, 0.35);
    --chart-in: #16cab5;
    --chart-out: #367af6;
    --chart-cash: #0e1b30;
    --backdrop: rgba(7, 19, 34, 0.5);
    --shadow: 0 1px 2px rgba(14, 27, 48, 0.06), 0 2px 8px rgba(14, 27, 48, 0.05);
    --shadow-md: 0 6px 18px rgba(14, 27, 48, 0.12);
    --shadow-lg: 0 18px 44px rgba(14, 27, 48, 0.24);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::placeholder { color: var(--faint); opacity: 1; }
* { scrollbar-color: var(--border-strong) transparent; }
code, kbd, pre { font-family: var(--font-mono); }
kbd {
  display: inline-block; min-width: 20px; padding: 0 5px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px;
  font: 600 11px/17px var(--font); text-align: center; color: var(--muted);
  background: var(--surface);
}

/* ---------- loading bar ---------- */

#busy {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50; pointer-events: none;
  background: var(--brand-gradient); transform-origin: left; transform: scaleX(0); opacity: 0;
  transition: opacity .3s;
}
body.is-busy #busy { opacity: 1; animation: busy 1.2s ease-in-out infinite; }
@keyframes busy {
  0% { transform: translateX(-60%) scaleX(.35); }
  100% { transform: translateX(110%) scaleX(.35); }
}

/* ---------- layout ---------- */

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
/* the menu: one dark column in both designs, the logo on top */
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 14px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.brand { display: flex; align-items: flex-start; gap: 10px; padding: 2px 8px 18px; }
.brand-id { flex: 1; min-width: 0; }
.brand-logo { display: block; height: 38px; width: auto; }
.brand-sub { color: var(--sidebar-muted); font-size: var(--fs-xs); letter-spacing: .04em; margin: 6px 0 0 38px; } /* under the word, right of the S */
/* „მენიუ“ on a narrow window (the menu folds away there) */
.menu-toggle {
  display: none; flex: none; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); color: #fff; font-size: var(--fs);
}
.menu-toggle:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.24); }
.menu-toggle svg { width: 20px; height: 20px; }
/* „«“ beside the logo: the menu folds to a strip of its icons, „»“ opens it again (the user, 2026-11-04: "fold the list on
   the left with a small button to have more room for the page") — a wide window only; a narrow one has „მენიუ“ */
.nav-fold {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; min-height: 34px; padding: 0;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--sidebar-muted); border-radius: 8px;
}
.nav-fold:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-fold svg { width: 18px; height: 18px; }
@media (min-width: 1024px) {
  body.nav-mini { --sidebar-w: 76px; }
  body.nav-mini .sidebar { padding: 16px 10px 24px; overflow-x: hidden; }
  body.nav-mini .brand { flex-direction: column; align-items: center; padding: 2px 0 14px; }
  body.nav-mini .brand-id { display: none; }
  body.nav-mini .nav-fold svg { transform: scaleX(-1); }
  body.nav-mini .search-pill { justify-content: center; padding: 6px; }
  body.nav-mini .search-pill .grow, body.nav-mini .search-pill kbd { display: none; }
  body.nav-mini #tabs .nav-title { display: none; }
  body.nav-mini #tabs button { justify-content: center; padding: 9px 0; gap: 0; }
  body.nav-mini #tabs .nav-label { display: none; }
  body.nav-mini #tabs .nav-badge:not([hidden]) {
    position: absolute; top: 5px; right: 6px; min-width: 18px; padding: 0 5px; font-size: 10.5px; line-height: 18px; border-radius: 9px;
  }
}
@media (max-width: 1023px) { .nav-fold { display: none; } }
/* the company — name, tax id, VAT status and the switch — in the strip over the page
   (moved out of the menu on 2026-09-28, the user: "up into the title, to give the menu on the left more room") */
.topbar {
  margin: 0 0 22px; /* the whole width, as every page (the user, 2026-10-02) */
  display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap;
  padding: 0 0 16px; border-bottom: 1px solid var(--border);
}
.topbar-company { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; flex: 1; min-width: 0; }
.topbar .company { color: var(--text); font-weight: 650; font-size: var(--fs-md); line-height: 1.35; }
.topbar .meta { font-size: var(--fs-sm); }
.topbar .company-switch { min-height: 38px; padding: 6px 14px; font-size: var(--fs); }
.search-pill {
  display: flex; width: 100%; margin: 0 0 16px; gap: 10px; justify-content: flex-start;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--sidebar-muted);
  border-radius: 10px; min-height: 40px; padding: 6px 12px; font-size: var(--fs); font-weight: 400;
}
.search-pill svg { width: 18px; height: 18px; flex: none; }
.search-pill .grow { min-width: 0; text-align: left; }
.search-pill kbd { background: transparent; border-color: rgba(255, 255, 255, 0.2); color: var(--sidebar-muted); }
.search-pill:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: #fff; }

/* ---------- company screen ---------- */

body.choosing .app { filter: blur(3px); pointer-events: none; }
.chooser {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto;
  display: grid; place-items: start center; padding: 6vh 16px 32px;
  background:
    radial-gradient(90% 60% at 0% 0%, rgba(54, 122, 246, 0.22), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(22, 202, 181, 0.12), transparent 70%),
    #071322;
}
.chooser-panel {
  width: min(760px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 28px 28px 24px;
}
.chooser-logo { height: 44px; width: auto; display: block; margin-bottom: 18px; }
/* the logo with the white word on the dark design, the navy one on the light */
.chooser-logo.on-light { display: none; }
:root[data-theme="light"] .chooser-logo.on-light { display: block; }
:root[data-theme="light"] .chooser-logo.on-dark { display: none; }
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .chooser-logo.on-light { display: block; }
  :root[data-theme="system"] .chooser-logo.on-dark { display: none; }
}
.chooser-panel h1 { font-size: var(--fs-xl); margin: 0 0 16px; }
.company-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.company-card {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; text-align: left;
  white-space: normal; min-height: 96px; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2); position: relative; overflow: hidden;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.company-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand-gradient); }
.company-card strong { font-size: var(--fs-md); overflow-wrap: anywhere; }
.company-card .muted { font-size: var(--fs-sm); font-weight: 400; }
.company-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.company-card.current { border-color: var(--accent); }
.chooser-actions { margin-top: 16px; }
.chooser-actions .chooser-who { overflow-wrap: anywhere; }
.chooser-new { margin-top: 12px; }
/* Balance's import: its own box under the companies */
.chooser-import { margin-top: 20px; padding: 16px 18px 4px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.chooser-import h2 { margin: 0 0 6px; font-size: var(--fs-md); }
.chooser-import p { margin: 0 0 12px; line-height: 1.55; }
.chooser-import .row { align-items: end; }
.chooser-import .chooser-from input { min-width: 12.5em; }
.chooser-import .chooser-from .muted { font-weight: 400; }
label.file-button {
  display: inline-flex; flex-direction: row; align-items: center; cursor: pointer;
  padding: 7px 14px; min-height: 36px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
}
label.file-button:hover { background: var(--surface-2); border-color: var(--border-strong); }
/* files attached to a document (attachSection in app.js) */
.attach { margin: 12px 0; }
.attach-list { list-style: none; margin: 4px 0 0; padding: 0; }
.attach-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--border); }
.attach-list li a { font-weight: 500; overflow-wrap: anywhere; }
.import-result { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.import-result h2 { margin-bottom: 8px; }
.import-result ul { margin: 0 0 12px; padding-left: 20px; }
.company:empty { display: none; }
.meta { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* ---------- menu ---------- */

#tabs { display: flex; flex-direction: column; }
#tabs .nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
#tabs .nav-title {
  color: var(--sidebar-muted);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em;
  padding: 0 12px 6px;
}
/* a module of the menu: the outline icon, its name (a long one wraps, never clipped), its count */
#tabs button {
  position: relative;
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 10px;
  color: var(--sidebar-text);
  padding: 9px 12px 9px 14px; margin: 0; min-height: 44px;
  font: 500 var(--fs-md)/1.3 var(--font);
  white-space: normal;
  cursor: pointer;
  transition: background .12s, color .12s;
}
#tabs button:hover { background: var(--sidebar-hover); color: #fff; }
#tabs button:focus-visible { outline: 2px solid var(--sidebar-mark); outline-offset: -2px; }
/* the page open now: a blue ground and the turquoise mark on its left */
#tabs button.active { background: var(--sidebar-active); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(54, 122, 246, 0.5); }
#tabs button.active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--sidebar-mark);
}
.nav-icon { width: 20px; height: 20px; flex: none; opacity: .78; }
#tabs button:hover .nav-icon { opacity: 1; }
#tabs button.active .nav-icon { opacity: 1; color: var(--sidebar-mark); }
.nav-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nav-badge {
  display: inline-block; flex: none; min-width: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--bad); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums;
}
.nav-badge.soft { background: var(--sidebar-mark); color: #04211d; }
/* The whole menu on one screen (the user, 2026-09-28: "show the list on the left in full, so we never scroll it"):
   on a shorter window the rows get tighter — the words keep their size. */
@media (max-height: 860px) {
  .sidebar { padding-top: 14px; padding-bottom: 16px; }
  .brand { padding-bottom: 12px; }
  .brand-logo { height: 32px; }
  .brand-sub { margin-top: 3px; }
  .search-pill { min-height: 36px; margin-bottom: 12px; }
  #tabs button { min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
  #tabs .nav-group { margin-bottom: 8px; }
}
@media (max-height: 700px) {
  #tabs .nav-title { display: none; }
  #tabs button { min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: var(--fs); }
}

.content { min-width: 0; padding: 22px 32px 112px; } /* the bottom keeps the last rows above the bar at the bottom (#taskbar) */
/* the page's title bar — the one place with a gradient */
.page-head {
  position: relative; overflow: hidden; margin: 0 0 22px; padding: 22px 28px;
  border-radius: var(--radius-lg); border: 1px solid #24354e;
  background: var(--title-bar); box-shadow: var(--shadow);
}
.page-head::after {
  content: ''; position: absolute; right: -80px; top: -120px; width: 340px; height: 340px; pointer-events: none;
  background: radial-gradient(circle, rgba(22, 202, 181, 0.16), transparent 66%);
}
.page-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer;
}
.page-close svg { width: 16px; height: 16px; }
.page-close:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.35); }
.page-head h1 { position: relative; z-index: 1; font-size: var(--fs-title); font-weight: 700; line-height: 1.25; margin: 0; letter-spacing: -.01em; color: #fff; overflow-wrap: anywhere; }
.page-head h1::after {
  content: ''; display: block; width: 48px; height: 3px; margin-top: 10px;
  border-radius: 3px; background: var(--brand-gradient);
}
.page-head p { position: relative; z-index: 1; margin: 10px 0 0; color: #c3cfe2; max-width: 980px; font-size: var(--fs); }
.page-head p:empty { display: none; }
/* 🕓 — who made a document and who changed it: a small popover, not a section of the page */
.hist-btn { padding: 4px 8px; min-width: 0; line-height: 1; }
.hist-pop {
  position: fixed; z-index: 1000; width: 360px; max-height: 60vh; overflow-y: auto; padding: 12px 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-md);
  font-size: var(--fs-sm);
}
.hist-pop .hist-head { font-weight: 600; margin-bottom: 6px; }
.hist-pop ul { list-style: none; margin: 0; padding: 0; }
.hist-pop li { padding: 6px 0; border-top: 1px solid var(--border); }
.hist-pop li:first-child { border-top: 0; }
.hist-pop .hist-when { color: var(--muted); font-variant-numeric: tabular-nums; }
/* every page uses the whole window (the user, 2026-10-02: "not only the cash desk page — the headings too, every page") */
main { margin: 0 auto; }

/* ---------- sub-tabs: a row of pills, the open one blue ---------- */

.subtabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  width: fit-content; max-width: 100%; margin: 0 0 20px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.subtabs button {
  background: none; border: 0; border-radius: 9px; margin: 0;
  padding: 7px 16px; min-height: 38px;
  color: var(--muted); font-weight: 500; font-size: var(--fs);
}
.subtabs button:hover { color: var(--text); background: var(--surface-2); }
.subtabs button.active { background: var(--accent-fill); color: var(--accent-text); font-weight: 600; box-shadow: 0 2px 8px var(--accent-shadow); }

/* ---------- cards & text ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
  min-width: 0;
}
h2 { font-size: var(--fs-lg); font-weight: 650; line-height: 1.35; margin: 0 0 14px; letter-spacing: -.005em; overflow-wrap: break-word; }
h3 { font-weight: 650; line-height: 1.35; }
.card > p.muted:first-of-type { margin-top: -4px; }
.card-head { align-items: center; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
p { margin: 0 0 10px; }
a { color: var(--link); }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.small { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.spaced-top { margin-top: 12px; }
h2.spaced { margin-top: 22px; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 6px 0; }
details > summary { cursor: pointer; color: var(--link); font-weight: 500; margin-bottom: 10px; }
details > summary:hover { text-decoration: underline; }

/* ---------- forms ---------- */

.row { display: flex; gap: 12px 14px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.row:last-child { margin-bottom: 0; }
.row.actions { margin: 16px 0 0; align-items: center; }
.grow { flex: 1; min-width: 200px; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-size: var(--fs); color: var(--text); font-weight: 400; padding-bottom: 9px; }
input, select, button, textarea { font: inherit; color: var(--text); }
input, select, textarea {
  background: var(--field);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  width: 100%;
  min-height: var(--control-h);
  font-size: var(--fs);
  transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--faint); }
input[readonly] { background: var(--surface-2); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
label.inline input { width: auto; min-height: 0; }
textarea { resize: vertical; line-height: 1.5; }
label.drop input[type="file"] { padding: 12px; border-style: dashed; background: var(--surface-2); cursor: pointer; }
select option, select optgroup { background: var(--surface); color: var(--text); }

/* buttons: the plain one, the blue one for the page's main action, the red ones for what removes */
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  min-height: var(--control-h);
  cursor: pointer;
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s;
}
button:hover, a.button:hover { background: var(--surface-3); border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); }
button:active:not(:disabled), a.button:active { transform: translateY(1px); }
button:focus-visible, a.button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button.primary, a.button.primary {
  background: var(--accent-fill); color: var(--accent-text); border-color: var(--accent-fill); font-weight: 600;
  box-shadow: 0 2px 10px var(--accent-shadow);
}
button.primary:hover, a.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.small-btn { min-height: var(--control-h-sm); padding: 4px 12px; font-size: var(--fs-sm); }
button.link { border: 0; background: none; color: var(--link); padding: 0; min-height: 0; font-size: inherit; font-weight: 500; box-shadow: none; }
button.link:hover { text-decoration: underline; background: none; }
button.link:focus-visible { outline-offset: 1px; border-radius: 4px; }
button.link.danger { color: var(--bad); }
button.link.muted-link { color: var(--muted); }
button.link.wrong-side { color: var(--bad); font-weight: 600; } /* an advance / overpayment named on the debtors page */
td button.link { white-space: normal; text-align: left; } /* long names in tables wrap instead of pushing the numbers away */
td button.link.nowrap { white-space: nowrap; }
/* the copy icon beside an item name (the stock balances): faint until the row is hovered, always there on a touch screen */
.named { display: inline-flex; align-items: baseline; gap: 2px; }
button.copy-name { flex: none; border: 0; background: none; box-shadow: none; min-height: 0; padding: 0 4px; color: var(--muted); font-size: inherit; line-height: 1; opacity: 0; cursor: copy; vertical-align: -2px; }
tr:hover button.copy-name, button.copy-name:focus-visible { opacity: 1; }
button.copy-name:hover { color: var(--link); background: none; }
@media (hover: none) { button.copy-name { opacity: .7; } }
td.name-cell { min-width: 220px; }
td.actions-cell { min-width: 130px; }
td.actions-cell button.link { display: block; margin: 0 0 4px; }
button.danger:not(.link) { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: transparent; }
button.danger:not(.link):hover { background: var(--bad-soft); border-color: var(--bad); }
button.danger-solid { background: #c93246; border-color: #c93246; color: #fff; }
button.danger-solid:hover { filter: brightness(1.06); background: #c93246; }
button:disabled { opacity: .5; cursor: default; }

/* ---------- tables: a frame of their own that scrolls sideways when wide ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
/* the item card's barcode row: the field wide, the add button the eye goes to (the user, 2026-10-06) */
.bc-add-row { display: flex; gap: 10px; align-items: stretch; margin-top: 6px; }
.bc-add-row input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: var(--fs); }
.bc-add-row button { white-space: nowrap; font-weight: 700; padding: 0 18px; }
#it-barcodes code { font-size: var(--fs); font-weight: 600; }
/* a home to-do's „გახსნა“ brought the user here: the button to press glows for a moment */
.go-here { outline: 3px solid var(--mint); outline-offset: 3px; transition: outline-color 0.4s; }
/* „ყველას მონიშვნა / მოხსნა“ over a list of tick boxes (app.js pickBar) */
.pick-bar { gap: 8px; align-items: center; margin: 6px 0; }
/* „ძებნა ცხრილში“ over every longer table (app.js installTableFind) */
.tfind { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.tfind .tf-input { flex: 0 1 340px; min-width: 0; }
.tf-hide { display: none !important; }
/* „⚙ აწყობა“ — a table's columns (public/table-columns.js): at the right end of its search bar, or in a bar of its own */
.col-off { display: none !important; }
.tcols { display: flex; justify-content: flex-end; margin: 6px 0; }
.tfind .tcols-btn { margin-left: auto; }
.tcols-btn { white-space: nowrap; }
.col-choose { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 18px; max-height: 55vh; overflow: auto; margin: 6px 0 4px; }
.col-choose label.inline { padding-bottom: 4px; }
.card > .table-wrap:not(:first-child) { margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs); }
th, td { padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .01em; line-height: 1.35; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
:where(tbody tr:hover) > td { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
tfoot td { font-weight: 650; border-top: 1px solid var(--border-strong); border-bottom: 0; background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td input.num { text-align: right; min-width: 100px; }
table.lines td { padding: 6px; }
table.lines select { min-width: 220px; }
table.lines .account-cell { min-width: 190px; }
table.lines input[name="cp"] { min-width: 220px; width: 100%; max-width: 320px; }
table.lines input[name="memo"] { min-width: 170px; }
table.lines select[name="currency"] { min-width: 76px; }
table.lines input[name="debit"], table.lines input[name="credit"] { min-width: 110px; }
table.lines .account-cell input { font-variant-numeric: tabular-nums; }
.acc-name { font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; min-height: 16px; line-height: 1.3; max-width: 240px; }
.acc-name.bad { color: var(--bad); }
table.compact { width: auto; min-width: min(340px, 100%); }
table.kv { width: 100%; }
table.kv td:first-child { color: var(--muted); }
td.pick { width: 28px; vertical-align: middle; }
.inactive td { color: var(--muted); }
tr.selected td { background: var(--accent-soft); }
.wrong-side { color: var(--bad); font-weight: 600; }
table.ledger tr.group td { background: var(--surface-2); padding-top: 12px; font-weight: 600; }
table.ledger tr.opening td { color: var(--muted); }
table.ledger tr.subtotal td { font-weight: 600; border-bottom: 2px solid var(--border-strong); }
table.ledger td.corr { min-width: 180px; font-size: var(--fs-sm); }
table.ledger td:first-child { white-space: nowrap; }
table.ledger td:nth-child(3) { min-width: 220px; }
table.ledger td.corr b { font-variant-numeric: tabular-nums; }
table.ledger td.corr.own { background: var(--accent-soft); }
/* the account card in Balance's form (app.js views.card): account codes bold, the turnover columns shaded */
table.ledger.bcard td:nth-child(3) { min-width: 0; }
table.ledger.bcard td.acc { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.ledger.bcard td.code { white-space: nowrap; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
table.ledger.bcard td.an { min-width: 130px; font-size: var(--fs-sm); }
table.ledger.bcard .turn { background: var(--surface-2); }
table.ledger.bcard td.num { white-space: nowrap; }
table.ledger td .muted { font-size: var(--fs-xs); }
table.recent tr { cursor: pointer; }
table.recent tr:focus-visible td { background: var(--accent-soft); outline: none; }
.period .presets, .presets { display: inline-flex; gap: 6px; flex-wrap: wrap; }
#entry-detail:empty { display: none; }
#entry-detail { border-color: var(--accent); box-shadow: var(--shadow-md); }
.journal-filter select { max-width: 280px; }
.entry-head .entry-no { font-weight: 700; }
table.turnover tr.group td { font-weight: 600; }
table.turnover tr.lvl-0 td { background: var(--surface-2); }
table.turnover tr.cp-row td { font-size: var(--fs-sm); }
table.turnover tr.cp-row td:first-child .link { color: var(--muted); font-weight: 400; }
button.chip { min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: var(--fs-sm); }
button.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--link); }
#cp-detail h3 { font-size: var(--fs); margin: 14px 0 8px; }
#cp-detail { border-color: var(--accent); box-shadow: var(--shadow-md); }
.rs-import { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.rs-import h3 { font-size: var(--fs); margin: 0 0 8px; }
.rs-import ol { margin: 0; padding-left: 20px; }
.rs-import li { margin: 6px 0; }
tr.group td { font-weight: 600; }
.indent-1 { padding-left: 24px; }
.indent-2 { padding-left: 40px; }
.indent-3 { padding-left: 56px; }
.indent-4 { padding-left: 72px; }

/* ---------- journal ---------- */

.entry { border-top: 1px solid var(--border); padding: 14px 0; }
.entry:first-of-type { border-top: 0; padding-top: 4px; }
.entry-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.entry-head strong { color: var(--muted); font-weight: 600; }
.entry.reversed .entry-body { opacity: .55; }

.badge {
  display: inline-block;
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.6;
  padding: 1px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge.muted { color: var(--muted); }
.badge.info { background: var(--accent-soft); color: var(--link); border-color: transparent; }

/* ---------- reports (cloud task R1): the one page for every report ---------- */
/* a table's rows by date from its „თარიღი“ header (app.js installDateSort) */
th.date-sort { cursor: pointer; user-select: none; white-space: nowrap; }
th.date-sort:hover { color: var(--text); }
th.date-sort .ds-mark { margin-left: 4px; font-size: 0.8em; opacity: 0.45; }
th.date-sort[data-dir] .ds-mark { opacity: 1; color: var(--accent); }
table.report th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.report th.sortable:hover { color: var(--text); }
table.report th.sorted { color: var(--link); }
table.report th.num { text-align: right; }
/* Wide reports (the user, 2026-09-28: "the numbers on the right are hidden — make them show"): the reports page uses
   the whole width, the text columns are clipped with an ellipsis instead of pushing the numbers out, the first column
   stays put while the table scrolls sideways, and the scrollbar is a real one. */
main.wide { max-width: none; }
main.wide .table-wrap { scrollbar-width: auto; }
table.report { font-size: var(--fs-sm); }
table.report td:not(.num) { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.report td:first-child, table.report th:first-child { position: sticky; left: 0; background: var(--surface); box-shadow: 1px 0 0 var(--border); z-index: 1; }
table.report th:first-child { z-index: 2; }
table.report tfoot td:first-child { background: var(--surface-2); }
/* tighter cells and wrapping headers, so the sales reports fit a 1920 px screen without sideways scrolling */
table.report th, table.report td { padding: 6px 10px; }
table.report th.sortable { white-space: normal; max-width: 120px; line-height: 1.25; }
table.report td:first-child { max-width: 300px; }
table.report td:not(.num):not(:first-child) { max-width: 170px; }
.report-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.report-head h2 { margin: 0; }
/* the stock report's filters: ready-made questions, then the fields in four panels by theme (2 × 2, one column on a phone), then what is
   set as chips and the buttons */
.rp-filters { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.rp-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rp-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rp-panel { margin: 0; padding: 8px 12px 12px; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.rp-panel legend { padding: 0 6px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.rp-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.rp-fields label { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.rp-fields label.wide { grid-column: 1 / -1; }
.rp-fields select, .rp-fields input { width: 100%; min-width: 0; }
.rp-filter-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* the stock lists' search: goods without a balance, below the list */
.stock-zero tr:first-child td { border-top: 2px dashed var(--border-strong); }
/* the desks' „სხვა“ booked over several lines: one row of fields per line, wrapping on a narrow window */
.other-line { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: flex-end; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.other-line > label { flex: 2 1 12rem; min-width: 0; }
.other-line > label:has([name="amount"]) { flex: 0 0 7rem; }
.other-line > [hidden] { display: none; }
.other-line [data-line-del] { align-self: center; }
.rp-set { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.chip-x { margin-left: 2px; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: var(--fs); line-height: 1; cursor: pointer; }
.chip-x:hover { color: var(--text); }
@media (max-width: 760px) { .rp-panels { grid-template-columns: 1fr; } }
@media (max-width: 340px) { .rp-fields { grid-template-columns: 1fr; } }
.report-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 12px; }
.report-sign { display: none; }
@media print {
  .report-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 36px; }
  table.report tr[hidden] { display: none; }
}
@media (max-width: 900px) { .report-parties { grid-template-columns: 1fr; } }

/* ---------- home ---------- */

/* the home page's title bar: the company, the day, the main actions */
.hero {
  position: relative; overflow: hidden;
  display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  margin-bottom: 20px; padding: 24px 28px; border-radius: var(--radius-lg); color: #fff;
  border: 1px solid #24354e; background: var(--title-bar); box-shadow: var(--shadow);
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -140px; width: 380px; height: 380px; pointer-events: none;
  background: radial-gradient(circle, rgba(22, 202, 181, 0.16), transparent 66%);
}
.hero > * { position: relative; z-index: 1; }
.hero-text { min-width: 0; }
.hero h1 { margin: 2px 0 6px; font-size: var(--fs-title); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hero .hello { color: var(--mint); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .03em; }
.hero .muted { color: #c3cfe2; }
.hero .quick { margin: 0; }
.hero .quick button:not(.primary) { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.hero .quick button:not(.primary):hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); }
.hero .quick button.primary { background: #2f6fe8; border-color: #2f6fe8; color: #fff; }
.hero .quick button.primary:hover { background: #3d7ff3; border-color: #3d7ff3; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; margin-bottom: 18px; }
/* the home page's six money cards: three columns and two rows on a wide screen, fewer on a narrow one */
.kpis.home-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
@media (max-width: 1180px) { .kpis.home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis.home-kpis { grid-template-columns: minmax(0, 1fr); } }
/* the receipt's logo preview (settings → company): on white, as it prints */
.rlogo-img img { display: block; max-width: 320px; max-height: 90px; background: #fff; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.kpi {
  position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px;
  text-align: left; white-space: normal; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  font-size: var(--fs); font-weight: 400; line-height: 1.5; color: var(--text); min-height: 0;
}
.kpi.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.kpi.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: var(--surface); }
.kpi .label { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs); font-weight: 500; line-height: 1.35; }
.kpi .label .nav-icon {
  width: 20px; height: 20px; padding: 8px; box-sizing: content-box; border-radius: 10px;
  background: var(--accent-soft); color: var(--link); opacity: 1;
}
.kpi .value { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .value small { font-size: var(--fs-md); color: var(--muted); font-weight: 500; }
.kpi .sub { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; overflow-wrap: anywhere; }
.kpi.alert { border-color: color-mix(in srgb, var(--bad) 60%, var(--border)); }
.kpi.alert .label .nav-icon { background: var(--bad-soft); color: var(--bad); }
.vat-big .kpi .value { font-size: 24px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.grid-2 > .card { margin-bottom: 0; }
.home-main { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 8px; flex: none; background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }
.dot.info { background: var(--accent); }
.count {
  display: inline-block; min-width: 24px; padding: 0 8px; margin-left: 8px; vertical-align: 2px;
  border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: var(--fs-xs); font-weight: 700; line-height: 22px; text-align: center;
}
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.todo-list li > .grow { flex: 1 1 280px; } /* the words keep room; a button goes under them on a narrow card */
.todo-list li:last-child { border-bottom: 0; }
.todo-list li .grow { min-width: 0; overflow-wrap: break-word; }
/* a long folder path or code in a sentence breaks instead of widening the page (a phone) */
.card p { overflow-wrap: break-word; }
.todo-list li.bad { color: var(--bad); }
.todo-list li button { margin-top: 1px; }
.todo-list li button.link { font-size: var(--fs); }
/* a self-service machine stopped on a fault (home pages) */
.card.vend-stopped { border-left: 4px solid var(--bad); }
.card.vend-stopped .row { gap: 10px; align-items: center; flex-wrap: wrap; }
.card.vend-stopped .dot { margin-top: 0; }
.card.vend-stopped strong { color: var(--bad); }
/* a switched-off basket: one line each (the board's stop and the baskets may stand together) */
.vend-blk { display: block; margin-top: 2px; }
.all-good { text-align: center; padding: 22px 0 10px; color: var(--muted); }
.all-good-mark {
  width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok); font-size: 22px; font-weight: 700;
}
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

.chart { width: 100%; height: auto; display: block; }
.chart .bar-in { fill: var(--chart-in); }
.chart .bar-out { fill: var(--chart-out); opacity: .9; }
.chart .cash-line { fill: none; stroke: var(--chart-cash); stroke-width: 2; stroke-linejoin: round; opacity: .7; }
.chart .cash-dot { fill: var(--surface); stroke: var(--chart-cash); stroke-width: 1.6; }
.chart .zero { stroke: var(--border-strong); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart rect:hover { opacity: 1; filter: brightness(1.1); }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: var(--fs-sm); margin-top: 8px; }
.legend .key { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: -10px; vertical-align: -1px; }
.legend .key.in { background: var(--chart-in); }
.legend .key.out { background: var(--chart-out); }
.legend .key.cash { background: var(--chart-cash); height: 3px; border-radius: 2px; vertical-align: 3px; }

.card.annual { border-left: 4px solid var(--accent); }
.card.annual.soon { border-left-color: var(--warn); }
.card.annual.late { border-left-color: var(--bad); }
.card.annual.done { border-left-color: var(--ok); }

/* ---------- month-end ---------- */

.progress-line { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 8px 0 14px; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: var(--brand-gradient); transition: width .4s; }
.tasks .task { padding: 18px 22px; }
.task-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.task-head h2 { margin: 0 0 2px; font-size: var(--fs-md); }
.task-head .grow { min-width: 220px; }
.task-no {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); font-weight: 700; font-size: var(--fs-sm);
}
.task.done .task-no { background: var(--ok-soft); color: var(--ok); }
.task.todo .task-no { background: var(--warn-soft); color: var(--warn); }
.task.blocked .task-no { background: var(--bad-soft); color: var(--bad); }
.task.none { opacity: .75; }
.task-pick { margin-top: 6px; transform: scale(1.15); }
.task-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.task .table-wrap { margin-top: 12px; }
.task p { margin: 10px 0 0; }

/* ---------- misc ---------- */

.meter { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.meter-fill { height: 100%; width: 0; background: var(--ok); border-radius: 999px; }
.meter-fill.warn { background: var(--warn); }
.meter-fill.bad { background: var(--bad); }
ul.calendar { margin: 0; padding-left: 20px; }
ul.calendar li { margin-bottom: 6px; }

.bank-table select { min-width: 180px; max-width: 280px; }
.bank-table td { vertical-align: middle; }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { border: 0; border-radius: 0; min-height: 36px; box-shadow: none; background: transparent; }
.segmented button + button { border-left: 1px solid var(--border-strong); }
.segmented button.active { background: var(--accent-fill); color: var(--accent-text); font-weight: 600; }

table.statement tr.section td { font-weight: 700; font-size: var(--fs-md); padding-top: 16px; background: none; }
table.statement tr.group td { font-weight: 600; color: var(--muted); background: none; }
table.statement tr.total td { font-weight: 600; border-top: 1px solid var(--muted); }
table.cpbal tr.total td { font-weight: 600; border-top: 1px solid var(--muted); }
table.statement tr.strong td { font-weight: 700; }
table.statement td:first-child { padding-left: 18px; }

#ai-preview { margin-top: 14px; }
#ai-preview summary { cursor: pointer; color: var(--muted); }
#ai-preview pre { max-height: 360px; overflow: auto; white-space: pre-wrap; font-size: var(--fs-xs); background: var(--surface-2); border: 1px solid var(--border); padding: 10px; border-radius: 8px; }
.answer { white-space: pre-wrap; line-height: 1.65; }

/* ---------- messages: a card in the corner, turquoise for done, red for an error ---------- */

#toasts {
  position: fixed; right: 20px; bottom: 72px; z-index: 60; /* above the bar at the bottom */
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  max-width: min(480px, calc(100vw - 40px));
}
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-2); color: var(--text);
  padding: 12px 12px 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); border-left: 4px solid var(--mint);
  box-shadow: var(--shadow-lg); font-size: var(--fs);
  animation: toast-in .18s ease-out;
}
.toast.error { background: color-mix(in srgb, var(--bad) 16%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 55%, transparent); border-left-color: var(--bad); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.toast-icon {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint-soft); color: var(--mint); font-weight: 700; font-size: 12.5px;
}
.toast.error .toast-icon { background: var(--bad-soft); color: var(--bad); }
.toast-text { flex: 1; min-width: 0; line-height: 1.5; overflow-wrap: break-word; }
.toast-close { min-height: 0; padding: 0 4px; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; }
.toast-close:hover { background: none; color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- dialogs ---------- */

dialog { color: var(--text); }
/* no backdrop blur: on a tall, scrolling dialog Chrome repaints it and the window flickers (the user, 2026-10-02) */
dialog::backdrop { background: var(--backdrop); }
.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal[open] { animation: pop .16s ease-out; }
.modal:has(table) { width: min(780px, calc(100vw - 32px)); }
.modal:has(.item-card) { width: min(840px, calc(100vw - 32px)); }
.modal-body { padding: 24px 24px 20px; }
.modal-body h2 { font-size: 20px; }
.modal-text { white-space: pre-line; line-height: 1.6; }
.modal-body label { margin-top: 6px; }
.modal-actions { justify-content: flex-end; margin-top: 20px !important; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

.palette {
  width: min(660px, calc(100vw - 32px)); margin-top: 12vh;
  padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.palette[open] { animation: pop .14s ease-out; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.palette-input svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.palette-input input { border: 0; box-shadow: none; padding: 6px 0; font-size: var(--fs-md); background: transparent; }
.palette-input input:focus { box-shadow: none; }
#palette-list { max-height: min(56vh, 480px); overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 12px 4px; color: var(--faint); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; }
.palette-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  border: 0; border-radius: 10px; padding: 9px 12px; min-height: 0; background: none; white-space: normal; font-size: var(--fs);
}
.palette-item:hover { background: var(--surface-2); }
.palette-item.active { background: var(--accent-soft); }
.palette-label { font-weight: 500; }
.palette-sub { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.palette-empty { color: var(--muted); padding: 18px; text-align: center; margin: 0; }
.palette-foot { display: flex; gap: 6px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-xs); }

/* ---------- narrow windows and big browser zoom ---------- */

@media (max-width: 1100px) {
  .home-main { grid-template-columns: minmax(0, 1fr); }
}
/* the menu folds away: the logo and „მენიუ“ on top, the list opens under them */
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; z-index: 40; height: auto; max-height: 100vh; overflow-y: auto;
    padding: 10px 16px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 18px rgba(1, 6, 16, 0.3);
  }
  .brand { align-items: center; padding: 0; }
  .brand-logo { height: 30px; }
  .brand-sub { display: none; }
  .menu-toggle { display: inline-flex; }
  .sidebar .search-pill, .sidebar #tabs { display: none; }
  body.nav-open .sidebar .search-pill { display: flex; margin: 12px 0 10px; }
  body.nav-open .sidebar #tabs { display: flex; padding-bottom: 6px; }
  #tabs .nav-title { display: block; }
  .content { padding: 18px 20px 96px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  :root { --fs-title: 24px; }
  .content { padding: 14px 14px 92px; }
  .page-head, .hero { padding: 18px; border-radius: var(--radius); }
  .card { padding: 18px 16px; }
  .search-pill kbd { display: none; }
  .topbar { margin-bottom: 14px; gap: 8px; }
  .topbar-company { flex-basis: 100%; }
  .topbar .company-switch { min-height: 36px; padding: 5px 12px; }
  .kpi .value { font-size: 26px; }
}

@media print {
  /* paper is white: the light words on the dark design would vanish */
  :root, :root[data-theme] {
    --bg: #fff; --surface: #fff; --surface-2: #f3f5f9; --surface-3: #eceff5; --field: #fff;
    --text: #000; --muted: #333; --faint: #555; --border: #c9cfd8; --border-strong: #9aa3b0;
    --link: #000; --ok: #0b6b5f; --bad: #b3263a; --warn: #8a4b05;
    --accent-soft: #eef3fb; --ok-soft: #eaf6f3; --bad-soft: #fbecee; --warn-soft: #fbf2e4;
  }
  .sidebar, .topbar, #taskbar, .page-close, .no-print, .subtabs, #toasts, #busy, .hero .quick, .menu-toggle { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; }
  .content { padding: 0; }
  .page-head { background: none; border: 0; box-shadow: none; padding: 0; }
  .page-head::after, .hero::after { display: none; }
  .page-head h1, .page-head p, .hero, .hero .muted { color: #000; }
  .hero { background: none; border: 0; box-shadow: none; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; margin-bottom: 24px; break-inside: avoid; }
  .table-wrap { border: 0; }
  th { position: static; }
}
[hidden] { display: none !important; }

#order-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 auto 16px; padding: 12px 16px;
  background: var(--ok-soft); color: var(--text);
  border: 1px solid var(--ok); border-radius: var(--radius); box-shadow: var(--shadow);
}
#order-banner .grow { flex: 1; min-width: 220px; }

/* ---------- waybills (the „ზედნადებები“ page) ---------- */

.wb-detail:empty { display: none; }
.wb-detail {
  margin: -4px -4px 18px; padding: 16px;
  border: 1px solid var(--accent); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-md);
}
.wb-detail .grid-2 { margin-bottom: 0; }
/* a waybill opened under its own row (several at once), its row marked while open */
table.recent tr.wb-open td { background: var(--accent-soft); }
table.recent tr.wb-inline { cursor: default; }
table.recent tr.wb-inline > td { padding: 4px 0 14px; background: transparent; white-space: normal; }
table.recent tr.wb-inline .wb-detail { margin: 0; }
/* the card's head: what it is, the number big, the state and „დახურვა“ on the right; then the supplier and the date */
.wb-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.wb-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wb-head-kind { color: var(--muted); font-size: var(--fs-sm); }
.wb-head-no { margin: 0; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wb-head-side { display: flex; align-items: center; gap: 10px; }
.wb-facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }
.wb-facts dt { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 2px; }
.wb-facts dd { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.wb-facts dd .muted { font-weight: 400; }
.wb-detail table.kv td { padding: 5px 10px; }
.wb-detail table.kv td:first-child { width: 42%; }
.wb-form fieldset {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px 14px; margin: 0 0 14px; min-width: 0;
}
.wb-form legend { padding: 0 6px; color: var(--link); font-weight: 600; font-size: 13px; }
.wb-form textarea { width: 100%; resize: vertical; }
.wb-hint { padding-bottom: 10px; }
table.wb-goods td { padding: 6px; }
table.wb-goods input[name="name"] { min-width: 240px; }
table.wb-goods input[name="bar_code"] { min-width: 130px; }
table.wb-goods select[name="unit_id"] { min-width: 110px; }
table.wb-goods input[name="unit_txt"] { margin-top: 4px; min-width: 110px; }
/* the quantity and price boxes fill their columns — right under their headings, as the name and code (the user,
   2026-11-03: "the cells under quantity and price do not match the headings") */
table.wb-goods input[name="qty"], table.wb-goods input[name="price"] { min-width: 90px; width: 100%; }
table.wb-goods select[name="vat_type"] { min-width: 120px; }
table.wb-goods .wb-line-amount { vertical-align: middle; font-weight: 600; }
#wb-check:empty { display: none; }
#wb-check { margin-bottom: 4px; }
.dialog-fields { display: grid; gap: 10px; margin-bottom: 6px; min-width: min(420px, 80vw); }
/* the goods card in two columns, so it fits the screen without scrolling */
.dialog-fields.item-card { grid-template-columns: 1fr 1fr; gap: 8px 14px; min-width: min(760px, 86vw); }
.dialog-fields.item-card > .wide { grid-column: 1 / -1; }
.dialog-fields.item-card h3 { margin: 6px 0 0; }
@media (max-width: 640px) { .dialog-fields.item-card { grid-template-columns: 1fr; } }

/* ---------- reportal.ge's forms (statements page) ---------- */

.reportal-forms { align-items: start; }
table.reportal tr.group td, table.reportal tr.total td { background: var(--accent-soft); font-weight: 600; }
table.reportal tr.total td { border-top: 0; }
table.reportal tr.sub td:first-child { padding-left: 36px; color: var(--muted); }
table.reportal tr.memo td { color: var(--muted); font-style: italic; }
table.reportal td.copy { cursor: copy; white-space: nowrap; }
table.reportal tr.line td.copy:hover { background: var(--mint-soft); }
@media print {
  .reportal-forms { display: block; }
}
.offscreen { position: fixed; left: -9999px; top: 0; }
/* the portal's own tab strip, one form at a time */
.portal-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: -4px 0 16px; }
.portal-tabs button { border-radius: 8px 8px 0 0; background: var(--surface-2); color: var(--muted); border-color: var(--border-strong); font-weight: 500; font-size: var(--fs); }
.portal-tabs button:hover { background: var(--surface-3); color: var(--text); }
.portal-tabs button.active { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-text); font-weight: 600; }
.rp-head { margin-bottom: 6px; }
.rp-head h2 { margin: 0; text-transform: none; }
table.reportal tr.grey td { color: var(--faint); }
table.reportal tr.grey td.copy { font-style: italic; }
.rp-part { border-top: 1px solid var(--border); padding: 12px 0 4px; }
.rp-part:first-of-type { border-top: 0; }
.rp-part h3 { font-size: 13.5px; margin: 0 0 6px; color: var(--link); font-weight: 600; }
@media print {
  .rp-form[hidden] { display: block !important; }
}
/* the VAT return as rs.ge shows it: 16 numbered pages as round steps */
.vf-steps { gap: 6px; }
.vf-steps button { border-radius: 50%; width: 40px; height: 40px; min-height: 0; padding: 0; justify-content: center; background: var(--surface-2); border-color: var(--border-strong); color: var(--text); font-variant-numeric: tabular-nums; }
.vf-steps button.active { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-text); }
.vf-steps button.empty:not(.active) { opacity: 0.45; }
table.reportal td.copy.locked { color: var(--muted); }
table.vat-rows td:first-child { min-width: 380px; }
table.vat-list td.copy { cursor: copy; }
table.vat-list td.copy:hover { background: var(--mint-soft); }

/* the closing of income and expenses (ბრუნვითი უწყისი) */
fieldset.pl-target { border: 0; padding: 0; margin: 8px 0 0; display: grid; gap: 2px; }
fieldset.pl-target label.inline { flex-wrap: wrap; padding-bottom: 4px; }
#pl-card h3 { font-size: 13.5px; margin: 16px 0 6px; font-weight: 600; }

/* two computers (sync.js): the bar over the page while the other computer writes, or a conflict waits */
.sync-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; padding: 10px 14px;
  border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; }
.sync-bar.bad { background: var(--bad-soft); color: var(--bad); }
.sync-bar .grow { flex: 1 1 280px; }
.sync-bar button { font-size: 13px; }

/* the cash desks' days (views.pos) */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.group-row td { background: var(--surface-2); border-top: 1px solid var(--border-strong); }

/* ---------- the bar at the bottom: open pages, × closes (the user, 2026-09-28) ---------- */
/* The menu's colour, so the two read as one frame around the page; the current page carries the turquoise mark. */
#taskbar {
  position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--sidebar);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -6px 18px rgba(1, 6, 16, 0.22);
  overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
#taskbar[hidden], body.choosing #taskbar { display: none; }
#taskbar .task.dragging { position: relative; z-index: 2; cursor: grabbing; opacity: 0.92; box-shadow: 0 6px 16px rgba(1, 6, 16, 0.45); transition: none; }
#taskbar .task {
  display: inline-flex; align-items: stretch; flex: none;
  border-radius: 10px; overflow: hidden;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text);
  transition: background .12s, border-color .12s, color .12s;
}
#taskbar .task:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
#taskbar .task.current { background: var(--sidebar-active); border-color: rgba(54, 122, 246, 0.6); color: #fff; box-shadow: inset 0 -3px 0 var(--sidebar-mark); }
#taskbar button { border: 0; border-radius: 0; background: none; color: inherit; font: inherit; min-height: 0; padding: 0; box-shadow: none; transform: none; }
#taskbar button:hover { background: none; border-color: transparent; }
#taskbar button:focus-visible { outline: 2px solid var(--sidebar-mark); outline-offset: -2px; }
#taskbar .task-go { display: inline-flex; align-items: center; gap: 8px; padding: 7px 6px 7px 12px; font-size: var(--fs); font-weight: 500; white-space: nowrap; }
#taskbar .task-go .nav-icon { width: 18px; height: 18px; opacity: .78; }
#taskbar .task.current .nav-icon { opacity: 1; color: var(--sidebar-mark); }
#taskbar .task-badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--sidebar-mark); color: #04211d; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
#taskbar .task-x { display: inline-flex; align-items: center; justify-content: center; width: 30px; margin-left: 2px; color: var(--sidebar-muted); }
#taskbar .task-x svg { width: 12px; height: 12px; }
#taskbar .task-x:hover { background: rgba(255, 107, 122, 0.4); color: #fff; }
/* Room for the bar is inside .content (its bottom padding), not on body: body padding sits outside the .app grid and
   showed as a white strip under the menu, the whole width of the window (the user, 2026-09-28). */
@media (max-width: 1023px) {
  #taskbar { left: 0; padding: 6px 10px; } /* the menu is on top there, not on the left */
  #toasts { bottom: 64px; }
}
.wb-pick { min-width: 220px; }

/* a sales document's make-up (v22): its goods and the day's receipts; a receipt opens to its lines */
.sale-doc { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.sale-doc h3 { margin: 0 0 6px; font-size: 15px; }
.sale-doc details { margin-top: 10px; }
.sale-doc .table-wrap { max-height: 520px; overflow: auto; }
.sale-doc tr.receipt-row { cursor: pointer; }
.sale-doc tr.receipt-row:hover td { background: var(--surface-2, rgba(127, 127, 127, .08)); }
.sale-doc tr.receipt-lines > td { padding: 4px 12px 10px 28px; background: var(--surface-2, rgba(127, 127, 127, .05)); }
.sale-doc tr.receipt-lines table { width: auto; min-width: 60%; font-size: var(--fs-sm); }

/* შესყიდვა-გაყიდვა: the opened document's card shows only when a document is open */
#doc-detail:empty, #doc-editor:empty { display: none; }

/* R6: signing in over the shop's network (the server's own computer never sees it) */
.signin-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--backdrop); }
.signin { width: min(380px, 92vw); display: grid; gap: 10px; }
.signin .bad:empty { display: none; }
/* a computer's card on the cloud's settings (app.js: the receipt logo) — the sub-tabs set [hidden] themselves */
.card.computer-only { display: none !important; }

/* the cloud's gate (app.js showCloudSignIn): a page of its own over the program — SOLO's word and the forms */
.cloud-gate {
  background: var(--bg); overflow-y: auto; place-items: stretch;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}
body.gated { overflow: hidden; }
.cloud-gate .gate-brand {
  position: relative; overflow: hidden; display: grid; align-content: center; gap: 18px;
  padding: 48px clamp(28px, 6vw, 88px); background: var(--title-bar); color: #fff; border-right: 1px solid var(--border);
}
/* --title-bar is dark in the light design too (as .hero / .page-head): the side's words stay white */
.cloud-gate .gate-brand::before { /* the mark's hexagon, large and faint */
  content: ""; position: absolute; right: -300px; top: calc(50% - 300px); width: 600px; height: 600px; pointer-events: none;
  background: linear-gradient(160deg, rgba(54, 122, 246, .2), rgba(22, 202, 181, .16));
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}
.cloud-gate .gate-logo { justify-self: start; }
.cloud-gate .gate-logo img { display: block; height: 46px; width: auto; margin: 0 0 18px; }
.cloud-gate h1 { position: relative; margin: 0; max-width: 13em; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; font-weight: 800; text-wrap: balance; }
.cloud-gate h1 span { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cloud-gate .gate-brand p { position: relative; margin: 0; max-width: 30em; color: rgba(255, 255, 255, .78); font-size: var(--fs-md); line-height: 1.6; }
.cloud-gate .gate-brand ul { position: relative; list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; color: rgba(255, 255, 255, .78); }
.cloud-gate .gate-brand li { display: flex; align-items: center; gap: 10px; }
.cloud-gate .gate-brand li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--mint); flex: none; }
.cloud-gate .gate-forms { display: grid; align-content: center; justify-items: center; gap: 18px; padding: 40px 24px; }
.cloud-gate .signin { width: min(400px, 100%); padding: 28px 28px 24px; gap: 12px; box-shadow: var(--shadow-lg); }
.cloud-gate .signin h2 { margin: 0; font-size: var(--fs-xl); }
.cloud-gate .gate-sub { margin: -6px 0 6px; font-size: var(--fs-sm); }
.cloud-gate .signin button.primary { min-height: 44px; margin-top: 4px; }
.cloud-gate .gate-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 4px; }
.cloud-gate .gate-back { justify-self: start; }
.cloud-gate .gate-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cloud-gate .gate-foot { margin: 0; color: var(--faint); font-size: var(--fs-sm); }
.cloud-gate .gate-foot a { color: var(--faint); }
@media (max-width: 860px) {
  .cloud-gate { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .cloud-gate .gate-brand { padding: 28px 22px 26px; border-right: 0; border-bottom: 1px solid var(--border); gap: 12px; }
  .cloud-gate .gate-brand::before { width: 300px; height: 300px; right: -150px; top: calc(50% - 150px); }
  .cloud-gate .gate-logo img { height: 36px; margin-bottom: 6px; }
  .cloud-gate h1 { font-size: 26px; }
  .cloud-gate .gate-brand p { font-size: var(--fs); }
  .cloud-gate .gate-brand ul { display: none; }
  .cloud-gate .gate-forms { align-content: start; padding: 22px 16px 32px; }
  .cloud-gate .signin { padding: 22px 18px 20px; }
}

/* ---------- a received waybill taken into stock (app.js wbReceiveTable / bindReceive) ---------- */
.wb-receive td { vertical-align: top; }
.wb-receive .wb-our { min-width: 300px; }
.wb-receive .wb-our .badge { margin-right: 4px; }
.wb-receive .wb-new { display: grid; gap: 6px; margin: 6px 0 4px; }
.wb-receive .wb-new > input { width: 100%; }
.wb-receive input, .wb-receive select { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.wb-receive .wb-new-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.wb-receive .wb-new-row.units { grid-template-columns: 80px 1fr; }
.wb-receive .wb-new-row label { margin: 0; font-size: 12px; color: var(--muted); display: grid; gap: 2px; min-width: 0; }
.wb-receive .wb-new-row input, .wb-receive .wb-new-row select { width: 100%; min-width: 0; }
.wb-receive input[type="checkbox"] { min-height: 0; width: 16px; height: 16px; padding: 0; margin: 0 6px 0 0; vertical-align: -3px; }
.wb-receive label.nowrap { display: inline; margin: 0; white-space: normal; }
.wb-receive input[data-pack] { width: 4.5em; }
.wb-receive input[data-conv], .wb-receive input[data-conv-total] { width: 6em; display: inline-block; }
.wb-receive label:has(> [data-conv]), .wb-receive label:has(> [data-conv-total]) { display: block; margin: 0 0 4px; white-space: nowrap; }
.wb-receive input[data-shelf-in] { width: 6.5em; }
.wb-receive input.changed { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wb-receive.as-expense td:nth-child(n+4) { opacity: .35; pointer-events: none; }
/* the product picker: a long list in a wide window */
.modal:has(.picker) { width: min(900px, calc(100vw - 32px)); }
.picker-list { max-height: 55vh; overflow: auto; }
.picker-list table { width: 100%; }
.picker-list tr.clickable { cursor: pointer; }
/* a new product made inside the picker (2026-10-09) */
.picker-new { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: var(--accent-soft); }
.picker-new h3 { margin: 0 0 6px; font-size: 15px; }

/* the tax invoice issued from a sale (app.js invoiceSection) */
.invoice-box { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, transparent); }
.invoice-box h3 { margin: 0 0 6px; font-size: 15px; }
.invoice-box p { margin: 4px 0; }
.modal .lines input[name="goods"] { min-width: 300px; }
/* „ახალი გატარება“ — the operation drop-down and its forms (operations.js) */
.op-head { align-items: center; }
.op-head h2 { margin: 0; }
.op-kind select { min-width: 340px; font-weight: 600; font-size: 14px; }
.op-form > p.muted:first-child { margin-top: 0; max-width: 90ch; }
/* what the document's lines are — goods, services… (the user, 2026-11-11: "hard for the eye to see that lines are added from
   there"): a labelled switch of big buttons, the chosen one filled, each with how many lines it holds */
.op-tabs-wrap { display: flex; align-items: center; gap: var(--sp-2, 8px) var(--sp-3, 12px); flex-wrap: wrap; margin: 14px 0 12px;
  padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius, 12px); }
.op-tabs-label { font-weight: 600; color: var(--text); }
.op-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.op-tabs button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); box-shadow: none; color: var(--text); font-weight: 600; padding: 8px 16px; min-height: var(--control-h, 40px); }
.op-tabs button:hover { border-color: var(--accent); background: var(--surface-3); color: var(--text); }
.op-tabs button.active { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-text); }
.op-count { font-weight: 600; font-size: var(--fs-sm); min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center;
  background: var(--surface-3); color: var(--text); }
.op-count:empty { display: none; }
.op-tabs button.active .op-count { background: color-mix(in srgb, var(--accent-text) 25%, transparent); color: var(--accent-text); }
@media (max-width: 600px) { .op-tabs-wrap { flex-direction: column; align-items: stretch; } .op-tabs button { flex: 1 1 auto; justify-content: center; } }
table.op-goods td, table.op-other td { vertical-align: middle; }
.op-n { width: 28px; text-align: right; }
td.op-item { min-width: 260px; }
table.op-goods td input.num, table.op-other td input.num { min-width: 86px; width: 104px; }
table.op-other input[name="memo"] { min-width: 300px; }
table.op-other select { min-width: 200px; max-width: 280px; }
td[data-prev].warn { color: var(--warn); font-weight: 600; }
.op-add { margin-top: 10px; }
.op-expense { margin-top: 10px; max-width: 520px; }
.op-rate { width: 110px; }
.op-cp { flex: 2 1 300px; min-width: 260px; }
.op-sum { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: flex-end; margin-top: 14px; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-variant-numeric: tabular-nums; color: var(--muted); }
.op-sum b { color: var(--text); }
.op-sum .op-total b { font-size: 16px; }
.op-preview:not(:empty) { margin-top: 10px; }
.op-preview table.op-lines td { padding: 4px 10px; }
.op-done { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--ok); background: var(--ok-soft); border-radius: 12px; }
.op-done h3 { margin: 0; color: var(--ok); font-size: 15px; }
.op-done .table-wrap { background: var(--surface); border-radius: 8px; }
.op-go { max-width: 80ch; }
table.op-other input.op-unit { min-width: 120px; width: 140px; }
/* a purchase / sale document on „შესყიდვა-გაყიდვა“ (app.js docCard) */
.doc-title { align-items: center; }
.doc-title h2 { margin: 0; }
/* a document's own window: its buttons at the top, over the form; „რედაქტირება“ only while the form is closed */
.doc-actions { justify-content: flex-end; gap: 8px; margin: 0 0 12px; }
.doc-actions:empty { display: none; }
body:has(#doc-editor:not([hidden])) .doc-actions [data-doc-edit] { display: none; }
/* …and they stay in sight while the form below is filled in („დ/კ“ among them — the review of 2026-10-30); on a narrow
   screen the folded menu is the bar on top and the buttons wrap into rows — there they scroll with the page */
@media (min-width: 1024px) {
  .doc-actions { position: sticky; top: 0; z-index: 5; margin: 0 0 var(--sp-2); padding: var(--sp-2) 0; background: var(--bg); }
  .doc-actions:not(:empty) ~ #doc-editor { scroll-margin-top: 72px; }
}
.doc-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 12px 14px; margin: 4px 0 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.doc-facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.doc-facts > div.num { margin-left: auto; text-align: right; }
.doc-facts span { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.doc-facts strong { font-size: 15px; }
.doc-facts small { color: var(--muted); font-size: 12px; }
.doc-sub { margin: 14px 0 8px; font-size: 15px; }
/* „დ/კ“ — the entries behind a document, in a window of its own (app.js docEntriesWindow) */
.drcr-btn { font-weight: 700; letter-spacing: .02em; }
.modal.doc-entries { width: min(1100px, calc(100vw - 32px)); }
.doc-entries .de-top { align-items: center; }
.doc-entries .de-top h2 { margin: 0; }
.de-group { margin-top: var(--sp-4); }
.de-entry { margin: 0 0 var(--sp-3); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.de-entry.de-reversed { border-style: dashed; }
.de-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.de-desc { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.de-note { margin: 4px 0 0; }
.doc-entries table.de-lines { width: 100%; margin-top: 6px; }
.doc-entries table.de-lines td.de-memo { min-width: 160px; }
.de-sub { display: none; margin-top: 2px; overflow-wrap: anywhere; }
.de-code { font-weight: 600; font-variant-numeric: tabular-nums; }
.de-notes { margin: var(--sp-4) 0 0; padding-left: 18px; }
@media (max-width: 700px) {
  .doc-entries .modal-body { padding: 14px 12px 16px; }
  .de-entry { padding: 8px; }
  /* a phone: account, debit, credit across; the counterparty and the note under the account */
  .doc-entries table.de-lines .de-cp, .doc-entries table.de-lines .de-memo { display: none; }
  .doc-entries table.de-lines th, .doc-entries table.de-lines td { padding: var(--sp-1) var(--sp-2); }
  .doc-entries table.de-lines td:first-child { overflow-wrap: anywhere; }
  .doc-entries .de-sub { display: block; }
}
table.doc-lines td { vertical-align: middle; }
/* the document's waybill and invoice (app.js docLinks) */
.doc-links:not(:empty) { display: grid; gap: 6px; margin: 0 0 14px; }
.doc-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; border-left: 3px solid var(--border-strong); }
.doc-link.on { border-left-color: var(--ok); }
.doc-link.off { border-left-color: var(--warn); background: var(--warn-soft); }
.doc-link-label { min-width: 132px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.doc-link-text { flex: 1 1 280px; }
/* type-and-pick fields (combo.js): a caret on the field, the drop-down in the page's colours, the window's groups */
input.combo {
  /* a caret drawn by two gradients — the page's CSP allows no data: images */
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.combo-menu {
  position: fixed; z-index: 1000; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.combo-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1 1 auto; }
.combo-list li { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.combo-list li:hover { background: var(--surface-2); }
.combo-list li.active { background: var(--accent-soft); color: var(--link); }
.combo-main { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.combo-sub { flex: 0 1 auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.combo-badge { flex: 0 0 auto; font-size: 11px; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; }
.combo-qty { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a product's stock (app.js stockNote): none left, below zero */
.qty-none { color: var(--warn); }
.qty-minus { color: var(--bad); font-weight: 600; }
.combo-list li.combo-empty { color: var(--muted); cursor: default; }
.combo-list li.combo-empty:hover { background: none; }
/* the VAT page as the month's steps (app.js views.vat, vat-month.js) */
.vat-month-pick { align-items: center; gap: 6px; }
.vat-month-pick input[type="month"] { width: auto; }
.vat-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vat-steps button { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.vstep-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 13px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.vstep-mark.ok { background: var(--ok-soft); color: var(--ok); }
.vstep-mark.todo { background: var(--accent-soft); color: var(--link); }
.vstep-mark.warn { background: var(--warn-soft); color: var(--warn); }
.vat-step { scroll-margin-top: 70px; }
.vat-step h2 { display: flex; align-items: center; gap: 8px; }
.vat-group { margin: 8px 0; }
td.vat-act { white-space: normal; min-width: 110px; }
td.vat-act button.link { display: block; margin: 0 0 4px; white-space: nowrap; }
.vat-group > summary { cursor: pointer; }
/* the VAT page: the year's months, the month's three parts, one list of what needs attention */
.vat-year tr.click { cursor: pointer; }
.vat-year tr.click:hover td { background: var(--surface-2); }
.vat-year tr.current td { background: var(--accent-soft); }
.vat-phase > .vat-step { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.vat-phase h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0; }
.vat-issues { list-style: none; margin: 0; padding: 0; }
.vat-issues li { display: flex; gap: 10px; align-items: baseline; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.vat-issues li:last-child { border-bottom: 0; }
.vat-issues li > span:first-child { width: 18px; flex: 0 0 18px; text-align: center; font-weight: 700; }
.vat-issues li.lv-todo > span:first-child { color: var(--link); }
.vat-issues li.lv-warn > span:first-child { color: var(--warn); }
.vat-issues li.lv-info > span:first-child { color: var(--muted); }
.vat-issues li.lv-info { color: var(--muted); }
.vat-issues .grow { flex: 1 1 auto; }
.vat-after { margin-top: 8px; }
tr.muted-row td { color: var(--muted); }
/* a <select> with a search line (combo.js selOpen) */
.select-menu .select-search { flex: 0 0 auto; margin: 6px; width: auto; min-height: 36px; }
.combo-list li.chosen .combo-main { font-weight: 700; }
.combo-list li.disabled { opacity: 0.5; cursor: default; }
button.combo-all {
  flex: 0 0 auto; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: var(--surface-2); color: var(--link);
  min-height: 38px; font-weight: 600; font-size: 13px; text-align: left; padding: 8px 14px; box-shadow: none;
}
button.combo-all:hover { background: var(--accent-soft); }
button.combo-new {
  flex: 0 0 auto; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: var(--accent-soft); color: var(--link);
  min-height: 38px; font-weight: 700; font-size: 13px; text-align: left; padding: 8px 14px; box-shadow: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.combo-new:hover, button.combo-new.active { background: var(--accent-fill); color: var(--accent-text); }
button.combo-all span { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.picker-groups { margin: 0 0 10px; }
.chip-count { color: var(--faint); font-weight: 400; margin-left: 2px; }
button.chip.active .chip-count { color: inherit; opacity: .75; }
.picker-list tr.clickable:focus-visible td { background: var(--accent-soft); outline: none; }
.doc-alert { margin: 0; padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.doc-alert.bad { background: var(--bad-soft); color: var(--bad); }
.doc-alert.warn { background: var(--warn-soft); color: var(--warn); }
/* a counterparty card with another card of the same name (ledger.getCounterparty twins) */
.cp-twins { margin: 8px 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); border-left: 4px solid var(--warn); line-height: 1.9; }
.cp-twins button { margin-left: 6px; }
/* a counterparty's name that opens its card (app.js cpLink) */
button.link.cp-link { text-align: left; white-space: normal; }
dialog.cp-window { width: min(1100px, calc(100vw - 32px)); }
/* the VAT return's explanation rows under „დარიცხული დღგ“ (declarations.js vatReturn at_rate / rounding / other) */
table.compact tr.sub td { color: var(--muted); font-size: 12.5px; padding-top: 4px; padding-bottom: 4px; }
table.compact tr.sub td:first-child { padding-left: 26px; cursor: help; }
.declare-box { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); max-width: 640px; }
.declare-box > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.declare-box span { font-weight: 600; }
.declare-box strong button.link { font-size: 16px; font-variant-numeric: tabular-nums; }
.declare-box p { margin: 6px 0 0; }
.nr-rate { width: 5em; }

/* each item's own window (item-window.js) */
.modal.item-window { width: min(1180px, calc(100vw - 32px)); }
/* a dialog opened ON a window (the item's „შესწორება“, the recipe, an entry from the account card): the window stays as
   it is — no second dark, blurred backdrop over it, no pop (the user, 2026-10-02: "the window vanishes and comes back") */
body:has(.item-window[open], .entry-window[open]) dialog:not(.item-window):not(.entry-window)::backdrop { background: transparent; backdrop-filter: none; }
body:has(.item-window[open], .entry-window[open]) dialog.modal:not(.item-window):not(.entry-window)[open] { animation: none; box-shadow: var(--shadow-lg); }
.modal.entry-window { width: min(1100px, calc(100vw - 32px)); } /* an entry opened from the account card */
/* the turnover sheet and the account card keep their header (დებეტი / კრედიტი) in sight (the user, 2026-10-01): the
   table scrolls inside its frame, the whole thead — both header rows of the turnover sheet — stuck to its top */
.table-wrap:has(> table.turnover), .table-wrap:has(> table.ledger) { max-height: calc(100vh - 150px); overflow: auto; }
table.turnover thead, table.ledger thead { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--border); }
table.turnover thead th, table.ledger thead th { position: relative; }
/* columns sized by hand (app.js colResize, the user, 2026-10-25: „as in Excel“): the widths fixed, a long name cut
   with „…“; the grip is the header cell's right edge */
table.col-fixed { table-layout: fixed; }
table.col-fixed th, table.col-fixed td { overflow: hidden; text-overflow: ellipsis; }
table.col-fixed td { white-space: nowrap; }
/* the edge is a faint line the whole height of the header cell, so the lines of a two-row header meet (the user,
   2026-11-11: "a faint line must show where I put the mouse and drag"); the hit area a little wider than the line; the
   right edge of the table has none */
.col-grip { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; touch-action: none; z-index: 2; }
.col-grip::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 1px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
th:last-child > .col-grip::after { display: none; }
th > .col-grip:hover::after, th > .col-grip.dragging::after { display: block; width: 3px; background: var(--accent); }
/* a two-row header: a cell over several columns (საწყისი ნაშთი…) stands in their middle */
thead tr:not(:last-child) th[colspan]:not([colspan="1"]) { text-align: center; }
/* „⚙ აწყობა“ → სტრიქონები: მჭიდრო (public/table-columns.js) */
table.t-dense th, table.t-dense td { padding-top: 4px; padding-bottom: 4px; }
table.t-dense td { font-size: var(--fs-sm); }
.tcols-more { align-items: center; gap: 6px 14px; margin-top: 10px; }
@media print { .col-grip { display: none; } }
.cur-row td { font-size: 12px; color: var(--muted); padding-top: 0; }
table.ledger tr[data-card-entry] { cursor: pointer; }
table.ledger tr[data-card-entry]:hover td { background: var(--accent-soft); }
.item-window .modal-body { padding: 18px 20px 20px; }
.item-head { align-items: center; gap: 8px; }
.item-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-period { align-items: flex-end; gap: 10px; margin: 10px 0 4px; }
.item-facts > div { min-width: 170px; }
.item-facts > div > div { font-variant-numeric: tabular-nums; }
.item-kinds { margin: 0 0 10px; }
.chip-static { display: inline-flex; gap: 4px; align-items: baseline; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: var(--muted); }
.chip-static strong { color: var(--text); font-weight: 600; }
.item-scroll { max-height: 48vh; overflow: auto; }
.item-window table td.num, .item-window table th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-window table.kv th { text-align: left; font-weight: 500; color: var(--muted); padding-right: 18px; white-space: nowrap; }
.icon-btn { min-height: 0; padding: 0 6px; border: 0; background: none; color: var(--muted); font-size: 13px; line-height: 1.4; cursor: pointer; }
.icon-btn:hover { color: var(--link); background: none; }
@media (max-width: 700px) {
  .item-window .modal-body { padding: 14px 12px 16px; }
  .item-facts > div { min-width: 130px; }
}

/* date fields as დდ.თთ.წწწწ (date-field.js): the text field, the calendar button inside it, the browser's own date
   input hidden under it (it keeps the form's value and anchors the picker) */
.date-field { position: relative; display: block; min-width: 9.5em; }
.date-field .date-text { padding-right: 34px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.date-field .date-pick {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-height: 0; width: 28px; height: 28px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
.date-field .date-pick:hover:not(:disabled) { color: var(--link); background: var(--accent-soft); }
.date-field .date-pick:disabled { opacity: .4; cursor: default; }
.date-field.month-field { min-width: 11em; }
.date-field.month-field .date-text { cursor: pointer; }
.date-field .date-native {
  position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0;
  border: 0; opacity: 0; pointer-events: none;
}

/* reports: a group row opens its goods under it */
table.report tr[data-expand] { font-weight: 600; }
table.report tr[data-expand].open td { background: var(--accent-soft); }
table.report .rp-caret { display: inline-block; width: 1em; color: var(--link); }
table.report tr.rp-child td { background: var(--surface-2); color: var(--muted); }
table.report td.rp-indent { padding-left: 2.2em; color: var(--text); }

/* the turnover sheet folds: a caret opens a group's accounts / an account's counterparties */
table.turnover .ts-caret { background: none; border: 0; padding: 0 4px 0 0; min-height: 0; width: 1.4em; cursor: pointer; color: var(--link); font-size: 0.95em; box-shadow: none; }
table.turnover .ts-caret-gap { display: inline-block; width: 1.4em; }

/* the hand terminal's count on a received waybill's card (mobile.js) */
.counted-box { border-radius: 10px; padding: 10px 14px; border: 1px solid var(--border); }
.counted-box.ok { background: var(--ok-soft); border-color: var(--ok); }
.counted-box.warn { background: var(--warn-soft); border-color: var(--warn); }
.counted-box ul { margin: 6px 0 0; padding-left: 18px; }

/* the machines' page (views.vend) */
.card.inner { box-shadow: none; border: 1px solid var(--border); margin: 12px 0; }
/* the machine's slots (one portion each): ticked = full */
.slot-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-top: 10px; max-width: 560px; }
.slot-grid button { padding: 8px 0; min-width: 0; font-size: 13px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--muted); }
.slot-grid button.full { background: var(--mint-soft); border-color: var(--ok); color: var(--ok); font-weight: 700; }
.slot-grid button.anchor { outline: 2px solid var(--accent); }
.big-code { font-size: 44px; font-weight: 800; letter-spacing: 8px; text-align: center; margin: 12px 0; }

/* a section's page — Balance's columns of links (2026-10-15), each group a card: its icon and title on top, a link per
   row with the page's own outline icon, its count and „›“ (the design of 2026-10-23) */
#view .card.sec-page { background: none; border: 0; box-shadow: none; padding: 0; }
/* the cards flow down the columns (no tall card leaves a hole beside it); 3 columns on a wide screen, fewer on a narrow one */
.sec-cols { columns: 3 320px; column-gap: 18px; }
.sec-col {
  display: inline-block; width: 100%; break-inside: avoid; margin: 0 0 18px; vertical-align: top;
  min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 16px 12px;
}
.sec-col h3 {
  display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 0 6px 14px;
  border-bottom: 1px solid var(--border); color: var(--text); font-size: var(--fs-lg); font-weight: 650; line-height: 1.3;
}
.sec-col h3 .nav-icon {
  width: 20px; height: 20px; padding: 8px; box-sizing: content-box; border-radius: 10px; flex: none;
  background: var(--accent-soft); color: var(--link); opacity: 1;
}
.sec-col h3 span { min-width: 0; overflow-wrap: anywhere; }
.sec-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sec-col li { margin: 0; }
.sec-link {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 44px;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; box-shadow: none;
  color: var(--text); font: 500 var(--fs-md)/1.35 var(--font); text-align: left; white-space: normal; cursor: pointer;
}
.sec-link .nav-icon { width: 19px; height: 19px; flex: none; color: var(--muted); opacity: .9; }
.sec-link .sec-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sec-link::after { content: '›'; flex: none; margin-left: 2px; color: var(--faint); font-size: 22px; line-height: 1; transition: transform .12s, color .12s; }
.sec-link:hover, .sec-link:focus-visible { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.sec-link:hover .nav-icon, .sec-link:focus-visible .nav-icon { color: var(--link); }
.sec-link:hover::after, .sec-link:focus-visible::after { color: var(--link); transform: translateX(2px); }
.sec-link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sec-link .nav-badge { margin-left: auto; }

/* documents: posted / unposted (Balance's „ჩაწერა“ — doc-drafts.js) */
.doc-list .doc-state { width: 18px; padding-right: 0; }
.state-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.state-dot.on { background: var(--ok); }
.state-dot.off { background: transparent; border: 2px solid var(--muted); }
tr.doc-draft td { color: var(--muted); font-style: italic; }
tr.doc-draft td a { font-style: normal; }

/* ⧉ beside a counterparty / goods field — its card in a window (combo.js addCardButton) */
.combo-wrap { display: flex; align-items: stretch; gap: 3px; width: 100%; min-width: 0; }
.combo-wrap > input { flex: 1 1 auto; min-width: 0; }
.combo-card {
  flex: 0 0 auto; width: 30px; padding: 0; min-height: 0; font-size: 15px; line-height: 1;
  color: var(--muted); background: var(--surface, transparent); border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: none; cursor: pointer;
}
.combo-card:hover, .combo-card:focus-visible { color: var(--link); border-color: var(--accent); background: var(--accent-soft); }
.op-item .combo-card { width: 24px; height: 22px; font-size: 13px; margin-left: 4px; vertical-align: middle; }

/* goods: Balance's folders beside the list (views.items) */
.item-tree-wrap { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 12px; align-items: start; }
.item-tree-main { min-width: 0; }
.item-tree { display: flex; flex-direction: column; gap: 1px; max-height: 70vh; overflow: auto; border-right: 1px solid var(--border); padding-right: 8px; position: sticky; top: 8px; }
.tree-node { display: flex; align-items: baseline; gap: 6px; justify-content: flex-start; text-align: left; width: 100%; padding: 5px 8px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; box-shadow: none; font-weight: 400; min-height: 0; }
.tree-node .muted { margin-left: auto; }
.tree-node.d1 { padding-left: 26px; font-size: 0.92em; }
.tree-node:hover { background: var(--accent-soft); }
.tree-node.active { background: var(--accent-soft); color: var(--link); font-weight: 600; }
.tree-ico { width: 1.2em; text-align: center; }
ul.plain { list-style: none; padding: 0; margin: 4px 0 10px; }
ul.plain li { padding: 3px 0; border-bottom: 1px solid var(--border); }
th.wb-tick, td.wb-tick { width: 26px; text-align: center; }
@media (max-width: 760px) { .item-tree-wrap { grid-template-columns: 1fr; } .item-tree { max-height: 220px; border-right: 0; position: static; } }
.tree-node { align-items: center; }
.tree-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; white-space: normal; line-height: 1.35; } /* a long folder name wraps — never clipped */
.tree-node .muted { margin-left: 0; flex: 0 0 auto; }
.tree-node { flex-shrink: 0; }

/* price tags and labels (app.js views.labels): an A4 grid, fixed sizes in mm, black on white */
#print-doc.print-labels .lbl-sheet { display: flex; flex-wrap: wrap; align-content: flex-start; }
.lbl { box-sizing: border-box; border: 0.2mm dashed #999; padding: 1.5mm 2mm; color: #000; background: #fff; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; break-inside: avoid; page-break-inside: avoid; font-family: Sylfaen, 'Noto Sans Georgian', sans-serif; }
.lbl-tag { width: 70mm; height: 38mm; }
.lbl-l58 { width: 58mm; height: 40mm; }
.lbl-l38 { width: 38mm; height: 21mm; padding: 0.8mm 1.2mm; }
.lbl-name { font-size: 9pt; line-height: 1.15; max-height: 2.3em; overflow: hidden; font-weight: 600; }
.lbl-l38 .lbl-name { font-size: 6.5pt; max-height: 2.3em; }
.lbl-price { font-size: 22pt; font-weight: 800; line-height: 1; }
.lbl-price sup { font-size: 11pt; }
.lbl-price span { font-size: 10pt; font-weight: 600; }
.lbl-l38 .lbl-price { font-size: 12pt; }
.lbl-l38 .lbl-price sup, .lbl-l38 .lbl-price span { font-size: 7pt; }
.lbl-code { text-align: center; line-height: 0; }
.lbl-digits { font: 8pt monospace; line-height: 1.2; }
.lbl-date { font-size: 6pt; text-align: right; color: #333; line-height: 1; }
@media print { @page { size: A4; margin: 8mm; } }

/* a cash order on paper (app.js printCashOrder): only it prints, black on white */
#print-doc { display: none; }
@media print {
  body.printing-doc > *:not(#print-doc) { display: none !important; }
  body.printing-doc #print-doc { display: block; }
}
.cash-paper { font-size: 13px; color: #000; background: #fff; max-width: 720px; }
.cash-paper .cp-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #000; padding-bottom: 8px; margin-bottom: 12px; }
.cash-paper .cp-num { text-align: right; }
.cash-paper h1 { font-size: 17px; margin: 0 0 4px; }
.cash-paper .cp-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.cash-paper .cp-table th, .cash-paper .cp-table td { border: 1px solid #000; padding: 4px 8px; text-align: left; }
.cash-paper .cp-table td.num { text-align: right; }
.cash-paper p { margin: 6px 0; }
.cash-paper p span { display: inline-block; min-width: 110px; color: #333; }
.cash-paper .cp-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 24px; margin-top: 30px; }
.cash-paper .cp-receipt { margin-top: 26px; padding-top: 10px; border-top: 1px dashed #000; }

/* the journal as Balance's table (app.js journalTable) */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--muted); min-height: 36px; padding: 4px 14px; font-weight: 500; font-size: var(--fs); }
.seg button.active { background: var(--accent-fill); color: var(--accent-text); font-weight: 600; }
table.jt { font-size: 13px; }
table.jt th { white-space: nowrap; cursor: pointer; user-select: none; }
table.jt td { padding-top: 4px; padding-bottom: 4px; vertical-align: top; }
table.jt td.jt-acc { font-weight: 700; font-size: 14px; white-space: nowrap; }
table.jt td.jt-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.jt tr.jt-row { cursor: pointer; }
table.jt tr.jt-row:hover td { background: var(--accent-soft); }
table.jt tr.picked td { background: var(--accent-soft); }
table.jt .jt-pick { width: 22px; text-align: center; }
.jt-ico { display: inline-block; width: 1.1em; text-align: center; font-weight: 700; }
.jt-ico.ok { color: var(--ok, var(--accent)); }
.jt-ico.off, .jt-ico.rev { color: var(--bad, var(--muted)); }
@media print { table.jt .jt-pick { display: none; } table.jt td.jt-name { white-space: normal; } }

/* the timesheet (payroll → ტაბელი): one small square per day, coloured by its mark */
table.ts-grid { width: auto; border-collapse: collapse; }
table.ts-grid th.ts-h { min-width: 22px; padding: 2px 0; text-align: center; font-size: 11px; font-weight: 500; }
table.ts-grid th.ts-we { color: var(--bad); }
table.ts-grid td.ts-td { padding: 1px; }
.ts-c { display: inline-block; width: 22px; height: 22px; padding: 0; border: 1px solid var(--border); border-radius: 4px; font-size: 11px; line-height: 20px; text-align: center; background: var(--surface); color: var(--muted); cursor: pointer; }
.ts-c.ts-W { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.ts-c.ts-O { background: var(--bg); color: var(--muted); }
.ts-c.ts-V { background: var(--accent-soft); color: var(--link); border-color: var(--accent); }
.ts-c.ts-S { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.ts-c.ts-U { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.ts-c.ts-n { background: transparent; border-style: dashed; cursor: default; }
p .ts-c { cursor: default; vertical-align: middle; }
tr.ts-unsaved td.ts-td { opacity: 0.45; }

/* VAT → invoices as rs.ge shows them: two tabs, status / attachment counters, a search under each column */
.rsreg-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--accent); margin: 6px 0 10px; }
.rsreg-tab { border: 1px solid var(--border); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--bg); color: var(--muted); padding: 7px 16px; font-weight: 600; cursor: pointer; }
.rsreg-tab.on { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-text); }
.rsreg-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--surface); color: var(--text, inherit); font-size: 12px; font-weight: 600; text-align: center; }
.rsreg-tab.on .rsreg-n { color: var(--accent-fill); background: #fff; }
.rsreg-chips { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.rsreg-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rsreg-chip { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: inherit; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.rsreg-chip.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); font-weight: 600; }
.rsreg-chip.ok .rsreg-n { background: var(--ok-soft); color: var(--ok); }
.rsreg-chip.warn .rsreg-n { background: var(--warn-soft); color: var(--warn); }
.rsreg-chip.bad .rsreg-n { background: var(--bad-soft); color: var(--bad); }
.rsreg-chip.info .rsreg-n { background: var(--accent-soft); color: var(--link); }
.rsreg-chip.muted .rsreg-n { background: var(--bg); color: var(--muted); }
.badge.info { background: var(--accent-soft); color: var(--link); }
table.rsreg th { white-space: nowrap; }
table.rsreg tr.rsreg-find th { padding-top: 0; }
table.rsreg tr.rsreg-find input { width: 100%; min-width: 60px; padding: 3px 6px; font-size: 12px; }
table.rsreg td { vertical-align: top; }
/* B3: the extra-costs allocation document — costs | purchase documents side by side, as Balance's (extra-costs-multi.js) */
.extra-doc-top { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
.extra-doc-panel td.extra-doc-src { min-width: 200px; }
.extra-doc-find { margin: 8px 0 2px; }
/* the extra costs' list per shipment (extra-costs-report.js): statuses and numbers wrap, the detail row in full */
table.report.extra-ledger td:not(.num) { white-space: normal; max-width: 220px; }
table.report.extra-ledger td:first-child { min-width: 130px; }
table.report.extra-ledger .badge { margin: 1px 0; white-space: normal; }
table.report.extra-ledger tr[data-detail] td { max-width: none; white-space: normal; position: static; }
.extra-doc-panel { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.extra-doc-picker { border: 1px dashed var(--border); border-radius: 6px; padding: 8px; margin: 6px 0; }
@media (max-width: 900px) { .extra-doc-top { grid-template-columns: 1fr; } }
/* B5: the statement rules' form (bank-rules.js) and a statement line split over several accounts (app.js) */
.bank-rule-cond { margin: 4px 0; }
.bank-rule-cond textarea { min-width: 220px; }
.bank-rule-group { border-left: 3px solid var(--border); padding: 2px 0 2px 10px; margin: 6px 0; }
.bank-split { border: 1px dashed var(--border); border-radius: 6px; padding: 6px 10px; }
.bank-split-part { margin: 3px 0; flex-wrap: nowrap; align-items: center; }
.bank-split-part select { max-width: 320px; }
.bank-split-part input[name="split_amount"] { width: 120px; flex: none; }

.cp-recent-chips { margin: 2px 0 10px; }

/* the invoices page: one month, three checks per invoice (app.js views.invoices) */
.inv-top { flex-wrap: wrap; gap: 10px; }
.inv-tabs { display: flex; gap: 6px; }
.inv-tab { font-size: var(--fs-md); font-weight: 600; padding: 9px 20px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); }
.inv-tab.on, .inv-tab.on:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-text); }
.inv-decl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: 14px; padding: 12px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); }
.inv-decl > div { min-width: 0; }
.inv-decl > button { margin-left: auto; }
.inv-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.inv-check { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--border); border-left: 6px solid var(--border); background: var(--surface); color: var(--text); font-weight: 400; cursor: pointer; min-height: 0;
  min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.inv-check:hover { border-color: var(--border-strong); background: var(--surface); }
.inv-check.ok { border-left-color: var(--ok); }
.inv-check.todo { border-left-color: var(--warn); }
.inv-check.bad { border-left-color: var(--bad); }
.inv-check.on { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.inv-check .ic-step { font-size: 12px; font-weight: 600; color: var(--muted); }
.inv-check .ic-main { font-size: 17px; font-weight: 700; line-height: 1.3; }
.inv-check.ok .ic-main { color: var(--ok); }
.inv-check.todo .ic-main { color: var(--warn); }
.inv-check.bad .ic-main { color: var(--bad); }
.inv-check .ic-sub { font-size: 12px; color: var(--muted); }
.inv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.inv-tools input[type="search"] { flex: 1 1 200px; max-width: 460px; min-width: 0; margin-right: auto; }
table.inv-table td.inv-ck { min-width: 160px; }
table.inv-table td { vertical-align: top; }
table.inv-table th { white-space: nowrap; }
table.inv-table tr.inv-row { cursor: pointer; }
table.inv-table tr.inv-row:hover td { background: var(--surface-2); }
table.inv-table tr.inv-row.todo td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.inv-table tr.inv-group td { background: var(--surface-3); cursor: pointer; padding-top: 9px; padding-bottom: 9px; }
table.inv-table .inv-cp { min-width: 160px; max-width: 280px; }
table.inv-table td .small-btn { margin-top: 5px; }
.inv-caret { display: inline-block; width: 14px; color: var(--muted); }
.ck { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 12.5px; line-height: 1.35; }
.ck-i { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; }
.ck.ok .ck-i { background: var(--ok-soft); color: var(--ok); }
.ck.todo .ck-i, .ck.warn .ck-i { background: var(--warn-soft); color: var(--warn); }
.ck.wait .ck-i { background: var(--accent-soft); color: var(--link); }
.ck.bad .ck-i { background: var(--bad-soft); color: var(--bad); }
.ck.off { color: var(--muted); }
.ck.off .ck-i { background: var(--surface-3); color: var(--muted); }
.ck.bad .ck-t { color: var(--bad); font-weight: 600; }
.ck.todo .ck-t, .ck.warn .ck-t { color: var(--warn); font-weight: 600; }
.ck.soft .ck-t { color: var(--muted); }
.inv-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.inv-kv dt { color: var(--muted); font-size: 12.5px; }
.inv-kv dd { margin: 0; }
.inv-dchecks { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin-bottom: 12px; }
.inv-dacts { flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.ad-list { max-height: 50vh; overflow: auto; }
/* „აღრიცხვის შემოწმება“ (health): a card per check, red / yellow edge; the groups (opening, residues, hidden) muted */
.h-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 4px 0 0; }
.h-check > summary, .h-group > summary { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; margin: 0; list-style: none; }
.h-check > summary::-webkit-details-marker, .h-group > summary::-webkit-details-marker { display: none; }
.h-check > summary .dot { margin-top: 0; }
.h-check[open] > summary, .h-group[open] > summary { margin-bottom: 8px; }
.h-check.h-bad { border-left: 4px solid var(--bad); }
.h-check.h-warn { border-left: 4px solid var(--warn); }
.h-group { background: var(--surface-2); }
.h-rows { width: 100%; }
.h-rows td { vertical-align: top; }
.h-rows td .dot { display: inline-block; margin-top: 6px; }
.h-sub > summary { color: var(--link); font-weight: 400; margin: 4px 0; }
.h-ok { color: var(--muted); }
@media (max-width: 700px) {
  .inv-decl > button { margin-left: 0; }
  .inv-kv { grid-template-columns: 1fr; gap: 2px; }
  .inv-kv dd { margin-bottom: 6px; }
}

/* ---------- every page in the same design (2026-10-22 / 2026-10-23): screen only — print keeps its plain rules ---------- */
@media screen {
  /* a phone: the sub-tabs in one row that scrolls sideways, not broken over three lines */
  @media (max-width: 700px) {
    .subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .subtabs::-webkit-scrollbar { display: none; }
    .subtabs button { flex: 0 0 auto; white-space: nowrap; }
  }
  #view .card { position: relative; }
  /* a place kept for content that is not there yet (the journal's entry card, the drafts list) — not an empty bar */
  #view .card:empty { display: none; }
  :where(tbody tr:nth-child(even)) > td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
  :where(tbody tr:hover) > td { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
}

/* C1: the loans' page (loans-page.js) */
.loan-row { cursor: pointer; }
.loan-schedule-text { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* „სალარო → გაუტარებელი გაყიდვები“ (pos-unposted.js) */
.unp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .unp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .unp-kpis { grid-template-columns: minmax(0, 1fr); } }
.unp-kpis .kpi .value { font-size: 26px; }
.unp-card { display: flex; flex-direction: column; gap: var(--sp-4); }
.unp-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); }
.unp-filters label { display: flex; flex-direction: column; gap: var(--sp-1); color: var(--muted); font-size: var(--fs-sm); min-width: 140px; }
.unp-filters .unp-grow { flex: 1 1 200px; }
.unp-filters .unp-grow select, .unp-filters .unp-grow input { width: 100%; }
.unp-actions { display: flex; gap: var(--sp-2); margin-left: auto; }
.unp-show { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.unp-show button {
  display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0; min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 500;
}
.unp-show button:hover { color: var(--text); border-color: var(--border-strong); }
.unp-show button.active { background: var(--accent-fill); border-color: transparent; color: var(--accent-text); font-weight: 600; }
.unp-show button.is-bad:not(.active) .unp-n { background: var(--bad-soft); color: var(--bad); }
.unp-n { min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--surface); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; text-align: center; }
.unp-show button.active .unp-n { background: color-mix(in srgb, var(--accent-text) 22%, transparent); color: inherit; }
.unp-table td:first-child { max-width: 420px; white-space: normal; }
.unp-table .caret { color: var(--muted); display: inline-block; width: 1em; }
.unp-table .unp-name { color: var(--text); font-weight: 500; text-decoration: none; }
.unp-table .unp-name:hover { color: var(--link); text-decoration: underline; }
.unp-table tr.unp-minus td:first-child { box-shadow: inset 3px 0 0 var(--bad), 1px 0 0 var(--border); }
.unp-table tr.unp-open td { background: var(--surface-2); }
.unp-table tr.unp-detail td { background: var(--surface-2); padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.unp-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-2); }
.unp-day { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-variant-numeric: tabular-nums; }
.unp-day-date { color: var(--link); font-weight: 600; }
.unp-empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: var(--sp-7) var(--sp-4); color: var(--muted); text-align: center; }
.unp-empty .nav-icon { width: 40px; height: 40px; color: var(--accent); }

/* the POS days fold (app.js posDayFold): day ▸ desks ▸ receipts ▸ goods, like the turnover sheet */
.pos-caret { display: inline-block; width: 1.2em; color: var(--link); }
.pos-caret-gap { display: inline-block; width: 1.2em; }
tr.pos-l1 td { background: var(--surface-2); }
tr.pos-l1 td:first-child { padding-left: 1.6em; }
tr.pos-l2 td:first-child { padding-left: 3em; }
tr.pos-l2 td { font-size: var(--fs-sm, 0.92em); }
tr.pos-l3 td { padding-left: 4.4em; background: var(--surface); }
tr.pos-fold > td { background: var(--surface-2); padding: var(--sp-2, 8px) var(--sp-3, 12px); }
tr.pos-fold table { background: var(--surface); }
tr.pos-rcs > td { padding-left: 2em; }
