/**
 * HamlyERP
 * Copyright (c) 2026 Nolwa Private Limited. All rights reserved.
 * Proprietary and confidential. Unauthorised copying, modification or distribution of this file is prohibited.
 */
/* v2 page kit (P13, docs/redesign/PAGE-KIT.md): pages, KPI cards, tabs, lists, filters, view pages, settings sections,
   states and pop-ups, on top of the shell (css/doc-form.css tokens + css/app-v2.css). Rules:
   - every colour, weight, size, spacing, radius, border, shadow, duration and layer is a var(--…) from
     css/app-v2/tokens.css (owner rule 13 Oct: the prototype is the spec, one token file; KIT-TOK-001 keeps literals
     out); only layout dimensions (box and column widths, breakpoints) and chart strokes stay plain numbers;
   - layout follows the page's own width (#df-page[data-cw]: wide / two / one / mid / phone), not the window,
     except pop-ups (SHELL-COMPONENTS §6);
   - logical properties only, so Arabic mirrors; directional icons carry .df-kit-dir. */

/* ---------- page ---------- */
.df-kit-page { display: block; }
.df-kit-page.is-narrow > * { max-width: 1080px; margin-inline: auto; }
.df-kit-page[data-cw="phone"] { padding: var(--sp-12) var(--sp-12) var(--sp-24); }
[dir="rtl"] .df-kit-dir { transform: scaleX(-1); }

/* today's vendor.css gives h1-h6 'Source Sans Pro'; the prototype's headings inherit the page font (tokens --font) */
.df-v2 :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) { font-family: inherit; }

/* ---------- page head ---------- */
.df-kit-head { gap: var(--sp-10) var(--sp-12); }
.df-kit-head-t { min-width: 0; display: grid; gap: var(--sp-2); }
.df-kit-head-row { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; min-width: 0; }
.df-kit-head-row h1 { overflow-wrap: anywhere; }
.df-kit-head-ic { width: 38px; height: 38px; border-radius: var(--r-lg); background: var(--ui-brand-soft); color: var(--ui-brand-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.df-kit-back { flex: none; }
.df-kit-crumb-sep { margin-inline: var(--sp-6); color: var(--ui-icon); }
.df-crumb a { color: var(--ui-muted); text-decoration: none; }
.df-crumb a:hover { color: var(--ui-brand-ink); text-decoration: underline; }
/* view pages (prototype list.css .df-vw-ttl .df-crumb): above the title, semibold links, "›" mirrored in Arabic */
.df-crumb.is-above { margin: 0; display: flex; gap: var(--sp-6); align-items: center; flex-wrap: wrap; }
.df-crumb.is-above a { font-weight: var(--fw-semibold); }
.df-crumb.is-above a:hover { color: var(--ui-brand); text-decoration: none; }
.df-crumb.is-above .df-kit-crumb-sep { margin-inline: 0; color: inherit; }
[dir="rtl"] .df-kit-crumb-sep.is-chev { display: inline-block; transform: scaleX(-1); }
/* the line under the title (prototype app.css .df-head .df-sub; list pages: "N documents · total", owner A11) and the
   prototype's title size (UI-POL-01, 29 Oct: app.css .df-head, .df-dh, .df-lst-head, .df-vw-ttl h1 are all 22 px / 600) */
.df-kit-head .df-sub { font-size: var(--fs-md); color: var(--ui-muted); margin-top: var(--sp-4); display: flex; gap: var(--sp-10); flex-wrap: wrap; align-items: center; font-variant-numeric: tabular-nums; }
.df-kit-head.is-list h1 { font-size: var(--fs-2xl); }
.df-kit-head.is-view h1 { font-size: var(--fs-2xl); }
.df-kit-page[data-cw="phone"] .df-kit-head:is(.is-list, .is-view) h1 { font-size: var(--fs-2xl); }
/* a head without kind="…" takes its size from the page (Lane D's RFQ parity, 16 Oct): a page with <x-ui.view> or a list now has the
   same 22 px as every other head; the rules stay so a page kind can still be told apart. The view rule comes last */
.df-kit-page:has(.df-kit-list) .df-kit-head:not(.is-list, .is-view) h1 { font-size: var(--fs-2xl); }
.df-kit-page:has(.df-kit-view) .df-kit-head:not(.is-list, .is-view) h1 { font-size: var(--fs-2xl); }
.df-kit-page[data-cw="phone"]:is(:has(.df-kit-list), :has(.df-kit-view)) .df-kit-head h1 { font-size: var(--fs-2xl); }
.df-kit-head-actions { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; }
.df-kit-page[data-cw="phone"] .df-kit-head-actions { order: 4; width: 100%; }
.df-kit-page[data-cw="phone"] .df-kit-head-actions > .df-btn-primary { flex: 1; justify-content: center; }
.df-kit-page[data-cw="phone"] .df-kit-head-ic { display: none; }

/* ---------- buttons with icons (shell .df-btn) ---------- */
.df-v2 .df-btn > svg { width: 16px; height: 16px; flex: none; }
.df-v2 .df-btn.df-kit-icon-only { padding-inline: 0; width: auto; aspect-ratio: 1; justify-content: center; flex: none; }
.df-v2 .df-btn.df-btn-danger { background: var(--ui-error); border-color: var(--ui-error); color: var(--ui-on-danger); }
.df-v2 .df-btn.df-btn-danger:hover { filter: brightness(.94); }
.df-kit-confirm-tx { margin: 0; color: var(--ui-ink); }
.df-kit-sheet .df-modal-body { padding: var(--sp-6); }
.df-kit-sheet .df-menu-item { min-height: 44px; }

/* ---------- grid ---------- */
.df-kit-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-16); align-items: start; }
.df-kit-grid > * { grid-column: span 12; margin-bottom: 0; min-width: 0; }
.df-kit-grid > .df-col-9 { grid-column: span 9; } .df-kit-grid > .df-col-8 { grid-column: span 8; }
.df-kit-grid > .df-col-6 { grid-column: span 6; } .df-kit-grid > .df-col-4 { grid-column: span 4; } .df-kit-grid > .df-col-3 { grid-column: span 3; }
.df-kit-page:is([data-cw="one"], [data-cw="mid"]) .df-kit-grid > :is(.df-col-3, .df-col-4) { grid-column: span 6; }
.df-kit-page:is([data-cw="one"], [data-cw="mid"]) .df-kit-grid > :is(.df-col-8, .df-col-9) { grid-column: span 12; }
.df-kit-page[data-cw="mid"] .df-kit-grid > .df-col-6 { grid-column: span 12; }
.df-kit-page[data-cw="phone"] .df-kit-grid > * { grid-column: span 12; }
.df-kit-page[data-cw="phone"] .df-kit-grid { gap: var(--sp-12); }

/* ---------- card ---------- */
.df-kit-card.is-flush { padding: 0; overflow: hidden; }
/* a flush card's head sits where a padded card's head does (prototype doc-form.css:107-108: card 18 / 20 px, head gap 14 px;
   settings.css:199: 14 px on a phone) */
.df-kit-card.is-flush > .df-card-head { padding: var(--sp-18) var(--sp-20) 0; margin-bottom: var(--sp-14); }
.df-kit-card-ic { width: 30px; height: 30px; border-radius: var(--r-md); background: var(--ui-brand-soft); color: var(--ui-brand-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.df-kit-card .df-card-head { flex-wrap: wrap; }
.df-kit-page[data-cw="phone"] .df-kit-card { padding: var(--sp-14); border-radius: var(--r-xl); }
.df-kit-page[data-cw="phone"] .df-kit-card.is-flush { padding: 0; }
.df-kit-page[data-cw="phone"] .df-kit-card.is-flush > .df-card-head { padding: var(--sp-14) var(--sp-14) 0; }

/* ---------- status pills ---------- */
.df-v2 .df-st { display: inline-flex; align-items: center; gap: var(--sp-5); padding: var(--sp-3) var(--sp-9); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap; line-height: var(--lh-130); }
.df-v2 .df-st::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-round); background: currentColor; flex: none; }
.df-v2 .df-st.is-green { background: var(--ui-ok-wash); color: var(--ui-ok); }
.df-v2 .df-st.is-gold { background: var(--ui-warn-wash); color: var(--ui-warn-ink); }   /* rule 37 (owner 2 Nov): no gold-on-gold chip - the "gold" tone is the warning status token */
.df-v2 .df-st.is-red { background: var(--ui-error-wash); color: var(--ui-error); }
.df-v2 .df-st.is-blue { background: var(--ui-blue-wash); color: var(--ui-blue); }
.df-v2 .df-st.is-violet { background: var(--ui-violet-wash); color: var(--ui-violet); }
.df-v2 .df-st.is-orange { background: var(--ui-orange-wash); color: var(--ui-orange); }
.df-v2 .df-st.is-grey { background: var(--ui-bg); color: var(--ui-muted); }

/* ---------- KPI tiles ---------- */
.df-kit-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-12); margin-bottom: var(--sp-16); }
.df-kit-kpi { --k: var(--ui-brand); position: relative; overflow: hidden; display: grid; gap: var(--sp-6); align-content: start; min-height: 112px; background: var(--ui-surface); border: var(--bw) solid var(--ui-line); border-radius: var(--ui-radius-card); padding: var(--sp-14) var(--sp-16) var(--sp-12); color: var(--ui-ink); text-decoration: none; }
.df-kit-kpi::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--k); }
.df-kit-kpi.is-gold { --k: var(--ui-gold); } .df-kit-kpi.is-red { --k: var(--ui-error); } .df-kit-kpi.is-blue { --k: var(--ui-blue); }
.df-kit-kpi.is-violet { --k: var(--ui-violet); } .df-kit-kpi.is-orange { --k: var(--ui-orange); }
a.df-kit-kpi:hover { border-color: var(--k); background: var(--ui-hl); color: var(--ui-ink); text-decoration: none; }
.df-kit-kpi-l { display: flex; align-items: center; gap: var(--sp-6); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--ui-muted); min-width: 0; }
.df-kit-kpi-l > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-kit-kpi-l svg { width: 15px; height: 15px; color: var(--k); flex: none; }
.df-kit-kpi-v { font-size: var(--fs-2xl); font-weight: var(--fw-heavy); color: var(--ui-heading); letter-spacing: var(--ls-n3); line-height: var(--lh-115); overflow-wrap: anywhere; }
.df-kit-kpi-v small { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--ui-muted); margin-inline-end: var(--sp-4); }
.df-kit-kpi-f { display: flex; align-items: center; gap: var(--sp-8); font-size: var(--fs-sm); color: var(--ui-muted); min-height: 24px; flex-wrap: wrap; }
.df-kit-kpi-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-kit-spark { margin-inline-start: auto; color: var(--k); flex: none; }
[dir="rtl"] .df-kit-spark { transform: scaleX(-1); }
.df-kit-delta { display: inline-flex; align-items: center; gap: var(--sp-4); font-weight: var(--fw-bold); white-space: nowrap; }
/* POLISH-01 item 1 (HUS-2 §1): an amount and its currency sign never break across lines */
.df-v2 .df-money, .df-v2 .df-num, .df-v2 .df-kit-kpi-v, .df-kit-table :is(th, td).is-num { white-space: nowrap; }
/* G4 RYL-001 / 002: the KPI value is never wider than its card (kit.js fitKpi then sizes the text to fit, never clipped digits) */
.df-v2 .df-kit-kpi-v { min-inline-size: 0; max-inline-size: 100%; }
.df-kit-delta.is-good { color: var(--ui-ok); } .df-kit-delta.is-bad { color: var(--ui-error); }
.df-kit-delta > span[aria-hidden] { font-size: var(--fs-2xs); }
.df-kit-page:is([data-cw="one"], [data-cw="mid"]) .df-kit-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* six tiles: one row only on a wide page, else two rows of three (never five and one) */
.df-kit-page[data-cw="two"] .df-kit-kpis:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.df-kit-page[data-cw="phone"] .df-kit-kpis { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 74%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: var(--sp-2); }
.df-kit-page[data-cw="phone"] .df-kit-kpis::-webkit-scrollbar { display: none; }
.df-kit-page[data-cw="phone"] .df-kit-kpi { scroll-snap-align: start; min-height: 104px; }

/* ---------- skeletons ---------- */
.df-kit-skel { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--ui-skel-a) 25%, var(--ui-skel-b) 37%, var(--ui-skel-a) 63%); background-size: 400% 100%; animation: df-kit-skel 1.3s ease infinite; }
@keyframes df-kit-skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .df-kit-skel { animation: none; } }
/* the KPI card's sparkline row (x-ui.kpi, kit-dash.js): the flat baseline and its skeleton only on a dashboard (dash-parity.css) */
.df-kit-kpi-spk:is(.is-flat, .is-skel) { display: none; }
.df-kit-kpi-skl { height: 12px; width: 50%; } .df-kit-kpi-skv { height: 26px; width: 70%; } .df-kit-kpi-skf { height: 12px; width: 40%; }
.df-kit-skel.is-title { height: 18px; width: 40%; margin-bottom: var(--sp-14); }
.df-kit-skel.is-line { height: 12px; margin-bottom: var(--sp-10); }
.df-kit-skel.is-line:nth-child(odd) { width: 86%; }
.df-kit-skel-rows { display: grid; }
.df-kit-skel-row { display: grid; grid-template-columns: 1.2fr 2fr 1fr .8fr; gap: var(--sp-16); align-items: center; height: var(--kit-row-h); padding-inline: var(--sp-12); border-bottom: var(--bw) solid var(--ui-line); }
.df-kit-skel-row .df-kit-skel { height: 12px; }
.df-kit-loading.is-card { padding: var(--sp-4) 0; }

/* ---------- states: empty, error ---------- */
.df-kit-state { text-align: center; padding: var(--sp-40) var(--sp-20); color: var(--ui-muted); display: grid; justify-items: center; gap: var(--sp-4); }
.df-kit-state-ic { width: 56px; height: 56px; border-radius: var(--r-round); background: var(--ui-bg); color: var(--ui-icon); display: inline-flex; align-items: center; justify-content: center; margin-bottom: var(--sp-6); }
.df-kit-state.is-error .df-kit-state-ic { background: var(--ui-error-wash); color: var(--ui-error); }
.df-kit-state h3 { color: var(--ui-ink); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.df-kit-state p { margin: 0; max-width: 46ch; font-size: var(--fs-md); }
.df-kit-state-act { margin-top: var(--sp-12); display: flex; gap: var(--sp-8); flex-wrap: wrap; justify-content: center; }

/* ---------- tabs ("Outlined", ADDENDUM §9.15) ---------- */
.df-kit-tabs { display: flex; gap: var(--sp-6); overflow-x: auto; scrollbar-width: none; padding: var(--sp-2) var(--sp-1); margin-bottom: var(--sp-14); }
.df-kit-tabs::-webkit-scrollbar { display: none; }
.df-kit-tab { display: inline-flex; align-items: center; gap: var(--sp-6); height: 36px; padding: 0 var(--sp-14); flex: none; border-radius: var(--r-lg); border: var(--bw) solid var(--ui-line-strong); background: var(--ui-surface); color: var(--ui-ink); font-size: var(--fs-md); font-weight: var(--fw-semibold); cursor: pointer; text-decoration: none; white-space: nowrap; }
.df-kit-tab:hover { border-color: var(--ui-brand); color: var(--ui-ink); text-decoration: none; }
.df-kit-tab svg { width: 15px; height: 15px; color: var(--ui-muted); }
.df-kit-tab b { font-size: var(--fs-xs); background: var(--ui-bg); color: var(--ui-muted); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-7); font-weight: var(--fw-bold); }
.df-kit-tab:is([aria-selected="true"], [aria-current="page"]) { background: var(--ui-brand-soft); border: var(--bw-strong) solid var(--ui-brand); color: var(--ui-heading); font-weight: var(--fw-heavy); }
.df-kit-tab:is([aria-selected="true"], [aria-current="page"]) b { background: var(--ui-surface); color: var(--ui-heading); }
.df-kit-tab:is([aria-selected="true"], [aria-current="page"]) svg { color: var(--ui-brand-ink); }
/* a list's status tabs = the prototype's tab chips (app.css .df-tabchip, A12): 34 px, padding 0 12, muted text, the
   count badge one step bolder than its chip (b = bolder: 700, 900 when picked), picked chip in the brand ink */
.df-kit-list-tabs { margin-bottom: var(--sp-12); }
.df-kit-list-tabs .df-kit-tab { height: 34px; padding: 0 var(--sp-12); color: var(--ui-muted); }
.df-kit-list-tabs .df-kit-tab:hover { color: var(--ui-brand-dark); }
.df-kit-list-tabs .df-kit-tab b { font-weight: var(--fw-semibold); }
.df-kit-list-tabs .df-kit-tab[aria-selected="true"] { color: var(--ui-brand-dark); }
.df-kit-list-tabs .df-kit-tab[aria-selected="true"] b { color: var(--ui-brand-dark); }
:root[data-theme="dark"] .df-kit-list-tabs .df-kit-tab:hover { border-color: var(--dk-brand-line); color: var(--dk-heading); }
:root[data-theme="dark"] .df-kit-list-tabs .df-kit-tab[aria-selected="true"] { border-color: var(--dk-brand-line); color: var(--dk-heading); }
:root[data-theme="dark"] .df-kit-list-tabs .df-kit-tab[aria-selected="true"] b { color: var(--dk-heading); }
.df-kit-panel:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-xl); }

/* ---------- menus (⋯) ---------- */
.df-kit-menu { display: inline-flex; position: relative; }
.df-kit-dots { width: var(--kit-head-h); height: var(--kit-head-h); }
.df-kit-pop { position: fixed; z-index: var(--z-popover); min-width: 220px; max-width: min(320px, calc(100vw - 16px)); max-height: min(70vh, 480px); overflow: auto; background: var(--ui-surface); border: var(--bw) solid var(--ui-line-strong); border-radius: var(--r-xl); box-shadow: var(--ui-shadow-pop); padding: var(--sp-6); }
.df-kit-pop-title { padding: var(--sp-6) var(--sp-10) var(--sp-8); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ui-muted); border-bottom: var(--bw) solid var(--ui-line); margin-bottom: var(--sp-4); overflow-wrap: anywhere; }
.df-kit-pop .df-menu-item { min-height: 38px; font-size: var(--fs-md); color: var(--ui-ink); }
.df-kit-pop a.df-menu-item { text-decoration: none; }
.df-kit-pop .df-menu-item[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------- pop-up holders (content of <x-ui.modal>/<x-ui.drawer> before it opens) ---------- */
.df-kit-holder[hidden] { display: none !important; }
.df-drawer .df-kit-drawer-foot { padding: var(--sp-12) var(--sp-18) calc(var(--sp-12) + env(safe-area-inset-bottom)); border-top: var(--bw) solid var(--ui-line); display: flex; gap: var(--sp-10); justify-content: flex-end; flex-wrap: wrap; }
.df-modal-foot { flex-wrap: wrap; }

/* ---------- settings sections ---------- */
.df-kit-set { padding: 0; }
.df-kit-set-head { display: flex; gap: var(--sp-12); align-items: flex-start; padding: var(--sp-16) var(--sp-20) var(--sp-12); border-bottom: var(--bw) solid var(--ui-line); }
/* margin 0: the base h2 margin (13 px) pushed a section name down when it has no description line (U2 P3, 7 Nov) */
.df-kit-set-head h2 { margin: 0; font-size: var(--fs-lg); color: var(--ui-heading); font-weight: var(--fw-bold); display: flex; align-items: center; gap: var(--sp-8); }
.df-kit-set-desc { margin: var(--sp-2) 0 0; font-size: var(--fs-md); color: var(--ui-muted); }
.df-kit-set-dot { width: 8px; height: 8px; border-radius: var(--r-round); background: var(--ui-gold); display: inline-block; }
.df-kit-set-dot[hidden] { display: none; }
.df-kit-set-rows { display: grid; }
.df-kit-setrow { display: grid; grid-template-columns: minmax(180px, 34%) minmax(0, 1fr); gap: var(--sp-8) var(--sp-24); align-items: center; padding: var(--sp-12) var(--sp-20); border-bottom: var(--bw) solid var(--ui-line); }
.df-kit-setrow:last-child { border-bottom: 0; }
.df-kit-setrow.is-stack { grid-template-columns: minmax(0, 1fr); }
.df-kit-setrow-pair { display: flex; gap: var(--sp-10); align-items: center; flex-wrap: wrap; }   /* a value beside its control (HR feature areas: the profile default, then the override) */
.df-kit-setrow-c { display: grid; gap: var(--sp-6); min-width: 0; justify-items: start; }
.df-kit-setrow-c > :is(.df-input, .df-textarea, select, .df-date, .df-group) { width: 100%; max-width: 420px; }
.df-kit-setrow-c > .df-kit-inline { width: 100%; max-width: 420px; }   /* a field with its button (Add location's Arabic rows) is as wide as a plain field; the input takes the room the old button leaves (U2 6 Nov) */
.df-kit-setrow-c > .df-xsel { width: 100%; max-width: 420px; min-width: 0; } /* a kit select is as wide as its row, not as its longest placeholder (Accounting > Map transactions at 390, Lane U 31 Oct C4) */
.df-kit-setrow.is-stack .df-kit-setrow-c > * { max-width: none; }
.df-kit-page:is([data-cw="mid"], [data-cw="phone"]) .df-kit-setrow { grid-template-columns: minmax(0, 1fr); padding: var(--sp-12) var(--sp-14); }
.df-kit-page[data-cw="phone"] .df-kit-set-head { padding: var(--sp-14); }
.df-kit-switch { display: inline-flex; align-items: center; gap: var(--sp-10); cursor: pointer; min-height: 40px; }
.df-kit-switch-l { font-size: var(--fs-md); }

/* ---------- form grid (fields fold with the page width) ---------- */
.df-kit-page[data-cw="mid"] .df-kit-form-grid > .df-field { grid-column: span 6; }
.df-kit-page[data-cw="phone"] .df-kit-form-grid > .df-field { grid-column: span 12; }

/* ---------- focus / hover: never an inverted card (SHELL-COMPONENTS §7) ---------- */
.df-kit-pop .df-menu-item:focus-visible { box-shadow: inset 0 0 0 var(--bw-2) var(--ui-brand-ring); }

/* ---------- "?" tips and the guided tour (owner rules, 11 Oct 2026) ---------- */
.df-kit-labelrow { display: flex; align-items: center; gap: var(--sp-6); min-width: 0; }
.df-kit-tip { flex: none; width: 20px; height: 20px; border-radius: var(--r-round); border: var(--bw) solid var(--ui-line-strong); background: var(--ui-surface); color: var(--ui-muted); font-size: var(--fs-xs); font-weight: var(--fw-heavy); line-height: var(--lh-none); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; position: relative; }
.df-kit-tip::after { content: ""; position: absolute; inset: calc(-1 * var(--sp-10)); }   /* 40 px touch target */
.df-kit-tip:hover, .df-kit-tip[aria-expanded="true"] { border-color: var(--ui-brand); color: var(--ui-brand-ink); background: var(--ui-brand-soft); }
.df-kit-tipbox { position: fixed; z-index: var(--z-popover); max-width: min(300px, calc(100vw - 16px)); background: var(--ui-heading); color: var(--ui-surface); border-radius: var(--r-lg); padding: var(--sp-10) var(--sp-12); font-size: var(--fs-md); line-height: var(--lh-145); box-shadow: var(--ui-shadow-pop); display: grid; gap: var(--sp-2); }
.df-kit-tipbox b { font-weight: var(--fw-bold); }
.df-kit-tour { position: fixed; inset: 0; z-index: var(--z-picker); }
.df-kit-tour-hole { position: fixed; border-radius: var(--r-lg); box-shadow: 0 0 0 var(--spot-spread) var(--ui-overlay), 0 0 0 var(--bw-accent) var(--ui-gold); transition: top var(--dur-slow), left var(--dur-slow), width var(--dur-slow), height var(--dur-slow); pointer-events: none; }
.df-kit-tour-box { position: fixed; width: min(340px, calc(100vw - 16px)); background: var(--ui-surface); color: var(--ui-ink); border-radius: var(--r-2xl); padding: var(--sp-16) var(--sp-16) var(--sp-12); box-shadow: var(--ui-shadow-modal); display: grid; gap: var(--sp-6); }
.df-kit-tour-box h3 { font-size: var(--fs-lg); color: var(--ui-heading); font-weight: var(--fw-heavy); }
.df-kit-tour-box p { margin: 0; font-size: var(--fs-md); line-height: var(--lh-150); }
.df-kit-tour-n { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ui-brand-ink); text-transform: var(--tt-label); letter-spacing: var(--ls-4); }   /* rule 37 (owner 2 Nov): no gold text on a light surface */
.df-kit-tour-foot { display: flex; align-items: center; gap: var(--sp-6); margin-top: var(--sp-6); flex-wrap: wrap; }
@media (max-width: 640px) { .df-kit-tour-box { inset-inline: var(--sp-8); bottom: calc(var(--sp-8) + env(safe-area-inset-bottom)); width: auto; } }
@media (prefers-reduced-motion: reduce) { .df-kit-tour-hole { transition: none; } }

/* ---------- dashboards (kit-dash.js) ---------- */
.df-kit-dash-per { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.df-kit-dash-per::-webkit-scrollbar { display: none; }
.df-kit-dash-upd { margin: calc(-1 * var(--sp-6)) var(--sp-2) var(--sp-10); font-size: var(--fs-sm); min-height: 18px; }
.df-kit-kpi.is-link { cursor: pointer; }
.df-kit-kpi.is-link:hover, .df-kit-kpi.is-link:focus-visible { border-color: var(--k); background: var(--ui-hl); }
.df-kit-kpi-na { font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--ui-muted); }
.df-kit-widget-body { min-height: 236px; }
.df-kit-widget.is-list .df-kit-widget-body { min-height: 280px; }
/* loaded: the reserved height is only for the skeleton (no layout shift while loading) */
.df-kit-widget-body:has(.df-kit-bars, .df-kit-state) { min-height: 0; }
/* module dashboards (v2.kit.module_dashboard): needs-attention list; today's SVG charts fill their card */
.df-kit-attn { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.df-kit-attn li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-10); padding: var(--sp-9) var(--sp-2); border-bottom: var(--bw) solid var(--ui-line); }
.df-kit-attn li:last-child { border-bottom: 0; }
.df-kit-attn-dot { inline-size: 10px; block-size: 10px; border-radius: var(--r-round); background: var(--ui-blue); }
.df-kit-attn li.is-bad .df-kit-attn-dot { background: var(--ui-error); }
.df-kit-attn li.is-warn .df-kit-attn-dot { background: var(--ui-gold); }
.df-kit-attn-tx { min-width: 0; display: grid; gap: var(--sp-2); }
.df-kit-attn-tx b { color: var(--ui-ink); font-weight: var(--fw-semibold); }
.df-kit-attn-tx small { color: var(--ui-muted); font-size: var(--fs-sm); }
.df-kit-dash-panel svg { max-inline-size: 100%; block-size: auto; }
/* period chips as links (server-rendered dashboards): the shell's segmented button look */
.df-seg a { border-radius: var(--r-md); padding: var(--sp-6) var(--sp-11); font-weight: var(--fw-semibold); font-size: var(--fs-md); color: var(--ui-muted); white-space: nowrap; text-decoration: none; }
.df-seg a:hover { color: var(--ui-heading); }
/* a card section after a module list (v2.kit.module_list sections) */
.df-kit-section { margin-top: var(--sp-16); }
/* dashboard list on a phone card: a bare number says what it is ("Invoices: 19") */
.df-kit-page[data-cw="phone"] .df-kit-widget .df-kit-table td.is-num:is([data-card="sub"], [data-card="status"], [data-card="meta"])::before { content: attr(data-label) ": "; }
.df-kit-chart { width: 100%; height: auto; max-height: 260px; display: block; }
.df-kit-ch-grid { stroke: var(--ui-line); stroke-width: 1; }
.df-kit-ch-ax { fill: var(--ui-muted); font-size: var(--fs-xs); }
.df-kit-ch-line { fill: none; stroke: var(--ui-brand); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.df-kit-ch-line.is-muted { stroke: var(--ui-gold); stroke-dasharray: 5 4; stroke-width: 1.8; }
.df-kit-ch-legend { display: flex; gap: var(--sp-14); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ui-muted); margin-bottom: var(--sp-6); }
.df-kit-ch-key::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: var(--r-pill); background: var(--ui-brand); vertical-align: middle; margin-inline-end: var(--sp-6); }
.df-kit-ch-key.is-muted::before { background: var(--ui-gold); }
.df-kit-ch-line.is-red { stroke: var(--ui-error); }
.df-kit-ch-key.is-red::before { background: var(--ui-error); }
.df-kit-kpi-sub.is-bad { color: var(--ui-error); font-weight: var(--fw-semibold); }
.df-kit-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-10); }
.df-kit-bars li { display: grid; grid-template-columns: minmax(80px, 30%) minmax(0, 1fr) auto; align-items: center; gap: var(--sp-10); font-size: var(--fs-sm); }
.df-kit-bars-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ui-ink); font-weight: var(--fw-semibold); }
.df-kit-bars-t { block-size: 10px; border-radius: var(--r-pill); background: var(--ui-hl); overflow: hidden; }
.df-kit-bars-b { display: block; block-size: 100%; inline-size: 0; border-radius: var(--r-pill); background: var(--ui-brand); }
.df-kit-bars-v { color: var(--ui-ink); font-weight: var(--fw-semibold); white-space: nowrap; }
.df-kit-bars-v small { color: var(--ui-muted); font-weight: var(--fw-medium); margin-inline-end: var(--sp-3); }
.df-kit-table.is-compact td { height: 38px; }
.df-kit-dash-more { display: inline-block; margin-top: var(--sp-10); font-weight: var(--fw-semibold); color: var(--ui-brand-ink); }

/* ---------- key / value list (view pages, cards) ---------- */
.df-v2 .df-kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: var(--sp-8) var(--sp-16); margin: 0; font-size: var(--fs-md); }
.df-v2 .df-kv dt { color: var(--ui-muted); font-weight: var(--fw-medium); }
.df-v2 .df-kv dd { margin: 0; color: var(--ui-ink); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.df-kit-demo-pills, .df-kit-demo-row { display: flex; flex-wrap: wrap; gap: var(--sp-8); align-items: center; }
.df-kit-kv-row { display: contents; }
.df-v2 .df-kit-kv.is-2 { grid-template-columns: minmax(110px, auto) minmax(0, 1fr) minmax(110px, auto) minmax(0, 1fr); }
.df-kit-page:is([data-cw="mid"], [data-cw="phone"]) .df-kit-kv.is-2 { grid-template-columns: minmax(110px, auto) minmax(0, 1fr); }
.df-kit-page[data-cw="phone"] .df-kv { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
.df-kit-page[data-cw="phone"] .df-kv dd { margin-bottom: var(--sp-8); }

/* ---------- view page (<x-ui.view>, timeline, related) ---------- */
.df-kit-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-16); align-items: start; }
.df-kit-view.has-side { grid-template-columns: minmax(0, 1fr) 340px; }
.df-kit-page:is([data-cw="one"], [data-cw="mid"], [data-cw="phone"]) .df-kit-view.has-side { grid-template-columns: minmax(0, 1fr); }
.df-kit-view-main, .df-kit-view-side { display: grid; gap: var(--sp-16); min-width: 0; align-content: start; }
.df-kit-view-main > .df-card, .df-kit-view-side > .df-card { margin-bottom: 0; }
.df-kit-page:is([data-cw="wide"], [data-cw="two"]) .df-kit-view-side { position: sticky; top: calc(var(--df-top, 60px) + var(--sp-14)); }
.df-kit-tl { list-style: none; margin: 0; padding: 0; display: grid; }
.df-kit-tl-i { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: var(--sp-10); position: relative; padding-bottom: var(--sp-14); }
.df-kit-tl-i:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: var(--sp-6); top: var(--sp-14); bottom: 0; width: 2px; background: var(--ui-line); }
.df-kit-tl-dot { width: 14px; height: 14px; border-radius: var(--r-round); border: var(--bw-accent) solid var(--ui-surface); background: var(--ui-icon); box-shadow: 0 0 0 var(--bw) var(--ui-line); margin-top: var(--sp-2); }
.df-kit-tl-i.is-green .df-kit-tl-dot { background: var(--ui-ok); } .df-kit-tl-i.is-gold .df-kit-tl-dot { background: var(--ui-gold); }
.df-kit-tl-i.is-red .df-kit-tl-dot { background: var(--ui-error); } .df-kit-tl-i.is-blue .df-kit-tl-dot { background: var(--ui-blue); }
.df-kit-tl-t { font-weight: var(--fw-semibold); color: var(--ui-ink); }
.df-kit-tl-m { font-size: var(--fs-sm); color: var(--ui-muted); }
.df-kit-tl-n { font-size: var(--fs-sm); color: var(--ui-ink); margin-top: var(--sp-4); background: var(--ui-bg); border-radius: var(--r-md); padding: var(--sp-6) var(--sp-8); overflow-wrap: anywhere; }
.df-kit-rel { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-6); }
.df-kit-rel-a { display: flex; align-items: center; gap: var(--sp-10); padding: var(--sp-8) var(--sp-10); border: var(--bw) solid var(--ui-line); border-radius: var(--r-lg); color: var(--ui-ink); text-decoration: none; min-width: 0; }
a.df-kit-rel-a:hover { background: var(--ui-hl); border-color: var(--ui-line-strong); color: var(--ui-ink); text-decoration: none; }
.df-kit-rel-a > svg { color: var(--ui-muted); flex: none; }
.df-kit-rel-t { display: grid; flex: 1; min-width: 0; }
.df-kit-rel-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ui-heading); }
.df-kit-rel-t small { font-size: var(--fs-xs); color: var(--ui-muted); }

/* ---------- list (<x-ui.list>) ---------- */
.df-kit-list { position: relative; }
.df-kit-list.is-busy [data-kit-wrap] { opacity: .55; transition: opacity var(--dur) var(--dur-delay); pointer-events: none; }
.df-kit-list-tools { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; margin-bottom: var(--sp-12); }
/* search (A13, prototype .df-list-tools .df-search / .df-icon-input / .df-lst-slash): 14 px, icon at 12, text at 36,
   the "/" key hint at the end (hidden on phones), "/" focuses it */
.df-kit-search { position: relative; flex: 1; min-width: 220px; max-width: 420px; display: block; }
.df-kit-search > svg { position: absolute; inset-inline-start: var(--sp-12); top: 50%; transform: translateY(-50%); width: var(--ic-16); height: var(--ic-16); color: var(--ui-icon); pointer-events: none; }
.df-kit-search .df-input { padding-inline: var(--sp-36) var(--sp-34); width: 100%; font-size: var(--fs-base); }
.df-kit-slash { position: absolute; inset-inline-end: var(--sp-10); top: 50%; transform: translateY(-50%); pointer-events: none; }
/* Filters button badge and toolbar Clear (prototype .df-lst-badge, #lst-clear) */
.df-kit-fbadge { min-width: 20px; height: 20px; border-radius: var(--r-pill); background: var(--ui-gold); color: var(--ui-brand-dark); font-size: var(--fs-xs); display: inline-grid; place-items: center; padding: 0 var(--sp-5); }
.df-kit-fbadge[hidden], .df-kit-list-tools [hidden] { display: none; }
.df-kit-bulk { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; background: var(--ui-brand-dark); color: var(--ui-on-brand); border-radius: var(--r-xl); padding: var(--sp-8) var(--sp-12); margin-bottom: var(--sp-12); }
.df-kit-bulk[hidden] { display: none; }
.df-kit-bulk .df-btn { background: transparent; color: var(--ui-on-brand); border: var(--bw) solid var(--ui-on-brand-soft); }
.df-kit-bulk .df-btn:hover { background: var(--ui-on-brand-soft); }
.df-kit-bulk-n { font-weight: var(--fw-bold); }

/* the Filters drawer (prototype list.js openFilters): <x-ui.filter-card> is its hidden source in the page */
.df-kit-filters, .df-kit-filters[hidden] { display: none; }
.df-drawer .df-kit-filters-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-16); align-content: start; }
.df-kit-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-8); }
.df-kit-range[hidden] { display: none; }
.df-kit-filter.is-period .df-kit-range { margin-top: var(--sp-8); }
.df-kit-filter .df-chips { flex-wrap: wrap; }
.df-kit-party-pick { max-width: 100%; }
.df-kit-party-pick[hidden], .df-kit-party [hidden] { display: none; }
.df-kit-party-pick > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-kit-party-x.df-icon-btn { width: 22px; height: 22px; }
.df-kit-party-res { display: grid; gap: var(--sp-2); }
.df-kit-party-res:empty { display: none; }
.df-kit-party-res .df-menu-item:focus { background: var(--ui-brand-soft); outline: none; }
.df-kit-party-none { padding: var(--sp-6); }

/* table */
.df-kit-table-wrap { overflow-x: auto; border: var(--bw) solid var(--ui-line); border-radius: var(--r-xl); background: var(--ui-surface); scrollbar-width: thin; scrollbar-color: var(--ui-scroll-thumb) transparent; }
.df-kit-table-wrap[hidden] { display: none; }
.df-kit-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); }
.df-kit-table th { text-align: start; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--ui-muted); padding: 0 var(--sp-12); height: var(--kit-head-h); border-bottom: var(--bw) solid var(--ui-line); background: var(--ui-surface-2); white-space: nowrap; }
.df-kit-table td { padding: 0 var(--sp-12); height: var(--kit-row-h); border-bottom: var(--bw) solid var(--ui-line); vertical-align: middle; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; color: var(--ui-ink); background: var(--ui-surface); }
.df-kit-table tbody tr:last-child td { border-bottom: 0; }
.df-kit-table :is(th, td).is-num { text-align: end; font-variant-numeric: tabular-nums; }
.df-kit-table :is(th, td).is-center { text-align: center; }
/* text in the other script (an English name on an Arabic page, or the reverse) truncates at ITS end, not its start:
   each text cell takes its direction from its content, while the column keeps the page's side (12 Oct, Windows 2) */
.df-kit-table td:not(.is-num):not(.is-center), .df-kit-bars-l, .df-kit-rel-t b { unicode-bidi: plaintext; }
/* plaintext alone would put an English name at the left of an Arabic page: the cell takes the page direction, the text keeps its own order */
.df-kit-table td:not(.is-num):not(.is-center) { text-align: match-parent; }
[dir="rtl"] .df-kit-table td:not(.is-num):not(.is-center), [dir="rtl"] .df-kit-bars-l, [dir="rtl"] .df-kit-rel-t b { text-align: right; }
[dir="ltr"] .df-kit-table td:not(.is-num):not(.is-center), [dir="ltr"] .df-kit-bars-l, [dir="ltr"] .df-kit-rel-t b { text-align: left; }
.df-kit-table [hidden] { display: none; }
.df-kit-table tbody tr { cursor: pointer; }
.df-kit-table tbody tr:hover td, .df-kit-table tbody tr:focus-visible td { background: var(--ui-hl); }
.df-kit-table tbody tr:focus-visible { outline: none; }
.df-kit-table tbody tr:focus-visible td:first-child { box-shadow: inset var(--bw-accent) 0 0 var(--ui-brand); }
[dir="rtl"] .df-kit-table tbody tr:focus-visible td:first-child { box-shadow: inset calc(-1 * var(--bw-accent)) 0 0 var(--ui-brand); }
.df-kit-table tbody tr.is-sel td { background: var(--ui-brand-soft); }
/* HF-SALE-01: the row a form just saved (?highlight=<id>, kit-list.js), marked like a selection with the accent edge */
.df-kit-table tbody tr.is-new td { background: var(--ui-brand-soft); }
.df-kit-table tbody tr.is-new td:first-child { box-shadow: inset var(--bw-accent) 0 0 var(--ui-brand); }
[dir="rtl"] .df-kit-table tbody tr.is-new td:first-child { box-shadow: inset calc(-1 * var(--bw-accent)) 0 0 var(--ui-brand); }
.df-kit-docno { font-weight: var(--fw-bold); color: var(--ui-heading); text-decoration: none; }
.df-kit-docno:hover { text-decoration: underline; color: var(--ui-heading); }
.df-kit-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: var(--sp-4); cursor: pointer; }
.df-kit-sort:hover { color: var(--ui-ink); }
.df-kit-sort-ic { width: 12px; height: 12px; opacity: 0; transition: transform var(--dur); }
th[aria-sort="ascending"] .df-kit-sort-ic, th[aria-sort="descending"] .df-kit-sort-ic { opacity: 1; color: var(--ui-brand-ink); }
th[aria-sort="ascending"] .df-kit-sort-ic { transform: rotate(180deg); }
th:is([aria-sort="ascending"], [aria-sort="descending"]) { color: var(--ui-heading); }
/* the detail table (Lane D's request 16 Oct; prototype .df-table, doc-form.css 326-332, and .df-vw-lines, list.css
   140-146 and 258-269): a document's lines on a view page. Every kit table inside <x-ui.view> takes the prototype's
   cell metrics (header and cells padding 8 px, rows from their content); <x-ui.detail-table> adds the rest: no frame
   of its own (it sits in a card), the # column, item + SKU, the amount, plain rows and cards on a phone. Before the list
   rules: a list keeps its own metrics wherever it is. */
.df-kit-view .df-kit-table th, .df-kit-table.is-detail th { padding: var(--sp-8); height: auto; }
.df-kit-view .df-kit-table td, .df-kit-table.is-detail td { padding: var(--sp-8); height: auto; }
/* a settings table (opt-in .is-set; prototype settings.js .df-table in .df-set-tablewrap, settings.css:116-132): a table
   of values to set inside a card on a form page - the cell metrics above, the header band, plain rows (no pointer, no
   row hover); a phone keeps the kit's cards */
.df-kit-table.is-set :is(th, td) { padding: var(--sp-8); height: auto; }
.df-kit-table.is-set th { background: var(--kit-detail-th); }
.df-kit-table.is-set td { background: none; }
.df-kit-table.is-set tbody tr { cursor: default; }
.df-kit-table.is-set tbody tr:hover td { background: none; }
.df-kit-table.is-detail { border-collapse: collapse; }
.df-kit-table.is-detail th { background: var(--kit-detail-th); }
.df-kit-table.is-detail td { max-width: none; background: none; }
.df-kit-table.is-detail tbody tr:last-child td { border-bottom: var(--bw) solid var(--ui-line); }
.df-kit-table.is-detail tbody tr { cursor: default; }
.df-kit-table.is-detail tbody tr:hover td { background: var(--kit-detail-hover); }
.df-kit-detail-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--sp-4)); scrollbar-width: thin; scrollbar-color: var(--ui-scroll-thumb) transparent; }
.df-kit-table.is-detail .df-kit-itemcell { white-space: normal; min-width: 180px; }
.df-kit-item { display: block; font-weight: var(--fw-semibold); }
.df-kit-sku { display: block; font-size: var(--fs-xs); color: var(--ui-muted); font-family: var(--df-mono); }
.df-kit-table.is-detail .df-kit-no { color: var(--ui-muted); width: 28px; }
.df-kit-table.is-detail .df-kit-amt { font-weight: var(--fw-bold); }
.df-kit-page[data-cw="phone"] .df-kit-detail-wrap { overflow: visible; margin: 0; }
.df-kit-page[data-cw="phone"] .df-kit-table.is-detail thead { display: none; }
.df-kit-page[data-cw="phone"] :is(.df-kit-table.is-detail, .df-kit-table.is-detail tbody) { display: block; width: 100%; }
.df-kit-page[data-cw="phone"] .df-kit-table.is-detail tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: none; gap: var(--sp-6) var(--sp-10); border: var(--bw) solid var(--ui-line); border-radius: var(--r-xl); padding: var(--sp-10) var(--sp-12); margin-bottom: var(--sp-8); background: none; }
.df-kit-page[data-cw="phone"] .df-kit-table.is-detail td { display: block; width: 100%; border: 0; padding: 0; white-space: normal; text-align: start !important; }
.df-kit-page[data-cw="phone"] .df-kit-table.is-detail td.df-kit-no { display: none; }
.df-kit-page[data-cw="phone"] .df-kit-table.is-detail td.df-kit-itemcell { grid-column: 1 / -1; min-width: 0; }
.df-kit-page[data-cw="phone"] .df-kit-table.is-detail td[data-label]:not(.df-kit-itemcell)::before { content: attr(data-label); display: block; font-size: var(--fs-xs); color: var(--ui-muted); }
.df-kit-page[data-cw="phone"] .df-kit-table.is-detail td.df-kit-amt { grid-column: 1 / -1; text-align: end !important; border-top: var(--bw) dashed var(--ui-line); padding-top: var(--sp-6); }
.df-kit-page[data-cw="phone"] .df-kit-table.is-detail td.df-kit-amt::before { display: inline !important; margin-inline-end: var(--sp-8); }
/* a list's table = the prototype's .df-dt (A14, measured on list.html at 1440 px): header 43 px (padding 10 8, letter
   spacing .2 px, muted, ▲ / ▼ after the sorted label, ↕ on hover), rows from their content (padding 10 8, first cell
   12 at the start: 53 px with the row's ⋯ button) */
.df-kit-list .df-kit-table th { padding: var(--sp-10) var(--sp-8); height: 43px; letter-spacing: var(--ls-2); }
.df-kit-list .df-kit-sort { display: inline; }
.df-kit-list .df-kit-table td { padding: var(--sp-10) var(--sp-8); height: auto; }
.df-kit-list .df-kit-table :is(th, td):first-child { padding-inline-start: var(--sp-12); }
.df-kit-list .df-kit-table th[aria-sort] { color: var(--ui-muted); }
.df-kit-list .df-kit-sort-ic { display: none; }
.df-kit-list th[aria-sort="ascending"] .df-kit-sort::after { content: " ▲"; font-size: var(--fs-2xs); white-space: pre; }
.df-kit-list th[aria-sort="descending"] .df-kit-sort::after { content: " ▼"; font-size: var(--fs-2xs); white-space: pre; }
.df-kit-list th[aria-sort="none"]:hover .df-kit-sort::after { content: " ↕"; font-size: var(--fs-2xs); opacity: .5; white-space: pre; }
.df-kit-table :is(th, td).df-kit-sel { width: 44px; padding-inline: var(--sp-12) 0; }
/* row select = the prototype's round tick (list.css .df-ck): 22 px circle, brand fill and white tick when picked */
.df-kit-ck { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border-radius: var(--r-round); border: var(--bw-strong) solid var(--ui-line-strong); background: var(--ui-surface) center / var(--ic-13) no-repeat; cursor: pointer; margin: 0; vertical-align: middle; flex: none; }
.df-kit-ck:hover { border-color: var(--ui-brand); }
.df-kit-table .df-kit-sel .df-kit-ck { display: block; margin: 0; }   /* vendor.css input[type=checkbox] adds margin-top 4px */
.df-kit-ck:checked { background-color: var(--ui-brand); border-color: var(--ui-brand); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E"); }
.df-kit-ck:indeterminate { background-color: var(--ui-brand); border-color: var(--ui-brand); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E"); }
.df-kit-ck:focus-visible { outline: var(--bw-2) solid var(--ui-gold); outline-offset: var(--sp-2); }
/* the ⋯ column stays at the end of the row even when the table scrolls sideways (§9.12); no separator before it */
.df-kit-table :is(th, td).df-kit-act { position: sticky; inset-inline-end: 0; width: 52px; padding-inline: var(--sp-4) var(--sp-8); text-align: end; overflow: visible; }
.df-kit-table th.df-kit-act { background: var(--ui-surface-2); z-index: 1; }
.df-kit-list-empty[hidden] { display: none; }
.df-kit-list-empty { border: var(--bw) solid var(--ui-line); border-radius: var(--r-xl); background: var(--ui-surface); }
.df-kit-list-foot { display: flex; align-items: center; gap: var(--sp-6); padding: var(--sp-10) var(--sp-2) 0; font-size: var(--fs-sm); color: var(--ui-muted); }
.df-kit-list-foot[hidden] { display: none; }
.df-kit-count { font-variant-numeric: tabular-nums; }
.df-kit-legacy[hidden] { display: none !important; }

/* phone: each row becomes a card; only cells with a card role show (title, sub, amount, status, meta) */
.df-kit-page[data-cw="phone"] .df-kit-table-wrap { border: 0; background: none; overflow: visible; }
.df-kit-page[data-cw="phone"] .df-kit-table thead { display: none; }
.df-kit-page[data-cw="phone"] .df-kit-table { display: block; }
.df-kit-page[data-cw="phone"] .df-kit-table tbody { display: grid; gap: var(--sp-10); }
.df-kit-page[data-cw="phone"] .df-kit-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "title status act" "sub amount act" "meta meta act"; gap: var(--sp-4) var(--sp-10); align-items: center; border: var(--bw) solid var(--ui-line); border-radius: var(--r-2xl); padding-block: var(--sp-12); padding-inline: var(--sp-14) var(--sp-6); background: var(--ui-surface); }
.df-kit-page[data-cw="phone"] .df-kit-table td { display: none; height: auto; padding: 0; border: 0; background: none; max-width: none; }
.df-kit-page[data-cw="phone"] .df-kit-table td[data-card], .df-kit-page[data-cw="phone"] .df-kit-table td[data-card][hidden] { display: block; min-width: 0; }
.df-kit-page[data-cw="phone"] .df-kit-table td[data-card="title"] { grid-area: title; font-weight: var(--fw-bold); }
.df-kit-page[data-cw="phone"] .df-kit-table td[data-card="status"] { grid-area: status; }
.df-kit-page[data-cw="phone"] .df-kit-table td[data-card="sub"] { grid-area: sub; color: var(--ui-muted); }
.df-kit-page[data-cw="phone"] .df-kit-table td[data-card="amount"] { grid-area: amount; font-weight: var(--fw-bold); text-align: end; }
.df-kit-page[data-cw="phone"] .df-kit-table td[data-card="meta"] { grid-area: meta; color: var(--ui-muted); font-size: var(--fs-sm); }
.df-kit-page[data-cw="phone"] .df-kit-table td.df-kit-act { display: block; grid-area: act; position: static; width: auto; align-self: start; }
.df-kit-page[data-cw="phone"] .df-kit-table td.df-kit-sel { display: none; }
.df-kit-page[data-cw="phone"] .df-kit-table tbody tr:hover td { background: none; }
.df-kit-page[data-cw="phone"] .df-kit-table tbody tr.is-sel { background: var(--ui-brand-soft); }
.df-kit-page[data-cw="phone"] .df-kit-table tbody tr.is-new { background: var(--ui-brand-soft); box-shadow: inset 0 0 0 var(--bw-strong) var(--ui-brand); }
.df-kit-page[data-cw="phone"] .df-kit-cols-btn { display: none; }
.df-kit-page[data-cw="phone"] .df-kit-search { max-width: none; min-width: 0; flex-basis: 100%; }
.df-kit-page[data-cw="phone"] .df-kit-slash { display: none; }
.df-kit-page[data-cw="phone"] .df-kit-list-foot .df-kit-count { flex: 1; }

/* column chooser and export dialog */
/* Columns drawer and export list (prototype list.css .df-lst-colist / .df-lst-colrow, A14) */
.df-kit-colhint { margin: 0; }
.df-kit-colist { display: grid; gap: var(--sp-2); border: var(--bw) solid var(--ui-line); border-radius: var(--r-xl); padding: var(--sp-4); margin-top: var(--sp-10); max-height: 50vh; overflow: auto; }
.df-kit-colrow { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-10); padding: var(--sp-8) var(--sp-10); border-radius: var(--r-md); cursor: pointer; font-size: var(--fs-base); }
.df-kit-colrow:hover { background: var(--ui-bg); }
.df-kit-colname { min-width: 0; }
.df-kit-coltag { font-size: var(--fs-xs); color: var(--ui-muted); border: var(--bw) solid var(--ui-line); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-8); }
.df-kit-coltag.is-extra { color: var(--ui-warn-ink); background: var(--ui-warn-wash); border-color: transparent; }
.df-kit-colwarn { margin-top: var(--sp-10); }
.df-kit-colwarn[hidden] { display: none; }
/* export dialog (prototype list.css .df-lst-exphead; fields 12 px apart as in list.js exportDialog) */
.df-kit-exp { display: block; }
.df-kit-exphead { display: flex; align-items: center; gap: var(--sp-8); justify-content: space-between; margin-bottom: var(--sp-8); min-height: 32px; }
.df-kit-exphead .df-label { margin: 0; }
.df-kit-exphead [hidden] { display: none !important; }
.df-kit-exp .df-kit-colist { margin-top: 0; }
.df-kit-exp-f { margin-top: var(--sp-12); }
.df-link-btn { border: 0; background: none; color: var(--ui-brand-ink); font-weight: var(--fw-semibold); cursor: pointer; padding: 0; }
.df-link-btn:hover { text-decoration: underline; }

/* ---------- today's dialogs on the dark v2 shell (12 Oct, Windows 2's finding) ----------
   Module pages on the kit still open today's Bootstrap modals (primary "modal" -> btn-modal into the module's
   container). The shell sets color-scheme: dark, so their native inputs turned dark inside a white dialog. In dark
   these dialogs, their fields, select2 / date pickers and tables take the shell tokens; light mode is untouched. */
:root[data-theme="dark"] .df-app-v2 .modal-content, :root[data-theme="dark"] .df-app-v2 .modal-body,
:root[data-theme="dark"] .df-app-v2 .modal .box, :root[data-theme="dark"] .df-app-v2 .modal .box-body,
:root[data-theme="dark"] .df-app-v2 .modal .well, :root[data-theme="dark"] .df-app-v2 .modal .panel,
:root[data-theme="dark"] .df-app-v2 .modal .nav-tabs-custom, :root[data-theme="dark"] .df-app-v2 .modal .tab-content,
:root[data-theme="dark"] .df-app-v2 .modal .table > tbody > tr > td, :root[data-theme="dark"] .df-app-v2 .modal .list-group-item {
  background: var(--ui-surface) !important; color: var(--ui-ink) !important; border-color: var(--ui-line-strong) !important; }
:root[data-theme="dark"] .df-app-v2 .modal-header, :root[data-theme="dark"] .df-app-v2 .modal-footer,
:root[data-theme="dark"] .df-app-v2 .modal .table > thead > tr > th, :root[data-theme="dark"] .df-app-v2 .modal .input-group-addon,
:root[data-theme="dark"] .df-app-v2 .modal .panel-heading, :root[data-theme="dark"] .df-app-v2 .modal .bg-gray,
:root[data-theme="dark"] .df-app-v2 .modal .table-striped > tbody > tr:nth-of-type(odd) > td {
  background: var(--ui-surface-2) !important; color: var(--ui-ink) !important; border-color: var(--ui-line-strong) !important; }
:root[data-theme="dark"] .df-app-v2 .modal .modal-title, :root[data-theme="dark"] .df-app-v2 .modal label,
:root[data-theme="dark"] .df-app-v2 .modal h1, :root[data-theme="dark"] .df-app-v2 .modal h2, :root[data-theme="dark"] .df-app-v2 .modal h3,
:root[data-theme="dark"] .df-app-v2 .modal h4, :root[data-theme="dark"] .df-app-v2 .modal strong, :root[data-theme="dark"] .df-app-v2 .modal b { color: var(--ui-heading) !important; }
:root[data-theme="dark"] .df-app-v2 .modal .help-block, :root[data-theme="dark"] .df-app-v2 .modal .text-muted,
:root[data-theme="dark"] .df-app-v2 .modal small { color: var(--ui-muted) !important; }
:root[data-theme="dark"] .df-app-v2 .modal .close { color: var(--ui-ink) !important; opacity: .8; text-shadow: none; }
:root[data-theme="dark"] .df-app-v2 .modal .form-control, :root[data-theme="dark"] .df-app-v2 .modal input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
:root[data-theme="dark"] .df-app-v2 .modal textarea, :root[data-theme="dark"] .df-app-v2 .modal select,
:root[data-theme="dark"] .df-app-v2 .modal .select2-container--default .select2-selection,
:root[data-theme="dark"] .df-app-v2 .modal .btn-default, :root[data-theme="dark"] .df-app-v2 .modal .tw-dw-btn-neutral,
:root[data-theme="dark"] .df-app-v2 .modal .tw-dw-btn-outline:not(.tw-dw-btn-error):not(.tw-dw-btn-primary) {
  background: var(--ui-surface) !important; color: var(--ui-ink) !important; border-color: var(--ui-line-strong) !important; }
:root[data-theme="dark"] .df-app-v2 .modal .btn-primary, :root[data-theme="dark"] .df-app-v2 .modal .tw-dw-btn-primary {
  background: var(--ui-primary) !important; border-color: var(--ui-primary) !important; color: var(--ui-on-brand) !important; }
:root[data-theme="dark"] .df-app-v2 .modal .btn-primary:hover, :root[data-theme="dark"] .df-app-v2 .modal .tw-dw-btn-primary:hover { background: var(--ui-primary-hover) !important; }
:root[data-theme="dark"] .df-app-v2 .modal .form-control:focus { border-color: var(--ui-brand-ink) !important; box-shadow: var(--focus-ring) !important; }
:root[data-theme="dark"] .df-app-v2 .modal .form-control[readonly], :root[data-theme="dark"] .df-app-v2 .modal .form-control[disabled] { background: var(--ui-ro) !important; }
:root[data-theme="dark"] .df-app-v2 .modal .select2-container--default .select2-selection__rendered { color: var(--ui-ink) !important; }
:root[data-theme="dark"] .df-app-v2 .modal ::placeholder { color: var(--ui-placeholder) !important; }
/* pop-ups those dialogs portal to <body>: select2 drop-downs, date pickers, drop-down menus */
:root[data-theme="dark"] .df-app-v2 > .select2-container .select2-dropdown, :root[data-theme="dark"] .df-app-v2 > .select2-container .select2-search__field,
:root[data-theme="dark"] .df-app-v2 > .datepicker.dropdown-menu, :root[data-theme="dark"] .df-app-v2 > .daterangepicker,
:root[data-theme="dark"] .df-app-v2 > .bootstrap-datetimepicker-widget, :root[data-theme="dark"] .df-app-v2 .modal .dropdown-menu {
  background: var(--ui-surface) !important; color: var(--ui-ink) !important; border-color: var(--ui-line-strong) !important; }
:root[data-theme="dark"] .df-app-v2 > .select2-container .select2-results__option--highlighted,
:root[data-theme="dark"] .df-app-v2 > .datepicker td.day:hover, :root[data-theme="dark"] .df-app-v2 > .daterangepicker td.available:hover,
:root[data-theme="dark"] .df-app-v2 .modal .dropdown-menu > li > a:hover { background: var(--ui-flash) !important; color: var(--ui-ink) !important; }
:root[data-theme="dark"] .df-app-v2 > .datepicker th, :root[data-theme="dark"] .df-app-v2 > .datepicker td,
:root[data-theme="dark"] .df-app-v2 > .daterangepicker .calendar-table, :root[data-theme="dark"] .df-app-v2 > .daterangepicker td,
:root[data-theme="dark"] .df-app-v2 > .daterangepicker th, :root[data-theme="dark"] .df-app-v2 .modal .dropdown-menu > li > a {
  background: transparent !important; color: var(--ui-ink) !important; border-color: var(--ui-line) !important; }
:root[data-theme="dark"] .df-app-v2 > .datepicker td.active, :root[data-theme="dark"] .df-app-v2 > .daterangepicker td.active {
  background: var(--ui-primary) !important; color: var(--ui-on-brand) !important; }
:root[data-theme="dark"] .df-app-v2 > .datepicker td.old, :root[data-theme="dark"] .df-app-v2 > .datepicker td.new,
:root[data-theme="dark"] .df-app-v2 > .daterangepicker td.off { color: var(--ui-icon) !important; }

/* ---------- view pages that reuse today's panes (P13, e.g. the HR employee page) ---------- */
.df-kit-emp-id { display: flex; align-items: center; gap: var(--sp-12); margin: 0 0 var(--sp-14); color: var(--ui-muted); }
.df-kit-emp-id b { display: block; color: var(--ui-heading); font-size: var(--fs-lg); }
.df-kit-emp-photo { width: 48px; height: 48px; border-radius: var(--r-round); object-fit: cover; border: var(--bw) solid var(--ui-line); }
/* today's markup inside a kit card: definition lists as label / value rows, tables and headings in kit type */
.df-kit-legacy-pane dl.dl-horizontal { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: var(--sp-6) var(--sp-12); margin: 0 0 var(--sp-12); }
.df-kit-legacy-pane dl.dl-horizontal dt { width: auto; float: none; text-align: start; color: var(--ui-muted); font-weight: var(--fw-semibold); white-space: normal; overflow: visible; }
.df-kit-legacy-pane dl.dl-horizontal dd { margin: 0; color: var(--ui-ink); min-width: 0; overflow-wrap: anywhere; }
.df-kit-legacy-pane h4 { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--ui-heading); margin: var(--sp-14) 0 var(--sp-8); }
.df-kit-legacy-pane .table { color: var(--ui-ink); }
.df-kit-legacy-pane .table > thead > tr > th { background: var(--ui-surface-2); color: var(--ui-muted); font-size: var(--fs-sm); font-weight: var(--fw-semibold); border-color: var(--ui-line); }
.df-kit-legacy-pane .table > tbody > tr > td { border-color: var(--ui-line); vertical-align: middle; }
.df-kit-legacy-pane .table-bordered, .df-kit-legacy-pane .table-bordered > * > tr > * { border-color: var(--ui-line); }
.df-kit-legacy-pane .row { margin-inline: calc(-1 * var(--sp-8)); }
.df-kit-legacy-pane .well { background: var(--ui-surface-2); border-color: var(--ui-line); box-shadow: none; }
.df-kit-legacy-pane .text-muted { color: var(--ui-muted); }
/* today's AdminLTE labels (white on yellow / red / green) as kit pills: readable in light and dark */
:is(.df-kit-legacy-pane, .df-kit-attn) .label { display: inline-block; padding: var(--sp-2) var(--sp-8); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: var(--lh-150); }
:is(.df-kit-legacy-pane, .df-kit-attn) .label.bg-yellow { background: var(--ui-warn-wash) !important; color: var(--ui-warn-ink) !important; }
:is(.df-kit-legacy-pane, .df-kit-attn) .label.bg-red { background: var(--ui-error-wash) !important; color: var(--ui-error) !important; box-shadow: inset 0 0 0 var(--bw) var(--ui-error); }
:is(.df-kit-legacy-pane, .df-kit-attn) .label.bg-green { background: var(--ui-brand-soft) !important; color: var(--ui-brand-ink) !important; }
:is(.df-kit-legacy-pane, .df-kit-attn) .label:is(.bg-gray, .bg-blue) { background: var(--ui-surface-2) !important; color: var(--ui-ink) !important; box-shadow: inset 0 0 0 var(--bw) var(--ui-line-strong); }
@media (max-width: 640px) { .df-kit-legacy-pane dl.dl-horizontal { grid-template-columns: 1fr; gap: var(--sp-2); } .df-kit-legacy-pane dl.dl-horizontal dd { margin-bottom: var(--sp-6); } }

/* ---------- a toolbar of period links and a small GET form above a grid (HR roster) ---------- */
.df-kit-roster-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-10) var(--sp-12); margin: 0 0 var(--sp-8); }
.df-kit-roster-range { align-self: center; color: var(--ui-heading); font-variant-numeric: tabular-nums; }
.df-kit-roster-f { display: grid; gap: var(--sp-4); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--ui-muted); margin: 0; min-width: 160px; }
.df-kit-roster-bar .df-seg { align-self: center; }

/* ---------- status flow (<x-ui.flow>; prototype app.css .df-track, list.css .df-vw-trackcard / .df-vw-me) ---------- */
.df-kit-flow.df-card { padding: var(--sp-14) var(--sp-16) var(--sp-10); }
.df-kit-track { display: flex; gap: 0; overflow-x: auto; padding: var(--sp-4) var(--sp-2); scroll-snap-type: x proximity; }
.df-kit-track-step { flex: 1 1 0; min-width: 120px; position: relative; padding-top: var(--sp-34); text-align: center; font-size: var(--fs-sm); scroll-snap-align: start; }
.df-kit-track-step::before { content: ""; position: absolute; top: var(--sp-14); inset-inline: 0; height: var(--bw-accent); background: var(--ui-line); }
.df-kit-track-step:first-child::before { inset-inline-start: 50%; }
.df-kit-track-step:last-child::before { inset-inline-end: 50%; }
.df-kit-track-step.is-done::before { background: var(--ui-brand); }
.df-kit-track-dot { position: absolute; top: var(--sp-3); left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: var(--r-round); background: var(--ui-surface); border: var(--bw-accent) solid var(--ui-line-strong); display: grid; place-items: center; z-index: 1; }
.df-kit-track-dot svg { width: var(--ic-13); height: var(--ic-13); }
.df-kit-track-step.is-done .df-kit-track-dot { background: var(--ui-brand); border-color: var(--ui-brand); color: var(--ui-on-brand); }
.df-kit-track-step.is-current .df-kit-track-dot { border-color: var(--ui-gold); box-shadow: 0 0 0 var(--sp-5) var(--ui-gold-wash); }
.df-kit-track-step.is-red .df-kit-track-dot { background: var(--ui-error); border-color: var(--ui-error); color: var(--ui-on-danger); }
.df-kit-track-step b { display: block; color: var(--ui-ink); font-size: var(--fs-sm); }
.df-kit-track-step small { color: var(--ui-muted); }
.df-kit-track-step.is-me b { color: var(--ui-heading); }
.df-kit-track-step.is-me small { color: var(--ui-brand-ink); font-weight: var(--fw-bold); }   /* rule 37 (owner 2 Nov): no gold text on a light surface */
.df-kit-track-step a { color: inherit; display: block; text-decoration: none; }
.df-kit-track-step a:hover b { color: var(--ui-brand-ink); text-decoration: underline; }
:root[data-theme="dark"] .df-kit-track-step.is-done .df-kit-track-dot { border-color: var(--dk-brand-line); }

/* ---------- app icons (M5, <x-ui.app-icon>; Lane B's Apps menu M1-M10 uses them, enhancement spec R4) ----------
   default = Hamly green square, white glyph (phone app grid, app page tiles); .is-plain = light rail's inactive app
   (white square, green glyph; in dark the green square with outline); .is-on = selected app (green; gold in dark).
   Sizes: --app-icon-size on the element or .is-sm / .is-lg. */
.df-app-icon { --_s: var(--app-icon-size); inline-size: var(--_s); block-size: var(--_s); flex: none; display: inline-grid; place-items: center;
  border-radius: var(--app-icon-radius); background: var(--app-icon-bg); color: var(--app-icon-glyph);
  box-shadow: var(--app-icon-highlight), var(--app-icon-shadow), 0 0 0 var(--bw) var(--app-icon-outline); }
.df-app-icon.is-sm { --_s: var(--sp-32); }
.df-app-icon.is-lg { --_s: calc(var(--sp-28) * 2); }
.df-app-icon > svg { inline-size: var(--app-icon-glyph-size); block-size: var(--app-icon-glyph-size); stroke-width: var(--app-icon-stroke); }
.df-app-icon.is-plain { background: var(--app-icon-plain-bg); color: var(--app-icon-plain-glyph); box-shadow: 0 0 0 var(--bw) var(--app-icon-plain-line); }
.df-app-icon.is-on { background: var(--app-icon-on-bg); color: var(--app-icon-on-glyph); box-shadow: var(--app-icon-highlight), var(--app-icon-shadow); }

/* ---------- today's markup on kit pages (12 Oct, Windows 2's findings after the merge) ----------
   select2 hides the original select absolutely positioned with its inline width:100%; today's pages clip it with
   section.content, kit pages do not, so on an Arabic page it hung off the left edge and the page scrolled sideways. */
#df-page .select2-hidden-accessible { width: 1px !important; }
/* today's form labels and help lines on kit pages take the prototype's .df-label (13px semibold) and .df-hint (12px
   muted); Windows 2's measurement 13 Oct (vendor.css: label bold, .help-block 14px grey) */
#df-page :is(.form-group > label, label.control-label) { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--ui-ink); }
#df-page .help-block { font-size: var(--fs-sm); color: var(--ui-muted); }
/* Dark mode: today's fields, core widget cards and module cards (hk-*) kept on kit pages paint #fff while the text
   follows the dark ink (light on white, unreadable). In dark they take the shell tokens; light mode is untouched. */
:root[data-theme="dark"] #df-page .form-control, :root[data-theme="dark"] #df-page textarea:not(.df-textarea),
:root[data-theme="dark"] #df-page select:not(.df-input), :root[data-theme="dark"] #df-page .input_number,
:root[data-theme="dark"] #df-page .input-group-addon, :root[data-theme="dark"] #df-page .select2-container--default .select2-selection,
:root[data-theme="dark"] #df-page .btn-default {
  background: var(--ui-surface) !important; color: var(--ui-ink) !important; border-color: var(--ui-line-strong) !important; }
/* an icon-only leading addon is an overlay (ui-theme.css:154): keep it transparent in dark too, or it covers the input's first characters (lane D, 24 Oct) */
:root[data-theme="dark"] #df-page .input-group > .input-group-addon:first-child:not(:has(input, select, button, textarea, [data-toggle])) {
  background: transparent !important; border-color: transparent !important; }
:root[data-theme="dark"] #df-page .select2-container--default .select2-selection__rendered { color: var(--ui-ink) !important; }
:root[data-theme="dark"] #df-page .form-control[readonly], :root[data-theme="dark"] #df-page .form-control[disabled] { background: var(--ui-ro) !important; }
:root[data-theme="dark"] #df-page .form-control::placeholder, :root[data-theme="dark"] #df-page textarea::placeholder { color: var(--ui-placeholder) !important; }
:root[data-theme="dark"] #df-page .form-control:focus { border-color: var(--ui-brand-ink) !important; box-shadow: var(--focus-ring) !important; }
/* core components.widget card (tw-bg-white tw-rounded-xl tw-ring-1, title h3.box-title) */
:root[data-theme="dark"] #df-page .tw-bg-white.tw-rounded-xl.tw-ring-1 { background: var(--ui-surface) !important; color: var(--ui-ink); --tw-ring-color: var(--ui-line); }
:root[data-theme="dark"] #df-page .tw-bg-white.tw-rounded-xl.tw-ring-1 .box-title { color: var(--ui-heading) !important; }
/* module cards (each module's ui/css: hk-card, hk-panel, hk-kpi, hk-dkpi, hk-dash-head) and their headings / tables */
:root[data-theme="dark"] #df-page :is(.hk-card, .hk-panel, .hk-kpi, .hk-dkpi, .hk-dash-head) {
  background: var(--ui-surface) !important; color: var(--ui-ink); border-color: var(--ui-line) !important; }
:root[data-theme="dark"] #df-page :is(.hk-card-head h4, .hk-section > h3, .hk-panel .box-title) { color: var(--ui-heading) !important; }
/* today's submit buttons that app.js wraps in .form-actions-card (ui-theme.css paints it #fff): in dark it takes the
   shell surface (Windows 2's finding 13 Oct); kit buttons opt out of the card altogether (no-actions-card) */
:root[data-theme="dark"] #df-page .form-actions-card { background: var(--ui-surface); border-color: var(--ui-line); }
/* lifted kit-wide from Windows 2's Fleet / Manufacturing fix (0cdefe25, 14 Oct): today's server-drawn SVG charts paint
   the donut track and grid light grey and the centre value near black; today's grey total rows (AdminLTE .bg-gray,
   !important) and the core filter card's title and hover stay light. In dark they take the shell colours. */
:root[data-theme="dark"] #df-page svg :is(circle[stroke="#eef0f2"], line[stroke="#eef0f2"]) { stroke: var(--ui-line); }
:root[data-theme="dark"] #df-page svg text[fill="#1f2937"] { fill: var(--ui-ink); }
:root[data-theme="dark"] #df-page svg text[fill="#6b7280"] { fill: var(--ui-icon); }
:root[data-theme="dark"] #df-page tr.bg-gray, :root[data-theme="dark"] #df-page tr.bg-gray > :is(th, td) { background: var(--ui-surface-2) !important; color: var(--ui-ink) !important; }
:root[data-theme="dark"] #df-page .pf-btn :is(.tw-text-gray-900, svg) { color: var(--ui-heading); }
:root[data-theme="dark"] #df-page .pf-btn:hover { background: var(--ui-flash); }
:root[data-theme="dark"] #df-page .hk-card.hk-danger .hk-card-head { background: var(--ui-error-wash) !important; }
:root[data-theme="dark"] #df-page .hk-card.hk-danger .hk-card-head h4 { color: var(--ui-error) !important; }
:root[data-theme="dark"] #df-page .hk-panel table.table > thead > tr > th { background: var(--ui-surface-2) !important; color: var(--ui-muted) !important; }
:root[data-theme="dark"] #df-page .hk-panel table.table > tbody > tr:hover > td { background: var(--ui-hover) !important; }
:root[data-theme="dark"] #df-page :is(.hk-panel, .hk-card) .table > * > tr > * { border-color: var(--ui-line) !important; }
:root[data-theme="dark"] #df-page .hk-kpi-gold .hk-kpi-icon { background: var(--ui-warn-wash) !important; color: var(--ui-warn-ink) !important; }
:root[data-theme="dark"] #df-page .hk-kpi-red .hk-kpi-icon { background: var(--ui-error-wash) !important; color: var(--ui-error) !important; }
:root[data-theme="dark"] #df-page .hk-kpi-blue .hk-kpi-icon { background: var(--ui-surface-2) !important; color: var(--ui-ink) !important; }

/* S1 settings page (owner row S1, 14 Oct 2026, R1.1; <x-ui.settings-page>, prototype settings.css 11-30 and 98-113 with
   dark.css 220-243): "Search all settings", the categories nav with counts and unsaved dots, the category head and the
   search results. The prototype's own class names (the parity tool compares them) and its breakpoints (1100, 900, 640) */
.df-set-search { position: relative; display: flex; align-items: center; gap: var(--sp-10); margin-bottom: var(--sp-18); max-width: none; }
.df-set-search .df-icon-input { flex: 1; min-width: 0; }
.df-set-search .df-input { min-height: 46px; font-size: var(--fs-lg); padding-inline-end: calc(var(--sp-40) + var(--sp-4)); }
.df-set-slash { position: absolute; inset-inline-end: var(--sp-12); top: 50%; transform: translateY(-50%); pointer-events: none; }
.df-set-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--sp-20); align-items: start; }
.df-set-main { min-width: 0; outline: none; }
.df-set-nav { background: var(--ui-surface); border: var(--bw) solid var(--ui-line); border-radius: var(--ui-radius-card); padding: var(--sp-8); }
.df-set-nav:empty { display: none; }
.df-set-cat { display: flex; align-items: center; gap: var(--sp-10); padding: var(--sp-9) var(--sp-10); border-radius: var(--r-lg); color: var(--ui-ink); text-decoration: none; font-weight: var(--fw-semibold); font-size: var(--fs-base); }
.df-set-cat svg { width: var(--ic-18); height: var(--ic-18); flex: none; color: var(--ui-muted); }
.df-set-cat:hover, .df-set-cat:focus { background: var(--ui-bg); color: var(--ui-ink); text-decoration: none; }
.df-set-cat.is-active { background: var(--ui-brand-soft); color: var(--ui-heading); }
.df-set-cat.is-active svg { color: var(--ui-brand-ink); }
.df-set-catname { flex: 1; min-width: 0; }
.df-set-count { font-size: var(--fs-xs); font-weight: var(--fw-bold); background: var(--ui-warn-wash); color: var(--ui-warn-ink); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-7); }
.df-set-dot { width: 8px; height: 8px; border-radius: var(--r-round); background: var(--ui-gold); flex: none; }
.df-set-sub { display: grid; padding: var(--sp-2) 0 var(--sp-8); margin-inline-start: var(--sp-28); border-inline-start: var(--bw-2) solid var(--ui-line); }
.df-set-sub a { font-size: var(--fs-md); color: var(--ui-muted); text-decoration: none; padding: var(--sp-5) var(--sp-10); border-radius: var(--r-md); }
.df-set-sub a:hover, .df-set-sub a:focus { color: var(--ui-heading); background: var(--ui-bg); text-decoration: none; }
.df-set-cathead { margin: var(--sp-2) 0 var(--sp-14); }
.df-set-cathead h2 { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-140); color: var(--ui-heading); display: flex; gap: var(--sp-10); align-items: center; }
.df-set-cathead h2 svg { width: var(--ic-22); height: var(--ic-22); color: var(--ui-gold-dark); }
.df-set-cathead p { margin: var(--sp-4) 0 0; font-size: var(--fs-md); }
.df-kit-setcat[hidden], [data-kit-set-res][hidden], .df-sb[hidden] { display: none; }   /* .df-sb: the bar of a form whose category is closed */
.df-kit-setrow.is-flash, .df-kit-set.is-flash { animation: df-kit-set-flash var(--dur-flash) ease-out; }
@keyframes df-kit-set-flash { 0%, 35% { background: var(--ui-gold-wash); box-shadow: 0 0 0 var(--sp-8) var(--ui-gold-wash); } 100% { background: transparent; box-shadow: 0 0 0 var(--sp-8) transparent; } }
.df-set-reshead { display: flex; gap: var(--sp-10); align-items: baseline; flex-wrap: wrap; margin-bottom: var(--sp-10); font-size: var(--fs-base); }
.df-set-keyhint { font-size: var(--fs-sm); }
.df-set-results { background: var(--ui-surface); border: var(--bw) solid var(--ui-line); border-radius: var(--ui-radius-card); padding: var(--sp-6); }
.df-set-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-12); padding: var(--sp-10) var(--sp-12); border-radius: var(--r-lg); cursor: pointer; }
.df-set-result + .df-set-result { margin-top: var(--sp-2); }
.df-set-result[aria-selected="true"] { background: var(--ui-brand-soft); box-shadow: inset var(--bw-accent) 0 0 var(--kit-sel-line); }
[dir="rtl"] .df-set-result[aria-selected="true"] { box-shadow: inset calc(-1 * var(--bw-accent)) 0 0 var(--kit-sel-line); }
.df-set-result:hover { background: var(--kit-detail-hover); }
.df-set-rcrumb { font-size: var(--fs-sm); color: var(--ui-muted); grid-column: 1 / -1; }
.df-set-rtitle { font-weight: var(--fw-semibold); }
.df-set-rtitle mark, .df-set-rdesc mark { background: var(--ui-gold-wash); color: inherit; border-radius: var(--r-xs); padding: 0 var(--sp-1); }
.df-set-rdesc { font-size: var(--fs-md); color: var(--ui-muted); grid-column: 1 / 2; }
.df-set-rside { grid-row: 2 / 4; grid-column: 2; align-self: center; display: flex; gap: var(--sp-6); align-items: center; }
.df-set-empty { padding: calc(var(--sp-24) + var(--sp-2)); text-align: center; color: var(--ui-muted); }
@media (max-width: 1100px) {
  .df-set-layout { grid-template-columns: 210px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .df-set-layout { grid-template-columns: minmax(0, 1fr); gap: var(--sp-12); }
  .df-set-nav { position: sticky; top: var(--df-top, 0px); z-index: var(--z-sticky); display: flex; gap: var(--sp-6); overflow-x: auto; padding: var(--sp-6); border-radius: var(--r-xl); scrollbar-width: thin; }
  .df-set-navgrp { flex: none; }
  .df-set-cat { white-space: nowrap; padding: var(--sp-7) var(--sp-10); font-size: var(--fs-md); border: var(--bw) solid var(--ui-line); }
  .df-set-cat.is-active { border-color: var(--kit-sel-line); }
  .df-set-sub { display: none; }
}
@media (max-width: 640px) {
  .df-set-result { grid-template-columns: minmax(0, 1fr); }
  .df-set-rside { grid-row: auto; grid-column: 1; }
}

/* the settings SHELL (UI rule 49, <x-ui.settings-page shell>, AI-CONFIG-01a): a fixed left menu with the search inside it,
   the open section on the right; on a phone the menu is a full-width list and a section opens on its own with "All sections" */
.is-shell .df-set-menu { position: sticky; top: calc(var(--df-top, 0px) + var(--sp-12)); display: flex; flex-direction: column; gap: var(--sp-10);
  max-height: calc(100vh - var(--df-top, 0px) - var(--sp-24)); overflow-y: auto; scrollbar-width: thin; }
.is-shell .df-set-search { margin: 0; max-width: none; }
.is-shell .df-set-search .df-input { min-height: 40px; font-size: var(--fs-md); }
.is-shell .df-set-back { display: none; }
@media (max-width: 900px) {
  .is-shell .df-set-menu { position: static; max-height: none; overflow: visible; }
  .is-shell .df-set-nav { position: static; display: block; overflow: visible; padding: var(--sp-6); border-radius: var(--ui-radius-card); }
  .is-shell .df-set-cat { white-space: normal; border: 0; min-height: 44px; padding: var(--sp-10) var(--sp-12); font-size: var(--fs-md); }
  .is-shell .df-set-navgrp + .df-set-navgrp { border-top: var(--bw) solid var(--ui-line); }
  .is-shell .df-set-sub { display: none; }
  .is-shell .df-set-search .df-input { min-height: 44px; }   /* 44 px touch targets on a phone (W3d, 3 Nov) */
  .is-shell.is-list .df-set-main { display: none; }
  .is-shell.is-list.is-searching .df-set-main { display: block; }
  .is-shell.is-searching .df-set-nav { display: none; }
  .is-shell:not(.is-list) .df-set-menu { display: none; }
  .is-shell .df-set-back { display: inline-flex; align-items: center; gap: var(--sp-6); min-height: 44px; min-width: 44px; margin-bottom: var(--sp-10); padding: 0 var(--sp-4);
    background: none; border: 0; color: var(--ui-brand-ink); font-weight: var(--fw-semibold); cursor: pointer; }
  .is-shell .df-set-back svg { transform: scaleX(-1); }
  [dir="rtl"] .is-shell .df-set-back svg { transform: none; }
}

/* top bar items modules add right after "Search or jump to" (App\Support\V2Shell::headerItem, Lane E's "Ask Hamly", owner 16 Oct) */
.df-top-slot { display: inline-flex; align-items: center; gap: var(--sp-6); flex: none; min-width: 0; }

/* an input with its button on one line (e.g. Quick call), and a card's own save row at its end (card forms outside a save bar) */
.df-kit-inline { display: flex; align-items: center; gap: var(--sp-6); }
.df-kit-inline > .df-input { flex: 1; min-width: 0; }
.df-kit-card-foot { display: flex; justify-content: flex-end; gap: var(--sp-8); margin-top: var(--sp-12); }
.df-kit-card-foot.is-start { justify-content: flex-start; }

/* a board of columns (CRM pipeline, kanban): columns scroll sideways, cards scroll inside a column; tokens only */
.df-kit-board { display: flex; gap: var(--sp-10); overflow-x: auto; padding-bottom: var(--sp-8); -webkit-overflow-scrolling: touch; }
.df-kit-bcol { min-width: 260px; width: 260px; max-height: 72vh; display: flex; flex-direction: column; background: var(--ui-surface-2); border: var(--bw) solid var(--ui-line); border-radius: var(--r-lg); }
.df-kit-bcol.over { background: var(--ui-hover); border-color: var(--ui-brand); }
.df-kit-bcol-head { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-10) var(--sp-12); border-bottom: var(--bw) solid var(--ui-line); }
.df-kit-bcol-head b { color: var(--ui-heading); font-weight: var(--fw-semibold); }
.df-kit-bcol-head small, .df-kit-bcard small { color: var(--ui-muted); font-size: var(--fs-xs); }
.df-kit-bcards { flex: 1; min-height: 60px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-6); padding: var(--sp-6); }
.df-kit-bcard { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-8) var(--sp-10); background: var(--ui-surface); border: var(--bw) solid var(--ui-line); border-radius: var(--r-md); font-size: var(--fs-sm); cursor: grab; }
.df-kit-bcard.is-rot { border-inline-start: var(--bw-accent) solid var(--ui-error); }
.df-kit-bcard.dragging { opacity: 0.5; }
.df-kit-bempty { padding: var(--sp-8); text-align: center; color: var(--ui-muted); font-size: var(--fs-xs); }
@media (max-width: 767px) { .df-kit-bcol { min-width: 82vw; width: 82vw; } }

/* a conversation (support requests): the customer's messages start-aligned, staff replies end-aligned; tokens only */
.df-kit-thread { display: flex; flex-direction: column; gap: var(--sp-10); }
.df-kit-msg { max-width: 80%; padding: var(--sp-10) var(--sp-14); border-radius: var(--r-lg); background: var(--ui-surface-2); border: var(--bw) solid var(--ui-line); }
.df-kit-msg.is-staff { margin-inline-start: auto; background: var(--ui-brand-soft); border-color: var(--ui-brand-ring); }
.df-kit-msg small { display: block; margin-bottom: var(--sp-4); color: var(--ui-muted); font-size: var(--fs-xs); }
.df-kit-msg div { white-space: pre-wrap; }

/* <x-ui.select> (js/app-v2/kit-select.js): the one shared select. 32 px desktop, 40 px touch, popup in the portal, bottom sheet on phones. */
.df-xsel { position: relative; width: 100%; }
.df-xsel-box { display: flex; align-items: center; gap: var(--sp-8); width: 100%; min-height: var(--ui-field-h); padding: var(--sp-2) var(--sp-10); border: var(--bw) solid var(--ui-line-strong); border-radius: var(--ui-radius); background: var(--ui-surface); color: var(--ui-ink); font-size: var(--fs-base); line-height: var(--lh-150); cursor: pointer; outline: none; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.df-xsel-box:focus-visible, .df-xsel-box[aria-expanded="true"] { border-color: var(--ui-brand); box-shadow: 0 0 0 var(--sp-3) var(--ui-brand-ring); }
.df-xsel.has-error .df-xsel-box { border-color: var(--ui-error); }
.df-xsel.has-error .df-xsel-box:focus-visible { box-shadow: 0 0 0 var(--sp-3) var(--ui-error-wash); }
.df-xsel.is-ro .df-xsel-box { background: var(--ui-ro); color: var(--ui-muted); border-color: var(--ui-line); cursor: not-allowed; }
.df-xsel-vals { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.df-xsel-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-xsel-ph { color: var(--ui-placeholder); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-xsel-caret { flex: none; color: var(--ui-icon); width: var(--sp-16); height: var(--sp-16); }
.df-xsel-box[aria-expanded="true"] .df-xsel-caret { transform: rotate(180deg); }
.df-xsel-chip { display: inline-flex; align-items: center; gap: var(--sp-4); max-width: 100%; padding: 0 var(--sp-4) 0 var(--sp-8); border-radius: var(--r-pill); background: var(--ui-brand-soft); color: var(--ui-heading); font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: var(--lh-150); }
.df-xsel-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-xsel-chip button { display: grid; place-items: center; width: var(--sp-20); height: var(--sp-20); padding: 0; border: 0; border-radius: var(--r-pill); background: transparent; color: inherit; cursor: pointer; flex: none; }
.df-xsel-chip button:hover { background: var(--ui-brand-ring); }
.df-xsel-chip svg { width: var(--sp-12); height: var(--sp-12); }
.df-xsel-pop { position: fixed; z-index: var(--z-picker); display: flex; flex-direction: column; overflow: hidden; background: var(--ui-surface); border: var(--bw) solid var(--ui-line-strong); border-radius: var(--r-lg); box-shadow: var(--ui-shadow-pick); }
.df-xsel-sbox { padding: var(--sp-8); border-bottom: var(--bw) solid var(--ui-line); }
.df-xsel-sbox.is-hidden { position: absolute; width: var(--sp-1); height: var(--sp-1); padding: 0; overflow: hidden; opacity: 0; border: 0; }
.df-xsel-q { width: 100%; min-height: var(--sp-32); padding: var(--sp-2) var(--sp-10); border: var(--bw) solid var(--ui-line-strong); border-radius: var(--ui-radius); background: var(--ui-surface); color: var(--ui-ink); font-size: var(--fs-base); outline: none; }
.df-xsel-q:focus { border-color: var(--ui-brand); box-shadow: 0 0 0 var(--sp-3) var(--ui-brand-ring); }
.df-xsel-list { list-style: none; margin: 0; padding: var(--sp-4); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: var(--sp-2); }
.df-xsel-opt { display: flex; align-items: center; gap: var(--sp-8); min-height: var(--sp-32); padding: var(--sp-4) var(--sp-10); border-radius: var(--r-md); cursor: pointer; font-size: var(--fs-base); line-height: var(--lh-150); }
.df-xsel-ot { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.df-xsel-opt.is-active { background: var(--ui-brand-soft); }
.df-xsel-opt[aria-selected="true"] { font-weight: var(--fw-semibold); color: var(--ui-heading); }
.df-xsel-ck { flex: none; color: var(--ui-brand); }
.df-xsel-none { padding: var(--sp-10); color: var(--ui-muted); font-size: var(--fs-sm); text-align: center; }
.df-xsel-back { display: none; }
@media (pointer: coarse), (max-width: 640px) {
  .df-xsel-box { min-height: var(--sp-40); }
  .df-xsel-q { min-height: var(--sp-40); }
  .df-xsel-opt { min-height: var(--sp-40); }
}
@media (max-width: 640px) {
  .df-xsel-back { display: block; position: fixed; inset: 0; z-index: var(--z-picker); background: var(--ui-overlay); }
  .df-xsel-pop.is-sheet { inset: auto 0 0 0; width: auto; max-height: 70vh; border-radius: var(--r-xl) var(--r-xl) 0 0; z-index: calc(var(--z-picker) + 1); }
}

/* ---------- <x-ui.upload>: the shared upload control (owner, 29 Oct); replaces the native "Browse.." button ---------- */
.df-upl { position: relative; display: block; min-inline-size: 0; }
.df-upl-input { position: absolute; inline-size: var(--sp-1); block-size: var(--sp-1); opacity: 0; overflow: hidden; pointer-events: none; }
.df-upl-box { display: flex; align-items: center; gap: var(--sp-10); min-block-size: var(--ui-field-h); padding: var(--sp-6) var(--sp-12); border: var(--bw) dashed var(--ui-line-strong); border-radius: var(--ui-radius);
  background: var(--ui-surface); color: var(--ui-ink); cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast); }
.df-upl-box:hover, .df-upl.is-drag .df-upl-box { border-color: var(--ui-brand); background: var(--ui-brand-soft); }
.df-upl-input:focus-visible + .df-upl-box { border-color: var(--ui-brand); box-shadow: 0 0 0 var(--sp-3) var(--ui-brand-ring); }
.df-upl-ic { flex: none; color: var(--ui-muted); }
.df-upl-tx { display: flex; flex-direction: column; min-inline-size: 0; line-height: var(--lh-130); }
.df-upl-t { font-size: var(--fs-base); font-weight: var(--fw-medium); color: var(--ui-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-upl-s { font-size: var(--fs-sm); color: var(--ui-muted); }
.df-upl.has-error .df-upl-box { border-color: var(--ui-error); }
.df-upl.is-ro .df-upl-box { background: var(--ui-ro); color: var(--ui-muted); cursor: not-allowed; border-color: var(--ui-line); }
.df-upl-list { list-style: none; margin: var(--sp-8) 0 0; padding: 0; display: grid; gap: var(--sp-6); }
.df-upl-list[hidden], .df-upl-err[hidden] { display: none; }
.df-upl-item { display: flex; align-items: center; gap: var(--sp-8); min-block-size: var(--ui-field-h); padding-inline: var(--sp-12) var(--sp-4); border: var(--bw) solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); }
.df-upl-name { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); color: var(--ui-ink); unicode-bidi: plaintext; }
.df-upl-size { flex: none; font-size: var(--fs-sm); color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.df-upl-x { flex: none; display: grid; place-items: center; inline-size: var(--ui-field-h); block-size: var(--ui-field-h); border: 0; background: none; color: var(--ui-muted); cursor: pointer; border-radius: var(--ui-radius); }
.df-upl-x:hover { color: var(--ui-error); background: var(--ui-error-wash); }
.df-upl .df-upl-err { margin-block-start: var(--sp-6); }

.df-xsel > select.df-xsel-native { position: absolute; inset-block-start: 0; inset-inline-start: 0; inline-size: var(--sp-1); block-size: var(--sp-1); opacity: 0; overflow: hidden; pointer-events: none; }

/* ---------- <x-ui.date>: the shared date field (UI-POL-01, 29 Oct) ---------- */
.df-date { position: relative; display: block; min-inline-size: 0; }
.df-date .df-date-in { inline-size: 100%; padding-inline-end: calc(var(--ui-field-h) + var(--sp-4)); text-align: start; }
.df-date-native { position: absolute; inset-block-end: 0; inset-inline-start: 0; inline-size: var(--sp-1); block-size: var(--sp-1); opacity: 0; overflow: hidden; pointer-events: none; }
.df-date-btn { position: absolute; inset-block-start: 0; inset-inline-end: 0; display: grid; place-items: center; inline-size: var(--ui-field-h); block-size: var(--ui-field-h); border: 0; background: none; color: var(--ui-muted); cursor: pointer; border-radius: var(--ui-radius); }
.df-date-btn:hover { color: var(--ui-brand); }
.df-date-btn:focus-visible { outline: none; box-shadow: 0 0 0 var(--sp-3) var(--ui-brand-ring); }
.df-date.has-error .df-date-in { border-color: var(--ui-error); }
.df-date.is-ro .df-date-btn { cursor: not-allowed; color: var(--ui-muted); }
.df-date .df-date-err { display: block; margin-block-start: var(--sp-6); }
.df-date .df-date-err[hidden] { display: none; }

/* x-ui.choice: a short fixed choice as one row of buttons (radios inside) */
.df-choice { display: inline-flex; flex-wrap: wrap; gap: var(--sp-4); padding: var(--sp-3); border: var(--bw) solid var(--ui-line); border-radius: var(--r-lg); background: var(--ui-surface); max-inline-size: 100%; }
.df-choice-o { position: relative; display: inline-flex; margin: 0; }
.df-choice-o input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.df-choice-o span { display: inline-flex; align-items: center; min-block-size: var(--ui-field-h); padding: 0 var(--sp-12); border-radius: var(--r-md); font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--ui-muted); white-space: nowrap; }
.df-choice-o:hover span { color: var(--ui-heading); }
.df-choice-o input:checked + span { background: var(--ui-brand-soft); color: var(--ui-brand-ink); box-shadow: inset 0 0 0 var(--bw) var(--ui-brand); }
.df-choice-o input:focus-visible + span { box-shadow: 0 0 0 var(--sp-3) var(--ui-brand-ring); }
.df-choice-o input:disabled + span { opacity: .55; cursor: not-allowed; }
.df-choice.has-error { border-color: var(--ui-error); }
@media (pointer: coarse) { .df-choice-o span { min-block-size: 44px; } }

/* dark mode: the file-input widget (Krajee: Edit shipping documents, attachments) and the hotel clause / room-line boxes follow the tokens, no white boxes (UI-POL-01 k) */
:root[data-theme="dark"] .file-input .file-preview, :root[data-theme="dark"] .file-input .file-drop-zone, :root[data-theme="dark"] .file-input .file-preview-frame,
:root[data-theme="dark"] .file-input .file-caption, :root[data-theme="dark"] .file-input .kv-fileinput-caption, :root[data-theme="dark"] .krajee-default.file-preview-frame {
  background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-ink);
}
:root[data-theme="dark"] .file-input .file-drop-zone-title, :root[data-theme="dark"] .file-input .file-footer-caption { color: var(--ui-muted); }
:root[data-theme="dark"] .file-input .file-drop-zone.clickable:hover { border-color: var(--ui-brand); }

/* phone: dialogs open full screen (UI-POL-01 e) */
@media (max-width: 767px) {
  .df-modal { inline-size: 100% !important; max-inline-size: none; block-size: 100vh; block-size: 100svh; max-block-size: none !important; border-radius: 0 !important; }
  .df-drawer { inline-size: 100%; }
}

/* the empty state is a row inside the table body */
.df-kit-table tbody tr.df-kit-empty-row:hover td { background: none; }
.df-kit-table tbody tr.df-kit-empty-row td.df-kit-list-empty { padding: var(--sp-32) var(--sp-16); text-align: center; border-block-end: 0; }

/* the location filter in the page head is the kit select (the pin sits inside its box) */
.df-loc-sel .df-xsel { min-inline-size: 200px; max-inline-size: 320px; }
.df-loc-sel .df-xsel .df-xsel-box { padding-inline-start: var(--sp-32); }
.df-loc-sel > svg.df-loc-pin { z-index: 1; }
.df-loc-sel select.df-xsel-native { block-size: var(--sp-1); min-inline-size: 0; max-inline-size: none; padding: 0; border: 0; box-shadow: none; }

/* tablet (768 to 900): the settings page keeps its categories beside the form, two columns (owner rule C); the one-column bar is for phones */
@media (min-width: 768px) and (max-width: 900px) {
  .df-set-layout { grid-template-columns: 200px minmax(0, 1fr); gap: var(--sp-16); }
  .df-set-nav { position: static; display: block; overflow: visible; padding: var(--sp-8); border-radius: var(--ui-radius-card); }
  .df-set-cat { white-space: normal; padding: var(--sp-9) var(--sp-10); border: 0; }
  .df-set-sub { display: grid; }
}

/* KPI cards fill the row evenly: 4 cards in 4 columns, 2 in 2, 7 or 8 in 4 (never 3 and 1) */
.df-kit-page:is([data-cw="one"], [data-cw="mid"], [data-cw="two"], [data-cw="wide"]) .df-kit-kpis:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.df-kit-page:is([data-cw="one"], [data-cw="mid"], [data-cw="two"], [data-cw="wide"]) .df-kit-kpis:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.df-kit-page:is([data-cw="one"], [data-cw="mid"], [data-cw="two"], [data-cw="wide"]) .df-kit-kpis:has(> :nth-child(7)):has(> :nth-child(8):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.df-kit-page[data-cw="one"] .df-kit-kpis:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* DocForm's own .df-date-btn (doc-form.css: top 50%, translateY(-50%), 34 px) must not move the kit date button */
.df-date[data-ui-date] > .df-date-btn { inset-block-start: 0; top: 0; inset-inline-end: 0; transform: none; inline-size: var(--ui-field-h); block-size: var(--ui-field-h); width: var(--ui-field-h); height: var(--ui-field-h); border-radius: var(--ui-radius); }
/* RTL: the date text is LTR digits; the calendar button stays on the page's trailing (left) side, so the digits sit at the right edge, clear of it */
[dir="rtl"] .df-date[data-ui-date] .df-date-in { text-align: right; padding-inline-end: var(--sp-12); padding-inline-start: calc(var(--ui-field-h) + var(--sp-4)); }

/* Lane D's inventory fixes, taken into the kit (owner 30 Oct): a unit word in a line row is never cut; the two helper classes of server-built row HTML */
.df-v2 .df-nowrap { white-space: nowrap; }
.df-v2 .df-flex { display: flex; }
.df-v2 .df-kit-table.df-lines td { white-space: normal; overflow: visible; text-overflow: clip; }

/* MAP-METHOD banner (purchase form, Home): sits in the page column like the page's own cards, not edge to edge (Lane U 31 Oct, C2) */
.df-map-banner { margin: var(--sp-16) var(--sp-24) 0; }
@media (max-width: 900px) { .df-map-banner { margin: var(--sp-12) var(--sp-16) 0; } }

/* LIST-TPL-01 (owner 6 Nov): an Overdue that was partly paid carries a small "partly paid" line under its pill */
.df-v2 .df-st-sub { display: block; font-size: var(--fs-xs); color: var(--ui-muted); margin-top: var(--sp-2); }

/* LIST-TPL-01 (D-57) L11: the totals bar of every row in the filter, then "26–50 of 71", page size, ‹ page 2 / 3 › */
.df-kit-totals { display: flex; flex-wrap: wrap; gap: var(--sp-6) var(--sp-16); min-width: 0; }
.df-kit-totals[hidden] { display: none; }
.df-kit-totals b { color: var(--ui-ink); font-weight: var(--fw-semibold); }
.df-kit-pages { color: var(--ui-ink); font-weight: var(--fw-medium); white-space: nowrap; }
.df-kit-page[data-cw="phone"] .df-kit-list-foot { flex-wrap: wrap; }
.df-kit-page[data-cw="phone"] .df-kit-totals { flex-basis: 100%; }
/* L2: the document number is the row's one bold link */
.df-v2 .df-kit-list .df-kit-table .df-kit-docno, .df-v2 .df-kit-list .df-kit-table td[data-card="title"] a { font-weight: var(--fw-semibold); }

/* TR-BTN-01 (D-47): <x-ui.translate> - green text + icon on the Arabic field's label row, opposite the label */
.df-translate { display: inline-flex; align-items: center; gap: var(--sp-4); margin-inline-start: auto; padding: 0; border: 0; background: transparent; color: var(--ui-brand-ink); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; }
.df-translate[hidden] { display: none; }
.df-translate:hover { text-decoration: underline; }
.df-translate:focus-visible { outline: var(--bw-strong) solid var(--ui-brand-ring); outline-offset: var(--sp-2); border-radius: var(--ui-radius-group); }
.df-translate[disabled] { opacity: .5; cursor: progress; }
@media (pointer: coarse) { .df-translate { min-height: var(--kit-row-h); } }

/* LIST-TPL-01 (owner 6 Nov): on touch screens and phone widths the due date ("Due in 10 days" / "Overdue 3 days") is a
   small grey line under the status; on desktop it is the hover, and the line stays for screen readers only (.df-sr) */
@media (pointer: coarse), (max-width: 767px) {
  .df-v2 .df-st-due.df-sr { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: block; font-size: var(--fs-xs); color: var(--ui-muted); }
}
.df-v2 .df-kit-page[data-cw="phone"] .df-st-due.df-sr { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: block; font-size: var(--fs-xs); color: var(--ui-muted); }
