/* shared/css-c.css: Wave 1, agent C (13 Oct). The tablet apps only (procurement/ and helpdesk/ link it after their own CSS).
   U5-3 Material UI outlined fields · U5-9 insight cards that read as buttons, and the insight side sheet · U5-12 item detail status chips ·
   U5-13 the By cost centre picker. Rules are scoped under .tab-frame so they win over components.css without touching it. */

/* ---------------------------------------------------------------- U5-3: outlined fields behave like MUI's OutlinedInput (compliance-v2
   src/views/forms/form-fields, theme overrides input.js). Empty: the label sits inside at body size. Focused or filled: it floats onto the
   border at 0.75 scale with a notch, animated (MUI: 200 ms, cubic-bezier(0, 0, .2, 1)). Focus: a 2 px Primary border and a Primary label.
   Hover: a darker outline. Dates always float (MUI shrinks the label for date inputs). A select floats once it has a real value; a select
   still on its disabled "Choose" option counts as empty. The Figma look stays: colours, the 8 px radius, the 16 px text and the field heights. */
.tab-frame .ui-of { transition: border-color .2s, background-color .2s, box-shadow .2s; }
.tab-frame .ui-of:hover:not(:focus-within) { border-color: var(--c-outline); }
.tab-frame .ui-of:focus-within { border-color: var(--c-primary); box-shadow: inset 0 0 0 1px var(--c-primary); }
.tab-frame .ui-of .ui-of__l,
.tab-frame .ui-of:focus-within .ui-of__l,
.tab-frame .ui-of:has(.ui-of__in:not(:placeholder-shown)) .ui-of__l {
  top: 0; left: 0; padding: 0; background: transparent; font: var(--t-minor-regular); letter-spacing: 0; line-height: 20px;
  max-width: calc(100% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transform-origin: left top; transform: translate(12px, 16px) scale(1);
  transition: transform .2s cubic-bezier(0, 0, .2, 1), color .2s, padding .2s, max-width .2s, background-color .2s; }
.tab-frame .ui-of--multi .ui-of__l { transform: translate(12px, 12px) scale(1); }
/* floated: on the border, 12 px (16 x .75), with the notch (a white patch the width of the label) */
.tab-frame .ui-of:focus-within .ui-of__l,
.tab-frame .ui-of:has(.ui-of__in:not(:placeholder-shown)) .ui-of__l,
.tab-frame .ui-of:has(input.ui-of__in[type="date"]) .ui-of__l {
  transform: translate(9px, -10px) scale(.75); padding: 0 5px; background: var(--c-white); color: var(--c-on-surface-variant); max-width: calc(133% - 32px); }
.tab-frame .ui-of:focus-within .ui-of__l { color: var(--c-primary); }
.tab-frame .ui-of:has(input.ui-of__in[type="date"]) { background: var(--c-white); }
/* an empty select (its disabled "Choose" option): the label inside, the placeholder text hidden, as MUI's empty Select */
.tab-frame .ui-of:has(select.ui-of__in option:checked[disabled]):not(:focus-within) { background: var(--c-surface); }
.tab-frame .ui-of:has(select.ui-of__in option:checked[disabled]):not(:focus-within) .ui-of__l {
  transform: translate(12px, 16px) scale(1); padding: 0; background: transparent; color: var(--c-on-primary-container); max-width: calc(100% - 44px); }
.tab-frame .ui-of:has(select.ui-of__in option:checked[disabled]):not(:focus-within) select.ui-of__in { color: transparent; }
.tab-frame .ui-of select.ui-of__in { cursor: pointer; }
.tab-frame .ui-mform .ui-of:has(select.ui-of__in option:checked[disabled]):not(:focus-within) { background: var(--c-white); }
@media (prefers-reduced-motion: reduce) { .tab-frame .ui-of, .tab-frame .ui-of .ui-of__l { transition: none; } }

/* ---------------------------------------------------------------- U5-9: insight cards look and feel tappable */
.ui-ins__c { position: relative; padding-right: 34px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease-out, border-color .15s, box-shadow .15s, background-color .15s; }
.ui-ins__go { position: absolute; right: 8px; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; display: grid; place-items: center;
  fill: var(--c-neutral-secondary); transition: background-color .15s, fill .15s, transform .15s; }
.ui-ins__go svg { display: block; }
.ui-ins__c:hover .ui-ins__go, .ui-ins__c:focus-visible .ui-ins__go { fill: var(--ins-c); background: var(--ins-b); }
.ui-ins__c:active { transform: scale(.97); background: color-mix(in srgb, var(--ins-b) 55%, var(--c-white)); box-shadow: 0 1px 4px rgba(76, 78, 100, .16); }
.ui-ins__c:focus-visible { outline: 2px solid var(--c-on-primary-container); outline-offset: 2px; }
/* the selected look shows only while the card's sheet is open */
.tab-frame:not(:has(#layer .ui-ss)) .ui-ins__c.is-on { border-color: transparent; box-shadow: 0 2px 10px rgba(76, 78, 100, .13); }
.tab-frame:has(#layer .ui-ss) .ui-ins__c.is-on { background: color-mix(in srgb, var(--ins-b) 45%, var(--c-white)); }
.tab-frame:has(#layer .ui-ss) .ui-ins__c.is-on .ui-ins__go { fill: var(--c-white); background: var(--ins-c); }

/* ---------------------------------------------------------------- U5-9: the side sheet (over the list, from the right, 60% of the frame) */
#layer .layer__box:has(> .ui-ss) { top: 0; bottom: 0; left: auto; right: 0; width: 60%; max-height: none; overflow: hidden; transform: none;
  border-radius: 16px 0 0 16px; box-shadow: -8px 0 24px rgba(0, 0, 0, .18); animation: uiSsIn .26s cubic-bezier(0, 0, .2, 1); }
#layer:has(.ui-ss) .layer__scrim { animation: uiSsFade .26s ease-out; }
@keyframes uiSsIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes uiSsFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #layer .layer__box:has(> .ui-ss), #layer:has(.ui-ss) .layer__scrim { animation: none; } }
.ui-ss { height: 100%; display: flex; flex-direction: column; outline: none; background: var(--c-white); }
.ui-ss__h { display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px 16px 20px; border-bottom: 1px solid var(--c-neutral-05); }
.ui-ss__hd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ui-ss__l { font: var(--t-minor-medium); color: var(--c-on-secondary-container); }
.ui-ss__v { font: 600 24px/1.25 var(--t-family); color: var(--ins-c); font-variant-numeric: tabular-nums; }
.ui-ss__hint { font: var(--t-body-regular); color: var(--c-neutral-secondary); overflow-wrap: anywhere; }
.ui-ss__x { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; }
.ui-ss__x:hover { background: var(--c-neutral-05); }
.ui-ss__x:focus-visible { outline: 2px solid var(--c-on-primary-container); outline-offset: 0; }
.ui-ss__n { padding: 12px 20px 4px; font: var(--t-body-medium); letter-spacing: var(--t-body-medium-ls); color: var(--c-on-surface-variant); }
.ui-ss__list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 4px 12px 24px; }
.ui-ss__row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 8px; border-radius: 8px; border-bottom: 1px solid var(--c-neutral-05);
  text-align: left; cursor: pointer; transition: background-color .12s; }
.ui-ss__row:hover { background: var(--c-surface); }
.ui-ss__row:active { background: var(--c-display-bg-secondary); }
.ui-ss__row:focus-visible { outline: 2px solid var(--c-on-primary-container); outline-offset: -2px; }
.ui-ss__row[disabled] { cursor: default; }
.ui-ss__d { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ui-ss__t { display: flex; align-items: center; gap: 8px; min-width: 0; font: var(--t-body-medium); color: var(--c-on-secondary-container); }
.ui-ss__t b { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-ss__t .ui-status--chip { flex: none; }
.ui-ss__t .ui-status--chip .ui-status__in { padding: 2px 8px 2px 4px; }
.ui-ss__t .ui-status--chip .ui-ic { width: 16px; height: 16px; }
.ui-ss__s { font: var(--t-subtext-regular); color: var(--c-neutral-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-ss__e { flex: none; font: var(--t-body-medium); color: var(--c-on-primary-container); font-variant-numeric: tabular-nums; }
.ui-ss__chev { flex: none; width: 8px; height: 8px; margin: 0 6px 0 2px; border-right: 2px solid var(--c-outline); border-bottom: 2px solid var(--c-outline); transform: rotate(-45deg); }
.ui-ss__more { margin-top: 12px; }
.ui-ss__empty { padding: 32px 8px; text-align: center; font: var(--t-body-regular); color: var(--c-neutral-secondary); }

/* ---------------------------------------------------------------- U5-12: one product's lines, one status at a time */
.ui-list__h.pc-iall { height: auto; min-height: 32px; gap: 12px; }
.pc-iall__b { display: inline-flex; align-items: center; gap: 8px; font: var(--t-body-medium); letter-spacing: var(--t-body-medium-ls); color: var(--c-on-primary-container); cursor: pointer; }
.pc-iall__n { font: var(--t-body-regular); color: var(--c-neutral-secondary); }

/* ---------------------------------------------------------------- U5-13: By cost centre, one cost centre at a time */
.pc-cctop .ui-chips { box-shadow: none; padding-bottom: 8px; }
.pc-ccpick { padding: 12px var(--ui-pad) 16px; background: var(--c-white); box-shadow: var(--sh-1); }
.pc-ccpick .ui-of { background: var(--c-white); }
.pc-ccpick select.ui-of__in { appearance: auto; padding-right: 12px; font: var(--t-minor-medium); }
.pc-cctabs { margin-top: 16px; }
