/* shared/css-p.css: P-tablet polish (13 Oct). The tablet apps only (procurement/ and helpdesk/ link it last).
   1. One anatomy for every sheet and dialog, after the Antz pharmacy dialogs (AddReOrderDialog) and the batch assessment dialogs
      (SetDateDialog, BATCH_ASSESSMENT_STYLE_GUIDE §3-§5), fitted to the Figma bottom sheet (Add NEW 1535:80501) and Reason Overlay (269:52426):
        header   title Antz_Medium 20/500 OnSurfaceVariant, an optional Body Regular neutralSecondary line, the close (44 px hit) at the right;
                 fixed, with the Figma 1 px shadow under it
        body     scrolls on its own between the header and the footer (sheets: Background ground, white form cards; dialogs: white)
        footer   fixed; the error line (Error on a 8% Error tint) above the buttons; CANCEL outlined on the left, the named action filled on
                 the right, side by side, equal width, upper case (Button Medium)
        widths   bottom sheet: the frame width, up to 88% high; dialog: 440 px, 16 px radius, the dialog elevation; side sheet: 60% from the right
   2. Readability and colour: amber and cyan text darkened to pass contrast; one ink for neutral figures; status tints on item tags;
      tabular figures and right-aligned money; the tab indicator (it had no width). */

:root {
  --c-warn-ink: #7A5D00;   /* moderateSecondary darkened: amber text on white or on its tint (4.9:1) */
  --c-info-ink: #00677F;   /* addPrimary darkened: cyan text on its tint */
  --sh-dialog: 0 24px 38px 3px rgba(0, 0, 0, .14), 0 11px 15px -7px rgba(0, 0, 0, .2); /* batch assessment guide §5 */
}

/* ---------------------------------------------------------------- tabs: the active indicator had no width (the span collapsed) */
.ui-tab__ind { display: block; align-self: stretch; width: 100%; }
.ui-tab.is-on .ui-tab__l { color: var(--c-on-secondary-container); }

/* ---------------------------------------------------------------- 1. bottom sheet: fixed header and footer, the body scrolls */
#layer .layer__box:has(> .hd-sheet) { display: flex; flex-direction: column; overflow: hidden; }
#layer .layer__box > .hd-sheet { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
.hd-sheet > .hd-shd, .hd-sheet > .hd-sfoot { flex: none; }
.hd-sheet > .hd-sbody { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.hd-sheet > .hd-sbody:last-child { padding-bottom: 24px; border-bottom: 0; }
.ui-dlg .hd-shd { gap: 12px; height: auto; min-height: 64px; }
.ui-dlg__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font: var(--t-medium); color: var(--c-on-surface-variant); }
.ui-dlg__t small { font: var(--t-body-regular); color: var(--c-neutral-secondary); }
.ui-dlg__x, .ui-sheet__x { width: 44px; height: 44px; flex: none; display: grid; place-items: center; margin-right: -10px; border-radius: 50%; }
.ui-dlg__x:hover, .ui-sheet__x:hover, .ui-reason__x:hover, .ui-ss__x:hover { background: var(--c-neutral-05); }
.ui-dlg__x:focus-visible, .ui-sheet__x:focus-visible, .ui-reason__x:focus-visible { outline: 2px solid var(--c-on-primary-container); outline-offset: -2px; }
/* footer */
.ui-dlg__foot { display: flex; flex-direction: column; gap: 12px; padding: 16px var(--ui-pad) 24px; background: var(--c-white); border-top: 1px solid var(--c-surface-variant); }
.ui-dlg__acts { display: flex; gap: 16px; }
.ui-dlg__acts .ui-btn { flex: 1 1 0; min-width: 0; width: auto; height: 56px; padding: 8px 16px; font: var(--t-minor-title); letter-spacing: .4px; text-transform: uppercase; }
.ui-dlg__acts .ui-btn--outline { color: rgba(68, 84, 74, .87); }
.ui-dlg__err { margin: 0; padding: 8px 12px; border-radius: 8px; background: rgba(233, 51, 83, .08); font: var(--t-body-regular); color: var(--c-error); }
.ui-dlg__err[hidden] { display: none; }
.hd-added .hd-added__t { padding: 32px var(--ui-pad) 16px; }

/* ---------------------------------------------------------------- 1. dialog (Reason Overlay): 440, white, title 20, muted line, CANCEL + action */
#layer .layer__box--center:has(> .ui-reason) { width: 440px; max-width: calc(100% - 48px); background: var(--c-white); border-radius: 16px; box-shadow: var(--sh-dialog); overflow: visible; }
.tab-frame .ui-reason { width: 100%; gap: 20px; padding: 20px 24px 24px; border-radius: 16px; }
.tab-frame .ui-reason__h { gap: 12px; font: var(--t-medium); color: var(--c-on-surface-variant); }
.tab-frame .ui-reason__x { margin: -10px -12px -10px 0; border-radius: 50%; }
.tab-frame .ui-reason__sub { margin-top: -4px; color: var(--c-neutral-secondary); line-height: 20px; }
.tab-frame .ui-reason__box { border-radius: 8px; font: 400 16px/24px var(--t-family); min-height: 120px; }
.tab-frame .ui-reason__err { margin: 0; }
.tab-frame .ui-reason .ui-dlg__acts .ui-btn { height: 48px; font: 500 14px/24px var(--t-family); letter-spacing: .4px; }

/* ---------------------------------------------------------------- 1. side sheet (insights) and the approver sheet: the same header */
.ui-ss__h { padding: 20px 14px 16px var(--ui-pad); box-shadow: 0 1px .5px rgba(0, 0, 0, .1); border-bottom: 0; }
.ui-ss__l { font: var(--t-medium); color: var(--c-on-surface-variant); }
.ui-ss__x { width: 44px; height: 44px; }
.ui-ss__n { padding: 16px var(--ui-pad) 4px; }
.ui-ss__list { padding: 4px 16px 24px; }
.ui-sheet__t { font: var(--t-medium); color: var(--c-on-surface-variant); }

/* ---------------------------------------------------------------- 2. colour: one ink for neutral figures; accents only for what needs action */
.ui-ins__c:is([data-tone="navy"], [data-tone="info"], [data-tone="ok"]) .ui-ins__v,
.ui-kf__c:is([data-tone="navy"], [data-tone="info"], [data-tone="ok"]) .ui-kf__v,
.ui-ss:is([data-tone="navy"], [data-tone="info"], [data-tone="ok"]) .ui-ss__v { color: var(--c-on-secondary-container); }
.ui-ins__c[data-tone="warn"] .ui-ins__v, .ui-kf__c[data-tone="warn"] .ui-kf__v, .ui-ss[data-tone="warn"] .ui-ss__v { color: var(--c-warn-ink); }
.ui-ins__c[data-tone="warn"] { --ins-c: var(--c-warn-ink); } /* the chevron and the pressed state follow */

/* item tags (Part Card tag) in their status colours (Statuses 89:129883) */
.ui-part__tag--wait { background: var(--c-st-awaiting-bg); color: var(--c-st-awaiting-fg); }
.ui-part__tag--mine { background: var(--c-notes); color: var(--c-tertiary); }
.ui-part__tag--approved { background: var(--c-st-approved-bg); color: var(--c-st-approved-fg); }
.ui-part__tag--progress { background: var(--c-st-progress-bg); color: var(--c-st-progress-fg); }
.ui-part__tag--done { background: var(--c-st-done-bg); color: var(--c-st-done-fg); }
.ui-part__tag--rejected { background: rgba(233, 51, 83, .08); color: var(--c-error); }
.ui-part__tag--cancelled { background: rgba(250, 97, 64, .1); color: var(--c-tertiary); }

/* ---------------------------------------------------------------- 2. numbers: tabular figures; money right-aligned in the fact rows */
.ui-card__fv, .ui-part__price, .ui-total__v, .pc-btot__v, .pc-tbl td, .ui-ss__e, .ui-kf__v, .ui-tab__n, .pc-sub__v { font-variant-numeric: tabular-nums; }
.pc-facts .pc-fact--money { text-align: right; }
.pc-facts .pc-fact--money .ui-card__fl { justify-content: flex-end; }

/* the priority sheet: the sheet header names it, so the card's own heading and padding go */
.ui-dlg .hd-psheet { padding: 0; background: none; }
.ui-dlg .hd-psheet .ui-fcard__h { display: none; }

/* the dashboard's seven KPIs: four per row, the last one spans two, so the grid has no hole and its long hint fits */
.pc-dash .ui-kf__c:last-child:nth-child(7) { grid-column: span 2; }

/* ---------------------------------------------------------------- S7: the fixed cost (fix-cost rows in the move sheet; "Estimate → Final" on lines and totals) */
.pc-fxrow { display: flex; flex-direction: column; gap: 12px; padding: 12px 0 14px; border-bottom: 1px solid var(--c-surface-variant); }
.pc-fxrow:first-child { padding-top: 0; }
.pc-fxrow__d { margin: -2px 0 0; font: var(--t-body-regular); color: var(--c-on-surface-variant); font-variant-numeric: tabular-nums; }
.pc-fxrow__d b { font: var(--t-body-title); color: var(--c-on-secondary-container); }
.pc-rtx { margin: 0; font: var(--t-subtext-regular); color: var(--c-neutral-secondary); font-variant-numeric: tabular-nums; }
.ui-sec .pc-rtx { margin-top: 6px; text-align: right; }
.pc-rtx--bar { margin-top: -8px; padding-bottom: 8px; text-align: right; }
.pc-est { display: block; font: var(--t-subtext-regular); color: var(--c-neutral-secondary); }
.pc-fixc { align-self: flex-start; gap: 4px; }

/* R6-6: Cancel Unordered Lines sheet: one preview row per line or vendor sub-line (name, quantity, vendor, value; its status chip) */
.pc-curow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--c-surface-variant); }
.pc-curow:last-of-type { border-bottom: 0; }
.pc-curow .pc-mvrow__t { flex: 1 1 auto; }

/* V3b: the vendor select (and "Split across vendors") at the top of each fix row */
.pc-fxv { display: flex; flex-direction: column; gap: 4px; }
.pc-fxv .ui-of { margin: 0; }
.pc-fxv .pc-other { align-self: flex-start; }
