/* ==========================================================================================================
   assets/forecast-skin.css - TASK-FORECAST-L4-SKIN ("duong giua"): the look of the Forecast screens, in ONE file of its own.
   Contract: contracts/TASK-FORECAST-L4-SKIN.md (+ -MAP.md = the value map, + -0.md = this lot). Owner decision 08/10/2026.

   WHY A FILE OF ITS OWN (option A of the contract): the four assets/tokens/*.css files and the §DS block of styles.css are
   hash-pinned (leave-ds-ui), and styles.css is shared with the Wave-0 lots (A2/A3/A4). One file, loaded AFTER reports.css,
   touches no pinned file and is removed by deleting ONE <link> in index.html.

   THE RULES OF THIS FILE (every one is enforced by tests/frontend/forecast-skin-css.test.js):
   1. Every selector starts with #screenForecast (or .forecast-sheet). Nothing here can reach another screen.
   2. A hex colour is written ONLY as the value of a --fcs-* token, and the tokens are declared ONLY in the SKIN-0 block.
   3. No !important. No font-size below 12px. Every text/ground pair the file writes clears 4.5:1, COMPUTED from the tokens.
   4. A rule that changes a button's ground restates :hover and :active, and leaves :disabled and :focus-visible alone.
   5. Each later lot edits ONLY its own fenced block (SKIN-1 .. SKIN-4); the markers below are the fence.

   EXCEPTION RECORDED: the Forecast screens are exempt from the 25/07 "Bebas for numbers only / one accent / green = approved"
   rule (Design/Modern app Design handoff 2507). See Design/DESIGN.md §Forecast skin. Bebas is never used for a VND amount.
   ========================================================================================================== */

/* L4-SKIN-0 --- foundation: tokens, buttons, titles, tabs ------------------------------------------------ */
#screenForecast {
  /* green button (C06) */
  --fcs-go-ink: #22300a;
  --fcs-go-hover: #bcdd52;
  /* group bands (SKIN-1 / SKIN-4) */
  --fcs-b-sku: #2b3440;
  --fcs-b-bq: #3a78c1;
  --fcs-b-mtd: #2a6ea9;      /* L4-BRIEF-R (Q10): was #5f97d2 (white 3.07:1); white on this is 5.38:1 - the same blue family as «Doanh số bình quân» #3a78c1 (4.53:1) beside it */
  --fcs-b-o1: #5b7b25;       /* L4-BRIEF-R (Q10): «Theo dự báo bán hàng», was --green-600 #6f8a32 (white 3.92:1); white on this is 4.88:1 */
  --fcs-b-o2: #667f1f;       /* L4-BRIEF-R (Q10): «Theo lịch sử bán hàng», was --green-500 #8aab3e (white 2.63:1); white on this is 4.54:1. The green ladder under the super-band --green-700 (6.02:1): 4.88 -> 4.54 -> «Chốt đơn» lime */
  --fcs-b-df-fc: #3d6b28;
  --fcs-band-sep: rgba(255, 255, 255, 0.28);
  /* column-head grounds of the order sheet (SKIN-4) */
  --fcs-h-blue1: #e2ecf8;
  --fcs-h-blue2: #eaf1fa;
  --fcs-h-blue3: #eff5fc;
  --fcs-h-o1: #eef5e0;
  --fcs-h-o2: #f0f6e4;
  --fcs-h-final: #dcecb0;
  /* cell grounds (SKIN-1 / SKIN-4) */
  --fcs-d-hist: #f7f9fc;
  --fcs-d-ready: #fdf7ea;
  --fcs-d-ready-ink: #8a6414;
  --fcs-d-final: #f4fae4;
  --fcs-d-input: #fffdf3;
  --fcs-fin-border: #b9d16a;
  --fcs-na-bg: #fdf3e2;
  --fcs-miss-bg: #fdf6e8;
  --fcs-miss-soft-bg: #fffaf0;
  /* rows of the order list and sheet (SKIN-3 / SKIN-4) */
  --fcs-row-draft: #fbfaf3;
  --fcs-row-draft-hover: #f7f4e6;
  --fcs-ordbar-on: #f7faf0;
  --fcs-pick: #e8f0fb;
  --fcs-tf-final: #e6f2c4;
  /* PO tab (SKIN-2) */
  --fcs-po-ket: #fdf3f3;
  --fcs-po-hand-bg: #fff4e5;
  --fcs-po-hand-ink: #8a5300;
  --fcs-po-hi: #f3f8ee;
  --fcs-po-hi-ban: #e7f1dc;
  --fcs-po-ban-bg: #dcebcd;
  --fcs-po-ban-ink: #33501c;
}

/* C03 + C05 - the title frame and the screen title. UTM Bebas, 24px, CAPITALS, ink. The line height is the 28px the old 22px title
   measured, so the head bar keeps its 73px (the contract forbids moving any block's height). <=900px: 21px, as Phuong's page does. */
#screenForecast .emp-headbar { box-shadow: var(--shadow-sm); }
#screenForecast .emp-title {
  font-family: var(--font-display); font-size: 24px; font-weight: var(--weight-regular);
  line-height: 28px; text-transform: uppercase; color: var(--ink);
}
@media (max-width: 900px) { #screenForecast .emp-title { font-size: 21px; } }

/* C14 + L15 - the title of every Forecast box (create, cancel, conflict, import...). Only the title span: the icon, the x and the
   words are untouched, and the box keeps its height. The shared boxes (vConfirm, .v-pop) are not under #screenForecast. */
#screenForecast .forecast-sheet .forecast-sheet-hd span {
  font-family: var(--font-display); font-size: 21px; font-weight: var(--weight-regular);
  letter-spacing: 0.01em; text-transform: uppercase; color: var(--ink);
}

/* C06 - the green action button. Four places, all picked by an attribute the markup already carries:
   - the order-list header button (data-act open_draft) - NOT the buttons inside a table row (Phuong keeps those blue) and not the KPI card;
   - the corner button of the other tabs (new_order / open_order);
   - «Chot don» in the order sheet's action bar (data-act close) - NOT close_go, the confirm in the box.
   Size and weight apply in every state; the colours apply only while enabled, so §DS's :disabled look is untouched; hover and active are
   restated (the §DS active ground is the dark blue) and :focus-visible keeps its ring. */
#screenForecast .v-btn-primary:is([data-act="new_order"], [data-act="open_order"], [data-act="open_draft"]:not(td *), .forecast-order-actions [data-act="close"]) {
  font-size: 13px; font-weight: var(--weight-bold);
}
#screenForecast .v-btn-primary:is([data-act="new_order"], [data-act="open_order"], [data-act="open_draft"]:not(td *), .forecast-order-actions [data-act="close"]):not(:disabled) {
  background: var(--green-400); color: var(--fcs-go-ink); box-shadow: var(--shadow-sm);
}
#screenForecast .v-btn-primary:is([data-act="new_order"], [data-act="open_order"], [data-act="open_draft"]:not(td *), .forecast-order-actions [data-act="close"]):not(:disabled):hover {
  background: var(--fcs-go-hover); color: var(--fcs-go-ink);
}
#screenForecast .v-btn-primary:is([data-act="new_order"], [data-act="open_order"], [data-act="open_draft"]:not(td *), .forecast-order-actions [data-act="close"]):not(:disabled):active {
  background: var(--green-500); color: var(--fcs-go-ink);
}
#screenForecast .v-btn-primary:is([data-act="new_order"], [data-act="open_order"], [data-act="open_draft"]:not(td *), .forecast-order-actions [data-act="close"]):not(:disabled):focus-visible {
  box-shadow: var(--shadow-focus);
}

/* C09 + L12 - the buttons that OPEN a destructive question are grey until hovered, then red (Phuong's .btn.dgr): «Huy nhap» (drop),
   «Xoa so da nhap» (clear_all), «Bo khoi bang nay» (sel_drop). «Huy don da chot» (cancel) and every confirm inside a box
   (cancel_go, drop_go, clear_go, dropsku_go, exit_discard, confirm) STAY RED - owner default Q6: the one that destroys keeps its warning.
   The red on hover is --danger (5.39:1), not Phuong's #d24545 (4.49:1). :disabled and :focus-visible are not touched. */
#screenForecast .v-btn-danger:is([data-act="drop"], [data-act="clear_all"], [data-act="sel_drop"]):not(:disabled) {
  background: var(--surface-card); border-color: var(--border-default); color: var(--text-body);
}
#screenForecast .v-btn-danger:is([data-act="drop"], [data-act="clear_all"], [data-act="sel_drop"]):not(:disabled):hover {
  background: var(--surface-card); border-color: var(--danger); color: var(--danger);
}
#screenForecast .v-btn-danger:is([data-act="drop"], [data-act="clear_all"], [data-act="sel_drop"]):not(:disabled):active {
  background: var(--surface-card); border-color: var(--danger); color: var(--danger);
}

/* C10 + C11 + C12 - the tab bar: an underline, not a pill. CSS only: the markup (v-seg, v-seg-btn, data-mode, onclick) is untouched.
   The bar is 44px high as before (the button is 44px; the 3px underline is taken OUT of the bottom padding so a wrapped label on a
   phone does not grow). Selected tab: ink + 3px underline, NO ground (Phuong's code, measured at rest 08/10 - the audit said otherwise);
   hover on any tab: pale ground + blue. The §DS focus ring is restated, because the selected tab's old shadow used to hide it. */
#screenForecast .forecast-modes.v-seg {
  display: flex; gap: 2px; padding: 0; border-radius: 0;
  background: var(--surface-card); box-shadow: inset 0 -1px 0 var(--border-subtle);
}
#screenForecast .forecast-modes .v-seg-btn {
  border-radius: 0; background: transparent; color: var(--text-muted);
  font-size: 13.5px; font-weight: var(--weight-bold); min-height: 44px;
  padding: var(--space-2) var(--space-4) calc(var(--space-2) - 3px); border-bottom: 3px solid transparent;
}
#screenForecast .forecast-modes .v-seg-btn:hover { background: var(--blue-50); color: var(--color-primary); }
#screenForecast .forecast-modes .v-seg-btn.active { background: transparent; color: var(--color-primary); border-bottom-color: var(--color-primary); box-shadow: none; }
#screenForecast .forecast-modes .v-seg-btn.active:hover { background: var(--blue-50); color: var(--color-primary); }
#screenForecast .forecast-modes .v-seg-btn:focus-visible { box-shadow: var(--shadow-focus); }
#screenForecast .forecast-mode-cnt { color: var(--text-muted); }
#screenForecast .forecast-modes .v-seg-btn.active .forecast-mode-cnt { color: var(--color-primary); }
/* /L4-SKIN-0 */

/* L4-SKIN-1 --- Delivery Forecast: group bands, month cells, input cells, total row ----------------------- */
/* Every rule below is scoped to the Delivery Forecast table (.fdf): .forecast-band-a/-b, .forecast-td-* and .forecast-foot are shared with
   the PO / catalogue tables, so no selector here is written bare. It only paints: no padding, size, position or z-index is declared, so the
   heights and the sticky stack that L4-A3 fixed stay exactly as they are. A3's row hover (#screenForecast :is(...) tbody tr:hover > td, one
   class heavier than every cell rule here) still wins on a hovered row, so each text colour below is also checked on the hover ground
   (--blue-50) by tests/frontend/forecast-skin-1-css.test.js. */

/* D01 + D02 - the two group bands are solid, white on blue / green (anh Phuong's .g-hist and .g-fc); his 11px is raised to the 12px floor.
   The unit line (D03, "DVT: Kg") keeps the 0.04em tracking it had instead of inheriting the band's wider 0.08em. */
#screenForecast .fdf .forecast-band-a {
  background: var(--blue-500); color: var(--color-primary-contrast);
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.08em; text-transform: uppercase;
}
#screenForecast .fdf .forecast-band-b {
  background: var(--fcs-b-df-fc); color: var(--text-on-brand);
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.08em; text-transform: uppercase;
}
#screenForecast .fdf :is(.forecast-band-a, .forecast-band-b) .forecast-unit { letter-spacing: 0.04em; }

/* D05 - the six read-only history months are WHITE (not the sunken grey), the text a grey that still clears 4.5:1 (7.46). */
#screenForecast .fdf td.forecast-td-hist { background: var(--surface-card); color: var(--gray-600); }

/* D06 - the computed columns (Tong nam, BQ 3, BQ 6) keep their pale blue; only the weight goes 600 -> 700. A3 owns their hover (--blue-100). */
#screenForecast .fdf td.forecast-td-calc { font-weight: var(--weight-bold); }

/* D09 - the item code is blue and bold at 12px (his 10.5px is below the floor); the running number is the muted grey that clears 4.5:1
   (his #99a6b6 is 2.48:1) and bold. tbody only: the foot's sigma cell is a label, not a number of the list. */
#screenForecast .fdf tbody td.fdf-k2 { color: var(--color-primary); font-size: var(--text-xs); font-weight: var(--weight-bold); }
#screenForecast .fdf tbody td.fdf-k1 { color: var(--text-muted); font-weight: var(--weight-bold); }

/* D10 - the total row: grey ground, a 2px line above it, bold dark text; the label "Tong cong N ma" is small capitals at 12px (his 11px is
   below the floor). The sigma cell is left at 13px on purpose: Be Vietnam Pro has no Greek, so the sigma is drawn in a fallback font whose line
   box is 1px taller at 13px than at 12px - shrinking it would shorten the whole row. Only colours, weight and the label's case change. */
#screenForecast .fdf tfoot.forecast-foot td {
  background: var(--gray-200); color: var(--gray-800); border-top: 2px solid var(--gray-400); font-weight: var(--weight-bold);
}
#screenForecast .fdf tfoot td.fdf-k3.forecast-foot-lbl { font-size: var(--text-xs); letter-spacing: 0.04em; text-transform: uppercase; }

/* D07 - a forecast box that HAS a number is white with a quiet border and bold text; the amber "edited by hand" look is gone here (DS-03, owner
   default Q4), but the class and the title stay in the markup. Only boxes in a cell that is not empty, and never a box the screen has flagged
   (.forecast-bad = red, .forecast-conflict = someone else typed here). While the box has focus its border is the §DS blue again (the amber
   .forecast-edited border of styles.css used to win there) and the focus ring is not touched. Bold applies to every typed box, so a figure just typed into an empty cell is already bold. */
#screenForecast .fdf .v-input.forecast-cell { font-weight: var(--weight-bold); }
#screenForecast .fdf td:not(.forecast-fc-miss) .v-input.forecast-edited:not(.forecast-bad):not(.forecast-conflict) { background: var(--surface-card); }
#screenForecast .fdf td:not(.forecast-fc-miss) .v-input.forecast-edited:not(.forecast-bad):not(.forecast-conflict):not(:focus) { border-color: var(--border-default); }
#screenForecast .fdf td:not(.forecast-fc-miss) .v-input.forecast-edited:not(.forecast-bad):not(.forecast-conflict):focus { border-color: var(--color-primary); }

/* D08 - an EMPTY month: the cell is white and the BOX is the pale amber (--fcs-miss-bg), its border stays --warning (styles.css) and its
   placeholder is 12px / 700 italic in --warning-text (7.42:1; his #d98a1f is 2.57:1 and 10.5px). A cell with no box at all (the read-only view
   prints the word "Chua nhap" instead) keeps an amber ground, as it has today, so a viewer still sees at a glance where a number is missing. */
#screenForecast .fdf td.forecast-fc-miss { background: var(--surface-card); }
#screenForecast .fdf td.forecast-fc-miss:not(:has(.v-input)) { background: var(--fcs-miss-bg); }
#screenForecast .fdf td.forecast-fc-miss .v-input:not(.forecast-bad):not(.forecast-conflict) { background: var(--fcs-miss-bg); }
#screenForecast .fdf td.forecast-fc-miss .v-input::placeholder { font-size: var(--text-xs); font-weight: var(--weight-bold); font-style: italic; color: var(--warning-text); }

/* C13 - the black tooltip: only its TITLE line changes. The box is appended to <body> by js/forecast-tip.js, so it is OUTSIDE #screenForecast and
   needs the one root this file otherwise refuses (.forecast-tip); the rule is written for the title element alone, the box itself (ground, text,
   shadow, position) stays styles.css's. The title is --green-400 on --gray-800 (8.14:1), 12px (his 10.5px is below the floor), capitals, 0.06em.
   [role="tooltip"] raises the weight above styles.css's `.forecast-tip b` so the order of the two files does not decide it. The class is made
   by js/forecast-tip.js and nowhere else (tests/frontend/forecast-skin-1-css.test.js scans for it). */
.forecast-tip[role="tooltip"] b { color: var(--green-400); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; }
/* /L4-SKIN-1 */

/* L4-SKIN-2 --- PO + Danh muc ------------------------------------------------------------------------------ */
/* No token is declared here (they are all in the SKIN-0 block). Every selector below starts at the PO table or the Danh muc table, and a rule that paints
   a GROUND stays under the specificity of A3's row hover (1,3,3, styles.css «N-310») so that the pale-blue hover still shows on every cell; a rule that
   only sets a text colour may be heavier, because the hover sets no colour. tests/frontend/forecast-skin-2-css.test.js computes that from the source. */

/* P03 + P04 (N-345) - the two heads that carry the date the calculation uses. «Ap dung» is the head right before «Ngay san sang ban» (no class of its own, and none
   is needed: the adjacent-sibling selector names it), pale green like Phuong's; «Ngay san sang ban» is the deeper green. */
#screenForecast .forecast-po-table thead tr.forecast-cols th:has(+ .forecast-th-hi) { background: var(--success-bg); color: var(--success); }
#screenForecast .forecast-po-table thead tr.forecast-cols th.forecast-th-hi { background: var(--fcs-po-ban-bg); color: var(--fcs-po-ban-ink); }

/* THE LADDER OF GROUNDS ON A PO CELL (the order of the lines does not matter, the weight does; every rung stays under A3's hover):
     hand row's amber taken off (1,2,1)  <  the two green date cells (1,2,2)  <  a row that does not enter the calculation (1,2,3)  <  the hand-set ETA cell (1,3,2).
   So a green cell in an ordinary or hand row stays green, a row that is out of the calculation turns all its cells pale pink (the green ones too, as Phuong's
   `tr.ket td.hi` does), and the one hand-set ETA cell stays amber even inside such a row. The hover (1,3,3) is above all four. */

/* P05 (N-348) - the two cells under the heads: two greens, the second deeper, both bold. */
#screenForecast .forecast-po-table tbody td.fpo-eta-ap { background: var(--fcs-po-hi); color: var(--text-body); font-weight: var(--weight-bold); }
#screenForecast .forecast-po-table tbody td.forecast-td-hi { background: var(--fcs-po-hi-ban); color: var(--text-body); font-weight: var(--weight-bold); }
/* P07 (P11) - a row set by hand is no longer amber from end to end (Phuong paints only the one ETA cell). This takes the old amber off; the cell that
   carries the hand-set ETA gets its amber back two rules below. */
#screenForecast .forecast-po-table .forecast-po-hand td { background: transparent; }

/* P06 (P11) - a row that does not enter the calculation (overdue, received in full, odd status, not in the catalogue, cannot be computed): ONE very pale
   pink for the whole row (the old --danger-bg was the deeper pink), the body ink on it (the old rule made the whole overdue row dark red; Phuong reddens
   only three cells), and red text on the two date cells. The red is --danger (4.95:1 on this pink), not Phuong's #d24545 (4.12:1). «Ap dung» is red only
   when the row is NOT hand-set: a hand-set ETA is the one thing on such a row that is not wrong, so it keeps the amber of the next rule. */
#screenForecast .forecast-po-table tbody tr:is(.forecast-po-off, .forecast-po-late) td { background: var(--fcs-po-ket); color: var(--text-body); }
#screenForecast .forecast-po-table tbody tr:is(.forecast-po-off, .forecast-po-late) td.forecast-td-hi { color: var(--danger); }
#screenForecast .forecast-po-table tbody tr:is(.forecast-po-off, .forecast-po-late):not(.forecast-po-hand) td.fpo-eta-ap { color: var(--danger); }

/* P07 (P11) - the hand-set ETA: the one amber cell, the dark amber ink on it (5.82:1). The «Nhap tay» badge and the buttons keep their own look (Phuong's
   9px capital tag is not copied: under the 12px floor). */
#screenForecast .forecast-po-table tr.forecast-po-hand td.fpo-eta-ap { background: var(--fcs-po-hand-bg); color: var(--fcs-po-hand-ink); }

/* P09 (N-348) - «Doi chieu voi hom nay» in red bold whenever it says anything but «Binh thuong», on EVERY kind of row. A3 fixed the weight of the grey that hid it;
   this keeps the fix by weight too: id + three classes + three elements beat the row rules above, whatever the row is. --danger, not --danger-text. */
#screenForecast .forecast-po-table tbody tr td.fpo-dc-bad.fpo-dc { color: var(--danger); font-weight: var(--weight-bold); }
/* M02 (N-356) - «Tong ton», the last column of Danh muc: bold and the strong ink, as Phuong's `.n.tong`. The «0» of the stock cells (Phuong: grey) is NOT here: CSS cannot
   pick a cell by its text and the markup carries no class for a zero, so that half of M02 waits for a hook in js/forecast-po-tab.js (a later lot). */
#screenForecast .forecast-dm-table tbody td.num:last-child { font-weight: var(--weight-bold); color: var(--text-strong); }

/* M03 (M3, N-363) - a standard lead time still empty: pale amber box, amber border, and the word «Chua nhap» in the dark amber ink, 12px bold italic (Phuong's is 10px
   and #b06d00, 4.01:1). The box is picked by what it is, not by a class: the lead input of Danh muc (data-f=lead_std) while its placeholder shows, so it turns
   back to the plain box the moment a number is typed, and while it has the focus (the ring and the blue border of the §DS stay). Only a person who may write the
   lead time sees this input at all; everyone else reads «—». */
#screenForecast .forecast-dm-table .v-input[data-f="lead_std"]:placeholder-shown:not(:focus) { background: var(--fcs-miss-soft-bg); border-color: var(--warning); }
#screenForecast .forecast-dm-table .v-input[data-f="lead_std"]::placeholder { color: var(--warning-text); font-size: 12px; font-weight: var(--weight-bold); font-style: italic; opacity: 1; }
/* /L4-SKIN-2 */

/* L4-SKIN-3 --- order list + closed order (L02 L03 L04 L05 L08 L10 L13 L14) ------------------------------------ */
/* No token is declared here (SKIN-0 owns every --fcs-*). Every selector below names a part that exists ONLY on the order-list tab
   (.forecast-kpis-3, the table that holds #fcTickAll, .forecast-bulkbar) or on the closed-order view (.forecast-xem-bar), so no other
   Forecast screen can change. Heights are held: each rule that changes a font size also writes the line height the baseline measured. */

/* L02 + L03 - the two number cards of the list tab. Label: 12px capitals (the 13px sentence case it replaces); number: UTM Bebas 36px,
   never a VND amount (these are counts of orders). Line heights are the baseline's own (16px label, 30.8px = 28px x 1.1 number), so a
   card is exactly as tall as before. Draft number --warning-strong (Phuong's #d98a1f is 2.76:1 on white), closed number --success. */
#screenForecast .forecast-kpis-3 .forecast-kpi > span {
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.05em; line-height: 16px;
  text-transform: uppercase; color: var(--text-muted);
}
#screenForecast .forecast-kpis-3 .forecast-kpi > b {
  font-family: var(--font-display); font-size: 36px; font-weight: var(--weight-regular); line-height: 30.8px;
}
#screenForecast .forecast-kpis-3 .forecast-kpi-draft > b { color: var(--warning-strong); }
#screenForecast .forecast-kpis-3 .forecast-kpi-done > b { color: var(--success); }

/* L04 - the date of the data card: UTM Bebas 24px in ink. The word before it ("toi ngay") is bare text in the line, so it cannot be
   styled without a wrapper (a js/ change) - that half of the row moves to a later lot. line-height 0: a 24px face on a 13px line would
   make the line 6px taller (measured 32 -> 38px); with 0 the date adds nothing to the line box and keeps the text baseline. */
#screenForecast .forecast-kpis-3 > .forecast-datacard .forecast-datacard-head > b {
  font-family: var(--font-display); font-size: 24px; font-weight: var(--weight-regular); letter-spacing: 0.01em; line-height: 0;
  color: var(--ink);
}

/* L05 - a source that is late reads in red (--danger 5.39:1 on white; Phuong's #d24545 is 4.49), the mark with it; an up-to-date line
   keeps --success. 12px per the map row; the 16px line height of the 13px line it replaces is kept, so the card does not shrink. */
#screenForecast .forecast-kpis-3 .forecast-src.old { font-size: var(--text-xs); line-height: 16px; color: var(--danger); }
#screenForecast .forecast-kpis-3 .forecast-src.old .forecast-src-mark { color: var(--danger); }

/* L08 - the head row of the order table. ":has(#fcTickAll)" picks the one table that holds the tick-all box, so the frozen table of the
   closed-order view and the tables of the other tabs are not reached. 12px capitals, bold, .05em, on the sunken ground, with a 2px rule
   under it. The rule is an inset shadow, like the 1px one this head already draws: a 2px border-bottom measured +0.5px on the head and +0.5px
   on the first row (collapsed borders), a shadow measures 0. (Phuong's 10.5px is under the 12px floor: the size is not copied, the rest is.) */
#screenForecast .forecast-table:has(#fcTickAll) thead th {
  background: var(--surface-sunken); color: var(--gray-600); font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: 0.05em; text-transform: uppercase; box-shadow: inset 0 -2px 0 var(--border-default);
}

/* L10 - the ground of a row. A draft is a paler cream than the --warning-bg it had (and goes to --fcs-row-draft-hover under the pointer);
   a ticked row keeps --blue-50 and gets --blue-100 under the pointer. Text on all four grounds is computed in the test. */
#screenForecast .forecast-table:has(#fcTickAll) tbody tr.draft td { background: var(--fcs-row-draft); }
#screenForecast .forecast-table:has(#fcTickAll) tbody tr.draft:hover td { background: var(--fcs-row-draft-hover); }
#screenForecast .forecast-table:has(#fcTickAll) tbody tr.selected td { background: var(--blue-50); }
#screenForecast .forecast-table:has(#fcTickAll) tbody tr.selected:hover td { background: var(--blue-100); }

/* L13 - the count in the bulk bar: blue while something is ticked, muted while the bar is grey. The bar's own ground and border are kept
   (the map row says so). --color-primary on --blue-50 and --text-muted on --surface-sunken are computed in the test. */
#screenForecast .forecast-bulkbar .forecast-bulk-n { color: var(--color-primary); }
#screenForecast .forecast-bulkbar.is-off .forecast-bulk-n { color: var(--text-muted); }

/* L14 - the "closed order, view only" bar: --blue-50 ground, a --blue-200 edge, rounded. The bar has no border and no vertical padding, and
   the map forbids moving its height (DS-47 leaves the 3-part layout to a later lot), so the edge is an inset shadow and only the sides get
   padding. Its label is the first <b> of the bar (the map names .forecast-ord-st .k, which is the order SHEET's bar - SKIN-4): 12px
   capitals, spaced .1em, muted (5.27:1 on --blue-50). The red "cancel" button and the status pill inside the bar are not touched. */
#screenForecast .forecast-xem-bar {
  padding-inline: var(--space-3); border-radius: var(--radius-md); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue-200);
}
#screenForecast .forecast-xem-bar > b:first-child {
  font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
}
/* /L4-SKIN-3 */

/* L4-SKIN-4 --- order sheet: KPI row, bands, heads, cells, totals ----------------------------------------- */
/* B01 - the «Don dang lam» bar. It is drawn only while an order exists, so only Phuong's «co don» look has a counterpart here (no order = the empty panel, not this bar).
   Ground and edge: the green tint and the lime of the green button. The label keeps its 12px/600/caps and takes the muted ink (5.53:1 on the tint). */
#screenForecast .forecast-ord-status { background: var(--fcs-ordbar-on); border-color: var(--green-400); }
#screenForecast .forecast-ord-st .k { color: var(--text-muted); }

/* B03 + B04 - the KPI row «Tong quan ky dat hang»: flat cells split by a 1px rule, no card per cell. The block does not move: height (122px), padding, gap and the x of the
   text are the old ones (the old 4px left edge is 1px + 3px of padding; the 1px top/right/bottom edges stay, transparent). The tone of a cell moves from that old edge to
   its NUMBER. A lit cell = pale ground + a 3px bar at the foot, no outline; the ring of the keyboard is restated because the old outline was also the lit look.
   The two line-heights are the old boxes (18px head, 26.4px figure), so UTM Bebas 38px does not make the cell taller. Bebas here is a COUNT (mã, kg), never an amount. */
#screenForecast .forecast-ov-hd {
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-muted); line-height: 18px;
}
#screenForecast .forecast-ov-cell {
  border-color: transparent; border-left-color: var(--border-subtle); border-left-width: 1px; padding-left: calc(var(--space-3) + 3px);
  border-radius: 0; box-shadow: none;
}
#screenForecast .forecast-ov-cell:first-child { border-left-color: transparent; }
#screenForecast .forecast-ov-cell:not(:disabled):hover { background: var(--blue-50); }
#screenForecast .forecast-ov-cell.on { background: var(--blue-50); box-shadow: inset 0 -3px 0 var(--color-primary); outline: 0; }
#screenForecast .forecast-ov-cell:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
#screenForecast .forecast-ov-lbl { letter-spacing: 0.05em; color: var(--text-muted); }
#screenForecast .forecast-ov-sub { color: var(--text-muted); }
#screenForecast .forecast-ov-fig {
  font-family: var(--font-display); font-size: 38px; font-weight: var(--weight-regular); line-height: 26.4px; color: var(--ink);
}
#screenForecast .forecast-ov-cell.is-blue .forecast-ov-fig { color: var(--color-primary); }
#screenForecast .forecast-ov-cell.is-bad .forecast-ov-fig { color: var(--danger); }
#screenForecast .forecast-ov-cell.is-watch .forecast-ov-fig { color: var(--warning-strong); }
#screenForecast .forecast-ov-cell.is-green .forecast-ov-fig { color: var(--success); }
#screenForecast .forecast-ov-u { font-family: var(--font-body); font-size: 13px; font-weight: var(--weight-bold); line-height: 0; color: var(--text-muted); }

/* B14 - «Gom nhom theo NCC» while ON (the only state that is v-btn-primary): pale blue ground, blue edge and ink, no coloured shadow. §DS's hover and active are the dark
   blue with white text, so both are restated; :disabled is not touched and the focus ring is restated. The icon and aria-pressed are markup and stay. */
#screenForecast .v-btn-primary[data-act="group"]:not(:disabled) { background: var(--blue-50); color: var(--color-primary); border-color: var(--color-primary); box-shadow: none; }
#screenForecast .v-btn-primary[data-act="group"]:not(:disabled):hover { background: var(--blue-50); color: var(--color-primary); border-color: var(--blue-400); box-shadow: none; }
#screenForecast .v-btn-primary[data-act="group"]:not(:disabled):active { background: var(--blue-100); color: var(--color-primary); border-color: var(--color-primary); box-shadow: none; }
#screenForecast .v-btn-primary[data-act="group"]:not(:disabled):focus-visible { box-shadow: var(--shadow-focus); }

/* B18 - the chips above the sheet: the live one (order date) and the editable one (cover days) take the lime edge; the editable one a pale green ground. */
#screenForecast .forecast-chip-live { border-color: var(--green-400); }
#screenForecast .forecast-chip-edit:not(.forecast-chip-off) { background: var(--green-50); border-color: var(--green-400); }

/* B05 - the group bands (tiers 1 and 2 of the head): a solid ground per group, white or dark ink picked so every pair clears 4.5:1 (the map's matrix). The markup carries no group
   class, so a band is found by its POSITION in its tier - the tiers are fixed (tier 1: SKU, Waiting Period, Doanh so theo thang, BQ, Doanh so, HTK, the super-band «Xac dinh...»,
   next month, note; tier 2: Option 1, Option 2, Chot don) - or by the class it already has (fo-kband-sku, fo-kband-wp, fo-bd-sup). forecast-skin-4-css.test.js draws the REAL head
   and pins the order, so a moved band turns that test red instead of turning a band the wrong colour. The vertical rule is an inset shadow, not a border: a collapsed border
   stays where the table drew it when a frozen cell sticks (A3 N-515). The side padding is 4px (was 8px): the 84px «Hang ton kho cuoi thang sau» band in capitals would wrap to a 5th line and make the whole head taller. The labels keep the OLD line box (13px x 1.25 = 16px) so the head does not get shorter with the 12px type; the sub lines go back to line-height normal. The «DVT» line keeps full opacity: 0.8 of white on the lighter bands is below 4.5:1. */
#screenForecast .fo-t thead tr:is(.fo-b1, .fo-b2) th.fo-bd {
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.02em; line-height: 16px; text-align: center; padding-inline: var(--space-1);
  box-shadow: inset -1px 0 0 var(--fcs-band-sep), inset 0 -1px 0 var(--border-subtle);
}
#screenForecast .fo-t thead tr.fo-b1 th.fo-bd { text-transform: uppercase; }
#screenForecast .fo-t thead tr.fo-b2 th.fo-bd { text-transform: none; }
#screenForecast .fo-t thead tr:is(.fo-b1, .fo-b2) th.fo-bd .forecast-th-sub { opacity: 1; }
#screenForecast .fo-t thead tr.fo-b1 th.fo-kband-sku { background: var(--fcs-b-sku); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b1 th.fo-kband-wp { background: var(--blue-700); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b1 th.fo-bd:nth-child(3) { background: var(--blue-500); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b1 th.fo-bd:nth-child(4) { background: var(--fcs-b-bq); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b1 th.fo-bd:nth-child(5) { background: var(--fcs-b-mtd); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b1 th.fo-bd:nth-child(6) { background: var(--gray-600); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b1 th.fo-bd-sup { background: var(--green-700); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b1 th.fo-bd:nth-child(8) { background: var(--gray-700); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b1 th.fo-bd:nth-child(9) { background: var(--gray-500); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b2 th.fo-bd:nth-child(1) { background: var(--fcs-b-o1); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b2 th.fo-bd:nth-child(2) { background: var(--fcs-b-o2); color: var(--text-on-brand); }
#screenForecast .fo-t thead tr.fo-b2 th.fo-bd:nth-child(3) { background: var(--green-400); color: var(--green-900); }

/* B06 - the column heads (tier 3): neutral grey, tinted by group as Phuong's page does, 12px/700 centred, a 3px line under (an inset shadow, for the same reason as above). The group
   is told by the Excel letter that starts the tooltip title («O · BQ 3 thang» -> «O ») or, for E / F / G, by the class they carry; H (Chi tieu) has neither a title nor a freeze
   class. The test draws the real head and checks every letter below exists and sits in the group named here. There is no sorted state to restyle: AI BOT has no sort by head. */
#screenForecast .fo-t thead tr.fo-b3 th {
  background: var(--gray-100); color: var(--text-body); font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: 16px; text-align: center; box-shadow: inset 0 -3px 0 var(--gray-500);
}
#screenForecast .fo-t thead tr.fo-b3 th.fo-ke, #screenForecast .fo-t thead tr.fo-b3 th.fo-kl { background: var(--fcs-h-blue1); color: var(--text-body); }
#screenForecast .fo-t thead tr.fo-b3 th.fo-kr { background: var(--warning-bg); color: var(--text-body); }
#screenForecast .fo-t thead tr.fo-b3 th.fo-col:not([data-tip-title]):not([class*="fo-k"]),
#screenForecast .fo-t thead tr.fo-b3 th:is([data-tip-title^="I "], [data-tip-title^="J "], [data-tip-title^="K "], [data-tip-title^="L "], [data-tip-title^="M "], [data-tip-title^="N "]) { background: var(--fcs-h-blue2); color: var(--text-body); }
#screenForecast .fo-t thead tr.fo-b3 th:is([data-tip-title^="O "], [data-tip-title^="P "], [data-tip-title^="Q "], [data-tip-title^="R "]) { background: var(--fcs-h-blue3); color: var(--text-body); }
#screenForecast .fo-t thead tr.fo-b3 th:is([data-tip-title^="Z "], [data-tip-title^="AA "], [data-tip-title^="AB "], [data-tip-title^="AC "]) { background: var(--fcs-h-o1); color: var(--text-body); }
#screenForecast .fo-t thead tr.fo-b3 th:is([data-tip-title^="AD "], [data-tip-title^="AE "], [data-tip-title^="AF "], [data-tip-title^="AG "]) { background: var(--fcs-h-o2); color: var(--text-body); }
#screenForecast .fo-t thead tr.fo-b3 th[data-tip-title^="AH "] { background: var(--fcs-h-final); color: var(--green-800); }
#screenForecast .fo-t thead tr:is(.fo-b1, .fo-b2, .fo-b3) th .forecast-th-sub { line-height: normal; }
#screenForecast .fo-t thead tr.fo-b3 th .forecast-th-sub { font-weight: var(--weight-medium); color: var(--gray-600); opacity: 1; }

/* B07 - the grounds of the body, one language per column as Phuong's page has it: the history line (and every cell that spans both lines) is the faintest blue-grey, the lead
   (E) pale blue, the applied lead (F) a stronger blue with bold blue ink, the ready date (G) cream with bold brown ink, Final (AH) pale green framed in lime (the frame is an inset shadow: a 2px border of a collapsed table is taken from the neighbouring columns and made the table 4px wider). Every colour is a solid
   token, so the frozen cells stay opaque. ORDER MATTERS here: the four rules have the same weight, so the column rules sit AFTER the history rule, and the N/A and the selected
   rules (below, and in the totals block) after those; forecast-skin-4-css.test.js pins that order. */
#screenForecast .fo-t tbody tr.fo-rh td { background: var(--fcs-d-hist); }
#screenForecast .fo-t tbody tr td.fo-ke { background: var(--blue-50); }
#screenForecast .fo-t tbody tr td.fo-kl { background: var(--fcs-h-blue1); color: var(--blue-700); font-weight: var(--weight-bold); }
#screenForecast .fo-t tbody tr td.fo-kr { background: var(--fcs-d-ready); color: var(--fcs-d-ready-ink); font-weight: var(--weight-bold); }
#screenForecast .fo-t tbody tr td.fo-final { background: var(--fcs-d-final); box-shadow: inset 2px 0 0 var(--green-400), inset -2px 0 0 var(--green-400); }

/* B08 - the lead box (E). Empty = the cream ground; with a number = white, a blue edge, bold. The state is read from :placeholder-shown, which is right while the box always
   carries a placeholder (the standard lead, or «Phai nhap»); the red «Phai nhap» box, a box in conflict and a focused box keep AI BOT's own look. */
#screenForecast .fo-t td.fo-ke .v-input:placeholder-shown:not(.fo-in-must):not(.forecast-conflict):not(:focus) { background: var(--fcs-d-input); }
#screenForecast .fo-t td.fo-ke .v-input:not(:placeholder-shown):not(.fo-in-must):not(.forecast-conflict):not(:focus) { background: var(--surface-card); border-color: var(--blue-400); font-weight: var(--weight-bold); }

/* B09 - the Final box (AH): bold dark green, a lime-green edge, white; the «chua chot» hint in the dark amber, 12px italic (Phuong's 11px orange is 2.76:1). */
#screenForecast .fo-t td.fo-final .v-input:not(.forecast-conflict):not(:focus) { background: var(--surface-card); border-color: var(--fcs-fin-border); }
#screenForecast .fo-t td.fo-final .v-input:not(.forecast-conflict) { color: var(--green-800); font-weight: var(--weight-bold); }
#screenForecast .fo-t td.fo-final .v-input::placeholder { color: var(--warning-text); font-size: var(--text-xs); font-style: italic; font-weight: var(--weight-semibold); }

/* B10 - N/A: the cream ground, and the word in the dark amber (4.67:1; Phuong's orange is 2.51:1). The red triangle is AI BOT's own (4.90:1) and is not touched. After the column
   rules above, because F and G are columns that can be N/A. */
#screenForecast .fo-t tbody tr td.fo-na { background: var(--fcs-na-bg); }
#screenForecast .fo-t .fo-na-t { color: var(--warning-strong); font-size: var(--text-xs); font-weight: var(--weight-bold); }

/* B15 - the selected row: the pale blue ground over every column tint (the rule comes after them), the tick cell one step darker, a 4px bar on the first cell. A row that is short
   of stock keeps its red bar (4px, was 3px); a row that is both shows the red bar and the blue one beside it. N/A keeps its own ground in a selected row: the amber word on the
   selection blue is 4.47:1, under the floor (Phuong lets the selection win). */
#screenForecast .fo-t tbody tr.selected td { background: var(--fcs-pick); }
#screenForecast .fo-t tbody tr.selected td.fo-kt { background: var(--blue-100); }
#screenForecast .fo-t tbody tr.selected td.fo-na { background: var(--fcs-na-bg); }
#screenForecast .fo-t tbody tr.fo-short td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
#screenForecast .fo-t tbody tr.fo-rh.selected td:first-child { box-shadow: inset 4px 0 0 var(--color-primary); }
#screenForecast .fo-t tbody tr.fo-rh.selected.fo-short td:first-child { box-shadow: inset 4px 0 0 var(--danger), inset 8px 0 0 var(--color-primary); }

/* B12 - the two total rows: blue-50 ground, bold blue ink, the 2px blue line on top (an inset shadow on the first row: a collapsed border stays where the table drew it when
   the pinned row sticks, A3 N-515). Labels: «TONG CONG» and the sigma in UTM Bebas 15px capitals (words, not amounts); «Lich su» / «Du bao» and «N ma» in the body face, 12px bold
   blue. The Final total (the AH cell) is the one `num` cell followed by a `num` and then the empty note cell (class fo-tb): the test draws the foot and checks that exactly one cell
   matches. A negative total keeps AI BOT's own red. */
#screenForecast .fo-t tfoot td { background: var(--blue-50); color: var(--blue-700); font-weight: var(--weight-bold); }
#screenForecast .fo-t tfoot td.neg { color: var(--danger-text); }
#screenForecast .fo-t tfoot tr.fo-tfh td { box-shadow: inset 0 2px 0 var(--color-primary); }
#screenForecast .fo-t tfoot td.fo-tl { font-family: var(--font-display); font-size: 15px; font-weight: var(--weight-regular); letter-spacing: 0.02em; text-transform: uppercase; color: var(--color-primary); }
#screenForecast .fo-t tfoot td.fo-tl:not(.fo-ks):not(.fo-tn) { font-family: var(--font-body); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: normal; text-transform: none; }
#screenForecast .fo-t tfoot td.fo-tn b { font-weight: var(--weight-regular); }
#screenForecast .fo-t tfoot td.fo-tl .forecast-foot-note { font-family: var(--font-body); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: normal; text-transform: none; color: var(--color-primary); }
#screenForecast .fo-t tfoot tr.fo-tfh td.num:has(+ td.num + td.fo-tb) { background: var(--fcs-tf-final); color: var(--green-800); font-size: 13.5px; box-shadow: inset 0 2px 0 var(--color-primary), inset 2px 0 0 var(--green-400), inset -2px 0 0 var(--green-400); }

/* B13 - the supplier group line: the grey ground, a 2px blue line on top, a grey one under; the numbers line in semibold grey-600 (6.59:1). */
#screenForecast .fo-t tbody tr.fo-gsep td { background: var(--gray-100); border-top: 2px solid var(--color-primary); border-bottom-color: var(--border-default); }
#screenForecast .fo-t .fo-gmeta { font-weight: var(--weight-semibold); color: var(--gray-600); }
/* /L4-SKIN-4 */
