/* =====================================================================
   Anthe ERP — global component styles
   Single source of truth for buttons, cards, modals, forms.
   ===================================================================== */

/* =====================================================================
   ANTHE BRAND PALETTE — navy primary · orange accent · grey neutral.
   The Spruko template + theme-switcher set --primary to violet by default on
   :root; we re-point it to the brand navy with !important so it beats the
   switcher's inline (non-important) setProperty and re-themes every
   bg-primary / text-primary utility + component automatically. Semantic
   colours (success/danger/warning/info) are deliberately left untouched.
   Canonical palette source: anthe_flutter/lib/theme.dart (AppTheme).
   ===================================================================== */
:root {
    --primary: 19 32 60 !important;        /* #13203C deep navy */
    --primary-rgb: 19, 32, 60 !important;  /* comma form for rgba(var(--primary-rgb),…) */
    /* Collapse the semantic palette into the brand set. ONLY navy · grey ·
       orange · red(danger, unchanged) are allowed. This re-themes every
       bg-success / text-info / bg-warning / bg-secondary utility + badge +
       stock cell across the whole app in one shot. */
    --success: 19 32 60 !important;        /* green     → navy (positive/ok)  */
    --info: 19 32 60 !important;           /* cyan-blue → navy                */
    --secondary: 122 129 148 !important;   /* cyan      → grey  (#7A8194)     */
    --warning: 253 122 14 !important;      /* amber     → orange (#FD7A0E)    */
    --anth-navy: #13203C;
    --anth-orange: #FD7A0E;
    --anth-grey: #BEBCBF;
}

/* ---------- Buttons ---------- */
.anth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem .9rem;
    border-radius: .375rem;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: opacity .15s ease, box-shadow .15s ease;
}
.anth-btn i { font-size: 1rem; line-height: 1; }
.anth-btn:hover { opacity: .9; }
.anth-btn:disabled { opacity: .55; cursor: not-allowed; }

.anth-btn--sm  { padding: .35rem .6rem;  font-size: .75rem; }
.anth-btn--lg  { padding: .65rem 1.25rem; font-size: .9rem; }
.anth-btn--block { display: flex; width: 100%; }

.anth-btn--primary   { background: #13203C; color: #fff; }
.anth-btn--secondary { background: #7A8194; color: #fff; }
.anth-btn--success   { background: #13203C; color: #fff; }
.anth-btn--danger    { background: #ef4b4b; color: #fff; }
.anth-btn--warning   { background: #FD7A0E; color: #fff; }
.anth-btn--info      { background: #13203C; color: #fff; }
.anth-btn--light     { background: #f5f6f9; color: #536485; border-color: #e9ecef; }
.anth-btn--dark      { background: #1f2d3d; color: #fff; }

.anth-btn--outline-primary { background: #fff; color: #13203C; border-color: #13203C; }
.anth-btn--outline-danger  { background: #fff; color: #ef4b4b; border-color: #ef4b4b; }

.anth-btn-soft--primary { background: rgba(19,32,60,.12); color: #13203C; }
.anth-btn-soft--success { background: rgba(19,32,60,.10);    color: #13203C; }
.anth-btn-soft--danger  { background: rgba(239,75,75,.12);   color: #ef4b4b; }
.anth-btn-soft--info    { background: rgba(19,32,60,.10);    color: #13203C; }
.anth-btn-soft--warning { background: rgba(253,122,14,.14);  color: #d96a06; }

/* ---------- Brand orange accent (for highlight CTAs / selected states) ---------- */
.anth-btn--accent      { background: #FD7A0E; color: #fff; }
.anth-btn-soft--accent { background: rgba(253,122,14,.14); color: #d96a06; }
.anth-text-accent      { color: #FD7A0E; }

/* Solid brand-coloured badges → readable LIGHT text. After the palette
   collapse, bg-primary/info/success/secondary/dark are all dark (navy/grey),
   so any default-grey or dark badge text was invisible on them. Soft badges
   (.bg-*\/10) keep their pale bg + dark text and are NOT matched here. Orange
   (bg-warning) keeps its own dark text — more legible than white on orange. */
.badge.bg-primary, .badge.bg-secondary, .badge.bg-success,
.badge.bg-info, .badge.bg-danger, .badge.bg-dark { color: #fff !important; }

/* Branded focus ring — orange, mirrors the Flutter app's focused field. */
.form-control:focus, .form-select:focus, .ti-form-input:focus,
textarea.form-control:focus {
    border-color: #FD7A0E !important;
    box-shadow: 0 0 0 .18rem rgba(253,122,14,.20) !important;
}

/* Icon-only action button */
.anth-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.9rem; height: 1.9rem; border-radius: .35rem;
    border: 1px solid transparent; cursor: pointer; font-size: .9rem;
    padding: 0;
}

.anth-btn-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

/* Action-button cluster for listing rows. Keeps the per-row icon buttons
   (View / Edit / Delete …) on ONE tidy row instead of wrapping 2+1 when the
   Actions column is narrow — flex-wrap:nowrap is guaranteed by spec, and
   the fixed-size buttons are told not to shrink. */
.anth-actions { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: nowrap; }
.anth-actions > * { flex: 0 0 auto; }
/* Safety net for listings that still emit bare icon buttons (no .anth-actions
   wrapper yet): never let a cell line-break its action buttons. */
td:has(.anth-icon-btn) { white-space: nowrap; }

/* Filter-chip bar — e.g. the "Show: All / Individual / Kits" row on listings.
   Use these INSTEAD of .anth-tabs for inline chips: .anth-tabs is a tab strip
   and drags in a bottom border + 1.25rem margin that mis-centres the chips. */
.anth-filter-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.anth-chip-group { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* ---------- List bar (components/list_bar.php) ----------
 * The strip above a list table: the screen's FILTERS on the left, its ACTION
 * buttons on the right. Owner, 2026-08-11 — the arrangement approved on Product
 * Master is meant to replicate across the list screens, so it is a component
 * with its own styles rather than .anth-filter-bar plus per-view inline rules.
 *
 * ⚠️ A SEPARATE BLOCK, NOT A MODIFIER ON .anth-filter-bar. Two other views
 *   (products/purchase_index, products/purchase_edit) use that class today with
 *   their own inline gap overrides; adding space-between to it would silently
 *   re-lay-out both. */
.anth-list-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem 1rem; flex-wrap: wrap;
}
.anth-list-bar__filters {
    display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; min-width: 0;
}
.anth-list-bar__label { margin: 0; font-weight: 600; }

/* ===== DROPDOWN CHROME, SHARED BY EVERY LIST FILTER ========================
 *
 * (owner, 2026-08-13: the opened list must look like the vehicle selector too.)
 *
 * ⚠️⚠️ A NATIVE <select>'s OPEN LIST IS DRAWN BY THE OPERATING SYSTEM AND CANNOT
 *   BE STYLED — not its font, not its rows, not its corners. Matching the two
 *   therefore means the closed control keeps being a select-looking button while
 *   the OPEN part is a real element we render. That is why this chrome exists.
 *
 * ⚠️⚠️ ONE DEFINITION, TWO CLASS NAMES. The list-bar's view filter and Product
 *   Master's vehicle filter are the same object visually, so they share these
 *   rules rather than each carrying a copy that drifts the day either is
 *   touched. Add a class here rather than restating the values anywhere else.
 *
 * ⚠️ 44px targets and 8px gaps: these are tapped on a tablet, not only clicked.
 * ℹ️ anth.css busts on filemtime(), NOT APP_VERSION — no version bump needed. */
.anth-dd            { position: relative; display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.anth-dd-btn, .vm-btn {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 44px;
    padding: .4rem .75rem; font-size: .8125rem; font-weight: 500; color: #13203C;
    background: #fff; border: 1px solid #d7dbe4; border-radius: .375rem; cursor: pointer;
}
.anth-dd-btn:hover, .vm-btn:hover { border-color: #9aa4b8; }
.anth-dd-btn:focus-visible, .vm-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.anth-dd-btn[aria-expanded="true"], .vm-btn[aria-expanded="true"] {
    border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.anth-dd-btn[aria-expanded="true"] .anth-dd-caret,
.vm-btn[aria-expanded="true"] .vm-caret { transform: rotate(180deg); }
.anth-dd-caret, .vm-caret { transition: transform .15s ease; }
.anth-dd-label      { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
.anth-dd-panel, .vm-panel {
    position: absolute; z-index: 1050; top: calc(100% + 6px); left: 0; width: 19rem; max-width: 92vw;
    background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem;
    box-shadow: 0 12px 28px rgba(15,23,42,.16);
}
.anth-dd-list       { max-height: 18rem; overflow-y: auto; padding: .35rem; }
.anth-dd-row {
    display: flex; align-items: flex-start; gap: .55rem; width: 100%; min-height: 44px;
    padding: .4rem .5rem; border: 0; border-radius: .375rem; background: none; text-align: left;
    font-size: .8125rem; color: #13203C; cursor: pointer;
}
.anth-dd-row + .anth-dd-row { margin-top: 2px; }
.anth-dd-row:hover  { background: #f1f5f9; }
.anth-dd-row:focus-visible { outline: 2px solid #6366f1; outline-offset: -2px; }
.anth-dd-row[aria-selected="true"] { background: #eef2ff; color: #3730a3; font-weight: 600; }
.anth-dd-tick       { flex: 0 0 1rem; margin-top: .1rem; color: #4f46e5; visibility: hidden; }
.anth-dd-row[aria-selected="true"] .anth-dd-tick { visibility: visible; }
.anth-dd-txt        { flex: 1 1 auto; min-width: 0; }
.anth-dd-hint       { display: block; font-size: .6875rem; font-weight: 400; color: #8c9097; margin-top: .1rem; }
/* The native control stays in the DOM as the source of truth — every existing
   handler still reads its value and hears its change event — but is never seen
   and never focusable, or the page would hold two controls for one question. */
.anth-vsel-native   { display: none !important; }
html.dark .anth-dd-btn, html.dark .vm-btn     { background: #1b2437; color: #e7e9ec; border-color: rgba(255,255,255,.16); }
html.dark .anth-dd-panel, html.dark .vm-panel { background: #1b2437; border-color: rgba(255,255,255,.16); }
html.dark .anth-dd-row      { color: #e7e9ec; }
html.dark .anth-dd-row:hover{ background: rgba(255,255,255,.06); }
html.dark .anth-dd-row[aria-selected="true"] { background: rgba(99,102,241,.22); color: #dfe3ff; }
@media (max-width: 575.98px) { .anth-dd-panel, .vm-panel { width: 100%; } }

/* THE VIEW SELECT, GLOBAL (owner, 2026-08-13: "make it global for all lists").
 *
 * It began scoped to Product Master so it would match the vehicle-model filter
 * beside it; the owner then asked for every list to look the same. It now reaches
 * EVERY screen rendering components/list_bar.php — Product Master, Kits, View
 * Invoice and any future one — which is the point, and is also the whole risk:
 * this is the one rule that changes several screens at once.
 *
 * ⚠️⚠️ .form-select-sm IN THIS BUNDLE CARRIES !important ON padding AND font-size.
 *   A restyle that does not match that specificity SILENTLY LOSES — the same trap
 *   the global search-box restyle hit. Those two declarations must keep it.
 *
 * ⚠️⚠️ '#' MUST BE %23 INSIDE A DATA URI or the chevron vanishes with no error at
 *   all. And a background-image DOES NOT INHERIT color, so dark mode needs its
 *   own copy with a light stroke rather than a filter.
 *
 * ⚠️ 44px tall to match the buttons beside it and to stay a real touch target.
 * ℹ️ anth.css busts on filemtime(), NOT on APP_VERSION — no version bump needed. */
.anth-list-bar__filters .anth-view-select {
    min-height: 44px !important;
    padding: .4rem 2rem .4rem .75rem !important;
    font-size: .8125rem !important;
    font-weight: 500;
    color: #13203C;
    background-color: #fff;
    border: 1px solid #d7dbe4;
    border-radius: .375rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2313203C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .55rem center;
    background-size: 1rem 1rem;
}
.anth-list-bar__filters .anth-view-select:hover { border-color: #9aa4b8; }
.anth-list-bar__filters .anth-view-select:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
html.dark .anth-list-bar__filters .anth-view-select {
    background-color: #1b2437; color: #e7e9ec; border-color: rgba(255,255,255,.16);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e7e9ec' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
/* margin-left:auto so the buttons still hug the right edge when the bar holds
   no filter at all (a list whose only control is "Add …"). */
.anth-list-bar__actions {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-left: auto;
}

/* On a phone each half owns its own line and the buttons lead, so the primary
   action is reachable without scrolling past a filter nobody has touched yet. */
@media (max-width: 767.98px) {
    .anth-list-bar__filters,
    .anth-list-bar__actions { flex: 1 1 100%; min-width: 0; margin-left: 0; }
    .anth-list-bar__actions { order: -1; }
    .anth-list-bar__actions .anth-btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Card / box helpers ---------- */
.anth-section-title {
    font-size: 1rem; font-weight: 600; margin: 0;
    display: flex; align-items: center; gap: .5rem;
}

/* ---------- Modal ---------- */
.anth-modal-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,.55);
    z-index: 1050; display: none; align-items: center; justify-content: center;
    padding: 1rem;
}
.anth-modal-backdrop.open { display: flex; }
.anth-modal-box {
    background: #fff; border-radius: 10px; width: 100%; max-width: 980px;
    max-height: 92vh; display: flex; flex-direction: column;
    box-shadow: 0 18px 45px rgba(0,0,0,.25); overflow: hidden;
}
.anth-modal-box--sm { max-width: 520px; }
.anth-modal-box--md { max-width: 680px; }
/* Added 2026-09-01 for the Research dialog. ⚠️ WITHOUT THIS RULE THE CLASS DID
   NOTHING and the box fell back to the base 980px - not broken, but a seven-column
   country grid scrolled that it need not. The base rule's width:100% still caps it
   to the viewport, so this only widens where there is room to.
   🧭 A CLASS THAT MATCHES NO RULE FAILS SILENTLY AND LOOKS DELIBERATE. */
.anth-modal-box--lg { max-width: 1120px; }
.anth-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid #eef0f3;
}
.anth-modal-header h5 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.anth-modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.anth-modal-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: .5rem;
    padding: 1rem 1.25rem; border-top: 1px solid #eef0f3;
}
.anth-modal-close {
    background: transparent; border: 0; cursor: pointer;
    font-size: 1.35rem; color: #6c757d; line-height: 1; padding: .15rem;
}

/* ---------- Toggle switch ---------- */
.anth-switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.anth-switch input { opacity: 0; width: 0; height: 0; }
.anth-switch .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #cfd4dc; border-radius: 24px; transition: .25s;
}
.anth-switch .slider:before {
    content: ""; position: absolute; height: 18px; width: 18px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .25s;
}
.anth-switch input:checked + .slider { background: #13203C; }
.anth-switch input:checked + .slider:before { transform: translateX(22px); }

/* ---------- File / camera ---------- */
.anth-file-drop {
    border: 1.5px dashed #c9d0da; border-radius: 8px; padding: .85rem;
    text-align: center; background: #fafbfc; cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.anth-file-drop:hover { border-color: #13203C; background: #eff1f6; }

.anth-avatar-ring {
    width: 8rem; height: 8rem; border-radius: 50%; object-fit: cover;
    border: 4px solid #eef0f3;
}

/* ---------- Column-settings grid (datatable modal) ---------- */
.anth-cols-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
    gap: .75rem; list-style: none; padding: 0; margin: 0;
}
@media (max-width: 992px) { .anth-cols-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .anth-cols-grid { grid-template-columns: 1fr; } }
.anth-col-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: .8rem 1rem; border: 1px solid #e9ecef; border-radius: 7px; background: #fff;
}
.anth-col-card.hidden-col { background: #f6f7f9; opacity: .7; }
.anth-col-card label {
    font-size: .875rem; font-weight: 500; color: #1f2d3d; margin: 0;
    flex: 1; min-width: 0;
    /* Two stacked lines since 2026-09-01: the column's NAME, and the department it
       came from. Each truncates on its own, which is why the name is now wrapped in
       .anth-col-name rather than sitting as a bare text node - a text node cannot be
       given text-overflow of its own. */
    display: flex; flex-direction: column; gap: .1rem;
}
.anth-col-card label > span {
    display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* ⚠️ #6c757d, NOT the #8c9097 used for muted text elsewhere. The card is #fff in BOTH
   themes (these cards have no dark variant at all - pre-existing), and #8c9097 on white
   is about 3.1:1, under AA for text this small. #6c757d measures 4.65:1 and is already
   the colour of the eye and drag icons in the same card.
   🧭 A GREY THAT PASSES ON THE PAGE CAN STILL FAIL ON A WHITE CARD. */
.anth-col-origin {
    font-size: .72rem; font-weight: 400; color: #6c757d; letter-spacing: .01em;
}
.anth-col-card .actions { display: flex; align-items: center; gap: .35rem; }
.anth-col-card .vis, .anth-col-card .grab {
    background: transparent; border: 0; padding: .25rem; cursor: pointer;
    font-size: 1.15rem; color: #6c757d;
}
.anth-col-card .grab { cursor: grab; }
.anth-col-card .grab:active { cursor: grabbing; }

/* ---------- DataTable toolbar ----------
 * ONE ROW: controls on the left, search on the right (owner, 2026-08-06).
 * Search used to be emitted by DataTables' own `dom` into a separate strip
 * BELOW this bar, so the two halves of "narrow this list" lived apart. The `f`
 * token was removed from `dom` and .anth-dt-toolbar__search below is the real
 * input, wired to the same dt.search() API. Do not re-add `f`: two boxes would
 * fight over one filter.
 * Shared by the 46 views that render components/datatable.php. */
.anth-dt-toolbar {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: .5rem; margin-bottom: 1rem;
}
.anth-dt-toolbar__controls {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; min-width: 0;
}
.anth-dt-toolbar__search { position: relative; margin-left: auto; min-width: 0; }
.anth-dt-search__icon {
    position: absolute; left: .6rem; top: 50%; transform: translateY(-50%);
    font-size: .95rem; color: #8c9097; pointer-events: none;
}
/* ⚠️⚠️ !important ON PADDING, AND ONLY BECAUSE THE TEMPLATE USED IT FIRST.
 *   The Ynex build ships `.form-control-sm { padding:.25rem .8rem !important;
 *   font-size:.8rem !important; border-color:… !important }`. Without matching
 *   it, `padding-left` is dropped and THE MAGNIFIER SITS UNDER THE TYPED TEXT —
 *   measured at a 16px overlap in the browser, on all 46 lists, after this
 *   shipped. The identical trap is already documented further down this file for
 *   the DataTables-generated input; I rebuilt the control and did not re-apply
 *   the lesson. Everything else here wins on specificity and is left un-important. */
.anth-dt-search__input {
    width: 15rem; max-width: 100%;
    padding: .375rem .8rem .375rem 2rem !important;
}

/* ---------- Opt-in: SEARCH FIRST, and prominent ----------
 * Set $dt_search_first = true on a view to get this. Default OFF: the component
 * is shared by 46 views and the owner approved the layout on Product Master
 * first ("once approved we will do for other pages").
 *
 * Search is the control people actually come to a list for; Columns and Export
 * are occasional. So search leads on the left and grows into the free space,
 * and the occasional controls sit right.
 *
 * ⚠️ `order` + `margin-right:auto`, NOT `flex-direction: row-reverse`. Reversing
 *   the row also reverses the WRAP direction, so at the width where the bar
 *   wraps the controls would jump ABOVE the search instead of below it. Using
 *   order moves the two items and leaves wrapping alone. */
.anth-dt-toolbar--search-first .anth-dt-toolbar__search {
    order: -1; margin-left: 0; margin-right: auto;
    flex: 1 1 24rem; max-width: 34rem;
}
/* ⚠️ font-size / padding / border ALL need !important here — see the note on
 *   .anth-dt-search__input above. .form-control-sm marks all three. */
.anth-dt-toolbar--search-first .anth-dt-search__input {
    width: 100%; height: 2.75rem;
    font-size: .95rem !important;
    padding: .5rem .9rem .5rem 2.6rem !important;
    border: 2px solid rgba(19, 32, 60, .16) !important;
    border-radius: .5rem;
    background-clip: padding-box;
}
.anth-dt-toolbar--search-first .anth-dt-search__input::placeholder { color: #9aa3b0; }
/* Focus uses the brand ORANGE — the one accent in the locked palette. Never a
 * new hue (MASTER §1), and never removing the ring (MASTER §5, Critical). */
/* ⚠️ NO box-shadow HERE ON PURPOSE. The house rule near the top of this file
 *   already gives every .form-control:focus the orange border + ring with
 *   !important, so a non-important ring declared here would silently lose. Only
 *   the border needs restating, because this input's own border is !important
 *   (2px) and would otherwise beat the house rule's colour. Keeping a rule that
 *   never applies is how a file fills up with styling nobody can trust. */
.anth-dt-toolbar--search-first .anth-dt-search__input:focus {
    border-color: #FD7A0E !important;
}
.anth-dt-toolbar--search-first .anth-dt-search__icon { left: .85rem; font-size: 1.05rem; }
.anth-dt-toolbar--search-first .anth-dt-toolbar__controls { flex: 0 0 auto; }

html[data-theme-mode="dark"] .anth-dt-toolbar--search-first .anth-dt-search__input,
[data-theme-mode="dark"] .anth-dt-toolbar--search-first .anth-dt-search__input {
    border-color: rgba(255, 255, 255, .22) !important;
}
html[data-theme-mode="dark"] .anth-dt-toolbar--search-first .anth-dt-search__input:focus,
[data-theme-mode="dark"] .anth-dt-toolbar--search-first .anth-dt-search__input:focus {
    border-color: #FD7A0E !important;
}

/* Below md the search owns its own full-width line; `order` still puts it first,
 * which is what we want — the important control leads on a phone too. */
@media (max-width: 767.98px) {
    .anth-dt-toolbar--search-first .anth-dt-toolbar__search {
        flex: 1 1 100%; max-width: none; margin-right: 0;
    }
    /* ⚠️ THE `flex: 0 0 auto` ABOVE MUST BE RELEASED ON A PHONE. It keeps the
     *   controls from shrinking so they hug the right on a wide screen — but at
     *   375px it also stops them WRAPPING, and the row ran 17px past the viewport
     *   (measured). min-width:0 as well: a flex item defaults to min-width:auto
     *   and will refuse to shrink below its content no matter what flex says. */
    .anth-dt-toolbar--search-first .anth-dt-toolbar__controls {
        flex: 1 1 100%; min-width: 0;
    }
    .anth-dt-toolbar--search-first .anth-dt-export { min-width: 0; }
}

/* Export: pick a format, press one button (replaced four lit-up buttons). */
.anth-dt-export { display: flex; align-items: center; gap: .35rem; }
.anth-dt-export__lbl { margin: 0; font-size: .8125rem; color: #8c9097; }
.anth-dt-export__sel { width: auto; min-width: 8.5rem; }

/* Was three inline style="" attributes repeated per filter in the component. */
.anth-dt-filters { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.anth-dt-filters__item {
    display: flex; align-items: center; gap: .35rem;
    font-size: .8125rem; color: #8c9097; margin: 0;
}
.anth-dt-filters__item select { width: auto; min-width: 9rem; }

/* The list bar's view picker + its note (Product Master's "Show", which was six
   mutually-exclusive chips). Shared by components/list_bar.php, so any screen
   adopting that strip gets the same control. */
.anth-view-select { width: auto; min-width: 14rem; }
.anth-view-hint   { font-size: .78rem; color: #8c9097; }

/* ⚠️ Below sm the search must own its own line, or it squeezes the controls
 *   into a column of one-word buttons. UX rule "Horizontal Scroll" is High and
 *   this bar is the widest fixed content on most list screens. */
@media (max-width: 767.98px) {
    .anth-dt-toolbar__search { margin-left: 0; width: 100%; }
    .anth-dt-search__input   { width: 100%; }
    .anth-view-select        { width: 100%; min-width: 0; }
    .anth-dt-export          { width: 100%; }
    .anth-dt-export__sel     { flex: 1 1 auto; min-width: 0; }
}

/* ⚠️ 44x44 is MASTER §5 Critical and applies to the web — the warehouse runs
 *   these lists on tablets. Scoped to a coarse pointer so a mouse keeps the
 *   dense row (MASTER §2), rather than to a width, which would also inflate a
 *   laptop's toolbar. */
@media (pointer: coarse) {
    .anth-dt-toolbar .anth-btn,
    .anth-list-bar .anth-btn,
    .anth-dt-search__input,
    .anth-dt-export__sel,
    .anth-view-select,
    .anth-dt-filters__item select { min-height: 44px; }
}

/* ---------- Dark mode for the toolbar ----------
 * anth.css is otherwise almost entirely light-only (one data-theme-mode block
 * in 811 lines) while the Spruko switcher IS live — a Tier-0 gap, logged, not
 * fixed here. These rules cover only what this pass added/moved. */
html[data-theme-mode="dark"] .anth-dt-search__icon,
[data-theme-mode="dark"] .anth-dt-search__icon,
html[data-theme-mode="dark"] .anth-dt-export__lbl,
[data-theme-mode="dark"] .anth-dt-export__lbl,
html[data-theme-mode="dark"] .anth-view-hint,
[data-theme-mode="dark"] .anth-view-hint,
html[data-theme-mode="dark"] .anth-dt-filters__item,
[data-theme-mode="dark"] .anth-dt-filters__item { color: #94a3b8; }

/* ---------- DataTable bulk-delete bar & checkbox column ---------- */
.anth-bulk-bar {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: .75rem;
    padding: .55rem .85rem; margin-bottom: .85rem;
    background: #fdecec; border: 1px solid #f5c2c2; color: #8a1f1f;
    border-radius: .5rem; font-size: .8125rem;
}
.anth-bulk-bar[hidden] { display: none !important; }
.anth-bulk-bar__info { display: flex; align-items: center; gap: .5rem; }
.anth-bulk-bar__info i { font-size: 1.1rem; color: #c2392c; }
.anth-bulk-bar__info strong { color: #1f2d3d; font-weight: 600; }
.anth-bulk-bar__actions { display: flex; align-items: center; gap: .4rem; }

.anth-bulk-col {
    width: 38px; text-align: center; vertical-align: middle;
}
table th.anth-bulk-col, table td.anth-bulk-col { padding-left: .5rem; padding-right: .25rem; }
.anth-bulk-cb, .anth-bulk-cb-all {
    width: 16px; height: 16px; cursor: pointer; accent-color: #13203C;
    vertical-align: middle;
}
tr.anth-row-selected > td { background: #f5efff !important; }

/* ---------- Purchase Invoice — Charges & Totals box ---------- */
.anth-tot-box {
    background: #f8f7fd; border: 1px solid #e4dafa; border-radius: 8px;
    padding: .75rem 1rem; font-size: .8125rem;
}
.anth-tot-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: .25rem 0; color: #536485;
}
.anth-tot-row + .anth-tot-row { border-top: 1px dashed #e4dafa; }
.anth-tot-row strong { color: #1f2d3d; font-variant-numeric: tabular-nums; }
.anth-tot-row--big strong { font-size: 1.05rem; color: #13203C; }
.anth-tot-check { margin-top: .55rem; font-size: .8125rem; font-weight: 500; }
.anth-tot-box.anth-tot-ok   { border-color: #bbf7d0; background: #f0fdf4; }
.anth-tot-box.anth-tot-ok   .anth-tot-check { color: #16a34a; }
.anth-tot-box.anth-tot-warn { border-color: #fde68a; background: #fffbeb; }
.anth-tot-box.anth-tot-warn .anth-tot-check { color: #b45309; }

/* ---------- DataTable serial-number column ---------- */
.anth-sn-col {
    width: 52px;
    text-align: right;
    color: #8c9097;
    font-variant-numeric: tabular-nums;
    font-size: .78rem;
}
table th.anth-sn-col, table td.anth-sn-col {
    padding-left: .35rem; padding-right: .6rem;
}
table th.anth-sn-col { color: #536485; font-weight: 600; }

/* ---------- Product Pricing row (brand × supplier) ---------- */
.anth-pricing-row .anth-pp-derived {
    display: flex; flex-direction: column; justify-content: flex-end;
    background: #f8f7fd; border: 1px dashed #ccd2e0; border-radius: 6px;
    padding: .45rem .65rem; font-size: .78rem; color: #536485;
}
.anth-pp-derived__row {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .15rem 0;
}
.anth-pp-derived__row + .anth-pp-derived__row {
    border-top: 1px dashed #e4dafa;
}
.anth-pp-derived__row strong { font-weight: 600; color: #1f2d3d; }
.anth-pp-derived__row span:last-child {
    font-variant-numeric: tabular-nums; font-weight: 600; color: #13203C;
}
@media (max-width: 768px) {
    .anth-pricing-row .anth-pp-derived { margin-top: .35rem; }
}

/* ---------- AnthSearchSelect (Choices.js wrapper) ---------- */
/* Match Choices container to our form-control look */
.choices.anth-ss { margin-bottom: 0; }
.choices.anth-ss .choices__inner {
    background: #fff; border: 1px solid #e6e8ee; border-radius: .375rem;
    padding: .35rem .6rem; min-height: 2.25rem; font-size: .8125rem;
    color: #1f2d3d;
}
.choices.anth-ss.is-focused .choices__inner,
.choices.anth-ss.is-open .choices__inner {
    border-color: #13203C; box-shadow: 0 0 0 .12rem rgba(19,32,60,.12);
}

/*
 * Closed-state inner — works on EVERY Choices dropdown (not just .anth-ss).
 *
 * Default Choices CSS:
 *   .choices__inner { padding: 7.5px 7.5px 3.75px; min-height: 44px; }
 *   .choices__list--single { padding: 4px 16px 4px 4px; }
 *   .choices__list--single .choices__item { padding-bottom: 0; }
 * On a single-select that combination puts the selected text in the
 * bottom-left of a 44px-tall box, with ~10px of empty space above it.
 * Flex-center + tighter min-height fixes both: text sits vertically
 * centred, box is the same height as our other form-controls (~36px).
 */
.choices .choices__inner {
    display: flex !important;
    align-items: center !important;
    min-height: 2.25rem !important;   /* ~36px, matches .form-control */
    padding: .15rem .6rem !important;
    font-size: .8125rem;
}
.choices .choices__list--single {
    padding: 0 1.25rem 0 0 !important; /* leave room for the caret only */
    width: 100%;
    display: flex !important;
    align-items: center !important;
}
.choices .choices__list--single .choices__item {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.4;
}
/*
 * The cloned input inside .choices__inner is what Choices uses for
 * type-to-search. On a single-select it's invisible when a value is
 * shown but still takes vertical space (margin-bottom: 5px + padding)
 * which pushes the selected text to the bottom of the box. Hide it
 * completely on closed single-selects — the search box inside the
 * OPEN dropdown panel still works for finding items.
 */
.choices[data-type*="select-one"] .choices__inner .choices__input--cloned {
    display: none !important;
}

/*
 * Upstream sets margin-bottom: 3.75px on every .choices__item, which
 * stacks extra space between dropdown rows. Zero it out — our padding
 * controls vertical rhythm now.
 */
.choices .choices__list--dropdown .choices__item,
.choices .choices__list[aria-expanded] .choices__item {
    margin: 0 !important;
}
.choices.anth-ss .choices__list--dropdown {
    border: 1px solid #e6e8ee; border-radius: .375rem;
    box-shadow: 0 4px 14px rgba(15, 22, 36, .08);
}
.choices.anth-ss .choices__item--selectable.is-highlighted {
    background: #eaedf3; color: #1f2d3d;
}

/*
 * Choices.js dropdown ITEM density.
 *
 * Default Choices padding renders each option ~38px tall (.75rem top +
 * .75rem bottom) — fine for a chunky mobile UI, way too much in our
 * desktop forms where dropdowns can be 6-30 items long. Tighten across
 * the board so 4 brands don't take half the viewport.
 *
 * Targets every Choices dropdown (not just .anth-ss) so the override
 * applies whether the field was opted in per-select (data-anth-search)
 * or form-wide (data-anth-search-all). The search input inside the
 * dropdown gets the same compact treatment.
 */
.choices .choices__list--dropdown,
.choices .choices__list[aria-expanded] {
    font-size: .8125rem;
}
.choices .choices__list--dropdown .choices__list,
.choices .choices__list[aria-expanded] .choices__list {
    max-height: 280px;
}
/*
 * Two CSS sources fight us on Choices items:
 *   1. Upstream choices.min.css:
 *      .choices__item--selectable { text-align:right; padding-left:100px; padding-right:10px }
 *      .choices__item--selectable { padding-right:100px }     // hover hint space
 *      .choices__item            { padding:10px; font-size:14px }
 *   2. Spruko Ynex theme app-*.css (loaded BEFORE anth.css):
 *      .choices__item--selectable { padding: .75rem !important }
 *      .choices__item            { padding: .025rem .625rem !important;
 *                                  margin-bottom: .25rem !important;
 *                                  border-width: 1px !important }
 *      .choices__item--selectable { padding-left:.75rem !important;
 *                                  padding-right:.75rem !important }
 *      .choices__inner           { padding: .275rem !important }
 *
 * Spruko's selectors all sit at specificity (0,1,0). To outrank them
 * without polluting every selector with !important wars, prefix with
 * `html body` so our specificity becomes (0,3,2)+ — impossible to beat
 * by accident. Then explicitly !important every property that affects
 * height: padding (all 4 sides), margin, border, line-height, min-height.
 */
html body .choices .choices__list--dropdown .choices__item,
html body .choices .choices__list[aria-expanded] .choices__item,
html body .choices .choices__list--dropdown .choices__item--selectable,
html body .choices .choices__list[aria-expanded] .choices__item--selectable {
    padding-top: .3rem !important;
    padding-bottom: .3rem !important;
    padding-left: .65rem !important;
    padding-right: .65rem !important;
    margin: 0 !important;
    border: 0 !important;       /* Spruko sets 1px purple border on every item */
    border-radius: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.35 !important;
    text-align: left !important;
    font-size: .8125rem !important;
    background-color: transparent;  /* let highlight bg show on .is-highlighted only */
}
/* Highlight only applies to the hovered/keyboard-focused item, and we
   restore its purple background here since we zeroed it above. */
html body .choices .choices__list--dropdown .choices__item--selectable.is-highlighted,
html body .choices .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
    background-color: #13203C !important;
    color: #fff !important;
}
/* Hide Choices' "Press to select" hint entirely. */
html body .choices .choices__item--selectable::after { display: none !important; }
/* Search input inside the dropdown — tighter to match. */
.choices .choices__input {
    padding: .35rem .6rem;
    font-size: .8125rem;
    margin-bottom: .25rem;
}
/* "No results" / placeholder rows in the dropdown — same compact rhythm. */
.choices .choices__list--dropdown .choices__item--disabled,
.choices .choices__list[aria-expanded] .choices__item--disabled {
    padding: .3rem .65rem;
    font-size: .75rem;
}

/* When ANY Choices dropdown is open, lift it above sticky form footers
   (.anth-form-actions uses z-index:5). Applies to both AnthSearchSelect
   and AnthLocation. The container becomes the stacking context, so the
   absolutely-positioned dropdown list inherits it correctly. */
.choices.is-open {
    z-index: 50;
    position: relative;
}
.choices .choices__list--dropdown,
.choices .choices__list[aria-expanded] {
    z-index: 51;
}

/* "+ Create new" footer button inside the dropdown */
.anth-ss-add-footer {
    border-top: 1px solid #eef0f3; padding: .25rem; background: #fafbfd;
    border-bottom-left-radius: .375rem; border-bottom-right-radius: .375rem;
    position: sticky; bottom: 0;
}
.anth-ss-add-btn {
    width: 100%; display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem .65rem; border: 0; background: transparent;
    color: #13203C; font-size: .8125rem; font-weight: 600; cursor: pointer;
    border-radius: .3rem; text-align: left;
}
.anth-ss-add-btn:hover { background: #eaedf3; }
.anth-ss-add-btn i { font-size: 1rem; }
.anth-ss-add-dynamic { display: none; }

/* Loading row inside the quick-add modal */
.anth-ss-loading {
    padding: 2rem 0; text-align: center; color: #8c9097; font-size: .8125rem;
}
.anth-ss-loading i { font-size: 1.4rem; display: inline-block; animation: anth-spin 1s linear infinite; vertical-align: -3px; margin-right: .4rem; }

/* Quick-add modal — responsive */
.anth-qadd-box {
    max-width: 640px;
}
body.anth-qadd-open { overflow: hidden; }
@media (max-width: 640px) {
    /* Full-screen on mobile */
    #anth-qadd-modal.anth-modal-backdrop { padding: 0; align-items: stretch; }
    #anth-qadd-modal .anth-qadd-box {
        max-width: 100%; width: 100%; height: 100dvh; border-radius: 0;
        display: flex; flex-direction: column;
    }
    #anth-qadd-modal .anth-modal-body { flex: 1 1 auto; overflow-y: auto; }
    #anth-qadd-modal .anth-modal-footer { position: sticky; bottom: 0; background: #fff; }
}

/* ---------- Misc ---------- */
.anth-hint { font-size: .72rem; color: #8c9097; margin-top: .25rem; }
.anth-required { color: #ef4b4b; }
.anth-divider { border: 0; border-top: 1px dashed #e3e6eb; margin: 1rem 0; }

/* ---------- Per-field validation ---------- */
.anth-field-error {
    color: #ef4b4b; font-size: .72rem; margin-top: .3rem; line-height: 1.35;
    display: block; min-height: .35rem;
}
.form-control.is-invalid,
select.form-control.is-invalid,
textarea.form-control.is-invalid {
    border-color: #ef4b4b !important;
    box-shadow: 0 0 0 .12rem rgba(239,75,75,.12) !important;
}
.form-control.is-valid {
    border-color: #26bf94 !important;
}
.anth-input-checking {
    background-image: none;
}
.anth-check-spin {
    display: inline-block; width: 12px; height: 12px; margin-left: .35rem;
    border: 2px solid #c9d0da; border-top-color: #13203C; border-radius: 50%;
    animation: anth-spin .6s linear infinite; vertical-align: middle;
}
@keyframes anth-spin { to { transform: rotate(360deg); } }

/* ---------- DataTables — professional pagination & controls ---------- */
.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
}
.dataTables_wrapper .dataTables_paginate .pagination {
    display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none;
    justify-content: flex-end;
}
.dataTables_wrapper .dataTables_paginate .page-item .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2rem; height: 2rem; padding: 0 .6rem;
    border: 1px solid #e6e8ee; border-radius: .375rem;
    background: #fff; color: #536485; font-size: .8125rem; font-weight: 500;
    cursor: pointer; text-decoration: none; transition: all .15s ease;
}
.dataTables_wrapper .dataTables_paginate .page-item .page-link:hover {
    background: #eaedf3; border-color: #ccd2e0; color: #13203C;
}
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background: #13203C; border-color: #13203C; color: #fff;
    box-shadow: 0 2px 6px rgba(19,32,60,.35);
}
.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
    background: #f7f8fa; color: #b4bcc8; cursor: not-allowed; border-color: #eef0f3;
}
.dataTables_wrapper .dataTables_info {
    font-size: .8125rem; color: #8c9097; padding-top: 1rem;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    font-size: .8125rem; color: #536485; margin-bottom: .25rem;
}
/*
 * The DataTables length-menu and search inputs come wrapped in a <label>.
 * Flex-align so the "Show / entries" text and the select/input share a
 * baseline regardless of select height.
 */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex; align-items: center; gap: .35rem; margin: 0;
    font-size: .8125rem; color: #536485;
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #e6e8ee; border-radius: .375rem;
    font-size: .8125rem; outline: none;
    background: #fff; color: #1f2d3d;
    line-height: 1.2; vertical-align: middle;
}
/*
 * The Ynex/Tailwind base applies width:100% to <select> globally, which
 * blows the length-menu picker out to a ~120px-wide box just to hold "25".
 * Force a tight auto width + a compact padding so the box visually matches
 * the surrounding "Show / entries" text instead of looming over it.
 * !important because the global rule has equal specificity.
 */
.dataTables_wrapper .dataTables_length select {
    margin: 0;
    width: auto !important;
    min-width: 60px !important;
    max-width: 80px !important;
    display: inline-block !important;
    padding: .15rem 1.5rem .15rem .5rem; /* tight; right padding leaves room for caret */
    height: auto;
}
/*
 * ---------- THE LIST SEARCH BOX — one rule, every list in the app ----------
 * Owner, 2026-08-02: the search bar must be bigger, clearer and better
 * highlighted, "and that is common on all pages wherever we have search".
 * It IS: every list page renders its search through DataTables' own `f`
 * feature, so `.dataTables_filter input` is the single selector that reaches
 * all of them — the shared component, the four views that build their own
 * DataTable with the same `dom`, and the product-picker modals in the GRN /
 * purchase-invoice forms. Nothing per-view was edited to get this.
 *
 * ⚠️ The magnifier is a background-image, NOT markup — that is what keeps
 * this a single-file change. It is an inline SVG data URI (no CDN, no
 * webfont, MASTER §4), URL-encoded: `#` MUST be written %23 or the rest of
 * the declaration is parsed as a fragment and the icon silently vanishes.
 *
 * ⚠️ The icon is decorative and the input has no visible <label> (DataTables
 * is configured with `search:''`). The placeholder therefore carries the
 * name, and the shared component adds an `aria-label` to match — a magnifier
 * drawn in CSS is not a label for a screen reader.
 */
/*
 * ⚠️ !important ON THREE PROPERTIES, AND ONLY BECAUSE THE TEMPLATE USED IT
 * FIRST. The DataTables bootstrap5 integration puts `form-control
 * form-control-sm` on this input, and the Ynex build ships
 * `.form-control-sm { padding: .25rem .8rem !important; font-size: .8rem
 * !important; }` plus an !important border. Without matching it the box
 * silently kept the old 12.8px/4px sizing — measured in the browser, not
 * assumed — and the left padding that clears the magnifier was dropped, so
 * the icon sat under the typed text. Everything else here wins on
 * specificity alone and is deliberately left un-important.
 */
.dataTables_wrapper .dataTables_filter input {
    min-width: 320px;
    min-height: 2.5rem;
    padding: .5rem .8rem .5rem 2.35rem !important;
    font-size: .875rem !important;
    border: 1.5px solid #d9dde6 !important;
    border-radius: .5rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2313203C' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left .75rem center;
    background-size: 1rem 1rem;
    box-shadow: 0 1px 2px rgba(19,32,60,.05);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.dataTables_wrapper .dataTables_filter input::placeholder { color: #98a2b3; opacity: 1; }
.dataTables_wrapper .dataTables_filter input:hover { border-color: #c3cad8 !important; }
/*
 * Focus = the brand ORANGE ring, same as every other field in the app
 * (.form-control:focus, line 88). Stated here with !important rather than
 * left to inherit: line 88 only reaches this input because the DataTables
 * bootstrap5 integration happens to add .form-control to it, and a search
 * box that stops lighting up because an integration changed a class name is
 * exactly the silent regression this rule exists to prevent.
 */
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #FD7A0E !important;
    box-shadow: 0 0 0 .2rem rgba(253,122,14,.22) !important;
}
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #13203C; box-shadow: 0 0 0 .12rem rgba(19,32,60,.12);
}
/*
 * The row above the table: "Show N entries" left, search right. These two
 * wrappers come from the `dom` string and had NO styling at all, so they
 * stacked as plain blocks and spent two rows on one line's worth of content.
 */
.anth-dt-controls {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem;
}
.anth-dt-controls--bottom { margin-bottom: 0; }
.anth-dt-search { margin-left: auto; }
/* A 320px minimum overflows a 375px phone once the card padding is counted. */
@media (max-width: 575.98px) {
    .anth-dt-search { width: 100%; margin-left: 0; }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_filter label { width: 100%; }
    .dataTables_wrapper .dataTables_filter input { min-width: 0; width: 100%; }
}

/*
 * ---------- DARK MODE, for the two controls above ----------
 * The switcher sets `class="dark"` on <html> (assets/switch.js:35) — that is
 * the only marker; there is no data-theme-mode attribute to key off.
 *
 * ⚠️ THIS FIXES A PRE-EXISTING BUG, IT DOES NOT INTRODUCE ONE. The rule at
 * the top of this block has always forced `background:#fff; color:#1f2d3d`
 * on both the search input and the length picker, so in dark mode the search
 * box rendered as a white slab and the length picker rendered near-black
 * text on a near-black background (measured: #1f2d3d on #1a1c1e). Enlarging
 * the search box turned a small blemish into the loudest thing on the page,
 * which is what makes this in scope rather than a drive-by.
 *
 * ⚠️ The magnifier is re-declared with a LIGHT stroke. It is painted into a
 * background-image, so it does not inherit `color` and a navy glyph would
 * simply disappear against the dark field.
 *
 * 🧭 Out of scope and still wrong in dark mode: this table's <thead> keeps
 * its light #f8f9fc background app-wide. That is a `chrome:css` job, not a
 * search-box one — flagged, deliberately not fixed here.
 */
html.dark .dataTables_wrapper .dataTables_filter input {
    background-color: #1a1c1e;
    color: #e7e9ec;
    border-color: rgba(255,255,255,.18) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9c0cc' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E");
    box-shadow: none;
}
html.dark .dataTables_wrapper .dataTables_filter input::placeholder { color: #7c8390; }
html.dark .dataTables_wrapper .dataTables_filter input:hover { border-color: rgba(255,255,255,.32) !important; }
html.dark .dataTables_wrapper .dataTables_length select { background: #1a1c1e; color: #e7e9ec; }
.dataTables_wrapper table.dataTable thead th {
    font-size: .75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .02em; color: #536485; background: #f8f9fc;
    border-bottom: 1px solid #e9ecef; padding: .7rem .75rem;
}
.dataTables_wrapper table.dataTable tbody td {
    font-size: .8125rem; padding: .7rem .75rem; vertical-align: middle;
    border-bottom: 1px solid #f1f2f5;
}
.dataTables_wrapper table.dataTable tbody tr:hover { background: #faf9fe; }
.dataTables_wrapper .dataTables_processing {
    background: #fff; border: 1px solid #e9ecef; border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,.08); color: #536485; font-size: .8125rem;
}

/* ---------- Tabs (full-page forms) ---------- */
.anth-tabs {
    display: flex; flex-wrap: wrap; gap: .15rem;
    border-bottom: 1px solid #e9ecef; margin-bottom: 1.25rem;
}
.anth-tab {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .65rem 1rem; font-size: .8125rem; font-weight: 500;
    color: #6c757d; cursor: pointer; background: none; border: 0;
    border-bottom: 2px solid transparent; white-space: nowrap;
    transition: color .15s ease, border-color .15s ease;
}
.anth-tab i { font-size: 1rem; }
.anth-tab:hover { color: #13203C; }
.anth-tab.active { color: #13203C; border-bottom-color: #13203C; }
.anth-tab.has-error { color: #ef4b4b; }
.anth-tab.has-error.active { border-bottom-color: #ef4b4b; }
.anth-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.1rem; height: 1.1rem; padding: 0 .3rem;
    font-size: .65rem; font-weight: 600; border-radius: 999px;
    background: rgba(19,32,60,.14); color: #13203C;
}
.anth-tab-pane { display: none; }
.anth-tab-pane.active { display: block; }

/* ---------- Repeatable rows (OEM / fitment / suppliers / BOM) ---------- */
.anth-repeat-row {
    position: relative; border: 1px solid #e9ecef; border-radius: 8px;
    padding: 1rem; margin-bottom: .75rem; background: #fcfcfd;
}
.anth-repeat-row .anth-row-remove {
    position: absolute; top: .5rem; right: .5rem;
}
.anth-repeat-empty {
    border: 1.5px dashed #d7dbe3; border-radius: 8px; padding: 1.25rem;
    text-align: center; color: #8c9097; font-size: .8125rem;
}

/* ---------- Sticky form action bar ---------- */
.anth-form-actions {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; justify-content: flex-end; gap: .5rem;
    padding: .85rem 1rem; margin-top: 1.25rem;
    background: #fff; border-top: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px; box-shadow: 0 -4px 14px rgba(0,0,0,.04);
}
.anth-form-actions .spacer { flex: 1; }

/* ---------- Image gallery thumbs ---------- */
.anth-thumb-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(96px,1fr));
    gap: .6rem;
}
.anth-thumb {
    position: relative; border: 1px solid #e9ecef; border-radius: 8px;
    overflow: hidden; aspect-ratio: 1; background: #f8f9fc;
}
.anth-thumb img { width: 100%; height: 100%; object-fit: cover; }
.anth-thumb .del {
    position: absolute; top: 3px; right: 3px;
    width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 0;
    background: rgba(239,75,75,.92); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: .85rem;
}

/* ---------- Per-row completeness progress (products listing) ----------
 * Hover popover styled as a white card — high contrast, clean
 * typography hierarchy, percentage colour-matched to the bar.
 * Avoids the native title-tooltip lag + styling and the clipped/
 * cramped feel of an overflow-clipped dark box.
 */
/* Stock on-hand quantity — rendered larger across all stock listings
 * (Stock Overview, Parts Master, Products, Orders ▸ View Stock) so the
 * number is easy to read at a glance. */
.anth-stock-qty { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
/* When the qty sits inside a coloured badge (products / kit listings), keep
 * the badge but enlarge its number. */
.badge.anth-stock-qty { font-size: 1rem; padding: .2rem .55rem; }

/* Attention highlight — draws the eye to easily-missed but important fields
 * (e.g. Sale Currency, VAT) so they aren't skipped during data entry. */
.anth-attn { background:#fff7ed !important; border:1.5px solid #f59e0b !important; }
.anth-attn:focus { outline:none !important; box-shadow:0 0 0 3px rgba(245,158,11,.25) !important; }
/* When .anth-attn is on a <select> that Choices.js has wrapped, the original
   select is hidden — paint the visible .choices__inner instead so the amber
   "you enter this" highlight still shows (order form Channel + Sale Currency). */
.choices:has(select.anth-attn) .choices__inner { background:#fff7ed !important; border:1.5px solid #f59e0b !important; }
.choices.is-focused:has(select.anth-attn) .choices__inner { box-shadow:0 0 0 3px rgba(245,158,11,.25) !important; }

.anth-prog-cell { position: relative; cursor: help; }
.anth-prog-tip {
    position: absolute;
    bottom: calc(100% + 10px); left: 50%;
    transform: translateX(-50%) translateY(2px);
    width: 220px;
    background: #fff;
    color: #1f2937;
    padding: .65rem .8rem .7rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: .8125rem; line-height: 1.45;
    text-align: left;
    opacity: 0; visibility: hidden;
    transition: opacity .12s ease, transform .12s ease;
    pointer-events: none;
    box-shadow: 0 10px 28px rgba(15,22,36,.14), 0 2px 6px rgba(15,22,36,.06);
    z-index: 200;
    white-space: normal;
}
/* Downward-pointing arrow — outer border + inner fill so it matches
 * the card's border. */
.anth-prog-tip::before,
.anth-prog-tip::after {
    content: "";
    position: absolute;
    left: 50%;
    border: 7px solid transparent;
    transform: translateX(-50%);
}
.anth-prog-tip::before { top: 100%; border-top-color: #e5e7eb; }
.anth-prog-tip::after  { top: calc(100% - 1px); border-top-color: #fff; }

/* Tooltips are rendered as a fixed-position PORTAL on <body> (see the
 * .anth-prog-cell handler in layouts/admin.php) so the DataTable's
 * overflow-x:auto scroll wrapper can't clip them (it coerces overflow-y to
 * auto, which clips the upward tooltip on the top rows). The in-cell
 * .anth-prog-tip stays hidden and serves only as the content source the
 * portal clones — hence no :hover reveal here anymore. */
.anth-prog-tip--float {
    position: fixed;
    bottom: auto; left: 0;
    transform: none;
    opacity: 1; visibility: visible;
    z-index: 9999;
    display: none;
}
/* Arrow points down by default (portal sits above the cell); flips to point
 * up when there isn't room above and the portal is placed below the cell. */
.anth-prog-tip--float.is-below::before { top: auto; bottom: 100%;            border-top-color: transparent; border-bottom-color: #e5e7eb; }
.anth-prog-tip--float.is-below::after  { top: auto; bottom: calc(100% - 1px); border-top-color: transparent; border-bottom-color: #fff; }

/* Typography inside the tooltip */
.anth-prog-tip .tip-title {
    font-size: .7rem; font-weight: 600;
    color: #6b7280; text-transform: uppercase; letter-spacing: .05em;
    margin-bottom: .15rem;
}
.anth-prog-tip .tip-pct {
    font-size: 1.5rem; font-weight: 700;
    line-height: 1.1;
    /* colour set inline to match the bar */
}
.anth-prog-tip .tip-frac {
    font-size: .75rem; font-weight: 500; color: #9ca3af;
    margin-left: .35rem;
}
.anth-prog-tip .tip-section {
    margin-top: .55rem;
    padding-top: .45rem;
    border-top: 1px solid #f1f5f9;
    color: #6b7280; font-size: .65rem;
    text-transform: uppercase; font-weight: 600;
    letter-spacing: .06em;
}
.anth-prog-tip ul {
    list-style: none; margin: .3rem 0 0; padding: 0;
}
.anth-prog-tip ul li {
    padding: .15rem 0;
    color: #374151; font-size: .8125rem;
    display: flex; align-items: flex-start; gap: .45rem;
}
.anth-prog-tip ul li::before {
    content: ""; flex: 0 0 5px; width: 5px; height: 5px;
    border-radius: 50%; background: #d97706;
    margin-top: .55rem;
}
.anth-prog-tip .tip-ok {
    color: #16a34a; font-weight: 600; font-size: .8125rem;
    margin-top: .35rem; display: flex; align-items: center; gap: .35rem;
}

/* ===== ANTHE brand logo fit =====
   The supplied ANTHE logo is a WIDE wordmark; the Spruko logo slots were sized
   for a near-square mark. Constrain height + let width scale so it sits neatly
   in the header, sidebar (expanded + collapsed) and the login card, without
   blowing out the bar. Adjust the max-heights if you want it bigger/smaller. */
.app-header .header-logo img,
.app-sidebar .header-logo img {
    max-height: 34px; width: auto; max-width: 100%; object-fit: contain;
}
/* Collapsed sidebar: the wordmark shrinks to fit the narrow rail. */
.app-sidebar.sidemenu-toggled .header-logo img,
[data-toggled] .app-sidebar .header-logo img {
    max-height: 26px;
}
/* Login / auth card logo can be a touch larger. */
.authentication-brand {
    max-height: 52px; width: auto; max-width: 240px; object-fit: contain;
}

/* =====================================================================
   POS CHIP — the shelf tag in the POSITION column of both stock screens.
   Rendered by application/views/partials/_pos_chips.php, which is the ONLY
   place that builds the markup; Dispatch ▸ View Stock and Stock Master both
   include it. Two screens describing one shelf must not describe it
   differently, and until that partial existed the renderer was pasted into
   both views byte-for-byte — which is a drift waiting to happen.

   WHY IT WAS REDESIGNED (owner, 2026-08-08: "small and not easily readable"):
   the old chip was a .65rem (10.4px) grey pill on a grey background carrying
   one number. That is roughly half the app's own body size and it broke two
   HIGH-severity rules at once — "minimum readable body size" (12px floor) and
   "no grey text on a grey background".

   ⚠️ THE PALETTE IS THE LOCKED BRAND SET — navy · grey · orange · red ONLY
   (see :root at the top of this file). The design tooling proposed a green
   system palette; it is deliberately not used. Every text colour below was
   checked to 4.5:1 against the surface it actually sits on:
     #13203C on #fff  ≈ 14:1     #536485 on #fff  ≈ 5.9:1
     #9a4a00 on #fdf0e3 ≈ 5.6:1  #b42318 on #fdeceb ≈ 6.3:1
   ⚠️ The brand orange #FD7A0E is 2.6:1 on white and is used for the RULE and
   the ICON only, never for text — the text is the darkened #9a4a00.

   ⚠️ MEANING IS NEVER CARRIED BY COLOUR ALONE. A problem chip gets a left
   rule, a warning icon AND a worded title, so it survives a greyscale print
   and a colour-blind reader.
   ===================================================================== */
/* ⚠️ A COLUMN, NOT A ROW. These chips sit UNDER a quantity badge in the Packed
   and Unpacked cells, one POS per line, so the eye reads "28 here, 24 there"
   straight down instead of hunting along a wrapped row. In POSITION (no badge)
   the same stack is still the right shape — a shelf list is read vertically. */
.anth-pos-chips {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    margin-top: .25rem;
}

/* The worded line under a cell's chips, used ONLY where the chips genuinely
   cannot add up to the heading (a kit's buildable remainder; packed units whose
   POS was never recorded). Deliberately quiet — it explains a number, it is not
   a second number. */
.anth-pos-note {
    display: block;
    margin-top: .25rem;
    font-size: .7rem;
    line-height: 1.3;
    color: #8a6d3b;
    max-width: 15rem;
    white-space: normal;
}
html.dark .anth-pos-note { color: #d0a86a; }

/* ONE LINE: a POS code and a single number. It was briefly a two-line chip
   carrying "N packed · M unpacked" — that shape is gone with the layout the
   owner rejected. Each chip now says one thing, and WHICH thing is decided by
   the column it sits in. */
.anth-pos-chip {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .05rem .4rem;
    padding: .2rem .45rem .25rem;
    border: 1px solid #e2e6ee;
    border-left: 3px solid #cbd3e1;
    border-radius: 5px;
    background: #fff;
    line-height: 1.3;
    /* Digits must line up between stacked chips — a shelf list is read as a
       column even though it is laid out as chips. */
    font-variant-numeric: tabular-nums;
}
.anth-pos-chip__code {
    font-size: .8125rem;          /* 13px — the app's own body size, was 10.4px */
    font-weight: 700;
    color: #13203C;
    letter-spacing: .01em;
    white-space: nowrap;
}
.anth-pos-chip__split {
    display: flex;
    align-items: baseline;
    gap: .25rem;
    font-size: .75rem;            /* 12px — the readable-size floor, not below it */
    white-space: nowrap;
    /* ⚠️ NO DIVIDER RULE HERE, DELIBERATELY. A left border would separate "what
       is here" from "how it splits" nicely on one line and then float at the
       start of the next line as a stray mark the moment the chip wraps — and CSS
       cannot tell whether it wrapped. The weight contrast (bold navy code,
       lighter split) does the same job in both layouts. */
}
.anth-pos-chip__n { font-weight: 600; }
.anth-pos-chip__n--boxed { color: #13203C; }
.anth-pos-chip__n--loose { color: #536485; font-weight: 500; }
.anth-pos-chip__sep      { color: #b9c0cc; }
.anth-pos-chip__lbl      { font-weight: 400; opacity: .75; }

/* Problem states. The left rule is what the eye catches scanning a column of
   rows; the icon is what makes it legible without colour. */
.anth-pos-chip--warn { border-left-color: #FD7A0E; background: #fdf0e3; }
.anth-pos-chip--warn .anth-pos-chip__code,
.anth-pos-chip--warn .anth-pos-chip__split { color: #9a4a00; }
.anth-pos-chip--warn .anth-pos-chip__n--boxed { color: #9a4a00; }

.anth-pos-chip--none { border-left-color: #FD7A0E; background: #fdf0e3; }
.anth-pos-chip--none .anth-pos-chip__code { color: #9a4a00; }

.anth-pos-chip--neg  { border-left-color: #ef4b4b; background: #fdeceb; }
.anth-pos-chip--neg .anth-pos-chip__code,
.anth-pos-chip--neg .anth-pos-chip__split { color: #b42318; }

.anth-pos-chip__ico { font-size: .8rem; line-height: 1; flex: none; }

/* The "+N more" fold. Deliberately quiet — it is a count, not a shelf. */
.anth-pos-chip--more {
    justify-content: center;
    border-left-color: #e2e6ee;
    color: #536485;
    font-size: .75rem;
    font-weight: 600;
    cursor: default;
}

/* deploy 325 - "CODE - n": the dash between a shelf and its number. */
.anth-pos-chip__dash { color: #b9c0cc; font-weight: 400; }

/* deploy 325 - the two chips that OPEN A LIST when clicked: what is in staff
   hands (orange edge, the brand's one accent) and what an invoice blocks (navy).
   Both are real <button>s so the focus ring below applies. */
.anth-pos-chip--hand { border-left-color: #FD7A0E; }
.anth-pos-chip--hand .anth-pos-chip__code { color: #9a4a00; }
.anth-pos-chip--blocked { border-left-color: #13203C; background: #eef1f6; }
.anth-pos-chip--blocked .anth-pos-chip__code { color: #13203C; }
.anth-pos-pop {
    position: absolute; z-index: 1080;
    min-width: 15rem; max-width: 24rem;
    background: #fff; border: 1px solid #e2e6ee; border-radius: 6px;
    box-shadow: 0 6px 20px rgba(19, 32, 60, .14);
    padding: .5rem .65rem; font-size: .78rem; line-height: 1.35; color: #13203C;
}
.anth-pos-pop__title { font-weight: 700; margin-bottom: .3rem; }
.anth-pos-pop__row { display: flex; justify-content: space-between; gap: .75rem; padding: .2rem 0; border-top: 1px solid #f0f2f5; }
.anth-pos-pop__row:first-of-type { border-top: 0; }
.anth-pos-pop__who { font-weight: 600; white-space: nowrap; }
.anth-pos-pop__meta { color: #536485; text-align: right; }
.anth-pos-pop__n { font-weight: 700; font-variant-numeric: tabular-nums; }
html.dark .anth-pos-pop { background: #232529; border-color: rgba(255,255,255,.14); color: #e7e9ec; }
html.dark .anth-pos-pop__row { border-top-color: rgba(255,255,255,.08); }
html.dark .anth-pos-pop__meta { color: #9aa3b2; }
html.dark .anth-pos-chip--blocked { background: #2b2f3a; }
html.dark .anth-pos-chip--blocked .anth-pos-chip__code { color: #e7e9ec; }
html.dark .anth-pos-chip__dash { color: #6b7280; }

/* Clickable variant (the assign-a-POS action). Only ever applied to a real
   <button>, so the focus ring below lands on something focusable. */
button.anth-pos-chip { cursor: pointer; text-align: left; transition: border-color .15s ease, background-color .15s ease; }
button.anth-pos-chip:hover { background: #f6f8fb; border-color: #cbd3e1; }
button.anth-pos-chip:focus-visible { outline: 2px solid #13203C; outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { button.anth-pos-chip { transition: none; } }

/* ---- Dark mode ----
   ⚠️ THE MARKER IS `html.dark`, SET BY assets/main.js. The
   [data-theme-mode="dark"] selectors elsewhere in this file are dead — the
   switcher sets a CLASS, not that attribute, so a rule keyed off it never
   applies and the miss is completely silent. */
html.dark .anth-pos-chip { background: #232529; border-color: rgba(255,255,255,.14); border-left-color: rgba(255,255,255,.28); }
html.dark .anth-pos-chip__code { color: #e7e9ec; }
html.dark .anth-pos-chip__n--boxed { color: #e7e9ec; }
html.dark .anth-pos-chip__n--loose { color: #9aa3b2; }
html.dark .anth-pos-chip__sep { color: #6b7280; }
html.dark .anth-pos-chip--warn,
html.dark .anth-pos-chip--none { background: #33261a; border-left-color: #FD7A0E; }
html.dark .anth-pos-chip--warn .anth-pos-chip__code,
html.dark .anth-pos-chip--warn .anth-pos-chip__split,
html.dark .anth-pos-chip--warn .anth-pos-chip__n--boxed,
html.dark .anth-pos-chip--none .anth-pos-chip__code { color: #ffb570; }
html.dark .anth-pos-chip--neg { background: #3a2223; border-left-color: #ef4b4b; }
html.dark .anth-pos-chip--neg .anth-pos-chip__code,
html.dark .anth-pos-chip--neg .anth-pos-chip__split { color: #ff8f8a; }
html.dark .anth-pos-chip--more { color: #9aa3b2; }
html.dark button.anth-pos-chip:hover { background: #2b2e33; }
html.dark button.anth-pos-chip:focus-visible { outline-color: #e7e9ec; }

/* ---------- THE HANDOVER CHAIN (deploy 335): Order Desk → Dispatch Queue ----------
 * .anth-ho      the strip on the order view (4 steps, who · when, the gate line)
 * .anth-ho-cell the compact 3-dot version in the orders list's Handover column
 * .anth-bulk-bar--primary  a neutral (navy) variant of the delete bar, for the
 *               Dispatch Queue's "Received paperwork" bulk action.
 * Brand only: navy for done, orange for the current step, grey for the rest. State
 * is also carried by the tick icon and the label, never by colour alone. */
/* 🚨 A `.box` carries `display:flex` from the template bundle, declared AFTER the
   `.hidden{display:none}` utility, so `class="box hidden"` was NEVER hidden: both tab
   panels of Assign Orders (deploy 332) rendered stacked, and the Dispatch Queue's did
   the same on its first render. Measured in the browser: computed display = flex.
   🧭 A UTILITY THAT LOSES THE CASCADE IS A CLASS THAT DOES NOTHING. */
.box.hidden { display: none !important; }

.anth-bulk-bar--primary { background: #eef1f7; border-color: #c9d2e3; color: #13203C; }
.anth-bulk-bar--primary .anth-bulk-bar__info i { color: #13203C; }
html[data-theme-mode="dark"] .anth-bulk-bar--primary { background: #1b2536; border-color: #2c3a52; color: #e2e8f0; }
html[data-theme-mode="dark"] .anth-bulk-bar--primary .anth-bulk-bar__info i,
html[data-theme-mode="dark"] .anth-bulk-bar--primary .anth-bulk-bar__info strong { color: #e2e8f0; }

.anth-ho {
    display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem;
    padding: .65rem .9rem; margin: -.5rem 0 1rem;
    background: #f8f9fc; border: 1px solid #e3e7ef; border-radius: 8px; font-size: .8125rem;
}
.anth-ho__steps { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.anth-ho__step {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
    column-gap: .5rem; align-items: center; color: #7A8194;
}
.anth-ho__dot {
    grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid #cfd4de; background: #fff; color: #7A8194;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 600; transition: background .15s ease, border-color .15s ease;
}
.anth-ho__lbl  { font-weight: 500; line-height: 1.2; }
.anth-ho__meta { font-size: .72rem; color: #7A8194; line-height: 1.2; }
.anth-ho__step.is-done { color: #13203C; }
.anth-ho__step.is-done .anth-ho__dot { border-color: #13203C; background: #13203C; color: #fff; }
.anth-ho__step.is-now  { color: #13203C; }
.anth-ho__step.is-now .anth-ho__dot { border-color: #FD7A0E; background: #FD7A0E; color: #fff; }
.anth-ho__step.is-now .anth-ho__lbl { font-weight: 600; }
.anth-ho__note { flex-basis: 100%; display: flex; gap: .4rem; align-items: center; color: #475569; font-size: .78rem; }
.anth-ho__msg  { flex-basis: 100%; font-size: .8rem; padding: .4rem .6rem; border-radius: 6px; }
.anth-ho__msg.is-ok  { background: #eef1f7; color: #13203C; }
.anth-ho__msg.is-err { background: #fdecec; color: #8a1f1f; }
html[data-theme-mode="dark"] .anth-ho { background: #1b2536; border-color: #2c3a52; }
html[data-theme-mode="dark"] .anth-ho__step { color: #94a3b8; }
html[data-theme-mode="dark"] .anth-ho__dot  { background: #1b2536; border-color: #3b4a63; color: #94a3b8; }
html[data-theme-mode="dark"] .anth-ho__step.is-done, html[data-theme-mode="dark"] .anth-ho__step.is-now { color: #f1f5f9; }
html[data-theme-mode="dark"] .anth-ho__step.is-done .anth-ho__dot { background: #cbd5e1; border-color: #cbd5e1; color: #13203C; }
html[data-theme-mode="dark"] .anth-ho__note { color: #cbd5e1; }
html[data-theme-mode="dark"] .anth-ho__msg.is-ok { background: #24324a; color: #e2e8f0; }

.anth-ho-cell { min-width: 118px; line-height: 1.2; }
.anth-ho-dots { display: flex; gap: 4px; margin-bottom: 3px; }
.anth-ho-dot  { width: 9px; height: 9px; border-radius: 50%; background: #dfe3ea; }
.anth-ho-dot.is-done { background: #13203C; }
.anth-ho-dot.is-now  { background: #FD7A0E; box-shadow: 0 0 0 2px rgba(253, 122, 14, .25); }
.anth-ho-lbl { font-size: .75rem; color: #1f2d3d; }
.anth-ho-lbl span { display: block; font-size: .68rem; color: #7A8194; }
html[data-theme-mode="dark"] .anth-ho-dot { background: #3b4a63; }
html[data-theme-mode="dark"] .anth-ho-dot.is-done { background: #cbd5e1; }
html[data-theme-mode="dark"] .anth-ho-lbl { color: #e2e8f0; }

/* ---------- THE PURCHASE-INVOICE WARNING AT INVOICE SAVE (deploy 336) ----------
 * The same red family the Mark Dispatched dialog already uses for the same fact
 * (red is the one semantic colour the brand keeps); the overridden note is navy. */
.anth-pgap {
    display: flex; gap: .6rem; align-items: flex-start;
    border: 1px solid #fecaca; background: #fef2f2; color: #7f1d1d;
    border-radius: 8px; padding: .75rem .9rem; margin: 0 0 1rem; font-size: .8125rem;
    flex-direction: column;
}
.anth-pgap > i { font-size: 1.1rem; line-height: 1; }
.anth-pgap--acked, .anth-pgap--quiet { flex-direction: row; align-items: center; }
.anth-pgap--acked { border-color: #c9d2e3; background: #eef1f7; color: #13203C; }
.anth-pgap--quiet { border-color: #e3e7ef; background: #f8f9fc; color: #64748b; }
.anth-pgap__head { color: #b91c1c; font-weight: 700; font-size: .875rem; display: flex; gap: .4rem; align-items: center; }
.anth-pgap__text { margin: 0; }
.anth-pgap__table { width: 100%; font-size: .78rem; border-collapse: collapse; }
.anth-pgap__table th, .anth-pgap__table td { padding: .35rem .5rem; border-bottom: 1px solid #fecaca; text-align: left; }
.anth-pgap__table th { font-weight: 600; color: #7f1d1d; }
.anth-pgap__table .num { text-align: right; font-variant-numeric: tabular-nums; }
.anth-pgap__table .is-gap { color: #b91c1c; font-weight: 600; }
.anth-pgap__table .is-muted { color: #94a3b8; }
.anth-pgap__note { color: #92400e; font-size: .72rem; }
.anth-pgap__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.anth-pgap__hint { color: #7f1d1d; font-size: .78rem; }
html[data-theme-mode="dark"] .anth-pgap { background: #2a1717; border-color: #7f1d1d; color: #fecaca; }
html[data-theme-mode="dark"] .anth-pgap__head, html[data-theme-mode="dark"] .anth-pgap__table .is-gap { color: #fca5a5; }
html[data-theme-mode="dark"] .anth-pgap__table th { color: #fecaca; }
html[data-theme-mode="dark"] .anth-pgap__table th, html[data-theme-mode="dark"] .anth-pgap__table td { border-color: #7f1d1d; }
html[data-theme-mode="dark"] .anth-pgap__hint { color: #fecaca; }
html[data-theme-mode="dark"] .anth-pgap--acked { background: #1b2536; border-color: #2c3a52; color: #e2e8f0; }
html[data-theme-mode="dark"] .anth-pgap--quiet { background: #1b2536; border-color: #2c3a52; color: #94a3b8; }

/* ---------- DEPARTMENTS + ROLES tick lists on the staff form (deploy 337) ----------
 * One row per department / role, 44 px tall, the whole row is the tap target; the
 * primary radio lives on the right and is enabled only on a ticked row. */
.anth-dept-list { border: 1px solid #e3e7ef; border-radius: 8px; overflow: hidden; }
.anth-dept-row {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    min-height: 44px; padding: 0 .75rem 0 .25rem; border-top: 1px solid #eef1f6;
    transition: background .15s ease;
}
.anth-dept-row:first-child { border-top: 0; }
.anth-dept-row:hover { background: #f8f9fc; }
.anth-dept-row.is-on { background: #f3f5fa; }
.anth-dept-row__main { display: flex; align-items: center; gap: .6rem; flex: 1 1 auto; min-height: 44px; margin: 0; padding: 0 .5rem; cursor: pointer; font-size: .8125rem; }
.anth-dept-row__main input, .anth-dept-row__primary input { width: 16px; height: 16px; accent-color: #13203C; cursor: pointer; margin: 0; }
.anth-dept-row__name { font-weight: 500; color: #1f2d3d; }
.anth-dept-row__desc { display: block; font-weight: 400; font-size: .72rem; color: #7A8194; }
.anth-dept-row__primary { display: inline-flex; align-items: center; gap: .35rem; margin: 0; padding: .5rem .25rem; font-size: .75rem; color: #7A8194; cursor: pointer; white-space: nowrap; }
.anth-dept-row__primary input:disabled { cursor: not-allowed; opacity: .35; }
.anth-dept-row.is-primary .anth-dept-row__primary { color: #FD7A0E; font-weight: 600; }
html[data-theme-mode="dark"] .anth-dept-list { border-color: #2c3a52; }
html[data-theme-mode="dark"] .anth-dept-row { border-top-color: #2c3a52; }
html[data-theme-mode="dark"] .anth-dept-row:hover, html[data-theme-mode="dark"] .anth-dept-row.is-on { background: #1b2536; }
html[data-theme-mode="dark"] .anth-dept-row__name { color: #e2e8f0; }
html[data-theme-mode="dark"] .anth-dept-row__desc, html[data-theme-mode="dark"] .anth-dept-row__primary { color: #94a3b8; }
html[data-theme-mode="dark"] .anth-dept-row.is-primary .anth-dept-row__primary { color: #FD7A0E; }

/* ---------- THE BUFFER ZONE LOOKUP (deploy 341) ----------
 * The box on Dispatch > Buffer Zone Queue: one input, one button, the card. */
.anth-bzl { margin-bottom: 1rem; }
.anth-bzl__form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; }
.anth-bzl__form .form-label { white-space: nowrap; font-weight: 600; }
.anth-bzl__form .form-control { flex: 1 1 260px; max-width: 420px; min-height: 44px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; }
.anth-bzl__form .anth-btn { min-height: 44px; }
.anth-bzl__form .anth-hint { flex-basis: 100%; }
.anth-bzl__out { margin-top: .9rem; }
.anth-bzl__card { border: 1px solid #e3e7ef; border-radius: 8px; padding: .85rem 1rem; font-size: .8125rem; }
.anth-bzl__head { display: flex; gap: .9rem; align-items: center; padding-bottom: .75rem; border-bottom: 1px solid #eef1f6; }
.anth-bzl__head img, .anth-bzl__noimg { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex: 0 0 72px; }
.anth-bzl__noimg { display: inline-flex; align-items: center; justify-content: center; background: #eef1f6; color: #7A8194; font-size: 1.5rem; }
.anth-bzl__name { font-weight: 700; font-size: .95rem; color: #1f2d3d; }
.anth-bzl__sold { margin-top: .25rem; font-weight: 600; color: #13203C; display: inline-flex; gap: .35rem; align-items: center; }
.anth-bzl__sec { padding: .7rem 0 .2rem; border-bottom: 1px solid #eef1f6; }
.anth-bzl__sec:last-child { border-bottom: 0; }
.anth-bzl__lbl { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #7A8194; margin-bottom: .35rem; display: flex; gap: .35rem; align-items: center; }
.anth-bzl__shelf { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px; background: #eef1f7; color: #13203C; font-size: .75rem; white-space: nowrap; margin: .1rem 0; }
.anth-bzl__shelf.is-bzp { background: rgba(253, 122, 14, .14); color: #9a4a06; }
.anth-bzl__none { color: #7A8194; }
.anth-bzl__err { color: #8a1f1f; background: #fdecec; border: 1px solid #f5c2c2; border-radius: 6px; padding: .5rem .75rem; }
.anth-bzl__kit { margin: .4rem 0 .6rem; }
.anth-bzl__kitline { margin: .2rem 0; }
.anth-bzl__parts { width: 100%; border-collapse: collapse; margin-top: .4rem; font-size: .78rem; }
.anth-bzl__parts th, .anth-bzl__parts td { padding: .3rem .5rem; border-bottom: 1px solid #eef1f6; text-align: left; vertical-align: top; }
.anth-bzl__parts th { color: #7A8194; font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; }
.anth-bzl__parts .num { text-align: right; font-variant-numeric: tabular-nums; }
.anth-bzl__parts tr.is-this td { background: #f3f5fa; font-weight: 600; }
html[data-theme-mode="dark"] .anth-bzl__card { border-color: #2c3a52; }
html[data-theme-mode="dark"] .anth-bzl__head, html[data-theme-mode="dark"] .anth-bzl__sec, html[data-theme-mode="dark"] .anth-bzl__parts th, html[data-theme-mode="dark"] .anth-bzl__parts td { border-color: #2c3a52; }
html[data-theme-mode="dark"] .anth-bzl__name { color: #e2e8f0; }
html[data-theme-mode="dark"] .anth-bzl__sold { color: #e2e8f0; }
html[data-theme-mode="dark"] .anth-bzl__shelf { background: #24324a; color: #e2e8f0; }
html[data-theme-mode="dark"] .anth-bzl__shelf.is-bzp { background: rgba(253, 122, 14, .22); color: #ffb26b; }
html[data-theme-mode="dark"] .anth-bzl__noimg { background: #2c3a52; color: #94a3b8; }
html[data-theme-mode="dark"] .anth-bzl__parts tr.is-this td { background: #1b2536; }
html[data-theme-mode="dark"] .anth-bzl__err { background: #2a1717; border-color: #7f1d1d; color: #fecaca; }

/* ---- deploy 346: the pencil on an invoice line's name (one invoice's own item name) ---- */
.anth-pname { display: inline-flex; align-items: flex-start; gap: .25rem; max-width: 100%; }
.anth-pname__text { min-width: 0; }
.anth-pname__btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: -8px 0 -8px 0; border: 0; border-radius: 6px; background: transparent; color: var(--anth-grey); cursor: pointer; font-size: 1rem; line-height: 1; }
.anth-pname__btn:hover, .anth-pname__btn:focus-visible { background: rgba(19, 32, 60, .06); color: var(--anth-navy); outline: none; }
.anth-pname[data-custom="1"] .anth-pname__btn { color: var(--anth-orange); }
.anth-pname[data-custom="1"] .anth-pname__text::after { content: " (this invoice only)"; color: var(--anth-orange); font-size: .72rem; font-weight: 600; }
.anth-pname__form { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin: .125rem 0; }
.anth-pname__input { flex: 1 1 14rem; min-width: 10rem; min-height: 36px; padding: .25rem .5rem; border: 1px solid var(--anth-grey); border-radius: 6px; font: inherit; color: var(--anth-navy); background: #fff; }
.anth-pname__input:focus { border-color: var(--anth-navy); box-shadow: 0 0 0 3px rgba(19, 32, 60, .12); outline: none; }
.anth-pname__form .anth-btn { min-height: 36px; padding: .25rem .625rem; }
.anth-pname__hint { flex: 1 0 100%; font-size: .72rem; color: #64748b; }
@media print { .anth-pname__btn, .anth-pname__form { display: none !important; } .anth-pname[data-custom="1"] .anth-pname__text::after { content: none; } }
[data-theme="dark"] .anth-pname__input, .dark .anth-pname__input { background: #0f172a; color: #e5e7eb; border-color: #334155; }


/* ============================================================================
   PACKING DEPARTMENT - THE PHONE COLUMN (deploy 518)

   Owner, on a phone, 2026-09-21: *"the side gaps are large, we have lot of space on sides.
   reduce the side margin."*

   MEASURED at 375px: `.main-content` pads 1.5rem each side on EVERY width (there is no phone
   breakpoint on it in the theme's build), and the column's own px-3 adds 12px more - so a card
   began 36px in and 19% of a 375px screen was gutter.

   ⚠️⚠️ THIS CANNOT BE DONE WITH A UTILITY. It needs a NEGATIVE margin to climb out of a
     parent's padding, and `-mx-6` - like every -mx-* except -mx-1 - is not in the theme's
     pre-built CSS. Tailwind has never been compiled against this codebase, so only the 4,579
     classes the vendor's own demo used exist.
       🧭 WHEN THE UTILITY DOES NOT EXIST, WRITE THE RULE ONCE HERE - NOT A STYLE BLOCK IN A VIEW.

   ⚠️ From 576px up it centres again instead of bleeding, which is also the honest answer to
     *"can we not have 2 views one for mobile and one for pc?"* - one view, two behaviours, one
     rule. A second template would be a second place for every future bug to live.
   ⚠️ `margin-inline` (not margin-left/right) so the RTL switcher in the theme keeps working.
   ============================================================================ */
.dept-wrap { margin-inline: -1.5rem; }

@media (min-width: 576px) {
    .dept-wrap { margin-inline: auto; }
}

/* =====================================================================
   THE CONFIRMATION TICK IS GREEN - ON THE PACKING DEPARTMENT SCREENS ONLY
   (deploy 536). Owner: *"wherever we confirm with tick, it should be green,
   still it is coming blue"*.

   It was coming blue because of the block at the top of this file: the brand
   palette deliberately collapses --success into the navy, so every
   `text-success` in the whole ERP paints #13203C. That rule is not wrong and is
   not being reverted - it is what keeps 235 screens to navy, grey, orange and
   red. But a packer standing at a rack needs YES to be unmistakable at arm's
   length, and navy-on-white is the same colour as everything else on the card.

   Scoped to `.dept-wrap`, which only the Packing Department shell renders, so
   nothing else in the application moves.
     🧭 A STATUS COLOUR THAT MATCHES THE PAGE IS NOT A STATUS COLOUR.
   #15803d, not a brighter green: ~5.1:1 on white, which small bold text needs.
   The boxicons tick inherits currentColor, so the icon follows the text.
   ===================================================================== */
.dept-wrap .text-success { color: #15803d !important; }
