/* ============================================================================
   COSMOSOFT ERP — design layer
   Builds on the committed HRMC token sheet (hrmc.css): every colour, radius,
   shadow, size and spacing step below is an --hrmc-* token, so the five
   palettes, dark appearance and compact density all carry across unchanged.
   Sections: tokens · shell · page header · surfaces · forms · buttons · tables
   · chips & alerts · tabs · workspace home · documents · dialogs · auth ·
   settings · responsive · print · motion.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */
:root{
    --rd-ring:0 0 0 3px color-mix(in srgb,var(--hrmc-brand) 55%,transparent);
    --rd-control-h:2.5rem;
    --rd-card-pad:var(--hrmc-s5,24px);
    --rd-content-max:1360px;
}
/* Workspace themes recolour the brand tokens in workspace-settings.css; the
   sidebar in hrmc.css is a literal brown, so it must follow the brand here or
   a purple workspace gets a brown menu. */
.hrmc-shell[data-workspace-theme] .hrmc-sidebar,
.hrmc-shell[data-workspace-theme] .hrmc-brand{background:var(--rd-sidebar-bg)!important}
/* The bar is derived, not the raw brand: dark mode lightens some brands (the legacy amber
   reaches #C96A18) and white label text on that measured 3.78:1. */
@media (prefers-color-scheme:dark){
    :root:not([data-hrmc-appearance="light"]) .hrmc-shell[data-workspace-theme]{--rd-sidebar-bg:color-mix(in srgb,var(--hrmc-brand-strong) 68%,#000)}
}
:root[data-hrmc-appearance="dark"] .hrmc-shell[data-workspace-theme]{--rd-sidebar-bg:color-mix(in srgb,var(--hrmc-brand-strong) 68%,#000)}
.hrmc-shell[data-workspace-theme]{
    --rd-sidebar-bg:var(--hrmc-brand-strong);
    --hrmc-sidebar-hover:color-mix(in srgb,var(--rd-sidebar-bg) 80%,#000);
    --hrmc-sidebar-active:color-mix(in srgb,var(--rd-sidebar-bg) 72%,#000);
    --hrmc-sidebar-submenu:color-mix(in srgb,var(--rd-sidebar-bg) 90%,#000);
    /* Sidebar text and the active edge follow the workspace colour. HRMC's own values are
       amber tints made for its brown bar, which leak onto a green or blue sidebar. */
    --hrmc-sidebar-text:#fff;
    --hrmc-sidebar-muted:color-mix(in srgb,#fff 84%,var(--rd-sidebar-bg));
    --hrmc-sidebar-edge:var(--hrmc-brand-edge);
}
.hrmc-shell[data-workspace-theme]:not([data-workspace-theme="cosmosoft"]) .hrmc-header{border-bottom-color:var(--hrmc-border)}

/* ----------------------------------------------------------------- shell -- */
.hrmc-shell{color-scheme:light}
@media (prefers-color-scheme:dark){:root:not([data-hrmc-appearance="light"]) :is(.hrmc-shell,.rd-public){color-scheme:dark}}
:root[data-hrmc-appearance="dark"] :is(.hrmc-shell,.rd-public){color-scheme:dark}
.hrmc-header-content{grid-template-columns:300px minmax(180px,1fr) auto}
/* hrmc.css paints this icon --hrmc-brand-strong, which is a dark fill made for a light
   header; on the dark header it measured 2.07:1. Follow the link's own muted colour. */
.hrmc-header .hrmc-password-link .material-symbols-outlined{color:inherit}
.hrmc-account .hrmc-logout{border:0;background:var(--hrmc-brand-strong);color:var(--hrmc-on-brand);cursor:pointer;font:inherit;box-shadow:none}
.hrmc-sidebar{overflow-y:auto;scrollbar-width:thin}
.rd-workspace-button{min-width:0}

/* Sidebar navigation: grouped, with a real current-page state. */
.rd-nav{display:grid;padding:var(--hrmc-s2,8px) var(--hrmc-s3,12px) var(--hrmc-s6,32px);gap:2px;color:var(--hrmc-sidebar-text,#fff)}
.rd-nav a{display:flex;align-items:center;gap:var(--hrmc-s3,12px);min-height:40px;padding:var(--hrmc-s2,8px) var(--hrmc-s3,12px);border-radius:var(--hrmc-r-control,6px);color:var(--hrmc-sidebar-text,#fff);text-decoration:none;font-size:var(--hrmc-fs-body,14px);line-height:1.3;position:relative;border-inline-start:3px solid transparent;transition:background .15s ease}
.rd-nav a .material-symbols-outlined{font-size:20px;flex:none;color:var(--hrmc-sidebar-muted,#ffe6cc);opacity:.9}
.rd-nav a:hover{background:var(--hrmc-sidebar-hover)}
.rd-nav a[aria-current=page]{background:var(--hrmc-sidebar-active);border-inline-start-color:var(--hrmc-sidebar-edge,#ffc08f);font-weight:var(--hrmc-fw-semi,600)}
/* The left edge carries the accent; the active icon itself stays at full legibility. */
.rd-nav a[aria-current=page] .material-symbols-outlined{color:var(--hrmc-sidebar-text,#fff);opacity:1}
.rd-nav a:focus-visible,.rd-nav summary:focus-visible{outline:2px solid var(--hrmc-sidebar-edge,#ffc08f);outline-offset:-2px}
.rd-nav details{margin-top:var(--hrmc-s2,8px)}
.rd-nav details>a{margin-inline-start:var(--hrmc-s1,4px)}
.rd-nav details details{margin:2px 0 var(--hrmc-s1,4px) var(--hrmc-s4,16px);border-inline-start:1px solid color-mix(in srgb,var(--hrmc-sidebar-edge,#ffc08f) 35%,transparent)}
.rd-nav details details>summary{font-size:var(--hrmc-fs-small,12.5px);text-transform:none;letter-spacing:0;padding-inline-start:var(--hrmc-s3,12px)}
.rd-nav summary{display:flex;align-items:center;gap:var(--hrmc-s2,8px);padding:var(--hrmc-s2,8px) var(--hrmc-s3,12px) var(--hrmc-s1,4px);color:var(--hrmc-sidebar-muted,#ffe6cc);cursor:pointer;font-size:var(--hrmc-fs-caption,11px);font-weight:var(--hrmc-fw-bold,700);letter-spacing:.08em;text-transform:uppercase;list-style:none;border-radius:var(--hrmc-r-control,6px);user-select:none}
.rd-nav summary::-webkit-details-marker{display:none}
.rd-nav summary::after{content:"expand_more";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;font-size:18px;margin-inline-start:auto;font-weight:400;text-transform:none;letter-spacing:0;transition:transform .2s ease}
.rd-nav details[open]>summary::after{transform:rotate(180deg)}
.rd-nav summary:hover{color:var(--hrmc-sidebar-text,#fff)}
.rd-nav>a:first-child{margin-bottom:var(--hrmc-s1,4px)}
/* Collapsed rail: icons only. */
.hrmc-shell:not(.is-menu-pinned) .rd-nav summary,.hrmc-shell:not(.is-menu-pinned) .rd-nav a>span:not(.material-symbols-outlined),.hrmc-shell:not(.is-menu-pinned) .rd-nav a{font-size:0}
.hrmc-shell:not(.is-menu-pinned) .rd-nav a{justify-content:center;padding:var(--hrmc-s2,8px)}
.hrmc-shell:not(.is-menu-pinned) .rd-nav summary::after{display:none}
.hrmc-shell:not(.is-menu-pinned) .rd-nav details details{margin-inline-start:0;border:0}

/* Content column */
.rd-content{max-width:var(--rd-content-max);margin:0 auto;padding:var(--hrmc-s5,24px) var(--hrmc-s6,32px) var(--hrmc-s6,40px);color:var(--hrmc-text);letter-spacing:0;font-size:var(--hrmc-fs-body,14px)}
.rd-content:has([data-purchase-editor]),.rd-content:has([data-inventory-editor]),.rd-content:has([data-quotation-selection]),.rd-content:has(.rd-company-profile){max-width:1800px}
.rd-content h1{font-size:var(--hrmc-fs-title,20px);line-height:1.25;margin:0 0 var(--hrmc-s4,16px)}
.rd-content h2{font-size:var(--hrmc-fs-lead,16px);line-height:1.3;margin:0 0 var(--hrmc-s3,12px)}
.rd-content h3{font-size:var(--hrmc-fs-body,14px);margin:0 0 var(--hrmc-s2,8px)}
.rd-content p{margin:0 0 var(--hrmc-s3,12px);line-height:1.5}
.rd-content a:not([class]){color:var(--hrmc-brand-hover);text-decoration:none;font-weight:var(--hrmc-fw-medium,500)}
.rd-content a:not([class]):hover{text-decoration:underline}
.rd-content small,.rd-auth small,.rd-muted{color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-normal,400)}
.rd-content :focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:2px}
/* hrmc.css rings every focusable thing with --hrmc-brand-strong at (0,2,1). HRMC lightens
   that token in dark; ERP cannot, because the workspace sidebar fill is derived from it -
   so the ring came out 2.31:1 against the dark page. --rd-focus keeps the light-mode ring
   exactly as it was (7.08:1) and lifts it to the tinted edge once the page goes dark. */
.hrmc-shell{--rd-focus:var(--hrmc-brand-strong)}
@media (prefers-color-scheme:dark){:root:not([data-hrmc-appearance="light"]) .hrmc-shell{--rd-focus:var(--hrmc-brand-edge)}}
:root[data-hrmc-appearance="dark"] .hrmc-shell{--rd-focus:var(--hrmc-brand-edge)}
.hrmc-shell :is(a,button,[role=button],input,select,textarea,summary,
    .rz-button,.rz-textbox,.rz-dropdown,.rz-datepicker,.rz-numeric,
    .rz-tabview-nav a,.rz-pager-element):focus-visible{outline-color:var(--rd-focus)}
.hrmc-shell .hrmc-sidebar :is(a,button,[role=button],summary):focus-visible{outline-color:var(--hrmc-sidebar-edge,#fff)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.rd-content [hidden],.rd-alert[hidden],.rd-settings [hidden],dialog [hidden]{display:none!important}

/* ------------------------------------------------------------ page header -- */
.rd-toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--hrmc-s3,12px) var(--hrmc-s4,16px);flex-wrap:wrap;margin-bottom:var(--hrmc-s4,16px)}
.rd-toolbar h2,.rd-toolbar h3{margin:0}
.rd-toolbar>div:not([class]),.rd-actions,.rd-document-buttons,.rd-approval-actions{display:flex;align-items:center;gap:var(--hrmc-s2,8px);flex-wrap:wrap}
/* A heading with a subtitle line (the order status panels: number, then the partner) stacks the
   subtitle under the title; laid out as a row it sat beside the title on a different baseline. */
.rd-toolbar>div:not([class]):has(>h1+p,>h2+p){flex-direction:column;align-items:flex-start;gap:2px}
.rd-toolbar>div:not([class])>h1+p,.rd-toolbar>div:not([class])>h2+p{margin:0;color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px)}
/* An action row that carries its own reason field (document completion, sales actions): centring
   put the button beside the middle of the label-and-input stack, visibly above the input. The
   buttons belong on the input's line, and a reason field needs room to be typed into. */
.rd-content .rd-actions:has(>label:not(.rd-check)){align-items:flex-end}
.rd-content .rd-actions>label:not(.rd-check){flex:1 1 260px;max-width:480px}
/* A page header is a toolbar holding the page title, directly or in a title block (title plus
   document number and status chip); both get the divider. */
.rd-toolbar:has(>h1,>div>h1),.rd-document-header,[data-inventory-editor]>.rd-toolbar:has(h1){align-items:center;min-height:44px;margin:0 0 var(--hrmc-s5,24px);padding-bottom:var(--hrmc-s4,16px);border-bottom:1px solid var(--hrmc-border)}
.rd-toolbar:has(>h1) h1,.rd-document-heading h1{margin:0;font-size:var(--hrmc-fs-title,20px)}
.rd-toolbar:has(>h1)+.rd-toolbar:has(>h1){margin-top:calc(-1*var(--hrmc-s3,12px))}
.rd-content>h1:first-child{padding-bottom:var(--hrmc-s4,16px);margin-bottom:var(--hrmc-s5,24px);border-bottom:1px solid var(--hrmc-border)}
.rd-document-heading{display:flex;align-items:baseline;gap:var(--hrmc-s3,12px);flex-wrap:wrap;min-width:0}
.rd-document-heading h2{margin:0;font-size:var(--hrmc-fs-body,14px);font-weight:var(--hrmc-fw-medium,500);color:var(--hrmc-text-muted);display:inline-flex;align-items:center;gap:var(--hrmc-s2,8px)}
.rd-document-heading h2 small{margin:0}
.rd-document-buttons{justify-content:flex-end}
.rd-toolbar>strong:only-child,.rd-toolbar>span:first-child{color:var(--hrmc-text-muted)}

/* -------------------------------------------------------------- surfaces -- */
.rd-card,
.rd-editor,
.rd-document-filters,
.rd-document-region,
.rd-user-section,
.rd-approval-panel,
.rd-tax-summary,
.rd-purchase-actions,
.rd-quote-comparison,
.rd-split>section,
.rd-content>form.rd-fields,
.rd-content>.rd-fields:not(.rd-card *),
.rd-content>form:not([class]):has(>.rd-fields),
.rd-content>form[data-stock-setup],
.rd-content>form[data-inv-period],
.rd-content>details:not([class]),
[data-purchase-editor]>fieldset>.rd-fields,
[data-purchase-editor] [data-header-dimensions]:has(h3),
[data-inventory-editor]>fieldset>.rd-fields,
[data-inventory-editor]>fieldset>details,
.rd-company-profile,
.rd-association-tree,
.rd-comparison-item{background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1);padding:var(--rd-card-pad);margin:0 0 var(--hrmc-s4,16px)}
.rd-card>h2,.rd-editor>h2,.rd-user-section>h2,.rd-tax-summary>h2,.rd-quote-comparison>h2,.rd-split>section>h2{margin:0 0 var(--hrmc-s4,16px);padding-bottom:var(--hrmc-s3,12px);border-bottom:1px solid var(--hrmc-border);font-size:var(--hrmc-fs-lead,16px)}
.rd-editor{max-width:none}
.rd-editor[data-purchase-editor],.rd-editor.rd-commercial-editor{background:transparent;border:0;box-shadow:none;padding:0}
.rd-editor.rd-commercial-editor{background:var(--hrmc-surface);border:1px solid var(--hrmc-border);box-shadow:var(--hrmc-e1);padding:var(--rd-card-pad)}
.rd-content:has(.rd-editor:not([data-purchase-editor]):not(.rd-workflow-editor):not(.rd-commercial-editor)) .rd-editor{max-width:880px}
.rd-content>.rd-toolbar:has(+.rd-editor:not([data-purchase-editor]):not(.rd-workflow-editor):not(.rd-commercial-editor)){max-width:880px}
.rd-split{display:grid;grid-template-columns:minmax(260px,1fr) minmax(320px,1.6fr);gap:var(--hrmc-s5,24px);align-items:start}
.rd-split>section+section{border-inline-start:0;padding-inline-start:var(--rd-card-pad)}
.rd-split>section table{margin:0}
.rd-split>section .rd-toolbar{margin-bottom:var(--hrmc-s3,12px)}

/* Collapsible regions: a card whose header is the <summary>. */
.rd-document-region{padding:0;overflow:hidden}
.rd-document-region>details>summary,.rd-document-region>h2{display:flex;align-items:center;gap:var(--hrmc-s2,8px);margin:0;padding:var(--hrmc-s3,12px) var(--rd-card-pad);cursor:pointer;list-style:none;font-size:var(--hrmc-fs-lead,16px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text);background:var(--hrmc-surface);user-select:none}
.rd-document-region>h2{cursor:default;border-bottom:1px solid var(--hrmc-border)}
.rd-document-region>details>summary::-webkit-details-marker{display:none}
.rd-document-region>details>summary::before{content:"chevron_right";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;font-size:22px;color:var(--hrmc-text-muted);transition:transform .2s ease;flex:none}
.rd-document-region>details[open]>summary::before{transform:rotate(90deg)}
.rd-document-region>details>summary:hover{background:var(--hrmc-surface-muted)}
.rd-document-region>details>summary h2{display:inline;margin:0;font-size:inherit;font-weight:inherit}
.rd-document-region>details[open]>summary{border-bottom:1px solid var(--hrmc-border)}
.rd-document-region>details>:not(summary){margin:var(--hrmc-s4,16px) var(--rd-card-pad)}
.rd-document-region>details>.rd-table,.rd-document-region>details>.rd-fields+.rd-table{margin:0;border:0;border-radius:0;box-shadow:none}
.rd-document-region>details>label{display:flex;max-width:480px}
.rd-document-region>details>textarea{width:calc(100% - 2*var(--rd-card-pad))}
.rd-document-region>details>.rd-icon{margin:var(--hrmc-s3,12px) var(--rd-card-pad) var(--hrmc-s4,16px)}
.rd-document-region>details[open]>.rd-table{margin:0}
.rd-document-region>*:not(details):not(h2){margin:var(--hrmc-s4,16px) var(--rd-card-pad)}
.rd-document-region>dl{margin-top:var(--hrmc-s4,16px)}
/* Plain <details> used as sections elsewhere */
.rd-content>details:not([class])>summary,[data-inventory-editor]>fieldset>details>summary{cursor:pointer;font-weight:var(--hrmc-fw-semi,600);font-size:var(--hrmc-fs-lead,16px);margin:calc(-1*var(--rd-card-pad));padding:var(--hrmc-s3,12px) var(--rd-card-pad);list-style:none;display:flex;align-items:center;gap:var(--hrmc-s2,8px)}
.rd-content>details:not([class])>summary::-webkit-details-marker,[data-inventory-editor]>fieldset>details>summary::-webkit-details-marker{display:none}
.rd-content>details:not([class])>summary::before,[data-inventory-editor]>fieldset>details>summary::before{content:"chevron_right";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;font-size:22px;color:var(--hrmc-text-muted);transition:transform .2s ease}
.rd-content>details:not([class])[open]>summary::before,[data-inventory-editor]>fieldset>details[open]>summary::before{transform:rotate(90deg)}
.rd-content>details:not([class])[open]>summary,[data-inventory-editor]>fieldset>details[open]>summary{margin-bottom:var(--hrmc-s4,16px);border-bottom:1px solid var(--hrmc-border)}
.rd-content>details:not([class])>.rd-table{margin:0}
.rd-content>details:not([class])>form>.rd-primary{margin-top:var(--hrmc-s2,8px)}
.rd-content>details:not([class]):not([open]),[data-inventory-editor]>fieldset>details:not([open]){padding-bottom:var(--rd-card-pad)}

/* ----------------------------------------------------------------- forms -- */
.rd-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:var(--hrmc-s4,16px) var(--hrmc-s5,24px);align-items:start}
.rd-fields>div:not([class]){display:flex;gap:var(--hrmc-s2,8px);align-items:center;flex-wrap:wrap;align-self:end;min-height:var(--rd-control-h)}
.rd-full{grid-column:1/-1}
/* Row and tile state classes used by the module pages: colour plus text (the pages add a chip), never colour alone. */
.rd-content td.is-bad{color:var(--hrmc-status-danger-text);font-weight:var(--hrmc-fw-semi,600)}
.rd-content td.is-bad .rd-chip{margin-inline-start:var(--hrmc-s1,4px);vertical-align:middle}
.fin-op-metrics strong.is-warn{color:var(--hrmc-status-warning-text)}
.fin-op-metrics strong.is-ok{color:var(--hrmc-status-success-text)}
.rd-content tr.is-selected>td{background:color-mix(in srgb,var(--hrmc-brand) 8%,var(--hrmc-surface));box-shadow:inset 3px 0 0 var(--hrmc-brand)}
html[dir="rtl"] .rd-content tr.is-selected>td{box-shadow:inset -3px 0 0 var(--hrmc-brand)}
.rd-content td form.rd-inline,.rd-content .rd-inline{display:inline-flex;flex-wrap:wrap;gap:var(--hrmc-s2,8px);align-items:center;margin:0;vertical-align:middle}
.rd-content td form.rd-inline input,.rd-content td form.rd-inline select{min-width:0;width:auto}
/* A field group whose every child is hidden must not leave an empty card behind. */
.rd-fields:not(:has(>:not([hidden]))){display:none}
.rd-editor .rd-fields,.rd-master-editor .rd-fields{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))}
.rd-editor[data-purchase-editor] .rd-fields,[data-inventory-editor] .rd-fields,.rd-stock-fields .rd-fields,.rd-commercial-editor .rd-fields,.rd-profile-fields{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
.rd-editor>label,.rd-content>form.rd-editor>label{max-width:480px}
.hrmc-body .rd-content label,.rd-auth label,.rd-settings form>label{display:flex;flex-direction:column;gap:6px;margin:0;font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text-muted);letter-spacing:.01em;min-width:0}
.hrmc-body .rd-content label:has(>input[required]:not([readonly]))::after{content:none}
/* An icon button stacked under a value and its note in a grid cell (the sales discount "adjust"
   control) needs a hair of space, or it reads as part of the percentage above it. */
.rd-content td>small+.rd-icon,.rd-content td>span+small+.rd-icon{margin-top:var(--hrmc-s1,4px)}
/* A form's closing save row (production processes and routes) followed the last "Add" button
   with no space at all; like the editor footers elsewhere it gets room and a divider. */
.rd-content form[method="post"] fieldset>.rd-actions:last-child{margin-top:var(--hrmc-s5,24px);padding-top:var(--hrmc-s4,16px);border-top:1px solid var(--hrmc-border)}
.rd-content .rd-table+button.rd-button{margin-top:var(--hrmc-s2,8px)}
/* A submit button placed straight after a field grid (period and fiscal-year forms) sat flush
   against the last row of inputs; it gets the same breathing room an actions row has. */
.rd-content .rd-fields+.rd-primary,.rd-content .rd-fields+.rd-button,.rd-content .rd-fields+button[type=submit]{margin-top:var(--hrmc-s4,16px)}
/* A form's action row or single save button sits one step below the fields, table or check it follows, also when an
   empty error slot or row template sits between them. A lone button becomes block-level so its margin collapses into a
   card's own bottom margin instead of doubling it (sales policy, BOM lines). */
.rd-content form :is(.rd-fields,.rd-table,label,template,:is(.rd-fields,.rd-table)+.rd-alert[hidden])+.rd-actions:not(td *){margin-top:var(--hrmc-s4,16px)}
.rd-content :is(.rd-fields,.rd-table,template,:is(.rd-fields,.rd-table)+.rd-alert[hidden])+:is(.rd-primary,.rd-button,button[type=submit],button.rd-icon):not(td *):not(:has(+:is(button,a))){display:flex;width:fit-content;margin-top:var(--hrmc-s4,16px)}
.rd-content form>button.rd-icon~button[type=submit]{margin-top:var(--hrmc-s4,16px)}
.rd-content [data-plan-results]:not(:empty){margin-top:var(--hrmc-s3,12px)}
/* A field whose control is not a native input (a directory picker, a chip list) still needs the
   caption every labelled field has; the group names itself with aria-labelledby. */
.hrmc-body .rd-content .rd-field-group{display:flex;flex-direction:column;gap:6px;min-width:0;margin:0}
.hrmc-body .rd-content .rd-field-caption{font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text-muted);letter-spacing:.01em}
.hrmc-body .rd-content .rd-field-group [data-member-picker]>.rd-actions{margin:0}
.hrmc-body .rd-content .rd-check,.rd-auth .rd-check,.rd-settings .rd-check{flex-direction:row;align-items:center;gap:var(--hrmc-s2,8px);font-weight:var(--hrmc-fw-normal,400);font-size:var(--hrmc-fs-body,14px);color:var(--hrmc-text);cursor:pointer;min-height:var(--rd-control-h);padding-top:2px}
.rd-fields>.rd-check{align-self:end}
.rd-check input{width:18px;height:18px;flex-shrink:0;accent-color:var(--hrmc-brand-strong);margin:0;cursor:pointer}
.rd-check input:disabled{cursor:not-allowed}
.rd-content input:not([type=checkbox]):not([type=radio]):not([type=file]),.rd-content textarea,.rd-content select,.rd-auth input:not([type=checkbox]),.rd-settings select,.rd-select-search{width:100%;min-width:0;min-height:var(--rd-control-h);padding:0 var(--hrmc-s3,12px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);background:var(--hrmc-surface);color:var(--hrmc-text);font:inherit;font-size:var(--hrmc-fs-body,14px);line-height:1.4;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease}
.rd-content textarea{padding:var(--hrmc-s2,8px) var(--hrmc-s3,12px);min-height:calc(var(--rd-control-h) + 8px);resize:vertical;line-height:1.45}
.rd-content textarea[rows="1"]{min-height:var(--rd-control-h);height:var(--rd-control-h)}
.rd-content input:not([type=checkbox]):not([type=radio]):hover,.rd-content select:hover,.rd-content textarea:hover{border-color:color-mix(in srgb,var(--hrmc-text-muted) 55%,var(--hrmc-border))}
.rd-content input:focus-visible,.rd-content select:focus-visible,.rd-content textarea:focus-visible,.rd-auth input:focus-visible,.rd-auth select:focus-visible,.rd-settings select:focus-visible{outline:2px solid var(--rd-focus,var(--hrmc-brand));outline-offset:1px;border-color:var(--hrmc-brand);box-shadow:var(--rd-ring)}
.rd-content input::placeholder,.rd-content textarea::placeholder,.rd-auth input::placeholder{color:color-mix(in srgb,var(--hrmc-text-muted) 70%,transparent)}
.rd-content input[readonly]:not([type=checkbox]):not([type=radio]):not([type=file]),.rd-content textarea[readonly],.rd-profile-fields input[readonly]{background:var(--hrmc-surface-muted);color:var(--hrmc-text-muted);border-style:dashed;cursor:default}
.rd-content input[readonly]:not([type=checkbox]):not([type=radio]):not([type=file]):focus-visible{box-shadow:none;border-color:var(--hrmc-border)}
.rd-content select,.rd-settings select{appearance:none;-webkit-appearance:none;padding-inline-end:2.25rem;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 17px) 50%,calc(100% - 12px) 50%;background-size:5px 5px,5px 5px;background-repeat:no-repeat;cursor:pointer}
.rd-content select[multiple]{background-image:none;padding:var(--hrmc-s2,8px);min-height:120px}
.rd-content select[multiple] option{padding:6px 8px;border-radius:4px}
.rd-content select:disabled,.rd-content input:disabled,.rd-content textarea:disabled{background:var(--hrmc-surface-muted);color:var(--hrmc-text-muted);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--hrmc-text-muted)}
.rd-content input[type=date],.rd-content input[type=number]{font-variant-numeric:tabular-nums}
.rd-content input[type=number]{text-align:right}
.rd-content input[type=file]{font-size:var(--hrmc-fs-small,12.5px);padding:var(--hrmc-s2,8px);border:1px dashed var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);background:var(--hrmc-surface-muted);max-width:100%;box-sizing:border-box;width:100%}
.rd-content input[type=file]::file-selector-button{font:inherit;font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);padding:6px 12px;margin-inline-end:var(--hrmc-s2,8px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);background:var(--hrmc-surface);color:var(--hrmc-text);cursor:pointer}
.rd-content input[type=search]{padding-inline-start:2.25rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2358655f'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:10px 50%;background-size:18px}
.rd-content input[type=search]::-webkit-search-cancel-button{cursor:pointer}
.rd-content input:user-invalid,.rd-content select:user-invalid,.rd-content textarea:user-invalid{border-color:var(--hrmc-status-danger-text)}
.rd-content fieldset,.rd-editor fieldset,.rd-code-settings fieldset,fieldset{border:0;padding:0;margin:0;min-width:0}
fieldset:disabled{opacity:1}
fieldset:disabled .rd-check{cursor:default}
fieldset:disabled .rd-primary,fieldset:disabled .rd-button,fieldset:disabled .rd-icon{opacity:.5;pointer-events:none}
fieldset:disabled a[data-inv-lots]{opacity:1;pointer-events:auto}
.rd-content legend{font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text-muted);padding:0;margin-bottom:6px}
.rd-select-search{margin:0 0 var(--hrmc-s1,4px)!important;padding:0 var(--hrmc-s3,12px)!important;min-height:36px}
.rd-content input[type=radio]{width:18px;height:18px;accent-color:var(--hrmc-brand-strong);margin:0}
.rd-user-section label:has(input:disabled){opacity:.55}
.rd-content label>small,.rd-auth label>small{font-weight:var(--hrmc-fw-normal,400);margin-top:-2px}

/* Radzen lookups rendered inside our label stack */
.rd-lookup-host{display:block;min-width:0;width:100%}
.rd-lookup-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none;margin:0!important;padding:0!important}
.rd-lookup-host .rz-dropdown{min-height:var(--rd-control-h);border-radius:var(--hrmc-r-control,6px);max-width:100%;font-family:inherit;border-color:var(--hrmc-border);background:var(--hrmc-surface);box-shadow:none;transition:border-color .15s ease,box-shadow .15s ease}
.rd-lookup-host .rz-dropdown:hover{border-color:color-mix(in srgb,var(--hrmc-text-muted) 55%,var(--hrmc-border))}
.rd-lookup-host .rz-dropdown:focus-within{border-color:var(--hrmc-brand);box-shadow:var(--rd-ring)}
.rd-lookup-host .rz-dropdown-label{font-family:inherit;letter-spacing:0;text-transform:none;font-weight:var(--hrmc-fw-regular,400);font-size:var(--hrmc-fs-body,14px);color:var(--hrmc-text)}
.rd-lookup-host .rz-placeholder{color:color-mix(in srgb,var(--hrmc-text-muted) 70%,transparent)}
.rd-lookup-host .rz-dropdown-trigger{color:var(--hrmc-text-muted)}
.rd-lookup-host .rz-state-disabled{background:var(--hrmc-surface-muted);opacity:1}
/* Radzen's own disabled colour (#bdbdbd) measures 1.88:1 and its selector outranks a plain
   class pair, so the disabled value - which still carries meaning - needs the extra weight. */
.rd-lookup-host .rz-dropdown.rz-state-disabled .rz-dropdown-label.rz-inputtext,.rd-lookup-host .rz-state-disabled .rz-dropdown-label{color:var(--hrmc-text-muted)}
body.theme-cosmosoft{--rz-primary:var(--hrmc-brand);--rz-primary-light:var(--hrmc-brand-soft);--rz-primary-lighter:var(--hrmc-brand-soft)}
.rz-dropdown-panel{min-width:min(320px,calc(100vw - 24px));max-width:calc(100vw - 24px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);box-shadow:var(--hrmc-e3);background:var(--hrmc-surface);color:var(--hrmc-text)}
/* Radzen paints the selected row with its indigo accent as the *text* colour (2.19:1 on the
   dark panel); the compound selector below outranks it. */
.rz-dropdown-panel .rz-dropdown-item.rz-state-highlight,.rz-dropdown-panel li.rz-state-highlight,.rz-multiselect-panel .rz-multiselect-item.rz-state-highlight{background:var(--hrmc-brand-soft);color:var(--hrmc-text)}
.rz-dropdown-panel .rz-state-highlight{background:var(--hrmc-brand-soft);color:var(--hrmc-text)}
.rz-dropdown-panel .rz-dropdown-item{white-space:normal;overflow-wrap:anywhere;font-family:inherit;font-size:var(--hrmc-fs-body,14px)}
/* The panel is portalled outside the shell and keeps Radzen's light item colour, which on the
   dark panel measured 2.19:1. Every list surface follows the panel's own text token. */
.rz-dropdown-panel,.rz-multiselect-panel,.rz-autocomplete-panel,.rz-datepicker-popup{color:var(--hrmc-text)}
.rz-dropdown-panel .rz-dropdown-item,.rz-dropdown-panel li,.rz-multiselect-panel .rz-multiselect-item,.rz-multiselect-panel li,.rz-autocomplete-panel .rz-autocomplete-list-item,.rz-datepicker-popup td,.rz-datepicker-popup th{color:var(--hrmc-text)}
.rz-dropdown-panel .rz-dropdown-item.rz-state-disabled,.rz-multiselect-panel .rz-state-disabled{color:var(--hrmc-text-muted)}
.rz-dropdown-panel .rz-dropdown-item:hover{background:var(--hrmc-surface-muted)}
.rz-dropdown-panel .rz-dropdown-filter{font-family:inherit;border-radius:var(--hrmc-r-control,6px);border-color:var(--hrmc-border);background:var(--hrmc-surface);color:var(--hrmc-text)}

/* Filter panel (list pages) */
.rd-document-filters{padding:var(--hrmc-s4,16px) var(--rd-card-pad) var(--hrmc-s4,16px);margin-bottom:var(--hrmc-s4,16px);background:color-mix(in srgb,var(--hrmc-surface) 60%,var(--hrmc-surface-muted))}
.rd-document-filters .rd-fields{grid-template-columns:repeat(auto-fill,minmax(min(100%,200px),1fr));gap:var(--hrmc-s3,12px) var(--hrmc-s4,16px)}
.rd-document-filters .rd-approval-actions{margin:var(--hrmc-s4,16px) 0 0}
.rd-document-filters>summary{display:flex;align-items:center;gap:var(--hrmc-s2,8px);cursor:pointer;list-style:none;font-weight:var(--hrmc-fw-semi,600);font-size:var(--hrmc-fs-small,12.5px);letter-spacing:.06em;text-transform:uppercase;color:var(--hrmc-text-muted);margin:calc(-1*var(--hrmc-s4,16px)) calc(-1*var(--rd-card-pad));padding:var(--hrmc-s3,12px) var(--rd-card-pad);user-select:none}
.rd-document-filters>summary::-webkit-details-marker{display:none}
.rd-document-filters>summary::before{content:"filter_list";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;font-size:20px;text-transform:none;letter-spacing:0}
.rd-document-filters>summary::after{content:"expand_more";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;font-size:20px;margin-inline-start:auto;text-transform:none;letter-spacing:0;transition:transform .2s ease}
.rd-document-filters[open]>summary::after{transform:rotate(180deg)}
.rd-document-filters[open]>summary{margin-bottom:var(--hrmc-s3,12px)}
.rd-document-filters:not([open]){padding-bottom:var(--hrmc-s4,16px)}
.rd-content>form.rd-fields,.rd-content>section>form.rd-fields[method="get"]{grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr));background:color-mix(in srgb,var(--hrmc-surface) 60%,var(--hrmc-surface-muted));padding:var(--hrmc-s4,16px) var(--rd-card-pad)}
.rd-content>form.rd-fields>div,.rd-content>form.rd-fields>.rd-check,.rd-content>section>form.rd-fields[method="get"]>div{align-self:end}
/* A bare live-region paragraph is a status note, not body copy. */
.rd-content>section>p[role=status]:not([class]),.rd-content>p[role=status]:not([class]){display:flex;gap:var(--hrmc-s2,8px);align-items:center;margin:0 0 var(--hrmc-s4,16px);color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px)}
.rd-content>section>p[role=status]:not([class])::before,.rd-content>p[role=status]:not([class])::before{content:"info";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;line-height:1;font-size:18px;flex:none}
.rd-master-filters{display:flex;gap:var(--hrmc-s2,8px);margin:0 0 var(--hrmc-s4,16px);align-items:center;flex-wrap:wrap}
.rd-master-filters>input{max-width:380px;flex:1 1 240px}
.rd-master-filters>select,.rd-master-filters>.rd-lookup-host{flex:0 1 220px;width:auto}
.rd-search{display:flex;gap:var(--hrmc-s2,8px);max-width:460px}
.rd-comparison-filter{justify-content:flex-start;align-items:end;gap:var(--hrmc-s3,12px)}
.rd-comparison-filter label{flex:1;max-width:640px;min-width:0}

/* --------------------------------------------------------------- buttons -- */
.rd-primary,.rd-button,.rd-icon,.rd-danger{display:inline-flex;align-items:center;justify-content:center;gap:var(--hrmc-s2,8px);min-height:var(--rd-control-h);padding:0 var(--hrmc-s4,16px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);font:inherit;font-size:var(--hrmc-fs-body,14px);font-weight:var(--hrmc-fw-semi,600);line-height:1.2;cursor:pointer;text-decoration:none;background:var(--hrmc-surface);color:var(--hrmc-text);white-space:nowrap;box-sizing:border-box;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease,transform .05s ease;-webkit-tap-highlight-color:transparent}
.rd-primary .material-symbols-outlined,.rd-button .material-symbols-outlined,.rd-icon .material-symbols-outlined,.rd-danger .material-symbols-outlined{font-size:20px;margin-inline-start:-2px}
.rd-button:hover,.rd-icon:hover{background:var(--hrmc-surface-muted);border-color:color-mix(in srgb,var(--hrmc-text-muted) 45%,var(--hrmc-border))}
.rd-primary{background:var(--hrmc-action-primary,var(--hrmc-brand-strong));color:var(--hrmc-on-action,#fff);border-color:transparent;box-shadow:var(--hrmc-e1)}
.rd-primary:hover{background:var(--hrmc-action-primary-hover,var(--hrmc-brand-hover));color:var(--hrmc-on-action,#fff)}
.rd-primary:active,.rd-button:active,.rd-icon:active,.rd-danger:active{transform:translateY(1px)}
.rd-primary:focus-visible,.rd-button:focus-visible,.rd-icon:focus-visible,.rd-danger:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:2px}
.rd-icon{width:var(--rd-control-h);padding:0;flex:none}
.rd-icon .material-symbols-outlined{margin:0}
.rd-primary:disabled,.rd-button:disabled,.rd-icon:disabled,.rd-danger:disabled,.rd-primary[aria-disabled=true]{opacity:.5;cursor:not-allowed;transform:none}
/* A document save can take a moment. erp.js already disables the button and sets
   data-saving on the form, but a greyed-out button alone reads as "broken" rather than
   "working": the button's own icon becomes a spinner while the save is in flight. */
.rd-content form[data-saving="true"]{cursor:progress}
.hrmc-body button[data-busy="true"]{opacity:.85;cursor:progress}
.hrmc-body button[data-busy="true"] .material-symbols-outlined{display:none}
.hrmc-body button[data-busy="true"]::before{
    content:"";inline-size:15px;block-size:15px;flex:none;border-radius:50%;
    border:2px solid color-mix(in srgb,currentColor 30%,transparent);border-top-color:currentColor;
    animation:rd-spin .7s linear infinite}
@keyframes rd-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){
    .hrmc-body button[data-busy="true"]::before{animation:none;border-top-color:transparent;border-right-color:currentColor}
}
/* Destructive verbs carry their own colour without new markup. */
.rd-danger,.rd-button[formaction$="/delete"],.rd-button[formaction$="/reject"],.rd-button[formaction$="/cancel"],.rd-button[data-inv-remove],.rd-icon[data-line-remove],.rd-button[formaction$="/delete"]:hover,.rd-button[formaction$="/reject"]:hover,.rd-button[formaction$="/cancel"]:hover{color:var(--hrmc-status-danger-text)}
.rd-button[formaction$="/delete"]:hover,.rd-button[formaction$="/reject"]:hover,.rd-button[formaction$="/cancel"]:hover,.rd-danger:hover,.rd-icon[data-line-remove]:hover,.rd-icon[data-inv-remove]:hover{background:var(--hrmc-status-danger-bg);border-color:color-mix(in srgb,var(--hrmc-status-danger-text) 35%,var(--hrmc-border))}
.rd-button[formaction$="/return"]{color:var(--hrmc-status-warning-text)}
.rd-button[formaction$="/return"]:hover{background:var(--hrmc-status-warning-bg)}
.rd-row-actions{white-space:nowrap}
.rd-row-actions a,.rd-content td>a.rd-icon{display:inline-flex;width:34px;min-height:34px;padding:0;color:var(--hrmc-text-muted);border-color:transparent;background:transparent}
.rd-row-actions a:hover,.rd-content td>a.rd-icon:hover{background:var(--hrmc-brand-soft);color:var(--hrmc-brand-hover);border-color:transparent}

/* ---------------------------------------------------------------- tables -- */
.rd-table{overflow:auto;padding:0;-webkit-overflow-scrolling:touch}
.rd-content table{width:100%;border-collapse:separate;border-spacing:0;text-align:start;font-size:var(--hrmc-fs-body,14px);background:var(--hrmc-surface)}
.rd-content th,.rd-content td{padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);border-bottom:1px solid var(--hrmc-border);vertical-align:middle;line-height:1.4}
/* A column whose heading is only a select-all checkbox is a control column, not data: without a
   width it takes an equal share of an auto table (a quarter of the directory search dialog). */
.rd-content th:has(>input[type=checkbox]:only-child){width:1%;white-space:nowrap}
.rd-content thead th{font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);letter-spacing:.02em;white-space:nowrap;position:sticky;top:0;z-index:1;padding-top:10px;padding-bottom:10px}
.rd-content tbody tr:last-child td{border-bottom:0}
.rd-content tbody tr:hover>td{background:color-mix(in srgb,var(--hrmc-surface-muted) 55%,var(--hrmc-surface))}
.rd-content tbody tr:hover>td.rd-line-actions{background:var(--hrmc-surface)}
.rd-content td>a:not([class]):first-child{font-weight:var(--hrmc-fw-semi,600)}
.rd-content td small{display:block;margin-top:2px}
/* Cells wrap between words; a word never breaks in the middle (the shared sheet allows breaks anywhere for prose). The wrapper scrolls instead. */
.hrmc-shell .hrmc-body .rd-content td,.hrmc-shell .hrmc-body .rd-content th{overflow-wrap:normal;word-break:normal;hyphens:manual}
.rd-content td>small{display:block}
.rd-content th.rd-num,.rd-content td.rd-num{text-align:right;font-variant-numeric:tabular-nums}
.rd-content td.rd-num{white-space:nowrap}
.rd-content table.rd-master-table{min-width:720px}
.rd-master-table th,.rd-master-table td{overflow-wrap:normal;word-break:normal}
.rd-master-table td:first-child{white-space:nowrap}
/* Empty states */
.rd-content tbody td[colspan]{text-align:center;padding:var(--hrmc-s6,40px) var(--hrmc-s4,16px);color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-body,14px)}
.rd-content tbody td[colspan]::before{content:"inbox";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;display:block;font-size:36px;margin:0 auto var(--hrmc-s2,8px);color:color-mix(in srgb,var(--hrmc-text-muted) 45%,transparent)}
.rd-content tbody tr:hover>td[colspan]{background:transparent}
.rd-content tbody td[colspan]:has(a),.rd-content tbody td[colspan]:has(button){text-align:start;padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px)}
.rd-content tbody td[colspan]:has(a)::before,.rd-content tbody td[colspan]:has(button)::before{content:none}
/* A headed table with no rows renders as a title strip over nothing - 35 of the 85 routes
   showed one. Pages that render their own `td[colspan]` row keep it (they have a tbody row);
   this only speaks for the tables that say nothing at all. Tables whose rows live in <tfoot>
   (totals strips) and tables with no header are left alone, and any page can word it itself
   with data-empty. */
.rd-content table:has(thead th):not(:has(tbody tr)):not(:has(tfoot tr))::after{
    content:"No records yet.";display:table-caption;caption-side:bottom;
    padding:var(--hrmc-s5,24px) var(--hrmc-s4,16px);text-align:center;
    color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px);
    border-top:1px solid var(--hrmc-border);background:var(--hrmc-surface)}
.rd-content form[data-fin-form] table:has(thead th):not(:has(tbody tr)):not(:has(tfoot tr))::after,
.rd-content form[data-sales-editor] table:has(thead th):not(:has(tbody tr)):not(:has(tfoot tr))::after,
.rd-content .rd-document-region table:has(thead th):not(:has(tbody tr)):not(:has(tfoot tr))::after{content:"No lines yet."}
.rd-content table[data-empty]:has(thead th):not(:has(tbody tr)):not(:has(tfoot tr))::after{content:attr(data-empty)}
/* Editable line tables keep inputs compact */
.rd-content td>input:not([type=checkbox]),.rd-content td>select,.rd-content td>textarea,.rd-content td .rd-lookup-host .rz-dropdown{min-height:36px}
.rd-content td>input[type=checkbox]{width:18px;height:18px;accent-color:var(--hrmc-brand-strong)}
.rd-content td label{margin-top:var(--hrmc-s2,8px)}
/* Pagination */
.rd-pagination,.rd-list-pagination{margin:var(--hrmc-s3,12px) 0 0;color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px)}
.rd-pagination>div,.rd-list-pagination>div{display:flex;align-items:center;gap:var(--hrmc-s2,8px)}
.rd-list-pagination .rd-button{width:36px;min-height:36px;padding:0}
.rd-import-table table{min-width:760px}
.rd-import-table th,.rd-import-table td:not(:nth-child(4)){white-space:nowrap}

/* --------------------------------------------------------- chips & alerts -- */
.rd-chip{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border-radius:var(--hrmc-r-pill,999px);font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);line-height:1.5;white-space:nowrap;background:var(--hrmc-surface-muted);color:var(--hrmc-text-muted);vertical-align:middle;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.rd-chip::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none;opacity:.85}
.rd-chip.is-ok{background:var(--hrmc-status-success-bg);color:var(--hrmc-status-success-text)}
.rd-chip.is-warn{background:var(--hrmc-status-warning-bg);color:var(--hrmc-status-warning-text)}
.rd-chip.is-bad{background:var(--hrmc-status-danger-bg);color:var(--hrmc-status-danger-text)}
.rd-chip.is-info{background:var(--hrmc-status-info-bg);color:var(--hrmc-status-info-text)}
.rd-chip.is-brand{background:var(--hrmc-brand-soft);color:var(--hrmc-brand-hover)}
.rd-badge{display:inline-flex;align-items:center;padding:2px 10px;border-radius:var(--hrmc-r-pill,999px);font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);background:var(--hrmc-brand-soft);color:var(--hrmc-brand-hover)}
.rd-lowest{display:inline-flex;align-items:center;gap:4px;font-size:var(--hrmc-fs-caption,11px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-status-success-text);background:var(--hrmc-status-success-bg);padding:2px 8px;margin-top:6px;border-radius:var(--hrmc-r-pill,999px)}
.rd-overdue{display:block;color:var(--hrmc-status-danger-text);font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600)}
.rd-alert{display:flex;align-items:flex-start;gap:var(--hrmc-s3,12px);padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);margin:0 0 var(--hrmc-s4,16px);border:1px solid color-mix(in srgb,var(--hrmc-status-success-text) 25%,transparent);border-inline-start:4px solid var(--hrmc-status-success-text);background:var(--hrmc-status-success-bg);color:var(--hrmc-status-success-text);border-radius:var(--hrmc-r-control,6px);font-size:var(--hrmc-fs-body,14px);line-height:1.45;overflow-wrap:anywhere}
.rd-alert::before{content:"check_circle";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;font-size:20px;flex:none;line-height:1.1}
.rd-alert.error{border-color:color-mix(in srgb,var(--hrmc-status-danger-text) 25%,transparent);border-inline-start-color:var(--hrmc-status-danger-text);background:var(--hrmc-status-danger-bg);color:var(--hrmc-status-danger-text)}
.rd-alert.error::before{content:"error"}
.rd-alert[role=status]:not(.error){border-color:color-mix(in srgb,var(--hrmc-status-info-text) 25%,transparent);border-inline-start-color:var(--hrmc-status-info-text);background:var(--hrmc-status-info-bg);color:var(--hrmc-status-info-text)}
.rd-alert[role=status]:not(.error)::before{content:"info"}
.rd-alert.warning,.rd-alert.warning[role=status]:not(.error){border-color:color-mix(in srgb,var(--hrmc-status-warning-text) 25%,transparent);border-inline-start-color:var(--hrmc-status-warning-text);background:var(--hrmc-status-warning-bg);color:var(--hrmc-status-warning-text)}
.rd-alert.warning::before,.rd-alert.warning[role=status]:not(.error)::before{content:"warning"}
p.rd-alert{margin-bottom:var(--hrmc-s4,16px)}
span.rd-alert{display:inline-flex;margin:0}
[data-form-error]:not([hidden]),[data-inventory-error]:not([hidden]),[data-stock-error]:not([hidden]){margin-top:var(--hrmc-s3,12px)}

/* ------------------------------------------------------------------ tabs -- */
.rd-master-tabs{display:flex;flex-wrap:wrap;gap:var(--hrmc-s1,4px);border-bottom:1px solid var(--hrmc-border);margin:0 0 var(--hrmc-s5,24px);overflow-x:auto;scrollbar-width:none}
.rd-master-tabs a,.rd-master-tabs [role=tab]{padding:var(--hrmc-s3,12px) var(--hrmc-s3,12px);color:var(--hrmc-text-muted);text-decoration:none;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;background:transparent;font:inherit;font-weight:var(--hrmc-fw-medium,500);cursor:pointer;white-space:nowrap;border-radius:var(--hrmc-r-control,6px) var(--hrmc-r-control,6px) 0 0;transition:color .15s ease,background .15s ease}
.rd-master-tabs a:hover,.rd-master-tabs [role=tab]:hover{color:var(--hrmc-text);background:var(--hrmc-surface-muted)}
.rd-master-tabs a[aria-current=page],.rd-master-tabs [aria-selected=true]{border-bottom-color:var(--hrmc-brand);color:var(--hrmc-brand-hover);font-weight:var(--hrmc-fw-semi,600)}

/* -------------------------------------------------------- workspace home -- */
.rd-home-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--hrmc-s4,16px);flex-wrap:wrap;margin-bottom:var(--hrmc-s5,24px);padding:var(--hrmc-s5,24px) var(--hrmc-s5,28px);border-radius:var(--hrmc-r-card,12px);background:linear-gradient(135deg,var(--hrmc-hero-start),var(--hrmc-hero-end));color:var(--hrmc-hero-text,#fff);box-shadow:var(--hrmc-e2)}
.rd-home-hero small{display:block;color:var(--hrmc-hero-eyebrow);font-size:var(--hrmc-fs-caption,11px);font-weight:var(--hrmc-fw-bold,700);letter-spacing:.1em;text-transform:uppercase;margin-bottom:var(--hrmc-s2,8px)}
.rd-home-hero h1{margin:0;color:inherit;font-size:var(--hrmc-fs-display,28px);border:0;padding:0}
.rd-home-hero p{margin:var(--hrmc-s2,8px) 0 0;color:color-mix(in srgb,var(--hrmc-hero-text,#fff) 86%,transparent);max-width:60ch}
.rd-home-hero .rd-actions{display:flex;gap:var(--hrmc-s2,8px);flex-wrap:wrap}
.rd-home-hero .rd-button{background:color-mix(in srgb,#fff 14%,transparent);border-color:color-mix(in srgb,#fff 35%,transparent);color:var(--hrmc-hero-text,#fff)}
.rd-home-hero .rd-button:hover{background:color-mix(in srgb,#fff 24%,transparent)}
.rd-home-section{margin-bottom:var(--hrmc-s5,24px)}
.rd-home-section>h2{font-size:var(--hrmc-fs-caption,11px);letter-spacing:.1em;text-transform:uppercase;color:var(--hrmc-text-muted);margin-bottom:var(--hrmc-s3,12px)}
.rd-links{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr));gap:var(--hrmc-s4,16px);max-width:none}
.rd-links a{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--hrmc-s3,12px);padding:var(--hrmc-s4,16px) var(--hrmc-s4,18px);background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1);text-decoration:none;color:var(--hrmc-text);min-height:88px;height:100%;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.rd-links a:hover{border-color:var(--hrmc-brand-edge);box-shadow:var(--hrmc-e2);transform:translateY(-1px)}
.rd-links a>.material-symbols-outlined:first-child{width:44px;height:44px;display:grid;place-items:center;border-radius:10px;background:var(--hrmc-brand-soft);color:var(--hrmc-brand-hover);font-size:24px}
.rd-links a>.material-symbols-outlined:last-child{color:var(--hrmc-text-muted);font-size:20px;transition:transform .15s ease}
.rd-links a:hover>.material-symbols-outlined:last-child{transform:translateX(3px);color:var(--hrmc-brand-hover)}
.rd-links strong{display:block;font-weight:var(--hrmc-fw-semi,600);line-height:1.3}
.rd-links strong small{display:block;margin-top:2px;font-weight:var(--hrmc-fw-normal,400);color:var(--hrmc-text-muted);line-height:1.35}
.rd-links a:focus-visible{outline:2px solid var(--rd-focus,var(--hrmc-brand-strong));outline-offset:2px}
.rd-home-section>h2{padding-bottom:var(--hrmc-s2,8px);border-bottom:1px solid var(--hrmc-border)}

/* ------------------------------------------------------------- documents -- */
.rd-document-header{margin-bottom:var(--hrmc-s4,16px)}
.rd-editor[data-purchase-editor]{margin:0}
.rd-editor[data-purchase-editor] textarea[rows="1"]{min-height:var(--rd-control-h);height:var(--rd-control-h)}
[data-purchase-editor]>fieldset>.rd-fields,[data-inventory-editor]>fieldset>.rd-fields{margin-bottom:var(--hrmc-s4,16px)}
[data-purchase-editor]>fieldset>.rd-fields>.rd-check{align-self:end}
[data-header-dimensions]{margin:0}
[data-header-dimensions] h3{margin:0 0 var(--hrmc-s3,12px);font-size:var(--hrmc-fs-caption,11px);letter-spacing:.1em;text-transform:uppercase;color:var(--hrmc-text-muted)}
[data-inherited-dimensions]{font-size:var(--hrmc-fs-small,12.5px);overflow-wrap:anywhere;color:var(--hrmc-text-muted)}
[data-inherited-dimensions]:not(:empty){margin-top:6px}
.rd-dimension-cell{min-width:200px}
.rd-dimension-readonly{display:inline-block;padding:var(--hrmc-s2,8px) 0;color:var(--hrmc-text-muted)}
#dimension-definitions{margin-top:var(--hrmc-s6,32px)}
/* Line tables */
.rd-purchase-lines{margin:0 0 var(--hrmc-s4,16px);max-width:100%;overflow:auto}
.rd-content .rd-purchase-lines table{min-width:100%;width:max-content;table-layout:auto}
.rd-purchase-lines td{vertical-align:top;min-width:120px}
.rd-purchase-lines th:first-child{width:240px}.rd-purchase-lines th:nth-child(2){width:240px}
.rd-purchase-lines input,.rd-purchase-lines select{width:100%;min-width:0;box-sizing:border-box}
.rd-purchase-lines th:last-child{width:55px}.rd-purchase-lines th:nth-child(3){width:125px}
.rd-purchase-lines:has([data-line="Rate"]) table{min-width:1500px}
.rd-purchase-lines th:nth-last-child(2),.rd-purchase-lines th:nth-last-child(3){width:190px}
.rd-purchase-lines:has([data-line="Rate"]) th:nth-child(4),.rd-purchase-lines:has([data-line="Rate"]) th:nth-child(5),.rd-purchase-lines:has([data-line="Rate"]) th:nth-child(6){width:130px}
.rd-purchase-lines th{white-space:nowrap}
.rd-purchase-lines td:has([data-line="ProjectId"]),.rd-purchase-lines td:has([data-line="DepartmentId"]){min-width:220px}
.rd-purchase-lines td:has([data-line="ItemId"]){min-width:300px}
.rd-purchase-lines td:has([data-line="SourceLineId"]){min-width:240px}
.rd-purchase-lines td:has([data-line="Quantity"]){min-width:120px}
.rd-purchase-lines td:has([data-line="Description"]){min-width:260px}
.rd-purchase-lines td:has([data-item-unit]){min-width:110px;white-space:nowrap}
.rd-purchase-lines td .rd-lookup-host{width:220px}
.rd-purchase-lines td:has([data-line="ItemId"]) .rd-lookup-host{width:280px}
.rd-purchase-lines [data-source-balance]{max-width:240px}
.rd-purchase-lines td.rd-line-actions{position:sticky;inset-inline-end:0;min-width:94px;background:var(--hrmc-surface);z-index:1;box-shadow:-8px 0 12px -10px var(--hrmc-shadow)}
.rd-line-actions>div,.rd-content td>.rd-actions{display:flex;gap:var(--hrmc-s1,4px);align-items:center;flex-wrap:nowrap}
.rd-line-actions .rd-icon,.rd-actions .rd-icon{width:34px;min-height:34px}
.rd-purchase-lines [data-po-line-gross],.rd-purchase-lines [data-po-line-net]{display:block;min-width:110px;text-align:end;font-weight:var(--hrmc-fw-semi,600);font-variant-numeric:tabular-nums;padding:var(--hrmc-s2,8px) 0}
.rd-purchase-lines [data-document-stock]{display:inline-block;padding:var(--hrmc-s2,8px) 0;font-variant-numeric:tabular-nums;color:var(--hrmc-text-muted)}
.rd-source-unit,[data-source-balance]{display:block;margin-top:6px;font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-text-muted)}
.rd-code-settings,.rd-tax-summary,.rd-purchase-actions{margin-top:var(--hrmc-s4,16px)}
.rd-code-settings h2{margin:20px 0}
.rd-purchase-actions label{display:flex;max-width:600px}
.rd-purchase-actions .rd-toolbar{margin:var(--hrmc-s4,16px) 0 0;justify-content:flex-start}
.rd-tax-summary p{margin:var(--hrmc-s4,16px) 0 0;color:var(--hrmc-text-muted)}
.rd-tax-summary p strong{color:var(--hrmc-text);font-size:var(--hrmc-fs-lead,16px)}
.rd-tax-summary .rd-table,.rd-quote-comparison .rd-table,.rd-approval-panel .rd-table{border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);box-shadow:none}
.rd-approval-panel{border-inline-start:4px solid var(--hrmc-brand)}
.rd-approval-panel h3{font-size:var(--hrmc-fs-lead,16px);margin:0}
.rd-approval-panel .rd-toolbar{margin-bottom:var(--hrmc-s3,12px)}
.rd-approval-panel .rd-toolbar>span{color:var(--hrmc-text-muted)}
.rd-approval-panel details{margin-top:var(--hrmc-s4,16px);border-top:1px solid var(--hrmc-border);padding-top:var(--hrmc-s3,12px)}
.rd-approval-panel summary{cursor:pointer;font-weight:var(--hrmc-fw-semi,600);padding:var(--hrmc-s2,8px) 0}
.rd-approval-panel form>label{display:flex;max-width:600px;margin:var(--hrmc-s3,12px) 0}
.rd-approval-actions{margin:var(--hrmc-s3,12px) 0 0}
.rd-approval-panel .rd-fields{margin-bottom:var(--hrmc-s3,12px)}
/* PO totals */
.rd-po-totals dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:var(--hrmc-s3,12px);margin:0 0 var(--hrmc-s3,12px)}
.rd-po-totals dl>div{padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);border-radius:var(--hrmc-r-control,6px);background:var(--hrmc-surface-muted);border:1px solid var(--hrmc-border)}
.rd-po-totals dl>div:has([data-po-total="total"]){background:var(--hrmc-brand-soft);border-color:var(--hrmc-brand-edge)}
.rd-po-totals dd{margin:4px 0 0;font-size:var(--hrmc-fs-title,20px);font-weight:var(--hrmc-fw-bold,700);font-variant-numeric:tabular-nums;overflow-wrap:anywhere;color:var(--hrmc-text)}
.rd-po-totals dt{font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-text-muted);font-weight:var(--hrmc-fw-semi,600)}
.rd-po-totals>.rd-toolbar{margin-bottom:0}
.rd-po-totals [data-po-calc-status]{color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px)}
.rd-po-line-toolbar{display:flex;flex-wrap:wrap;gap:var(--hrmc-s3,12px) var(--hrmc-s4,16px);align-items:end;justify-content:flex-start;padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px) var(--hrmc-r-card,12px) 0 0;border-bottom:0;margin:0}
.rd-po-line-toolbar+.rd-purchase-lines{border-top-left-radius:0;border-top-right-radius:0}
.rd-po-line-toolbar .rd-quantity-mode{display:flex;gap:var(--hrmc-s3,12px);align-items:center;min-height:var(--rd-control-h)}
.rd-po-line-toolbar .rd-quantity-mode legend{float:left;margin:0 var(--hrmc-s2,8px) 0 0}
.rd-po-line-toolbar .rd-check{min-height:0;padding:0}
.rd-po-line-toolbar label:not(.rd-check){flex:0 1 200px}
.rd-po-line-toolbar>.rd-button{margin-inline-start:auto}
[data-purchase-editor]:not(.rd-po-alternate) [data-po-alternate-column]{display:none}
/* Toolbars directly above line tables */
.rd-toolbar:has(+.rd-purchase-lines),.rd-toolbar:has(+.rd-table.rd-inventory-lines),.rd-toolbar:has(>h3):has(+.rd-table){margin-bottom:var(--hrmc-s3,12px)}
.rd-toolbar h3{font-size:var(--hrmc-fs-lead,16px)}
/* Inventory editor */
[data-inventory-editor] .rd-toolbar:has(h1){display:flex}
[data-inventory-editor] .rd-toolbar h1{display:inline;margin-inline-end:var(--hrmc-s3,12px)}
[data-inventory-editor] .rd-toolbar>div:first-child{display:flex;align-items:baseline;gap:var(--hrmc-s3,12px);flex-wrap:wrap}
[data-inventory-editor] .rd-toolbar>div:first-child strong{font-weight:var(--hrmc-fw-medium,500);color:var(--hrmc-text-muted);display:inline-flex;align-items:center;gap:var(--hrmc-s2,8px)}
[data-inventory-editor] fieldset:disabled{opacity:1}
[data-inventory-editor] fieldset:disabled .rz-state-disabled{opacity:1}
.rd-content .rd-table table.rd-inventory-lines{min-width:1600px;width:max-content;table-layout:auto}
.rd-content .rd-inventory-lines th,.rd-content .rd-inventory-lines td{white-space:nowrap;overflow-wrap:normal;word-break:normal;min-width:110px}
.rd-inventory-lines td:nth-child(2){min-width:280px}
.rd-inventory-lines th:first-child,.rd-inventory-lines td:first-child{width:230px;min-width:230px;max-width:230px;white-space:normal;overflow-wrap:anywhere;position:sticky;inset-inline-start:0;z-index:2;background:var(--hrmc-surface)}
.rd-inventory-lines th:nth-child(2),.rd-inventory-lines td:nth-child(2){position:sticky;inset-inline-start:230px;z-index:2;background:var(--hrmc-surface)}
.rd-table:has(>table.rd-inventory-lines){scroll-padding-inline:530px 120px}
@media(max-width:900px){
 .rd-inventory-lines th:first-child,.rd-inventory-lines td:first-child,.rd-inventory-lines th:nth-child(2),.rd-inventory-lines td:nth-child(2){position:static}
 .rd-table:has(>table.rd-inventory-lines){scroll-padding-inline:12px 100px}
}
.rd-inventory-lines thead th:first-child,.rd-inventory-lines thead th:nth-child(2){z-index:3}
.rd-inventory-lines td:nth-child(4){min-width:90px}
.rd-inventory-lines input[type=number]{width:110px}
.rd-inventory-lines select{min-width:180px}
.rd-inventory-lines td:has([data-il="ProjectId"]),.rd-inventory-lines td:has([data-il="DepartmentId"]),.rd-inventory-lines td:has([data-il="CostCenterId"]){min-width:220px}
.rd-inventory-lines td:first-child .rd-lookup-host{width:100%;min-width:0}
/* A searchable lookup inside any grid cell keeps enough width to show what is selected (the label itself has no
   intrinsic width, so without this an auto-layout table squeezes it to the width of its column heading). */
.rd-content td>.rd-lookup-host{min-width:180px}
.rd-inventory-lines [data-stock-exempt-note]{display:block;white-space:normal;max-width:190px;color:var(--hrmc-status-warning-text,#7a4b08)}
.rd-inventory-lines input[data-il=Description]{min-width:180px}
.rd-inventory-lines td.rd-line-actions,.rd-inventory-lines td:has(.rd-actions){position:sticky;inset-inline-end:0;background:var(--hrmc-surface);z-index:2}
.rd-content .rd-inventory-lines tbody tr:hover>td:first-child,.rd-content .rd-inventory-lines tbody tr:hover>td:nth-child(2){background:color-mix(in srgb,var(--hrmc-surface-muted) 55%,var(--hrmc-surface))}
/* Workflow editor & commercial lines */
.rd-workflow-editor table{min-width:900px}
.rd-workflow-editor td:nth-child(2){min-width:220px}
.rd-workflow-editor td:nth-child(3){min-width:300px}
.rd-workflow-editor td .rd-lookup-host{width:240px}
.rd-workflow-editor td:last-of-type{width:48px}
.rd-workflow-editor th{white-space:nowrap}
.rd-workflow-editor>h2{margin-top:var(--hrmc-s5,24px)}
.rd-editor .rd-table,.rd-commercial-lines{border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);box-shadow:none;margin:var(--hrmc-s4,16px) 0}
.rd-commercial-lines th{white-space:nowrap}
.rd-commercial-lines td{min-width:140px}
.rd-commercial-lines td:has(select){min-width:230px}
.rd-commercial-lines td:has([type=checkbox]){min-width:90px;text-align:center}
.rd-editor>.rd-toolbar:last-child,.rd-editor>.rd-fields+.rd-toolbar{margin:var(--hrmc-s5,24px) 0 0;padding-top:var(--hrmc-s4,16px);border-top:1px solid var(--hrmc-border);justify-content:flex-start}
.rd-editor>.rd-primary:last-child,.rd-content>form>fieldset>.rd-primary,.rd-content>form.rd-editor>.rd-primary{margin-top:var(--hrmc-s4,16px)}
.rd-editor>.rd-toolbar:first-child{margin-bottom:var(--hrmc-s4,16px);padding-bottom:var(--hrmc-s3,12px);border-bottom:1px solid var(--hrmc-border)}
.rd-editor>.rd-toolbar:first-child h2{font-size:var(--hrmc-fs-lead,16px)}
.rd-editor>label+label,.rd-editor>.rd-fields+label,.rd-editor>.rd-toolbar+label{margin-top:var(--hrmc-s4,16px)}
.rd-editor>.rd-toolbar:has(.rd-check){justify-content:flex-start;gap:var(--hrmc-s3,12px) var(--hrmc-s5,24px);margin:var(--hrmc-s4,16px) 0}
/* Quotation comparison */
.rd-comparison-item{padding:var(--rd-card-pad)}
.rd-comparison-item h2{font-size:var(--hrmc-fs-lead,16px);margin:0}
.rd-comparison-item p{margin:4px 0}
.rd-comparison-item .rd-table{border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);box-shadow:none;margin-top:var(--hrmc-s3,12px)}
.rd-comparison-quantities{display:flex;gap:var(--hrmc-s5,24px);flex-wrap:wrap;font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-text-muted);margin:var(--hrmc-s3,12px) 0}
.rd-comparison-quantities span{display:flex;flex-direction:column;gap:2px}
.rd-comparison-quantities strong{font-size:var(--hrmc-fs-lead,16px);color:var(--hrmc-text);font-variant-numeric:tabular-nums}
.rd-offer-table{min-width:1400px;table-layout:fixed}
.rd-offer-table th:first-child,.rd-offer-table td:first-child{width:72px;min-width:72px;position:sticky;inset-inline-start:0;z-index:2}
.rd-offer-table th:nth-child(2),.rd-offer-table td:nth-child(2){width:205px;position:sticky;inset-inline-start:72px;z-index:2}
.rd-offer-table td:first-child,.rd-offer-table td:nth-child(2){background:var(--hrmc-surface)}
.rd-offer-table tr.rd-offer-selected td,.rd-offer-table tr.rd-offer-selected td:first-child,.rd-offer-table tr.rd-offer-selected td:nth-child(2){background:var(--hrmc-status-success-bg)}
.rd-offer-table th:first-child,.rd-offer-table th:nth-child(2){z-index:3}
.rd-offer-table th:nth-child(5){width:130px}
.rd-offer-table th:nth-child(10){width:230px}
.rd-offer-table th:last-child{width:64px}
.rd-offer-table td{overflow-wrap:anywhere;vertical-align:top}
.rd-offer-table td:nth-child(2){min-width:185px}
.rd-offer-table td:nth-child(5){width:130px;min-width:130px}
.rd-offer-table td:nth-child(10){width:230px;min-width:230px}
.rd-offer-table small,.rd-quote-dialog small{display:block}
.rd-offer-table input[type=checkbox]{width:18px;height:18px}
.rd-offer-table textarea{min-height:64px}
.rd-award-footer{display:flex;justify-content:space-between;align-items:center;gap:var(--hrmc-s4,16px);padding:var(--hrmc-s4,16px) var(--rd-card-pad);margin-top:var(--hrmc-s4,16px);background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e2);position:sticky;bottom:var(--hrmc-s3,12px);z-index:5}
.rd-award-footer [data-selection-totals]{font-size:var(--hrmc-fs-small,12.5px);margin-top:4px;color:var(--hrmc-text-muted)}
.rd-quote-totals{display:grid;grid-template-columns:auto 1fr;gap:var(--hrmc-s2,8px) var(--hrmc-s5,24px)}
.rd-quote-totals dt{color:var(--hrmc-text-muted)}
.rd-quote-totals dd{margin:0;font-weight:var(--hrmc-fw-semi,600);font-variant-numeric:tabular-nums}
.rd-preserve-lines{white-space:pre-wrap;overflow-wrap:anywhere}
/* Users & roles */
.rd-user-section{padding:var(--rd-card-pad)}
.rd-user-section h3{font-size:var(--hrmc-fs-small,12.5px);letter-spacing:.06em;text-transform:uppercase;color:var(--hrmc-text-muted);margin-bottom:var(--hrmc-s2,8px)}
.rd-access-columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--hrmc-s5,24px)}
.rd-option-list{margin-top:var(--hrmc-s2,8px);max-height:260px;overflow:auto;border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);padding:var(--hrmc-s1,4px)}
.rd-option-list .rd-check{padding:4px 8px;min-height:0;border-radius:4px}
.rd-option-list .rd-check:hover{background:var(--hrmc-surface-muted)}
.rd-company-access{padding:var(--hrmc-s3,12px) 0;border-bottom:1px solid var(--hrmc-border)}
.rd-company-access:last-child{border-bottom:0}
.rd-company-access>.rd-check{font-weight:var(--hrmc-fw-semi,600)}
.rd-role-choices{display:flex;flex-wrap:wrap;gap:var(--hrmc-s1,4px) var(--hrmc-s4,16px);margin-inline-start:26px}
.rd-role-choices .rd-check{min-height:32px;padding:0}
.rd-permission-tree{margin:var(--hrmc-s4,16px) 0}
.rd-permission-tree details{border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);padding:0 var(--hrmc-s4,16px);margin-bottom:var(--hrmc-s2,8px)}
.rd-permission-tree summary{font-weight:var(--hrmc-fw-semi,600);padding:var(--hrmc-s3,12px) 0;cursor:pointer;list-style:none;display:flex;align-items:center;gap:var(--hrmc-s2,8px)}
.rd-permission-tree summary::-webkit-details-marker{display:none}
.rd-permission-tree summary::before{content:"chevron_right";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;font-size:20px;color:var(--hrmc-text-muted);transition:transform .2s ease}
.rd-permission-tree details[open]>summary::before{transform:rotate(90deg)}
.rd-permission-tree details[open]>summary{border-bottom:1px solid var(--hrmc-border);margin-bottom:var(--hrmc-s2,8px)}
.rd-permission-tree label{margin-inline-start:0;min-height:34px;padding:0 var(--hrmc-s2,8px)}
.rd-permission-tree label small{margin-inline-start:var(--hrmc-s1,4px)}
.rd-permission-tree details>label:last-child{margin-bottom:var(--hrmc-s2,8px)}
/* Company profile */
.rd-company-profile{padding:var(--rd-card-pad)}
.rd-toolbar:has(+ .rd-company-profile) h1{margin-bottom:0}
.rd-profile-layout{display:grid;grid-template-columns:minmax(0,1fr) 200px;gap:var(--hrmc-s6,32px)}
.rd-profile-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--hrmc-s4,16px) var(--hrmc-s5,24px);align-content:start}
.rd-profile-address{grid-column:span 2}
.rd-profile-logo{display:flex;flex-direction:column;gap:var(--hrmc-s3,12px);min-width:0}
.rd-logo-preview{width:160px;height:160px;display:grid;place-items:center;border:1px dashed var(--hrmc-border);background:var(--hrmc-surface-muted);border-radius:var(--hrmc-r-card,12px);overflow:hidden}
.rd-logo-preview img{width:100%;height:100%;object-fit:contain}
.rd-logo-preview .material-symbols-outlined{font-size:48px;color:var(--hrmc-text-muted)}
.rd-logo-error{font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-status-danger-text)}
.rd-code-settings{border-top:1px solid var(--hrmc-border);padding-top:var(--hrmc-s5,24px);margin-top:var(--hrmc-s5,24px)}
.rd-code-settings h2{font-size:var(--hrmc-fs-lead,16px);margin:0 0 var(--hrmc-s4,16px)}
#project-stores table{min-width:560px}
#project-stores th:last-child,#project-stores td:last-child{min-width:150px}
/* Store associations, periods, stock setup */
.rd-association-tree{padding:var(--hrmc-s2,8px) var(--hrmc-s3,12px)}
.rd-association-tree details{padding:4px 0 4px 18px}
.rd-association-tree summary{cursor:pointer;padding:6px 0;font-weight:var(--hrmc-fw-medium,500)}
.rd-association-tree input[type=checkbox]{width:16px;height:16px;vertical-align:middle;margin-inline-end:8px;accent-color:var(--hrmc-brand-strong)}
.rd-association-tree label[data-association-item]{display:flex;flex-direction:row;align-items:center;padding:6px 12px;gap:8px;margin:0;font-weight:var(--hrmc-fw-normal,400);font-size:var(--hrmc-fs-body,14px);color:var(--hrmc-text);border-radius:4px}
.rd-association-tree label[data-association-item]:hover{background:var(--hrmc-surface-muted)}
.rd-association-tree label[data-association-item] span{min-width:0;overflow-wrap:anywhere}
.rd-association-tree label[hidden],.rd-association-tree details[hidden]{display:none}
.rd-association-tree strong{margin-inline-end:10px}
#store-association .rd-toolbar>label{flex-direction:row;align-items:center;margin:0;gap:var(--hrmc-s2,8px);font-size:var(--hrmc-fs-body,14px);color:var(--hrmc-text);font-weight:var(--hrmc-fw-normal,400)}
#store-association .rd-toolbar>label input{width:18px;height:18px;accent-color:var(--hrmc-brand-strong)}
.rd-table table.rd-period-table{min-width:880px}
.rd-period-table th,.rd-period-table td{word-break:normal;overflow-wrap:normal}
.rd-stock-checks{display:flex;gap:var(--hrmc-s3,12px) var(--hrmc-s5,24px);flex-wrap:wrap;margin:var(--hrmc-s4,16px) 0}
.rd-content .rd-stock-checks label{display:flex;flex-direction:row;align-items:center;gap:8px;font-size:var(--hrmc-fs-body,14px);color:var(--hrmc-text);font-weight:var(--hrmc-fw-normal,400);margin:0}
.rd-stock-checks input[type=checkbox]{width:18px;height:18px;margin:0;accent-color:var(--hrmc-brand-strong)}
[data-lot-preview]{display:block;min-height:40px;padding:10px 12px;background:var(--hrmc-surface-muted);border:1px dashed var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:var(--hrmc-fs-small,12.5px)}
.rd-lot-token-reference{margin-top:var(--hrmc-s5,24px)}
.rd-lot-token-reference td{padding:8px 20px 8px 0}
.rd-toolbar [data-stock-search]{width:100%;max-width:340px;min-width:0}
[data-stock-setup]+.rd-toolbar{margin-top:var(--hrmc-s5,24px)}

/* --------------------------------------------------------------- dialogs -- */
.rd-source-picker,.rd-quote-dialog,.rd-inventory-dialog,dialog.rd-attachment-modal{width:min(1200px,calc(100vw - 32px));max-height:90vh;padding:0;border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);color:var(--hrmc-text);background:var(--hrmc-surface);box-shadow:var(--hrmc-e3);overflow:auto;box-sizing:border-box}
.rd-quote-dialog{width:min(1080px,calc(100vw - 32px));max-height:85vh}
.rd-inventory-dialog{width:min(1200px,94vw);max-height:85vh}
dialog.rd-attachment-modal{width:min(1180px,calc(100vw - 24px))}
.rd-source-picker::backdrop,.rd-quote-dialog::backdrop,.rd-inventory-dialog::backdrop,dialog.rd-attachment-modal::backdrop{background:rgb(18 33 38 / 55%);backdrop-filter:blur(2px)}
.rd-source-picker>*,.rd-quote-dialog>*,.rd-inventory-dialog>*,dialog.rd-attachment-modal>*{margin-inline-start:var(--rd-card-pad);margin-inline-end:var(--rd-card-pad)}
.rd-source-picker>:first-child,.rd-quote-dialog>:first-child,.rd-inventory-dialog>:first-child,dialog.rd-attachment-modal>:first-child{margin-top:var(--hrmc-s4,16px)}
.rd-source-picker>:last-child,.rd-quote-dialog>:last-child,.rd-inventory-dialog>:last-child,dialog.rd-attachment-modal>:last-child{margin-bottom:var(--hrmc-s4,16px)}
dialog .rd-toolbar:first-child{position:sticky;top:0;z-index:3;background:var(--hrmc-surface);margin:0 0 var(--hrmc-s4,16px);padding:var(--hrmc-s4,16px) var(--rd-card-pad);border-bottom:1px solid var(--hrmc-border)}
dialog .rd-toolbar:first-child h2{font-size:var(--hrmc-fs-lead,16px)}
.rd-source-picker .rd-fields{margin-bottom:var(--hrmc-s4,16px);grid-template-columns:repeat(auto-fill,minmax(min(100%,200px),1fr))}
.rd-source-results{min-height:120px}
.rd-source-results details{border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);padding:0 var(--hrmc-s3,12px);margin-bottom:var(--hrmc-s2,8px)}
.rd-source-results summary{cursor:pointer;padding:var(--hrmc-s3,12px) 0;font-weight:var(--hrmc-fw-semi,600)}
.rd-source-results summary span{margin-inline-start:var(--hrmc-s4,16px);font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-text-muted);font-weight:var(--hrmc-fw-normal,400)}
.rd-source-results details[open]>summary{border-bottom:1px solid var(--hrmc-border)}
.rd-source-results table{min-width:920px;width:100%;table-layout:auto}
.rd-source-results th{white-space:nowrap}
.rd-source-results input[type=number]{width:130px}
.rd-source-results input[type=checkbox]{width:18px;height:18px}
.rd-source-footer{position:sticky;bottom:0;background:var(--hrmc-surface);padding:var(--hrmc-s3,12px) var(--rd-card-pad);margin:var(--hrmc-s4,16px) 0 0!important;border-top:1px solid var(--hrmc-border);z-index:3}
.rd-inventory-dialog .rd-table{max-height:55vh;overflow:auto}
.rd-inventory-dialog input[type=number]{width:120px}
.rd-attachment-backdrop,.rd-lot-backdrop,.rd-settings-backdrop{position:fixed;inset:0;background:rgb(18 33 38 / 55%);z-index:2998}
dialog.rd-attachment-modal{position:fixed;inset:0;margin:auto;z-index:2999}
.rd-attachment-modal .rd-fields{grid-template-columns:repeat(auto-fill,minmax(min(100%,200px),1fr));gap:var(--hrmc-s3,12px) var(--hrmc-s4,16px);margin-bottom:var(--hrmc-s3,12px)}
.rd-attachment-modal [data-attachment-filters]{margin-top:var(--hrmc-s2,8px);padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);background:var(--hrmc-surface-muted);border-radius:var(--hrmc-r-control,6px)}
.rd-attachment-actions{display:flex;gap:var(--hrmc-s2,8px);align-items:center;flex-wrap:wrap}
.rd-lot-dialog[open]{position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);margin:0;width:min(1120px,calc(100vw - 24px));max-height:90vh;z-index:2999}
.rd-lot-dialog table{min-width:900px}
.rd-lot-dialog td{vertical-align:top}
.rd-lot-dialog td:first-child{min-width:230px}
.rd-lot-dialog input[type=number]{width:110px}
.rd-lot-dialog input[type=date]{width:155px}
.rd-lot-date{display:flex;align-items:center;gap:var(--hrmc-s1,4px);min-width:200px}
.rd-lot-date input[type=date]{flex:1;min-width:145px}
.rd-lot-date .rd-icon{flex:none}
.rd-lot-date input::-webkit-calendar-picker-indicator{display:none}
[data-lot-error][hidden]{display:none!important}
.rd-lot-dialog input{min-height:36px;padding:0 10px;border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);font:inherit;background:var(--hrmc-surface);color:var(--hrmc-text)}
.rd-lot-open,.rd-settings-open{overflow:hidden}
.rd-lot-open .rz-dropdown-panel,.rd-settings-open .rz-dropdown-panel,.rz-dropdown-panel{z-index:3001!important}
[data-inv-lots][hidden],.rd-lot-backdrop[hidden]{display:none}
dialog .rd-table{border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);box-shadow:none}

/* ------------------------------------------------------------------ auth -- */
.rd-public{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:var(--hrmc-s5,24px);color:var(--hrmc-text);background:var(--hrmc-shell-bg,#f4f7f5);background-image:radial-gradient(1200px 600px at 10% -10%,color-mix(in srgb,var(--hrmc-brand) 14%,transparent),transparent 60%),radial-gradient(900px 500px at 100% 110%,color-mix(in srgb,var(--hrmc-brand) 10%,transparent),transparent 60%);font-size:var(--hrmc-fs-body,14px)}
.rd-auth{width:min(440px,100%);padding:var(--hrmc-s6,32px) var(--hrmc-s6,32px) var(--hrmc-s5,24px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);background:var(--hrmc-surface);box-shadow:var(--hrmc-e3);box-sizing:border-box}
.rd-auth-wide{width:min(760px,100%)}
.rd-auth>img{width:52px;height:52px;border-radius:12px;box-shadow:var(--hrmc-e1)}
.rd-auth h1{font-size:var(--hrmc-fs-title,20px);margin:var(--hrmc-s4,16px) 0 var(--hrmc-s5,24px);font-weight:700;letter-spacing:-.02em}
.rd-auth h1+.rd-alert{margin-top:calc(-1*var(--hrmc-s2,8px))}
.rd-auth form{display:grid;gap:var(--hrmc-s4,16px)}
.rd-auth .rd-fields{gap:var(--hrmc-s4,16px) var(--hrmc-s5,24px)}
.rd-auth .rd-primary{width:100%;margin-top:var(--hrmc-s2,8px)}
.rd-auth>details,.rd-auth>a{display:block;margin-top:var(--hrmc-s4,16px);font-size:var(--hrmc-fs-small,12.5px)}
.rd-auth>a:first-child{margin:0 0 var(--hrmc-s3,12px);font-weight:var(--hrmc-fw-medium,500)}
.rd-auth>a{color:var(--hrmc-brand-hover);text-decoration:none;font-weight:var(--hrmc-fw-medium,500)}
.rd-auth>a:hover{text-decoration:underline}
.rd-auth details summary{cursor:pointer;color:var(--hrmc-text-muted)}
.rd-auth details p{margin:var(--hrmc-s2,8px) 0 0;color:var(--hrmc-text-muted)}
.rd-auth .rd-primary,.rd-auth .rd-button{display:inline-flex;align-items:center;justify-content:center;gap:var(--hrmc-s2,8px);min-height:var(--rd-control-h);padding:0 var(--hrmc-s4,16px);border-radius:var(--hrmc-r-control,6px);font:inherit;font-weight:var(--hrmc-fw-semi,600);cursor:pointer;border:1px solid transparent;background:var(--hrmc-action-primary,var(--hrmc-brand-strong));color:var(--hrmc-on-action,#fff);box-shadow:var(--hrmc-e1)}
.rd-auth .rd-primary:hover{background:var(--hrmc-action-primary-hover,var(--hrmc-brand-hover))}
.rd-auth .rd-primary:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:2px}
.rd-public>h1{margin:0}
/* End states (page not found, request failed). They are the two pages a reader only ever
   sees when something already went wrong, so they explain what happened and offer the way
   back rather than leaving a bare heading in the middle of the screen. */
.rd-endstate{background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,14px);
    box-shadow:var(--hrmc-e2);padding:var(--hrmc-s6,40px) var(--hrmc-s5,24px);max-width:520px;text-align:center;
    display:grid;gap:var(--hrmc-s3,12px);justify-items:center}
.rd-endstate>.material-symbols-outlined{font-size:44px;inline-size:72px;block-size:72px;display:grid;place-items:center;
    border-radius:50%;background:var(--hrmc-brand-soft);color:var(--hrmc-brand-hover)}
.rd-endstate h1{margin:0;font-size:var(--hrmc-fs-title,20px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text)}
.rd-endstate p{margin:0;color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-body,14px);line-height:1.55;max-width:42ch}
.rd-endstate code{font-family:ui-monospace,Consolas,monospace;font-size:var(--hrmc-fs-small,12.5px);
    background:var(--hrmc-shell-bg,#f4f7f5);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-pill,999px);
    padding:2px 10px;color:var(--hrmc-text-muted);overflow-wrap:anywhere;max-width:100%}
.rd-endstate .rd-actions{margin-top:var(--hrmc-s2,8px);display:flex;gap:var(--hrmc-s2,8px);flex-wrap:wrap;justify-content:center}

/* -------------------------------------------------------------- settings -- */
.rd-settings{padding:0;display:flex;flex-direction:column;border-inline-start:1px solid var(--hrmc-border)}
.rd-settings header{padding:var(--hrmc-s4,16px) var(--hrmc-s5,20px);margin:0;border-bottom:1px solid var(--hrmc-border);flex:none}
.rd-settings h2{font-size:var(--hrmc-fs-lead,16px)}
/* Only the workspace form fills the drawer; the language form stays compact. */
.rd-settings form[data-workspace-settings]{display:flex;flex-direction:column;flex:1;min-height:0}
.rd-settings form[data-workspace-settings]>*{margin-inline-start:var(--hrmc-s5,20px);margin-inline-end:var(--hrmc-s5,20px)}
.rd-settings form[data-workspace-settings]>label{margin:0 var(--hrmc-s5,20px) var(--hrmc-s3,12px);font-size:var(--hrmc-fs-small,12.5px)}
.rd-settings form[data-workspace-settings]>label:first-of-type{margin-top:var(--hrmc-s4,16px)}
.rd-settings>.rd-language-picker{padding:var(--hrmc-s4,16px) var(--hrmc-s5,20px) 0}
.rd-settings select{margin-top:0;border-radius:var(--hrmc-r-control,6px)}
.rd-settings .rd-lookup-host{margin-top:0}
.rd-settings footer{margin:auto 0 0;padding:var(--hrmc-s4,16px) var(--hrmc-s5,20px);border-top:1px solid var(--hrmc-border);background:var(--hrmc-surface);position:sticky;bottom:0}
.rd-settings footer .rd-primary{width:100%}
.rd-theme-options{border:0;padding:var(--hrmc-s2,8px) 0 var(--hrmc-s4,16px);margin:0 var(--hrmc-s5,20px)}
.rd-theme-options legend,.rd-appearance legend{font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text-muted);padding:0;margin-bottom:var(--hrmc-s2,8px)}
.rd-theme-swatch input:checked+span{outline:2px solid var(--hrmc-text);outline-offset:2px}
.rd-appearance{border:0;padding:0 0 var(--hrmc-s4,16px);margin:0 var(--hrmc-s5,20px)}
.rd-segmented{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;padding:3px;background:var(--hrmc-surface-muted);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px)}
.rd-segmented label{position:relative;display:flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:0 var(--hrmc-s2,8px);border-radius:4px;font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text-muted);cursor:pointer;flex-direction:row;margin:0}
.rd-segmented label .material-symbols-outlined{font-size:18px}
.rd-segmented input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}
.rd-segmented label:has(input:checked){background:var(--hrmc-surface);color:var(--hrmc-text);box-shadow:var(--hrmc-e1)}
.rd-segmented label:has(input:focus-visible){outline:2px solid var(--hrmc-brand);outline-offset:1px}
.rd-settings-hint{font-size:var(--hrmc-fs-caption,11px);color:var(--hrmc-text-muted);margin:var(--hrmc-s2,8px) 0 0}
.rd-settings-group{font-size:var(--hrmc-fs-caption,11px);letter-spacing:.1em;text-transform:uppercase;color:var(--hrmc-text-muted);font-weight:var(--hrmc-fw-bold,700);margin:var(--hrmc-s4,16px) var(--hrmc-s5,20px) var(--hrmc-s2,8px)}

/* ------------------------------------------------------- module surfaces -- */
/* Finance, sales and dashboard pages were built on the same rd-* hooks; these
   rules put their remaining module-specific classes on the shared look. */
/* Any GET form directly on the page is a filter panel. */
.rd-content>form[method="get"]:not(:has(>.rd-document-filters)):not(.rd-fields):not(.rd-master-filters):not(.rd-toolbar),
.rd-content>section>form[method="get"]:not(.rd-fields):not(.rd-master-filters):not(.rd-toolbar){background:color-mix(in srgb,var(--hrmc-surface) 60%,var(--hrmc-surface-muted));border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1);padding:var(--hrmc-s4,16px) var(--rd-card-pad);margin:0 0 var(--hrmc-s4,16px)}
.rd-content>form[method="get"]>.rd-fields,.rd-content>form[method="get"]>details>.rd-fields,.rd-content>section>form[method="get"]>.rd-fields{grid-template-columns:repeat(auto-fill,minmax(min(100%,200px),1fr));gap:var(--hrmc-s3,12px) var(--hrmc-s4,16px)}
.rd-content>form[method="get"]>.rd-actions,.rd-content>form[method="get"]>details>.rd-actions,.rd-content>form[method="get"]>.rd-fields+div,.rd-content>section>form[method="get"]>.rd-actions,.rd-content>section>form[method="get"]>.rd-fields+div{margin-top:var(--hrmc-s4,16px)}
.rd-content>form[method="get"]>details>summary{display:flex;align-items:center;gap:var(--hrmc-s2,8px);cursor:pointer;list-style:none;font-weight:var(--hrmc-fw-semi,600);font-size:var(--hrmc-fs-small,12.5px);letter-spacing:.06em;text-transform:uppercase;color:var(--hrmc-text-muted);margin:calc(-1*var(--hrmc-s4,16px)) calc(-1*var(--rd-card-pad));padding:var(--hrmc-s3,12px) var(--rd-card-pad);user-select:none}
/* Count of applied filters, shown on the (closed by default) filter panel header. */
.rd-filter-count{padding:2px var(--hrmc-s2,8px);border-radius:var(--hrmc-r-pill,999px);background:var(--hrmc-brand-soft);color:var(--hrmc-brand-hover);font-size:var(--hrmc-fs-caption,11px);letter-spacing:.02em;text-transform:none;font-weight:var(--hrmc-fw-semi,600)}
.rd-content>form[method="get"]>details>summary::-webkit-details-marker{display:none}
.rd-content>form[method="get"]>details>summary::before{content:"filter_list";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;font-size:20px}
.rd-content>form[method="get"]>details>summary::after{content:"expand_more";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;text-transform:none;letter-spacing:0;line-height:1;font-size:20px;margin-inline-start:auto;transition:transform .2s ease}
.rd-content>form[method="get"]>details[open]>summary::after{transform:rotate(180deg)}
.rd-content>form[method="get"]>details[open]>summary{margin-bottom:var(--hrmc-s3,12px)}
/* Closed, the panel keeps the same 16px gap to the list as when open. The old negative margin
   dated from panels only closing on phones; with every panel closed by default it pulled the
   list 16px up under the panel's bottom edge. */
.rd-content>form[method="get"]>details:not([open]){margin-bottom:var(--hrmc-s4,16px)}
/* Editors: header field groups become cards, plain <details> sections become regions. */
form[data-fin-form]>fieldset>.rd-fields,form[data-sales-editor]>fieldset>.rd-fields,form[data-fin-form]>.rd-fields,.rd-content>form:not([method="get"]):not(.rd-editor)>fieldset>.rd-fields:first-child,[data-fin-setup]>fieldset>.rd-fields,form[data-stock-accounting]>.rd-fields{background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1);padding:var(--rd-card-pad);margin:0 0 var(--hrmc-s4,16px)}
form[data-fin-form]>fieldset>.rd-fields+.rd-fields,form[data-sales-editor]>fieldset>.rd-fields+.rd-fields{margin-top:calc(-1*var(--hrmc-s2,8px))}
form[data-fin-form]>fieldset>details,form[data-sales-editor]>fieldset>details,form[data-fin-form]>details,form[data-sales-editor]>details,[data-inventory-editor]>fieldset>details,.rd-content>form:not([method="get"])>details{background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1);padding:0;margin:0 0 var(--hrmc-s4,16px);overflow:hidden}
form[data-fin-form]>fieldset>details>summary,form[data-sales-editor]>fieldset>details>summary,form[data-fin-form]>details>summary,form[data-sales-editor]>details>summary,[data-inventory-editor]>fieldset>details>summary,.rd-content>form:not([method="get"])>details>summary{display:flex;align-items:center;gap:var(--hrmc-s2,8px);margin:0;padding:var(--hrmc-s3,12px) var(--rd-card-pad);cursor:pointer;list-style:none;font-size:var(--hrmc-fs-lead,16px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text);user-select:none;border:0}
form[data-fin-form] details>summary::-webkit-details-marker,form[data-sales-editor] details>summary::-webkit-details-marker{display:none}
form[data-fin-form]>fieldset>details>summary::before,form[data-sales-editor]>fieldset>details>summary::before,form[data-fin-form]>details>summary::before,form[data-sales-editor]>details>summary::before,.rd-content>form:not([method="get"])>details>summary::before{content:"chevron_right";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;line-height:1;font-size:22px;color:var(--hrmc-text-muted);transition:transform .2s ease;flex:none}
form[data-fin-form]>fieldset>details[open]>summary::before,form[data-sales-editor]>fieldset>details[open]>summary::before,form[data-fin-form]>details[open]>summary::before,form[data-sales-editor]>details[open]>summary::before,.rd-content>form:not([method="get"])>details[open]>summary::before{transform:rotate(90deg)}
form[data-fin-form]>fieldset>details[open]>summary,form[data-sales-editor]>fieldset>details[open]>summary,form[data-fin-form]>details[open]>summary,form[data-sales-editor]>details[open]>summary,[data-inventory-editor]>fieldset>details[open]>summary,.rd-content>form:not([method="get"])>details[open]>summary{border-bottom:1px solid var(--hrmc-border);margin-bottom:0}
form[data-fin-form]>fieldset>details>:not(summary),form[data-sales-editor]>fieldset>details>:not(summary),form[data-fin-form]>details>:not(summary),form[data-sales-editor]>details>:not(summary),[data-inventory-editor]>fieldset>details>:not(summary),.rd-content>form:not([method="get"])>details>:not(summary){margin:var(--hrmc-s4,16px) var(--rd-card-pad)}
form[data-fin-form]>fieldset>details>.rd-table,form[data-sales-editor]>fieldset>details>.rd-table,form[data-sales-editor]>details>.rd-table,.rd-content>form:not([method="get"])>details>.rd-table{margin:0;border:0;border-radius:0;box-shadow:none}
form[data-fin-form]>fieldset>details>textarea,form[data-sales-editor]>fieldset>details>textarea{width:calc(100% - 2*var(--rd-card-pad))}
form[data-fin-form]>fieldset>details>label,form[data-sales-editor]>fieldset>details>label{display:flex;max-width:480px}
[data-inventory-editor]>fieldset>details{padding:0}
[data-inventory-editor]>fieldset>details>summary{margin:0}
[data-inventory-editor]>fieldset>details:not([open]){padding-bottom:0}
[data-sales-editor] details{margin:0 0 var(--hrmc-s4,16px)}
[data-sales-editor] summary{padding:var(--hrmc-s3,12px) var(--rd-card-pad)}
.fin-title,.rd-sales-header{display:flex;align-items:baseline;gap:var(--hrmc-s3,12px);flex-wrap:wrap;min-width:0}
.fin-title h1,.rd-sales-header h1{margin:0}
.fin-title>strong,.rd-sales-header>strong{font-weight:var(--hrmc-fw-medium,500);color:var(--hrmc-text-muted)}
.rd-toolbar:has(>.fin-title),.rd-toolbar:has(>.rd-sales-header){min-height:44px;margin:0 0 var(--hrmc-s5,24px);padding-bottom:var(--hrmc-s4,16px);border-bottom:1px solid var(--hrmc-border)}
/* Tab strips: every page-level nav of links with a current page shares one look. */
.fin-tabs,.rd-dashboard-tabs,.rd-dashboard-levels,.rd-discount-nav,nav.rd-actions:has(>a[aria-current]),nav.rd-actions:has(>a.rd-button){display:flex;flex-wrap:nowrap;gap:var(--hrmc-s1,4px);border-bottom:1px solid var(--hrmc-border);margin:0 0 var(--hrmc-s5,24px);overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.fin-tabs>a,.rd-dashboard-tabs>a,.rd-dashboard-levels>a,.rd-discount-nav>a,nav.rd-actions>a.rd-button,.fin-tabs>a.rd-button{display:inline-flex;align-items:center;gap:6px;min-height:0;padding:var(--hrmc-s3,12px) var(--hrmc-s3,12px);color:var(--hrmc-text-muted);text-decoration:none;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;background:transparent;box-shadow:none;font:inherit;font-weight:var(--hrmc-fw-medium,500);cursor:pointer;white-space:nowrap;border-radius:var(--hrmc-r-control,6px) var(--hrmc-r-control,6px) 0 0;transition:color .15s ease,background .15s ease}
.fin-tabs>a:hover,.rd-dashboard-tabs>a:hover,.rd-dashboard-levels>a:hover,.rd-discount-nav>a:hover,nav.rd-actions>a.rd-button:hover{color:var(--hrmc-text);background:var(--hrmc-surface-muted);border-color:transparent;border-bottom-color:transparent}
.fin-tabs>a[aria-current=page],.rd-dashboard-tabs>a[aria-current=page],.rd-dashboard-levels>a[aria-current=page],.rd-discount-nav>a[aria-current=page],nav.rd-actions>a.rd-button[aria-current=page]{border-bottom-color:var(--hrmc-brand);color:var(--hrmc-brand-hover);font-weight:var(--hrmc-fw-semi,600);text-decoration:none}
.fin-tabs .material-symbols-outlined,.rd-dashboard-tabs .material-symbols-outlined{font-size:20px}
fieldset>.fin-tabs{margin-bottom:var(--hrmc-s4,16px)}
/* Stat strips: totals, summaries and KPI rows. */
.fin-totals,.fin-summary,.rd-sales-totals,.rd-sales-price-detail{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:var(--hrmc-s3,12px);padding:0;margin:0 0 var(--hrmc-s4,16px);border:0}
.fin-totals>*,.fin-summary>*,.rd-sales-totals>div,.rd-sales-price-detail>div{display:flex;flex-direction:column;gap:4px;min-width:0;padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);border-radius:var(--hrmc-r-control,6px);background:var(--hrmc-surface-muted);border:1px solid var(--hrmc-border);color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);text-decoration:none}
.fin-totals strong,.fin-summary strong,.rd-sales-totals dd,.rd-sales-price-detail dd{display:block;margin:0;font-size:var(--hrmc-fs-title,20px);font-weight:var(--hrmc-fw-bold,700);color:var(--hrmc-text);font-variant-numeric:tabular-nums;overflow-wrap:anywhere;line-height:1.2}
.rd-sales-totals dt,.rd-sales-price-detail dt{font-size:inherit}
.fin-summary a:hover{border-color:var(--hrmc-brand-edge);background:var(--hrmc-brand-soft)}
.fin-warning{display:flex;gap:var(--hrmc-s3,12px);align-items:flex-start;padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);margin:0 0 var(--hrmc-s4,16px);border:1px solid color-mix(in srgb,var(--hrmc-status-warning-text) 25%,transparent);border-inline-start:4px solid var(--hrmc-status-warning-text);background:var(--hrmc-status-warning-bg);color:var(--hrmc-status-warning-text);border-radius:var(--hrmc-r-control,6px);line-height:1.45}
.fin-warning::before{content:"warning";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;line-height:1.1;font-size:20px;flex:none}
/* A standing scope/context note is information, not a warning; warnings stay amber. */
.rd-note{display:flex;gap:var(--hrmc-s3,12px);align-items:flex-start;padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);margin:0 0 var(--hrmc-s4,16px);border:1px solid var(--hrmc-border);border-inline-start:4px solid var(--hrmc-text-muted);background:var(--hrmc-surface-muted);color:var(--hrmc-text-muted);border-radius:var(--hrmc-r-control,6px);font-size:var(--hrmc-fs-small,12.5px);line-height:1.5}
.rd-note::before{content:"info";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;line-height:1.1;font-size:18px;flex:none}
.fin-report-total{font-weight:var(--hrmc-fw-bold,700)}
.fin-report-total td{background:var(--hrmc-surface-muted)}
.fin-trend{display:grid;grid-template-columns:110px 1fr;gap:var(--hrmc-s3,12px);padding:var(--hrmc-s2,8px) 0;border-bottom:1px solid var(--hrmc-border);align-items:center}
.fin-bar{display:block;height:8px;max-width:100%;margin-block:4px;border-radius:var(--hrmc-r-pill,999px)}
.fin-bar.revenue{background:var(--hrmc-status-success-text)}.fin-bar.expense{background:var(--hrmc-status-danger-text)}
.fin-dashboard-columns{display:grid;grid-template-columns:1fr 1fr;gap:var(--hrmc-s5,24px);margin:0 0 var(--hrmc-s5,24px)}
.fin-dashboard-columns section,.rd-dashboard-columns section{min-width:0;background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1);padding:var(--hrmc-s4,16px) var(--rd-card-pad)}
.fin-dashboard-columns section>h3,.rd-dashboard-columns section>h2,.rd-dashboard-columns section>h3{margin:0 0 var(--hrmc-s3,12px);padding-bottom:var(--hrmc-s2,8px);border-bottom:1px solid var(--hrmc-border);font-size:var(--hrmc-fs-lead,16px)}
.fin-dashboard-columns section .rd-table,.rd-dashboard-columns section .rd-table{border:0;box-shadow:none;border-radius:0}
/* Voucher line tables */
.fin-lines table{min-width:1100px}
.fin-lines td{vertical-align:top;padding:var(--hrmc-s2,8px) var(--hrmc-s3,12px)}.fin-lines th{white-space:nowrap}
.fin-lines input[type=number]{min-width:100px;width:100%;text-align:end}
.fin-lines select{min-width:190px}.fin-lines input:not([type=number]):not([type=checkbox]){min-width:150px}.fin-lines td:last-child{min-width:90px}
.fin-lines input[type=checkbox]{min-width:0;width:18px;height:18px}
.fin-lines .fin-dimensions{min-width:200px;max-width:280px}.fin-lines details{min-width:180px;margin:0;padding:0}.fin-lines details summary{padding:var(--hrmc-s2,8px) 0;cursor:pointer;font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-text-muted);font-weight:var(--hrmc-fw-semi,600)}
.fin-dimensions{display:flex;flex-wrap:wrap;gap:var(--hrmc-s3,12px);padding:var(--hrmc-s2,8px) 0}.fin-dimensions label{display:flex;min-width:170px;flex:1}
.fin-accounting-preview{margin:0 0 var(--hrmc-s4,16px)}.fin-accounting-preview>summary{display:flex;gap:var(--hrmc-s4,16px);flex-wrap:wrap;align-items:baseline}.fin-accounting-preview summary span{font-weight:var(--hrmc-fw-normal,400);font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-text-muted)}.fin-stale [data-fin-accounting-preview]{opacity:.55}
[data-fin-extra-advance]{display:grid;grid-template-columns:minmax(160px,1fr) 110px 36px;gap:6px;margin-block:8px}
[data-fin-v2] textarea{width:100%;box-sizing:border-box}
[data-fin-form] .rd-toolbar:has(>h2){margin-bottom:var(--hrmc-s3,12px)}
[data-fin-form] .rd-table+.rd-toolbar{margin:calc(-1*var(--hrmc-s2,8px)) 0 var(--hrmc-s4,16px);justify-content:flex-start;gap:var(--hrmc-s4,16px)}
[data-fin-form] [data-fin-total],[data-fin-preview-total]{font-variant-numeric:tabular-nums}
/* Finance matching / sales source dialogs */
.fin-matching,.rd-sales-source-dialog{width:min(1100px,calc(100vw - 32px));max-height:85vh;padding:0;border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);color:var(--hrmc-text);background:var(--hrmc-surface);box-shadow:var(--hrmc-e3);overflow:auto;box-sizing:border-box}
.rd-sales-source-dialog{width:min(1200px,95vw);max-height:90vh}
.fin-matching::backdrop,.rd-sales-source-dialog::backdrop{background:rgb(18 33 38 / 55%);backdrop-filter:blur(2px)}
.fin-matching>*,.rd-sales-source-dialog>*{margin-inline-start:var(--rd-card-pad);margin-inline-end:var(--rd-card-pad)}
.fin-matching>:last-child,.rd-sales-source-dialog>:last-child{margin-bottom:var(--hrmc-s4,16px)}
.fin-matching .rd-table{max-height:45vh;overflow:auto}.fin-matching h2{font-size:var(--hrmc-fs-lead,16px);margin:0}
.rd-sales-source-dialog .rd-table{max-height:48vh;overflow:auto}
/* Sales grid */
.rd-sales-grid td:has(>.rd-check){min-width:170px;white-space:nowrap}
.rd-sales-grid td>.rd-check{min-height:28px;padding:0;white-space:nowrap}
.rd-sales-grid td>.rd-check+.rd-check{margin-top:2px}
.rd-sales-grid th:last-child{background:var(--hrmc-grid-heading)!important}
/* Direct sales invoice of stock items: Item, Unit, Quantity, Rate and Gross value fit the page width without scrolling.
   The shared number-input rule (16ch + 48px) is too wide for that, so it is narrowed here with one class more. */
.hrmc-shell .rd-content .rd-sales-items-first table td:has(input[type=number]){min-width:0}
.hrmc-shell .rd-content .rd-sales-items-first table input[type=number]{min-width:7.5rem;width:7.5rem}
.rd-content .rd-sales-items-first td.rd-sales-item{min-width:15rem;max-width:16rem}
.rd-content .rd-sales-items-first td.rd-sales-item>.rd-lookup-host{max-width:15rem}
.hrmc-shell .rd-content .rd-sales-items-first table td:has(>[data-sales-unit]){min-width:8.5rem}
.rd-content .rd-sales-items-first td:has(>[data-sales-unit]) summary{white-space:nowrap}
.rd-content .rd-sales-items-first th,.rd-content .rd-sales-items-first td{padding-inline:8px}
.rd-sales-line-actions{position:sticky;inset-inline-end:0;min-width:100px;background:var(--hrmc-surface);white-space:nowrap;z-index:2;box-shadow:-8px 0 12px -10px var(--hrmc-shadow)}
.rd-sales-grid tfoot td,.rd-sales-grid tfoot th{font-weight:var(--hrmc-fw-semi,600);border-top:2px solid var(--hrmc-border);background:var(--hrmc-surface-muted);font-variant-numeric:tabular-nums}
.rd-sales-calculation-status{display:flex;justify-content:space-between;align-items:center;gap:var(--hrmc-s3,12px);margin:0 0 var(--hrmc-s4,16px);color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px)}
[data-sales-breakdown]>section{padding:var(--hrmc-s3,12px) 0;border-bottom:1px solid var(--hrmc-border)}[data-sales-breakdown]>section:last-child{border-bottom:0}[data-sales-breakdown] h3{font-size:var(--hrmc-fs-body,14px)}
[data-sales-breakdown] .rd-table{border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);box-shadow:none;margin:var(--hrmc-s2,8px) 0}
/* Dashboards */
.rd-stock-dashboard h1{font-size:var(--hrmc-fs-title,20px);margin:0}
.rd-stock-dashboard h2{font-size:var(--hrmc-fs-lead,16px)}
.rd-dashboard-filters{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr));gap:var(--hrmc-s3,12px) var(--hrmc-s4,16px);align-items:end;margin:0 0 var(--hrmc-s4,16px);padding:var(--hrmc-s4,16px) var(--rd-card-pad);background:color-mix(in srgb,var(--hrmc-surface) 60%,var(--hrmc-surface-muted));border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1)}
.rd-dashboard-filters label{font-size:var(--hrmc-fs-small,12.5px)}
.rd-dashboard-filters>div,.rd-dashboard-filters>.rd-actions{display:flex;gap:var(--hrmc-s2,8px);align-items:center}
.rd-dashboard-context{display:flex;gap:var(--hrmc-s2,8px);flex-wrap:wrap;font-size:var(--hrmc-fs-small,12.5px);padding:0;margin:0 0 var(--hrmc-s4,16px);color:var(--hrmc-text-muted)}
.rd-dashboard-context>*{padding:3px 12px;border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-pill,999px);background:var(--hrmc-surface)}
.rd-dashboard-context strong{color:var(--hrmc-brand-hover);background:var(--hrmc-brand-soft);border-color:var(--hrmc-brand-edge)}
.rd-dashboard-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:var(--hrmc-s4,16px);margin:0 0 var(--hrmc-s5,24px)}
/* Card: label and icon on one row, the figure on its own full-width row, the hint underneath. The figure scales with the card
   (container query units) and never wraps, so a value such as 12,445,158.80 stays on one line at any width. */
.rd-dashboard-metric{container-type:inline-size;display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:start;padding:var(--hrmc-s4,16px) var(--hrmc-s4,18px);border:1px solid var(--hrmc-border);border-top:3px solid var(--metric-color);border-radius:var(--hrmc-r-card,12px);background:var(--hrmc-surface);box-shadow:var(--hrmc-e1);text-decoration:none;color:inherit;gap:var(--hrmc-s2,8px);min-width:0;transition:box-shadow .15s ease,transform .15s ease}
a.rd-dashboard-metric:hover{box-shadow:var(--hrmc-e2);transform:translateY(-1px)}
a.rd-dashboard-metric:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:2px}
.rd-dashboard-metric>.material-symbols-outlined{grid-column:2;grid-row:1;display:grid;place-items:center;width:36px;height:36px;border-radius:10px;color:var(--metric-color);background:color-mix(in srgb,var(--metric-color) 12%,transparent);font-size:22px;overflow:hidden}
.rd-dashboard-metric strong{grid-column:1/-1;font-size:clamp(1.2rem,13cqw,var(--hrmc-fs-display,1.75rem));line-height:1.15;white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.rd-dashboard-metric strong.is-long{font-size:clamp(1.05rem,10.5cqw,1.5rem)}
.rd-dashboard-metric small{grid-column:1/-1;color:var(--hrmc-text-muted);line-height:1.4}
.rd-dashboard-metric>small:first-child{grid-column:1;grid-row:1;align-self:center;font-weight:var(--hrmc-fw-semi,600)}
.metric-teal{--metric-color:var(--hrmc-status-success-text)}.metric-blue{--metric-color:var(--hrmc-status-info-text)}.metric-red{--metric-color:var(--hrmc-status-danger-text)}.metric-amber{--metric-color:var(--hrmc-status-warning-text)}
.rd-dashboard-columns{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:var(--hrmc-s5,24px);margin:0 0 var(--hrmc-s5,24px);align-items:start}
.rd-stock-dashboard section{padding:0;border-top:0}
.rd-stock-dashboard>section{margin-bottom:var(--hrmc-s5,24px)}
.rd-stock-dashboard>section,.rd-stock-dashboard .rd-dashboard-columns>section{background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1);padding:var(--hrmc-s4,16px) var(--rd-card-pad,24px);min-width:0}
.rd-stock-dashboard>section>h2,.rd-stock-dashboard .rd-dashboard-columns>section>h2{margin:0 0 var(--hrmc-s2,8px);padding-bottom:var(--hrmc-s3,12px);border-bottom:1px solid var(--hrmc-border)}
.rd-stock-dashboard>section .rd-table{border:0;box-shadow:none;border-radius:0}
.rd-stock-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px var(--hrmc-s3,12px);padding:var(--hrmc-s3,12px) 0;text-decoration:none;color:inherit;border-bottom:1px solid var(--hrmc-border)}
.rd-stock-bar:last-child{border-bottom:0}
.rd-stock-bar:hover>span:first-child{color:var(--hrmc-brand-hover)}
.rd-stock-bar>span:first-child{overflow-wrap:anywhere}
.rd-stock-bar strong{font-variant-numeric:tabular-nums;white-space:nowrap}
.rd-stock-bar strong small{margin-inline-start:var(--hrmc-s2,8px);color:var(--hrmc-text-muted);font-weight:400}
.rd-stock-track{grid-column:1/-1;height:8px;background:var(--hrmc-surface-muted);border-radius:var(--hrmc-r-pill,999px);overflow:hidden}
.rd-stock-track i{display:block;height:100%;min-width:2px;background:var(--hrmc-brand);border-radius:inherit}
.rd-dashboard-queues a{display:grid;grid-template-columns:32px minmax(0,1fr) auto 20px;align-items:center;gap:var(--hrmc-s3,12px);padding:var(--hrmc-s3,12px) var(--hrmc-s2,8px);margin:0 calc(-1*var(--hrmc-s2,8px));border-bottom:1px solid var(--hrmc-border);color:inherit;text-decoration:none;border-radius:var(--hrmc-r-control,6px)}
.rd-dashboard-queues a:last-child{border-bottom:0}
.rd-dashboard-queues a:hover{background:var(--hrmc-surface-muted);color:var(--hrmc-brand-hover)}
.rd-dashboard-queues a:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:-2px}
.rd-dashboard-queues a>strong{min-width:32px;padding:2px 10px;text-align:center;border-radius:var(--hrmc-r-pill,999px);background:var(--hrmc-surface-muted);color:var(--hrmc-text-muted);font-variant-numeric:tabular-nums}
.rd-dashboard-queues a.has-items>strong{background:var(--hrmc-status-warning-bg);color:var(--hrmc-status-warning-text)}
.rd-dashboard-queues a>.material-symbols-outlined:last-child{color:var(--hrmc-text-muted)}
.rd-dashboard-clear{margin:var(--hrmc-s3,12px) 0 0;color:var(--hrmc-status-success-text);font-size:var(--hrmc-fs-small,12.5px)}
.rd-dashboard-pager{display:flex;justify-content:space-between;align-items:center;padding:var(--hrmc-s3,12px) 0 0;gap:var(--hrmc-s3,12px);color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px)}
.rd-flow-kind{display:block;color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-caption,11px);margin-top:4px}
.rd-dashboard-item{display:flex;gap:var(--hrmc-s5,24px);align-items:center;flex-wrap:wrap;padding:var(--hrmc-s4,16px) 0;border-bottom:1px solid var(--hrmc-border)}
.rd-dashboard-item span,.rd-dashboard-item small{display:block}
.rd-stock-dashboard .rd-table{max-width:100%;overflow:auto}
.rd-stock-dashboard table{min-width:720px}
.rd-stock-tree-actions{margin:0 0 var(--hrmc-s3,12px)}
.rd-stock-dashboard .rd-stock-tree{min-width:1180px;table-layout:auto}
.rd-stock-tree th:first-child{width:32%}
.rd-stock-tree-name{display:flex;align-items:center;gap:var(--hrmc-s1,6px);padding-inline-start:calc(var(--stock-depth)*var(--hrmc-s5,24px));min-width:240px}
.rd-stock-tree [data-stock-store],.rd-stock-tree [data-stock-last-date],.rd-stock-tree td:nth-child(4){white-space:nowrap}
.rd-stock-tree-toggle,.rd-stock-tree-leaf{flex:0 0 28px;width:28px;height:28px}
.rd-stock-tree-toggle{display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;border-radius:4px}
.rd-stock-tree-toggle:hover{background:var(--hrmc-surface-muted)}
.rd-stock-tree-toggle:focus-visible{outline:2px solid var(--hrmc-brand)}
.rd-stock-tree-toggle[aria-expanded=true] .material-symbols-outlined{transform:rotate(90deg)}
.rd-stock-tree [data-stock-depth="1"]{font-weight:var(--hrmc-fw-bold,700)}
.rd-stock-tree [data-stock-depth="2"],.rd-stock-tree [data-stock-depth="3"]{font-weight:var(--hrmc-fw-semi,600)}
.rd-stock-tree [hidden]{display:none!important}
/* Item status dialog (dashboard) */
.rd-item-status-link{border:0;background:transparent;padding:0;color:var(--hrmc-brand-hover);font:inherit;font-weight:var(--hrmc-fw-semi,600);text-align:start;cursor:pointer}
.rd-item-status-link:hover{text-decoration:underline}
.rd-item-status-link:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:3px}
.rd-item-status{width:min(900px,calc(100vw - 24px));max-height:90vh;padding:0;border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);background:var(--hrmc-surface);color:var(--hrmc-text);box-shadow:var(--hrmc-e3);overflow:auto}
.rd-item-status::backdrop{background:rgb(18 33 38 / 55%)}
.rd-item-status>.rd-toolbar,.rd-item-status>footer{padding:var(--hrmc-s4,16px) var(--rd-card-pad);margin:0;border-bottom:1px solid var(--hrmc-border)}
.rd-item-status>.rd-toolbar small,.rd-item-status>.rd-toolbar strong{display:block;margin-top:var(--hrmc-s1,4px)}
.rd-stock-dashboard .rd-item-status>.rd-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start}
.rd-stock-dashboard .rd-item-status>.rd-toolbar>div{display:block;min-width:0}
.rd-stock-dashboard .rd-item-status>.rd-toolbar h2{margin:0 0 var(--hrmc-s2,8px)}
.rd-item-stock-levels{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0;border-bottom:1px solid var(--hrmc-border)}
.rd-item-stock-levels>div{padding:var(--hrmc-s4,16px);border-top:3px solid var(--hrmc-status-danger-text)}
.rd-item-stock-levels>div:nth-child(2){border-color:var(--hrmc-status-info-text)}
.rd-item-stock-levels>div:nth-child(3){border-color:var(--hrmc-status-success-text)}
.rd-item-stock-levels>div:nth-child(4){border-color:var(--hrmc-brand)}
.rd-item-stock-levels dt{font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-text-muted)}
.rd-item-stock-levels dd{margin:var(--hrmc-s2,8px) 0 0;font-size:var(--hrmc-fs-title,20px);font-weight:700;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.rd-item-status-body{padding:var(--hrmc-s4,16px) var(--rd-card-pad)}
.rd-item-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--hrmc-s4,16px);margin:0 0 var(--hrmc-s5,24px)}
.rd-item-facts>div{display:flex;justify-content:space-between;gap:var(--hrmc-s3,12px);border-bottom:1px solid var(--hrmc-border);padding-bottom:var(--hrmc-s2,8px)}
.rd-item-facts dt{color:var(--hrmc-text-muted)}.rd-item-facts dd{margin:0;text-align:end;font-weight:600;overflow-wrap:anywhere}
.rd-item-fact-wide{grid-column:1/-1}
.rd-item-status h3{font-size:var(--hrmc-fs-lead,16px);margin:0 0 var(--hrmc-s3,12px)}
.rd-item-status h3 small{display:block;color:var(--hrmc-text-muted);font-weight:400}
.rd-stock-dashboard .rd-item-status table{min-width:480px}
.rd-item-status>footer{border-bottom:0;border-top:1px solid var(--hrmc-border);display:flex;justify-content:flex-end}
/* Discount schemes, report settings, role button access */
.rd-discount-rule{padding:var(--hrmc-s4,16px) 0;border-top:1px solid var(--hrmc-border)}
.rd-discount-rule:first-of-type{border-top:0;padding-top:0}
.rd-discount-rule .rd-toolbar{margin-bottom:var(--hrmc-s3,12px)}
.rd-discount-rule h2{font-size:var(--hrmc-fs-body,14px);margin:0}
.rd-commercial-editor.rd-discount-editor{background:transparent;border:0;box-shadow:none;padding:0}
.rd-discount-editor .rd-scheme-section{padding:20px 0;border-bottom:1px solid var(--hrmc-border)}
.rd-discount-editor h2{font-size:16px;line-height:1.4;margin:0 0 16px}
.rd-discount-editor .rd-discount-rules-heading{margin:24px 0 16px}
.rd-discount-editor .rd-scheme-eligibility{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.rd-discount-editor fieldset.rd-scope-fields,.rd-discount-editor fieldset.rd-rule-scope{padding:0;margin:0;border:0;min-width:0}
.rd-discount-editor .rd-scope-fields legend,.rd-discount-editor .rd-rule-scope legend{font-size:14px;font-weight:600;padding:0;margin-bottom:12px}
.rd-discount-editor .rd-scope-fields .rd-fields{grid-template-columns:1fr}
.rd-discount-editor .rd-discount-rule{padding:16px;margin:0 0 16px;border:1px solid var(--hrmc-border);border-radius:6px;background:var(--hrmc-surface,#fff)}
.rd-discount-editor .rd-discount-rule>.rd-toolbar{padding:0 0 12px;border-bottom:2px solid var(--hrmc-brand);margin-bottom:16px}
.rd-discount-editor .rd-discount-rule h3{font-size:14px;margin:0;font-weight:600}
.rd-discount-editor fieldset.rd-rule-scope{border-top:1px solid var(--hrmc-border);margin-top:20px;padding-top:12px}
.rd-discount-editor .rd-rule-scope .rd-discount-eligibility{margin-top:0}
@media(max-width:700px){.rd-discount-editor .rd-scheme-eligibility{grid-template-columns:1fr}.rd-discount-editor .rd-discount-rule{padding:12px}}
.rd-commercial-editor .rd-discount-calculation{grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr))}
.rd-commercial-editor .rd-discount-eligibility{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:var(--hrmc-s4,16px)}
.rd-report-settings-fields{border:0;padding:0;min-width:0}
.rd-report-toggles{display:flex;flex-wrap:wrap;gap:var(--hrmc-s3,12px) var(--hrmc-s5,24px);margin:var(--hrmc-s4,16px) 0}
.rd-content .rd-report-toggles label{display:flex;flex-direction:row;gap:var(--hrmc-s2,8px);align-items:center;font-size:var(--hrmc-fs-body,14px);color:var(--hrmc-text);font-weight:var(--hrmc-fw-normal,400);min-height:var(--rd-control-h)}
.rd-report-toggles input[type=checkbox]{width:18px;height:18px;accent-color:var(--hrmc-brand-strong)}
.rd-report-settings-fields details{margin-bottom:var(--hrmc-s4,16px)}
.rd-button-access{margin-top:var(--hrmc-s5,24px)}
.rd-button-access-options{display:flex;flex-wrap:wrap;gap:var(--hrmc-s2,8px) var(--hrmc-s4,16px)}
.rd-button-access-options label{white-space:nowrap}
.rd-button-access th[scope="row"]{min-width:10rem;vertical-align:top}
.rd-button-access details{margin-bottom:var(--hrmc-s4,16px)}
.rd-role-row-tools{display:flex;gap:4px;margin-top:8px;flex-wrap:wrap}
@media(max-width:640px){
 .rd-button-access table,.rd-button-access tbody,.rd-button-access tr,.rd-button-access th[scope="row"],.rd-button-access td{display:block;width:100%;box-sizing:border-box}
 .rd-button-access thead{display:none}
 .rd-button-access th[scope="row"]{min-width:0;white-space:normal}
 .rd-button-access-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 8px}
 .rd-button-access-options label{white-space:normal;overflow-wrap:anywhere;min-width:0}
}
/* Sales pricing */
[data-sales-pricing] .rd-table table{min-width:650px}
[data-sales-pricing] [data-sales-item]{min-width:210px}[data-sales-pricing] [data-sales-unit]{min-width:150px}[data-sales-pricing] [data-sales-qty]{min-width:100px}
[data-sales-result]{min-width:0}[data-sales-result] .rd-table{overflow-x:auto;max-width:100%;margin-bottom:var(--hrmc-s4,16px)}[data-sales-result] table{min-width:760px}
[data-sales-result] th,[data-sales-result] td{overflow-wrap:normal;word-break:normal}[data-sales-result] td{white-space:nowrap;font-variant-numeric:tabular-nums}
[data-sales-result] td:first-child{white-space:normal;min-width:70px}
[data-sales-result] .rd-sales-prices{min-width:1120px}[data-sales-result] .rd-sales-prices td:first-child{min-width:200px;max-width:260px}[data-sales-result] .rd-sales-prices td:nth-child(n+3){text-align:end}
[data-sales-result] details{border-top:1px solid var(--hrmc-border);padding-top:var(--hrmc-s2,8px)}[data-sales-result] summary{cursor:pointer;padding:var(--hrmc-s2,8px) 0;font-weight:var(--hrmc-fw-semi,600)}
/* Checkbox labels written as text + box (not .rd-check) still read as a row. */
.hrmc-body .rd-content label:has(>input[type=checkbox]):not(.rd-check):not(.rd-theme-swatch),.hrmc-body .rd-content label:has(>input[type=radio]):not(.rd-check):not(.rd-segmented label){flex-direction:row-reverse;justify-content:flex-start;align-items:center;gap:var(--hrmc-s2,8px);font-weight:var(--hrmc-fw-normal,400);font-size:var(--hrmc-fs-body,14px);color:var(--hrmc-text);min-height:var(--rd-control-h);cursor:pointer}
.hrmc-body .rd-content label:has(>input[type=checkbox]:first-child):not(.rd-check):not(.rd-theme-swatch),.hrmc-body .rd-content label:has(>input[type=radio]:first-child):not(.rd-check):not(.rd-segmented label){flex-direction:row;justify-content:flex-start}
.hrmc-body .rd-content label:has(>input[type=checkbox]):not(.rd-check)>input[type=checkbox],.hrmc-body .rd-content label:has(>input[type=radio]):not(.rd-check)>input[type=radio]{width:18px;height:18px;flex-shrink:0;accent-color:var(--hrmc-brand-strong);margin:0}
/* A fieldset of radios reads as one row of choices under its legend. */
/* .rd-quantity-mode and .rd-segmented already lay themselves out (a floated legend inside a
   toolbar row); taking them over here squeezed the purchase order's toolbar past the paper. */
.rd-content fieldset:has(>label>input[type=radio]):not(.rd-quantity-mode):not(.rd-segmented){display:flex;flex-wrap:wrap;align-items:center;gap:var(--hrmc-s2,8px) var(--hrmc-s4,16px)}
.rd-content fieldset:has(>label>input[type=radio]):not(.rd-quantity-mode):not(.rd-segmented)>legend{flex:0 0 100%;float:none}
.rd-fields>fieldset:has(>label>input[type=radio]){align-content:start}
.rd-fields>label:has(>input[type=checkbox]),.rd-fields>label:has(>input[type=radio]){align-self:end}
/* Paper documents (vouchers, certificates, print previews) stay light. */
.fin-voucher,.fin-certificate,.rd-print-document{color-scheme:light}

/* ------------------------------------------------- module surfaces, part 2 -- */
/* Operations pages added after the first consolidation (stocktaking, purchase
   matching, cost recalculation, finance operations, sales growth, support).
   These rules are shape-based, so a new page written the same way inherits them. */

/* Any page-level nav of links whose class ends in -tabs is a tab strip. */
.rd-content nav[class$="-tabs"],.rd-content nav[class*="-tabs "],.fin-op-tabs,.rd-growth-tabs{display:flex;flex-wrap:nowrap;gap:var(--hrmc-s1,4px);border-bottom:1px solid var(--hrmc-border);margin:0 0 var(--hrmc-s5,24px);overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding:0}
.rd-content nav[class$="-tabs"]>a,.fin-op-tabs>a,.rd-growth-tabs>a{display:inline-flex;align-items:center;gap:6px;padding:var(--hrmc-s3,12px);color:var(--hrmc-text-muted);text-decoration:none;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;background:transparent;font:inherit;font-weight:var(--hrmc-fw-medium,500);white-space:nowrap;border-radius:var(--hrmc-r-control,6px) var(--hrmc-r-control,6px) 0 0;transition:color .15s ease,background .15s ease}
.rd-content nav[class$="-tabs"]>a:hover,.fin-op-tabs>a:hover,.rd-growth-tabs>a:hover{color:var(--hrmc-text);background:var(--hrmc-surface-muted)}
.rd-content nav[class$="-tabs"]>a[aria-current=page],.fin-op-tabs>a[aria-current=page],.rd-growth-tabs>a[aria-current=page]{border-bottom-color:var(--hrmc-brand);color:var(--hrmc-brand-hover);font-weight:var(--hrmc-fw-semi,600)}

/* A posting form that carries its own field group is a card, unless it is one of
   the document editors that already owns its layout. */
.rd-content form[method="post"]:has(>.rd-fields):not(.rd-editor):not([data-purchase-editor]):not([data-inventory-editor]):not([data-fin-form]):not([data-sales-editor]):not([data-workspace-settings]):not([data-stock-setup]):not(.rd-company-profile),
.rd-content form[method="post"]:has(>fieldset>.rd-fields):not(.rd-editor):not([data-purchase-editor]):not([data-inventory-editor]):not([data-fin-form]):not([data-sales-editor]):not(.rd-company-profile),
.rd-content>section>form[method="post"]:has(>.rd-fields),
.rd-content [data-count-grid],
.rd-recost-review{background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1);padding:var(--rd-card-pad);margin:0 0 var(--hrmc-s4,16px)}
.rd-content form[method="post"]:has(>.rd-fields)>h2,
.rd-content form[method="post"]:has(>fieldset>.rd-fields)>h2,
.rd-content [data-count-grid]>h2,.rd-recost-review>.rd-toolbar:first-child{margin:0 0 var(--hrmc-s4,16px);padding-bottom:var(--hrmc-s3,12px);border-bottom:1px solid var(--hrmc-border);font-size:var(--hrmc-fs-lead,16px)}
.rd-content form[method="post"]:has(>.rd-fields)>.rd-actions,
.rd-content form[method="post"]:has(>fieldset>.rd-fields)>.rd-actions{margin-top:var(--hrmc-s4,16px)}
.rd-content form[method="post"]:has(>.rd-fields)>.rd-table,
.rd-content [data-count-grid]>.rd-table{border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);box-shadow:none;margin:var(--hrmc-s4,16px) 0 0}
.rd-content [data-count-grid]>.rd-toolbar:first-child{margin-bottom:var(--hrmc-s3,12px)}
/* A heading that introduces a card should not also sit inside one. */
.rd-content>section>h2,.rd-content>h2:not(:first-child){margin-top:var(--hrmc-s5,24px)}

/* Disclosure blocks used as settings panels on these pages. */
.rd-content>section>details:not([class]),.rd-content>details:not([class]){background:var(--hrmc-surface);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);box-shadow:var(--hrmc-e1);padding:0;margin:0 0 var(--hrmc-s4,16px);overflow:hidden}
.rd-content>section>details:not([class])>summary,.rd-content>details:not([class])>summary{display:flex;align-items:center;gap:var(--hrmc-s2,8px);margin:0;padding:var(--hrmc-s3,12px) var(--rd-card-pad);cursor:pointer;list-style:none;font-size:var(--hrmc-fs-lead,16px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text);user-select:none}
.rd-content>section>details:not([class])>summary::-webkit-details-marker,.rd-content>details:not([class])>summary::-webkit-details-marker{display:none}
.rd-content>section>details:not([class])>summary::before,.rd-content>details:not([class])>summary::before{content:"chevron_right";font-family:"Material Symbols","Material Symbols Outlined";font-feature-settings:"liga";font-weight:400;font-style:normal;line-height:1;font-size:22px;color:var(--hrmc-text-muted);transition:transform .2s ease;flex:none}
.rd-content>section>details:not([class])[open]>summary::before,.rd-content>details:not([class])[open]>summary::before{transform:rotate(90deg)}
.rd-content>section>details:not([class])[open]>summary,.rd-content>details:not([class])[open]>summary{border-bottom:1px solid var(--hrmc-border)}
.rd-content>section>details:not([class])>:not(summary),.rd-content>details:not([class])>:not(summary){margin:var(--hrmc-s4,16px) var(--rd-card-pad)}
.rd-content>section>details:not([class])>form,.rd-content>details:not([class])>form{margin:0;padding:var(--rd-card-pad);background:transparent;border:0;box-shadow:none}
/* The padded-card model earlier in this file gives a direct-child <details> a -24px summary margin and
   bottom padding when closed. This block is the one that wins for these panels (padding:0,
   overflow:hidden), so those two properties are reset here - left in place, the summary was pulled
   24px above the panel and clipped ("New fiscal year", "Pending documents"). */
.rd-content>details:not([class]):not([open]){padding-bottom:0}
.rd-content>details:not([class])[open]>summary{margin-bottom:0}

/* Client-side pager shared by the count grids. */
.rd-count-pager{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:var(--hrmc-s3,12px);padding:var(--hrmc-s3,12px) 0 0;color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px)}
.rd-count-pager [data-count-page]{font-variant-numeric:tabular-nums;order:-1;margin-inline-end:auto}
.hrmc-body .rd-content .rd-count-pager label{flex-direction:row;align-items:center;gap:var(--hrmc-s2,8px);margin:0;min-height:0}
.rd-count-pager select{width:auto;min-width:5rem}
.rd-count-pager .rd-icon{width:34px;min-height:34px}

/* Page section wrappers keep the shared type scale. */
.rd-stocktake h1,.fin-operations h1,.rd-recost h1,.rd-growth h1{font-size:var(--hrmc-fs-title,20px)}
.rd-stocktake h2,.fin-operations h2,.rd-recost h2,.rd-growth h2,.rd-content>section>h2{font-size:var(--hrmc-fs-lead,16px)}
.rd-stocktake h3,.fin-operations h3,.rd-recost h3,.rd-growth h3{font-size:var(--hrmc-fs-body,14px)}
.rd-stocktake .rd-toolbar,.fin-operations .rd-toolbar,.rd-recost .rd-toolbar,.rd-growth .rd-toolbar{flex-wrap:wrap}
.rd-content>section>.rd-toolbar:first-child{min-height:44px;margin:0 0 var(--hrmc-s5,24px);padding-bottom:var(--hrmc-s4,16px);border-bottom:1px solid var(--hrmc-border)}
.rd-content>section>.rd-toolbar:first-child h1{margin:0}
.rd-content>section>.rd-toolbar:first-child>span{color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,12.5px)}

/* ------------------------------------------------------------ responsive -- */
@media(max-width:1100px){
    .rd-profile-layout{grid-template-columns:1fr}
    .rd-profile-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
    .rd-profile-logo{max-width:280px}
}
@media(max-width:900px){
    .rd-access-columns{grid-template-columns:1fr}
    .rd-split{grid-template-columns:1fr}
    .rd-split>section+section{padding-inline-start:var(--rd-card-pad)}
}
@media(max-width:768px){
    :root{--rd-card-pad:var(--hrmc-s4,16px)}
    /* The phone menu is an overlay: dim the page behind it and keep the sheet above the scrim. */
    .hrmc-shell.is-menu-pinned::before{content:"";position:fixed;inset:0;background:rgb(18 33 38 / 55%);z-index:1399;backdrop-filter:blur(1px)}
    .hrmc-shell.is-menu-pinned .hrmc-sidebar{box-shadow:var(--hrmc-e3)}
    .hrmc-sidebar-label{display:none}
    .rd-content{padding:var(--hrmc-s4,16px)}
    .rd-toolbar:has(>h1,>div>h1),.rd-document-header{margin-bottom:var(--hrmc-s4,16px);padding-bottom:var(--hrmc-s3,12px)}
    .rd-document-buttons{width:100%;justify-content:flex-start}
    .rd-document-buttons .rd-primary,.rd-document-buttons .rd-button,.rd-actions .rd-primary,.rd-actions .rd-button{flex:1 1 auto}
    .rd-fields,.rd-editor .rd-fields,.rd-master-editor .rd-fields,.rd-editor[data-purchase-editor] .rd-fields,[data-inventory-editor] .rd-fields,.rd-stock-fields .rd-fields,.rd-commercial-editor .rd-fields,.rd-document-filters .rd-fields,.rd-attachment-modal .rd-fields,.rd-source-picker .rd-fields{grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:var(--hrmc-s3,12px) var(--hrmc-s4,16px)}
    .rd-master-filters input,.rd-master-filters select{flex:1 1 100%;max-width:100%}
    .rd-auth{padding:var(--hrmc-s5,24px) var(--hrmc-s4,16px)}
    .hrmc-account-name{display:none}
    .hrmc-workspace{max-width:170px}
    .hrmc-workspace strong{white-space:normal;overflow-wrap:anywhere}
    .rd-po-totals dl>div:last-child{grid-column:1/-1}
    .rd-comparison-filter,.rd-award-footer{flex-direction:column;align-items:stretch}
    .rd-comparison-filter label{width:100%}
    .rd-lot-dialog[open]{padding:0}
    .rd-lot-dialog .rd-toolbar{flex-wrap:wrap;gap:10px}
    .rd-links{grid-template-columns:1fr}
    .rd-home-hero{padding:var(--hrmc-s4,16px) var(--hrmc-s4,18px)}
    .rd-settings{width:min(340px,100vw)}
    .rd-po-line-toolbar>.rd-button{margin-inline-start:0;width:100%}
    .rd-po-line-toolbar label:not(.rd-check){flex:1 1 140px}
    .fin-dashboard-columns,.rd-dashboard-columns{grid-template-columns:1fr}
    .rd-item-stock-levels{grid-template-columns:repeat(2,minmax(0,1fr))}
    .rd-item-facts{grid-template-columns:1fr}
    .rd-commercial-editor .rd-discount-eligibility{grid-template-columns:1fr}
}
@media(max-width:600px){
    .rd-profile-fields{grid-template-columns:1fr}
    .rd-profile-address{grid-column:auto}
    .rd-document-buttons .rd-icon{flex:0 0 auto}
    .rd-content th,.rd-content td{padding:var(--hrmc-s2,10px) var(--hrmc-s3,12px)}
    .rd-toolbar>div:not([class]),.rd-actions{width:100%}
    .rd-editor>.rd-toolbar:last-child .rd-primary,.rd-editor>.rd-toolbar:last-child .rd-button{flex:1 1 auto}
    .rd-source-results summary span{display:block;margin:4px 0}
    .rd-source-footer{gap:var(--hrmc-s3,12px);flex-wrap:wrap}
}
@media(min-width:1700px){
    .rd-profile-fields{grid-template-columns:repeat(6,minmax(0,1fr))}
    .rd-profile-address{grid-column:span 3}
}

/* ----------------------------------------------------------------- print -- */
@media print{
    .hrmc-header,.hrmc-sidebar,.rd-master-tabs,.fin-tabs,.rd-dashboard-tabs,.crm-nav,.rd-breadcrumb,.rd-toast-region,.rd-purchase-actions,.rd-primary,.rd-button,.rd-icon,.rd-actions,.rd-select-search,.rd-option-search,.rd-document-filters,.rd-settings,.rd-settings-backdrop,.rd-settings-trigger,.rd-comparison-filter,[data-compare-search],.rd-award-footer button,.rd-document-buttons{display:none!important}
    /* Alerts, warnings and notices speak to the person at the screen. They are never part of a printed report or
       document; anything a reader of the paper must know (a project filter, a currency book) belongs in its heading. */
    .rd-alert,.fin-warning{display:none!important}
    /* The one exception is a mark that belongs to the document itself: a voucher printed before posting must say so. */
    .fin-voucher .fin-warning{display:flex!important}
    /* A report that prints its own heading (company, title, what it covers) does not also print the screen's page title. */
    body:has(.osr-print-head) .rd-document-header,body:has([data-desk-report]) .rd-document-header{display:none!important}
    /* "Print" on one table of a report: that table alone under the report's heading (see PrintBlockButton). */
    .rd-print-block{display:none!important}
    body.rd-print-one [data-print-block]:not(.rd-print-target),body.rd-print-one .osr-counts,body.rd-print-one .osr:not(:has(.rd-print-target)){display:none!important}
    .hrmc-body{margin:0!important}
    .rd-content{padding:0;max-width:none}
    .rd-card,.rd-editor,.rd-document-region,.rd-table,[data-purchase-editor]>fieldset>.rd-fields{box-shadow:none;border-color:#bbb;break-inside:avoid}
    .rd-purchase-lines,.rd-table{overflow:visible}
    /* Line grids are sized for a scrolling viewport (width:max-content plus a min-width);
       on paper that runs off the sheet, so every grid folds back to the page width. */
    /* Fixed layout makes the columns share the sheet instead of growing to their content,
       which is what kept a 20-column purchase order 2.7x wider than the page. */
    .rd-content table,.rd-content .rd-table table{width:100%!important;min-width:0!important;table-layout:fixed}
    .rd-purchase-lines table,.rd-inventory-lines,.rd-sales-grid table,.fin-lines table,.rd-offer-table,.rd-stock-tree,.tr-output table{font-size:9px}
    /* Fixed layout honours explicit column widths, and the screen grid sets several; clearing
       them lets the columns share the sheet. The grids also keep their headings on one line
       on screen, where columns are wide - on paper an 86px column cannot hold
       "Specification / Remarks", and the heading ran straight over its neighbours, so
       wrapping wins here regardless of the screen rule. */
    .rd-content th,.rd-content td{padding:4px 5px;overflow-wrap:anywhere;white-space:normal!important;min-width:0!important;width:auto!important;max-width:none!important;vertical-align:top}
    /* Data may be one long unbroken code, so cells break anywhere; a heading is words. With
       17 columns on a fixed layout each gets ~86px, which the body size cannot hold, so the
       heading steps down one notch and breaks between words rather than through them. */
    .rd-content th{overflow-wrap:break-word;font-size:10px!important;line-height:1.25;letter-spacing:0}
    /* A 17-column line grid on A4 gives each column ~86px. At body size the values break
       through the middle of words; one notch down they fit on a line. */
    .rd-content .rd-table td,.rd-content .rd-table td input,.rd-content .rd-table td select,
    .rd-content .rd-table td .rz-dropdown-label{font-size:10px!important;line-height:1.3}
    .rd-content td.rd-num,.rd-content th.rd-num{white-space:nowrap}
    .rd-content td,.rd-content th,.rd-line-actions,.rd-sales-line-actions,.rd-inventory-lines td:first-child,.rd-inventory-lines td:nth-child(2),.rd-offer-table td:first-child,.rd-offer-table td:nth-child(2){position:static!important;box-shadow:none!important}
    /* Checkboxes and radios are 18px controls, not fields: stretching them to the column
       width left no room for their own label text and pushed the sheet past the paper. */
    .rd-content input:not([type=checkbox]):not([type=radio]),.rd-content select:not(.rd-lookup-native),.rd-content textarea{width:100%!important;min-width:0!important;border:0!important;padding:0!important;background:transparent!important}
    .rd-content input[type=checkbox],.rd-content input[type=radio]{width:18px!important;height:18px!important;flex:0 0 auto}
    /* The 1px native select behind each lookup must stay out of the flow, or the width reset
       above stretches it across the sheet. */
    .rd-lookup-native{display:none!important}
    /* Lookup hosts carry fixed screen widths (220-280px) that no longer fit a shared column. */
    .rd-content .rd-lookup-host,.rd-content .rd-lookup-host .rz-dropdown{display:block!important;width:100%!important;min-width:0!important;max-width:none!important}
    /* Radzen truncates its own label with an ellipsis, which on paper prints the chosen
       supplier as "S...". Paper has no hover, so the value has to be shown in full. */
    .rd-content .rz-dropdown-label,.rd-content .rz-dropdown-label.rz-inputtext{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;padding:0!important}
    .rd-content .rd-lookup-host .rz-dropdown{height:auto!important;min-height:0!important;overflow:visible!important;align-items:flex-start;padding:0!important;border:0!important;background:transparent!important}
    .rd-content .rz-dropdown-trigger,.rd-content .rz-helper-hidden-accessible{display:none!important}
    /* Card children are inset by the card padding on screen; on paper the sheet margin does
       that job, and the inset pushed full-width fields past the edge. */
    .rd-document-region>details>:not(summary),.rd-document-region>:not(details):not(h2),.rd-content>section>details:not([class])>:not(summary){margin-inline-start:0!important;margin-inline-end:0!important}
    .rd-content thead{display:table-header-group}
    .rd-content tr{break-inside:avoid}
    .rd-offer-table{min-width:0;font-size:10px}
    .rd-comparison-item{break-inside:avoid}
    .rd-comparison-item .rd-table{overflow:visible}
    .rd-document-region details:not([open])>:not(summary){display:block}
    .rd-chip,.rd-alert,.rd-po-totals dl>div{print-color-adjust:exact;-webkit-print-color-adjust:exact}
}

/* ---------------------------------------------------------------- motion -- */
/* Keep eight integer digits plus six decimal places readable in entry grids. */
@media screen{
    .hrmc-shell .rd-content table input[type=number]{
        width:calc(16ch + 48px);min-width:calc(16ch + 48px);max-width:none;
        box-sizing:border-box;flex-shrink:0;text-align:end;font-variant-numeric:tabular-nums;
    }
    .hrmc-shell .rd-content table td:has(input[type=number]){min-width:calc(16ch + 48px)}
    .hrmc-shell .rd-content table td.rd-num{min-width:12ch;white-space:nowrap}
}
/* Header: brand | workspace | settings | search | account. The columns collapse in
   three steps so the company name and the search stay reachable at every width. */
.hrmc-shell .hrmc-header-content,.hrmc-shell.is-menu-pinned .hrmc-header-content{grid-template-columns:300px minmax(160px,1fr) 40px minmax(200px,360px) auto;gap:var(--hrmc-s4,16px);align-items:center}
.rd-menu-search{display:flex;align-items:center;gap:8px;min-width:0}
.rd-menu-search>.material-symbols-outlined{flex:none;font-size:20px;color:var(--hrmc-text-muted)}
.rd-menu-search select,.rd-menu-search .rd-lookup-host{width:100%;min-width:0}
.rd-menu-search .rz-dropdown{width:100%;min-width:0}
.rd-menu-search select{min-height:38px;padding:0 2rem 0 var(--hrmc-s3,12px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-pill,999px);background:var(--hrmc-surface-muted);color:var(--hrmc-text);font:inherit;font-size:var(--hrmc-fs-body,14px)}
.rd-menu-search .rz-dropdown{border-radius:var(--hrmc-r-pill,999px);background:var(--hrmc-surface-muted)}
.rd-menu-finder{position:relative;width:100%;min-width:0}
.rd-menu-finder input{width:100%;min-width:0;min-height:38px;box-sizing:border-box;padding:0 var(--hrmc-s3,12px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-pill,999px);background:var(--hrmc-surface-muted);color:var(--hrmc-text);font:inherit;font-size:var(--hrmc-fs-body,14px)}
.rd-menu-finder input:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:2px}
.rd-menu-results{position:absolute;top:calc(100% + 6px);left:0;right:0;z-index:1500;max-height:min(360px,60vh);overflow:auto;overscroll-behavior:contain;background:var(--hrmc-surface);color:var(--hrmc-text);border:1px solid var(--hrmc-border);border-radius:6px;box-shadow:0 5px 18px var(--hrmc-border)}
.rd-menu-results [role=option],.rd-menu-results p{margin:0;padding:10px 12px;font-size:var(--hrmc-fs-body,14px);line-height:1.4;overflow-wrap:anywhere;white-space:normal}
.rd-menu-results [role=option]{cursor:pointer}
.rd-menu-results [role=option]:hover,.rd-menu-results [aria-selected=true]{background:var(--hrmc-brand-soft);color:var(--hrmc-brand-hover)}
.rd-menu-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:1200px){
    .hrmc-shell .hrmc-header-content,.hrmc-shell.is-menu-pinned .hrmc-header-content{grid-template-columns:72px minmax(140px,1fr) 40px minmax(160px,300px) auto;gap:var(--hrmc-s3,12px)}
    .hrmc-shell .hrmc-header .hrmc-brand{justify-content:center;padding:0}
    .hrmc-shell .hrmc-header .hrmc-brand>span:last-child{display:none}
    .hrmc-account-name{display:none}
}
@media(max-width:900px){
    .hrmc-shell .hrmc-header-content,.hrmc-shell.is-menu-pinned .hrmc-header-content{grid-template-columns:72px minmax(0,1fr) 40px auto;grid-template-rows:auto auto;padding:0 var(--hrmc-s3,12px) var(--hrmc-s2,8px) 0;row-gap:var(--hrmc-s2,8px)}
    .hrmc-shell .hrmc-header .hrmc-brand{grid-row:1/3;align-self:stretch}
    .rd-menu-search{grid-column:2/-1;grid-row:2}
    .hrmc-shell .hrmc-header{height:auto!important}
    .hrmc-workspace strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:768px){
    /* hrmc.css hides the wordmark and reserves 64px for the menu toggle; keep the company
       name visible next to it and give the search its own row. */
    .hrmc-shell .hrmc-header-content,.hrmc-shell.is-menu-pinned .hrmc-header-content{grid-template-columns:minmax(0,1fr) 40px auto!important;grid-template-rows:auto auto;padding:var(--hrmc-s2,8px) var(--hrmc-s3,12px) var(--hrmc-s2,8px) 64px!important;row-gap:var(--hrmc-s2,8px)}
    .hrmc-shell .hrmc-workspace{display:flex!important;min-width:0}
    .hrmc-shell .hrmc-workspace small{display:none}
    .hrmc-shell .hrmc-workspace strong{font-size:var(--hrmc-fs-body,14px)}
    .rd-menu-search{grid-column:1/-1;grid-row:2}
    .hrmc-shell.is-menu-pinned .hrmc-body::before{content:none}
}
@media print{.rd-menu-search{display:none}}
@media(prefers-reduced-motion:reduce){
    .rd-content *,.rd-nav *,.rd-links a,.rd-settings{transition:none!important;animation:none!important}
}
/* Order status panels follow the workspace theme and dark mode like every other surface; they
   were a white panel with light-mode borders in dark mode. */
/* Radzen's .rz-body carries a transform, which makes it the containing block for position:fixed,
   so these backdrops dimmed only the content column and left the sidebar and top bar bright.
   While a panel is open the transform is dropped and the backdrop covers the whole window. */
.hrmc-body:has(.po-status-backdrop,.so-status-backdrop){transform:none}
/* erp.js focuses the panel itself so keyboard and screen-reader users start inside it; that is a
   starting point, not a control, and a ring around the whole panel is noise. */
.rd-content [role="dialog"][tabindex="-1"]:focus-visible,.rd-content [role="dialog"][tabindex="-1"]:focus{outline:none}
.po-status-backdrop{position:fixed;inset:0;z-index:1200;background:color-mix(in srgb,#000 45%,transparent);display:flex;align-items:center;justify-content:center;padding:16px}
.po-status-dialog{width:min(1100px,100%);max-height:calc(100vh - 32px);background:var(--hrmc-surface);color:var(--hrmc-text);border:1px solid var(--hrmc-border);box-shadow:var(--hrmc-e3);display:flex;flex-direction:column;border-radius:var(--hrmc-r-card,12px)}
.po-status-header{padding:var(--hrmc-s4,16px) var(--hrmc-s5,24px);border-bottom:1px solid var(--hrmc-border);display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.po-status-header h2{font-size:var(--hrmc-fs-title,20px);margin:0}.po-status-header p{margin:4px 0 0;color:var(--hrmc-text-muted)}
.po-status-body{overflow:auto;padding:20px 24px 28px}.po-status-body h3{font-size:var(--hrmc-fs-lead,16px);margin:24px 0 8px}
.po-status-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;border-top:1px solid var(--hrmc-border);border-inline-start:1px solid var(--hrmc-border)}
.po-status-metrics>div{min-width:0;min-height:78px;padding:12px 14px;border-inline-end:1px solid var(--hrmc-border);border-bottom:1px solid var(--hrmc-border);display:flex;flex-direction:column;justify-content:space-between;gap:6px}
.po-status-metrics span{font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-text-muted);overflow-wrap:anywhere}.po-status-metrics strong{font-size:var(--hrmc-fs-title,20px);font-variant-numeric:tabular-nums}
@media(max-width:760px){.po-status-body{padding:14px}.po-status-header{padding:14px}.po-status-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}

.rd-password-control{position:relative;display:block;min-width:0}
.rd-auth .rd-password-control input{padding-inline-end:48px}
.rd-auth .rd-password-toggle{position:absolute;right:2px;top:2px;bottom:2px;width:42px;min-height:0;display:grid;place-items:center;padding:0;border:0;border-radius:4px;background:transparent;color:var(--hrmc-text-muted);cursor:pointer}
.rd-auth .rd-password-toggle:hover{background:var(--hrmc-brand-soft);color:var(--hrmc-brand)}
.rd-auth .rd-password-toggle:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:1px}
.rd-password-toggle .material-symbols-outlined{font-size:22px}

/* ------------------------------------------------------- partner addresses -- */
/* GPS block of the address editor: fields and actions beside a live OpenStreetMap preview, stacked on narrow screens. */
.rd-address-location{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--hrmc-s5,24px);margin:var(--hrmc-s5,24px) 0;padding:var(--hrmc-s4,16px) var(--rd-card-pad,20px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);background:color-mix(in srgb,var(--hrmc-surface) 60%,var(--hrmc-surface-muted))}
.rd-address-location h3{margin:0 0 var(--hrmc-s1,4px)}
.rd-address-location>div:first-child{display:flex;flex-direction:column;gap:var(--hrmc-s3,12px);min-width:0}
.rd-address-location>div:first-child>p{margin:0}
.rd-address-location label small{display:block;margin-top:var(--hrmc-s1,4px);color:var(--hrmc-text-muted)}
.rd-address-point{grid-template-columns:repeat(2,minmax(0,1fr))}
.rd-address-map{min-height:280px;border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,8px);overflow:hidden;background:var(--hrmc-surface-muted);display:grid;place-items:center}
.rd-address-map iframe{width:100%;height:100%;min-height:280px;border:0;display:block}
.rd-address-map>p{margin:0;padding:var(--hrmc-s4,16px);color:var(--hrmc-text-muted);text-align:center}
.rd-address-focus{margin:0 0 var(--hrmc-s3,12px)}
.rd-content a.rd-address-point-link{display:inline-flex;align-items:center;gap:2px;font-variant-numeric:tabular-nums;white-space:nowrap}
.rd-address-point-link .material-symbols-outlined{font-size:18px}
@media (max-width:900px){.rd-address-location{grid-template-columns:minmax(0,1fr)}}
@media print{.rd-address-map{display:none}}
/* Customers added from mobile: a highlighted worklist above the partner list, with activate / reject per row. */
.rd-pending-customers{margin:0 0 var(--hrmc-s5,24px);padding:var(--hrmc-s4,16px) var(--rd-card-pad,20px);border:1px solid color-mix(in srgb,var(--hrmc-status-warning-text) 30%,var(--hrmc-border));border-inline-start:4px solid var(--hrmc-status-warning-text);border-radius:var(--hrmc-r-card,12px);background:color-mix(in srgb,var(--hrmc-status-warning-bg) 45%,var(--hrmc-surface))}
.rd-pending-customers h2{margin:0 0 var(--hrmc-s1,4px)}
.rd-pending-customers>p{margin:0 0 var(--hrmc-s3,12px)}
.rd-pending-actions{display:flex;flex-wrap:wrap;gap:var(--hrmc-s2,8px);align-items:flex-start}
.rd-pending-actions form{margin:0}
.rd-pending-actions details>summary{list-style:none;cursor:pointer}
.rd-pending-actions details>summary::-webkit-details-marker{display:none}
.rd-pending-actions details[open]>form{display:grid;gap:var(--hrmc-s2,8px);margin-top:var(--hrmc-s2,8px);min-width:220px;white-space:normal}
/* Dashboard filters: item hierarchy sits under "More filters"; tables keep their headers, totals and first column in view. */
.rd-dashboard-filters>.rd-more-filters{grid-column:1/-1;border-top:1px dashed var(--hrmc-border);padding-top:var(--hrmc-s2,8px)}
.rd-more-filters>summary{display:inline-flex;align-items:center;gap:var(--hrmc-s2,8px);cursor:pointer;padding:6px 4px;font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-brand-hover);list-style:none}
.rd-more-filters>summary::-webkit-details-marker{display:none}
.rd-more-filters>summary:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:2px;border-radius:var(--hrmc-r-control,6px)}
.rd-more-filters>summary .material-symbols-outlined{font-size:18px}
.rd-more-filters[open]>summary{margin-bottom:var(--hrmc-s2,8px)}
.rd-more-filters-body{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr));gap:var(--hrmc-s3,12px) var(--hrmc-s4,16px);align-items:end}
.rd-stock-dashboard>.rd-table{max-height:calc(100vh - 240px);min-height:200px}
.rd-stock-dashboard>.rd-table thead th{position:sticky;top:0;z-index:2;background:var(--hrmc-surface-muted)}
.rd-stock-dashboard>.rd-table tfoot th,.rd-stock-dashboard>.rd-table tfoot td{position:sticky;bottom:0;z-index:2;background:var(--hrmc-surface-muted);box-shadow:0 -1px 0 var(--hrmc-border)}
.rd-stock-tree th:first-child,.rd-stock-tree td:first-child{position:sticky;left:0;z-index:1;background:var(--hrmc-surface)}
.rd-stock-tree thead th:first-child,.rd-stock-tree tfoot th:first-child{z-index:3;background:var(--hrmc-surface-muted)}
.rd-stock-tree tbody tr:hover td{background:var(--hrmc-surface-muted)}
/* "vs previous period" note on a metric card */
.rd-trend{display:inline-flex;align-items:center;gap:var(--hrmc-s1,4px);margin-top:var(--hrmc-s1,4px);font-size:var(--hrmc-fs-caption,11px);font-weight:var(--hrmc-fw-semi,600);color:var(--hrmc-text-muted)}
.rd-trend .material-symbols-outlined{font-size:16px}
.rd-trend.is-bad{color:var(--hrmc-status-danger-text)}.rd-trend.is-good{color:var(--hrmc-status-success-text)}
@media print{.rd-trend{color:inherit}}
/* Breadcrumb above the page content (built from the sidebar by erp.js) */
.rd-breadcrumb{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hrmc-s2,8px);margin:0 0 var(--hrmc-s3,12px);font-size:var(--hrmc-fs-small,12.5px);color:var(--hrmc-text-muted)}
.rd-breadcrumb a{color:var(--hrmc-text-muted);text-decoration:none}.rd-breadcrumb a:hover{color:var(--hrmc-brand-hover);text-decoration:underline}
.rd-breadcrumb a:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:2px;border-radius:var(--hrmc-r-control,6px)}
.rd-breadcrumb [aria-current=page]{color:var(--hrmc-text);font-weight:var(--hrmc-fw-semi,600)}
.rd-breadcrumb-sep{opacity:.6}
@media print{.rd-breadcrumb{display:none}}
/* A table whose only row is the "nothing found" message reads as an empty state, not a stray cell. */
.rd-content tbody td[colspan]:only-child{padding:var(--hrmc-s6,32px) var(--hrmc-s4,16px);text-align:center;color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-body,14px)}
.rd-saved-views{display:flex;align-items:center;gap:var(--hrmc-s1,4px);margin-inline-start:var(--hrmc-s2,8px)}
.rd-saved-views select{min-width:150px;max-width:220px}
.rd-saved-views .rd-icon:disabled{opacity:.4;cursor:not-allowed}
/* Page loading bar (erp.js) */
.rd-progress{position:fixed;inset:0 0 auto 0;height:3px;z-index:2000;background:transparent;pointer-events:none}
.rd-progress[hidden]{display:none}
.rd-progress::before{content:"";display:block;height:100%;width:0;background:var(--hrmc-brand);border-radius:0 var(--hrmc-r-pill,999px) var(--hrmc-r-pill,999px) 0}
.rd-progress.is-active::before{animation:rd-progress 8s cubic-bezier(.1,.6,.2,1) forwards}
@keyframes rd-progress{to{width:92%}}
@media (prefers-reduced-motion:reduce){.rd-progress.is-active::before{animation:none;width:60%}}
@media print{.rd-progress{display:none}}
/* Default dark theme: primary-button text was 4.31:1 on its fill; white is 4.72:1 (workspace themes already set their own). */
@media (prefers-color-scheme:dark){:root:not([data-hrmc-appearance="light"]) .hrmc-shell:not([data-workspace-theme]){--hrmc-on-action:#fff}}
:root[data-hrmc-appearance="dark"] .hrmc-shell:not([data-workspace-theme]){--hrmc-on-action:#fff}
/* Touch screens: icon buttons reach the recommended 44 px target. */
@media (pointer:coarse){.rd-icon,.rd-content .rd-icon,.rd-content td>a.rd-icon,.rd-row-actions a,.rd-list-pagination .rd-button,.rd-help-trigger,.rd-settings-trigger,.rd-language-picker select,.rd-segmented label,.crm-views>.rd-button,.crm-card-move .rd-icon{min-width:44px;min-height:44px}.rd-stock-tree-toggle{min-width:44px;min-height:44px}.rd-option-list .rd-check{min-height:40px}}
/* One KPI card for every dashboard: the same surface, accent bar, hover and figure that fits its card at any width.
   Pages keep their own markup and layout; only the look is shared. A card takes its accent from --metric-color, or cycles
   brand / success / warning when it does not set one. */
.rd-dashboard-metric,.dash-kpis>a,.dash-kpis>span,.insight-metrics>a,.spot-metrics>div{container-type:inline-size;min-width:0;padding:var(--hrmc-s4,16px) var(--hrmc-s4,18px);border:1px solid var(--hrmc-border);border-top:3px solid var(--metric-color,var(--hrmc-brand));border-radius:var(--hrmc-r-card,12px);background:var(--hrmc-surface);box-shadow:var(--hrmc-e1);color:inherit;text-decoration:none;transition:box-shadow .15s ease,transform .15s ease}
.dash-kpis>:nth-child(3n+2),.insight-metrics>a:nth-child(3n+2),.spot-metrics>div:nth-child(3n+2){--metric-color:var(--hrmc-status-success-text)}
.dash-kpis>:nth-child(3n),.insight-metrics>a:nth-child(3n),.spot-metrics>div:nth-child(3n){--metric-color:var(--hrmc-status-warning-text)}
.dash-kpis>a:hover,.insight-metrics>a:hover{box-shadow:var(--hrmc-e2);transform:translateY(-1px)}
.dash-kpis>a:focus-visible,.insight-metrics>a:focus-visible{outline:2px solid var(--hrmc-brand);outline-offset:2px}
.dash-kpis strong,.insight-metrics strong,.spot-metrics strong{font-size:clamp(1.2rem,13cqw,var(--hrmc-fs-display,1.75rem));line-height:1.15;white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
@media print{.dash-kpis>a,.insight-metrics>a,.rd-dashboard-metric,.spot-metrics>div{break-inside:avoid;box-shadow:none}}

/* Tab strips that scroll sideways fade at the edge that still has tabs beyond it, so a clipped
   tab reads as "more this way" instead of a layout fault. erp.js sets the data attributes. */
[data-scroll-more~="end"]{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}
[data-scroll-more~="start"]{-webkit-mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}
[data-scroll-more~="start"][data-scroll-more~="end"]{-webkit-mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}

.rd-menu-settling .hrmc-sidebar,.rd-menu-settling .hrmc-shell,.rd-menu-settling .hrmc-body{transition:none!important}

/* ----------------------------------------------------------------- login -- */
.rd-login{width:min(980px,100%);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);border-radius:calc(var(--hrmc-r-card,12px) + 4px);overflow:hidden;background:var(--hrmc-surface);box-shadow:var(--hrmc-e3);border:1px solid var(--hrmc-border)}
.rd-login-brand{display:flex;flex-direction:column;justify-content:space-between;gap:var(--hrmc-s6,32px);padding:var(--hrmc-s7,44px) var(--hrmc-s6,36px);color:var(--hrmc-hero-text,#fff);background:radial-gradient(420px 260px at 100% 0,color-mix(in srgb,#fff 16%,transparent),transparent 70%),linear-gradient(150deg,var(--hrmc-hero-start,var(--hrmc-brand-strong)),var(--hrmc-hero-end,var(--hrmc-brand-hover)))}
.rd-login-home,.rd-login-back{display:inline-flex;align-items:center;gap:var(--hrmc-s2,8px);color:inherit;text-decoration:none;font-weight:var(--hrmc-fw-semi,600)}
.rd-login-home{font-size:18px;gap:var(--hrmc-s3,12px)}
.rd-login-back{font-size:var(--hrmc-fs-small,13px);opacity:.85}
.rd-login-back:hover{opacity:1;text-decoration:underline}
.rd-login-back .material-symbols-outlined{font-size:18px}
.rd-login-mark{width:40px;height:40px;display:grid;place-items:center;border-radius:10px;background:color-mix(in srgb,#fff 20%,transparent);color:inherit;font-size:24px}
.rd-login-mark-sm{background:var(--hrmc-brand-strong);color:var(--hrmc-on-action,#fff);width:44px;height:44px;box-shadow:var(--hrmc-e1)}
.rd-login-pitch h2{margin:0;font-size:28px;line-height:1.2;font-weight:700;letter-spacing:-.01em;color:inherit;border:0;padding:0}
.rd-login-pitch p{margin:var(--hrmc-s3,12px) 0 0;max-width:36ch;opacity:.9;line-height:1.6}
.rd-login-pitch ul{list-style:none;margin:var(--hrmc-s5,24px) 0 0;padding:0;display:grid;gap:var(--hrmc-s3,12px)}
.rd-login-pitch li{display:flex;align-items:center;gap:var(--hrmc-s3,12px);font-weight:var(--hrmc-fw-medium,500)}
.rd-login-pitch li .material-symbols-outlined{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:color-mix(in srgb,#fff 18%,transparent);font-size:19px}
.rd-login .rd-login-card{width:auto;border:0;border-radius:0;box-shadow:none;padding:var(--hrmc-s7,44px) var(--hrmc-s6,40px);align-self:center;background:transparent}
.rd-login-head h1{margin:var(--hrmc-s4,16px) 0 var(--hrmc-s2,8px);font-size:26px;letter-spacing:-.02em}
.rd-login-head p{margin:0 0 var(--hrmc-s5,24px);color:var(--hrmc-text-muted)}
.rd-login .rd-auth-card h1,.rd-login .rd-login-head h1{font-weight:700}
.rd-login-new{margin:var(--hrmc-s5,24px) 0 0;padding-top:var(--hrmc-s4,16px);border-top:1px solid var(--hrmc-border);text-align:center;color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,13px)}
.rd-login-new a{color:var(--hrmc-brand-hover);font-weight:var(--hrmc-fw-semi,600);text-decoration:none}
.rd-login-new a:hover{text-decoration:underline}
.rd-login input:not([type=checkbox]){min-height:44px}
.rd-login-brand a:focus-visible{outline:2px solid var(--hrmc-hero-text,#fff);outline-offset:3px;border-radius:6px}
@media(max-width:820px){
    .rd-login{grid-template-columns:1fr;max-width:460px}
    .rd-login-brand{padding:var(--hrmc-s4,18px) var(--hrmc-s5,22px);gap:var(--hrmc-s3,12px)}
    .rd-login-pitch,.rd-login-back{display:none}
    .rd-login .rd-login-card{padding:var(--hrmc-s5,26px) var(--hrmc-s5,22px)}
    .rd-login-mark-sm{display:none}
    .rd-login-head h1{margin-top:0;font-size:22px}
}

@media screen{
/* Purchase line grid: every cell starts at the same top edge, and cells holding plain text (unit, stock,
   amounts) centre on the 40px control beside them instead of riding at the top. The pricing-unit caption
   sits under the rate box, like the quantity note under the quantity box, so Quantity and Rate line up. */
.rd-purchase-lines td{vertical-align:top}
.rd-purchase-lines [data-item-unit],.rd-purchase-lines [data-document-stock],.rd-purchase-lines [data-po-line-gross],.rd-purchase-lines [data-po-line-net],.rd-purchase-lines [data-alt-value]{display:flex;align-items:center;min-height:var(--rd-control-h);padding-block:0}
.rd-purchase-lines [data-po-line-gross],.rd-purchase-lines [data-po-line-net],.rd-purchase-lines [data-alt-value]{justify-content:flex-end}
.rd-purchase-lines [data-pricing-rate-label]:not([hidden]){display:flex;flex-direction:column-reverse;gap:var(--hrmc-s1,4px)}
.rd-purchase-lines [data-pricing-rate-unit],.rd-purchase-lines [data-pricing-quantity]{font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-normal,400);color:var(--hrmc-text-muted);line-height:1.3}
.rd-purchase-lines td>select+input:not([hidden]),.rd-purchase-lines td>input+input:not([type=hidden]):not([hidden]){margin-top:var(--hrmc-s2,8px)}

/* Document line grids (goods receipt, issue, invoice, sales): the same alignment rule as the purchase grid.
   Every cell starts at the top edge, so a cell that is taller than its neighbours (a pricing-unit note under
   the quantity, a second discount box) no longer pushes its own input out of line. Cells that hold only text
   (unit, value, source label) are offset by half the difference to a 40px control so the text sits level with
   the boxes beside it. */
.rd-inventory-lines td,.fin-lines td,.rd-sales-grid td{vertical-align:top}
.rd-inventory-lines{--rd-cell-pad:12px}
.fin-lines{--rd-cell-pad:var(--hrmc-s2,8px)}
.rd-sales-grid{--rd-cell-pad:var(--hrmc-s2,8px)}
.rd-content :is(.rd-inventory-lines,.fin-lines,.rd-sales-grid) tbody td:not(:has(input:not([type=hidden]),select,button,textarea,details,a.rd-button,.rz-dropdown,.rd-lookup-host)){padding-top:calc(var(--rd-cell-pad) + (var(--rd-control-h) - 1lh) / 2);padding-bottom:0}
:is(.rd-inventory-lines,.fin-lines,.rd-sales-grid) [data-fin-pricing-rate-label]:not([hidden]){display:flex;flex-direction:column-reverse;gap:var(--hrmc-s1,4px)}
:is(.rd-inventory-lines,.fin-lines,.rd-sales-grid) :is([data-fin-pricing-unit],[data-fin-pricing-quantity],[data-inv-pricing-quantity]){font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-normal,400);color:var(--hrmc-text-muted);line-height:1.3}
.rd-content :is(.rd-inventory-lines,.fin-lines,.rd-sales-grid) tbody select:not(.rd-lookup-native){min-height:var(--rd-control-h)}
.rd-content .rd-sales-grid td>.rd-check{min-height:var(--rd-control-h);align-items:center}
.rd-content .rd-sales-grid [data-sales-unit]{display:flex;align-items:center;min-height:var(--rd-control-h)}
.rd-content :is(.rd-inventory-lines,.fin-lines,.rd-sales-grid) tbody .rz-dropdown{min-height:var(--rd-control-h)}
.rd-content .rd-sales-grid td:has(>details,>button)>span[data-calculated]:first-child{display:flex;align-items:center;min-height:var(--rd-control-h)}
.rd-content .rd-sales-grid td.rd-num:has(>details,>button)>span[data-calculated]:first-child{justify-content:flex-end}
.rd-content :is(.rd-inventory-lines,.fin-lines,.rd-purchase-lines) tbody td>input[type=checkbox]:only-of-type{margin-top:calc((var(--rd-control-h) - 18px) / 2)}
}

/* Sales pricing-unit rate (the second-quantity feature on quotations, orders, dispatches and returns): the
   "Rate / unit" caption goes under the rate box and the notes use one muted small style, so Quantity and
   Rate start on the same line like every other line grid. */
@media screen{
.rd-content .rd-sales-grid [data-sales-pricing-label]:not([hidden]){display:flex;flex-direction:column-reverse;gap:var(--hrmc-s1,4px)}
.rd-content .rd-sales-grid :is([data-sales-pricing-unit],[data-sales-pricing-quantity],[data-sales-pricing-applied]){font-size:var(--hrmc-fs-small,12.5px);font-weight:var(--hrmc-fw-normal,400);color:var(--hrmc-text-muted);line-height:1.3}
.rd-content .rd-sales-grid td>small{display:block;margin-top:var(--hrmc-s1,4px)}
}

/* ------------------------------------------------------------------ help -- */
.hrmc-header .rd-help-trigger{flex:none;width:38px;padding:6px;text-decoration:none;color:var(--hrmc-text)}
.hrmc-header .rd-help-trigger:hover{color:var(--hrmc-brand-hover)}
@media(max-width:768px){.rd-help-trigger{width:34px;min-height:34px}}
.rd-help{display:grid;gap:var(--hrmc-s5,24px)}
.rd-help-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:var(--hrmc-s4,16px);padding-bottom:var(--hrmc-s4,16px);border-bottom:1px solid var(--hrmc-border)}
.rd-help-head small{display:block;font-size:var(--hrmc-fs-caption,11px);font-weight:var(--hrmc-fw-bold,700);letter-spacing:.1em;text-transform:uppercase;color:var(--hrmc-text-muted);margin-bottom:var(--hrmc-s1,4px)}
.rd-help-head h1{margin:0;border:0;padding:0}
.rd-help-head p{margin:var(--hrmc-s2,8px) 0 0;color:var(--hrmc-text-muted);max-width:62ch}
.rd-help-search{display:flex;gap:var(--hrmc-s2,8px);align-items:center;flex:1 1 320px;max-width:520px}
.rd-help-search label{flex:1;min-width:0}
.rd-help-search input{width:100%}
.rd-help-modules{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:var(--hrmc-s4,16px)}
.rd-help-module{display:grid;gap:var(--hrmc-s2,8px);align-content:start;padding:var(--hrmc-s5,22px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);background:var(--hrmc-surface);box-shadow:var(--hrmc-e1)}
.rd-help-module h2{margin:0;font-size:var(--hrmc-fs-title,20px)}
.rd-help-module h2 a{color:inherit;text-decoration:none}
.rd-help-module h2 a:hover{color:var(--hrmc-brand-hover)}
.rd-help-module p{margin:0;color:var(--hrmc-text-muted)}
.rd-help-module ul{margin:var(--hrmc-s2,8px) 0 0;padding:0;list-style:none;display:grid;gap:var(--hrmc-s1,4px)}
.rd-help-module a{color:var(--hrmc-brand-hover);text-decoration:none;font-weight:var(--hrmc-fw-medium,500)}
.rd-help-module a:hover{text-decoration:underline}
.rd-help-module small{color:var(--hrmc-text-muted)}
.rd-help-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:10px;background:var(--hrmc-brand-soft);color:var(--hrmc-brand-hover);font-size:24px}
.rd-help-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:var(--hrmc-s5,28px);align-items:start}
.rd-help-nav{position:sticky;top:var(--hrmc-s3,12px);max-height:calc(100vh - 140px);overflow:auto;padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-card,12px);background:var(--hrmc-surface)}
.rd-help-nav summary{font-weight:var(--hrmc-fw-semi,600);cursor:pointer;padding:var(--hrmc-s1,4px) 0}
.rd-help-nav h2{margin:var(--hrmc-s3,12px) 0 var(--hrmc-s1,4px);font-size:var(--hrmc-fs-caption,11px);letter-spacing:.08em;text-transform:uppercase;color:var(--hrmc-text-muted)}
.rd-help-nav ul{margin:0;padding:0;list-style:none}
.rd-help-nav a{display:block;padding:5px var(--hrmc-s2,8px);border-radius:var(--hrmc-r-control,6px);color:var(--hrmc-text);text-decoration:none;font-size:var(--hrmc-fs-small,13px);line-height:1.35}
.rd-help-nav a:hover{background:var(--hrmc-surface-muted)}
.rd-help-nav a[aria-current=page]{background:var(--hrmc-brand-soft);color:var(--hrmc-brand-hover);font-weight:var(--hrmc-fw-semi,600)}
.rd-help-article{min-width:0;max-width:78ch;line-height:1.7;overflow-wrap:anywhere}
.rd-help-home{max-width:none}
.rd-help-article h2{margin:var(--hrmc-s6,32px) 0 var(--hrmc-s3,12px);padding-top:var(--hrmc-s3,12px);border-top:1px solid var(--hrmc-border);font-size:var(--hrmc-fs-title,20px);scroll-margin-top:var(--hrmc-s5,24px)}
.rd-help-article h2:first-child,.rd-help-toc+h2{border-top:0;margin-top:var(--hrmc-s4,16px)}
.rd-help-article h3{margin:var(--hrmc-s5,22px) 0 var(--hrmc-s2,8px);font-size:calc(var(--hrmc-fs-title,20px) - 3px);scroll-margin-top:var(--hrmc-s5,24px)}
.rd-help-article p,.rd-help-article ul,.rd-help-article ol{margin:var(--hrmc-s2,8px) 0}
.rd-help-article ul,.rd-help-article ol{padding-inline-start:1.4em}
.rd-help-article li{margin:var(--hrmc-s1,4px) 0}
.rd-help-article a{color:var(--hrmc-brand-hover)}
.rd-help-article code{padding:1px 5px;border-radius:4px;background:var(--hrmc-surface-muted);font-size:.9em}
.rd-help-article blockquote{margin:var(--hrmc-s3,12px) 0;padding:var(--hrmc-s2,8px) var(--hrmc-s4,16px);border-inline-start:4px solid var(--hrmc-brand);border-radius:0 var(--hrmc-r-control,6px) var(--hrmc-r-control,6px) 0;background:var(--hrmc-brand-soft)}
.rd-help-article blockquote p{margin:var(--hrmc-s1,4px) 0}
.rd-help-article hr{border:0;border-top:1px solid var(--hrmc-border);margin:var(--hrmc-s5,24px) 0}
.rd-help-table{overflow-x:auto;margin:var(--hrmc-s3,12px) 0;border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px)}
.rd-help-table table{width:100%;border-collapse:collapse;font-size:var(--hrmc-fs-small,13px);line-height:1.5}
.rd-help-table th,.rd-help-table td{padding:var(--hrmc-s2,8px) var(--hrmc-s3,12px);border-bottom:1px solid var(--hrmc-border);text-align:start;vertical-align:top}
.rd-help-table th{background:var(--hrmc-surface-muted);font-weight:var(--hrmc-fw-semi,600);white-space:nowrap}
.rd-help-table tr:last-child td{border-bottom:0}
.rd-help-toc{margin:var(--hrmc-s3,12px) 0;padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);background:var(--hrmc-surface-muted)}
.rd-help-toc ul{margin:var(--hrmc-s1,4px) 0 0;padding:0;list-style:none;display:flex;flex-wrap:wrap;gap:var(--hrmc-s1,4px) var(--hrmc-s4,16px)}
.rd-help-toc a{font-size:var(--hrmc-fs-small,13px)}
.rd-help-foot{margin-top:var(--hrmc-s6,32px);padding-top:var(--hrmc-s4,16px);border-top:1px solid var(--hrmc-border);color:var(--hrmc-text-muted)}
.rd-help-count{color:var(--hrmc-text-muted)}
.rd-help-results{margin:0;padding:0;list-style:none;display:grid;gap:var(--hrmc-s3,12px);max-width:78ch}
.rd-help-results li{padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);border:1px solid var(--hrmc-border);border-radius:var(--hrmc-r-control,6px);background:var(--hrmc-surface)}
.rd-help-results a{color:var(--hrmc-brand-hover);text-decoration:none}
.rd-help-results a:hover{text-decoration:underline}
.rd-help-results small{color:var(--hrmc-text-muted)}
.rd-help-results p{margin:var(--hrmc-s1,4px) 0 0;color:var(--hrmc-text-muted);font-size:var(--hrmc-fs-small,13px)}
@media(max-width:900px){.rd-help-layout{grid-template-columns:1fr}.rd-help-nav{position:static;max-height:none}.rd-help-nav details:not([open])>*:not(summary){display:none}}
@media print{.rd-help-nav,.rd-help-search,.rd-help-foot,.rd-help-trigger{display:none!important}.rd-help-layout{display:block}.rd-help-article{max-width:none}}

/* A lookup replaces a native select after the page has painted. Its inner label must not size the field (it was ~217px
   wide on its own), or every field beside it jumps when the swap happens; the host keeps the select's width instead. */
/* Radzen lays the dropdown out as a column flex box, so flex-grow cannot widen the label: width:0 alone clipped every
   lookup to its padding ("BUS" for "Business Overview"). width:0 still keeps the label out of the field's intrinsic
   width; min-width:100% then stretches it to the field once the field has its size. */
.rd-lookup-host .rz-dropdown-label.rz-inputtext{box-sizing:border-box;min-width:100%;width:0;flex:1 1 0%}
.rd-lookup-host .rz-helper-hidden-accessible,.rd-lookup-host .rz-helper-hidden-accessible input{width:1px;min-width:0}

/* Pages that are drawn by the live connection show a placeholder of the same size until they arrive (see InteractivePages). */
.rd-content.rd-boots{min-height:min(78vh,720px)}
.rd-boot{display:grid;gap:var(--hrmc-s3,12px);align-content:start;padding-top:var(--hrmc-s2,8px)}
.rd-boot i{display:block;height:22px;width:34%;border-radius:var(--hrmc-r-control,6px);background:var(--hrmc-surface-muted)}
.rd-boot i:nth-child(2){width:56%;height:14px}
.rd-boot i:nth-child(3){width:100%;height:42px}
.rd-boot i:nth-child(4){width:100%;height:260px;border-radius:var(--hrmc-r-card,12px)}
.rd-content:has(>:not(.rd-breadcrumb):not(.rd-boot):not(script):not(template))>.rd-boot{display:none}
/* Keep the page from shifting sideways when the scrollbar appears after content arrives. */
html,.hrmc-body{scrollbar-gutter:stable}

/* The cheque designer is built by script after the page loads; hold its space so the page does not stretch when it arrives. */
.cheque-designer[data-cheque-editor]:empty{min-height:1100px}

/* The ledger lines are drawn by script after the page loads; hold room for the first lines so the totals below do not drop. */
.rd-table.fin-ledger-table{min-height:185px}

/* ------------------------------------------------- procurement pages (imports, services) -- */
/* A page that renders its own breadcrumb (interactive procurement pages) replaces the layout's generic one. */
.rd-content:has(.rd-page-breadcrumb)>.rd-breadcrumb:not(.rd-page-breadcrumb){display:none}
/* Row inputs in the shipment, declaration and cost editors were sharing the column's width: HS codes showed
   "720", duty names "Custo". Inputs keep a readable minimum and the table scrolls inside .rd-table instead. */
.rd-procurement-editor .rd-table>table{width:max-content;min-width:100%}
/* Specificity matches the global .rd-content input rule (width:100%;min-width:0), which otherwise wins. */
.rd-content .rd-procurement-editor .rd-table td>input:not([type=checkbox]):not([type=radio]):not([type=file]),.rd-content .rd-procurement-editor .rd-table td>textarea{min-width:10rem}
.rd-content .rd-procurement-editor .rd-table td>input[type=number]:not([type=checkbox]):not([type=radio]):not([type=file]){min-width:8.5rem}
.rd-content .rd-procurement-editor .rd-table td>input[type=date]:not([type=checkbox]):not([type=radio]):not([type=file]){min-width:10.5rem}
.rd-content .rd-procurement-editor .rd-table td>textarea{min-width:16rem}
/* Selects size to their longest option (the cell is max-content), never narrower than a text input. */
.rd-content .rd-procurement-editor .rd-table td>select{width:auto;min-width:10rem;max-width:100%}
/* Landed cost sheet: the charges and item tables fit the page width, so that the amount of a charge is seen without
   scrolling sideways. A posted-source label is long (voucher / narration / amount) and is cut, not allowed to stretch the table. */
.rd-content .rd-procurement-editor .rd-table.rd-cost-charges>table,.rd-content .rd-procurement-editor .rd-table.rd-cost-items>table{width:100%!important;min-width:0!important}
.rd-content .rd-procurement-editor .rd-table.rd-cost-charges>table{table-layout:fixed}
.rd-cost-charges thead th:nth-child(1){width:22%}
.rd-cost-charges thead th:nth-child(2){width:14%}
.rd-cost-charges thead th:nth-child(3){width:29%}
.rd-cost-charges thead th:nth-child(4){width:14%}
.rd-cost-charges thead th:nth-child(5){width:14%}
.rd-cost-charges thead th:nth-child(6){width:7%}
.rd-content .rd-procurement-editor .rd-table.rd-cost-charges td{overflow:hidden}
.rd-content .rd-procurement-editor .rd-table.rd-cost-charges td>input:not([type=checkbox]):not([type=radio]):not([type=file]),.rd-content .rd-procurement-editor .rd-table.rd-cost-charges td>select{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.rd-content .rd-procurement-editor .rd-table.rd-cost-charges td>.rz-dropdown{min-width:0!important;width:100%!important;max-width:100%}
.hrmc-shell .rd-content .rd-cost-charges table td.rd-num,.hrmc-shell .rd-content .rd-cost-items table td.rd-num{min-width:0!important}
.rd-content .rd-cost-items thead th{white-space:normal;line-height:1.25;vertical-align:bottom}
.rd-content .rd-cost-items td,.rd-content .rd-cost-items th{padding-inline:6px}
.rd-procurement-editor .rd-table td>.rz-dropdown,.rd-procurement-editor .rd-table td>.rd-lookup-host{min-width:14rem}
.rd-procurement-editor .rd-table td>.rz-dropdown+.rz-dropdown{margin-top:var(--hrmc-s2,8px)}
/* Detail rows spanning the table (estimate match, manual shares) are editors, not empty states. */
.rd-procurement-editor .rd-table tbody td[colspan]:has(.rd-fields){text-align:start;padding:var(--hrmc-s3,12px) var(--hrmc-s4,16px);color:inherit}
.rd-procurement-editor .rd-table tbody td[colspan]:has(.rd-fields)::before{content:none}
.rd-procurement-editor .rd-table td[colspan]>.rd-fields{max-width:60rem}
.rd-procurement-editor>.rd-document-region{margin-bottom:var(--hrmc-s4,16px)}
/* Service progress: order numbers and service codes stay on one line instead of wrapping letter by letter. */
.rd-service-progress td:first-child,.rd-service-progress td:nth-child(2),.rd-service-progress td:first-child a{white-space:nowrap}
.rd-service-progress td:not(:first-child):not(:nth-child(2)){text-align:end;font-variant-numeric:tabular-nums;white-space:nowrap}
/* Document action links such as "Goods receipt: supplier / order" wrap on a phone instead of overflowing. */
.rd-procurement-actions{flex-wrap:wrap;align-items:stretch}
.rd-procurement-actions>.rd-button,.rd-procurement-actions>a{white-space:normal;max-width:100%;overflow-wrap:anywhere;text-align:start;height:auto;padding-block:var(--hrmc-s2,8px)}

/* Search dialog for a plain dropdown with many options. Centred in the window; long option names wrap instead of pushing it sideways. */
dialog.rd-option-search { width: min(36rem, calc(100vw - 2rem)); max-height: min(44rem, calc(100dvh - 2rem)); margin: auto; padding: 1rem; box-sizing: border-box; overflow: hidden;
    border: 1px solid var(--hrmc-border, #b9c9c2); border-radius: var(--hrmc-r-card, 12px); background: var(--hrmc-surface, #fff); color: var(--hrmc-text, inherit); box-shadow: var(--hrmc-e3, 0 12px 32px rgb(0 0 0 / 20%)); }
dialog.rd-option-search[open] { display: flex; flex-direction: column; gap: .6rem; }
dialog.rd-option-search::backdrop { background: rgb(18 33 38 / 45%); }
dialog.rd-option-search > input { width: 100%; min-height: 40px; flex: none; box-sizing: border-box; }
dialog.rd-option-search > .rd-actions { flex: none; margin: 0; }
.rd-select-results { display: grid; gap: .2rem; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; align-content: start; }
.rd-select-results button { justify-content: flex-start; text-align: start; white-space: normal; overflow-wrap: anywhere; height: auto; min-height: 36px; padding-block: .4rem; max-width: 100%; }
.rd-select-results button[aria-pressed=true] { font-weight: 700; }
/* A report table's heading with its own Print button on the right. */
.rd-block-head { display: flex; align-items: center; justify-content: space-between; gap: var(--hrmc-s2, 8px); }
.rd-print-block { display: inline-flex; align-items: center; gap: 4px; padding: 2px var(--hrmc-s2, 8px); border: 1px solid var(--hrmc-border, #dfe8e2); border-radius: var(--hrmc-r-control, 6px); background: var(--hrmc-surface, #fff); color: var(--hrmc-text, #172b28); font: inherit; font-size: var(--hrmc-fs-small, 0.78rem); cursor: pointer; }
.rd-print-block .material-symbols-outlined { font-size: 16px; }
.rd-print-block:hover { border-color: var(--hrmc-brand-strong, #7a1f3d); color: var(--hrmc-brand-strong, #7a1f3d); }
.rd-print-block:focus-visible { outline: 2px solid var(--hrmc-brand-strong, #7a1f3d); outline-offset: 2px; }
