/* APEX POS — Odoo-style look (owner, 25/10/2026): app home grid, control panel, white form sheets,
   clean lists, purple throughout (owner, 31/10: the teal accents did not fit); the top bar in Odoo's Enterprise purple (27/10).
   Light and dark redefine the same tokens; every text pair is ≥ 4.5:1 (checked 25/10). */
:root {
  --primary: #714b67; --primary-hover: #5f3f57; --on-primary: #fff;
  --accent: #714b67;            /* brand-coloured text and links */
  --soft: #f3edf2;              /* light purple tint: active menu, selected row */
  --pick: #d4ebfa; --on-pick: #000; /* Odoo's chosen row in a search panel ($o-list-group-active-bg, from $o-info) */
  /* Odoo 19's greys (Bootstrap): page gray-100, borders gray-300, text gray-900 */
  --paper: #f8f9fa; --card: #fff; --line: #dee2e6; --line-soft: #e9ecef;
  --ink: #212529; --ink-strong: #000; --muted: #6c757d;
  --ph: #bec5cc;                /* a search box's «Search…», Odoo's: faint on purpose (owner, 08/11: «ناسکترە») */
  --btn2: #e9ecef; --btn2-hover: #dee2e6;
  --amber: #a15c00; --amber-bg: #fdf3e1; --red: #c0352b; --red-bg: #fbe9e8; --green: #1e7b3c; --green-bg: #e3f4e8;
  --radius: 6px; --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06); --shadow: 0 4px 16px rgba(17, 24, 39, .10);
  --home-bg: linear-gradient(135deg, #f4eef3 0%, #eef4f6 55%, #f7f1ea 100%);
  --nav-h: 46px;                /* Odoo 19's navbar */
  --stick: var(--nav-h);        /* where a pinned thing sticks: under the top bar when the window scrolls (a phone), 0 in `main` when `main` does (a desktop, below) */
  /* the top bar in Odoo's Enterprise colour (owner, 27/10: $o-enterprise-color #714b67, the same as
     --primary; Community's #71639e was tried and turned down), shaped as Odoo's navbar
     (navbar.variables.scss): a border 10% darker, entries white at 90% (white on hover), hover/active 8% black */
  --tile: #fff;                 /* the apps' cards on the home screen */
  --tile-line: #ebe4ea; --tile-shadow: 0 1px 2px rgba(60, 30, 55, .04); --tile-up: 0 10px 26px rgba(60, 30, 55, .12); /* their edge, and their shadow at rest and raised */
  /* a till category's colours (owner, 31/10): soft and muted beside the purple, background + its text; no teal */
  --cc1: #f3e8f0; --cc1i: #6b3f60; --cc2: #fbe8ec; --cc2i: #8c2f45; --cc3: #fcecdd; --cc3i: #84460f; --cc4: #f8f0d6; --cc4i: #665209;
  --cc5: #e6f1e3; --cc5i: #37602f; --cc6: #e5edf6; --cc6i: #2f5480; --cc7: #ece9f7; --cc7i: #4f4590; --cc8: #efeae6; --cc8i: #5e5248;
  --nav-bg: #714b67; --nav-line: #53374c; --nav-ink: rgba(255, 255, 255, .9); --nav-ink-hover: #fff; --nav-hover: rgba(0, 0, 0, .08);
  --dd-hover: rgba(0, 0, 0, .08); /* an item of a top-bar menu under the pointer (Odoo's) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #8a5f80; --primary-hover: #9c6d91; --on-primary: #fff; --accent: #d6aecd; --soft: #3a2f3b; --pick: #1d3b52; --on-pick: #fafafa;
    --paper: #1b1d26; --card: #262a36; --line: #3c4052; --line-soft: #323646;
    --ink: #e4e4e7; --ink-strong: #fafafa; --muted: #a1a1aa; --ph: #7a8096; --btn2: #3a3f4f; --btn2-hover: #464c5f;
    --amber: #f2b45a; --amber-bg: #3a2c14; --red: #ff8f85; --red-bg: #42201d; --green: #6bd38f; --green-bg: #19352a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 6px 20px rgba(0, 0, 0, .4);
    --home-bg: linear-gradient(135deg, #22202b 0%, #1b2128 55%, #262026 100%);
    --nav-bg: #4f3548; --nav-line: #3b2836; --tile: #2b2e3b; --dd-hover: rgba(255, 255, 255, .08);
    --tile-line: #363a4b; --tile-shadow: none; --tile-up: 0 10px 26px rgba(0, 0, 0, .4);
    --cc1: #40303c; --cc1i: #e3bdd8; --cc2: #452a30; --cc2i: #f0b3c0; --cc3: #43321f; --cc3i: #efc08f; --cc4: #3d3620; --cc4i: #e5d08a;
    --cc5: #2b3a29; --cc5i: #afd6a6; --cc6: #28354a; --cc6i: #aac6ea; --cc7: #312e4c; --cc7i: #c3bcf0; --cc8: #38332f; --cc8i: #d2c6bb;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #8a5f80; --primary-hover: #9c6d91; --on-primary: #fff; --accent: #d6aecd; --soft: #3a2f3b; --pick: #1d3b52; --on-pick: #fafafa;
  --paper: #1b1d26; --card: #262a36; --line: #3c4052; --line-soft: #323646;
  --ink: #e4e4e7; --ink-strong: #fafafa; --muted: #a1a1aa; --ph: #7a8096; --btn2: #3a3f4f; --btn2-hover: #464c5f;
  --amber: #f2b45a; --amber-bg: #3a2c14; --red: #ff8f85; --red-bg: #42201d; --green: #6bd38f; --green-bg: #19352a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 6px 20px rgba(0, 0, 0, .4);
  --home-bg: linear-gradient(135deg, #22202b 0%, #1b2128 55%, #262026 100%);
  --nav-bg: #4f3548; --nav-line: #3b2836; --tile: #2b2e3b; --dd-hover: rgba(255, 255, 255, .08);
  --tile-line: #363a4b; --tile-shadow: none; --tile-up: 0 10px 26px rgba(0, 0, 0, .4);
  --cc1: #40303c; --cc1i: #e3bdd8; --cc2: #452a30; --cc2i: #f0b3c0; --cc3: #43321f; --cc3i: #efc08f; --cc4: #3d3620; --cc4i: #e5d08a;
  --cc5: #2b3a29; --cc5i: #afd6a6; --cc6: #28354a; --cc6i: #aac6ea; --cc7: #312e4c; --cc7i: #c3bcf0; --cc8: #38332f; --cc8i: #d2c6bb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
/* the scrollbar's room is always kept: a short screen and a long one are the same width, so nothing jumps sideways
   between them (owner, 05/11: Reports' tabs moved on each click) */
html { scrollbar-gutter: stable; }
html:has(main.full):not(:has(.set)) { scrollbar-gutter: auto; } /* the home and the till fill the screen and never scroll: no empty strip beside them */
/* Odoo's frame (owner, 07/11, a picture): on a desktop the top bar is the window's whole width and the scroll bar starts under it, beside the
   content only: the content scrolls in `main`, not the window. A phone keeps the window's own scroll (its browser's bar folds away with it).
   Only with the app's frame (#main): the login and the boot screens scroll as pages. Print is another media, so a sheet is never cut. */
@media screen and (min-width: 768px) {
  :root { --stick: 0px; }
  html:has(#main), html:has(#main) body { height: 100%; overflow: hidden; scrollbar-gutter: auto; }
  html:has(#main) #app { height: 100%; display: flex; flex-direction: column; }
  html:has(#main) .o-nav { flex: none; }
  #main { flex: 1 1 auto; align-self: stretch; min-height: 0; margin: 0; overflow-y: auto; scrollbar-gutter: stable; }
  #main.full:not(:has(.set)) { scrollbar-gutter: auto; }
  /* an element's own scroll bar goes to its start side, which would put `main`'s on the LEFT in Kurdish and Arabic; the owner wants it on the
     right as in English (07/11): `main` itself is LTR (its bar, and where its own overflow goes), its screens are RTL as the page */
  html[dir="rtl"] #main { direction: ltr; }
  html[dir="rtl"] #main > * { direction: rtl; }
}
/* Kurdish and Arabic letters in Vazirmatn (owner, 08/11, chose it from six free fonts that hold every Kurdish letter, then «B یان C، ئەوە دابنێ کامە ڕێکترە»):
   its letters stand at the size of the system font's and it fits a 1.5 line with no cut at the bottom of «ڕ» (Noto Sans Arabic, the other
   one, reached 4% of its size below such a line, and grew 11% wider in bold against Vazirmatn's 3%). It is the app's own file (public/fonts, licence in public/licenses), in the
   offline cache, and answers only for the Arabic-script range: Latin letters and digits stay the system's. */
@font-face {
  font-family: "Vazirmatn"; src: url(/fonts/vazirmatn.woff2) format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
/* Odoo 19: the system's own font at 14px (16px fields on phones, below) */
body {
  background: var(--paper); color: var(--ink);
  font: 14px/1.5 "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, "Noto Sans", Arial, "Noto Sans Arabic", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
input, select, button, textarea { font: inherit; color: inherit; }
/* A field cuts its text at its own line (owner, 07/11: the bottom of «ن» and «ڕ» gone on a phone). The Arabic fonts of a phone are up to
   1.75em tall; a line of 1.5em was shorter than their letters. 1.8em holds them, and the padding below is made less by as much, so no field grows. */
input, select, textarea { line-height: 1.8; }
/* a box that ends its text in … hides what is outside it: its room above and below is added and taken back as a margin, so a letter's top
   and bottom stay whole and nothing moves */
.clip, .sp-name, .inv-pick-text, .tiles .stock, .tiles b, .cats button span, .cp .crumbs, .cp .crumbs > span:last-child { padding-block: .2em; margin-block: -.2em; }
a { color: var(--accent); }
h1, h2, h3 { color: var(--ink-strong); font-weight: 600; }
.num, input[inputmode="decimal"], input[inputmode="numeric"] { font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.ico { display: inline-flex; line-height: 0; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); font-weight: 700; letter-spacing: .1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--red); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }

/* ---------- buttons (Odoo: primary purple, secondary light grey, small radius) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; background: var(--btn2); color: var(--ink); border-radius: 4px;
  padding: 5px 10px; cursor: pointer; min-height: 33px; white-space: nowrap; font-weight: 500; text-decoration: none; line-height: 1.5;
}
.btn:hover { background: var(--btn2-hover); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.link { background: none; color: var(--accent); padding-inline: 6px; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.big { min-height: 48px; font-size: 16px; padding: 10px 22px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.icon { display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 4px; color: var(--muted); min-width: 32px; min-height: 32px; }
.icon:hover { background: var(--line-soft); color: var(--ink); }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.in {
  border: 1px solid var(--line); background: var(--card); border-radius: 4px; padding: 3px 10px;
  min-height: 33px; width: 100%;
}
select.in { padding-block: 5px; } /* a select takes no line height: its room is its padding, as before */
/* every select's open list on the page's colours (owner, 15/11: a select with a see-through background — the underline fields, Settings — opened
   a white list with the dark theme's pale words on it, unreadable) */
select option, select optgroup { background-color: var(--card); color: var(--ink); }
.in:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent); }
.btn:focus-visible, .icon:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
/* form sheets: Odoo's underline fields */
.sheet .in:not(select):not([type="file"]), .sheet select.in { border-width: 0 0 1px; border-radius: 0; background: transparent; padding-inline: 2px; }
.sheet .in:focus { box-shadow: none; border-bottom-color: var(--primary); }
/* …except search boxes, which keep their frame and room for the magnifier */
.sheet .search .in:not(select) { border-width: 1px; border-radius: 4px; background: var(--card); padding-inline: 38px 10px; }
.form > .seg { justify-self: start; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 6px 14px; cursor: pointer; min-height: 34px; color: var(--ink); }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.on { background: var(--primary); color: var(--on-primary); } /* not bold: a wider word moved every tab (owner, 05/11) */
/* the contacts' two views, list and cards, as Odoo's buttons at the panel's end; the card's two ticks (owner, 08/11) */
.view-seg button { display: inline-flex; align-items: center; padding: 4px 10px; min-height: 30px; }
.p-ticks { gap: 22px; flex-wrap: wrap; }
input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* ---------- top bar ---------- */
/* Odoo 20's top bar (owner, 08/11, F, from a sample beside today's): no line under it, its entries rounded (6px) and set in from its edges */
.o-nav {
  position: sticky; top: 0; z-index: 20; height: var(--nav-h); background: var(--nav-bg);
  display: flex; align-items: center; gap: 4px; padding-inline: 8px; color: var(--nav-ink);
}
.o-nav .icon, .o-nav .apps-btn, .o-nav .pill, .o-sys select.lang { border-radius: 6px; }
.o-nav .icon, .o-nav .apps-btn { color: var(--nav-ink); }
.o-nav .icon:hover { background: var(--nav-hover); color: var(--nav-ink-hover); }
.o-nav .app-name { font-weight: 600; font-size: 1.2em; color: var(--nav-ink); padding-inline: 8px 12px; white-space: nowrap; }
.o-sys .muted { color: var(--nav-ink); }
.o-nav .menu-pop { color: var(--ink); } /* the avatar menu opens on the page's colours */
/* the rest of the bar, whatever its entries: what does not fit goes under «زیاتر ▾» (paintNav, owner 08/11, A1), so its width must not follow them */
.o-menus { display: flex; gap: 2px; overflow-x: auto; flex: 1 1 0; min-width: 0; scrollbar-width: none; align-self: stretch; padding-block: 6px; }
.o-menus a { display: flex; align-items: center; padding: 0 .75em; border-radius: 6px; text-decoration: none; color: var(--nav-ink); white-space: nowrap; }
.o-menus a:hover { background: var(--nav-hover); color: var(--nav-ink-hover); }
.o-menus a.on { background: var(--nav-hover); color: var(--nav-ink-hover); }
/* a menu that opens a box, as Odoo 19's (owner, 07/11; measured on the test Odoo): the toggle a tab, the box under the bar, white with a light
   border and 4px corners and no shadow, headings 13px grey, items 14px, those under a heading set in by 12px, 8% black under the pointer */
.o-menus .o-dd { display: flex; align-items: center; padding: 0 .75em; border: 0; border-radius: 6px; background: none; color: var(--nav-ink); cursor: pointer; white-space: nowrap; }
.o-menus .o-dd:hover, .o-menus .o-dd.on, .o-menus .o-dd.open { background: var(--nav-hover); color: var(--nav-ink-hover); }
.o-dd-menu { position: fixed; z-index: 40; top: calc(var(--nav-h) + 4px); min-width: 160px; max-width: calc(100vw - 16px); max-height: calc(100vh - var(--nav-h) - 16px); overflow-y: auto;
  padding: 8px 0; background: var(--card); border: 1px solid var(--line); border-radius: 4px; font-size: 14px; }
.o-dd-menu .o-dd-head { padding: 8px 20px 1px; font-size: 13px; font-weight: 500; line-height: 19.5px; color: var(--muted); white-space: nowrap; }
.o-dd-menu a { display: block; padding: 3px 20px; line-height: 21px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.o-dd-menu a.sub { padding-inline-start: 32px; } /* not `.in`: that is every input's frame */
.o-dd-menu a:hover, .o-dd-menu a:focus-visible { background: var(--dd-hover); color: var(--ink-strong); outline: none; }
.o-dd-menu a.on { font-weight: 600; }
.o-sys { display: flex; align-items: center; gap: 4px; }
.o-sys .sys-wide { display: flex; align-items: center; gap: 4px; }
.o-nav .burger { display: none; }
/* a phone's ☰ panel (owner, 07/11, Odoo 19's on the test Odoo): from the side, 312px, over a veil; its own bar with «هەموو ئەپەکان» and ✕; the
   app; tabs bold, a menu a bold heading under a line, its headings and items set in, 16px for fingers; the language and the light at its foot */
/* APEX inside a place that is not the live one (owner, 13/11): under the top bar on every page */
.place-bar { flex: none; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; padding: 6px 16px;
  background: var(--amber-bg); color: var(--amber); font-weight: 600; border-bottom: 1px solid var(--line); }
/* the tags' app (owner, 13/11, design A2): the tags in the side panel, the chosen one with its colour at the edge; one box for a scan or a word */
.tg-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cc-ink, transparent); box-shadow: inset 0 0 0 1.5px var(--cc-ink, var(--muted)); }
.tg-row { width: 100%; border: 0; border-inline-start: 3px solid transparent; background: none; color: inherit; font: inherit; text-align: start; }
.tg-row.on { background: var(--pick); color: var(--on-pick); font-weight: 600; border-inline-start-color: var(--cc-ink, var(--primary)); }
.tg-add { margin: 6px 10px; }
.tg-cp { flex: none; gap: 8px; flex-wrap: nowrap; }
.tg-mode button { white-space: nowrap; padding-inline: 10px; } /* the tag's name beside them stays whole at 1349 */
.tg-line { padding: 7px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }
.tg-line.ok { background: var(--green-bg); color: var(--green); }
.tg-line.warn { background: var(--amber-bg); color: var(--amber); }
.tg-line.bad { background: var(--red-bg); color: var(--red); }
.o-table tr.tg-new td { background: var(--green-bg); }
.tg-table .tg-tick { width: 34px; }
.tg-x { color: var(--muted); }
.tg-x:hover { color: var(--red); }
.tg-removing .tg-one { border-color: var(--red); }
.tg-colors { gap: 8px; flex-wrap: wrap; }
.sp-head.tg-static { cursor: default; }
/* the item's tags on its card (3A): a chip each in its colour, ✕ to take it off; its own line under the code and the lists, a name never broken */
.tg-chip > span { white-space: nowrap; }
.item-card .hf.f-tags { margin-top: 6px; }
.tg-chips { flex-wrap: wrap; gap: 6px; }
.tg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 99px; background: var(--cc-bg, var(--soft));
  color: var(--cc-ink, var(--ink)); box-shadow: inset 0 0 0 1px var(--cc-ink, var(--line)); font-size: 13px; font-weight: 600; }
.tg-chip-x { border: 0; background: none; color: inherit; font: inherit; font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 50%; cursor: pointer; opacity: .75; }
.tg-chip-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.tg-chip-add { padding: 2px 6px; }
.bm-veil { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); }
.bm-panel { position: absolute; inset-block: 0; inset-inline-start: 0; width: min(312px, 86vw); display: flex; flex-direction: column; overflow-y: auto;
  background: var(--card); color: var(--ink); font-size: 16px; }
.bm-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--nav-h); padding: 6px 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.bm-bar .icon { color: var(--ink); }
.bm-app { display: flex; align-items: center; gap: 10px; margin: 16px 16px 0; }
.bm-app .app-ico { width: 32px; height: 32px; padding: 0; background: none; box-shadow: none; border-radius: 0; }
.bm-app b { font-size: 20px; font-weight: 800; color: var(--ink-strong); }
.bm-list { padding: 8px 0; }
.bm-list a { display: block; text-decoration: none; }
.bm-top { padding: 12px 16px; font-weight: 700; color: var(--ink-strong); }
.bm-menu { margin: 0 16px; padding: 16px 0 8px; border-top: 1px solid var(--line); font-weight: 800; color: var(--ink-strong); }
.bm-head { padding: 8px 40px 4px; padding-inline-end: 16px; color: var(--muted); }
.bm-item { padding: 8px 16px; padding-inline-start: 40px; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.bm-item.sub { padding-inline-start: 64px; }
.bm-list a.on { color: var(--accent); font-weight: 700; }
.bm-list a:hover, .bm-list a:focus-visible { background: var(--dd-hover); outline: none; }
.bm-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.bm-foot select.lang { width: auto; }
.o-sys select.lang { min-height: 30px; padding: 2px 6px; width: auto; border-color: transparent; background: transparent; color: var(--nav-ink); }
.o-sys select.lang:hover { background: var(--nav-hover); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px;
  background: rgba(255, 255, 255, .2); color: #fff; border: 0; cursor: pointer;
}
.menu-pop {
  position: absolute; inset-inline-end: 8px; top: calc(var(--nav-h) - 4px); z-index: 30; min-width: 200px;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 6px;
}
.menu-pop .who { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-pop button { display: flex; gap: 8px; width: 100%; border: 0; background: none; padding: 8px 10px; cursor: pointer; border-radius: 4px; text-align: start; }
.menu-pop button:hover { background: var(--line-soft); }
.menu-pop button[hidden] { display: none; }

/* The staff on a shared computer (owner, 17/11, staff.js): the lock screen, a modal window over everything, opaque so nothing under it is read.
   Names first (6B), a PIN pad as a phone's (left to right), a card read at any time. */
dialog.staff-lock { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--home-bg), var(--paper); color: var(--ink); }
dialog.staff-lock::backdrop { background: var(--paper); }
.sl-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px 16px 16px; box-sizing: border-box; }
.sl-head { text-align: center; }
.sl-clock { font-size: 40px; font-weight: 700; color: var(--ink-strong); line-height: 1.1; }
.sl-day { color: var(--muted); margin-top: 4px; }
.sl-body { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sl-body h2 { margin: 0; font-size: 20px; }
.sl-hint { margin: 0; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.sl-why { color: var(--amber); font-size: 13px; }
.sl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 160px)); justify-content: center; gap: 10px; width: min(100%, 860px); margin-top: 8px; }
.sl-tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; color: var(--ink); font: inherit; }
.sl-tile:hover, .sl-tile:focus-visible { border-color: var(--primary); outline: none; }
.sl-name { font-weight: 500; text-align: center; line-height: 1.3; }
.sl-tag { font-size: 11px; color: var(--amber); }
.sl-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--cc-bg, var(--soft)); color: var(--cc-ink, var(--accent)); }
.sl-av.lg { width: 68px; height: 68px; font-size: 24px; }
.sl-who { width: min(100%, 320px); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sl-back { align-self: flex-start; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 4px 0; font: inherit; }
.sl-big { font-size: 17px; }
.sl-dots { display: flex; gap: 14px; margin-top: 4px; }
.sl-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary); }
.sl-dots span.on { background: var(--primary); }
.sl-err { color: var(--red); font-size: 13px; min-height: 20px; text-align: center; }
.sl-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.sl-pad button { height: 56px; font-size: 22px; border-radius: 10px; border: 0; background: var(--btn2); color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.sl-pad button:hover { background: var(--btn2-hover); }
.sl-pad button:disabled { opacity: .5; cursor: default; }
.sl-pass { display: flex; gap: 8px; width: 100%; }
.sl-pass .btn { white-space: nowrap; }
.sl-foot { display: flex; justify-content: center; }
.sl-foot .btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.shake { animation: sl-shake .32s; }
@keyframes sl-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }
/* attached files (owner, 17/11, «هاوپێچ»): the clip with its count, the window's list, a file shown */
.btn.clip { display: inline-flex; align-items: center; gap: 6px; }
.clip-n { min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--primary); color: var(--on-primary); font-size: 11px; line-height: 18px; text-align: center; }
.clip-n[hidden] { display: none; }
.clip-box.drop { outline: 2px dashed var(--primary); outline-offset: 4px; }
.clip-top { align-items: center; gap: 10px; flex-wrap: wrap; }
.clip-top .btn { display: inline-flex; align-items: center; gap: 6px; }
.clip-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--card); min-height: 64px; }
.clip-empty { padding: 20px; text-align: center; }
.clip-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line-soft); }
.clip-row:first-child { border-top: 0; }
.clip-row.gone { opacity: .6; }
.clip-kind { flex: none; width: 40px; padding: 4px 0; border-radius: 6px; font-size: 11px; font-weight: 700; text-align: center; color: #fff; background: var(--muted); }
.clip-kind.k-pdf { background: #c82333; }
.clip-kind.k-jpg, .clip-kind.k-png { background: #1f7a8c; }
.clip-text { flex: 1; min-width: 0; }
.clip-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.clip-acts { display: flex; gap: 6px; flex: none; }
.clip-row .badge { margin-inline-start: 6px; }
.clip-view { gap: 10px; }
.clip-frame { width: 100%; height: min(72vh, 900px); border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.clip-img { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; border-radius: 6px; }
@media (max-width: 560px) {
  .clip-row { flex-wrap: wrap; }
  .clip-acts { width: 100%; justify-content: flex-end; }
}
/* the sync status: flat like its neighbours in the navbar, only the dot says how it is; a refused invoice alone is filled */
.pill { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 2px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--nav-ink); font: inherit; white-space: nowrap; cursor: pointer; }
.pill[hidden] { display: none; } /* the offline edition's when all is well (app.js paintStatus) */.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6ee7a8; }
.pill:hover { background: var(--nav-hover); color: var(--nav-ink-hover); }
.pill.off::before { background: rgba(255, 255, 255, .4); }
.pill.wait::before { background: #ffc857; }
.pill.bad, .pill.bad:hover { background: #c0392b; color: #fff; }
.pill.bad::before { background: #fff; }
/* the licence's days left (owner, 10/11, the top bar's chip alone): the same light amber in both themes, on the navbar's colour */
.lic-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: 6px; background: #fdf3e1; color: #7a4600; font-weight: 600; white-space: nowrap; }
.lic-chip[hidden], .lic-chip .lic-short { display: none; } /* a phone's bar has room for the days alone */
.lic-phone { white-space: nowrap; }
.lic-dlg p { margin: 0; }
.lic-facts { margin: 0; padding: 0; list-style: none; }
.lic-facts li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.lic-lock { max-width: 420px; margin: 40px auto 0; padding: 26px 24px; text-align: center; }
.lic-lock h2 { margin: 0 0 8px; font-size: 18px; }
.lic-lock p { margin: 6px 0; }
.lic-ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; background: var(--red-bg); display: grid; place-items: center; font-size: 26px; }
/* a list's ☐ column and Odoo's «N selected · Actions» */
.o-table .c-pick { width: 36px; padding-inline: 16px 4px; cursor: default; }
.o-table .c-pick input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.o-table tr.picked td { background: var(--soft); }
.sel-box { display: inline-flex; align-items: center; gap: 8px; }
.sel-box:empty { display: none; }
.sel-box .sel-n { font-weight: 600; color: var(--primary); white-space: nowrap; }
.void-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; white-space: nowrap; margin-inline-end: 8px; }
.void-toggle input { accent-color: var(--primary); }
/* the sync pill's window: every invoice still on this device */
.sync-list { gap: 10px; }
.sync-card { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-inline-start: 4px solid var(--amber); border-radius: 6px; background: var(--card); }
.sync-card.bad { border-inline-start-color: var(--red); }
.sync-card .sc-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.sync-card .sc-why { padding: 6px 8px; border-radius: 4px; background: var(--amber-bg); color: var(--amber); }
.sync-card.bad .sc-why { background: var(--red-bg); color: var(--red); }
.sync-note { padding: 8px 10px; border-radius: 4px; background: var(--line-soft); color: var(--muted); }

/* ---------- home: the apps ---------- */
.home { min-height: calc(100vh - var(--nav-h)); background: var(--home-bg); padding: 48px 16px; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 16px; max-width: 840px; margin: 0 auto; }
/* the apps' cards (owner, 24/11, sample A of four, «A جوانە»; it was Odoo's icon on a white tile with its name under it): the icon and its
   name in one card; under the pointer the card rises and a line of the app's own colour (`--c`, icons.js APP_COLOR) shows at its foot */
.app { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-strong); padding: 18px 8px 15px;
  background: var(--tile); border: 1px solid var(--tile-line); border-radius: 18px; box-shadow: var(--tile-shadow); position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s; }
.app::after { content: ''; position: absolute; bottom: 0; inset-inline: 26%; height: 3px; border-radius: 3px 3px 0 0; background: var(--c, var(--primary)); opacity: 0; transition: opacity .15s, inset-inline .2s; }
.app:hover, .app:focus-visible { transform: translateY(-3px); border-color: transparent; box-shadow: var(--tile-up); }
.app:hover::after, .app:focus-visible::after { opacity: 1; inset-inline: 16%; }
.app-ico { width: 54px; height: 54px; display: block; }
.app-ico svg { display: block; width: 100%; height: 100%; }
.app span.label { font-size: 14px; line-height: 1.35; text-align: center; font-weight: 600; }
.home-search { max-width: 520px; margin: 0 auto 36px; position: relative; }
/* the three search boxes as Odoo's (owner, 08/11, «سێرچی ئۆدۆ ... ناسکترە»; measured on the test Odoo): 35px, a 4px corner and its 1px line, a 14px
   magnifier in the text's colour, a faint hint. The home's was a 42px pill; the till's, the labels' and the reports' are not these. */
.home-search .in { min-height: 35px; border-radius: 4px; padding-inline: 32px 10px; background: var(--card); }
.home-search .ico { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); display: flex; color: var(--ink); }
.home-search .in::placeholder, .cp-search .in::placeholder, .barrow > .search .in::placeholder { color: var(--ph); opacity: 1; }

/* ---------- control panel + content (Odoo 19: buttons + breadcrumbs · search · pager) ---------- */
.cp { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 10px 16px; margin: 0 -16px; background: var(--card); border-bottom: 1px solid var(--line); }
.cp-main { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; }
.cp .crumbs { font-size: 18px; font-weight: 500; color: var(--ink-strong); display: flex; gap: 6px; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; }
.cp .crumbs > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.cp-cog { flex: none; }
/* a customer's pricing: the base, + its % (Crystal's «نمط التسعير») */
.p-price { display: flex; align-items: center; gap: 8px; }
.p-price > select { flex: 1 1 auto; min-width: 0; }
.p-pct { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.p-pct.hidden { display: none; }
.p-pct .in { width: 72px; text-align: end; }
.cp .crumbs a { color: var(--accent); text-decoration: none; font-weight: 400; }
.cp .crumbs .sep { color: var(--muted); font-weight: 400; }
.cp .cp-search { position: relative; flex: 1 1 360px; max-width: 560px; }
.cp .cp-search .in { padding-inline-start: 32px; min-height: 35px; }
.cp .cp-search .ico { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); display: flex; color: var(--ink); }
.cp-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 1 1 0; }
.cp:not(:has(.cp-search)) .cp-end { flex: none; } /* no search to keep centred: the breadcrumb takes the room, whole */
.cp-end:empty { min-width: 0; } /* the spacer of a search with nothing at the end; a phone and a tablet hide it (their search has its own line) */
main { padding: 0 16px 24px; max-width: none; margin: 0 auto; }
main.full { padding: 0; max-width: none; }
.cp.sticky { position: sticky; top: var(--stick); z-index: 12; }
/* Crystal's ◀ number ▶ */
.rec-nav { display: inline-flex; align-items: stretch; flex: none; }
.rec-nav .btn.pager:first-child { border-start-end-radius: 0; border-end-end-radius: 0; }
.rec-nav .in { width: clamp(112px, calc(var(--n, 8) * 1ch + 28px), 62vw); min-height: 0; padding: 0 6px; text-align: center; border: 1px solid var(--line); border-inline: 0; border-radius: 0; background: var(--card); }
.rec-nav.busy { opacity: .6; }
.dlg .form > .rec-nav { justify-self: start; }
.names-list { max-height: 58vh; overflow: auto; border: 1px solid var(--line); }
.names-list thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
.names-acts { width: 1%; white-space: nowrap; text-align: end; }
.names-acts .btn + .btn { margin-inline-start: 6px; }
.pos-tools { display: flex; align-items: stretch; gap: 8px; flex: none; }
.pos-tools .search { flex: 1 1 auto; min-width: 0; }
.pos-tools .rec-nav .in { width: 88px; }
.cp-end { flex-wrap: wrap; max-width: 100%; }
.cp-end > .seg { max-width: 100%; flex-wrap: wrap; } /* Reports' five tabs on a phone: two lines, not a page wider than the screen */
/* Odoo's pager: "1-50" and ‹ › */
.pager-box { display: flex; align-items: center; gap: 8px; }
@media (min-width: 901px) { .pager-first { order: -1; } } /* Reports: the tabs hold the end of the control panel, the pager comes before them */
.pager-range { color: var(--ink); white-space: nowrap; unicode-bidi: isolate; }
.pager-btns { display: inline-flex; }
.btn.pager { padding: 5px 8px; border-radius: 0; }
.btn.pager:first-child { border-start-start-radius: 4px; border-end-start-radius: 4px; }
.btn.pager:last-child { border-start-end-radius: 4px; border-end-end-radius: 4px; border-inline-start: 1px solid var(--line); }
/* ‹ points back: flipped for «next», and both flipped again right-to-left */
.btn.pager .flip { display: inline-flex; transform: scaleX(-1); }
[dir="rtl"] .btn.pager .ico { transform: scaleX(-1); }
.screen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; } /* the column is the screen's width: a wide part scrolls or wraps inside it, the page never goes sideways */
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-sm); padding: 20px 28px; max-width: 1140px; width: 100%; margin: 0 auto; }
.sheet h2.title { font-size: 22px; margin: 0 0 12px; }
.sheet .in.title-in { font-size: 24px; font-weight: 600; min-height: 46px; color: var(--ink-strong); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-sm); }
.card:has(> table) { overflow-x: auto; } /* the label designs' table was 383px in a 374px card on a phone and pushed the whole page sideways: it scrolls in its card */
.pad { padding: 14px; }
.form { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 12px 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
/* Reports › Summary (owner, 16/11, «ناڕێکی تەواو»): the bar on one line at one height, the cards in rows of the same number (`--cols`, set by the page) */
.sum-bar { gap: 10px 18px; align-items: center; }
.sum-bar .hf { flex: 0 0 auto; }
.sum-bar .hf .hc > .in { flex: 0 0 auto; }
.sum-cards { display: grid; gap: 12px 16px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
@media (max-width: 900px) { .sum-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
h2.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); font-weight: 700; }
.empty { padding: 40px 12px; text-align: center; color: var(--muted); }
.tag { display: inline-flex; align-items: center; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--soft); color: var(--accent); white-space: nowrap; font-weight: 600; }
.tag.bad { background: var(--red-bg); color: var(--red); }
.tag.wait { background: var(--amber-bg); color: var(--amber); }
.tag.ok { background: var(--green-bg); color: var(--green); }
.tag.on { background: var(--primary); color: var(--on-primary); }

/* ---------- lists (Odoo list view) ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
.tbl th, .tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); text-align: start; white-space: nowrap; }
.tbl thead th { color: var(--ink-strong); font-weight: 600; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; }
.tbl tbody tr:hover { background: var(--line-soft); }
.tbl td.num, .tbl th.num { text-align: end; }
.tbl tr.click { cursor: pointer; }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line); }
/* Odoo list view: white, edge to edge, cells .5rem × .3rem with 16px at both ends, filled badges */
.list-screen { gap: 0; }
/* the list is as high as the screen under the control panel: main's 24px under it made every short list scroll by 24px for nothing */
main:has(> .list-screen) { padding-bottom: 0; }
.o-list { margin: 0 -16px; background: var(--card); overflow-x: auto; min-height: calc(100vh - var(--nav-h) - var(--cp-h, 54px)); }
.o-list > .empty { background: var(--card); }
/* the vouchers' list (owner, 23/11): its filters under the control panel, its sums over the table */
.vl-filters { gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; }
.vl-filters .vl-party { width: 280px; max-width: 100%; }
.o-list > .vl-cards { padding: 12px 16px; }
.vl-cards .vl-fig { font-size: 22px; font-weight: 700; }
/* a phone: the cards side by side all the same (none alone on a row, as Reports' since 16/11), their figures smaller */
@media (max-width: 900px) { .o-list > .vl-cards { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; } .vl-cards .card.pad { padding: 10px; } .vl-cards .vl-fig { font-size: 16px; } }
.tbl.o-table { font-size: 14px; }
.tbl.o-table th, .tbl.o-table td { padding: 8px 4.8px; border-bottom: 1px solid var(--line); }
/* every list's rows 40 px, as Odoo's (owner, 05/11: on the panel's three screens first, then all); a row of two lines still grows */
.tbl.o-table tbody td { height: 40px; padding-block: 4px; }
.tbl.o-table tr > :first-child { padding-inline-start: 16px; }
.tbl.o-table tr > :last-child { padding-inline-end: 16px; }
.tbl.o-table thead th { font-weight: 500; color: var(--ink-strong); height: 40px; } /* a 40 px head row, 8 px over and under, as Odoo's (measured 05/11; 44 px until then) */
.tbl.o-table tbody tr:hover { background: color-mix(in srgb, var(--ink) 5.5%, transparent); }
.tbl.o-table tfoot td { border: 0; font-weight: 700; }
.tbl.o-table tr.void td:not(:last-child):not(:nth-last-child(2)) { color: var(--muted); text-decoration: line-through; }
/* a voucher (owner, 05/11, Crystal's Payable Entry; one sheet 06/11): its fields on two rows, the balance now and after it at the end of the
   second, then its party's open papers under a section line, wider once a party is chosen; a return's figures red */
.sheet.money-sheet { display: grid; gap: 4px; min-width: 0; } /* a grid item: without min-width the table widens the page on a phone */
.sheet.money-sheet.wide { max-width: 1400px; }
.money-head { gap: 16px; }
.money-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.sheet .money-top h2.title { margin: 0; }
.money-no { margin-inline-start: auto; display: inline-flex; gap: 6px; font-size: 15px; } /* the number it will most likely get, as Crystal's «No.» */
/* the voucher saved last on the screen: its number once the server gives it, and its print with its papers (owner, 06/11) */
.money-last { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 6px 6px 12px; margin-bottom: 12px; border-radius: 4px;
  background: var(--green-bg); color: var(--green); font-size: 14px; }
[dir="rtl"] .money-last { padding: 6px 12px 6px 6px; }
.money-last > b { color: var(--ink-strong); }
.money-last .btn { margin-inline-start: auto; }
/* the party and before / discount / after on one row (06/11); the note, the currency and the balances on the next, in the same columns */
.money-fields { display: grid; gap: 12px 28px; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); align-items: end; }
/* the Stock app's «سفرکردنەوە» tab (owner, 25/11): a branch and its button, then the zeroings */
.zero-sheet { display: grid; gap: 8px; margin-bottom: 12px; }
.zero-do { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.zero-do .field { min-width: 220px; }
.money-bal { grid-column: span 3; display: flex; justify-content: flex-end; gap: 32px; padding-bottom: 6px; }
.money-fields.has-cur .money-bal { grid-column: span 2; }
/* a voucher being changed has its day beside the note (owner, 24/11, A) */
.money-fields.has-day .money-bal { grid-column: span 2; }
.money-fields.has-day.has-cur .money-bal { grid-column: span 1; }
/* a figure's name stands over its figure, on the right as the figures are in every language (owner, 06/11: «نوسینەکان ڕێک بخە لەگەڵ خانەکان») */
.money-fields > .f-fig > span { text-align: right; }
.money-bal > div { display: grid; gap: 2px; text-align: end; }
.money-bal span { font-size: 13px; font-weight: 600; color: var(--muted); }
.money-bal b { font-size: 16px; color: var(--ink-strong); }
.pay-papers { min-width: 0; }
.pay-papers h2.sec { margin-top: 22px; }
.pay-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 8px; }
.pay-all { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.pay-all label { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; }
.pay-scroll { overflow-x: auto; }
.sheet .pay-table .in:not(select), .sheet .pay-all .in:not(select) { min-height: 30px; height: 30px; padding: 2px 4px; text-align: end; }
.sheet .pay-in:not(select) { width: 90px; } /* narrower since the papers' total and own discount joined the table (06/11): it fits at 1517 px */
.sheet .pay-pct:not(select) { width: 50px; }
.pay-table .in:disabled { opacity: .35; }
.pay-table tr.ret td.m, .pay-table tr.ret td.m .in { color: var(--red); }
/* the choice a screen is about, first on its bar (owner, 06/11: the voucher's receipt / payment, then the statement's running / unpaid): wider
   than a tab, both words bold so neither moves; on a phone the buttons after it wrap under it */
.cp-kind { margin-inline-end: 8px; flex: none; }
.cp-main:has(> .cp-kind) { flex-wrap: wrap; row-gap: 8px; }
.cp-kind button { padding-inline: 18px; font-weight: 600; }
/* the money's two kinds with their icons (owner, 23/11, sample A): the form's and the vouchers' list's */
.cp-kind button, .vl-kind button { display: inline-flex; align-items: center; gap: 7px; }
/* a paper's number opens it over the voucher (06/11) */
.pay-open { background: none; border: 0; padding: 0; min-height: 0; height: auto; font: inherit; color: var(--primary); cursor: pointer; }
.pay-open:hover, .pay-open:focus-visible { text-decoration: underline; }
.sheet .in.pay-sum { font-weight: 700; color: var(--ink-strong); border-bottom-style: dashed; }
/* the statements' app (owner, 06/11): a party's statement on one sheet, the choices on a bar over it; a credit's figures red */
.sheet.st-sheet { max-width: 1400px; min-width: 0; display: grid; gap: 10px; }
.st-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 24px; }
.st-bar .st-who { flex: 1 1 260px; min-width: 0; }
.st-bar .st-date { width: 150px; }
.st-balance { margin-inline-start: auto; display: grid; gap: 2px; text-align: end; }
.st-balance span { font-size: 13px; font-weight: 600; color: var(--muted); }
.st-balance b { font-size: 20px; color: var(--ink-strong); }
.st-scroll { overflow-x: auto; min-width: 0; }
.st-table tr.neg td.num { color: var(--red); }
.st-table tr.st-prev td { font-weight: 600; background: var(--soft); }
.st-table tr.st-cash td { color: var(--muted); }
/* every customer's open papers (06/11): a party's name above its papers, its sum under them */
.st-table tr.st-party td { font-weight: 700; background: var(--soft); padding-top: 14px; }
.st-table tr.st-sub td { font-weight: 600; border-bottom: 2px solid var(--line); }
.st-who .in.bad { border-color: var(--red); }
/* the statement's search panel (owner, 06/11, Crystal's): the name first (its balances above it went the same day), then the filters */
/* «Customer | Supplier» and «Unpaid | Paid» (owner, 21/11: the second sat in a box wider than its buttons): each the width of the field above it, two equal halves */
.sp-body .field > .st-kind, .sp-body .field > .st-state { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; }
.sp-body .field > .st-kind button, .sp-body .field > .st-state button { min-width: 0; padding-inline: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-who { display: block; }
.st-out .st-table td bdi { white-space: nowrap; }
.st-table td bdi { white-space: nowrap; }
.st-entry .in:not(select) { min-width: 120px; }
.st-entry select.in { min-width: 104px; }
.st-entry td { padding: 4px 6px; vertical-align: middle; }
.st-entry tr.bad td, .tbl tr.bad td { background: var(--red-bg); }
.a4-tbl tfoot td { font-weight: 700; border-top: 1px solid currentColor; }
@media (max-width: 760px) {
  .st-balance { margin-inline-start: 0; text-align: start; }
}
@media (max-width: 760px) {
  .money-fields, .money-fields.has-cur { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
  .money-fields > .field:first-child { grid-column: 1 / -1; }
  .money-bal, .money-fields.has-cur .money-bal { grid-column: 1 / -1; justify-content: space-between; }
}
.badge { display: inline-block; padding: .25em .82em; border-radius: 99px; font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; color: #fff; background: var(--muted); }
.badge.ok { background: #198754; }
.badge.info { background: var(--primary); }
.badge.bad { background: #c82333; }
.badge.wait { background: #ffac00; color: #212529; }
.badge.out { background: #2563a8; } /* money going out: a payment voucher (owner, 23/11 — not the app's purple, 01/11) */
.list { display: grid; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.list > .item, .list > a.item {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; cursor: pointer;
  border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; box-shadow: none; background: var(--card); color: inherit; text-decoration: none;
}
.list > .item:last-child { border-bottom: 0; }
.list > .item:hover { background: var(--line-soft); }
.list > .empty, .list > .muted { padding: 16px; }
/* kanban cards */
.kanban { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.kcard { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); }
.kcard:hover { box-shadow: var(--shadow); }
.kcard .kav { width: 44px; height: 44px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }

/* ---------- invoice form (wholesale, returns, purchase, transfer): Crystal-style item grid ---------- */
/* the head and the totals are kept short: the item grid gets the screen (owner, 29/10: 100+ lines a paper) */
.inv-sheet { max-width: none; padding: 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
/* a saved invoice shown read-only (voided, or a cashier): a disabled fieldset, text kept readable */
fieldset.sheet { min-width: 0; }
fieldset.sheet:disabled :is(input, select) { color: inherit; opacity: 1; -webkit-text-fill-color: currentColor; }
/* one row of fields, each as wide as it needs; the note takes what is left */
.ihead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; }
.hf { display: flex; align-items: center; gap: 8px; min-height: 34px; min-width: 0; }
.hf > .hl { font-size: 13px; font-weight: 600; color: var(--ink-strong); white-space: nowrap; }
.hf > .hc { display: flex; gap: 4px; align-items: center; min-width: 0; flex: 1 1 auto; }
.hf > .hc > .in { flex: 1 1 auto; min-width: 0; min-height: 32px; padding-block: 2px; }
.hf .seg button { min-height: 30px; padding: 3px 12px; }
.hf .hc > .icon { min-width: 30px; min-height: 30px; }
.hf.f-party { flex: 0 1 320px; }
.hf.f-rep { flex: 0 1 220px; } /* the sales rep (15/11) */
.hf.f-ref { flex: 0 1 210px; }
.hf.f-day .in { width: 150px; }
.hf.f-cur, .hf.f-rate { flex: 0 1 170px; }
.hf.f-to { flex: 0 1 260px; }
.hf.f-note { flex: 1 1 220px; }
.hf .docno { font-size: 15px; color: var(--accent); }
.hf input[type="date"].past { color: var(--amber); font-weight: 600; } /* a paper entered on a later day */
.barrow { display: flex; gap: 8px; align-items: stretch; }
.barrow > .search { flex: 1 1 auto; min-width: 0; }
.igrid-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--card); height: max(300px, calc(100vh - var(--inv-rest, 330px))); }
.igrid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.igrid th, .igrid td { width: var(--w, 1%); min-width: var(--w, 0px); height: 36px; padding: 0; white-space: nowrap; border-bottom: 1px solid var(--line-soft); border-inline-end: 1px solid var(--line-soft); background: var(--card); }
.igrid .c-name { width: auto; } /* the name takes the room the number columns do not need */
/* A column keeps its width whatever is typed in it (owner, 07/11, two pictures: «جووڵە هەیە لە خانەکان»): each was `width: 1%`, so as wide as its widest
   content, and a Total going from 1,000 to 500,010 moved the name, the unit, the qty and the price beside it (57 → 93px); a unit that was a select
   instead of a word, or a longer barcode, did the same when an item was added. Now `--w`, a number of pixels per column, as the width AND the least
   width (a width alone lets a narrow window squeeze the columns again, by their contents): enough for the usual values (a longer one widens its own
   column only), and tight enough that a 1366px screen needs no side scroll; the name is the one free column and takes what is left. */
.igrid .c-n { --w: 36px; }
.igrid .c-bc { --w: 108px; }
.igrid .c-unit { --w: 84px; }
.igrid .c-qty, .igrid .c-bonus { --w: 70px; }
.igrid .c-price, .igrid th.list-head, .igrid td.c-pl { --w: 104px; }
.igrid .c-total { --w: 106px; }
.igrid .c-cost { --w: 84px; }
.igrid .c-lot { --w: 120px; }
.igrid .c-expiry { --w: 84px; }
.igrid .c-have { --w: 90px; }
.igrid .c-stock { --w: 76px; }
.igrid .c-grp { --w: 130px; }
.igrid .c-del { --w: 38px; }
.igrid td.c-bc { overflow: hidden; text-overflow: ellipsis; max-width: var(--w); } /* a 19-digit code ends in …, its whole in the tooltip */
.igrid thead th { position: sticky; top: 0; z-index: 3; height: 34px; padding: 0 10px; background: var(--soft); color: var(--accent); font-size: 13px; font-weight: 700; text-align: center; border-bottom: 1px solid var(--line); }
.igrid tbody th.c-n { background: var(--line-soft); color: var(--muted); font-weight: 600; text-align: center; }
.igrid td.c-name { min-width: 200px; padding: 0 10px; font-weight: 600; white-space: normal; line-height: 1.3; }
.igrid td.c-bc, .igrid td.c-stock, .igrid td.c-total, .igrid span.fixed { padding: 0 8px; }
.igrid td.c-bc, .igrid td.c-stock { color: var(--muted); font-size: 13px; }
.igrid td.c-total { font-weight: 700; text-align: end; color: var(--ink-strong); }
.igrid td.c-pl { background: color-mix(in srgb, var(--soft) 65%, var(--card)); }
.igrid td.c-cost { padding: 0; }
/* a purchase line's cost (owner, 12/11): the reckoned one is the box's own text, as it was; one typed by hand over it stands out in amber */
.igrid .c-cost .cell { text-align: end; font-weight: 600; color: var(--accent); }
.igrid .c-cost .cell::placeholder { color: var(--accent); opacity: 1; }
.igrid .c-cost .cell.hand { color: var(--amber); background: var(--amber-bg); }
/* a purchase row's share of the paper's expenses (owner, 16/11, 8A): spread (the box's own grey text) or typed over it in amber, as the cost */
.igrid .c-share { --w: 96px; }
.igrid td.c-share { padding: 0; }
.igrid .c-share .cell { text-align: end; }
.igrid .c-share .cell::placeholder { color: var(--muted); opacity: 1; }
.igrid .c-share .cell.hand { color: var(--amber); background: var(--amber-bg); font-weight: 600; }
.igrid .c-share .cell.bad { color: var(--red); background: var(--red-bg, #fdecea); }
.igrid .c-share .cell[readonly] { background: var(--line-soft); }
/* the expenses' sum in the totals, a click opens them; red while the shares typed do not add up */
.exp-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.exp-btn:disabled { cursor: default; text-decoration: none; color: inherit; }
.kv.exp-bad .exp-btn { color: var(--red); }
/* the expenses' window: name, amount, split, whose, ✕ */
.exp-form { min-width: min(820px, 92vw); }
.exp-wrap { overflow-x: auto; }
.exp-tbl { width: 100%; }
.exp-tbl td { padding: 4px; vertical-align: top; }
.exp-tbl .exp-name { min-width: 150px; }
.exp-tbl .exp-amount { width: 130px; }
.exp-tbl .exp-del { width: 40px; text-align: center; }
.exp-to { display: grid; gap: 4px; min-width: 170px; }
.exp-to [hidden] { display: none; }
/* a phone: each expense a small card — name and ✕, amount and split, whose — the heads hidden (the boxes say what they hold) */
@media (max-width: 640px) {
  .exp-tbl thead { display: none; }
  .exp-tbl tr { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .exp-tbl td { padding: 0; width: auto; min-width: 0; }
  .exp-tbl td:nth-child(1) { grid-column: 1 / 3; }
  .exp-tbl td:nth-child(2) { grid-column: 1; }
  .exp-tbl td:nth-child(3) { grid-column: 2 / 4; }
  .exp-tbl td:nth-child(4) { grid-column: 1 / 4; }
  .exp-tbl td:nth-child(5) { grid-column: 3; grid-row: 1; }
  .exp-to { min-width: 0; }
}
/* a return's line naming the line it came on (owner, 12/11, design A): the paper's number as a link, «…» still to choose; its window's list */
.igrid .c-of { --w: 150px; }
.igrid td.c-of { padding: 0; }
.igrid .of-btn { cursor: pointer; text-align: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.igrid .of-btn.on { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.of-box { padding: 4px 16px 14px; }
.of-scroll { max-height: min(60vh, 460px); overflow: auto; }
.of-table { width: 100%; }
.of-table:focus { outline: none; }
.of-table tbody tr { cursor: pointer; }
.of-table tbody tr.on > td, .of-table tbody tr:hover > td { background: var(--soft); }
.of-table td.strong { font-weight: 700; color: var(--ink-strong); }
.of-table td.of-lot { white-space: nowrap; } /* a batch and its month (owner, 23/11) */
.of-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.of-foot .muted { margin-inline-start: auto; }
.igrid tr.low td.c-stock { color: var(--red); font-weight: 600; }
/* a stock count's «بڕی ئێستا» (owner, 06/11, Crystal's Current Quantity): read only, beside what is typed */
.igrid td.c-have { padding: 0 10px; text-align: center; color: var(--muted); font-weight: 600; }
.igrid td.c-have.neg { color: var(--red); }
.hf.f-reason .in { width: 150px; }
/* «تەلەف» stands apart from the other papers by its colour (owner, 06/11: «وەک رەنگ»; 07/11 picked B of three: amber band, head and grid head) */
.inv-scrap { box-shadow: inset 0 4px 0 var(--amber); }
.inv-scrap .ihead { background: var(--amber-bg); border-radius: 4px; padding: 4px 8px; }
.inv-scrap .igrid thead th { color: var(--amber); background: var(--amber-bg); }
.igrid .cell { display: block; width: 100%; height: 35px; border: 0; border-radius: 0; background: transparent; padding: 0 10px; color: var(--ink); outline: none; }
.igrid input.cell { min-width: 78px; }
.igrid .c-price input.cell, .igrid .c-pl input.cell { min-width: 100px; }
.igrid .c-qty input.cell, .igrid .c-bonus input.cell { min-width: 64px; text-align: center; }
.igrid select.cell { min-width: 80px; cursor: pointer; }
.igrid .cell:focus { background: var(--card); box-shadow: inset 0 0 0 2px var(--primary); }
/* the item's group (owner, 09/11): the card's list in a cell as the others, borderless, its name cut with … (whole on hover), a ▾ at its end */
.igrid td.c-grp { overflow: hidden; max-width: var(--w); }
.igrid td.c-grp .inv-pick { height: 35px; min-height: 0; border: 0; border-radius: 0; background: transparent; padding: 0 8px 0 10px; gap: 4px; }
.igrid td.c-grp .inv-pick:focus { box-shadow: inset 0 0 0 2px var(--primary); }
.igrid td.c-grp .inv-pick::after { content: '▾'; margin-inline-start: auto; color: var(--muted); font-size: 11px; }
.igrid td.c-grp .inv-pick-text { min-width: 0; }
.igrid td.c-grp span.fixed { display: block; overflow: hidden; text-overflow: ellipsis; }
.igrid .cell.bad { box-shadow: inset 0 0 0 2px var(--red); }
/* an expiry already gone / within three months, typed or the oldest in stock */
.igrid .cell.exp-bad, .igrid .cell.exp-bad::placeholder { color: var(--red); font-weight: 600; opacity: 1; }
.igrid .cell.exp-wait, .igrid .cell.exp-wait::placeholder { color: var(--amber); font-weight: 600; opacity: 1; }
.igrid .cell[readonly] { color: var(--muted); }
.igrid tbody tr.cur > * { background: var(--soft); }
.igrid tbody tr.cur > th.c-n { background: var(--primary); color: var(--on-primary); }
.igrid tbody tr:hover > td { background: color-mix(in srgb, var(--soft) 55%, var(--card)); }
.igrid tbody tr.cur:hover > td { background: var(--soft); }
/* an item with no purchase price: it stands out, and can still be saved */
.igrid tbody tr.no-buy > td, .igrid tbody tr.no-buy:hover > td { background: var(--amber-bg); }
/* rows chosen with Ctrl / Shift + click, to copy (as Crystal's blue rows) */
.igrid tbody tr.picked > *, .igrid tbody tr.picked:hover > td { background: color-mix(in srgb, var(--primary) 26%, var(--card)); }
.igrid tbody th.c-n { cursor: pointer; user-select: none; }
.igrid tfoot td { position: sticky; bottom: 0; z-index: 2; height: 34px; padding: 0 10px; background: var(--line-soft); font-weight: 700; color: var(--ink-strong); border-top: 1px solid var(--line); border-bottom: 0; }
.igrid tfoot td.c-n, .igrid tfoot td.c-qty, .igrid tfoot td.c-bonus, .igrid tfoot td.c-owed { text-align: center; }
/* the gift a rep still owes on a line, and whose (owner, 27/11, «قەرزی هەدیە»): a number as the bonus, the rep as the group's cell */
.igrid .c-owed { --w: 84px; }
.igrid .c-grep { --w: 130px; }
.igrid .c-owed input.cell { min-width: 64px; text-align: center; color: var(--amber); font-weight: 700; }
.igrid td.c-grep { overflow: hidden; max-width: var(--w); }
.igrid td.c-grep .inv-pick { height: 35px; min-height: 0; border: 0; border-radius: 0; background: transparent; padding: 0 8px 0 10px; gap: 4px; }
.igrid td.c-grep .inv-pick:focus { box-shadow: inset 0 0 0 2px var(--primary); }
.igrid td.c-grep .inv-pick::after { content: '▾'; margin-inline-start: auto; color: var(--muted); font-size: 11px; }
.igrid td.c-grep .inv-pick-text { min-width: 0; }
.igrid td.c-grep span.fixed { display: block; overflow: hidden; text-overflow: ellipsis; }
/* «قەرزی هەدیە» (owner, 27/11): a rep's head row with «هات»; the days a gift waited (amber past 30); the window of what a rep brought */
.gift-list tr.gift-grp > td { background: var(--soft); font-weight: 600; }
.gift-grp-in { position: sticky; inset-inline-start: 16px; display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge.gift-days:not(.wait) { background: var(--line-soft); color: var(--muted); }
.gift-form { min-width: min(940px, 90vw); }
.gift-wrap { overflow-x: auto; }
.gift-tbl td { vertical-align: middle; }
.gift-tbl .gift-n { width: 80px; text-align: center; }
.gift-tbl .gift-exp { width: 92px; }
.gift-tbl td.gift-left { font-weight: 700; color: var(--amber); }
.gift-tbl tr.gift-other > td { background: var(--amber-bg); }
/* the items that came in an owed line's place (owner, 27/11): each a row of fields with their names above them, ✕ at its end, «+ کاڵایەکی تر» under */
.tbl.o-table.gift-tbl tbody tr.gift-other > td { height: auto; white-space: normal; padding: 8px 12px 10px; }
.gift-others-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 4px; }
.gift-sub { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; padding: 6px 0; border-bottom: 1px dashed color-mix(in srgb, var(--amber) 35%, transparent); }
.gift-f { display: grid; gap: 2px; margin: 0; }
.gift-f > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.gift-f-n .gift-n, .gift-f-exp .gift-exp { width: 96px; }
.gift-f-item { flex: 1 1 200px; min-width: 180px; }
.gift-f-item .gift-item { width: 100%; }
.gift-f-unit .gift-unit { width: auto; min-width: 90px; }
.gift-f-cost .gift-cost { display: block; min-width: 80px; padding: 6px 0; }
.gift-rm { align-self: center; color: var(--red); }
.gift-add { margin-top: 8px; }
.gift-after { margin-top: 10px; padding: 9px 12px; border-radius: 6px; background: var(--green-bg); color: var(--green); font-size: 13.5px; display: grid; gap: 2px; }
/* a phone: each line a small card — the item and what is left; its purchase and supplier; came now, its month, «another item» — no head */
@media (max-width: 640px) {
  .gift-tbl thead { display: none; }
  .gift-tbl, .gift-tbl tbody { display: block; width: 100%; }
  .gift-tbl tbody tr:not(.gift-other) { display: grid; grid-template-columns: 1fr 1fr auto; gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl.o-table.gift-tbl tbody td { padding: 0; border: 0; min-width: 0; height: auto; white-space: normal; }
  .tbl.o-table.gift-tbl tbody tr { height: auto; }
  .gift-tbl tbody tr:not(.gift-other) td:nth-child(3) { grid-column: 1 / 3; grid-row: 1; }
  .gift-tbl tbody tr:not(.gift-other) td:nth-child(4) { grid-column: 3; grid-row: 1; text-align: end; }
  .gift-tbl tbody tr:not(.gift-other) td:nth-child(1) { grid-column: 1; grid-row: 2; font-size: 12px; }
  .gift-tbl tbody tr:not(.gift-other) td:nth-child(2) { grid-column: 2 / 4; grid-row: 2; font-size: 12px; }
  .gift-tbl tbody tr:not(.gift-other) td:nth-child(5) { grid-column: 1; grid-row: 3; }
  .gift-tbl tbody tr:not(.gift-other) td:nth-child(6) { grid-column: 2; grid-row: 3; }
  .gift-tbl tbody tr:not(.gift-other) td:nth-child(7) { grid-column: 3; grid-row: 3; }
  .gift-tbl .gift-n, .gift-tbl .gift-exp { width: 100%; }
  .tbl.o-table.gift-tbl tr.gift-other, .tbl.o-table.gift-tbl tr.gift-other > td { display: block; padding: 8px; }
  .gift-f-item { flex: 1 1 100%; }
  .gift-f-n, .gift-f-exp, .gift-f-unit { flex: 1 1 40%; }
  .gift-f-n .gift-n, .gift-f-exp .gift-exp, .gift-f-unit .gift-unit { width: 100%; }
}
/* a table's columns put in order (owner, 27/11): ↑ ↓ at each row's end, the usual order under them */
.colpick-order { overflow-x: hidden; }
.colpick-order label { display: flex; align-items: center; gap: 6px; }
.colpick-order label .grow { flex: 1 1 auto; }
.col-moves { display: inline-flex; gap: 2px; }
.col-move { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 4px; width: 26px; height: 24px; padding: 0; line-height: 1; cursor: pointer; }
.col-move:hover { background: var(--soft); }
.colpick-reset { display: block; margin: 6px 8px 2px; }
.colpick-hint { padding: 2px 10px 6px; max-width: 240px; white-space: normal; line-height: 1.5; }
.igrid td.empty { height: 200px; color: var(--muted); border: 0; white-space: normal; }
/* kept inside the visible part when the grid is wider than a phone */
.igrid td.empty .hint { position: sticky; inset-inline-start: 0; width: min(100%, calc(100vw - 48px)); padding: 0 12px; text-align: center; }
.igrid td.empty .ico { opacity: .45; margin-bottom: 6px; }
.igrid .c-del { width: 40px; text-align: center; }
.igrid .c-del .icon { min-width: 30px; min-height: 30px; opacity: .6; }
.igrid .c-del .icon:hover { opacity: 1; color: var(--red); background: var(--red-bg); }
/* the totals: one strip under the grid — counts · discount · net, paid, remaining at the far end */
.itotals { display: flex; flex-wrap: wrap; align-items: stretch; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.ibox { display: flex; flex-wrap: wrap; align-items: center; padding: 6px 4px; }
.ibox + .ibox { border-inline-start: 1px solid var(--line); }
.ibox:last-child:not(:first-child) { margin-inline-start: auto; }
.ibox .kv { display: grid; gap: 1px; padding: 0 14px; min-width: 80px; justify-items: end; }
.ibox .kv .in { text-align: end; }
.ibox .kv > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ibox .kv > b { font-size: 16px; color: var(--ink-strong); }
.ibox .kv.big > b { font-size: 24px; line-height: 1.1; color: var(--accent); }
.ibox .kv.big > span { color: var(--ink-strong); font-weight: 700; }
.sheet .ibox .in:not(select) { width: 120px; min-height: 30px; padding: 2px 4px; }
.search { position: relative; }
.search .in { font-size: 15px; min-height: 42px; padding-inline-start: 38px; }
.search > .ico { position: absolute; inset-inline-start: 12px; top: 11px; color: var(--muted); z-index: 1; }
/* …the paper's item bar (barcode / name) is one of the three */
.barrow > .search .in:not(select) { min-height: 35px; padding-inline: 32px 10px; }
.barrow > .search > .ico { inset-inline-start: 10px; top: 50%; transform: translateY(-50%); display: flex; color: var(--ink); }
@media (min-width: 768px) { .barrow > .search .in { font-size: 14px; } }
.results {
  position: absolute; inset-inline: 0; top: calc(100% + 2px); z-index: 25; max-height: 60vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow);
}
.results button {
  display: flex; width: 100%; gap: 10px; justify-content: space-between; align-items: center;
  border: 0; border-bottom: 1px solid var(--line-soft); background: none; padding: 9px 12px; cursor: pointer; text-align: start;
}
.results button.on, .results button:hover { background: var(--soft); }
.results .nm { font-weight: 600; }
.units { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.units button { border: 1px solid var(--line); background: var(--card); border-radius: 4px; padding: 3px 10px; cursor: pointer; min-height: 30px; font-size: 13px; }
.units button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- POS (sale): products on one side, the order on the other ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0; height: calc(100vh - var(--nav-h)); }
.pos-products { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; overflow: hidden; background: var(--paper); }
.pos-products .tiles { overflow: auto; flex: 1 1 auto; align-content: start; }
.pos-order { display: flex; flex-direction: column; background: var(--card); border-inline-start: 1px solid var(--line); min-height: 0; }
.pos-lines { flex: 1 1 auto; overflow: auto; min-height: 120px; }
/* the quantity in a box of its own, its unit under it (owner, 24/11, sample A of three); the chosen line's box lit, a cursor after what is typed */
.pos-line { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: start; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.pos-line .qb { grid-row: 1 / 4; display: grid; justify-items: center; align-content: center; min-height: 52px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.pos-line .qb b { font-size: 22px; line-height: 1.15; color: var(--ink-strong); white-space: nowrap; }
.pos-line .qb.long b { font-size: 16px; }
.pos-line .qb small { max-width: 54px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-block: .2em; margin-block: -.2em; }
.pos-line.low .qb b, .pos-line.low .meta { color: var(--red); }
.pos-line .nm { color: var(--ink-strong); }
.pos-line .meta { grid-column: 2 / -1; font-size: 13px; color: var(--muted); }
.pos-line .tot { font-weight: 700; text-align: end; color: var(--ink-strong); }
.pos-line .pos-exp { margin-inline-start: 8px; }
.pos-line.sel { background: var(--soft); box-shadow: inset 3px 0 0 var(--primary); }
.pos-line.sel .qb { border: 2px solid var(--primary); background: var(--card); }
.pos-line .units { grid-column: 2 / -1; }
.pos-caret { display: inline-block; width: 2px; height: .9em; margin-inline-start: 2px; vertical-align: -.08em; background: var(--primary); animation: pos-caret 1s steps(1) infinite; }
@keyframes pos-caret { 50% { opacity: 0; } }
.pos-sum { padding: 10px 14px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.pos-sum .row { justify-content: space-between; }
.pos-sum .net { font-size: 26px; font-weight: 700; color: var(--ink-strong); }
.pad-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.pad-keys button { border: 0; background: var(--card); min-height: 52px; font-size: 18px; cursor: pointer; color: var(--ink); }
.pad-keys button:hover { background: var(--line-soft); }
.pad-keys button.mode.on { background: var(--soft); color: var(--accent); font-weight: 700; }
.pad-keys button.mode { font-size: 14px; }
.pad-keys button:disabled { color: var(--muted); opacity: .55; cursor: not-allowed; }
.pad-keys button:disabled:hover { background: var(--card); }
.pos-pay { display: grid; grid-template-columns: 1fr auto; }
.pos-pay .again { width: 72px; background: var(--card); color: var(--ink); border-top: 1px solid var(--line); }
.pos-pay .again:hover:not(:disabled) { background: var(--line-soft); }
.pos-pay .again:disabled { color: var(--muted); opacity: .5; cursor: default; }
.pos-pay button { border: 0; min-height: 62px; font-size: 18px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; }
.pos-pay .pay { background: var(--primary); color: var(--on-primary); }
.pos-pay .pay:hover { background: var(--primary-hover); }
/* a refund: the till, with a red total and button so nobody sells here (owner, 31/10) */
.pos.refund .pos-line.sel { background: var(--red-bg); box-shadow: inset 3px 0 0 var(--red); }
.pos.refund .pos-line.sel .qb { border-color: var(--red); }
.pos.refund .pos-caret { background: var(--red); }
.pos.refund .pos-sum .net { color: var(--red); }
.pos-pay .pay.back { background: #c0352b; color: #fff; }
.pos-pay .pay.back:hover { background: #a52c23; }
.refund-link { display: none; } /* a phone's top bar hides the second menu until it is swiped */
/* «پرسیاری یەکە بکە» (owner, 24/11, sample A of three): the till's window asking an item's unit, a big row per unit, the lit one first (pos.js askUnit) */
.dlg.up-dlg { width: min(460px, calc(100vw - 24px)); }
.dlg > .up-box { display: grid; gap: 8px; padding: 14px; }
.up-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 2px 14px; min-height: 66px; padding: 11px 15px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.up-row:hover { border-color: var(--primary); }
.up-row.on { border: 2px solid var(--primary); background: var(--soft); padding: 10px 14px; }
.up-row:focus-visible { outline: none; } /* the lit row is the focused one */
.up-k { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; background: var(--line); color: var(--ink-strong); font-weight: 700; }
.up-row.on .up-k { background: var(--primary); color: var(--on-primary); }
.up-nm { font-size: 17px; font-weight: 700; color: var(--ink-strong); }
.up-sub { font-size: 13px; color: var(--muted); min-height: 1.2em; }
.up-pr { grid-row: 1 / 3; grid-column: 3; display: grid; gap: 2px; justify-items: end; }
.up-pr b { font-size: 18px; color: var(--ink-strong); }
.up-pr small { font-size: 12.5px; color: var(--muted); }
.up-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 4px 2px 0; font-size: 12.5px; color: var(--muted); }
.up-foot kbd { font-family: inherit; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink); }
@media (pointer: coarse) { .up-foot { display: none; } } /* keys mean nothing to a finger */
/* the till's categories, as Odoo 20's CategorySelector (point_of_sale/…/category_selector.xml, .scss; owner, 31/10), in our purple */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 8px; flex: none; max-height: 16.5rem; overflow-y: auto; padding: 2px; }
.cats button { display: flex; align-items: center; justify-content: center; height: 4rem; padding: 4px; border: 2px solid transparent; border-radius: 8px; background: var(--cc-bg, var(--card)); box-shadow: var(--shadow-sm); color: var(--cc-ink, var(--ink)); font: inherit; text-align: center; cursor: pointer; }
.cats button span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.cats button:hover { filter: brightness(.96); }
.cats.has-on button { opacity: .75; }
.cats button.on { opacity: 1; border-color: var(--cc-ink, var(--primary)); background: var(--cc-bg, var(--soft)); color: var(--cc-ink, var(--accent)); font-weight: 600; }
.cc-1 { --cc-bg: var(--cc1); --cc-ink: var(--cc1i); }
.cc-2 { --cc-bg: var(--cc2); --cc-ink: var(--cc2i); }
.cc-3 { --cc-bg: var(--cc3); --cc-ink: var(--cc3i); }
.cc-4 { --cc-bg: var(--cc4); --cc-ink: var(--cc4i); }
.cc-5 { --cc-bg: var(--cc5); --cc-ink: var(--cc5i); }
.cc-6 { --cc-bg: var(--cc6); --cc-ink: var(--cc6i); }
.cc-7 { --cc-bg: var(--cc7); --cc-ink: var(--cc7i); }
.cc-8 { --cc-bg: var(--cc8); --cc-ink: var(--cc8i); }
.names-chip { display: inline-block; padding: 3px 10px; border-radius: 6px; background: var(--cc-bg, var(--card)); color: var(--cc-ink, var(--ink)); box-shadow: inset 0 0 0 1px var(--cc-ink, var(--line)); font-weight: 600; }
.names-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.names-edit .in { flex: 1 1 200px; min-width: 0; width: auto; }
.names-edit .names-acts { width: auto; margin-inline-start: auto; }
.names-list button, .names-list input { scroll-margin-top: 44px; } /* never under the sticky head */
.cc-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-dot { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid var(--cc-ink, var(--line)); background: var(--cc-bg, var(--card)); cursor: pointer; }
.cc-dot.on { outline: 2px solid var(--cc-ink, var(--primary)); outline-offset: 2px; }
.names-move { width: 1%; white-space: nowrap; }
.names-move .icon { min-width: 26px; min-height: 26px; padding: 0; }
.names-move .icon:disabled { opacity: .25; cursor: default; }
.names-move .up svg { transform: rotate(90deg); }
.names-move .down svg { transform: rotate(-90deg); }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tiles button {
  position: relative; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 12px 10px 10px; cursor: pointer;
  min-height: 92px; text-align: start; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; box-shadow: var(--shadow-sm);
}
.tiles button:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.tiles b { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-align: start; }
.tiles .tile-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tiles .price { font-size: 13px; font-weight: 700; background: var(--soft); color: var(--accent); padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.tiles .stock { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- import sheet grid ---------- */
.tbl.sheetgrid { font-size: 12px; }
.tbl.sheetgrid th, .tbl.sheetgrid td { padding: 4px 8px; border: 1px solid var(--line-soft); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.tbl.sheetgrid thead th, .tbl.sheetgrid tbody th { position: sticky; background: var(--line-soft); color: var(--muted); text-align: center; font-weight: 600; }
.tbl.sheetgrid thead th { top: 0; z-index: 1; }
.tbl.sheetgrid tbody th { inset-inline-start: 0; }
.tbl.sheetgrid tr.head-row td { background: var(--soft); font-weight: 700; color: var(--accent); }
.tbl.map td { vertical-align: middle; }
.tbl.map select, .tbl.map input.in { min-width: 180px; min-height: 34px; padding: 4px 8px; }

/* ---------- settings (Odoo settings boxes) ---------- */
/* Settings, Odoo 19's sizes: the section tabs (40px, 13px, a 23px icon), the grey bands (15px) and the boxes in two columns */
.set { display: flex; flex-direction: column; min-height: calc(100dvh - var(--nav-h)); }
.set .cp { margin: 0; }
.set-body { flex: 1; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.set-tabs { background: var(--paper); border-inline-end: 1px solid var(--line); }
.set-tabs-in { position: sticky; top: calc(var(--stick) + 57px); }
.set-tab { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding-inline: 16px 24px; border: 0; border-inline-start: 2px solid transparent; background: none; color: var(--ink); font: inherit; font-size: 13px; white-space: nowrap; text-align: start; cursor: pointer; }
.set-tab:hover { color: var(--ink-strong); background: var(--line-soft); }
.set-tab.on { color: var(--ink-strong); background: var(--soft); border-inline-start-color: var(--primary); font-weight: 600; }
.set-tab .app-ico, .set-hit .app-ico { flex: none; width: 23px; height: 23px; padding: 0; border-radius: 0; background: none; box-shadow: none; }
.set-pane { min-width: 0; background: var(--card); }
.set-band { margin: 0; padding: .7rem 40px; background: var(--line-soft); color: var(--ink-strong); font-size: 15px; font-weight: 600; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; max-width: 1040px; padding: 24px 40px; }
/* the Control Center's «چاودێری» (owner, 14/11): the day's figures as cards, each with its bar against its cap (green, amber past half, red past 80%) */
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; max-width: 1040px; padding: 20px 40px; }
.mon-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mon-card { display: grid; gap: 4px; align-content: start; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.mon-title { font-weight: 600; color: var(--ink-strong); font-size: 13px; }
.mon-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mon-value b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.mon-bar { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.mon-bar > i { display: block; height: 100%; background: var(--green); }
.mon-bar.wait > i { background: var(--amber); }
.mon-bar.bad > i { background: var(--red); }
.mon-bar.share > i { background: var(--accent); }
/* errors seen sooner (owner, 14/11): the overall state first, green or red */
.mon-health.ok { border-color: var(--green); background: var(--green-bg); }
.mon-health.bad { border-color: var(--red); background: var(--red-bg); }
.mon-health.ok .mon-value b { color: var(--green); font-size: 18px; }
.mon-health.bad .mon-value b { color: var(--red); font-size: 18px; }
.mon-branch + .mon-branch { border-top: 1px solid var(--line-soft); padding-top: 4px; margin-top: 2px; }
/* the problems' kinds as chips, each with its count; a tab's count of problems beside its name */
.mon-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.mon-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.mon-chip.on { border-color: var(--primary); background: var(--soft); color: var(--accent); font-weight: 600; }
.mon-chip-n { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.set-tab .mon-tab-n { margin-inline-start: 6px; padding: 0 7px; font-size: 11px; }
.tbl td.mon-detail { white-space: normal; overflow-wrap: anywhere; min-width: 180px; max-width: 380px; }
.mon-err { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.mon-pct { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 2px 8px; min-width: 110px; }
.mon-pct .mon-bar { grid-column: 1 / -1; }
.set-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 40px; border-bottom: 1px solid var(--line); }
.set-pick select.in { width: auto; min-width: 200px; }
.set-hit { display: flex; align-items: center; gap: 10px; padding: 12px 40px; margin-top: 10px; background: var(--soft); color: var(--ink-strong); font-size: 16px; }
.set-pane .in:not(select), .set-pane select.in { border-width: 0 0 1px; border-radius: 0; background: transparent; padding-inline: 2px; }
.set-pane .in:focus { box-shadow: none; border-bottom-color: var(--primary); }
.set-pane mark { background: #ffe58a; color: #000; }
.setting { display: grid; grid-template-columns: 24px minmax(0, 1fr); margin: 8px 0; }
.setting.wide { grid-column: 1 / -1; }
.setting .s-left input { margin-top: 3px; }
.setting .s-right { display: grid; gap: 6px; align-content: start; justify-items: start; min-width: 0; padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.setting .s-right > :is(.in, .list, .form, .field) { width: 100%; }
.setting .s-right > select.in, .setting .s-right > input.in { max-width: 360px; }
.setting .s-title { font-weight: 600; color: var(--ink-strong); }
.setting .s-right > .btn.link { padding-inline: 0; }
/* a group's rights, as Crystal's grid: each row only the columns it has */
.perm-wrap { max-height: 56vh; overflow: auto; border: 1px solid var(--line); }
.perm-grid { font-size: 12.5px; }
.perm-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--card); text-align: center; white-space: normal; min-width: 62px; line-height: 1.2; vertical-align: bottom; }
.perm-grid thead th:first-child { text-align: start; min-width: 160px; }
.perm-grid .perm-app th { background: var(--line-soft); color: var(--ink-strong); font-weight: 600; text-align: start; }
.perm-grid .perm-name { font-weight: 500; text-align: start; white-space: nowrap; cursor: pointer; }
.perm-grid .perm-name:hover { color: var(--accent); }
.perm-grid td { text-align: center; padding: 0; }
.perm-grid .perm-other { background: var(--soft); }
.perm-cell { display: flex; align-items: center; justify-content: center; min-height: 32px; cursor: pointer; }
.perm-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.checks label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.unit-card { padding: 12px; display: grid; gap: 8px; }
/* item card: profit % beside each selling price, and the stock / cost figures under the units */
.units-tbl td.pct .in { color: var(--accent); font-weight: 600; }
/* kept small (owner, 30/10: «بچووکی بکەوە… رەنگە شتی تر زیاد بکەین»): one row of head fields, a tight
   units table whose columns fit the window (only a phone scrolls it sideways), a short stock strip */
.item-card { gap: 10px; }
.item-card .in.title-in { font-size: 20px; min-height: 38px; padding-block: 2px; }
.item-card .in.name2-in { min-height: 30px; padding-block: 2px; font-size: 13px; }
.item-card .ihead { gap: 4px 28px; }
.item-card .hf.f-code { flex: 0 1 240px; }
.item-card .hf.f-cat, .item-card .hf.f-grp, .item-card .hf.f-sec { flex: 1 1 220px; }
.item-card .checks { gap: 4px 20px; font-size: 13px; }
.item-card h2.sec { margin: 6px 0 0; padding-bottom: 4px; font-size: 12px; }
/* the card's tabs (owner, 14/11, design A: Odoo's notebook). The pane keeps a height, so Save does not jump from tab to tab */
.nb-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-top: 6px; }
/* the sales reps' app (15/11, picture B): a rep's page, his figures, his tabs */
.rp-page { max-width: 1280px; display: grid; gap: 14px; padding: 16px 20px; grid-template-columns: minmax(0, 1fr); }
.rp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rp-av { width: 52px; height: 52px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.rp-who { display: grid; gap: 2px; min-width: 0; }
.rp-who > b { font-size: 21px; color: var(--ink-strong); display: flex; gap: 8px; align-items: center; }
.rp-tools { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rp-tools .in, .rp-period .in { width: auto; }
.stats.rp-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.rp-stats .rp-fig { font-size: 17px; }
.rp-pane { min-width: 0; }
.rp-st { align-items: center; gap: 10px; padding: 8px 4px; }
.rp-period { gap: 6px; align-items: center; flex-wrap: wrap; }
.rp-dates { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rp-dates[hidden] { display: none; }
.cp:has(.rp-period) .cp-search { max-width: 400px; } /* the reps: a few names to find, room for the period and its two days on one line */
a.rp-link { font-weight: 700; color: var(--primary-text, var(--primary)); text-decoration: none; }
a.rp-link:hover { text-decoration: underline; }
@media (max-width: 640px) { .rp-page { padding: 12px; } .rp-tools { margin-inline-start: 0; width: 100%; } .stats.rp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nb-tabs button { border: 1px solid transparent; border-bottom: 0; background: none; color: var(--muted); padding: 8px 18px; font: inherit; font-weight: 600; cursor: pointer; border-radius: 4px 4px 0 0; margin-bottom: -1px; }
.nb-tabs button:hover { color: var(--ink); }
.nb-tabs button.on { color: var(--ink-strong); border-color: var(--line); background: var(--card); box-shadow: inset 0 2px 0 var(--primary); }
.nb-pane { min-height: 172px; }
.item-card .nb-pane > .checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; font-size: 14px; padding: 6px 4px 0; }
.item-card .nb-pane > .stats { padding: 14px 16px; }
@media (max-width: 640px) { .item-card .nb-pane > .checks { grid-template-columns: minmax(0, 1fr); } .nb-tabs button { padding: 8px 12px; } }
.units-box { overflow-x: auto; box-shadow: none; }
.units-tbl { font-size: 13px; }
.units-tbl th, .units-tbl td { width: 1%; padding: 3px 6px; }
.units-tbl tr > :first-child { padding-inline-start: 10px; }
.units-tbl thead th { padding-block: 6px; font-weight: 600; background: var(--paper); }
.units-tbl tbody tr:hover { background: none; }
.units-tbl th.u-bc, .units-tbl td.u-bc { width: auto; } /* the barcodes take what is left */
.units-tbl th.u-cols { padding: 0 2px; text-align: end; }
/* «تێچووی جێگیر» ticked: its cost column in amber, as a cost typed by hand on a purchase (owner, 16/11) */
.units-tbl th.u-fixed, .units-tbl td.u-fixed { background: var(--amber-bg); color: var(--amber); }
.units-tbl td.u-fixed .in { color: var(--amber); font-weight: 600; border-color: var(--amber); }
/* a price list in the colour of the branch selling from it (owner, 02/11), on the card and the purchase grid */
th.list-head { text-align: center; line-height: 1.25; }
th.list-head[class*="cc-"] { background: var(--cc-bg); color: var(--cc-ink); }
td.list-cell[class*="cc-"] { background: color-mix(in srgb, var(--cc-bg) 35%, var(--card)); }
/* a transfer's two branches, the same size, the arrow between them (owner, 02/11: no boxes or dots of colour here) */
.hf.f-from, .hf.f-to { flex: 0 1 240px; }
.hf.f-from .hl, .hf.f-to .hl { min-width: 74px; }
.move-arrow { margin-inline: -8px; color: var(--muted); font-size: 18px; line-height: 1; }
.inv-table .mv-words, .it-table .mv-words { text-align: right; } /* under its head, which is .num and so left-to-right */
.it-table thead th { white-space: normal; vertical-align: bottom; } /* many columns: a head of two words takes two lines before the table runs off */
.tbl.o-table.it-table th, .tbl.o-table.it-table td { padding-inline: 4px; } /* 16 columns with the movement's two */
.tbl.o-table.it-table tr > :first-child { padding-inline-start: 16px; }
.tbl.o-table.it-table tr > :last-child { padding-inline-end: 16px; }
.it-table thead th.sort { cursor: pointer; user-select: none; }
.it-table thead th.sort:hover { color: var(--primary); }
.it-table .sort-mark { font-size: 10px; margin-inline-start: 4px; }
/* the row that only sets the widths (items.js widest): there for the columns, not seen, no height */
.tbl.o-table.it-table tr.it-size td { padding-block: 0; border: 0; height: 0; line-height: 0; visibility: hidden; }
.it-table tr.it-size * { line-height: 0; padding-block: 0; border-block: 0; }
.it-table.fixed { table-layout: fixed; }
.it-table th.c-cols { position: sticky; inset-inline-end: 0; background: var(--card); } /* ⇄ stays in reach when the table scrolls sideways */
/* invoices' profits (reports and its app, profit.js): its filters in the search panel since 05/11; a paper's items stay low rows under it */
.screen:has(> .form > .o-split) { gap: 0; } /* Reports' tab: the panel right under the control panel, as on the app */
.pf-table .clip { max-width: 220px; }
/* expiry (reports.js expiring): a table since 05/11; the name stops at 360 px, category, group and supplier at 200 */
.ex-table td .clip { max-width: 200px; }
.ex-table td:first-child .clip { max-width: 360px; }
.pf-table tbody tr.pf-back td { color: var(--red); } /* a till's refund (owner, 08/11); every return takes off */
.pf-table tbody tr.pf-open td { font-weight: 600; background: var(--paper); }
.pf-table tbody tr.pf-line td { height: auto; font-size: 13px; padding-block: 4px; background: var(--paper); border-bottom-color: var(--line-soft); }
.pf-table tr.pf-line .pf-item { padding-inline-start: 18px; }
.pf-table .tag + .tag { margin-inline-start: 4px; }
.inv-pick { display: flex; align-items: center; width: 100%; text-align: start; cursor: pointer; }
.inv-pick-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- the search panel beside a list (owner, 05/11, from Odoo's Stock report: «لای چەپ ئاسان کاری زیاتر دەکات تا بۆشایی سەرەوە زیاتر بێت»)
   ui.js sidePanel / sideTicks; on the start side (right in Kurdish and Arabic, as Odoo's own in those), it stays in view while the list scrolls */
.o-split { display: flex; align-items: flex-start; margin: 0 -16px; min-width: 0; } /* min-width: a wide table scrolls in its list, not the page */
.o-split > .o-list { flex: 1 1 0; min-width: 0; margin: 0; }
.sp {
  flex: none; width: var(--sp-w, 220px); position: sticky; top: var(--stick); max-height: calc(100vh - var(--nav-h)); min-height: calc(100vh - var(--nav-h) - 54px);
  display: flex; flex-direction: column; background: var(--card); border-inline-end: 1px solid var(--line);
}
/* A list's control panel stays pinned under the top bar and its side panel stands under it, as Odoo's (owner, 07/11, from two pictures): the panel
   was `100vh − nav` high under a control panel of 54–58px, so a short list scrolled the page by that for nothing, with two scroll bars side
   by side. `--cp-h` is the control panel's own height, measured by cpanel() (ui.js) on its screen. A phone keeps it scrolling away. */
@media (min-width: 761px) {
  .list-screen > .cp { position: sticky; top: var(--stick); z-index: 12; }
  .list-screen .sp { top: calc(var(--stick) + var(--cp-h, 54px)); max-height: calc(100vh - var(--nav-h) - var(--cp-h, 54px)); min-height: calc(100vh - var(--nav-h) - var(--cp-h, 54px)); }
}
/* a window of 761–900px (a tablet): the control panel is laid out as a phone's, in two rows (owner, 07/11): its title (debtors, creditors, opening, a
   paper) had only ~130px beside the search and the buttons, and was cut to a sliver of a letter */
@media (min-width: 761px) and (max-width: 900px) {
  .cp-main { flex-basis: 100%; flex-wrap: wrap; row-gap: 8px; }
  .cp .cp-search { flex-basis: 100%; max-width: none; order: 3; }
  .cp-end:empty { display: none; }
}
/* its edge, dragged wider or narrower (owner, 05/11, as Odoo's): a line shows on hover */
.sp-grip { position: absolute; inset-block: 0; inset-inline-end: -5px; width: 9px; cursor: col-resize; z-index: 3; touch-action: none; }
.sp-grip:hover, .sp-grip:focus-visible, .sp.sizing .sp-grip { outline: none; background: linear-gradient(var(--primary), var(--primary)) center / 2px 100% no-repeat; }
html:has(.sp.sizing) { cursor: col-resize; user-select: none; }
.sp.closed .sp-grip { display: none; }
/* no title, as Odoo's (owner, 05/11): ◧ alone in the top corner, beside the first list's header or the first field's name; a phone keeps
   the title on its bar. The whole panel scrolls as one, as Odoo's (no list of its own height) */
/* ◧ stands in the part that scrolls, so its edge is the fields' edge (16 px in), never on the scrollbar (owner, 05/11, a picture), on the
   first field's name row or the first list's header row; its box is 28 px high, so it ends above the field's box */
.sp-top { position: absolute; top: 12px; inset-inline-end: 16px; z-index: 2; display: flex; align-items: center; gap: 4px; }
.sp-body:has(> .sp-top + .sp-sec) > .sp-top { top: 20px; }
.sp-title { display: none; flex: 1; font-weight: 600; color: var(--ink-strong); }
.sp-toggle { background: var(--card); height: 28px; min-height: 28px; min-width: 30px; padding: 4px 6px; }
[dir="rtl"] .sp-toggle .ico { transform: scaleX(-1); } /* its column on the start side */
.sp.closed { width: 46px; }
.sp.closed .sp-body > :not(.sp-top) { display: none; }
.sp.closed .sp-body { overflow: hidden; }
.sp.closed .sp-top { inset-inline-end: 6px; } /* in the middle of the 46 px strip */
/* one column no wider than the panel, with or without its scrollbar: nothing runs off its side (the counts were cut, 05/11) */
.sp-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; flex: 1 1 auto; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; padding-bottom: 16px; }
.sp-body > .field { padding: 10px 16px 0; }
.sp-top + .field { padding-top: 18px; } /* its name beside ◧, its box under it */
.sp-top + .sp-sec .sp-head { padding-inline-end: 56px; } /* the number and ▾ clear of ◧ */
.sp-body > .field .in { height: 34px; min-height: 34px; padding-block: 2px; }
/* a day and an hour (the invoices' profits) in 188 px, its scrollbar beside it: the whole «01/11/2026, 12:00 AM» shows */
.sp-body > .field .in[type="datetime-local"] { font-size: 13px; padding-inline: 6px 4px; }
.sp-body > .void-toggle { margin: 12px 16px 0; }
/* sizes as Odoo 19's, measured on mahdi2 (05/11): a header 24 px over its name and 8 px under, upper case (English); rows 29 px apart; counts 13 px */
.sp-sec { display: grid; grid-template-columns: minmax(0, 1fr); }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 24px 16px 8px; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink-strong); text-align: start; text-transform: uppercase; }
.sp-head:hover .sp-label { color: var(--accent); }
.sp-head .ico { color: var(--amber); } /* Odoo's funnel, not purple (owner, 01/11: purple is not for everything) */
.sp-label { flex: 1; min-width: 0; }
.sp-badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--soft); color: var(--accent); font-size: 12px; font-weight: 500; text-align: center; }
.sp-badge:empty { display: none; }
.sp-caret { color: var(--muted); font-size: 11px; transition: transform .15s; }
.sp-sec.shut .sp-caret { transform: rotate(-90deg); }
[dir="rtl"] .sp-sec.shut .sp-caret { transform: rotate(90deg); }
.sp-sec.shut > :not(.sp-head) { display: none; }
.sp-find.in { width: calc(100% - 32px); height: 32px; min-height: 32px; margin: 2px 16px 4px; }
.sp-row { display: flex; align-items: center; gap: 8px; min-height: 29px; padding-block: 4px; padding-inline: 16px 12px; cursor: pointer; }
.sp-row:hover { background: var(--line-soft); }
/* the chosen row as Odoo's (owner, 05/11, «وەک ئنتەرپرایس»): $o-list-group-active-bg is drawn from $o-info (#17a2b8), not from the
   edition's purple, so Enterprise's is this blue too; black, a little bolder */
.sp-row:has(input:checked) { background: var(--pick); color: var(--on-pick); font-weight: 500; }
.sp-row input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.sp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-n { flex: none; color: var(--muted); font-size: 13px; font-weight: 500; }
.sp-row.hid-find, .sp-row.hid-zero { display: none; }
.sp-sec > .void-toggle { margin: 6px 16px 0; }
/* one line to a row, every row of a height (owner, 05/11, as Odoo's): a long text ends in … (.clip, its whole in the tooltip).
   dir="auto" cuts a Latin name at its end; it still lines up with the column's other names */
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip, .sp-name { text-align: left; }
[dir="rtl"] .clip, [dir="rtl"] .sp-name { text-align: right; }
.inv-table .clip { max-width: 380px; }
@media (max-width: 760px) {
  /* a phone: the panel over the table, shut until its button */
  .o-split { flex-direction: column; align-items: stretch; margin: 0 -8px; }
  .sp, .sp.closed { width: auto; position: static; max-height: none; min-height: 0; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .sp-top, .sp.closed .sp-top { position: static; padding-block: 6px 0; padding-inline: 16px 6px; }
  .sp.closed .sp-top { padding-block: 6px; }
  .sp-title { display: block; }
  .sp-grip { display: none; }
  .sp-top + .sp-sec .sp-head { padding-inline-end: 16px; }
  .sp-top + .field { padding-top: 10px; }
  .sp-rows { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; } /* over the table: 158 categories would push it 4,800 px down */
}
.stat-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.stat-row .muted { margin-inline-end: 6px; }
@media (min-width: 900px) {
  .item-card .ihead { flex-wrap: nowrap; }
  .item-card .ihead .hf { flex: 1 1 0; }
}
.units-tbl .in { min-height: 30px; padding-block: 2px; font-size: 14px; }
.units-tbl .in.u-name { width: 110px; }
.units-tbl .in.u-factor { width: 56px; text-align: center; }
/* a unit's barcodes: one tag each, the input after them waits for the next scan */
.bc-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 150px; min-height: 30px; padding: 2px 0; border-bottom: 1px solid var(--line); cursor: text; }
.bc-box:focus-within { border-bottom-color: var(--primary); }
.bc-tags { display: contents; }
.bc-tag { display: inline-flex; align-items: center; gap: 2px; padding: 1px 2px 1px 8px; border-radius: 99px; background: var(--soft); color: var(--ink-strong); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bc-tag button { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.bc-tag button:hover { background: var(--red-bg); color: var(--red); }
/* written twice on this item: amber; another item's code: red (owner, 30/10) */
.bc-tag.twice { background: var(--amber-bg); color: var(--amber); font-weight: 600; box-shadow: inset 0 0 0 1px var(--amber); }
.bc-tag.taken { background: var(--red-bg); color: var(--red); font-weight: 600; box-shadow: inset 0 0 0 1px var(--red); }
.bc-tag.twice button, .bc-tag.taken button { color: inherit; }
.bc-in { flex: 1 1 80px; min-width: 80px; min-height: 26px; padding: 0 4px; border: 0; background: transparent; color: var(--ink); font-size: 14px; outline: none; }
.bc-in:disabled { display: none; }
.units-tbl .in.u-money { width: 88px; }
.units-tbl .in.u-num:not(.u-factor) { text-align: end; }
.units-tbl .pctw { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; }
.units-tbl .in.u-pct { width: 50px; }
.units-tbl td:last-child .icon { min-width: 28px; min-height: 28px; padding: 4px; }
.units-tbl tfoot td { padding-block: 2px; border-top: 0; border-bottom: 0; }
.item-card .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; padding: 7px 12px; }
.item-card .stats .stat b { font-size: 14px; justify-self: start; } /* under its label, also a Kurdish unit name in English */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; background: var(--paper); }
.stats .stat { display: grid; gap: 2px; min-width: 0; }
.stats .stat b { font-variant-numeric: tabular-nums; color: var(--ink-strong); overflow-wrap: anywhere; }

/* ---------- dialog + notifications ---------- */
.dlg { border: 0; border-radius: 6px; padding: 0; background: var(--card); color: var(--ink); width: min(560px, calc(100vw - 24px)); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(17, 24, 39, .45); }
.dlg > header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dlg > header h2 { margin: 0; font-size: 17px; }
.dlg > :not(header) { padding: 16px; }
/* the item card over an invoice: header and buttons stay in view while it scrolls */
.dlg.wide { width: min(980px, calc(100vw - 24px)); }
/* an invoice's lines from Excel: the columns, then every row and what it was matched to */
.li-box { gap: 10px; }
.li-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; }
.li-preview { overflow: auto; max-height: 38vh; box-shadow: none; }
.li-preview .tbl { font-size: 13px; }
.li-preview .tbl th, .li-preview .tbl td { padding: 5px 10px; }
.li-preview tr.li-bad td { color: var(--red); background: var(--red-bg); }
.li-preview tr.li-bad .btn { padding: 2px 8px; min-height: 26px; }
.dlg.wide > header { position: sticky; top: 0; z-index: 2; background: var(--card); }
.dlg .sheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
.dlg .dlg-foot { position: sticky; bottom: 0; z-index: 2; background: var(--card); padding: 10px 0; margin-top: 10px; border-top: 1px solid var(--line-soft); }
/* right-click menu of the invoice grid */
.menu-pop.ctx { position: fixed; inset: auto; z-index: 70; min-width: 230px; }
.dlg > .menu-pop.ctx { padding: 6px; } /* in a window: not its content's padding */
.menu-pop.ctx hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; }
.menu-pop.ctx button .ico { color: var(--muted); }
.menu-pop.ctx button:focus-visible { background: var(--line-soft); outline: none; }
/* an item's stock in every branch: a right click on a form's quantity, the pointer resting on an item at the till (owner, 08/11, Crystal's; branchstock.js) */
.bs-row.neg { color: var(--red); }
.bs-row.here { font-weight: 600; }
.bs-tip { position: fixed; z-index: 70; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-sm); font-size: 13px; white-space: nowrap; pointer-events: none; }
/* ⇄ optional columns (Odoo) */
.colpick { min-width: 200px; max-height: 60vh; overflow-y: auto; }
.colpick-find { position: sticky; top: 0; z-index: 1; width: 100%; margin-bottom: 4px; }
.colpick label { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.colpick label:hover { background: var(--line-soft); }
/* a name typed that is on no row: made from here (owner, 09/11, the groups), first under the box */
.colpick-add { display: flex; gap: 8px; align-items: center; width: 100%; padding: 7px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--accent); font-weight: 600; text-align: start; cursor: pointer; white-space: nowrap; }
.colpick-add:hover, .colpick-add:focus-visible { background: var(--line-soft); outline: none; }
.igrid thead th.c-del { padding: 0; }
.col-toggle { min-width: 30px; min-height: 30px; color: var(--accent); }
.tbl th.c-cols { width: 1%; padding: 2px 6px; }
.dlg > #toasts { padding: 0; }
#toasts { position: fixed; top: calc(var(--nav-h) + 10px); inset-inline-end: 12px; display: grid; gap: 8px; z-index: 60; pointer-events: none; }
.toast {
  background: var(--card); color: var(--ink); padding: 12px 16px; border-radius: 4px; box-shadow: var(--shadow);
  border-inline-start: 4px solid var(--green); max-width: min(380px, calc(100vw - 24px)); font-weight: 500;
}
.toast.err { border-inline-start-color: var(--red); }
/* a warning that is not a refusal (owner, 09/11: a sales paper saved offline, printed with no number), yellow as Odoo's warnings */
.toast.warn { background: var(--amber-bg); color: var(--amber); border-inline-start-color: var(--amber); font-weight: 600; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--home-bg); padding: 16px; }
.login { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 28px; display: grid; gap: 14px; }
.login .brand-mark { display: flex; justify-content: center; }
.login .brand-logo { height: 86px; width: auto; }
.brand-logo.dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo.light { display: none; }
  :root:not([data-theme="light"]) .brand-logo.dark { display: block; }
}
:root[data-theme="dark"] .brand-logo.light { display: none; }
:root[data-theme="dark"] .brand-logo.dark { display: block; }
.login h1 { margin: 0; font-size: 22px; text-align: center; }
.login-tools { position: fixed; top: 10px; inset-inline-end: 12px; display: flex; gap: 6px; }
/* the place's form (screens/setup.js) is taller than the login: it starts under the language and theme buttons, not behind them */
.login.setup { margin-block: 48px 16px; }
.login.setup h2.sec { margin: 6px 0 0; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 900px) {
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-tools { flex-wrap: wrap; justify-content: space-between; }
  .pos-tools .search { flex-basis: 100%; }
  /* Odoo 20: on a small screen one row that slides, lower buttons, two lines */
  .cats { display: flex; overflow-x: auto; overflow-y: hidden; }
  .cats button { flex: none; width: 115px; height: 3rem; }
  .cats button span { -webkit-line-clamp: 2; }
  .pos.refund .pos-tools { justify-content: center; }
  .refund-link { display: inline-flex; }
  .pos-products { max-height: none; }
  .pos-products .tiles { max-height: 42vh; }
  .pos-order { border-inline-start: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  main { padding: 0 8px 16px; }
  .cp { padding: 8px; margin: 0 -8px; }
  .o-list { margin: 0 -8px; min-height: calc(100dvh - var(--nav-h) - var(--cp-h, 142px)); } /* a phone's control panel is 50–138px, not the 54px of a desktop's: a short list no longer scrolls the page */
  .o-split > .o-list { min-height: calc(100dvh - var(--nav-h) - var(--cp-h, 142px) - 57px); } /* …and the shut side panel above the list is 57px */
  .cp-main { flex-basis: 100%; flex-wrap: wrap; row-gap: 8px; } /* a form's three buttons, then its breadcrumb on the next line when both do not fit */
  .cp .crumbs { font-size: 16px; }
  .cp .cp-search { flex-basis: 100%; max-width: none; order: 3; }
  .cp-end:empty { display: none; }
  .sheet { padding: 14px; }
  .set-body { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .set-tabs { border-inline-end: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .set-tabs-in { position: static; display: flex; }
  .set-tab { width: auto; padding-inline: 12px; border-inline-start: 0; border-bottom: 2px solid transparent; }
  .set-tab.on { border-bottom-color: var(--primary); }
  .set-band, .set-pick, .set-hit { padding-inline: 16px; }
  .set-grid { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .mon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 16px; gap: 8px; }
  .inv-sheet { padding: 12px; }
  .ihead { display: grid; grid-template-columns: minmax(0, 1fr); }
  .hf { display: grid; grid-template-columns: 96px minmax(0, 1fr); }
  .hf.f-day .in { width: auto; }
  .igrid-wrap { height: auto; min-height: 240px; }
  .igrid .c-bc { display: none; }
  .hide-sm { display: none; }
  /* the name stays in view while the grid scrolls sideways */
  .igrid td.c-name { min-width: 150px; max-width: 46vw; position: sticky; inset-inline-start: 0; z-index: 1; box-shadow: 1px 0 0 var(--line-soft); }
  .apps { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .app { padding: 14px 4px 12px; gap: 8px; border-radius: 16px; }
  .app-ico { width: 46px; height: 46px; }
  .app span.label { font-size: 13px; }
  .home { padding: 28px 10px; }
}

/* Odoo on phones and touch screens: 16px fields (also stops the phone zooming into a field),
   bigger buttons for fingers */
@media (max-width: 767.98px) {
  .in, select.in, textarea, .igrid .cell { font-size: 16px; }
  /* the top bar as Odoo's on a phone (owner, 07/11): ☰, the app's name, the branch, the sync and the user; the rest is in ☰ */
  .o-nav .apps-btn, .o-menus, .o-sys .sys-wide { display: none; }
  .o-nav .burger { display: inline-flex; }
  .o-nav .app-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 1.15em; padding-inline: 2px 6px; padding-block: .2em; margin-block: -.2em; }
  .o-sys select.lang { max-width: 118px; }
  .lic-chip { padding: 2px 6px; }
  .lic-chip .lic-full { display: none; }
  .lic-chip .lic-short { display: inline; }
}
@media (pointer: coarse) {
  .btn { padding: 7px 14px; }
  .btn.pager { padding: 7px 10px; }
}

/* ---------- barcode labels (print.js, screens/labels.js): in millimetres and points, on the screen as on the paper ---------- */
.lbl { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: #fff; color: #000; line-height: 1.15; text-align: center; font-family: Tahoma, Arial, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lbl-t { width: 100%; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-t:not(.lbl-framed) { padding-block: .2em; margin-block: -.2em; } /* the tail of «و» and the bowl of «ن» are lower than a line of 1.15em: room added to the clip, none to the layout (owner, 07/11) */
.lbl-name { font-weight: 700; }
.lbl-bars { flex: 0 1 auto; min-height: 0; box-sizing: border-box; } /* its width and wished height come from the design (print.js); a short label takes from its height only */
.lbl-bars svg { display: block; width: 100%; height: 100%; }
.lbl-no { flex: none; width: 100%; white-space: nowrap; overflow: hidden; }
.lbl-framed { box-sizing: border-box; border: .2mm solid #000; }
.lbl-t.lbl-framed, .lbl-no.lbl-framed, .lbl-foot .lbl-framed { padding: .2mm .5mm; }
.lbl-parts td { vertical-align: middle; }
.lbl-size { display: inline-flex; align-items: center; gap: 4px; }
.lbl-size .in { width: 56px; text-align: center; }
.lbl-foot { flex: none; display: flex; justify-content: space-between; gap: 1mm; width: 100%; direction: ltr; font-weight: 700; }
.lbl-page { box-sizing: border-box; display: grid; direction: ltr; align-content: start; overflow: hidden; break-after: page; break-inside: avoid; }
.lbl-page:last-child { break-after: auto; }
.lbl-preview { display: inline-block; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.lbl-stage { display: flex; justify-content: center; align-items: center; padding: 16px; background: var(--line); border-radius: 6px; overflow: auto; }
.lbl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.lbl-search { flex: 1 1 280px; position: relative; }
.lbl-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: 14px; align-items: start; }
.lbl-list tr.on td { background: var(--line-soft); }
.lbl-qty { width: 70px; }
.lbl-month { width: 110px; }
@media (max-width: 760px) { .lbl-body { grid-template-columns: minmax(0, 1fr); } }

/* ---------- paper (print.js): hidden on screen, the only thing printed; its @page is set for each print ---------- */
#print { display: none; }
.a4 { display: flow-root; position: relative; background: #fff; color: #000; font-size: 13px; line-height: 1.45; text-align: start; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.a4 > * { position: relative; }
.a4.small { font-size: 11px; }
.a4-muted { color: #555; }
.a4-when { font-size: .9em; margin-bottom: 10px; }
.a4-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.a4-apart { justify-content: space-between; }
.a4-logo { display: block; max-height: 64px; max-width: 200px; object-fit: contain; }
.a4-company { font-size: 1.25em; font-weight: 700; }
/* the logo and the name placed by hand (owner, 22/11, B): three cells whatever the layout, the middle one truly in the middle; a cell holding both stacks them there */
.a4-placed { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; }
.a4-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; } /* too narrow for both side by side: the name goes under the logo whole, not squeezed into lines */
.a4-cell-center { flex-direction: column; text-align: center; gap: 4px; }
.a4-cell-end { justify-content: flex-end; text-align: end; }
.a4-band .a4-placed { margin-bottom: 0; }
.a4-address { white-space: pre-line; color: #333; font-size: .92em; }
.a4-tagline { color: var(--doc-1-ink); font-weight: 700; }
.a4-party { width: 45%; margin-inline-start: auto; margin-block: 8px 12px; }
.a4-title { margin: 12px 0 8px; font-size: 1.85em; font-weight: 500; color: var(--doc-1-ink); }
.a4-void { margin-inline-start: 12px; font-size: .6em; font-weight: 700; color: #b02a37; }
.a4-facts { display: flex; flex-wrap: wrap; gap: 6px 36px; margin-bottom: 14px; }
.a4-fact > b { color: var(--doc-2-ink); display: block; }
.a4-tbl { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.a4-tbl thead { display: table-header-group; }
.a4-tbl tr { break-inside: avoid; }
.a4-tbl th, .a4-tbl td { padding: 4px 6px; vertical-align: top; text-align: start; }
.a4-tbl th { font-weight: 700; }
.a4-tbl .num { text-align: end; white-space: nowrap; }
/* the words of every cell in the middle of it (owner, 22/11, the layout's tick) */
.a4-tbl.a4-center th, .a4-tbl.a4-center td, .a4-tbl.a4-center .num { text-align: center; }
.a4-sum { width: 42%; margin-inline-start: auto; margin-top: 4px; break-inside: avoid; }
.a4-sum .pr-row { padding: 3px 6px; }
.a4-sum .pr-row.big { border-top: 1px solid #212529; color: var(--doc-1-ink); font-size: 1.15em; font-weight: 700; }
.a4-note { margin-top: 12px; }
.a4-balance { margin-top: 6px; padding-top: 3px; border-top: 1px solid #adb5bd; }
.a4-words { margin-top: 8px; font-weight: 600; }
.a4-sign { display: flex; justify-content: space-between; gap: 60px; margin-top: 56px; break-inside: avoid; }
.a4-sign > div { flex: 1; max-width: 240px; padding-top: 6px; border-top: 1px solid #000; text-align: center; }
/* a voucher's own paper (owner, 06/11, sample A): the title in the middle, number and day on one line, a framed form, the amount boxed */
.v-title { text-align: center; }
.v-title .a4-title { margin: 14px 0 6px; font-weight: 600; }
.a4-tab .v-title, .a4-tab .v-title .a4-title { text-align: inherit; }
.v-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; margin: 10px 0 14px; }
.v-frame { border: 2px solid #212529; border-radius: 6px; padding: 16px 20px; display: grid; gap: 14px; break-inside: avoid; }
.v-line { display: flex; align-items: baseline; gap: 10px; }
.v-label { flex: none; min-width: 9em; font-weight: 600; }
.v-value { flex: 1; min-width: 0; padding-bottom: 3px; border-bottom: 1px dotted #999; }
.v-amount { display: flex; }
.v-amount bdi { padding: 6px 16px; border: 2px solid var(--doc-1); border-radius: 6px; font-size: 1.5em; font-weight: 700; color: var(--doc-1-ink); }
.v-frame + .a4-tbl { margin-top: 18px; }
.v-balance { margin-top: 12px; color: #495057; }
.v-sign { margin-top: 64px; }
.a4-foot { margin-top: 18px; break-inside: avoid; } /* at the bottom of the page: on paper by @media print, in the preview below */
.a4-footer { white-space: pre-line; text-align: center; border-top: 1px solid #adb5bd; padding-top: 6px; font-size: .92em; }
.a4-draw { pointer-events: none; line-height: 0; }
.a4-draw-top { position: absolute !important; top: 0; inset-inline: 0; overflow: hidden; }
.a4 .pr-row { display: flex; justify-content: space-between; gap: 8px; }
/* the layouts: where the head's pieces go */
.a4-band { padding: 12px; margin-bottom: 12px; background: color-mix(in srgb, var(--doc-1) 10%, #fff); }
.a4-band .a4-top { margin-bottom: 0; }
.a4-tab .a4-title { margin: 8px 0 0; text-align: end; }
.a4-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: start; margin-bottom: 12px; }
.a4-three .a4-party { width: auto; margin: 0; text-align: end; }
.a4-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.a4-centered { text-align: center; }
.lay-wave .a4-top, .lay-bubble .a4-top { box-sizing: border-box; padding-top: 18px; align-items: flex-start; }
.lay-wave .a4-top { min-height: 100px; } /* the party starts under the wave */
.lay-bubble .a4-top { min-height: 130px; }
.lay-dual .a4-top { margin-top: 74px; } /* under the corners */
.lay-lines .a4-top { margin-top: 130px; } /* under the lines */
.lay-compact .a4-title { margin: 4px 0; font-size: 1.5em; }
.lay-compact .a4-facts { margin-bottom: 6px; }
.lay-compact .a4-three { margin-bottom: 4px; }
/* the tables, after Odoo's report_tables.scss */
.tbl-light .a4-tbl th, .tbl-compact .a4-tbl th { border-bottom: 1px solid #212529; }
.tbl-light .a4-tbl td, .tbl-compact .a4-tbl td { border-bottom: 1px solid #dee2e6; }
.tbl-compact .a4-tbl th, .tbl-compact .a4-tbl td { padding-block: 1px; }
.tbl-compact .a4-tbl td { font-size: .9em; }
.tbl-bold .a4-tbl th { color: var(--doc-1-ink); border-block: 2px solid var(--doc-1); }
.tbl-bold .a4-tbl td { border-bottom: 1px solid color-mix(in srgb, var(--doc-1) 40%, #fff); }
.tbl-striped .a4-tbl th { color: var(--doc-2-ink); }
.tbl-striped .a4-tbl tbody { border-block: 1px solid #212529; }
.tbl-striped .a4-tbl tbody tr:nth-child(odd) td { background: color-mix(in srgb, var(--doc-2) 10%, #fff); }
.tbl-boxed .a4-tbl, .tbl-bubble .a4-tbl { border: 1px solid #495057; }
.tbl-boxed .a4-tbl th, .tbl-bubble .a4-tbl th { text-transform: uppercase; border-bottom: 1px solid #495057; border-inline-end: 1px solid #495057; }
.tbl-boxed .a4-tbl td, .tbl-bubble .a4-tbl td { border-bottom: 1px solid #ced4da; border-inline-end: 1px solid #ced4da; }
.tbl-boxed .a4-sum .pr-row.big, .tbl-bubble .a4-sum .pr-row.big { background: var(--doc-1); color: var(--doc-on-1); border: 0; }
.tbl-bubble .a4-tbl { border-collapse: separate; border-spacing: 0; border-radius: 8px; overflow: hidden; }
.tbl-bubble .a4-tbl th { color: var(--doc-1-ink); }
.tbl-bubble .a4-sum .pr-row.big { border-radius: 8px; }
.tbl-bubble .a4-facts { padding: 8px 10px; border: 1px solid var(--doc-2); border-radius: 8px; background: color-mix(in srgb, var(--doc-2) 8%, #fff); }
.tbl-column .a4-tbl { border-bottom: 1px solid #ced4da; }
.tbl-column .a4-tbl th { background: var(--doc-2); color: var(--doc-on-2); }
.tbl-column .a4-tbl td:not(:last-child) { border-inline-end: 1px solid #ced4da; }
.tbl-column .a4-fact:not(:last-child) { padding-inline-end: 36px; border-inline-end: 1px solid var(--doc-2); }
/* the layout window: the choices on one side, the paper on the other */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.doc-form { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px 12px; align-items: start; }
.doc-label { font-weight: 600; padding-top: 5px; }
.doc-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.doc-badges button { border: 1px solid var(--line); background: var(--line-soft); color: var(--ink); border-radius: 4px; padding: 3px 9px; cursor: pointer; font: inherit; font-size: 13px; }
.doc-badges button.on { border-color: var(--primary); background: var(--card); color: var(--primary); font-weight: 600; box-shadow: 0 0 0 1px var(--primary); }
.doc-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.doc-logo img { max-height: 44px; max-width: 120px; object-fit: contain; background: #fff; }
.doc-color { width: 36px; height: 30px; padding: 1px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); cursor: pointer; }
.doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
/* the logo's and the name's size (owner, 22/11, B) */
.doc-size { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-size input[type=range] { flex: 1 1 160px; max-width: 260px; accent-color: var(--primary); }
.doc-size-out { min-width: 48px; }
.doc-name-off { margin-top: 6px; }
.doc-at { margin-top: 6px; } /* a text's place under its box (the address, the tagline, the footer) */
.doc-cols label { flex-wrap: nowrap; align-items: flex-start; line-height: 1.3; }
.doc-cols input { flex: none; }
.doc-preview { position: sticky; top: 56px; width: 380px; height: 538px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.doc-preview .a4 { position: absolute; top: 0; inset-inline-start: 0; padding: 36px; min-height: 1123px; box-sizing: border-box; transform-origin: top left; }
.doc-preview .a4[dir="rtl"] { transform-origin: top right; }
.doc-preview .a4-foot { position: absolute; inset-inline: 36px; bottom: 36px; margin: 0; }
@media (max-width: 820px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-preview { position: static; margin-inline: auto; max-width: 100%; }
}
/* an item's movements (screens/movement.js) */
.dlg.wide:has(.mv) { width: min(1280px, calc(100vw - 24px)); }
.mv { display: grid; gap: 12px; min-width: 0; }
.mv-title { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.mv-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.mv-card { flex: 1 1 150px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.mv-card > b { display: block; font-size: 17px; }
.mv-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 16px; }
.mv-filters .field { min-width: 140px; }
.mv-filters > label.row { min-height: 34px; flex-wrap: nowrap; gap: 6px; }
.mv-kinds { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.mv-kinds label { flex-wrap: nowrap; gap: 6px; }
.mv-table { max-height: 56vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.mv-table tfoot td { position: sticky; bottom: 0; background: var(--soft); font-weight: 700; border-top: 1px solid var(--line); }
.mv-table .mv-words { text-align: end; }
.mv-table td.mv-in { color: var(--green); }
.mv-table td.mv-out { color: var(--red); }
.mv-table .mv-note-row td { background: var(--line-soft); }
/* the roll receipt: on paper, and on its strip in the preview */
.roll { margin: 0 auto; background: #fff; color: #000; font-size: 12px; line-height: 1.45; text-align: start; }
.roll.big { font-size: 15px; }
.pr-logo { display: block; max-width: 60%; max-height: 20mm; margin: 0 auto 4px; object-fit: contain; }
.pr-head { text-align: center; font-size: 1.17em; }
.pr-meta { text-align: center; font-size: .92em; }
.pr-text { white-space: pre-line; }
.pr-foot { margin-top: 8px; }
.roll .pr-row { display: flex; justify-content: space-between; gap: 8px; }
.roll .pr-row > span:first-child { min-width: 0; }
.roll .pr-row > .num { flex: none; }
.roll .pr-row.big { font-size: 1.33em; font-weight: 700; }
.pr-line { margin: 3px 0; }
.pr-sep { border-top: 1px dashed #000; margin: 6px 0; }
.doc-tabs { margin-bottom: 14px; }
.doc-other { margin-top: 8px; gap: 8px; }
.doc-mm { width: 84px; }
.doc-preview.is-roll { display: flex; justify-content: center; align-items: flex-start; background: #dee2e6; padding-top: 14px; }
.roll-paper { flex: none; min-height: 420px; padding: 4mm 0; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transform-origin: top center; }
@media print {
  body > *:not(#print) { display: none !important; }
  body { background: #fff; color: #000; }
  #print { display: block; color: #000; }
  #print.a4 { display: flow-root; } /* the head's first margin stays inside the page, over its drawing */
  /* at the bottom of every page, over the empty row print.js keeps for it */
  #print.a4 .a4-foot { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; }
  .a4-wrap { width: 100%; border-collapse: collapse; }
  .a4-wrap > tbody > tr > td, .a4-wrap > tfoot > tr > td { padding: 0; }

}
