/* =============================================================================
   RioSoft — app.css
   -----------------------------------------------------------------------------
   The ONE stylesheet of the desktop ERP. It replaced sixteen global files
   (desktop-app, riosoft-theme, unified-theme, topnav, toolbar-dark, sidebar-*,
   mobile-responsive, fast-nav, searchable-select, toast, global-font-size, ltr,
   embedded-compact, pdf-template-picker, mixed-unit-lines).

   Order matters:
     1. Fonts            local woff2, no network
     2. Tokens           the small palette every page draws from (light + dark)
     3. Legacy aliases   old variable names pointed at the tokens, so pages
                         written against the previous themes follow along
     4. Type scale       the --app-font-* contract Settings → Project fonts writes
     5. Base
     6. Shell            header, nav, menus, drawer, content area (full screen)
     7. Components       buttons, fields, panels, cards, tables, badges, …
     8. Bootstrap bridge Bootstrap's own variables set from the tokens
     9. Dialogs, searchable select, toast, PDF picker
    10. Dashboard
    11. Responsive, print

   Page stylesheets (assets/css/<page>.css) only carry layout for their own
   screen; colour comes from the tokens below.
   ============================================================================= */

/* ============================== 1. Fonts ================================== */
@font-face{font-family:"Inter";font-weight:400;font-display:swap;src:url(../vendor/fonts/inter-400.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Inter";font-weight:500;font-display:swap;src:url(../vendor/fonts/inter-500.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Inter";font-weight:600;font-display:swap;src:url(../vendor/fonts/inter-600.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Inter";font-weight:700;font-display:swap;src:url(../vendor/fonts/inter-700.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Inter";font-weight:800 900;font-display:swap;src:url(../vendor/fonts/inter-800.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Noto Sans Arabic";font-weight:300 400;font-display:swap;src:url(../vendor/fonts/noto-sans-arabic-400.woff2) format("woff2")}
@font-face{font-family:"Noto Sans Arabic";font-weight:500;font-display:swap;src:url(../vendor/fonts/noto-sans-arabic-500.woff2) format("woff2")}
@font-face{font-family:"Noto Sans Arabic";font-weight:600;font-display:swap;src:url(../vendor/fonts/noto-sans-arabic-600.woff2) format("woff2")}
@font-face{font-family:"Noto Sans Arabic";font-weight:700;font-display:swap;src:url(../vendor/fonts/noto-sans-arabic-700.woff2) format("woff2")}
@font-face{font-family:"Noto Sans Arabic";font-weight:800 900;font-display:swap;src:url(../vendor/fonts/noto-sans-arabic-800.woff2) format("woff2")}

/* ============================== 2. Tokens ================================= */
/* Light is the base; html.dark-theme (set by assets/js/theme.js before first
   paint, following the OS unless the user picked one) swaps the values. */
:root{
  /* surfaces */
  --ui-bg:#f3f4f6;--ui-surface:#ffffff;--ui-surface-2:#f7f8fa;--ui-surface-3:#eef0f3;--ui-field:#ffffff;--ui-nav:#ffffff;
  /* ink */
  --ui-text:#1d2129;--ui-text-2:#363c45;--ui-muted:#5f6670;--ui-faint:#8c939c;
  /* lines */
  --ui-line:#dcdfe4;--ui-line-soft:#e8eaee;--ui-line-strong:#c3c8cf;
  /* accent — orange; --ui-accent-ink is the text that sits ON the accent */
  --ui-accent:#f28c1a;--ui-accent-ink:#1f1306;--ui-accent-text:#c2610a;--ui-accent-strong:#c2610a;--ui-accent-soft:#fff1e1;--ui-accent-line:#f7c896;--ui-ring:rgba(242,140,26,.22);
  /* status */
  --ui-green:#1c9655;--ui-green-soft:#e4f5ea;--ui-green-line:#b7e2c7;
  --ui-red:#d2483c;--ui-red-soft:#fdecea;--ui-red-line:#f4c7c2;
  --ui-amber:#b7791f;--ui-amber-soft:#fdf3dc;--ui-amber-line:#f1d9a6;
  --ui-blue:#2563eb;--ui-blue-soft:#e8f0fe;--ui-blue-line:#bcd2fb;
  --ui-violet:#7c3aed;--ui-violet-soft:#f1ebfe;
  /* table header: a slate tint akin to the header bar, so it reads apart from the rows */
  --ui-th-bg:#e6ecf4;--ui-th-bg-hover:#dae2ed;--ui-th-ink:#1f2d40;--ui-th-line:#c3cedc;
  /* shape + depth */
  --ui-h:38px;--ui-h-sm:32px;--ui-r:10px;--ui-r-lg:14px;
  --ui-shadow:0 1px 2px rgba(20,24,30,.05);
  --ui-shadow-pop:0 14px 36px rgba(20,24,30,.14),0 2px 6px rgba(20,24,30,.06);
  --ui-overlay:rgba(20,24,30,.38);
  --ui-hero-a:#ffa940;--ui-hero-b:#ef7f0e;
  color-scheme:light;
}
html.dark-theme,html[data-theme=dark]{
  --ui-bg:#1b1d21;--ui-surface:#23262b;--ui-surface-2:#2a2e34;--ui-surface-3:#33383f;--ui-field:#1e2125;--ui-nav:#15171a;
  --ui-th-bg:#2f3640;--ui-th-bg-hover:#363e4a;--ui-th-ink:#e3e8ef;--ui-th-line:#4a5260;
  --ui-text:#f1f2f4;--ui-text-2:#d2d5da;--ui-muted:#9aa0a9;--ui-faint:#6f757e;
  --ui-line:#383c43;--ui-line-soft:#2d3136;--ui-line-strong:#4a4f57;
  --ui-accent:#f5901a;--ui-accent-ink:#1f1306;--ui-accent-text:#ffad4d;--ui-accent-strong:#c96a0d;--ui-accent-soft:#3b2816;--ui-accent-line:#6b4419;--ui-ring:rgba(245,144,26,.25);
  --ui-green:#5fbf86;--ui-green-soft:#1d3226;--ui-green-line:#2d5a3f;
  --ui-red:#e26a60;--ui-red-soft:#3b2422;--ui-red-line:#5a302c;
  --ui-amber:#e3ab52;--ui-amber-soft:#382c17;--ui-amber-line:#5c4520;
  --ui-blue:#78a6ff;--ui-blue-soft:#1c2a44;--ui-blue-line:#2b4170;
  --ui-violet:#a78bfa;--ui-violet-soft:#2c2340;
  --ui-shadow:0 1px 2px rgba(0,0,0,.3);
  --ui-shadow-pop:0 18px 44px rgba(0,0,0,.5),0 2px 6px rgba(0,0,0,.3);
  --ui-overlay:rgba(8,9,11,.6);
  --ui-hero-a:#ffa940;--ui-hero-b:#e8780a;
  color-scheme:dark;
}

/* ========================== 3. Legacy aliases ============================= */
/* Names used by page styles written for the earlier themes. A page that still
   defines one of these locally keeps its own value; everywhere else it lands on
   the token. */
:root{
  /* Plain names for page styles. A page that defines one of these keeps its own
     value for its own content; the shell reads only the --ui-* tokens. */
  --bg:var(--ui-bg);--surface:var(--ui-surface);--surface-2:var(--ui-surface-2);--surface-3:var(--ui-surface-3);--text:var(--ui-text);--muted:var(--ui-muted);--faint:var(--ui-faint);--line:var(--ui-line);--line-soft:var(--ui-line-soft);--line-strong:var(--ui-line-strong);--accent:var(--ui-accent);--accent-ink:var(--ui-accent-ink);--accent-text:var(--ui-accent-text);--accent-strong:var(--ui-accent-strong);--accent-soft:var(--ui-accent-soft);--accent-line:var(--ui-accent-line);--green:var(--ui-green);--green-soft:var(--ui-green-soft);--green-line:var(--ui-green-line);--red:var(--ui-red);--red-soft:var(--ui-red-soft);--red-line:var(--ui-red-line);--amber:var(--ui-amber);--amber-soft:var(--ui-amber-soft);--amber-line:var(--ui-amber-line);--blue:var(--ui-blue);--blue-soft:var(--ui-blue-soft);--blue-line:var(--ui-blue-line);--violet:var(--ui-violet);--violet-soft:var(--ui-violet-soft);--shadow:var(--ui-shadow);--shadow-pop:var(--ui-shadow-pop);--overlay:var(--ui-overlay);
  --text-primary:var(--ui-text);--text-secondary:var(--ui-muted);--text-tertiary:var(--ui-faint);--text-muted:var(--ui-muted);
  --surface-primary:var(--ui-surface);--surface-secondary:var(--ui-surface-2);--surface-tertiary:var(--ui-surface-3);--surface-hover:var(--ui-surface-3);
  --surface-stroke:var(--ui-line-soft);--surface-stroke-default:var(--ui-line);--border-color:var(--ui-line);--border:var(--ui-line);
  --bg-card:var(--ui-surface);--bg-primary:var(--ui-bg);--bg-secondary:var(--ui-surface-2);--card-bg:var(--ui-surface);
  --primary:var(--ui-accent-strong);--primary-dark:var(--ui-accent-text);--primary-light:var(--ui-accent-soft);--primary-lighter:var(--ui-accent-soft);
  --win-accent:var(--ui-accent);--win-accent-dark:var(--ui-accent-text);--win-border:var(--ui-line);
  --win11-primary:var(--ui-accent-strong);--win11-accent:var(--ui-accent);--win11-text:var(--ui-text);--win11-text-secondary:var(--ui-muted);
  --win11-border:var(--ui-line);--win11-surface:var(--ui-surface);--win11-card:var(--ui-surface);--win11-bg:var(--ui-bg);--win11-soft:var(--ui-accent-soft);
  --win11-success:var(--ui-green);--win11-danger:var(--ui-red);--win11-warning:var(--ui-amber);--win11-info:var(--ui-blue);--win11-purple:var(--ui-violet);
  --win11-radius:var(--ui-r);--win11-shadow:var(--ui-shadow);
  --success:var(--ui-green);--success-bg:var(--ui-green-soft);--success-light:var(--ui-green-soft);
  --danger:var(--ui-red);--error:var(--ui-red);--error-bg:var(--ui-red-soft);--danger-bg:var(--ui-red-soft);--danger-light:var(--ui-red-soft);
  --warning:var(--ui-amber);--warning-bg:var(--ui-amber-soft);--warning-light:var(--ui-amber-soft);--warning-border:var(--ui-amber-line);
  --info:var(--ui-blue);--info-bg:var(--ui-blue-soft);--info-light:var(--ui-blue-soft);--info-border:var(--ui-blue-line);
  --space-xs:4px;--space-sm:8px;--space-md:12px;--space-lg:16px;--space-xl:24px;
  --radius-sm:6px;--radius-md:8px;--radius-lg:var(--ui-r-lg);--radius:var(--ui-r);
  --shadow-sm:var(--ui-shadow);--shadow-md:var(--ui-shadow-pop);--shadow-lg:var(--ui-shadow-pop);--shadow-dialog:var(--ui-shadow-pop);
  --transition-fast:.12s ease;--transition:.2s ease;
}

/* ============================ 4. Type scale =============================== */
/* Settings → Project fonts (includes/project_fonts.php) rewrites these
   variables at runtime; the selectors below own every size, so an admin can
   rescale the whole app from one screen. */
:root{
  --app-font-family:"Inter","Noto Sans Arabic","Segoe UI",Tahoma,system-ui,sans-serif;
  --app-font-size:13px;
  --app-font-xs:10.5px;--app-font-sm:11.5px;--app-font-md:14px;--app-font-lg:16px;--app-font-xl:19px;--app-font-display:23px;
  --app-font-table:var(--app-font-size);
  --app-font-table-head:max(10px,calc(var(--app-font-table) - 1px));
  --app-font-table-dense:max(11px,calc(var(--app-font-table) - 1.5px));
  --app-font-table-dense-head:max(10px,calc(var(--app-font-table) - 2.5px));
  --app-font-grid-stat:var(--app-font-md);
}
@media screen{
  body{font-size:var(--app-font-size)!important;font-family:var(--app-font-family)!important}
  /* One family everywhere — icon fonts, code and anything marked keep-font excepted. */
  body *:where(:not(i,svg,svg *,canvas,.fa,.fas,.far,.fal,.fab,[class*="fa-"],[class*="bi-"],[class*="icon"],[class*="logo"],.material-icons,.material-symbols-outlined,pre,code,kbd,samp,pre *,code *,.mono,[class*="mono"],[style*="monospace"],[style*="Consolas"],[data-keep-font],[data-keep-font] *,.keep-font,.keep-font *)){font-family:var(--app-font-family)!important}
  .fa,.fas,.far,.fal,.fad,[class^="fa-"],[class*=" fa-"]{font-family:"Font Awesome 6 Free","Font Awesome 6 Pro","Font Awesome 5 Free","FontAwesome"!important}
  .fab,[class^="fa-brands"],[class*=" fa-brands"]{font-family:"Font Awesome 6 Brands","Font Awesome 5 Brands"!important}
  .bi,[class^="bi-"],[class*=" bi-"],.bi::before,[class^="bi-"]::before,[class*=" bi-"]::before{font-family:"bootstrap-icons"!important}
  /* Baseline: plain text lands on the body size; classes below lift what must read bigger. */
  body *:where(:not(i,svg,svg *,canvas,.fa,.fas,.far,.fal,.fab,[class*="fa-"],[class*="bi-"],[class*="icon"],[class*="logo"],[class*="close"],.material-icons,.material-symbols-outlined,[data-keep-font-size],[data-keep-font-size] *,.keep-font-size,.keep-font-size *)){font-size:var(--app-font-size)!important}
  .stat-value,.hr-stat-value,.sp-row.grand .sp-row-value,.pos-totals-row.grand .pos-totals-value{font-size:var(--app-font-display)!important;line-height:1.15}
  .purchase-summary-metric.tp-grand .tp-grand-value,.ws-stat .ws-stat-value,.win-stat-card .value,.summary-tile .value,.zone-stat .value,.dispatch-summary .summary-value,.win-summary-item .count,.stat-info h3,.tile h3,.summary-value{font-size:var(--app-font-xl)!important;line-height:1.2}
  .page-title,.page-header .page-title,.page-title-bar h1,.cashvan-page-title h1,.content-header .title,.modal-title,.panel-title,.card-header,.card-title,.section-title,.empty-state-title,.hr-hero h1,.hr-profile-title,.topbar .title,.pos-empty h4,#paidAmountInput,h1{font-size:var(--app-font-lg)!important}
  .kpi-value{font-size:var(--app-font-lg)!important}
  .sale-picker-hdr,.sale-pk-stock,.van-bar-stat .value,.sp-head,.sp-row.grand .sp-row-label,.sp-btn.primary,.pos-line-total,.pos-qty-value,.pos-btn-save,.pos-btn-del,.pos-search-item-price .main,.sp-disc-row input,#totalBaseDisplay,.remaining-value,h2,h3,.gl-hbar-item,.gl-hbar-select,.drb-text,.sp-customer .sp-row-value,.sp-disc-row select,.pos-disc-group .pos-tbl-select,.pos-gift-badge,.pos-promo-badge,.pos-search-item-info h4,.tv-search-item .pname,.psearch .pname,.do-search-item-info h4,.adj-search-item .s-name,.search-item .item-name,.invoice-search-item .inv-number,.psearch .pnm,.psearch .pprice,.do-search-item-price .main,.invoice-search-item .inv-total,.search-item .item-prices .main-price{font-size:var(--app-font-md)!important}
  .form-hint,.field-hint,.text-muted small,figcaption,small,.stat-label,.stat-sub,.kpi-label,.pos-col-idx,.pos-product-code,.pos-tbl-select,.sp-customer-warn,.pos-search-item-info .meta,.tv-search-item .pmeta,.tv-search-item .pstock,.psearch .pmeta,.adj-search-item .s-code,.adj-search-item .s-stock,.search-item .item-code,.search-item .item-unit,.invoice-search-item .inv-date,.invoice-search-item .inv-supplier,.cs-meta,.dsr-meta,.psearch .pright,.psearch .pstock,.stock-badge,.unit-badge,.qty-badge,.badge,.pill,.status-badge{font-size:var(--app-font-sm)!important}
  .ui-step-sub,.ui-choice-sub{font-size:var(--app-font-sm)!important}
  .pos-oos-badge,.pos-paid-info,.kbd-hint,.kbd-hint kbd,.sp-customer-title,.card-count,.pos-supplier-tag,.pos-search-supplier-header,.vo-stat-label,.vo-ops-metric .label{font-size:var(--app-font-xs)!important}
  table,.data-table,.table,.report-table,table td,.data-table td,.table td,.pos-table,.pos-product-name,.pos-tbl-input{font-size:var(--app-font-table)!important}
  table th,.data-table th,.table th,.report-table th,.pos-table thead th{font-size:var(--app-font-table-head)!important}
  td *:where(:not(i,svg,svg *,[class*="fa-"],[class*="bi-"],[class*="icon"],[data-keep-font-size],.keep-font-size,.keep-font-size *)),th *:where(:not(i,svg,svg *,[class*="fa-"],[class*="bi-"],[class*="icon"],[data-keep-font-size],.keep-font-size,.keep-font-size *)){font-size:inherit!important}
  body.so-workspace .data-table,body.so-workspace .data-table td,.vo-table,.vo-table td{font-size:var(--app-font-table-dense)!important}
  body.so-workspace .data-table th,.vo-table th{font-size:var(--app-font-table-dense-head)!important}
  body.so-workspace .stats-after-table .stat-value,.vo-stat-value,.vo-ops-metric .value,.vo-mix-net{font-size:var(--app-font-grid-stat)!important}
  .vo-page-header h1,.vo-modal-header h3,.vo-ops-head h2{font-size:var(--app-font-lg)!important}
}
@media screen and (pointer:coarse){
  body input[type=text],body input[type=number],body input[type=search],body input[type=tel],body input[type=email],body input[type=password],body input[type=date],body textarea,body select{font-size:16px!important}
}

/* ================================ Icons =================================== */
/* One icon set: Lucide line icons (assets/vendor/lucide, ISC licence), served
   locally. Existing markup keeps its Font Awesome / Bootstrap Icons class
   names; each name below is drawn with the matching Lucide glyph, and a name
   with no match falls back to the local Font Awesome glyph. */
@font-face{font-family:"lucide";src:url(../vendor/lucide/lucide.woff2) format("woff2"),url(../vendor/lucide/lucide.woff) format("woff");font-display:block}
html .bi-archive::before,html .bi-arrow-clockwise::before,html .bi-arrow-counterclockwise::before,html .bi-arrow-left::before,html .bi-arrow-left-right::before,html .bi-arrow-repeat::before,html .bi-arrow-return-left::before,html .bi-arrow-return-right::before,html .bi-arrow-right::before,html .bi-bag-check::before,html .bi-bank2::before,html .bi-bar-chart::before,html .bi-box-seam::before,html .bi-box-seam-fill::before,html .bi-building-fill::before,html .bi-calculator::before,html .bi-calculator-fill::before,html .bi-calendar-check::before,html .bi-calendar-event::before,html .bi-card-heading::before,html .bi-card-text::before,html .bi-cart-plus::before,html .bi-cart-plus-fill::before,html .bi-cart-x::before,html .bi-cart3::before,html .bi-check-circle::before,html .bi-check-circle-fill::before,html .bi-check-lg::before,html .bi-check2-circle::before,html .bi-check2-square::before,html .bi-chevron-down::before,html .bi-chevron-left::before,html .bi-chevron-right::before,html .bi-clipboard2-pulse::before,html .bi-clock-history::before,html .bi-cloud-upload::before,html .bi-collection::before,html .bi-credit-card-2-front::before,html .bi-crosshair::before,html .bi-dash::before,html .bi-download::before,html .bi-envelope-fill::before,html .bi-eraser::before,html .bi-exclamation-octagon::before,html .bi-exclamation-octagon-fill::before,html .bi-exclamation-triangle::before,html .bi-exclamation-triangle-fill::before,html .bi-eye::before,html .bi-file-earmark::before,html .bi-file-earmark-excel::before,html .bi-file-earmark-pdf::before,html .bi-file-earmark-plus::before,html .bi-file-earmark-text::before,html .bi-file-earmark-text-fill::before,html .bi-file-excel::before,html .bi-file-pdf::before,html .bi-file-text::before,html .bi-files::before,html .bi-flag-fill::before,html .bi-funnel::before,html .bi-geo-alt::before,html .bi-geo-alt-fill::before,html .bi-gift::before,html .bi-graph-up::before,html .bi-graph-up-arrow::before,html .bi-grid-3x3-gap::before,html .bi-grip-vertical::before,html .bi-hash::before,html .bi-hourglass-split::before,html .bi-house::before,html .bi-image::before,html .bi-inbox::before,html .bi-inbox-fill::before,html .bi-info-circle::before,html .bi-info-circle-fill::before,html .bi-journal-text::before,html .bi-layout-three-columns::before,html .bi-lightning-charge::before,html .bi-link-45deg::before,html .bi-list::before,html .bi-lock-fill::before,html .bi-map::before,html .bi-palette::before,html .bi-patch-check::before,html .bi-patch-check-fill::before,html .bi-pause-btn::before,html .bi-pause-circle::before,html .bi-pencil::before,html .bi-pencil-square::before,html .bi-percent::before,html .bi-person-badge::before,html .bi-person-badge-fill::before,html .bi-person-fill::before,html .bi-person-plus::before,html .bi-play-circle::before,html .bi-plus::before,html .bi-plus-circle::before,html .bi-plus-lg::before,html .bi-printer::before,html .bi-printer-fill::before,html .bi-receipt::before,html .bi-receipt-cutoff::before,html .bi-safe2::before,html .bi-save::before,html .bi-save2::before,html .bi-search::before,html .bi-send::before,html .bi-send-fill::before,html .bi-shield-exclamation::before,html .bi-shop::before,html .bi-shop-window::before,html .bi-sign-stop-fill::before,html .bi-slash-circle::before,html .bi-stack::before,html .bi-star::before,html .bi-star-fill::before,html .bi-sticky::before,html .bi-sticky-fill::before,html .bi-tag::before,html .bi-tags::before,html .bi-telephone::before,html .bi-telephone-fill::before,html .bi-tools::before,html .bi-trash::before,html .bi-trash3::before,html .bi-trash3-fill::before,html .bi-truck::before,html .bi-truck-fill::before,html .bi-ui-checks-grid::before,html .bi-upc::before,html .bi-upc-scan::before,html .bi-upload::before,html .bi-wallet2::before,html .bi-wifi-off::before,html .bi-wrench::before,html .bi-wrench-adjustable-circle::before,html .bi-x-circle::before,html .bi-x-lg::before,html .fa-address-book::before,html .fa-angle-double-down::before,html .fa-angle-double-up::before,html .fa-angles-left::before,html .fa-angles-right::before,html .fa-arrow-down::before,html .fa-arrow-left::before,html .fa-arrow-left-long::before,html .fa-arrow-right::before,html .fa-arrow-right-arrow-left::before,html .fa-arrow-right-long::before,html .fa-arrow-right-to-bracket::before,html .fa-arrow-rotate-left::before,html .fa-arrow-trend-down::before,html .fa-arrow-trend-up::before,html .fa-arrow-up::before,html .fa-arrow-up-right-from-square::before,html .fa-arrows-left-right::before,html .fa-arrows-rotate::before,html .fa-backward-step::before,html .fa-bag-shopping::before,html .fa-balance-scale::before,html .fa-ban::before,html .fa-barcode::before,html .fa-bars::before,html .fa-basket-shopping::before,html .fa-bell::before,html .fa-bolt::before,html .fa-book::before,html .fa-book-open::before,html .fa-book-open-reader::before,html .fa-box::before,html .fa-box-open::before,html .fa-boxes-stacked::before,html .fa-briefcase::before,html .fa-building::before,html .fa-building-columns::before,html .fa-bullseye::before,html .fa-calculator::before,html .fa-calendar::before,html .fa-calendar-alt::before,html .fa-calendar-day::before,html .fa-calendar-days::before,html .fa-camera::before,html .fa-cart-plus::before,html .fa-cart-shopping::before,html .fa-cash-register::before,html .fa-chart-area::before,html .fa-chart-bar::before,html .fa-chart-column::before,html .fa-chart-line::before,html .fa-chart-pie::before,html .fa-chart-simple::before,html .fa-check::before,html .fa-check-circle::before,html .fa-chevron-circle-down::before,html .fa-chevron-down::before,html .fa-chevron-left::before,html .fa-chevron-right::before,html .fa-chevron-up::before,html .fa-circle::before,html .fa-circle-check::before,html .fa-circle-exclamation::before,html .fa-circle-info::before,html .fa-circle-notch::before,html .fa-circle-question::before,html .fa-circle-xmark::before,html .fa-city::before,html .fa-clipboard-check::before,html .fa-clipboard-list::before,html .fa-clock::before,html .fa-clock-rotate-left::before,html .fa-close::before,html .fa-code-branch::before,html .fa-code-merge::before,html .fa-cog::before,html .fa-coins::before,html .fa-copy::before,html .fa-credit-card::before,html .fa-cubes::before,html .fa-database::before,html .fa-diagram-project::before,html .fa-dollar-sign::before,html .fa-dolly::before,html .fa-download::before,html .fa-draw-polygon::before,html .fa-edit::before,html .fa-ellipsis::before,html .fa-ellipsis-vertical::before,html .fa-envelope::before,html .fa-equals::before,html .fa-eraser::before,html .fa-exchange-alt::before,html .fa-exclamation-circle::before,html .fa-exclamation-triangle::before,html .fa-expand::before,html .fa-external-link-alt::before,html .fa-eye::before,html .fa-eye-slash::before,html .fa-file::before,html .fa-file-alt::before,html .fa-file-circle-minus::before,html .fa-file-circle-plus::before,html .fa-file-contract::before,html .fa-file-csv::before,html .fa-file-excel::before,html .fa-file-invoice::before,html .fa-file-invoice-dollar::before,html .fa-file-lines::before,html .fa-file-pdf::before,html .fa-file-signature::before,html .fa-filter::before,html .fa-flask::before,html .fa-floppy-disk::before,html .fa-folder::before,html .fa-folder-open::before,html .fa-folder-tree::before,html .fa-forward-step::before,html .fa-gauge::before,html .fa-gauge-high::before,html .fa-gavel::before,html .fa-gear::before,html .fa-gears::before,html .fa-gift::before,html .fa-globe::before,html .fa-hand-holding-dollar::before,html .fa-history::before,html .fa-home::before,html .fa-hourglass::before,html .fa-hourglass-end::before,html .fa-hourglass-half::before,html .fa-house::before,html .fa-id-card::before,html .fa-image::before,html .fa-inbox::before,html .fa-industry::before,html .fa-info-circle::before,html .fa-key::before,html .fa-layer-group::before,html .fa-lightbulb::before,html .fa-link::before,html .fa-link-slash::before,html .fa-list::before,html .fa-list-check::before,html .fa-location-crosshairs::before,html .fa-location-dot::before,html .fa-lock::before,html .fa-lock-open::before,html .fa-magnifying-glass::before,html .fa-map::before,html .fa-map-location-dot::before,html .fa-map-marker-alt::before,html .fa-minus::before,html .fa-mobile-screen::before,html .fa-money-bill::before,html .fa-money-bill-transfer::before,html .fa-money-bill-wave::before,html .fa-money-check::before,html .fa-money-check-dollar::before,html .fa-not-equal::before,html .fa-note-sticky::before,html .fa-paper-plane::before,html .fa-pause::before,html .fa-pen::before,html .fa-pen-ruler::before,html .fa-pen-to-square::before,html .fa-people-arrows::before,html .fa-percent::before,html .fa-phone::before,html .fa-play::before,html .fa-plus::before,html .fa-power-off::before,html .fa-print::before,html .fa-qrcode::before,html .fa-question-circle::before,html .fa-ranking-star::before,html .fa-receipt::before,html .fa-right-from-bracket::before,html .fa-right-left::before,html .fa-rotate::before,html .fa-rotate-left::before,html .fa-route::before,html .fa-ruler::before,html .fa-ruler-combined::before,html .fa-sack-dollar::before,html .fa-save::before,html .fa-scale-balanced::before,html .fa-scale-unbalanced-flip::before,html .fa-scroll::before,html .fa-search::before,html .fa-shield::before,html .fa-shield-halved::before,html .fa-shopping-cart::before,html .fa-sign-out-alt::before,html .fa-signature::before,html .fa-signs-post::before,html .fa-sitemap::before,html .fa-sliders::before,html .fa-spinner::before,html .fa-square-check::before,html .fa-square-plus::before,html .fa-stamp::before,html .fa-star::before,html .fa-store::before,html .fa-sync::before,html .fa-table::before,html .fa-table-cells::before,html .fa-table-columns::before,html .fa-table-list::before,html .fa-tachometer-alt::before,html .fa-tag::before,html .fa-tags::before,html .fa-thumbtack::before,html .fa-times::before,html .fa-times-circle::before,html .fa-toggle-off::before,html .fa-toggle-on::before,html .fa-trash::before,html .fa-trash-alt::before,html .fa-trash-can::before,html .fa-trash-can-arrow-up::before,html .fa-triangle-exclamation::before,html .fa-trophy::before,html .fa-truck::before,html .fa-truck-arrow-right::before,html .fa-truck-fast::before,html .fa-truck-field::before,html .fa-truck-loading::before,html .fa-truck-ramp-box::before,html .fa-undo::before,html .fa-up-right-and-down-left-from-center::before,html .fa-upload::before,html .fa-user::before,html .fa-user-check::before,html .fa-user-clock::before,html .fa-user-edit::before,html .fa-user-gear::before,html .fa-user-group::before,html .fa-user-pen::before,html .fa-user-plus::before,html .fa-user-shield::before,html .fa-user-slash::before,html .fa-user-tag::before,html .fa-user-tie::before,html .fa-user-xmark::before,html .fa-users::before,html .fa-users-gear::before,html .fa-users-viewfinder::before,html .fa-van-shuttle::before,html .fa-vault::before,html .fa-wallet::before,html .fa-warehouse::before,html .fa-whatsapp::before,html .fa-window-restore::before,html .fa-xmark::before{font-family:"lucide"!important;font-weight:normal!important;font-style:normal;speak:never;-webkit-font-smoothing:antialiased}
html .bi-archive::before{content:"\e041"}
html .fa-arrow-down::before{content:"\e042"}
html .fa-arrow-left::before,html .bi-arrow-left::before{content:"\e048"}
html .fa-arrow-right::before,html .bi-arrow-right::before{content:"\e049"}
html .fa-arrow-up::before{content:"\e04a"}
html .fa-ranking-star::before{content:"\e04f"}
html .fa-ban::before,html .bi-slash-circle::before{content:"\e051"}
html .fa-money-bill-wave::before,html .fa-money-bill::before,html .fa-money-check-dollar::before,html .fa-money-check::before{content:"\e052"}
html .fa-bell::before{content:"\e059"}
html .fa-book::before{content:"\e05e"}
html .fa-book-open::before,html .fa-book-open-reader::before{content:"\e05f"}
html .fa-briefcase::before{content:"\e062"}
html .fa-calendar::before,html .fa-calendar-alt::before,html .bi-calendar-event::before{content:"\e063"}
html .fa-camera::before{content:"\e064"}
html .fa-chart-pie::before{content:"\e06b"}
html .fa-check::before,html .bi-check-lg::before{content:"\e06c"}
html .fa-chevron-down::before,html .bi-chevron-down::before{content:"\e06d"}
html .fa-chevron-left::before,html .bi-chevron-left::before{content:"\e06e"}
html .fa-chevron-right::before,html .bi-chevron-right::before{content:"\e06f"}
html .fa-chevron-up::before{content:"\e070"}
html .fa-angle-double-down::before{content:"\e071"}
html .fa-angles-left::before{content:"\e072"}
html .fa-angles-right::before{content:"\e073"}
html .fa-angle-double-up::before{content:"\e074"}
html .fa-circle::before{content:"\e076"}
html .fa-circle-exclamation::before,html .fa-exclamation-circle::before{content:"\e077"}
html .bi-pause-btn::before,html .bi-pause-circle::before{content:"\e07f"}
html .bi-play-circle::before{content:"\e080"}
html .bi-plus-circle::before{content:"\e081"}
html .fa-circle-question::before,html .fa-question-circle::before{content:"\e082"}
html .fa-circle-xmark::before,html .fa-times-circle::before,html .bi-x-circle::before{content:"\e084"}
html .fa-clipboard-list::before,html .bi-clipboard2-pulse::before{content:"\e086"}
html .fa-clock::before{content:"\e087"}
html .bi-cloud-upload::before{content:"\e091"}
html .fa-coins::before{content:"\e097"}
html .fa-table-columns::before,html .bi-layout-three-columns::before{content:"\e099"}
html .fa-copy::before{content:"\e09e"}
html .bi-arrow-return-left::before{content:"\e0a1"}
html .bi-arrow-return-right::before{content:"\e0a2"}
html .fa-credit-card::before,html .bi-credit-card-2-front::before{content:"\e0aa"}
html .bi-crosshair::before{content:"\e0ac"}
html .fa-database::before{content:"\e0ad"}
html .fa-dollar-sign::before{content:"\e0b1"}
html .fa-download::before,html .bi-download::before{content:"\e0b2"}
html .fa-ellipsis::before{content:"\e0b6"}
html .fa-ellipsis-vertical::before{content:"\e0b7"}
html .fa-arrow-up-right-from-square::before,html .fa-external-link-alt::before{content:"\e0b9"}
html .fa-eye::before,html .bi-eye::before{content:"\e0ba"}
html .fa-eye-slash::before{content:"\e0bb"}
html .fa-file::before,html .bi-file-earmark::before{content:"\e0c0"}
html .fa-file-circle-minus::before{content:"\e0c6"}
html .fa-file-circle-plus::before,html .bi-file-earmark-plus::before{content:"\e0c9"}
html .fa-file-pdf::before,html .fa-file-lines::before,html .fa-file-alt::before,html .fa-file-contract::before,html .bi-card-text::before,html .bi-file-earmark-pdf::before,html .bi-file-pdf::before,html .bi-file-earmark-text::before,html .bi-file-earmark-text-fill::before,html .bi-file-text::before{content:"\e0cc"}
html .bi-files::before{content:"\e0cf"}
html .bi-flag-fill::before{content:"\e0d1"}
html .fa-flask::before{content:"\e0d5"}
html .fa-folder::before{content:"\e0d7"}
html .fa-filter::before,html .bi-funnel::before{content:"\e0dc"}
html .fa-gavel::before{content:"\e0e0"}
html .fa-gift::before,html .bi-gift::before{content:"\e0e1"}
html .fa-code-branch::before{content:"\e0e2"}
html .fa-code-merge::before{content:"\e0e4"}
html .fa-globe::before{content:"\e0e8"}
html .fa-table-cells::before,html .bi-grid-3x3-gap::before{content:"\e0e9"}
html .bi-grip-vertical::before{content:"\e0eb"}
html .bi-hash::before{content:"\e0ef"}
html .fa-house::before,html .fa-home::before,html .bi-house::before{content:"\e0f5"}
html .fa-image::before,html .bi-image::before{content:"\e0f6"}
html .fa-inbox::before,html .bi-inbox::before,html .bi-inbox-fill::before{content:"\e0f7"}
html .fa-circle-info::before,html .fa-info-circle::before,html .bi-info-circle::before,html .bi-info-circle-fill::before{content:"\e0f9"}
html .fa-key::before{content:"\e0fd"}
html .bi-ui-checks-grid::before{content:"\e0ff"}
html .fa-link::before,html .bi-link-45deg::before{content:"\e102"}
html .fa-list::before,html .bi-list::before{content:"\e106"}
html .fa-spinner::before,html .fa-circle-notch::before{content:"\e10a"}
html .fa-lock::before,html .bi-lock-fill::before{content:"\e10b"}
html .fa-lock-open::before{content:"\e10c"}
html .fa-arrow-right-to-bracket::before{content:"\e10d"}
html .fa-right-from-bracket::before,html .fa-sign-out-alt::before{content:"\e10e"}
html .fa-envelope::before,html .bi-envelope-fill::before{content:"\e10f"}
html .fa-map::before,html .bi-map::before{content:"\e110"}
html .fa-location-dot::before,html .fa-map-marker-alt::before,html .bi-geo-alt::before,html .bi-geo-alt-fill::before{content:"\e111"}
html .fa-up-right-and-down-left-from-center::before,html .fa-expand::before{content:"\e113"}
html .fa-bars::before{content:"\e115"}
html .fa-whatsapp::before{content:"\e116"}
html .fa-minus::before,html .bi-dash::before{content:"\e11c"}
html .fa-sitemap::before{content:"\e125"}
html .bi-exclamation-octagon::before,html .bi-exclamation-octagon-fill::before{content:"\e127"}
html .bi-sign-stop-fill::before{content:"\e128"}
html .fa-box::before,html .fa-dolly::before,html .bi-box-seam::before,html .bi-box-seam-fill::before{content:"\e129"}
html .fa-pause::before{content:"\e12e"}
html .fa-pen::before{content:"\e12f"}
html .fa-percent::before,html .bi-percent::before{content:"\e132"}
html .fa-phone::before,html .bi-telephone::before,html .bi-telephone-fill::before{content:"\e133"}
html .fa-sack-dollar::before{content:"\e13a"}
html .fa-play::before{content:"\e13c"}
html .fa-plus::before,html .bi-plus::before,html .bi-plus-lg::before{content:"\e13d"}
html .fa-power-off::before{content:"\e140"}
html .fa-print::before,html .bi-printer::before,html .bi-printer-fill::before{content:"\e141"}
html .fa-rotate::before,html .fa-arrows-rotate::before,html .fa-sync::before{content:"\e145"}
html .bi-arrow-repeat::before{content:"\e146"}
html .fa-rotate-left::before,html .fa-arrow-rotate-left::before,html .bi-arrow-counterclockwise::before{content:"\e148"}
html .bi-arrow-clockwise::before{content:"\e149"}
html .fa-ruler-combined::before,html .fa-ruler::before,html .fa-pen-ruler::before{content:"\e14b"}
html .fa-save::before,html .fa-floppy-disk::before,html .bi-save::before,html .bi-save2::before{content:"\e14d"}
html .fa-magnifying-glass::before,html .fa-search::before,html .bi-search::before{content:"\e151"}
html .fa-paper-plane::before,html .bi-send::before,html .bi-send-fill::before{content:"\e152"}
html .fa-gear::before,html .fa-cog::before,html .fa-gears::before{content:"\e154"}
html .fa-shield-halved::before,html .fa-shield::before{content:"\e158"}
html .fa-bag-shopping::before,html .bi-bag-check::before{content:"\e15b"}
html .fa-cart-shopping::before,html .fa-shopping-cart::before,html .fa-cart-plus::before,html .bi-cart-plus::before,html .bi-cart-plus-fill::before,html .bi-cart-x::before,html .bi-cart3::before{content:"\e15c"}
html .fa-backward-step::before{content:"\e15f"}
html .fa-forward-step::before{content:"\e160"}
html .fa-mobile-screen::before{content:"\e163"}
html .fa-pen-to-square::before,html .fa-edit::before,html .bi-pencil-square::before{content:"\e172"}
html .fa-square-plus::before{content:"\e173"}
html .fa-star::before,html .bi-star::before,html .bi-star-fill::before{content:"\e176"}
html .fa-table-list::before,html .fa-table::before{content:"\e17d"}
html .fa-tag::before,html .bi-tag::before{content:"\e17f"}
html .fa-bullseye::before{content:"\e180"}
html .fa-toggle-off::before{content:"\e18b"}
html .fa-toggle-on::before{content:"\e18c"}
html .fa-trash::before,html .bi-trash::before{content:"\e18d"}
html .fa-trash-can::before,html .fa-trash-alt::before,html .bi-trash3::before,html .bi-trash3-fill::before{content:"\e18e"}
html .fa-arrow-trend-down::before{content:"\e190"}
html .fa-arrow-trend-up::before,html .bi-graph-up-arrow::before{content:"\e191"}
html .fa-triangle-exclamation::before,html .fa-exclamation-triangle::before,html .bi-exclamation-triangle::before,html .bi-exclamation-triangle-fill::before{content:"\e193"}
html .fa-truck::before,html .fa-truck-fast::before,html .fa-truck-arrow-right::before,html .fa-truck-field::before,html .fa-truck-loading::before,html .fa-truck-ramp-box::before,html .bi-truck::before,html .bi-truck-fill::before{content:"\e194"}
html .fa-link-slash::before{content:"\e19c"}
html .fa-upload::before,html .bi-upload::before{content:"\e19e"}
html .fa-user::before,html .bi-person-fill::before{content:"\e19f"}
html .fa-user-check::before{content:"\e1a0"}
html .fa-user-plus::before,html .bi-person-plus::before{content:"\e1a2"}
html .fa-user-slash::before,html .fa-user-xmark::before{content:"\e1a3"}
html .fa-users::before,html .fa-people-arrows::before{content:"\e1a4"}
html .bi-wifi-off::before{content:"\e1af"}
html .bi-tools::before,html .bi-wrench::before,html .bi-wrench-adjustable-circle::before{content:"\e1b1"}
html .fa-xmark::before,html .fa-times::before,html .fa-close::before,html .bi-x-lg::before{content:"\e1b2"}
html .fa-bolt::before,html .bi-lightning-charge::before{content:"\e1b4"}
html .fa-calculator::before,html .fa-cash-register::before,html .bi-calculator::before,html .bi-calculator-fill::before{content:"\e1bc"}
html .fa-equals::before{content:"\e1bd"}
html .fa-not-equal::before{content:"\e1be"}
html .fa-gauge-high::before,html .fa-gauge::before,html .fa-tachometer-alt::before{content:"\e1bf"}
html .fa-lightbulb::before{content:"\e1c2"}
html .fa-building::before,html .bi-building-fill::before{content:"\e1cc"}
html .fa-list-check::before{content:"\e1d0"}
html .fa-van-shuttle::before{content:"\e1d4"}
html .fa-location-crosshairs::before{content:"\e1db"}
html .bi-palette::before{content:"\e1dd"}
html .fa-qrcode::before{content:"\e1df"}
html .fa-clock-rotate-left::before,html .fa-history::before,html .bi-clock-history::before{content:"\e1f5"}
html .bi-pencil::before{content:"\e1f9"}
html .bi-shield-exclamation::before{content:"\e1fe"}
html .fa-wallet::before,html .bi-wallet2::before{content:"\e204"}
html .fa-scale-balanced::before,html .fa-balance-scale::before,html .fa-scale-unbalanced-flip::before{content:"\e212"}
html .fa-clipboard-check::before{content:"\e219"}
html .fa-circle-check::before,html .fa-check-circle::before,html .bi-check-circle::before,html .bi-check-circle-fill::before,html .bi-check2-circle::before{content:"\e226"}
html .fa-building-columns::before,html .bi-bank2::before{content:"\e23a"}
html .bi-patch-check::before,html .bi-patch-check-fill::before{content:"\e241"}
html .fa-folder-open::before{content:"\e247"}
html .fa-arrows-left-right::before,html .bi-arrow-left-right::before{content:"\e24a"}
html .fa-thumbtack::before{content:"\e259"}
html .fa-eraser::before,html .bi-eraser::before{content:"\e28f"}
html .fa-city::before{content:"\e290"}
html .fa-hourglass-half::before,html .fa-hourglass-end::before,html .fa-hourglass::before,html .bi-hourglass-split::before{content:"\e296"}
html .fa-sliders::before{content:"\e29a"}
html .fa-industry::before{content:"\e29f"}
html .fa-undo::before{content:"\e2a1"}
html .fa-chart-bar::before{content:"\e2a2"}
html .fa-chart-column::before,html .fa-chart-simple::before,html .bi-bar-chart::before{content:"\e2a3"}
html .fa-chart-line::before,html .bi-graph-up::before{content:"\e2a5"}
html .bi-calendar-check::before{content:"\e2b7"}
html .fa-calendar-day::before,html .fa-calendar-days::before{content:"\e2b9"}
html .fa-box-open::before{content:"\e2cc"}
html .fa-trash-can-arrow-up::before{content:"\e2cd"}
html .fa-boxes-stacked::before,html .fa-cubes::before{content:"\e2d0"}
html .fa-scroll::before{content:"\e2ed"}
html .fa-note-sticky::before,html .bi-sticky::before,html .bi-sticky-fill::before{content:"\e303"}
html .fa-file-excel::before,html .fa-file-csv::before,html .bi-file-earmark-excel::before,html .bi-file-excel::before{content:"\e326"}
html .fa-folder-tree::before{content:"\e33c"}
html .fa-users-gear::before,html .fa-user-gear::before{content:"\e342"}
html .fa-tags::before,html .bi-tags::before{content:"\e35c"}
html .fa-trophy::before{content:"\e373"}
html .fa-stamp::before{content:"\e3bb"}
html .fa-file-invoice-dollar::before,html .fa-receipt::before,html .bi-receipt::before,html .bi-receipt-cutoff::before{content:"\e3d3"}
html .fa-store::before,html .bi-shop::before,html .bi-shop-window::before{content:"\e3e4"}
html .fa-warehouse::before{content:"\e3e6"}
html .fa-money-bill-transfer::before,html .fa-right-left::before,html .fa-arrow-right-arrow-left::before,html .fa-exchange-alt::before{content:"\e417"}
html .fa-diagram-project::before{content:"\e425"}
html .fa-window-restore::before{content:"\e426"}
html .fa-user-tie::before,html .fa-user-tag::before,html .fa-user-clock::before{content:"\e468"}
html .fa-user-group::before{content:"\e46e"}
html .fa-arrow-left-long::before{content:"\e48f"}
html .fa-arrow-right-long::before{content:"\e490"}
html .fa-chart-area::before{content:"\e4d3"}
html .fa-chevron-circle-down::before{content:"\e4dd"}
html .fa-basket-shopping::before{content:"\e4ea"}
html .fa-layer-group::before,html .bi-collection::before,html .bi-stack::before{content:"\e529"}
html .fa-draw-polygon::before{content:"\e52b"}
html .fa-barcode::before,html .bi-upc::before,html .bi-upc-scan::before{content:"\e535"}
html .fa-map-location-dot::before{content:"\e53d"}
html .fa-route::before{content:"\e53e"}
html .fa-signs-post::before{content:"\e540"}
html .fa-address-book::before{content:"\e54d"}
html .fa-square-check::before,html .bi-check2-square::before{content:"\e559"}
html .fa-users-viewfinder::before{content:"\e579"}
html .fa-vault::before,html .bi-safe2::before{content:"\e58f"}
html .bi-journal-text::before{content:"\e598"}
html .fa-file-invoice::before{content:"\e5ac"}
html .fa-hand-holding-dollar::before{content:"\e5b8"}
html .fa-file-signature::before,html .fa-signature::before{content:"\e5f2"}
html .fa-user-pen::before,html .fa-user-edit::before{content:"\e5fc"}
html .fa-id-card::before,html .bi-card-heading::before,html .bi-person-badge::before,html .bi-person-badge-fill::before{content:"\e617"}
html .fa-user-shield::before{content:"\e647"}
.fa,.fas,.far,.fab,.fa-solid,.fa-regular,.fa-brands,.bi{display:inline-block;line-height:1;font-style:normal;text-rendering:auto}

/* ================================ 5. Base ================================= */
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--ui-bg);color:var(--ui-text);line-height:1.45;-webkit-font-smoothing:antialiased}
/* Pages with the app frame: header on top, the content area owns the scroll.
   Standalone pages (login, print) keep normal document scrolling. */
body:has(>.desktop-app){display:flex;flex-direction:column;overflow:hidden}
body.theme-transitioning,body.theme-transitioning *{transition:background-color .25s,border-color .25s,color .25s!important}
button,input,select,textarea{font:inherit;color:inherit}
:where(a){color:var(--ui-accent-text);text-decoration:none}
:where(a):hover{text-decoration:underline}
:where(h1,h2,h3,h4,h5,h6){margin:0 0 .5em;font-weight:700;line-height:1.3;color:var(--ui-text)}
:where(p){margin:0 0 .75em}
hr{border:0;border-top:1px solid var(--ui-line-soft);margin:14px 0}
img{max-width:100%}
::selection{background:var(--ui-accent-soft);color:var(--ui-text)}
:focus-visible{outline:2px solid var(--ui-accent);outline-offset:2px}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:var(--ui-line);border-radius:10px;border:2px solid transparent;background-clip:padding-box}
::-webkit-scrollbar-thumb:hover{background-color:var(--ui-line-strong)}
::-webkit-scrollbar-track{background:transparent}
[dir=rtl] .flip{transform:scaleX(-1)}
svg.i{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
[hidden]{display:none!important}

/* ================================ 6. Shell ================================ */
/* Header: brand · navigation · actions — one row, 60px. */
.hdr{height:60px;flex:none;display:flex;align-items:center;gap:12px;padding:0 14px;background:var(--ui-nav);border-bottom:1px solid var(--ui-line-soft);position:relative;z-index:10000}
.hdr .brand{display:flex;align-items:center;gap:10px;padding:0 4px;flex:none;color:var(--ui-text);text-decoration:none!important}
.hdr .brand .logo{width:38px;height:38px;border-radius:11px;background:var(--ui-surface-3);display:grid;place-items:center;flex:none}
html:not(.dark-theme) .hdr .brand .logo{background:transparent}
/* Logo left, wordmark right in both languages: a reading-order choice, so the
   row is reversed under RTL to cancel the mirroring. */
[dir=rtl] .hdr .brand{flex-direction:row-reverse}
.hdr .brand .logo img{width:28px;height:28px;object-fit:contain;display:block}
.hdr .brand b{display:block;font-size:16px;font-weight:800;letter-spacing:1px;line-height:1.2}
.hdr .brand small{display:block;font-size:10.5px;color:var(--ui-muted);max-width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hdr .nav{flex:1;min-width:0;height:100%;display:flex;align-items:center;gap:2px;padding-inline-start:8px;border-inline-start:1px solid var(--ui-line-soft)}
.hdr .nav-grp{position:relative;flex:none}
.hdr .hdr-btn{height:36px;flex:none;border:0;background:transparent;color:var(--ui-text-2);border-radius:9px;padding:0 10px;display:flex;align-items:center;gap:5px;font-size:13.5px;font-weight:600;white-space:nowrap;cursor:pointer;text-decoration:none!important;transition:background .12s,color .12s}
.hdr .hdr-btn .chev{width:14px;height:14px;opacity:.55;transition:transform .15s}
.hdr .hdr-btn:hover,.hdr .hdr-btn.pop-open{background:var(--ui-surface-3);color:var(--ui-text)}
.hdr .hdr-btn.pop-open .chev{transform:rotate(180deg)}
.hdr .hdr-btn.is-active,.hdr .nav-grp.is-active>.hdr-btn{background:var(--ui-accent-soft);color:var(--ui-accent-text)}
.hdr-actions{display:flex;align-items:center;gap:8px;flex:none}
:is(.hdr,.tn-drawer) .icon-btn{width:38px;height:38px;border-radius:11px;border:1px solid var(--ui-line);background:var(--ui-field);color:var(--ui-text-2);display:grid;place-items:center;cursor:pointer;position:relative;text-decoration:none!important;transition:border-color .12s,color .12s}
:is(.hdr,.tn-drawer) .icon-btn:hover,:is(.hdr,.tn-drawer) .icon-btn.pop-open{border-color:var(--ui-accent);color:var(--ui-accent-text)}
:is(.hdr,.tn-drawer) .icon-btn i{font-size:15px}
.dot-badge{position:absolute;top:-6px;inset-inline-end:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:var(--ui-red);color:#fff;font-size:10.5px;font-weight:800;display:grid;place-items:center;border:2px solid var(--ui-nav);direction:ltr}
.acct{height:40px;display:flex;align-items:center;gap:9px;padding:0 10px 0 4px;border-radius:12px;border:1px solid var(--ui-line);background:var(--ui-field);cursor:pointer;color:var(--ui-text);transition:border-color .12s}
[dir=rtl] .acct{padding:0 4px 0 10px}
.acct:hover,.acct.pop-open{border-color:var(--ui-accent)}
.acct .chev{width:15px;height:15px;color:var(--ui-muted);transition:transform .15s}
.acct.pop-open .chev{transform:rotate(180deg)}
.hdr .avatar{width:32px;height:32px;border-radius:9px;background:var(--ui-accent-soft);color:var(--ui-accent-text);display:grid;place-items:center;font-weight:800;font-size:12.5px;border:1px solid var(--ui-accent-line);flex:none}
.acct-txt{text-align:start;line-height:1.25}
.acct-txt b{display:block;font-size:13px;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acct-txt small{display:block;font-size:11px;color:var(--ui-muted)}
.hdr .menu-btn{display:none}

/* Owner, 2026-10-30: in the light theme the header is a dark slate band, so it
   stands apart from the white forms and panels under it. Only the bar's own
   parts are recoloured: the dropdowns (.pop) live inside .hdr and stay light,
   which is why the theme variables are not redefined on .hdr itself. */
html:not(.dark-theme):not([data-theme=dark]) .hdr{--hdr-bg:#1f2d40;--hdr-ink:#dbe3ee;--hdr-ink-strong:#fff;--hdr-muted:#9fb0c5;--hdr-line:rgba(255,255,255,.13);--hdr-tint:rgba(255,255,255,.07);--hdr-hover:rgba(255,255,255,.11);background:var(--hdr-bg);border-bottom-color:#16202e;box-shadow:0 2px 10px rgba(15,23,42,.18)}
html:not(.dark-theme):not([data-theme=dark]) .hdr>.brand{color:var(--hdr-ink-strong)}
html:not(.dark-theme):not([data-theme=dark]) .hdr>.brand small{color:var(--hdr-muted)}
html:not(.dark-theme):not([data-theme=dark]) .hdr .brand .logo{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25)}
html:not(.dark-theme):not([data-theme=dark]) .hdr>.nav{border-inline-start-color:var(--hdr-line)}
html:not(.dark-theme):not([data-theme=dark]) .hdr .hdr-btn{color:var(--hdr-ink)}
html:not(.dark-theme):not([data-theme=dark]) .hdr .hdr-btn:hover,html:not(.dark-theme):not([data-theme=dark]) .hdr .hdr-btn.pop-open{background:var(--hdr-hover);color:var(--hdr-ink-strong)}
html:not(.dark-theme):not([data-theme=dark]) .hdr .hdr-btn.is-active,html:not(.dark-theme):not([data-theme=dark]) .hdr .nav-grp.is-active>.hdr-btn{background:rgba(245,144,26,.20);color:#ffb35c}
html:not(.dark-theme):not([data-theme=dark]) :is(.hdr>.menu-btn,.hdr-actions>.icon-btn,.hdr-actions>.nav-grp>.icon-btn,.hdr-actions>.nav-grp>.acct){background:var(--hdr-tint);border-color:var(--hdr-line);color:var(--hdr-ink)}
html:not(.dark-theme):not([data-theme=dark]) :is(.hdr>.menu-btn,.hdr-actions>.icon-btn,.hdr-actions>.nav-grp>.icon-btn,.hdr-actions>.nav-grp>.acct):is(:hover,.pop-open){border-color:var(--ui-accent);color:var(--hdr-ink-strong)}
html:not(.dark-theme):not([data-theme=dark]) .hdr-actions>.nav-grp>.acct :is(.acct-txt small,.chev){color:var(--hdr-muted)}
html:not(.dark-theme):not([data-theme=dark]) .hdr .dot-badge{border-color:var(--hdr-bg)}

/* Popovers: nav groups, bell, account. Fixed so the header never clips them;
   assets/js/app.js places each below its trigger, or above when that is roomier. */
.pop{position:fixed;z-index:300;max-width:calc(100vw - 16px);background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:12px;box-shadow:var(--ui-shadow-pop);display:flex;flex-direction:column;overflow:hidden;opacity:0;transform:translateY(-4px);transition:opacity .12s,transform .12s}
.pop[data-side=top]{transform:translateY(4px)}
.pop.in{opacity:1;transform:none}
.pop-list{overflow:auto;padding:5px;flex:1;min-height:0}
.pop-grid{display:grid;grid-template-columns:repeat(var(--cols,1),minmax(min(220px,calc(100vw - 40px)),1fr));gap:1px 4px;padding:5px;overflow:auto}
.mi{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;font-size:13.5px;cursor:pointer;color:var(--ui-text-2);user-select:none;text-decoration:none!important;min-width:0}
button.mi{width:100%;border:0;background:none;text-align:start;font:inherit}
.mi:hover,.mi:focus-visible,.mi.act{background:var(--ui-surface-3);color:var(--ui-text);outline:none}
.mi.is-active,.mi.on{color:var(--ui-accent-text);background:var(--ui-accent-soft)}
.mi .tn-ico,.mi>i,.mi>svg{width:18px;flex:none;text-align:center;color:var(--ui-accent);font-size:14px}
.mi .tn-txt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mi.danger,.mi.danger i{color:var(--ui-red)}
.mi-head{font-size:11px;font-weight:700;color:var(--ui-faint);padding:9px 10px 4px;letter-spacing:.3px;grid-column:1/-1}
.mi-sep{height:1px;background:var(--ui-line-soft);margin:5px 4px}
.tn-badge{margin-inline-start:auto;min-width:20px;height:20px;padding:0 6px;border-radius:10px;font-size:10.5px;font-weight:800;display:inline-grid;place-items:center;background:var(--ui-surface-3);color:var(--ui-muted);direction:ltr}
.tn-badge.is-count{background:var(--ui-red);color:#fff}
.mi-count{margin-inline-start:auto;font-weight:800;font-size:12px;color:var(--ui-muted);direction:ltr}
.mi-count.hot{color:var(--ui-red)}
.pop-empty{padding:20px 12px;text-align:center;color:var(--ui-faint);font-size:13px}
/* account menu */
.acct-pop{padding:6px}
.acct-user{display:flex;align-items:center;gap:11px;padding:10px 10px 12px;border-bottom:1px solid var(--ui-line-soft);margin-bottom:6px}
.acct-user .avatar{width:42px;height:42px;font-size:15px;border-radius:12px}
.acct-user b{display:block;font-size:14px}
.acct-user small{color:var(--ui-muted);font-size:12px}
.acct-sec{padding:6px 8px 10px}
.acct-lbl{font-size:11.5px;font-weight:700;color:var(--ui-faint);margin-bottom:7px;display:flex;align-items:center;gap:6px}
.acct-lbl i{font-size:12px}

/* Segmented control (account menu, filters) */
.segr{display:flex;background:var(--ui-field);border:1px solid var(--ui-line);border-radius:var(--ui-r);padding:3px;gap:3px}
.segr>a,.segr>label,.segr>button{flex:1;position:relative;min-height:30px;display:flex;align-items:center;justify-content:center;gap:6px;border-radius:7px;cursor:pointer;color:var(--ui-muted);font-weight:650;font-size:12.5px;padding:0 8px;border:0;background:none;white-space:nowrap;text-decoration:none!important;transition:background .12s,color .12s}
.segr>a:hover,.segr>label:hover,.segr>button:hover{color:var(--ui-text)}
.segr input{position:absolute;opacity:0;pointer-events:none}
.segr>.on,.segr>label:has(input:checked){background:var(--ui-accent);color:var(--ui-accent-ink)}
/* Sized to its options instead of the full row: a page's switch between views
   (report types, pay-plan steps). Active option: .on (or a checked input). */
.segr.segr-fit{display:inline-flex;max-width:100%;overflow-x:auto;scrollbar-width:none}
.segr.segr-fit>a,.segr.segr-fit>label,.segr.segr-fit>button{flex:0 0 auto;padding:0 12px}
.segr>.on>i,.segr>a>i,.segr>button>i{font-size:12px}

/* Drawer (mobile navigation) */
.tn-drawer-backdrop{position:fixed;inset:0;background:var(--ui-overlay);z-index:150}
.tn-drawer{position:fixed;top:0;bottom:0;inset-inline-start:0;width:min(330px,88%);background:var(--ui-surface);border-inline-end:1px solid var(--ui-line);z-index:160;display:flex;flex-direction:column;box-shadow:var(--ui-shadow-pop)}
.tn-drawer-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid var(--ui-line-soft);font-weight:800;font-size:15px}
.tn-drawer-body{flex:1;overflow:auto;padding:8px}
.tn-drawer-link{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:8px;color:var(--ui-text-2);text-decoration:none!important;font-size:13.5px}
.tn-drawer-link:hover{background:var(--ui-surface-2)}
.tn-drawer-link.is-active{color:var(--ui-accent-text);background:var(--ui-accent-soft)}
.tn-drawer-link .tn-ico{width:18px;text-align:center;color:var(--ui-accent)}
.tn-drawer-trigger{width:100%;display:flex;align-items:center;gap:10px;height:42px;border:0;background:none;border-radius:9px;padding:0 10px;font-weight:650;cursor:pointer;color:var(--ui-text-2)}
.tn-drawer-trigger:hover{background:var(--ui-surface-2)}
.tn-drawer-trigger .tn-txt{flex:1;text-align:start}
.tn-drawer-trigger .tn-ico{width:18px;color:var(--ui-faint)}
.tn-drawer-trigger .tn-caret{transition:transform .15s;color:var(--ui-faint);font-size:11px}
.tn-drawer-group.is-open .tn-caret{transform:rotate(180deg)}
.tn-drawer-items{display:none;padding:2px 0 6px;padding-inline-start:12px}
.tn-drawer-group.is-open .tn-drawer-items{display:block}
.tn-drawer-group.is-open>.tn-drawer-trigger{color:var(--ui-accent-text)}
.tn-drawer-foot{border-top:1px solid var(--ui-line-soft);padding:12px;display:flex;flex-direction:column;gap:10px}

/* App frame. Every page is full screen: header on top, the content area takes
   the rest and owns the scroll. */
.desktop-app{flex:1;min-height:0;display:flex;flex-direction:column}
.app-layout{flex:1;min-height:0;display:flex}
.main-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}
.content-area{flex:1;min-height:0;overflow:auto;padding:14px;position:relative}
.content-area.content-area-pos{overflow:hidden;padding:0}
.page-container,.container,.container-fluid,.container-xxl,.container-xl,.container-lg{width:100%;max-width:none!important}
/* Chrome from the previous shells; a page that still prints one gets nothing. */
.mobile-header,.status-bar,.app-toolbar,.window-titlebar{display:none!important}
body.embedded-page .content-area{padding:12px 14px}
body.pos-layout .desktop-app{height:100vh}

/* Page heading row: title + actions (used by most list pages). */
.page-header{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin-bottom:14px}
.page-breadcrumb{font-size:12px;color:var(--ui-faint);display:flex;gap:6px;width:100%}
.page-title{margin:0;font-weight:800;color:var(--ui-text)}
.page-subtitle{margin:0;color:var(--ui-muted)}
.page-title-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:10px 14px;margin-bottom:12px}
.page-title-bar h1,.page-title-bar h2{margin:0;display:flex;align-items:center;gap:8px;font-weight:800}
.page-actions,.header-actions,.panel-actions,.toolbar-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
/* No title band inside pages — the app header already says where you are.
   A page's own header keeps only its actions, as one quiet row. Pages render
   .page-actions-bar directly; older pages get .ui-slim-bar from app.js, which
   strips their title and decoration (hence the !important over page styles). */
.page-actions-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;margin:0 0 12px}
.ui-slim-bar{display:flex!important;flex-wrap:wrap;align-items:center!important;justify-content:center!important;gap:8px;margin:0 0 12px!important;padding:0!important;min-height:0!important;background:none!important;border:0!important;box-shadow:none!important;color:var(--ui-text)!important;position:static!important}
.ui-slim-bar::before,.ui-slim-bar::after,.ui-slim-hide{display:none!important}
/* --- Page action buttons: ONE shared look (owner, 2026-10-30: "the buttons'
   design must be shared, not made up per page"). Used by the page header row
   (app.js marks it .ui-slim-bar) and by any .ui-actions row - a page writes
   markup only, never button CSS:
     <div class="ui-actions [ui-actions-sm]">
       <a class="btn btn-primary"><i class="fas fa-plus"></i> <span>New</span></a>   main action, filled
       <a class="btn tone-blue"><i class="fas fa-truck"></i> <span>Driver</span></a>  white, icon in a blue chip
       <span class="ui-actions-sep"></span>                                          thin divider
       <a class="btn btn-icon tone-green" title="Excel"><i class="fas fa-file-excel"></i></a>  tinted square, icon only
     </div>
   Tones: tone-blue, tone-green, tone-red, tone-amber, tone-violet, tone-accent
   (the bootstrap variants btn-success/-danger/-info/-warning map onto them).
   `.btn.btn-primary` because `.ui-slim-bar a.btn` outranked the old
   `.ui-slim-bar .btn-primary` and greyed every primary link. --- */
.tone-blue{--tone-soft:var(--ui-blue-soft);--tone-ink:var(--ui-blue);--tone-line:var(--ui-blue-line)}
.tone-green{--tone-soft:var(--ui-green-soft);--tone-ink:var(--ui-green);--tone-line:var(--ui-green-line)}
.tone-red{--tone-soft:var(--ui-red-soft);--tone-ink:var(--ui-red);--tone-line:var(--ui-red-line)}
.tone-amber{--tone-soft:var(--ui-amber-soft);--tone-ink:var(--ui-amber);--tone-line:var(--ui-amber-line)}
.tone-violet{--tone-soft:var(--ui-violet-soft);--tone-ink:var(--ui-violet);--tone-line:var(--ui-violet)}
.tone-accent{--tone-soft:var(--ui-accent-soft);--tone-ink:var(--ui-accent-text);--tone-line:var(--ui-accent-line)}
.ui-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.ui-slim-bar :is(.actions,.header-actions,.page-actions,.page-actions-bar){display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px}
:is(.ui-slim-bar,.ui-actions) .btn,.ui-slim-bar a.btn,.ui-slim-bar button:not(.btn-primary):not(.primary){background:var(--ui-surface)!important;border:1px solid var(--ui-line)!important;color:var(--ui-text)!important;box-shadow:0 1px 2px rgba(16,24,40,.06)!important}
:is(.ui-slim-bar,.ui-actions) .btn{height:34px;min-height:34px;padding:0 12px;gap:8px;border-radius:10px;font-size:12.5px;font-weight:700;line-height:1;white-space:nowrap;text-decoration:none!important;display:inline-flex;align-items:center;justify-content:center;transition:transform .15s,box-shadow .15s,border-color .15s,background-color .15s}
:is(.ui-slim-bar,.ui-actions) .btn>i:first-child{width:22px;height:22px;display:inline-grid;place-items:center;flex:none;margin:0;border-radius:7px;background:var(--tone-soft,var(--ui-surface-3));color:var(--tone-ink,var(--ui-text-2));font-size:12px}
:is(.ui-slim-bar,.ui-actions) .btn:hover{transform:translateY(-1px);border-color:var(--tone-line,var(--ui-line-strong))!important;box-shadow:0 6px 14px rgba(16,24,40,.10)!important}
:is(.ui-slim-bar,.ui-actions) .btn:is(.btn-success,.btn-outline-success){--tone-soft:var(--ui-green-soft);--tone-ink:var(--ui-green);--tone-line:var(--ui-green-line)}
:is(.ui-slim-bar,.ui-actions) .btn:is(.btn-danger,.btn-outline-danger){--tone-soft:var(--ui-red-soft);--tone-ink:var(--ui-red);--tone-line:var(--ui-red-line)}
:is(.ui-slim-bar,.ui-actions) .btn:is(.btn-info,.btn-outline-info,.btn-outline-primary){--tone-soft:var(--ui-blue-soft);--tone-ink:var(--ui-blue);--tone-line:var(--ui-blue-line)}
:is(.ui-slim-bar,.ui-actions) .btn:is(.btn-warning,.btn-outline-warning){--tone-soft:var(--ui-amber-soft);--tone-ink:var(--ui-amber);--tone-line:var(--ui-amber-line)}
/* The main action: filled in the accent. */
:is(.ui-slim-bar,.ui-actions) .btn.btn-primary,:is(.ui-slim-bar,.ui-actions) .btn.primary,.ui-slim-bar .primary{--tone-soft:rgba(255,255,255,.38);--tone-ink:var(--ui-accent-ink);background:var(--ui-accent)!important;border-color:var(--ui-accent)!important;color:var(--ui-accent-ink)!important;box-shadow:0 2px 6px rgba(242,140,26,.30)!important}
:is(.ui-slim-bar,.ui-actions) .btn.btn-primary:hover,:is(.ui-slim-bar,.ui-actions) .btn.primary:hover{--tone-ink:#fff;background:var(--ui-accent-strong)!important;border-color:var(--ui-accent-strong)!important;color:#fff!important}
/* Icon only: a square tinted in its tone (the name in title/aria-label). The
   doubled class outranks `.ui-slim-bar button:not(.btn-primary)`, which paints
   every <button> of the header white. */
:is(.ui-slim-bar,.ui-actions) .btn.btn-icon.btn-icon{width:34px;min-width:34px;padding:0;gap:0;background:var(--tone-soft,var(--ui-surface-3))!important;border-color:transparent!important;color:var(--tone-ink,var(--ui-text-2))!important;box-shadow:none!important}
:is(.ui-slim-bar,.ui-actions) .btn.btn-icon>i:first-child{width:auto;height:auto;background:none;color:inherit;font-size:15px}
:is(.ui-slim-bar,.ui-actions) .btn.btn-icon>span{display:none}
/* A compact row (e.g. at the end of a .ui-tabs menu). */
.ui-actions-sm{gap:6px}
.ui-actions.ui-actions-sm .btn{height:30px;min-height:30px;padding:0 10px;gap:6px;border-radius:8px;font-size:12px;box-shadow:none!important}
.ui-actions.ui-actions-sm .btn>i:first-child{width:20px;height:20px;border-radius:6px;font-size:11px}
.ui-actions.ui-actions-sm .btn.btn-icon{width:30px;min-width:30px;padding:0}
.ui-actions.ui-actions-sm .btn.btn-icon>i:first-child{font-size:13px}
.ui-actions-center{justify-content:center}
.ui-actions-sep{width:1px;height:22px;margin:0 4px;flex:none;background:var(--ui-line)}
.ui-actions-sm .ui-actions-sep{height:18px;margin:0 2px}

/* ============================= 7. Components ============================== */
/* --- Buttons. One shape for every button in the app; old per-page class
       names (action-btn, rpt-btn, win11-btn, …) share it. --- */
.btn,.win11-btn,.action-btn,.rpt-btn,.ws-btn,.sp-btn,.ap-btn,.toolbar-btn,.btn-export{height:var(--ui-h);padding:0 14px;border-radius:var(--ui-r);border:1px solid var(--ui-line);background:var(--ui-surface-2);color:var(--ui-text);display:inline-flex;align-items:center;justify-content:center;gap:7px;font-weight:650;font-size:13px;line-height:1;cursor:pointer;white-space:nowrap;text-decoration:none!important;vertical-align:middle;user-select:none;transition:background .12s,border-color .12s,color .12s,transform .06s}
.btn:hover,.win11-btn:hover,.action-btn:hover,.rpt-btn:hover,.ws-btn:hover,.sp-btn:hover,.ap-btn:hover,.toolbar-btn:hover,.btn-export:hover{border-color:var(--ui-accent);color:var(--ui-accent-text)}
.btn:active:not(:disabled){transform:translateY(1px)}
.btn i,.btn svg{font-size:14px}
.btn svg{width:16px;height:16px}
.btn-primary,.win11-btn.primary,.action-btn.primary,.sp-btn.primary,.ap-btn.primary,.btn.primary{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-accent-ink)}
.btn-primary:hover,.win11-btn.primary:hover,.action-btn.primary:hover,.sp-btn.primary:hover,.ap-btn.primary:hover,.btn.primary:hover{background:var(--ui-accent-strong);border-color:var(--ui-accent-strong);color:#fff}
.btn-secondary,.btn-light,.btn-outline-secondary,.btn-default,.btn-outline{background:var(--ui-surface-2);border-color:var(--ui-line);color:var(--ui-text)}
.btn-ghost,.btn-link,.btn.ghost{background:transparent;border-color:transparent;color:var(--ui-muted)}
.btn-ghost:hover,.btn-link:hover,.btn.ghost:hover{background:var(--ui-surface-3);border-color:transparent;color:var(--ui-text)}
.btn-success,.btn.success,.action-btn.success{background:var(--ui-green-soft);border-color:var(--ui-green-line);color:var(--ui-green)}
.btn-success:hover,.btn.success:hover,.action-btn.success:hover{background:var(--ui-green);border-color:var(--ui-green);color:#fff}
.btn-danger,.btn.danger,.action-btn.danger,.win11-btn.danger{background:var(--ui-red-soft);border-color:var(--ui-red-line);color:var(--ui-red)}
.btn-danger:hover,.btn.danger:hover,.action-btn.danger:hover,.win11-btn.danger:hover{background:var(--ui-red);border-color:var(--ui-red);color:#fff}
.btn-warning,.btn.warning{background:var(--ui-amber-soft);border-color:var(--ui-amber-line);color:var(--ui-amber)}
.btn-warning:hover,.btn.warning:hover{background:var(--ui-amber);border-color:var(--ui-amber);color:#fff}
.btn-info,.btn.info{background:var(--ui-blue-soft);border-color:var(--ui-blue-line);color:var(--ui-blue)}
.btn-info:hover,.btn.info:hover{background:var(--ui-blue);border-color:var(--ui-blue);color:#fff}
.btn-outline-primary{background:transparent;border-color:var(--ui-accent);color:var(--ui-accent-text)}
.btn-outline-primary:hover{background:var(--ui-accent);color:var(--ui-accent-ink)}
.btn-outline-danger{background:transparent;border-color:var(--ui-red-line);color:var(--ui-red)}
.btn-outline-danger:hover{background:var(--ui-red);border-color:var(--ui-red);color:#fff}
.btn-outline-success{background:transparent;border-color:var(--ui-green-line);color:var(--ui-green)}
.btn-outline-success:hover{background:var(--ui-green);border-color:var(--ui-green);color:#fff}
.btn-sm,.btn.sm{height:var(--ui-h-sm);padding:0 10px;font-size:12.5px;border-radius:8px}
.btn-xs{height:26px;padding:0 8px;font-size:12px;border-radius:7px}
.btn-lg{height:46px;padding:0 20px;font-size:15px}
.btn-icon{width:var(--ui-h);padding:0}
.btn-sm.btn-icon{width:var(--ui-h-sm)}
.btn-block,.w-100.btn{width:100%}
.btn:disabled,.btn.disabled,.btn[aria-disabled=true]{opacity:.45;cursor:not-allowed;pointer-events:none}
.btn-group{display:inline-flex;gap:6px;flex-wrap:wrap}

/* --- Row buttons: the small soft squares in a table row's actions cell, one
   look on every list (owner, 2026-10-30). The kind (view, edit, delete, ...)
   or a tone class picks the colour; the name goes in title/aria-label.
     <div class="action-btns"><a class="action-btn view" title="View"><i class="fas fa-eye"></i></a> ...</div> --- */
.action-btns{display:flex;flex-wrap:nowrap;align-items:center;gap:4px}
.action-btn{--tone-soft:var(--ui-surface-3);--tone-ink:var(--ui-text-2);width:27px;min-width:27px;height:27px;padding:0;gap:0;border:0;border-radius:7px;background:var(--tone-soft);color:var(--tone-ink);display:inline-flex;align-items:center;justify-content:center;font-size:13px;line-height:1;cursor:pointer;text-decoration:none!important;transition:transform .15s,filter .15s}
.action-btn:hover{transform:translateY(-1px);filter:brightness(.96);border:0;color:var(--tone-ink)}
.action-btn>i{margin:0}
.action-btn:is(.view,.assign,.settlement,.info,.copy){--tone-soft:var(--ui-blue-soft);--tone-ink:var(--ui-blue)}
.action-btn:is(.approve,.start,.success){--tone-soft:var(--ui-green-soft);--tone-ink:var(--ui-green)}
.action-btn:is(.edit,.modify,.return,.warning){--tone-soft:var(--ui-amber-soft);--tone-ink:var(--ui-amber)}
.action-btn:is(.delete,.reject,.cancel,.cancel-action,.danger){--tone-soft:var(--ui-red-soft);--tone-ink:var(--ui-red)}
.action-btn:is(.print,.statement,.opening){--tone-soft:var(--ui-violet-soft);--tone-ink:var(--ui-violet)}
.action-btn.more{background:var(--ui-surface-3);box-shadow:inset 0 0 0 1px var(--ui-line-strong)}
.action-btn.more:hover{--tone-ink:var(--ui-accent-text);background:var(--ui-accent-soft);box-shadow:inset 0 0 0 1px var(--ui-accent)}
.action-btn:is(.disabled,:disabled){opacity:.45;cursor:not-allowed;transform:none;filter:none}

/* --- Tabs: moving between the pages of one module (owner, 2026-10-30; the
   bar look 2026-10-31: "a beautiful tab design, shared"). One white bar: each
   tab is an icon and a name, never a button shape; the page you are on is in
   the accent with a soft glow and a rounded line under it; groups of tabs are
   split by a thin line (.ui-tabs-sep); the page's own buttons sit at the far
   end (.ui-tabs-end, usually a .ui-actions-sm). Inside a card the bar is flat.
     <nav class="ui-tabs"><a class="ui-tab active"><i ...></i> <span class="ui-tab-label">Orders</span> <span class="ui-tab-badge">3</span></a>
       <span class="ui-tabs-sep"></span> ...
       <div class="ui-tabs-end ui-actions ui-actions-sm">...</div></nav> --- */
.ui-tabs{position:relative;min-width:0;display:flex;flex-wrap:wrap;align-items:stretch;gap:0 2px;margin:0 0 12px;padding:0 8px;background:var(--ui-surface);border:1px solid var(--ui-line-soft);border-radius:14px;box-shadow:0 1px 2px rgba(16,24,40,.05)}
.ui-tab{position:relative;display:inline-flex;align-items:center;gap:8px;height:48px;padding:0 14px;flex:none;border:0;border-radius:0;background:none;color:var(--ui-muted);font-size:13px;font-weight:700;line-height:1;white-space:nowrap;text-decoration:none!important;transition:color .15s,background-color .15s}
.ui-tab>i{margin:0;font-size:14px;color:var(--ui-faint);transition:color .15s}
/* The line under a tab: faint on hover, the accent on the open one. */
.ui-tab::after{content:"";position:absolute;inset-inline:10px;bottom:-1px;height:3px;border-radius:3px 3px 0 0;background:transparent;transition:background-color .15s}
.ui-tab:hover{color:var(--ui-text)}
.ui-tab:hover>i{color:var(--ui-text-2)}
.ui-tab:hover::after{background:var(--ui-line-strong)}
.ui-tab:focus-visible{outline:2px solid var(--ui-accent);outline-offset:-6px;border-radius:12px}
.ui-tab.active{color:var(--ui-accent-text);background:linear-gradient(to top,var(--ui-accent-soft),transparent 80%)}
.ui-tab.active>i{color:var(--ui-accent)}
.ui-tab.active::after{background:var(--ui-accent)}
.ui-tab.disabled,.ui-tab.disabled:hover{color:var(--ui-faint);background:none;cursor:not-allowed;opacity:.6}
.ui-tab.disabled::after{background:transparent}
.ui-tab-badge{display:inline-flex;align-items:center;justify-content:center;min-width:17px;height:17px;padding:0 5px;border-radius:999px;background:var(--ui-red);color:#fff;font-size:10px;font-weight:800;line-height:1}
.ui-tab-badge.is-empty{background:var(--ui-surface-3);color:var(--ui-muted)}
.ui-tabs-end{align-self:center;margin-inline-start:auto;padding:6px 0}
/* A thin line between groups of tabs (e.g. people | results | rules). */
.ui-tabs-sep{align-self:center;flex:none;width:1px;height:20px;margin:0 8px;background:var(--ui-line)}
/* Tabs inside a card (a record's sections): the card is the frame, so the bar is flat. */
:is(.pe-card,.panel,.card,.modal-box)>.ui-tabs{margin:0;background:none;border:0;border-bottom:1px solid var(--ui-line-soft);border-radius:0;box-shadow:none}
:is(.pe-card,.panel,.card,.modal-box)>.ui-tabs .ui-tab{height:44px}
/* Too narrow for the names: icon tabs (the name stays in the tooltip). */
@media (max-width:1200px){.ui-tab-label{display:none}.ui-tab{padding:0 12px}.ui-tab>i{font-size:15px}.ui-tab-badge{position:absolute;top:5px;inset-inline-end:1px;min-width:16px;height:16px;padding:0 4px}}
/* The badge floats over the icon only where the label was folded away; a tab
   that keeps its words keeps the badge beside them. */
@media (max-width:1200px){.ui-tab:not(:has(.ui-tab-label)) .ui-tab-badge{position:static}}
/* Panels under the bar (app.js "Tab panels", 2026-11-13): the module's other
   pages open in frames that stay mounted below the bar, so moving between them
   never reloads the page you were on. The page's own content (.ui-panel-off)
   hides while another panel is open. A page shown inside a panel
   (body.in-ui-panel) drops its own tabs and keeps only its end actions. */
/* Doubled: a strip that is display:flex!important itself (.ui-stats) must still hide. */
.ui-panel-off.ui-panel-off{display:none!important}
.ui-panel-remote{display:block;flex:1 1 auto;min-height:360px;margin:0 0 12px;overflow:hidden;background:var(--ui-surface);border:1px solid var(--ui-line-soft);border-radius:14px;box-shadow:0 1px 2px rgba(16,24,40,.05)}
.ui-panel-remote[hidden]{display:none!important}
.ui-panel-frame{display:block;width:100%;height:100%;border:0;background:transparent}
.ui-tabs-end a[data-panel][aria-current=true]{background:var(--ui-accent-soft)!important;color:var(--ui-accent-text)!important;box-shadow:inset 0 0 0 2px var(--ui-accent)!important}
.ui-tabs.ui-panels-away .ui-tabs-end :is(a,button,.ui-actions-sep):not([data-panel]){display:none}
.ui-tab-x{display:inline-grid;place-items:center;width:18px;height:18px;margin-inline-start:2px;padding:0;border:0;border-radius:50%;background:none;color:var(--ui-faint);font:inherit;font-size:15px;line-height:1;cursor:pointer}
.ui-tab-x:hover{background:var(--ui-red-soft);color:var(--ui-red)}
body.in-ui-panel .ui-tabs[data-ui-panels]>.ui-tab{display:none}
body.in-ui-panel .ui-tabs[data-ui-panels]:not(:has(.ui-tabs-end)){display:none}

/* --- Fields --- */
.form-group,.win11-form-group,.field{display:flex;flex-direction:column;min-width:0;margin-bottom:12px}
.form-label,.win11-label,label.label,.filter-group>label{font-size:12px;font-weight:650;color:var(--ui-muted);margin-bottom:6px;display:block}
.form-label .required,.form-label .req,.required-star,.req{color:var(--ui-red)}
/* Classed fields get the full shape. Bare elements get the same look through
   :where() — zero specificity — so a page class sizing its own compact inputs
   (POS line cells, inline grid editors) always wins. */
.form-control,.form-input,.form-select,.filter-select,.win11-input,.form-textarea,.ap-input{min-height:var(--ui-h);width:100%}
.form-control,.form-input,.form-select,.filter-select,.win11-input,.form-textarea,.ap-input,
:where(input[type=text],input[type=number],input[type=email],input[type=password],input[type=search],input[type=tel],input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=url],input:not([type]),select,textarea){height:var(--ui-h);background-color:var(--ui-field);border:1px solid var(--ui-line);border-radius:var(--ui-r);padding:0 12px;color:var(--ui-text);outline:none;transition:border-color .15s,box-shadow .15s;max-width:100%}
textarea.form-control,textarea.form-input,.form-textarea,:where(textarea){height:auto;padding:9px 12px;min-height:76px;line-height:1.55;resize:vertical}
.form-select,.filter-select,:where(select){padding-inline-end:30px;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c939c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:15px;background-position:right 10px center}
[dir=rtl] :where(select),[dir=rtl] .form-select,[dir=rtl] .filter-select{background-position:left 10px center}
:where(select[multiple],select[size]){background-image:none;padding:6px;height:auto}
.form-control:hover,.form-input:hover,.form-select:hover,:where(input,select,textarea):hover{border-color:var(--ui-line-strong)}
.form-control:focus,.form-input:focus,.form-select:focus,.filter-select:focus,.ap-input:focus,:where(input,select,textarea):focus{border-color:var(--ui-accent);box-shadow:0 0 0 3px var(--ui-ring)}
::placeholder{color:var(--ui-faint)}
.form-control[readonly],:where(input[readonly]){background-color:var(--ui-surface-2);color:var(--ui-muted);border-style:dashed}
input:disabled,select:disabled,textarea:disabled{opacity:.6;cursor:not-allowed}
.form-control.error,.is-invalid,input.error{border-color:var(--ui-red)!important;box-shadow:0 0 0 3px rgba(210,72,60,.14)!important}
.form-error,.invalid-feedback,.ferr{font-size:11.5px;color:var(--ui-red);margin-top:5px}
.form-hint,.field-hint,.form-text{font-size:11.5px;color:var(--ui-faint);margin-top:5px}
input[type=number]{direction:ltr}
[dir=rtl] input[type=number]{text-align:end}
input[type=checkbox],input[type=radio]{accent-color:var(--ui-accent);width:16px;height:16px;min-height:0;vertical-align:middle;cursor:pointer}
.form-check,.checkbox-item,.check{display:flex;align-items:center;gap:8px;cursor:pointer;padding:4px 0}
.form-row{display:flex;flex-wrap:wrap;gap:12px}
.form-row>*{flex:1 1 180px}
.form-grid,.fgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(200px,100%),1fr));gap:12px 14px}
.form-grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.form-grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.form-grid .full,.form-grid .span-all{grid-column:1/-1}
.input-group{display:flex;align-items:stretch}
.input-group>.form-control,.input-group>input{flex:1;min-width:0}
.input-group-text{display:flex;align-items:center;padding:0 10px;background:var(--ui-surface-3);border:1px solid var(--ui-line);color:var(--ui-muted);font-size:12px;font-weight:650}
/* Filter bars */
.filter-bar,.filter-row,.filters,.filter-panel,.search-bar,.toolbar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px}
.filter-panel,.filter-bar{background:var(--ui-surface);border:1px solid var(--ui-line-soft);border-radius:var(--ui-r-lg);padding:12px 14px;margin-bottom:14px}
.filter-group{display:flex;flex-direction:column;min-width:150px}
/* Inside a filter row controls size to their content; the search box takes the rest. */
:is(.filter-bar,.filter-panel)>form{flex:1 1 100%;min-width:0}
:is(.filter-row,.filter-bar,.filter-panel,.toolbar,.search-bar)>:is(.form-control,.form-select,.filter-select,select,input:not([type=checkbox]):not([type=radio])){width:auto;flex:0 1 auto;min-width:130px}
:is(.filter-row,.filter-bar,.toolbar,.search-bar)>:is(.search-input,.search-box,[class*="search"]){flex:1 1 220px;min-width:180px}
.date-preset{height:30px;padding:0 10px;border-radius:8px;border:1px solid var(--ui-line);background:var(--ui-surface-2);color:var(--ui-muted);font-size:12px;font-weight:650;cursor:pointer}
.date-preset:hover,.date-preset.active{border-color:var(--ui-accent);color:var(--ui-accent-text);background:var(--ui-accent-soft)}

/* --- Filter bar: one row of labelled pills (owner, 2026-10-30) ---
   <div class="ui-filters">
     <label class="ui-filters-search"><i class="fas fa-magnifying-glass"></i><input type="search"></label>
     <label class="ui-filter" data-default=""><span class="ui-filter-label">Status</span><select>…</select></label>
     <label class="ui-filter ui-filter-flag"><input type="checkbox"> <i …></i> High risk</label>
     <div class="ui-filters-end"><span class="ui-filters-count">…</span><button class="ui-filters-reset">…</button></div>
   </div>
   A pill whose control is not at its data-default value is tinted and gets its own ×
   (assets/js/app.js, "Filter bars"), so the bar needs no separate row of chips. A flag
   pill (a checkbox) shows only while it is on. The reset button shows only when
   something is set. Other pages opt in by using these classes. */
.ui-filters{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px;margin-bottom:8px;background:var(--ui-surface-2);border:1px solid var(--ui-line-soft);border-radius:14px}
.ui-filters-search{position:relative;display:flex;align-items:center;flex:1 1 220px;min-width:180px;max-width:360px;margin:0}
.ui-filters-search>i{position:absolute;inset-inline-start:12px;color:var(--ui-faint);font-size:13px;pointer-events:none}
.ui-filters-search>input{width:100%;height:34px;min-height:0;padding:0 12px;padding-inline-start:34px;border-radius:999px;background:var(--ui-surface);font-size:12.5px}
.ui-filter{position:relative;display:inline-flex;align-items:center;gap:6px;height:34px;margin:0;padding:0 6px;padding-inline-start:12px;border:1px solid var(--ui-line);border-radius:999px;background:var(--ui-surface);color:var(--ui-text);font-size:12.5px;font-weight:700;white-space:nowrap;cursor:pointer;transition:background-color .15s,border-color .15s,box-shadow .15s}
.ui-filter:hover{border-color:var(--ui-line-strong)}
.ui-filter:focus-within{border-color:var(--ui-accent);box-shadow:0 0 0 3px var(--ui-ring)}
.ui-filter-label{display:inline-flex;align-items:center;gap:8px;color:var(--ui-muted);font-size:11.5px;font-weight:600}
.ui-filter-label::after{content:"";width:1px;height:14px;background:var(--ui-line)}
.ui-filter select,.ui-filter input:not([type=checkbox]){width:auto;min-width:0;max-width:210px;height:30px;min-height:0;margin:0;padding:0;padding-inline-end:20px;border:0;border-radius:0;background-color:transparent;box-shadow:none;color:inherit;font:inherit;cursor:pointer}
/* A plain select (data-searchable="0", or before app.js runs) keeps the browser's own list. */
.ui-filter select{background-position:right 2px center;background-size:13px}
[dir=rtl] .ui-filter select{background-position:left 2px center}
.ui-filter input[type=date]{padding-inline-end:2px}
.ui-filter select:focus,.ui-filter input:focus{box-shadow:none;outline:none}
/* A searchable select (assets/js/searchable-select.js) sits in a pill without its own box. */
.ui-filter .ss-wrapper{width:auto;min-width:0;max-width:220px}
.ui-filter .ss-toggle{min-height:0;height:30px;padding:0;gap:6px;border:0;background:transparent;box-shadow:none;color:inherit;font-weight:700}
.ui-filter .ss-wrapper.ss-empty-value .ss-label{color:inherit}
.ui-filter.is-set .ss-caret{display:none}
/* Its list: at least as wide as the longest choice, options in the page's weight. */
.ui-filter .ss-panel{font-size:13px;font-weight:500;white-space:normal;cursor:default}
.ui-filter .ss-option{display:flex;align-items:center;gap:8px;padding:9px 12px;white-space:normal;line-height:1.35}
.ui-filter .ss-option-selected{font-weight:700}
.ui-filter .ss-option-selected::after{content:"";width:6px;height:10px;margin-inline-start:auto;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg) translate(-1px,-1px);flex:none}
/* A short list needs no search box; it stays focusable (off screen) so the keyboard still works. */
.ui-filter .ss-wrapper:not(:has(>select>option:nth-child(8))) .ss-search{position:absolute;width:1px;height:1px;margin:0;padding:0;overflow:hidden;clip-path:inset(50%);border:0}
.ui-filter-x{display:none;place-items:center;flex:none;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:rgba(15,23,42,.08);color:inherit;font-size:15px;line-height:1;cursor:pointer}
.ui-filter-x:hover{background:rgba(15,23,42,.16)}
.ui-filter.is-set{background:var(--ui-accent-soft);border-color:var(--ui-accent-line);color:var(--ui-accent-text)}
.ui-filter.is-set .ui-filter-label{color:inherit;opacity:.75}
.ui-filter.is-set .ui-filter-label::after{background:currentColor;opacity:.35}
.ui-filter.is-set .ui-filter-x{display:inline-grid}
.ui-filter.is-set select{padding-inline-end:4px;background-image:none}
.ui-filter-flag:not(.is-set){display:none}
.ui-filter-flag>input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.ui-filter-flag.is-set{background:var(--ui-red-soft);border-color:var(--ui-red-line);color:var(--ui-red)}
.ui-filters-end{display:inline-flex;align-items:center;gap:6px;margin-inline-start:auto}
.ui-filters-count{padding:0 8px;color:var(--ui-muted);font-size:12px;font-weight:700;white-space:nowrap}
.ui-filters-count b{color:var(--ui-text);font-weight:800}
.ui-filters-reset{display:none;align-items:center;gap:6px;height:34px;padding:0 12px;border:1px dashed var(--ui-line-strong);border-radius:999px;background:transparent;color:var(--ui-muted);font-size:12px;font-weight:700;cursor:pointer}
.ui-filters-reset:hover{border-color:var(--ui-red);color:var(--ui-red);background:var(--ui-red-soft)}
.ui-filters.has-set .ui-filters-reset{display:inline-flex}
html.dark-theme .ui-filter-x{background:rgba(255,255,255,.12)}
@media (max-width:720px){.ui-filters-search{flex-basis:100%;max-width:none}.ui-filters-end{width:100%;margin-inline-start:0;justify-content:space-between}}

/* --- Stats strip: figures in one quiet frame (owner, 2026-10-30) ---
   <div class="stats-grid ui-stats">
     <button class="stat-card active" style="--stat-c:var(--ui-green)"><span class="stat-label">Paid</span><span class="stat-value">12</span></button>
   </div>
   Each figure is split from the next by a thin line; a dot in its colour
   (--stat-c, or a colour class below) names it; .active tints the figure the
   list is filtered by. Icon tiles and the cards' coloured edges are dropped. */
.ui-stats{display:flex!important;flex-wrap:nowrap;gap:0!important;margin:0 0 10px;padding:0!important;overflow:hidden;background:var(--ui-surface)!important;border:1px solid var(--ui-line)!important;border-radius:12px;box-shadow:none}
.ui-stats>*{--stat-c:var(--ui-accent);position:relative;flex:1 1 0;min-width:0;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0!important;padding:8px 14px!important;background:transparent!important;border:0!important;border-inline-end:1px solid var(--ui-line-soft)!important;border-radius:0!important;box-shadow:none!important;color:var(--ui-text);font:inherit;text-align:start;transform:none!important;transition:background-color .15s}
.ui-stats>:last-child{border-inline-end:0!important}
.ui-stats>::before,.ui-stats>::after{display:none!important}
.ui-stats>:is(button,a,[onclick]){cursor:pointer;text-decoration:none!important}
.ui-stats>:is(button,a,[onclick]):hover{background:var(--ui-surface-2)!important}
.ui-stats>.active{background:color-mix(in srgb,var(--stat-c) 9%,var(--ui-surface))!important;box-shadow:inset 0 -2px 0 var(--stat-c)!important}
.ui-stats>:is(.success,.green,.approved,.paid,.completed){--stat-c:var(--ui-green)}
.ui-stats>:is(.danger,.error,.red,.rejected,.overdue,.cancelled){--stat-c:var(--ui-red)}
.ui-stats>:is(.warning,.orange,.amber,.pending,.partial){--stat-c:var(--ui-amber)}
.ui-stats>:is(.info,.blue,.total,.primary){--stat-c:var(--ui-blue)}
.ui-stats>:is(.violet,.purple,.high-risk){--stat-c:var(--ui-violet)}
.ui-stats :is(.stat-icon,.kpi-icon,.stat-card-icon){display:none!important}
.ui-stats :is(.stat-info,.stat-content,.stat-body,.kpi-content,.kpi-body){flex:1;min-width:0;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;margin:0;padding:0}
.ui-stats .stat-label{order:0;display:flex;align-items:center;gap:7px;min-width:0;margin:0;color:var(--ui-muted);font-size:12px!important;font-weight:600;line-height:1.2;letter-spacing:0;text-transform:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ui-stats .stat-label::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--stat-c)}
.ui-stats .stat-value{order:1;margin:0;color:var(--ui-text);font-size:16px!important;font-weight:800;line-height:1.1;white-space:nowrap;font-variant-numeric:tabular-nums}
.ui-stats>.active .stat-label{color:var(--ui-text)}
@media (max-width:760px){.ui-stats{flex-wrap:wrap}.ui-stats>*{flex:1 1 50%;border-bottom:1px solid var(--ui-line-soft)!important}}
/* A phone: half a screen holds a big number or its label, not both on one line - the label goes above (2026-11-17). */
@media (max-width:480px){.ui-stats>*,.ui-stats :is(.stat-info,.stat-content,.stat-body,.kpi-content,.kpi-body){flex-direction:column;align-items:flex-start;justify-content:center;gap:3px}}

/* --- Row sub-line and selection bar (damage module, 2026-11-12) ---
   .ui-sub: the quiet second line under a cell's main text (a code under a
   name, a note under a product). .ui-selbar: the bar that rises from the
   foot of a list while rows are ticked; .on shows it.
     <td><strong>Name</strong><span class="ui-sub">CODE-1</span></td>
     <div class="ui-selbar ui-actions"><span class="ui-selbar-count">3</span> ... </div> --- */
.ui-sub{display:block;margin-top:2px;color:var(--ui-muted);font-size:var(--app-font-sm,12px);font-weight:500;line-height:1.35;white-space:normal}
/* .ui-drill: a figure in a report cell that opens the documents behind it
   (<a class="ui-drill" data-modal href="…">1,250<i class="fas fa-list"></i></a>). */
.ui-drill{display:inline-flex;align-items:center;gap:6px;margin:-2px -6px;padding:2px 6px;border-radius:6px;color:inherit;text-decoration:none;cursor:pointer;transition:background-color .15s,color .15s}
.ui-drill>i{font-size:10px;color:var(--ui-faint);opacity:.6;transition:opacity .15s,color .15s}
.ui-drill:hover,.ui-drill:focus-visible{background:var(--ui-accent-soft);color:var(--ui-accent-text);text-decoration:none}
.ui-drill:hover>i,.ui-drill:focus-visible>i{opacity:1;color:var(--ui-accent)}
.ui-selbar{display:none;position:sticky;bottom:0;z-index:30;margin-top:10px;padding:10px 14px;border:1px solid var(--ui-line);border-radius:var(--ui-r-lg,12px);background:var(--ui-surface);box-shadow:0 -4px 16px rgba(16,24,40,.08)}
.ui-selbar.on{display:flex}
.ui-selbar-count{font-weight:800;font-variant-numeric:tabular-nums}
@media print{.ui-selbar{display:none!important}}

/* --- Panels / cards --- */
.panel,.card,.win-card,.section-card,.info-box{background:var(--ui-surface);border:1px solid var(--ui-line-soft);border-radius:var(--ui-r-lg);margin-bottom:14px;min-width:0}
.panel-header,.card-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 16px;border-bottom:1px solid var(--ui-line-soft);font-weight:700;color:var(--ui-text);background:transparent}
.panel-header .title,.panel-title,.card-title{display:flex;align-items:center;gap:8px;margin:0;font-weight:750}
.panel-header .icon,.panel-title-icon{color:var(--ui-accent);display:inline-grid;place-items:center}
.panel-body,.card-body{padding:16px}
.panel-footer,.card-footer{padding:12px 16px;border-top:1px solid var(--ui-line-soft);display:flex;align-items:center;justify-content:flex-end;gap:8px;background:var(--ui-surface-2);border-radius:0 0 var(--ui-r-lg) var(--ui-r-lg)}
.section-title{font-weight:750;margin:0 0 10px;display:flex;align-items:center;gap:8px}
/* One look for every section header: page styles that painted them in solid
   or gradient colour are overridden, so the template's quiet header wins. */
.content-area :is(.panel-header,.card-header){background:transparent!important;color:var(--ui-text)!important;border-bottom:1px solid var(--ui-line-soft)!important;box-shadow:none!important}
.content-area :is(.panel-header,.card-header) :is(i,.icon,svg){color:var(--ui-accent)}

/* --- Stat / KPI tiles --- */
.stats-grid,.stats-row,.summary-cards,.kpi-grid,.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));gap:12px;margin-bottom:14px}
.stat-card,.kpi-card,.stat-box,.summary-card{position:relative;display:flex;align-items:center;gap:12px;background:var(--ui-surface);border:1px solid var(--ui-line-soft);border-radius:var(--ui-r-lg);padding:14px 16px;min-width:0;overflow:hidden}
.stat-card::before,.kpi-card::before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--ui-accent)}
.stat-card.success::before,.stat-card.deposit::before,.kpi-card.green::before{background:var(--ui-green)}
.stat-card.error::before,.stat-card.danger::before,.stat-card.withdraw::before,.kpi-card.red::before{background:var(--ui-red)}
.stat-card.warning::before,.kpi-card.orange::before{background:var(--ui-amber)}
.stat-card.info::before,.kpi-card.blue::before{background:var(--ui-blue)}
.stat-icon,.kpi-icon{width:42px;height:42px;border-radius:11px;display:grid;place-items:center;background:var(--ui-accent-soft);color:var(--ui-accent-text);flex:none;font-size:18px}
.stat-info,.stat-content{flex:1;min-width:0}
.kpi-card{flex-direction:column;align-items:stretch;gap:6px}
.kpi-header{display:flex;align-items:center;gap:8px}
.stat-label,.kpi-label,.summary-label{color:var(--ui-muted);font-weight:600}
.stat-value,.kpi-value,.summary-value{font-weight:800;color:var(--ui-text);font-variant-numeric:tabular-nums}
.stat-sub{color:var(--ui-faint)}
/* A second figure in a box: the count leads, its cost sits under it, so the
   label keeps its room however many boxes share the strip. */
.ui-stats .stat-value:has(.stat-sub){text-align:end}
.ui-stats .stat-value .stat-sub{display:block;margin-top:2px;color:var(--ui-muted);font-size:11.5px;font-weight:600;letter-spacing:0}
.stat-trend.up{color:var(--ui-green)}.stat-trend.down{color:var(--ui-red)}

/* --- Tables --- */
.table-responsive,.table-wrap,.table-container,.data-grid{overflow:auto;background:var(--ui-surface);border:1px solid var(--ui-line-soft);border-radius:var(--ui-r-lg)}
.data-table,.table,.report-table,.win11-table{width:100%;border-collapse:separate;border-spacing:0;color:var(--ui-text);background:var(--ui-surface)}
.data-table th,.table th,.report-table th,.win11-table th{position:sticky;top:0;z-index:1;background:var(--ui-th-bg);color:var(--ui-th-ink);font-weight:700;text-align:start;padding:0 12px;height:40px;border-bottom:2px solid var(--ui-th-line);white-space:nowrap}
.data-table td,.table td,.report-table td,.win11-table td{padding:8px 12px;height:44px;border-bottom:1px solid var(--ui-line-soft);vertical-align:middle}
.data-table tbody tr:hover td,.table-hover tbody tr:hover td,.report-table tbody tr:hover td{background:var(--ui-surface-2)}
.data-table tbody tr:last-child td,.table tbody tr:last-child td{border-bottom:0}
.data-table tfoot td,.table tfoot td,.report-table tfoot td{background:var(--ui-surface-2);font-weight:700;border-top:1px solid var(--ui-line)}
.table-striped tbody tr:nth-child(odd) td{background:var(--ui-surface-2)}
.table-bordered td,.table-bordered th{border:1px solid var(--ui-line-soft)}
.table-sm td{height:34px;padding:4px 10px}
.num,.number,.amount,.amount-cell,td.num,th.num{text-align:end;font-variant-numeric:tabular-nums}
.empty-row td{height:180px!important;text-align:center;color:var(--ui-faint)}
.pagination{display:flex;gap:4px;align-items:center;flex-wrap:wrap;list-style:none;margin:12px 0 0;padding:0}
.page-link,.pagination a,.pagination span{min-width:32px;height:32px;padding:0 8px;border-radius:8px;border:1px solid transparent;color:var(--ui-muted);display:inline-grid;place-items:center;font-weight:650;text-decoration:none!important}
.page-link:hover,.pagination a:hover{background:var(--ui-surface-3);color:var(--ui-text)}
.page-item.active .page-link,.pagination .active,.pagination .current{background:var(--ui-accent-soft);color:var(--ui-accent-text);border-color:var(--ui-accent-line)}
.page-item.disabled .page-link{opacity:.4;pointer-events:none}

/* --- Live lists (assets/js/live-list.js) --- */
.ll-sentinel{min-height:1px;text-align:center;color:var(--ui-faint);font-size:12px}
.ll-sentinel.is-more{padding:14px 0}
.ll-sentinel.is-loading::before{content:"";display:inline-block;width:16px;height:16px;border:2px solid var(--ui-line);border-top-color:var(--ui-accent);border-radius:50%;animation:spin .7s linear infinite;vertical-align:middle;margin-inline-end:8px}
@keyframes llFlash{from{background:var(--ui-accent-soft)}to{background:transparent}}
.ll-new,.ll-new>td{animation:llFlash 2.4s ease-out}

/* --- Badges / pills --- */
.badge,.status-badge,.pill{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 9px;border-radius:11px;font-weight:650;line-height:1;white-space:nowrap;background:var(--ui-surface-3);color:var(--ui-muted)}
.badge-success,.bg-success,.badge.success,.status-badge.success,.status-badge.paid,.status-badge.active,.status-badge.approved,.p-green{background:var(--ui-green-soft)!important;color:var(--ui-green)!important}
.badge-danger,.bg-danger,.badge.danger,.status-badge.danger,.status-badge.cancelled,.status-badge.rejected,.status-badge.inactive,.p-red{background:var(--ui-red-soft)!important;color:var(--ui-red)!important}
.badge-warning,.bg-warning,.badge.warning,.status-badge.warning,.status-badge.pending,.p-amber{background:var(--ui-amber-soft)!important;color:var(--ui-amber)!important}
.badge-violet,.badge.violet{background:var(--ui-violet-soft)!important;color:var(--ui-violet)!important}
.badge-info,.bg-info,.badge.info,.status-badge.info,.p-blue{background:var(--ui-blue-soft)!important;color:var(--ui-blue)!important}
.badge-primary,.bg-primary,.badge.primary,.p-gold{background:var(--ui-accent-soft)!important;color:var(--ui-accent-text)!important}
.badge-neutral,.bg-secondary,.badge-secondary,.status-badge.draft,.p-grey{background:var(--ui-surface-3)!important;color:var(--ui-muted)!important}

/* --- Facts list: label and value on one line, two columns (owner, 2026-10-30) ---
   <dl class="ui-facts"><div><dt>Phone</dt><dd>0750…</dd></div>…<div class="wide"><dt>Notes</dt><dd>…</dd></div></dl>
   .ui-facts.one = one column. A value may carry <small> (a unit) or .ui-facts-sub (a second line). */
.text-nowrap{white-space:nowrap}
.ui-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:32px;margin:0 0 -1px;padding:2px 14px}
.ui-facts.one{grid-template-columns:minmax(0,1fr)}
.ui-facts>div{display:flex;align-items:baseline;justify-content:space-between;gap:12px;min-width:0;padding:9px 0;border-bottom:1px solid var(--ui-line-soft)}
.ui-facts dt{flex:none;margin:0;color:var(--ui-muted);font-size:12px;font-weight:600}
.ui-facts dd{min-width:0;margin:0;font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;text-align:end;overflow-wrap:anywhere}
:where(.ui-facts dd){color:var(--ui-text)}
.ui-facts dd small{margin-inline-start:3px;color:var(--ui-faint);font-size:11px;font-weight:600}
.ui-facts .ui-facts-sub{display:block;color:var(--ui-muted);font-size:11.5px;font-weight:500}
.ui-facts>.wide{grid-column:1/-1;flex-direction:column;gap:4px}
.ui-facts>.wide dd{font-weight:500;line-height:1.7;text-align:start}
@media (max-width:760px){.ui-facts{grid-template-columns:minmax(0,1fr)}}

/* --- Step rail: a task done step by step (owner, 2026-10-31; first used by the
   representatives pay plan, modules/representatives/pay_plan.php) ---
   <ol class="ui-steps">
     <li class="ui-step is-done"><button type="button" class="ui-step-btn" data-step="1">
       <span class="ui-step-dot"><span class="ui-step-num">1</span><i class="fas fa-check"></i></span>
       <span class="ui-step-text"><span class="ui-step-title">Salary</span><span class="ui-step-sub">650,000</span></span>
     </button></li>
     <li class="ui-step is-current">…</li>   the open step (aria-current="step" on its button)
     <li class="ui-step">…</li>              not reached yet: its button is disabled
   </ol>
   States: .is-current, .is-done (reached: a check), .is-error (a field to fix: red).
   A line joins the dots and fills in the accent as steps are done. Vertical by
   default; .ui-steps-h lays it in one row, .ui-steps-fold does so below 1000px. --- */
.ui-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;min-width:0}
.ui-step{position:relative;min-width:0}
.ui-step:not(:last-child)::after{content:"";position:absolute;inset-inline-start:21px;top:42px;bottom:-6px;width:2px;border-radius:2px;background:var(--ui-line);transition:background-color .2s}
.ui-step.is-done:not(:last-child)::after{background:var(--ui-accent)}
.ui-step-btn{position:relative;z-index:1;display:flex;align-items:center;gap:12px;width:100%;min-height:54px;margin:0 0 4px;padding:8px;border:0;border-radius:var(--ui-r);background:none;color:var(--ui-muted);font:inherit;text-align:start;cursor:pointer;transition:background-color .15s,color .15s}
.ui-step-btn:hover:not(:disabled){background:var(--ui-surface-2);color:var(--ui-text)}
.ui-step-btn:focus-visible{outline:2px solid var(--ui-accent);outline-offset:1px}
.ui-step-btn:disabled{cursor:default;opacity:1}
.ui-step-dot{flex:none;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:var(--ui-surface);border:2px solid var(--ui-line);color:var(--ui-faint);font-size:12px;font-weight:800;font-variant-numeric:tabular-nums;transition:background-color .2s,border-color .2s,color .2s,box-shadow .2s}
.ui-step-dot>i{display:none;font-size:12px}
.ui-step-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.ui-step-title{font-size:13px;font-weight:750;line-height:1.3;color:inherit}
.ui-step-sub{font-size:11.5px;font-weight:600;line-height:1.3;color:var(--ui-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ui-step.is-done .ui-step-dot{background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-accent-text)}
.ui-step.is-done:not(.is-current):not(.is-error) .ui-step-dot>i{display:block}
.ui-step.is-done:not(.is-current):not(.is-error) .ui-step-num{display:none}
.ui-step.is-done .ui-step-btn{color:var(--ui-text-2)}
.ui-step.is-current .ui-step-btn{background:var(--ui-accent-soft);color:var(--ui-accent-text)}
.ui-step.is-current .ui-step-dot{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-accent-ink);box-shadow:0 0 0 4px var(--ui-ring)}
.ui-step.is-error .ui-step-dot{background:var(--ui-red-soft);border-color:var(--ui-red);color:var(--ui-red);box-shadow:none}
.ui-step.is-error .ui-step-title{color:var(--ui-red)}
.ui-steps-h{flex-direction:row;align-items:center;gap:0}
.ui-steps-h>.ui-step{display:flex;align-items:center;flex:1 1 auto}
.ui-steps-h>.ui-step:last-child{flex:0 1 auto}
.ui-steps-h>.ui-step:not(:last-child)::after{position:static;flex:1 1 12px;min-width:12px;height:2px;width:auto;margin:0 4px}
.ui-steps-h .ui-step-btn{width:auto;min-height:44px;margin:0;padding:6px 8px}
.ui-steps-h .ui-step-sub{display:none}
@media (max-width:1000px){
  .ui-steps-fold{flex-direction:row;align-items:center;gap:0;overflow-x:auto;scrollbar-width:none}
  .ui-steps-fold>.ui-step{display:flex;align-items:center;flex:1 1 auto}
  .ui-steps-fold>.ui-step:last-child{flex:0 1 auto}
  .ui-steps-fold>.ui-step:not(:last-child)::after{position:static;flex:1 1 12px;min-width:12px;height:2px;width:auto;margin:0 4px}
  .ui-steps-fold .ui-step-btn{width:auto;min-height:44px;margin:0;padding:6px 8px}
  .ui-steps-fold .ui-step-sub{display:none}
}

/* --- Choice tiles: pick one of a few options as big cards (a radio inside;
   a checkbox works the same) - e.g. how a commission is counted ---
   <div class="ui-choices" role="radiogroup">
     <label class="ui-choice"><input type="radio" name="method" value="percent_sales">
       <span class="ui-choice-icon"><i class="fas fa-percent"></i></span>
       <span class="ui-choice-title">% of net sales</span>
       <span class="ui-choice-sub">One line that says what it means</span></label> …
   </div>
   The chosen tile is framed in the accent with a filled dot in its corner.
   .ui-choices.compact = smaller tiles in one row. --- */
.ui-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(170px,100%),1fr));gap:10px}
.ui-choice{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0;margin:0;padding:14px 14px 12px;border:1px solid var(--ui-line);border-radius:var(--ui-r-lg);background:var(--ui-surface);color:var(--ui-text);font-weight:400;cursor:pointer;transition:border-color .15s,background-color .15s,box-shadow .15s}
.ui-choice:hover{border-color:var(--ui-line-strong);background:var(--ui-surface-2)}
.ui-choice>input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.ui-choice::after{content:"";position:absolute;top:12px;inset-inline-end:12px;width:16px;height:16px;border-radius:50%;border:2px solid var(--ui-line-strong);background:var(--ui-surface);transition:border-color .15s,box-shadow .15s}
.ui-choice-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:var(--ui-surface-3);color:var(--ui-muted);font-size:15px;transition:background-color .15s,color .15s}
.ui-choice-title{padding-inline-end:22px;font-size:13.5px;font-weight:750;line-height:1.35}
.ui-choice-sub{font-size:11.5px;color:var(--ui-muted);line-height:1.5}
.ui-choice:is(.on,:has(>input:checked)){border-color:var(--ui-accent);background:var(--ui-accent-soft);box-shadow:0 0 0 3px var(--ui-ring)}
.ui-choice:is(.on,:has(>input:checked))::after{border-color:var(--ui-accent);background:var(--ui-accent);box-shadow:inset 0 0 0 3px var(--ui-surface)}
.ui-choice:is(.on,:has(>input:checked)) .ui-choice-icon{background:var(--ui-accent);color:var(--ui-accent-ink)}
.ui-choice:is(.on,:has(>input:checked)) .ui-choice-title{color:var(--ui-accent-text)}
.ui-choice:has(>input:focus-visible){outline:2px solid var(--ui-accent);outline-offset:2px}
.ui-choice:has(>input:disabled){opacity:.55;cursor:not-allowed}
.ui-choices.compact .ui-choice{flex-direction:row;align-items:center;padding:10px 12px}
.ui-choices.compact .ui-choice-sub{display:none}

/* --- Alerts --- */
.alert{display:flex;align-items:flex-start;gap:10px;padding:11px 14px;border-radius:var(--ui-r);border:1px solid var(--ui-line);background:var(--ui-surface-2);color:var(--ui-text-2);margin-bottom:12px}
.alert-success{background:var(--ui-green-soft);border-color:var(--ui-green-line);color:var(--ui-green)}
.alert-danger,.alert-error{background:var(--ui-red-soft);border-color:var(--ui-red-line);color:var(--ui-red)}
.alert-warning{background:var(--ui-amber-soft);border-color:var(--ui-amber-line);color:var(--ui-amber)}
.alert-info{background:var(--ui-blue-soft);border-color:var(--ui-blue-line);color:var(--ui-blue)}
.alert-title{font-weight:700}

/* --- Tabs --- */
.tabs,.tab-nav,.nav-tabs{display:flex;gap:4px;border-bottom:1px solid var(--ui-line);margin-bottom:14px;overflow-x:auto;list-style:none;padding:0}
.tab,.tab-item,.tab-btn,.nav-tabs .nav-link{height:38px;padding:0 14px;border:0;border-bottom:2px solid transparent;background:none;color:var(--ui-muted);font-weight:650;cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;gap:6px;text-decoration:none!important;margin-bottom:-1px}
.tab:hover,.tab-item:hover,.tab-btn:hover,.nav-tabs .nav-link:hover{color:var(--ui-text)}
.tab.active,.tab-item.active,.tab-btn.active,.nav-tabs .nav-link.active{color:var(--ui-accent-text);border-bottom-color:var(--ui-accent);background:none}

/* --- Dropdown (legacy, non-Bootstrap) --- */
.dropdown{position:relative;display:inline-block}
.dropdown-menu{position:absolute;z-index:200;min-width:190px;background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:12px;box-shadow:var(--ui-shadow-pop);padding:5px;display:none;inset-inline-end:0;top:calc(100% + 6px)}
.dropdown.open .dropdown-menu,.dropdown-menu.show{display:block}
.dropdown-item{display:flex;align-items:center;gap:9px;width:100%;padding:8px 10px;border-radius:8px;border:0;background:none;color:var(--ui-text-2);text-align:start;cursor:pointer;text-decoration:none!important}
.dropdown-item:hover,.dropdown-item:focus{background:var(--ui-surface-3);color:var(--ui-text)}
.dropdown-divider{height:1px;background:var(--ui-line-soft);margin:5px 4px;border:0}

/* --- Legacy modal (.modal-overlay.active) --- */
.modal-overlay{position:fixed;inset:0;z-index:1000;background:var(--ui-overlay);display:none;align-items:center;justify-content:center;padding:18px}
.modal-overlay.active,.modal-overlay.show,.modal-overlay.open{display:flex}
.modal-overlay>.modal,.modal-overlay>.modal-content,.modal-overlay>.modal-dialog,.modal-box{background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:var(--ui-r-lg);box-shadow:var(--ui-shadow-pop);width:min(560px,100%);max-height:92vh;display:flex;flex-direction:column;overflow:hidden;color:var(--ui-text)}
.modal-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 18px;border-bottom:1px solid var(--ui-line-soft);font-weight:750}
.modal-title{margin:0;font-weight:750}
.modal-body{padding:18px;overflow:auto}
.modal-footer{display:flex;gap:10px;justify-content:flex-end;padding:14px 18px;border-top:1px solid var(--ui-line-soft)}
.modal-close{width:32px;height:32px;border-radius:8px;border:0;background:none;color:var(--ui-muted);cursor:pointer;display:grid;place-items:center;font-size:18px}
.modal-close:hover{background:var(--ui-surface-3);color:var(--ui-text)}

/* --- Empty state, loaders, tooltips --- */
.empty-state{text-align:center;padding:36px 16px;color:var(--ui-faint)}
.empty-state .icon,.empty-state-icon{font-size:34px;opacity:.6;margin-bottom:8px}
.empty-state-title{color:var(--ui-text-2);font-weight:700}
.spinner{width:22px;height:22px;border:2.5px solid var(--ui-line);border-top-color:var(--ui-accent);border-radius:50%;animation:spin .7s linear infinite;display:inline-block}
.loading-overlay{position:absolute;inset:0;background:color-mix(in srgb,var(--ui-surface) 70%,transparent);display:grid;place-items:center;z-index:5}
@keyframes spin{to{transform:rotate(360deg)}}
/* Tooltips are one floating bubble (assets/js/app.js), never clipped by a
   scrolling table or a toolbar. */
.ui-tip{position:fixed;z-index:2147483600;max-width:min(320px,calc(100vw - 16px));padding:6px 10px;border-radius:8px;background:var(--ui-text);color:var(--ui-surface);font-size:12px;font-weight:600;line-height:1.45;white-space:pre-line;pointer-events:none;box-shadow:var(--ui-shadow-pop);opacity:0;transform:translateY(3px);transition:opacity .1s,transform .1s}
.ui-tip[data-side=bottom]{transform:translateY(-3px)}
.ui-tip.in{opacity:1;transform:none}
.spa-progress{position:fixed;top:0;inset-inline-start:0;height:2px;background:var(--ui-accent);z-index:500;transition:width .2s}

/* --- Utilities (the handful pages lean on; Bootstrap names) --- */
.text-center{text-align:center!important}.text-start,.text-left{text-align:start!important}.text-end,.text-right{text-align:end!important}
.text-muted,.text-secondary,.muted{color:var(--ui-muted)!important}.text-faint{color:var(--ui-faint)!important}
.text-success{color:var(--ui-green)!important}.text-danger{color:var(--ui-red)!important}.text-warning{color:var(--ui-amber)!important}.text-info{color:var(--ui-blue)!important}.text-primary,.text-accent{color:var(--ui-accent-text)!important}
.fw-bold,.strong{font-weight:700!important}.fw-semibold{font-weight:600!important}.small{font-size:var(--app-font-sm)!important}.ltr{direction:ltr;unicode-bidi:isolate}
.d-none,.hidden{display:none!important}.d-block{display:block!important}.d-inline-block{display:inline-block!important}.d-flex,.flex{display:flex!important}.d-grid{display:grid!important}.d-inline-flex{display:inline-flex!important}
.flex-col,.flex-column{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.flex-1,.flex-grow-1{flex:1 1 auto!important}
.items-center,.align-items-center{align-items:center!important}.justify-between,.justify-content-between{justify-content:space-between!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}
.gap-1{gap:4px!important}.gap-2{gap:8px!important}.gap-3{gap:12px!important}.gap-4{gap:16px!important}
.m-0{margin:0!important}.mt-0{margin-top:0!important}.mt-1{margin-top:4px!important}.mt-2{margin-top:8px!important}.mt-3{margin-top:12px!important}.mt-4{margin-top:16px!important}
.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:4px!important}.mb-2{margin-bottom:8px!important}.mb-3{margin-bottom:12px!important}.mb-4{margin-bottom:16px!important}
.ms-auto{margin-inline-start:auto!important}.me-auto{margin-inline-end:auto!important}.ms-1{margin-inline-start:4px!important}.ms-2{margin-inline-start:8px!important}.me-1{margin-inline-end:4px!important}.me-2{margin-inline-end:8px!important}
.p-0{padding:0!important}.p-1{padding:4px!important}.p-2{padding:8px!important}.p-3{padding:12px!important}.p-4{padding:16px!important}.py-2{padding-block:8px!important}.px-3{padding-inline:12px!important}
.w-100{width:100%!important}.h-100{height:100%!important}
/* Light 12-column grid for pages written against Bootstrap without loading it. */
.row{display:flex;flex-wrap:wrap;margin-inline:-7px;row-gap:12px}
.row>*{padding-inline:7px;width:100%;min-width:0}
.col{flex:1 0 0%}.col-auto{flex:0 0 auto;width:auto}
.col-12{width:100%}.col-6{width:50%}.col-4{width:33.333%}.col-3{width:25%}
@media(min-width:768px){.col-md-2{width:16.666%}.col-md-3{width:25%}.col-md-4{width:33.333%}.col-md-5{width:41.666%}.col-md-6{width:50%}.col-md-7{width:58.333%}.col-md-8{width:66.666%}.col-md-9{width:75%}.col-md-12{width:100%}}
@media(min-width:992px){.col-lg-2{width:16.666%}.col-lg-3{width:25%}.col-lg-4{width:33.333%}.col-lg-6{width:50%}.col-lg-8{width:66.666%}.col-lg-9{width:75%}.col-lg-12{width:100%}}

/* Mixed-unit document lines (invoice item tables). */
.pos-unit-cell{display:flex;align-items:center;gap:4px;min-width:92px}
.pos-unit-cell .pos-tbl-select,.pos-unit-cell>select{flex:1 1 auto;min-width:66px;width:auto}
.pos-unit-add{flex:0 0 auto;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;padding:0;line-height:1;border:1px dashed var(--ui-line-strong);border-radius:6px;background:var(--ui-field);color:var(--ui-muted);cursor:pointer}
.pos-unit-add i{font-size:13px!important;line-height:1}
.pos-unit-add:hover,.unit-badge-pick:hover{border-color:var(--ui-accent);border-style:solid;color:var(--ui-accent-text);background:var(--ui-accent-soft)}
.unit-badge-pick{cursor:pointer}.unit-badge-pick.is-default{font-weight:700}

/* ========================== 8. Bootstrap bridge =========================== */
/* Sale / purchase / preorder screens load Bootstrap. Its components read these
   variables, so setting them (html-qualified to outrank Bootstrap's :root no
   matter which file loads last) makes them follow the tokens and the theme. */
html:root{
  --bs-body-bg:var(--ui-bg);--bs-body-color:var(--ui-text);--bs-body-font-family:var(--app-font-family);
  --bs-secondary-bg:var(--ui-surface-2);--bs-tertiary-bg:var(--ui-surface-3);--bs-secondary-color:var(--ui-muted);--bs-tertiary-color:var(--ui-faint);
  --bs-border-color:var(--ui-line);--bs-border-color-translucent:var(--ui-line-soft);--bs-border-radius:var(--ui-r);--bs-border-radius-sm:8px;--bs-border-radius-lg:var(--ui-r-lg);
  --bs-primary:var(--ui-accent);--bs-primary-rgb:242,140,26;--bs-link-color:var(--ui-accent-text);--bs-link-hover-color:var(--ui-accent-strong);--bs-link-color-rgb:194,97,10;
  --bs-success-rgb:28,150,85;--bs-danger-rgb:210,72,60;--bs-warning-rgb:183,121,31;--bs-info-rgb:37,99,235;
  --bs-emphasis-color:var(--ui-text);--bs-heading-color:var(--ui-text);--bs-focus-ring-color:var(--ui-ring);
}
html .btn{--bs-btn-padding-x:14px;--bs-btn-padding-y:0;--bs-btn-font-size:13px;--bs-btn-font-weight:650;--bs-btn-border-radius:var(--ui-r);--bs-btn-focus-box-shadow:0 0 0 3px var(--ui-ring)}
html .btn-primary{--bs-btn-bg:var(--ui-accent);--bs-btn-border-color:var(--ui-accent);--bs-btn-color:var(--ui-accent-ink);--bs-btn-hover-bg:var(--ui-accent-strong);--bs-btn-hover-border-color:var(--ui-accent-strong);--bs-btn-hover-color:#fff;--bs-btn-active-bg:var(--ui-accent-strong);--bs-btn-active-border-color:var(--ui-accent-strong);--bs-btn-disabled-bg:var(--ui-accent);--bs-btn-disabled-border-color:var(--ui-accent);--bs-btn-disabled-color:var(--ui-accent-ink)}
html .btn-secondary,html .btn-light,html .btn-outline-secondary{--bs-btn-bg:var(--ui-surface-2);--bs-btn-border-color:var(--ui-line);--bs-btn-color:var(--ui-text);--bs-btn-hover-bg:var(--ui-surface-3);--bs-btn-hover-border-color:var(--ui-accent);--bs-btn-hover-color:var(--ui-accent-text);--bs-btn-active-bg:var(--ui-surface-3)}
html .btn-success{--bs-btn-bg:var(--ui-green);--bs-btn-border-color:var(--ui-green);--bs-btn-hover-bg:var(--ui-green);--bs-btn-hover-border-color:var(--ui-green)}
html .btn-danger{--bs-btn-bg:var(--ui-red-soft);--bs-btn-border-color:var(--ui-red-line);--bs-btn-color:var(--ui-red);--bs-btn-hover-bg:var(--ui-red);--bs-btn-hover-border-color:var(--ui-red);--bs-btn-hover-color:#fff}
html .form-control,html .form-select{--bs-border-color:var(--ui-line)}
html .modal{--bs-modal-bg:var(--ui-surface);--bs-modal-color:var(--ui-text);--bs-modal-border-color:var(--ui-line);--bs-modal-border-radius:var(--ui-r-lg);--bs-modal-header-border-color:var(--ui-line-soft);--bs-modal-footer-border-color:var(--ui-line-soft)}
html .dropdown-menu{--bs-dropdown-bg:var(--ui-surface);--bs-dropdown-border-color:var(--ui-line);--bs-dropdown-link-color:var(--ui-text-2);--bs-dropdown-link-hover-bg:var(--ui-surface-3);--bs-dropdown-link-hover-color:var(--ui-text);--bs-dropdown-border-radius:12px}
html .table{--bs-table-bg:var(--ui-surface);--bs-table-color:var(--ui-text);--bs-table-border-color:var(--ui-line-soft);--bs-table-hover-bg:var(--ui-surface-2);--bs-table-striped-bg:var(--ui-surface-2)}
html .card{--bs-card-bg:var(--ui-surface);--bs-card-border-color:var(--ui-line-soft);--bs-card-border-radius:var(--ui-r-lg);--bs-card-cap-bg:transparent}
html .list-group{--bs-list-group-bg:var(--ui-surface);--bs-list-group-color:var(--ui-text);--bs-list-group-border-color:var(--ui-line-soft);--bs-list-group-action-hover-bg:var(--ui-surface-2)}
html.dark-theme .btn-close{filter:invert(1) grayscale(1) brightness(2)}
.modal-backdrop{--bs-backdrop-bg:#000;--bs-backdrop-opacity:.45}

/* ================ 9. Dialogs, searchable select, toast, PDF =============== */
/* Fast navigation: pages opened as dialogs + Ctrl+K palette (assets/js/fast-nav.js). */
.fnav-overlay{position:fixed;inset:0;z-index:10500;background:var(--ui-overlay);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;padding:18px;animation:fnavFade .14s ease}
.fnav-overlay.fnav-nested-overlay{z-index:10520;padding:12px}
.fnav-nested-overlay .fnav-dialog{width:min(1580px,97vw);height:95vh;border-color:var(--ui-accent-line)}
body.fnav-modal-open{overflow:hidden}
.fnav-dialog{display:flex;flex-direction:column;overflow:hidden;width:min(1060px,96vw);height:min(780px,92vh);background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:var(--ui-r-lg);box-shadow:var(--ui-shadow-pop);animation:fnavPop .16s ease}
.fnav-size-sm{width:min(560px,96vw);height:min(520px,88vh)}
.fnav-size-md{width:min(820px,96vw);height:min(660px,90vh)}
.fnav-size-lg{width:min(1060px,96vw);height:min(780px,92vh)}
.fnav-size-xl{width:96vw;height:94vh}
.fnav-size-rv{width:min(1320px,82vw);height:92vh}
.fnav-size-75{width:min(88vw,1440px);height:86vh;min-width:320px;min-height:380px}
.fnav-size-full{width:100%;height:100%;border:0;border-radius:0}
.fnav-overlay:has(>.fnav-size-full){padding:0}
/* Pages opened as dialogs (receipt voucher, customer, product, …) use the whole
   screen: same data room as the page itself, the dialog head still closes it. */
.fnav-overlay,.fnav-overlay.fnav-nested-overlay{padding:0}
.fnav-overlay .fnav-dialog,.fnav-nested-overlay .fnav-dialog{width:100vw!important;height:100vh!important;min-width:0;min-height:0;max-width:none;border:0;border-radius:0}
.fnav-head{display:flex;align-items:center;gap:8px;flex:none;height:44px;padding-inline:16px 8px;border-bottom:1px solid var(--ui-line-soft);background:var(--ui-surface)}
.fnav-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:750;font-size:14px;color:var(--ui-text)}
.fnav-head-actions{display:flex;align-items:center;gap:2px}
.fnav-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:var(--ui-muted);font-size:14px;cursor:pointer;transition:background .12s,color .12s}
.fnav-btn:hover{background:var(--ui-surface-3);color:var(--ui-text)}
.fnav-btn.fnav-close:hover{background:var(--ui-red);color:#fff}
.fnav-body{position:relative;flex:1;min-height:0;background:var(--ui-bg)}
.fnav-frame{position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent}
.fnav-spinner{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;gap:10px;font-size:13px;color:var(--ui-muted);background:var(--ui-bg);pointer-events:none}
.fnav-spinner span{width:18px;height:18px;border:2.5px solid var(--ui-line);border-top-color:var(--ui-accent);border-radius:50%;animation:spin .7s linear infinite}
.fnav-palette-overlay{position:fixed;inset:0;z-index:10600;background:var(--ui-overlay);backdrop-filter:blur(2px);display:flex;align-items:flex-start;justify-content:center;padding:10vh 16px 16px;animation:fnavFade .12s ease}
.fnav-palette{width:min(640px,94vw);max-height:70vh;display:flex;flex-direction:column;overflow:hidden;background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:var(--ui-r-lg);box-shadow:var(--ui-shadow-pop);animation:fnavPop .14s ease}
.fnav-palette-inputrow{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--ui-line-soft);color:var(--ui-faint)}
.fnav-palette-input{flex:1;min-width:0;border:0!important;outline:none;background:transparent;font-size:15px;color:var(--ui-text);box-shadow:none!important;min-height:0;padding:0}
.fnav-palette-inputrow kbd{padding:2px 7px;font-size:11px;color:var(--ui-faint);background:var(--ui-surface-3);border:1px solid var(--ui-line);border-radius:5px}
.fnav-palette-list{flex:1;min-height:0;overflow-y:auto;padding:6px}
.fnav-palette-group{padding:8px 10px 4px;font-size:11px;font-weight:700;color:var(--ui-faint)}
.fnav-palette-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:8px;cursor:pointer}
.fnav-palette-item.active{background:var(--ui-accent-soft)}
.fnav-palette-icon{flex:none;width:22px;text-align:center;font-size:14px;color:var(--ui-accent)}
.fnav-palette-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--ui-text)}
.fnav-palette-item.active .fnav-palette-label{color:var(--ui-accent-text)}
.fnav-palette-hint{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:45%;font-size:11.5px;color:var(--ui-faint)}
.fnav-palette-empty{padding:26px 12px;text-align:center;font-size:13px;color:var(--ui-faint)}
@keyframes fnavFade{from{opacity:0}to{opacity:1}}
@keyframes fnavPop{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}

/* Searchable select (assets/js/searchable-select.js upgrades long <select>s). */
.ss-wrapper{position:relative;display:inline-block;min-width:180px;width:100%}
/* Inside a table cell the column sets the width: 180px spilled over the next cell. */
td .ss-wrapper{min-width:0;max-width:100%}
.ss-hidden-select{position:absolute!important;opacity:0!important;pointer-events:none!important;width:1px!important;height:1px!important;min-height:0!important;max-height:1px!important;min-width:0!important;max-width:1px!important;margin:0!important;padding:0!important;border:0!important}
.ss-toggle{display:flex;align-items:center;gap:8px;width:100%;min-height:var(--ui-h);padding:4px 12px;background:var(--ui-field);color:var(--ui-text);border:1px solid var(--ui-line);border-radius:var(--ui-r);cursor:pointer;font:inherit;text-align:start;transition:border-color .15s,box-shadow .15s}
.ss-toggle:hover{border-color:var(--ui-line-strong)}
.ss-wrapper.ss-open>.ss-toggle,.ss-toggle:focus-visible{border-color:var(--ui-accent);box-shadow:0 0 0 3px var(--ui-ring);outline:none}
.ss-wrapper.ss-disabled>.ss-toggle{cursor:not-allowed;opacity:.6}
.ss-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ss-wrapper.ss-empty-value .ss-label{color:var(--ui-faint)}
.ss-caret{flex:none;display:inline-flex;align-items:center;color:var(--ui-muted);font-size:11px;transition:transform .15s}
.ss-wrapper.ss-open .ss-caret{transform:rotate(180deg)}
.ss-panel{position:fixed;max-height:min(380px,70vh);min-width:220px;z-index:10050;background:var(--ui-surface);color:var(--ui-text);border:1px solid var(--ui-line);border-radius:12px;box-shadow:var(--ui-shadow-pop);display:flex;flex-direction:column;overflow:hidden}
.ss-search{position:relative;padding:9px 11px;border-bottom:1px solid var(--ui-line-soft)}
.ss-search-icon{position:absolute;top:50%;inset-inline-start:20px;transform:translateY(-50%);color:var(--ui-faint);font-size:13px;pointer-events:none}
.ss-search-input{width:100%;min-height:32px!important;padding:0 10px 0 32px!important;background:var(--ui-surface-2)!important;border:1px solid var(--ui-line-soft)!important;border-radius:8px!important}
[dir=rtl] .ss-search-input{padding:0 32px 0 10px!important}
.ss-list{list-style:none;margin:0;padding:5px;overflow-y:auto;max-height:280px}
.ss-option{padding:8px 10px;border-radius:8px;cursor:pointer;color:var(--ui-text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ss-option-active,.ss-option:hover{background:var(--ui-surface-3);color:var(--ui-text)}
.ss-option-selected{color:var(--ui-accent-text);font-weight:650;background:var(--ui-accent-soft)}
.ss-option-disabled{opacity:.5;cursor:not-allowed}
.ss-empty{padding:18px 12px;text-align:center;color:var(--ui-faint);font-size:13px}
/* Inside an inline toolbar a searchable select keeps a select's compact width
   instead of stretching to a full row of its own. */
:is(.topbar,.toolbar,.filter-row,.filter-bar,.search-bar,.pos-filters,.page-actions-bar,.kpi-strip)>.ss-wrapper{width:auto;min-width:140px;max-width:240px;flex:0 1 auto}
:is(.topbar,.pos-filters)>.ss-wrapper>.ss-toggle{min-height:29px;height:29px;padding:2px 8px}

/* Toasts (assets/js/toast.js). */
.sahl-toasts{position:fixed;top:16px;left:50%;transform:translateX(-50%);z-index:2147483000;display:flex;flex-direction:column-reverse;gap:8px;max-height:calc(100vh - 32px);width:max-content;max-width:min(460px,calc(100vw - 32px));pointer-events:none;margin:0;padding:0}
.sahl-toast{--tc:var(--ui-muted);pointer-events:auto;position:relative;display:flex;align-items:flex-start;gap:10px;width:100%;padding:12px 16px;padding-inline-start:18px;border-radius:12px;border:1px solid var(--ui-line);background:var(--ui-surface);color:var(--ui-text);box-shadow:var(--ui-shadow-pop);overflow:hidden;line-height:1.55;overflow-wrap:anywhere;opacity:0;transform:translateY(-16px) scale(.97);transition:opacity .22s ease,transform .22s cubic-bezier(.21,1.02,.73,1)}
.sahl-toast::before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:4px;background:var(--tc)}
.sahl-toast.is-visible{opacity:1;transform:none}
.sahl-toast.is-leaving{opacity:0;transform:translateY(-16px) scale(.97);margin-bottom:-100%;transition:opacity .18s,transform .18s,margin-bottom .18s}
.sahl-toast.is-bumping{animation:toastBump .3s ease}
@keyframes toastBump{40%{transform:scale(1.03)}}
.sahl-toast__icon{flex:none;width:20px;height:20px;margin-top:1px;color:var(--tc);display:flex}
.sahl-toast__icon svg{width:20px;height:20px}
.sahl-toast__body{flex:1;min-width:0;font-size:14px;font-weight:550;white-space:pre-line}
.sahl-toast__count{flex:none;align-self:center;min-width:22px;padding:2px 7px;border-radius:999px;background:var(--tc);color:#fff;font-size:12px;font-weight:700;text-align:center;direction:ltr}
.sahl-toast__close{flex:none;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:currentColor;opacity:.45;font-size:18px;line-height:1;cursor:pointer}
.sahl-toast__close:hover{opacity:1;background:var(--ui-surface-3)}
.sahl-toast--success{--tc:var(--ui-green)}.sahl-toast--error{--tc:var(--ui-red)}.sahl-toast--warning{--tc:var(--ui-amber)}.sahl-toast--info{--tc:var(--ui-blue)}

/* "Choose PDF template" dialog (assets/js/pdf-template-picker.js). */
.pdf-tpl-dialog{position:fixed;inset:0;margin:auto;width:min(680px,calc(100vw - 32px));max-height:calc(100vh - 64px);padding:0;border:1px solid var(--ui-line);border-radius:var(--ui-r-lg);background:var(--ui-surface);color:var(--ui-text);box-shadow:var(--ui-shadow-pop);overflow:visible}
.pdf-tpl-dialog::backdrop{background:rgba(15,23,42,.45)}
.pdf-tpl-body{padding:18px 20px 20px;max-height:calc(100vh - 64px);overflow-y:auto}
.pdf-tpl-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pdf-tpl-head h2{margin:0;font-size:17px}
.pdf-tpl-close{border:0;background:transparent;font-size:22px;line-height:1;padding:2px 6px;cursor:pointer;color:var(--ui-muted);border-radius:8px}
.pdf-tpl-close:hover{background:var(--ui-surface-3);color:var(--ui-text)}
.pdf-tpl-hint{font-size:13px;color:var(--ui-muted);margin:6px 0 16px;line-height:1.6}
.pdf-tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.pdf-tpl-card{display:flex;flex-direction:column;align-items:flex-start;gap:5px;text-align:start;font:inherit;cursor:pointer;background:var(--ui-surface-2);color:inherit;border:1px solid var(--ui-line);border-radius:12px;padding:14px;transition:border-color .15s,background .15s}
.pdf-tpl-card:hover,.pdf-tpl-card:focus-visible{border-color:var(--ui-accent);background:var(--ui-surface-3);outline:none}
.pdf-tpl-card.is-default{border-color:var(--ui-accent)}
.pdf-tpl-name{font-size:14.5px;font-weight:650}
.pdf-tpl-desc{font-size:12px;color:var(--ui-muted);line-height:1.5}
.pdf-tpl-tag{margin-top:3px;font-size:11px;font-weight:650;padding:2px 8px;border-radius:999px;background:var(--ui-accent);color:var(--ui-accent-ink)}
.pdf-tpl-remember{display:flex;align-items:center;gap:7px;margin-top:16px;font-size:13px;color:var(--ui-muted);cursor:pointer}

/* ============================== 10. Dashboard ============================= */
/* A launcher of tiles across the full width, each tile in its own colour.
   Documents fill the first line; the other groups share the lines below, in
   columns sized by index.php (--gcols) so their tiles match. A .wide tile
   takes two places. Alert tiles keep one fixed size. */
body.dashboard-page .content-area{padding:16px 18px}
.mdash{--tw:clamp(128px,10.5vw,200px);--th:clamp(100px,13.5vh,140px);display:flex;flex-direction:column;gap:18px}
.mdash-band{display:flex;flex-direction:column;gap:10px}
.mdash-title{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:800;color:var(--ui-muted)}
.mdash-title svg{width:16px;height:16px;color:var(--ui-accent)}
.mdash-total{min-width:22px;height:20px;padding:0 7px;border-radius:10px;background:var(--ui-red);color:#fff;font-size:11px;font-weight:800;display:inline-grid;place-items:center;direction:ltr}
.mdash-groups{display:grid;grid-template-columns:var(--gcols,1fr);gap:16px 28px;align-items:start}
.mdash-group{display:flex;flex-direction:column;gap:7px;min-width:0}
.mdash-group.full{grid-column:1/-1}
.mdash-gtitle{font-size:11.5px;font-weight:700;color:var(--ui-faint);padding-inline-start:2px}
.mdash-row{display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));grid-auto-rows:var(--th);gap:10px}
.mdash-row.mdash-alerts{grid-template-columns:repeat(var(--n),var(--tw))}
.mtile{--c:#475569;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:10px 5px;border-radius:14px;
  background:linear-gradient(150deg,color-mix(in srgb,var(--c) 82%,#fff) 0%,var(--c) 48%,color-mix(in srgb,var(--c) 84%,#000) 100%);
  color:#fff;text-align:center;text-decoration:none!important;overflow:visible;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 1px 2px rgba(15,23,42,.18),0 10px 22px -14px var(--c);
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease}
.mtile::after{content:"";position:absolute;inset:0;border-radius:inherit;border:1px solid rgba(255,255,255,.12);pointer-events:none}
.mtile:hover{color:#fff;transform:translateY(-3px);filter:brightness(1.06);box-shadow:inset 0 1px 0 rgba(255,255,255,.26),0 2px 4px rgba(15,23,42,.18),0 16px 28px -14px var(--c)}
.mtile:active{transform:translateY(0);filter:brightness(.97)}
.mtile:focus-visible{outline:3px solid var(--ui-accent);outline-offset:2px}
.mtile-ic{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.16);box-shadow:inset 0 0 0 1px rgba(255,255,255,.2);flex:none}
.mtile-ic svg{width:23px;height:23px;stroke-width:1.8}
.mtile-lb{font-size:clamp(11px,.8vw,12.5px);font-weight:700;line-height:1.3;text-shadow:0 1px 1px rgba(0,0,0,.18);overflow-wrap:normal;word-break:normal;hyphens:manual}
.mtile-n{position:absolute;top:-7px;inset-inline-end:-7px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;display:grid;place-items:center;
  background:var(--ui-surface-3);color:var(--ui-muted);font-size:11px;font-weight:800;direction:ltr;border:2px solid var(--ui-bg);font-variant-numeric:tabular-nums}
.mtile-n.hot{background:var(--ui-red);color:#fff}
.mtile-n.quiet{top:7px;inset-inline-end:7px;border:0;background:rgba(255,255,255,.2);color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.35)}
.mtile.wide{grid-column:span 2}
.mtile.wide .mtile-ic{width:54px;height:54px}
.mtile.wide .mtile-ic svg{width:27px;height:27px}
.mtile.wide .mtile-lb{font-size:clamp(12px,.9vw,14px)}
/* Narrower screens: two groups to a line, then one group to a line with the
   tiles wrapping at a readable size. */
@media(max-width:1200px){
  .mdash-groups{grid-template-columns:1fr 1fr}
}
@media(max-width:900px){
  .mdash-groups{grid-template-columns:1fr}
  .mdash-row,.mdash-row.mdash-alerts{grid-template-columns:repeat(auto-fill,minmax(104px,1fr))}
}
@media(max-width:760px){
  .mdash-row,.mdash-row.mdash-alerts{grid-auto-rows:clamp(92px,24vw,116px)}
}

/* ============================== Status bar ================================ */
/* The footer bar under every page: connection, branch, currency and date on
   one side; tabs mode, print, refresh, clock, language, theme and the user on
   the other. */
.sbar{flex:none;display:flex;align-items:center;gap:14px;height:32px;padding:0 12px;background:var(--ui-nav);border-top:1px solid var(--ui-line-soft);color:var(--ui-muted);font-size:12px}
.sbar-item{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.sbar-item svg{width:14px;height:14px}
.sbar-dot{width:8px;height:8px;border-radius:50%;background:var(--ui-green);box-shadow:0 0 0 3px var(--ui-green-soft)}
.sbar-spacer{flex:1}
.sbar-btn{width:26px;height:26px;border-radius:7px;border:1px solid transparent;background:transparent;color:var(--ui-muted);display:inline-grid;place-items:center;cursor:pointer;text-decoration:none!important}
.sbar-btn:hover{background:var(--ui-surface-3);color:var(--ui-text)}
.sbar-btn svg{width:15px;height:15px}
.sbar-langs{display:inline-flex;gap:2px;padding:2px;border-radius:8px;background:var(--ui-surface-2);border:1px solid var(--ui-line-soft)}
.sbar-langs a{padding:1px 8px;border-radius:6px;color:var(--ui-muted);font-weight:700;font-size:11.5px;text-decoration:none!important}
.sbar-langs a.on{background:var(--ui-accent);color:var(--ui-accent-ink)}
.sbar-user{font-weight:700;color:var(--ui-text)}
.sbar-clock{font-variant-numeric:tabular-nums;direction:ltr}
/* Owner, 2026-10-30: the status bar takes the header's dark slate, so the page
   sits framed between the two. It holds no dropdowns, so redefining the theme
   variables here recolours every part of it. */
html:not(.dark-theme):not([data-theme=dark]) .sbar{--ui-nav:#1f2d40;--ui-text:#fff;--ui-muted:#b4c1d1;--ui-line-soft:rgba(255,255,255,.12);--ui-surface-2:rgba(255,255,255,.07);--ui-surface-3:rgba(255,255,255,.13);--ui-green-soft:rgba(95,191,134,.28);border-top-color:#16202e}
@media(max-width:760px){.sbar .sbar-hide-sm{display:none}}
@media print{.sbar{display:none!important}}

/* ============================== Map pages ================================= */
/* The old dark title band (map-pages.css and inline copies) used sidebar colours
   that no longer exist, leaving light text on a light band. Pages carry no
   title band now: only the actions stay, as ordinary buttons. */
html body .map-page-header{display:flex;justify-content:flex-end;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 10px;padding:0;background:none;border:0;border-radius:0;box-shadow:none}
html body .map-page-header .map-header-titles{display:none}
html body .map-header-actions{display:flex;flex-wrap:wrap;gap:8px}
html body .map-header-actions .btn-h{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:6px 12px;border-radius:var(--ui-r,8px);border:1px solid var(--ui-line);background:var(--ui-surface);color:var(--ui-text);font-size:12.5px;font-weight:700;text-decoration:none;white-space:nowrap;cursor:pointer}
html body .map-header-actions .btn-h:hover{background:var(--ui-surface-2);color:var(--ui-text)}
html body .map-header-actions .btn-h.primary{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-accent-ink)}
html body .map-header-actions .btn-h.primary:hover{filter:brightness(.96);background:var(--ui-accent);color:var(--ui-accent-ink)}
html body .map-embed{border:1px solid var(--ui-line-soft)}

/* ===================== Embedded pages (dialog / workspace tab) ============ */
/* Density layer for pages rendered inside a fast-nav dialog or a workspace tab
   (body.embedded-page, set by header.php). Standalone pages are untouched. */
body.embedded-page {
    --emb-gap: 8px;
    --emb-pad: 10px;
    --emb-radius: 8px;
    background: var(--surface-secondary, var(--ui-bg));
}

/* ───────────────── 1. No duplicated page chrome ───────────────── */
/* The dialog's own head bar carries the title, close, reload and
   "open full page" controls, so a second page header is pure waste. */
body.embedded-page .page-header,
body.embedded-page .page-title-bar,
body.embedded-page .content-header > .breadcrumb,
body.embedded-page .breadcrumb,
body.embedded-page .page-breadcrumb,
body.embedded-page .back-link-bar { display: none !important; }

/* Some modules print a lone <h1> as the page title — keep the first one
   only when it is the sole heading, otherwise it repeats the dialog title. */
body.embedded-page .page-container > h1:first-child,
body.embedded-page .container > h1:first-child { display: none; }

/* ───────────────── 2. Page shell ───────────────── */
body.embedded-page .page-container,
body.embedded-page .container,
body.embedded-page .content,
body.embedded-page .main-content,
body.embedded-page .hr-page,
body.embedded-page .cashvan-shell {
    max-width: none;
    margin: 0;
    padding: var(--emb-gap);
}

/* ───────────────── 3. Panels / cards ───────────────── */
body.embedded-page .panel,
body.embedded-page .card,
body.embedded-page .content-card,
body.embedded-page .form-card {
    margin-bottom: var(--emb-gap);
    border-radius: var(--emb-radius);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
body.embedded-page .panel:last-child,
body.embedded-page .card:last-child { margin-bottom: 0; }

body.embedded-page .panel-header,
body.embedded-page .card-header,
body.embedded-page .content-header {
    padding: 6px var(--emb-pad);
    min-height: 0;
}
body.embedded-page .panel-header h2,
body.embedded-page .panel-header h3,
body.embedded-page .card-header h2,
body.embedded-page .card-header h3,
body.embedded-page .content-header h2,
body.embedded-page .content-header h3 { margin: 0; }

body.embedded-page .panel-body,
body.embedded-page .card-body,
body.embedded-page .content-body { padding: var(--emb-pad); }
body.embedded-page .card-footer,
body.embedded-page .content-footer { padding: 6px var(--emb-pad); }

/* ───────────────── 4. Stat cards → one-line chips ───────────────── */
/* Same treatment the sales-orders list got: icon · label · value inline. */
body.embedded-page .stats-grid,
body.embedded-page .stats-row {
    gap: 6px;
    margin-bottom: var(--emb-gap);
}
body.embedded-page .stat-card {
    padding: 4px 8px;
    min-height: 30px;
    border-radius: var(--emb-radius);
    gap: 7px;
}
body.embedded-page .stat-card .stat-icon,
body.embedded-page .stat-card .icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 6px;
    margin: 0;
}
body.embedded-page .stat-content,
body.embedded-page .compact-stat-content,
body.embedded-page .sc-content,
body.embedded-page .stat-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
body.embedded-page .stat-label,
body.embedded-page .stat-title {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.embedded-page .stat-value,
body.embedded-page .stat-number {
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
}

/* ───────────────── 5. Tables ───────────────── */
body.embedded-page table,
body.embedded-page .data-table th,
body.embedded-page table th { padding: 5px 8px; }

/* Sticky headers ONLY inside a real vertical scroll box. Applying it to every
   table made small summary tables (totals, debt) float over the rows above
   them while the dialog scrolled — content looked truncated. */
body.embedded-page .table-scroll th,
body.embedded-page .so-table-scroll th,
body.embedded-page .tv-items-wrap th {
    position: sticky;
    top: 0;
    z-index: 2;
}
body.embedded-page .data-table td,
body.embedded-page table td { padding: 4px 8px; }

/* The dialog is short — let the grid scroll inside itself instead of
   pushing the action bar out of reach. */
body.embedded-page .table-scroll,
body.embedded-page .so-table-scroll,
body.embedded-page .tv-items-wrap {
    max-height: min(560px, 46vh);
    overflow: auto;
}

/* ───────────────── 6. Forms ───────────────── */
body.embedded-page .form-group,
body.embedded-page .field,
body.embedded-page .form-row { margin-bottom: 8px; }
body.embedded-page label,
body.embedded-page .form-label { margin-bottom: 3px; }
/* Not for controls inside a table or an invoice entry form: those are sized to
   their column, and 9px of side padding clipped the numbers in them inside a
   dialog (a quantity of 70 read "7(", the exchange rate "1.0000("). They keep
   the page's own compact sizing. :where() adds no specificity, so every
   other control matches exactly as before. */
body.embedded-page .form-control:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)),
body.embedded-page .form-select:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)),
body.embedded-page input[type="text"]:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)),
body.embedded-page input[type="number"]:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)),
body.embedded-page input[type="date"]:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)),
body.embedded-page input[type="search"]:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)),
body.embedded-page input[type="tel"]:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)),
body.embedded-page input[type="email"]:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)),
body.embedded-page select:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)),
body.embedded-page .ss-toggle:not(:where(table *, #saleForm *, #editSaleForm *, #returnForm *, #quotationForm *, #purchaseForm *, #editPurchaseForm *, #linkedReturnForm *)) {
    min-height: 30px;
    height: auto;
    padding: 4px 9px;
}
body.embedded-page textarea,
body.embedded-page textarea.form-control { min-height: 56px; padding: 6px 9px; }
/* The search field of a filter bar keeps room for its icon inside a dialog too. */
body.embedded-page .ui-filters-search > input { height: 34px; padding: 0 12px; padding-inline-start: 34px; }

/* ───────────────── 7. Buttons ───────────────── */
body.embedded-page .btn {
    padding: 5px 11px;
    border-radius: 6px;
}
body.embedded-page .btn-sm { padding: 3px 8px; }
body.embedded-page .btn-lg { padding: 7px 14px; }
body.embedded-page .action-btn { width: 26px; height: 26px; }

/* ───────────────── 8. Toolbars, filters, alerts, tabs ───────────────── */
body.embedded-page .filter-bar,
body.embedded-page .filters,
body.embedded-page .toolbar,
body.embedded-page .search-bar {
    gap: 6px;
    padding: 0;
    margin-bottom: 6px;
}
body.embedded-page .alert,
body.embedded-page .alert-bar {
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
}
body.embedded-page .nav-tabs .nav-link,
body.embedded-page .tabs a,
body.embedded-page .tab-btn { padding: 5px 10px; }

/* ───────────────── 9. Action bar pinned to the dialog floor ───────────────── */
/* A form's save row must stay reachable without scrolling the dialog. */
body.embedded-page .form-actions,
body.embedded-page .save-bar,
body.embedded-page .actions.save-bar,
body.embedded-page .sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 40;
    gap: 8px;
    padding: 7px 10px;
    margin-top: var(--emb-gap);
    background: var(--surface-primary, var(--ui-surface));
    border: 1px solid var(--surface-stroke, rgba(0,0,0,.08));
    border-radius: var(--emb-radius);
    box-shadow: 0 -3px 12px rgba(16, 24, 40, .10);
}

/* ───────────────── 10. Headings & misc rhythm ───────────────── */
body.embedded-page hr { margin: 8px 0; }
body.embedded-page .mb-3, body.embedded-page .mb-4 { margin-bottom: var(--emb-gap) !important; }
body.embedded-page .mt-3, body.embedded-page .mt-4 { margin-top: var(--emb-gap) !important; }
body.embedded-page .p-3, body.embedded-page .p-4 { padding: var(--emb-pad) !important; }

/* A page that opts out (needs its own full-bleed layout inside the dialog)
   just adds data-embed-raw to <body> or a wrapper. */
body.embedded-page[data-embed-raw] .page-container { padding: 0; }

/* ============================== 11. Responsive ============================ */
@media(max-width:1450px){.hdr .brand small{display:none}.acct-txt{display:none}}
@media(max-width:1250px){
  .dash{display:flex;flex-direction:column}
  .dash>*,.dash .dash-row,.dash .dpanel,.dash .tiles{flex:none;min-height:auto}
  .dash .dash-row.top,.dash .dash-row.bottom{grid-template-columns:1fr}
  .dash .tiles{grid-auto-rows:minmax(100px,auto)}
}
@media(max-width:991.98px){
  .hdr .menu-btn{display:grid}
  .hdr .nav{display:none}
  .hdr-actions{margin-inline-start:auto}
  .form-grid.cols-3,.form-grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  .hdr{padding:0 10px;gap:8px}
  .hdr .brand .brand-txt{display:none}
  .content-area,body.dashboard-page .content-area{padding:10px}
  .form-grid,.form-grid.cols-2,.form-grid.cols-3,.form-grid.cols-4{grid-template-columns:1fr}
  .dash .tiles{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .dash .tile.r2{grid-row:auto}.dash .tile.c2,.dash .tile.hero{grid-column:span 2}
  .page-title-bar{padding:10px 12px}
  .fnav-overlay,.fnav-palette-overlay{padding:0}
  .fnav-dialog,.fnav-size-sm,.fnav-size-md,.fnav-size-lg,.fnav-size-xl,.fnav-size-rv,.fnav-size-75{width:100vw;height:100vh;min-width:0;min-height:0;border-radius:0;border:0}
  .fnav-palette{width:100vw;max-height:100vh;height:100vh;border-radius:0}
  .pdf-tpl-grid{grid-template-columns:1fr}
  .pop-grid{grid-template-columns:1fr!important}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ===================== Tables fit their page (2026-11-07) ===================
   app.js marks a table that would scroll sideways: .ui-fit lets go of the
   page's minimum widths and wraps text; .ui-stack shows each row as a card,
   each value with its column's name (data-label, read from the header). A
   card lays its values out in as many columns as fit. Screen only. */
@media screen{
table.ui-fit{min-width:0!important;max-width:100%!important;width:100%!important;table-layout:auto!important}
table.ui-fit>*>tr>:is(th,td){white-space:normal!important;min-width:0!important;max-width:none!important;width:auto!important}
table.ui-stack{display:block!important;min-width:0!important;max-width:100%!important;width:100%!important;border:0!important;background:none!important;table-layout:auto!important}
table.ui-stack>thead{display:none}
table.ui-stack>thead:has(.sahl-xls-btn){display:block}
table.ui-stack>thead:has(.sahl-xls-btn)>tr{display:flex;justify-content:flex-end;margin:0 0 6px}
table.ui-stack>thead:has(.sahl-xls-btn)>tr>th{display:none}
table.ui-stack>thead:has(.sahl-xls-btn)>tr>th:has(.sahl-xls-btn){display:block;height:auto;padding:0;border:0;background:none;font-size:0}
table.ui-stack>:is(tbody,tfoot){display:block!important;width:100%!important}
table.ui-stack>:is(tbody,tfoot)>tr{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,210px),1fr));gap:0 18px;margin:0 0 8px;padding:6px 12px;border:1px solid var(--ui-line-soft);border-radius:var(--ui-r-lg,12px);background:var(--ui-surface);box-shadow:0 1px 2px rgba(16,24,40,.04)}
table.ui-stack>tfoot>tr{background:var(--ui-surface-2)}
table.ui-stack>:is(tbody,tfoot)>tr>:is(td,th){display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0!important;max-width:none!important;width:auto!important;height:auto!important;min-height:30px;padding:4px 0!important;border:0!important;border-bottom:1px dashed var(--ui-line-soft)!important;background:none!important;text-align:end!important;white-space:normal!important;position:static!important;overflow-wrap:anywhere}
table.ui-stack>:is(tbody,tfoot)>tr>[data-label]{justify-content:space-between}
table.ui-stack>:is(tbody,tfoot)>tr>[data-label]::before{content:attr(data-label);flex:0 1 auto;max-width:48%;color:var(--ui-muted);font-size:var(--app-font-sm,12px);font-weight:600;text-align:start;overflow-wrap:normal}
table.ui-stack>:is(tbody,tfoot)>tr>[data-fit-full]{grid-column:1/-1;justify-content:center}
table.ui-stack>:is(tbody,tfoot)>tr>:is(td,th):is(:empty,[data-fit-empty]){display:none}
table.ui-stack>:is(tbody,tfoot)>tr>[data-fit-flip]{flex-direction:row-reverse}
table.ui-stack>:is(tbody,tfoot)>tr>:is(td,th) :is(input,select,textarea):not([type=checkbox]):not([type=radio]){min-width:0!important;max-width:100%}
table.ui-stack>:is(tbody,tfoot)>tr>:is(td,th){flex-wrap:wrap}
table.ui-stack>:is(tbody,tfoot)>tr>:is(td,th) :is(.row-actions,.action-btns,.btn-group,.d-flex){flex-wrap:wrap;justify-content:flex-end;min-width:0;max-width:100%}
table.ui-stack>:is(tbody,tfoot)>tr>:is(td,th) :is(.btn,.badge,img){max-width:100%}
}

/* ================================ 12. Print =============================== */
@media print{
  :root,html.dark-theme{--ui-bg:#fff;--ui-surface:#fff;--ui-surface-2:#f5f5f5;--ui-surface-3:#eee;--ui-field:#fff;--ui-text:#000;--ui-text-2:#111;--ui-muted:#444;--ui-faint:#666;--ui-line:#bbb;--ui-line-soft:#ddd;color-scheme:light}
  body{display:block;overflow:visible;height:auto;background:#fff;color:#000}
  .hdr,.tn-drawer,.tn-drawer-backdrop,.pop,.sahl-toasts,.btn,.page-actions,.filter-panel,.filter-bar,.pagination,.no-print{display:none!important}
  .desktop-app,.app-layout,.main-content,.content-area{display:block;overflow:visible;height:auto;padding:0}
  .data-table th,.table th{position:static}
}

/* ============================== Entry sheet =============================== */
/* A table typed into like paper or Excel (expenses daily sheet, 2026-11-16):
   one field per cell, the row being typed lit, row numbers, a category picked
   by the page shown dashed, a row that may be entered twice in amber. */
.ui-sheet td{padding:3px 4px!important;vertical-align:middle}
.ui-sheet .ui-sheet-no{width:38px;text-align:center;color:var(--ui-faint);font-variant-numeric:tabular-nums;font-size:12px}
.ui-sheet .ui-sheet-x{width:40px;text-align:center}
.ui-sheet td :is(input,select){width:100%;min-width:0;height:34px;padding:4px 8px;border:1px solid var(--ui-line-soft);border-radius:7px;background:var(--ui-field);color:var(--ui-text);font:inherit;font-size:13.5px}
.ui-sheet td :is(input,select):focus{outline:none;border-color:var(--ui-accent);box-shadow:0 0 0 3px var(--ui-accent-soft)}
.ui-sheet td input.num{text-align:end;font-weight:800;font-variant-numeric:tabular-nums;direction:ltr}
.ui-sheet tbody tr:focus-within>td{background:var(--ui-accent-soft)}
.ui-sheet td.is-auto select{color:var(--ui-violet);border-style:dashed}
.ui-sheet tbody tr.is-warn>td{background:var(--ui-amber-soft)}
.ui-sheet tbody tr.is-warn>td.ui-sheet-no{color:var(--ui-amber);font-weight:800}
.ui-sheet tbody tr.is-warn>td.ui-sheet-no::after{content:" !"}
.ui-sheet .ui-sheet-x .action-btn{opacity:.35}
.ui-sheet tr:hover .ui-sheet-x .action-btn,.ui-sheet tr:focus-within .ui-sheet-x .action-btn{opacity:1}
.ui-sheet tfoot td{font-size:14px}
/* Paper: what only the printed page carries (signature lines). */
.ui-print-only{display:none}
.ui-signs{grid-template-columns:repeat(3,1fr);gap:40px;padding:56px 24px 12px}
.ui-signs>div{border-top:1px solid #000;padding-top:6px;text-align:center;font-weight:700}
@media print{
  .ui-print-only{display:block}
  .ui-signs.ui-print-only{display:grid}
  body:has(.ui-paper) :is(.ui-tabs,.alert){display:none!important}
  .ui-paper{border:0;box-shadow:none}
  .ui-paper a{color:inherit;text-decoration:none}
}
/* On a phone each typed row is a small card: name and amount side by side,
   the note across, then the rest. */
@media (max-width:640px){
  .ui-sheet>thead{display:none}
  .ui-sheet,.ui-sheet>tbody,.ui-sheet>tfoot{display:block;width:100%}
  .ui-sheet>tbody>tr{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:8px;margin:0 0 8px;border:1px solid var(--ui-line-soft);border-radius:var(--ui-r-lg,12px)}
  .ui-sheet>tbody>tr>td{display:block;flex:1 1 30%;min-width:0;border:0!important;padding:0!important}
  .ui-sheet>tbody>tr>td.ui-sheet-no,.ui-sheet>tbody>tr>td.ui-sheet-x{flex:0 0 auto;width:auto}
  .ui-sheet>tbody>tr>td.ui-sheet-narrow{flex:0 0 72px}
  .ui-sheet>tbody>tr>td.ui-sheet-wide{flex-basis:100%;order:1}
  .ui-sheet>tbody>tr>td:not(.ui-sheet-no):not(.ui-sheet-wide):not(:nth-child(-n+4)){order:2}
  .ui-sheet>tfoot>tr{display:flex;flex-wrap:wrap;gap:8px;padding:8px}
  .ui-sheet>tfoot>tr>td{display:block;border:0!important;padding:0!important}
  .ui-sheet>tfoot>tr>td:empty{display:none}
}
