/* Shared portal controls. See docs/ui-standards.md. */
:root { --page-standard: 1280px; --page-wide: 1600px; --control-height: 2.75rem; }
html { scrollbar-gutter: stable; }
/* Let the dealer app bar reach the viewport edge when no scrollbar is needed. */
html:has(.dealer-shell) { scrollbar-gutter: auto; }
.dealer-preview-banner { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem 1rem; padding:.6rem clamp(1rem,3vw,2.25rem); background:light-dark(#e3eef4,var(--theme-raised)); border-bottom:1px solid light-dark(#cbd8e2,var(--theme-line)); }
.page-standard { max-width: var(--page-standard); margin-inline: auto; }
.page-wide { max-width: var(--page-wide); margin-inline: auto; }

.section-layout, .inventory-workspace-layout { display:grid; grid-template-columns:12rem minmax(0,1fr); gap:1.75rem; align-items:start; }
.section-content, .inventory-workspace-content { min-width:0; }
.section-nav { min-width:0; position:relative; padding:0 1rem 0 0; border-right:2px solid light-dark(#cbd8e2, var(--theme-line)); background:transparent; }
.section-nav-items { display:grid; gap:.15rem; }
.section-nav-items > :is(a,button) { display:flex; align-items:center; gap:.5rem; width:100%; min-height:2.75rem; padding:.6rem .75rem; border:0; border-left:3px solid transparent; border-radius:0; background:transparent; color:light-dark(#344e65, var(--theme-ink)); font-family:inherit; font-size:.85rem; line-height:1.4; font-weight:600; text-align:left; text-decoration:none; white-space:normal; cursor:pointer; }
.section-nav-items > :is(a,button):hover { color:light-dark(#173c54, var(--theme-ink)); background:light-dark(#edf3f6, var(--theme-raised)); }
.section-nav-items > :is(.active,.is-active,[aria-current="page"],[aria-pressed="true"]) { color:light-dark(#143d57, var(--theme-ink)); border-left-color:#247b99; background:light-dark(#e3eef4, var(--theme-raised)); border-radius:0 .4rem .4rem 0; font-weight:700; box-shadow:inset 0 0 0 1px light-dark(#d4e3ec, var(--theme-line)); }
.section-nav-items > :is(a,button):focus-visible, .section-nav-toggle:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
.section-nav-items > :is(a,button) > span { font-size:.75rem; }
.section-nav-group { color:var(--muted); font-size:.65rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; padding:.7rem .9rem .3rem; }
.section-nav-group:not(:first-child) { margin-top:.5rem; }
.section-nav-toggle { display:none; }
.section-nav-caption { display:block; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; font-size:.65rem; margin-bottom:.2rem; }
.section-nav-current { display:block; font-weight:600; }
.section-nav-chevron { margin-left:auto; font-size:1.25rem; }
.section-nav-menu-only { border:0; padding:0; margin-bottom:1rem; }
.section-nav-menu-only[data-ready] .section-nav-toggle { display:flex; }
.section-nav-toggle { align-items:center; justify-content:space-between; gap:1rem; min-height:3.5rem; width:100%; padding:.65rem .85rem; border:1px solid light-dark(#c6d3df, var(--theme-line)); border-radius:.5rem; color:light-dark(#19324d, var(--theme-ink)); background:light-dark(white, var(--theme-surface)); font:inherit; text-align:left; cursor:pointer; }
.section-nav-menu-only[data-ready]:not([data-expanded]) .section-nav-items { display:none; }
.section-nav-menu-only[data-ready] .section-nav-items { margin-top:.5rem; padding:.5rem; border:1px solid var(--line); border-radius:.5rem; background:light-dark(white, var(--theme-surface)); }
.section-nav-menu-only .section-nav-items > :is(.active,.is-active,[aria-current="page"],[aria-pressed="true"]) { background:light-dark(#edf3f6, var(--theme-raised)); }
@media (max-width:900px) {
    .section-layout, .inventory-workspace-layout { grid-template-columns:minmax(0,1fr); gap:1.25rem; }
    .section-nav { padding:0; border:0; }
    .section-nav[data-ready] .section-nav-toggle { display:flex; }
    .section-nav[data-ready]:not([data-expanded]) .section-nav-items { display:none; }
    .section-nav[data-ready] .section-nav-items { margin-top:.5rem; padding:.5rem; border:1px solid var(--line); border-radius:.5rem; background:light-dark(white, var(--theme-surface)); }
    .section-nav-items > :is(.active,.is-active,[aria-current="page"],[aria-pressed="true"]) { background:light-dark(#edf3f6, var(--theme-raised)); }
}

/* These inputs also occur inside child components with isolated parent CSS. */
input.currency-input,
body input:is([type="date"], [type="month"], [type="time"], [type="datetime-local"]) {
    box-sizing: border-box; min-width: 0; max-width: 100%; min-height: var(--control-height);
    padding: .6rem .75rem; border: 1px solid light-dark(#c6d3df, var(--theme-line)); border-radius: .5rem;
    background: light-dark(#fff, var(--theme-surface)); color: light-dark(#19324d, var(--theme-ink)); font: inherit; line-height: 1.3; color-scheme: inherit;
}
input.currency-input { width: 100%; }
body input:is([type="date"], [type="month"], [type="time"], [type="datetime-local"]):focus-visible,
input.currency-input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--focus-ring); }
body input:is([type="date"], [type="month"], [type="time"], [type="datetime-local"])::-webkit-calendar-picker-indicator {
    padding: .35rem; margin: -.35rem -.2rem -.35rem .4rem; border-radius: .35rem;
    background-color: light-dark(#eaf1f5, var(--theme-raised)); cursor: pointer; opacity: .8;
}
body input:is([type="date"], [type="month"], [type="time"], [type="datetime-local"]):disabled,
input.currency-input:disabled { background: light-dark(#f1f4f7, var(--theme-raised)); color: light-dark(#738398, var(--theme-muted)); cursor: not-allowed; }

.recovery-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 220px); gap: 1rem; align-items: end; margin: 1rem 0; }
.recovery-filters .field { display:grid; gap:.4rem; margin:0; }
.recovery-table td:first-child { display: table-cell; }
.recovery-table td { vertical-align: middle; }
.recovery-table .row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.recovery-help { color: var(--muted); margin: 0 0 1rem; }

.group-card { text-decoration: none; }
.group-card.directory-group:has(> .store-card-link) { padding: 0; }
.group-card.directory-group > .button-link { margin: 0 1.6rem 1rem; align-self: flex-start; }

.template-surface { border: 1px solid var(--line); border-radius: .75rem; background: light-dark(white, var(--theme-surface)); padding: var(--settings-padding); }
.template-surface .template-toolbar { gap: 1rem; margin-bottom: 1rem; }
.template-surface .field { margin-bottom: 0; }
.template-surface .template-overview { margin: 1rem 0; gap: 1rem; flex-wrap: wrap; }
.template-footer { display: grid; gap: .8rem; border-top: 1px solid var(--line); padding-top: 1.25rem; margin-top: 1.25rem; }
.template-footer small { color: var(--muted); line-height: 1.5; }
.template-empty { padding: 1.5rem; border: 1px dashed light-dark(#c7d5df, var(--theme-line)); border-radius: .5rem; margin: 1rem 0; color: var(--muted); }
.training-card > .form-actions + .training-muted { margin-top: 1rem; line-height: 1.5; }
.modal-dialog label.field { margin-bottom: 1rem; }
.notice.notice-info { border-color: light-dark(#c9dce7, var(--theme-line)); background: light-dark(#edf5f9, var(--theme-raised)); color: light-dark(#234d68, var(--theme-ink)); }
.notice.notice-info::before { content: "i"; background: light-dark(#d8e9f1, var(--theme-raised)); color: light-dark(#234d68, var(--theme-ink)); }
.inventory-workspace-content > .panel { margin-bottom: var(--settings-gap); }
.inventory-workspace-content :is(.section-title, .section-toolbar) { margin-bottom: 1rem; }
.inventory-workspace-content :is(h2, h3) + p { margin-top: .5rem; }
.dealer-report-stack { display: grid; gap: var(--settings-gap); }
.dealer-report-stack > section { margin: 0; }
.dealer-report-stack :is(h2, h3) + p { margin-top: .65rem; }

.payroll-entry-table { table-layout: fixed; }
.payroll-entry-table th:nth-child(1) { width: 13%; }
.payroll-entry-table th:nth-child(6) { width: 19%; }
.payroll-entry-table th:last-child { width: 15%; }
.payroll-entry-table td:nth-child(-n+3) { white-space: nowrap; }
.payroll-entry-table td { overflow-wrap: anywhere; }

@media (max-width: 700px) {
    .recovery-filters { grid-template-columns: minmax(0, 1fr); }
    .recovery-filters input { width: 100%; }
    .recovery-table td:first-child { display: flex; }
    .recovery-table td { gap: .75rem; }
    .payroll-table-scroll { overflow: visible; }
    .payroll-entry-table, .payroll-entry-table tbody { display: block; min-width: 0; width: 100%; }
    .payroll-entry-table thead { display: none; }
    .payroll-entry-table tr { display: grid; grid-template-columns: 1fr 1fr; padding: .85rem; gap: .75rem; border-bottom: 1px solid var(--line); }
    .payroll-entry-table td { display: flex; flex-direction: column; align-items: flex-start; padding: 0; border: 0; white-space: normal; min-width: 0; }
    .payroll-entry-table td[data-label]::before { content: attr(data-label); font-size: .7rem; color: var(--muted); margin-bottom: .25rem; }
    .payroll-entry-table td:is([colspan], .payroll-row-actions), .payroll-entry-table td[data-label="Unpaid lunch"] { grid-column: 1 / -1; }
    .payroll-entry-table .payroll-row-actions { flex-direction: row; gap: 1rem; }
    .payroll-entry-table .payroll-row-actions button { min-height: 2.75rem; }
    .monthly-analysis-table, .monthly-analysis-table.has-percentages { min-width: 600px; }
    .monthly-analysis-table th:first-child, .monthly-analysis-table.has-percentages th:first-child { width: 150px; }
    .monthly-analysis-table :is(th, td):first-child { position: sticky; left: 0; background: light-dark(#fff, var(--theme-surface)); z-index: 1; box-shadow: 1px 0 light-dark(#d9e2ed, var(--theme-line)); }
    .monthly-analysis-table .analysis-section-row th { background: light-dark(#eef4f9, var(--theme-raised)); }
    .monthly-analysis-table :is(th, td) { padding: .6rem; }
    .training-people { scrollbar-width: thin; }
}

.rapid-notice.is-info { color:light-dark(#234d68, var(--theme-ink)); background:light-dark(#edf5f9, var(--theme-raised)); border-color:light-dark(#c9dce7, var(--theme-line)); }
.rapid-notice.is-info > span { background:light-dark(#d8e9f1, var(--theme-raised)); color:light-dark(#234d68, var(--theme-ink)); }
.training-roster { scrollbar-width:thin; scrollbar-color:light-dark(#90aabb, var(--theme-line)) light-dark(#edf3f6, var(--theme-line)); }

.inventory-workspace-content > .inventory-section { margin-top:0; }
.inventory-workspace-content > .inventory-section > .section-title .eyebrow { display:none; }
.inventory-workspace-content .summary-page-heading { margin:0 0 1rem; }

.pad-workspace input:not([type="checkbox"]), .field input:not([type="checkbox"]):not([type="radio"]) { min-height:var(--control-height); }

.section-content > .operation-status.is-idle { display:none; }
.form-actions + .section-layout { margin-top:var(--settings-gap); }
@media (max-width:700px) { .payroll-contractor-card .payroll-entry-table td:first-child { padding-left:0; } }


/* One alphabetical directory: independent stores and parent groups, with visible child stores. */
.dealer-hierarchy, .dealer-directory-children { list-style:none; padding:0; margin:0; }
.dealer-hierarchy { display:grid; gap:.85rem; }
.dealer-directory-entry { min-width:0; background:var(--surface, light-dark(#fff, var(--theme-surface))); border:1px solid var(--border, light-dark(#dce3e8, var(--theme-line))); border-radius:10px; }
.dealer-directory-parent { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.25rem; }
.dealer-directory-parent h2 { font-size:1.05rem; line-height:1.4; margin:.15rem 0; overflow-wrap:anywhere; }
.dealer-directory-kind { display:block; color:var(--muted); font-size:.7rem; letter-spacing:.055em; text-transform:uppercase; font-weight:600; }
.dealer-directory-detail, .dealer-directory-store-detail { color:var(--muted); font-size:.85rem; line-height:1.5; }
.dealer-directory-group-link { flex-shrink:0; font-size:.85rem; font-weight:600; }
.dealer-directory-children { margin:0 1.25rem 1rem 2rem; border-left:2px solid light-dark(#dbe5eb, var(--theme-line)); }
.dealer-directory-children > li + li { border-top:1px solid light-dark(#edf0f3, var(--theme-line)); }
.dealer-directory-row { display:flex; align-items:center; min-width:0; }
.dealer-directory-store-link { display:grid; grid-template-columns:minmax(10rem,1fr) minmax(0,1.5fr) auto; align-items:center; gap:1.25rem; padding:1rem 1.25rem; flex:1; min-width:0; text-decoration:none; color:inherit; }
.dealer-directory-store-link:hover { background:light-dark(#f5f8fa, var(--theme-raised)); text-decoration:none; }
.dealer-directory-store-link:focus-visible, .dealer-directory-group-link:focus-visible { outline:2px solid var(--focus-ring); outline-offset:-3px; }
.dealer-directory-name { display:block; font-size:1.05rem; font-weight:650; overflow-wrap:anywhere; }
.dealer-directory-store-detail { display:grid; gap:.15rem; overflow-wrap:anywhere; }
.dealer-directory-meta { font-size:.78rem; }
.dealer-directory-arrow { color:light-dark(#316780, var(--theme-accent)); }
.dealer-directory-row.is-child .dealer-directory-store-link { padding:.65rem 1rem; }
.dealer-directory-row.is-child .dealer-directory-name { font-size:.9rem; font-weight:550; }
.dealer-directory-row.is-child .dealer-directory-store-detail { font-size:.8rem; }
.dealer-directory-actions { padding:.5rem 1rem .5rem 0; flex-shrink:0; }
.dealer-directory-empty { padding:0 1.25rem 1rem; margin:0; color:var(--muted); font-size:.85rem; }
@media(max-width:700px) {
    .dealer-directory-parent { padding:1rem; align-items:flex-start; flex-wrap:wrap; gap:.5rem; }
    .dealer-directory-children { margin:0 .65rem .75rem 1rem; }
    .dealer-directory-store-link { grid-template-columns:minmax(0,1fr) auto; gap:.35rem .5rem; padding:1rem; }
    .dealer-directory-store-detail { grid-column:1; }
    .dealer-directory-arrow { grid-column:2; grid-row:1 / 3; }
    .dealer-directory-row { flex-wrap:wrap; }
    .dealer-directory-actions { padding:0 1rem .65rem; width:100%; }
    .dealer-directory-actions .lifecycle-menu { left:0; right:auto; }
}

/* Action menus use the browser top layer, independent of card/table stacking. */
.action-menu { display:inline-flex; }
.action-menu-popover { position:fixed; inset:auto; margin:0; min-width:10rem; width:max-content; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow:auto; padding:.4rem; border:1px solid light-dark(#c7d4e2, var(--theme-line)); border-radius:.5rem; background:light-dark(white, var(--theme-surface)); color:light-dark(#193a5b, var(--theme-ink)); box-shadow:0 8px 24px #16324b24; }
.action-menu-popover:popover-open { display:grid; }
.action-menu-popover button, .action-menu-popover a { display:block; width:100%; min-height:2.75rem; padding:.6rem .75rem; border:0; border-radius:.25rem; background:light-dark(white, var(--theme-surface)); color:light-dark(#193a5b, var(--theme-ink)); font:inherit; font-size:.85rem; text-align:left; text-decoration:none; cursor:pointer; white-space:nowrap; }
.action-menu-popover :is(button,a):hover { background:light-dark(#edf3f6, var(--theme-raised)); }
.action-menu-popover :is(button,a):focus-visible { outline:2px solid var(--focus-ring); outline-offset:-2px; }
.action-menu-popover .danger { color:light-dark(#a63124, var(--theme-danger)); }

.store-breadcrumb-trigger { display:inline-flex; align-items:center; gap:.35rem; max-width:100%; padding:0; border:0; background:transparent; color:var(--accent); font:inherit; font-weight:600; text-align:left; cursor:pointer; }
.store-breadcrumb-trigger:hover { text-decoration:underline; text-underline-offset:.2em; }
.store-breadcrumb-trigger:focus-visible { outline:2px solid var(--focus-ring); outline-offset:4px; }
.store-breadcrumb-options { width:20rem; max-height:min(24rem, calc(100dvh - 16px)); }
.store-breadcrumb-options a, .store-breadcrumb-options button, .store-breadcrumb-current, .store-breadcrumb-message { white-space:normal; overflow-wrap:anywhere; line-height:1.5; }
.store-breadcrumb-current, .store-breadcrumb-message { display:block; padding:.6rem .75rem; font-size:.85rem; }
.store-breadcrumb-current, .store-breadcrumb-options a[aria-current=true] { border-radius:.25rem; background:light-dark(#edf3f6, var(--theme-raised)); font-weight:600; }
.store-breadcrumb-message { color:var(--muted); }
.payroll-entry-actions { justify-content:flex-start; margin-top:1rem; }
.payroll-entry-actions .form-actions { justify-content:flex-start; }

.settings-stack[hidden], .settings-card[hidden] { display:none; }

/* Administration and Payroll use one section rail and one spacing owner. */
.section-content.settings-stack > :is(.admin-toolbar,.group-cards,.admin-table-shell,.template-editor,.contractor-enrollment-reviews,.recovery-filters,.recovery-help) { margin-block:0; }
.directory-entity-link { color:var(--ink); font-weight:600; text-decoration:none; }
.directory-entity-link:hover { text-decoration:underline; }
.payroll-job-layout .payroll-register { margin-top:0; }
.payroll-job-layout .payroll-register-toolbar { margin:0; }
.payroll-job-layout .payroll-add-panel { padding:var(--settings-padding); }
.payroll-job-layout .payroll-type-totals { grid-template-columns:repeat(2,minmax(0,1fr)); }
.payroll-job-layout .payroll-type-totals > div { border:1px solid var(--line); border-radius:.5rem; padding:1rem; }
.payroll-export-preview .payroll-table-scroll { overflow-x:auto; }
.payroll-export-preview table { min-width:650px; }
@media(max-width:600px) { .payroll-job-layout .payroll-type-totals { grid-template-columns:minmax(0,1fr); } }

.payroll-job-layout .payroll-contractor-card { margin:0; }

/* Contractor records and contained directory/history tables. */
.section-content > .contractor-directory-shell { min-width: 0; max-width: 100%; overflow-x: auto; }
.contractor-record .contractor-name-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contractor-history-scroll { max-width: 100%; overflow-x: auto; }
.contractor-history-table { width: 100%; min-width: 800px; border-collapse: collapse; font-size: .9rem; }
.contractor-history-table th { text-align: left; background: light-dark(#f4f7fa, var(--theme-raised)); color: light-dark(#607388, var(--theme-muted)); font-size: .75rem; }
.contractor-history-table th, .contractor-history-table td { padding: .8rem .65rem; border-bottom: 1px solid light-dark(#d5e0ea, var(--theme-line)); vertical-align: top; }
.contractor-history-table :is(th, td):nth-child(n+4) { text-align: right; white-space: nowrap; }
.contractor-history-table td:first-child { min-width: 12rem; }
.contractor-history-table td:first-child a { display: inline-block; margin-block: .2rem; }
.contractor-history-table small { display: block; color: var(--muted, light-dark(#607388, var(--theme-muted))); }
@media (max-width: 600px) {
    .contractor-record .contractor-name-grid { grid-template-columns: 1fr; }
    .contractor-history-table { min-width: 0; }
    .contractor-history-table thead { display: none; }
    .contractor-history-table, .contractor-history-table tbody, .contractor-history-table tr, .contractor-history-table td { display: block; width: 100%; }
    .contractor-history-table tr { padding-block: .6rem; border-bottom: 1px solid light-dark(#d5e0ea, var(--theme-line)); }
    .contractor-history-table td { border: 0; padding: .35rem .5rem; overflow-wrap: anywhere; }
    .contractor-history-table td:first-child { min-width: 0; }
    .contractor-history-table td:nth-child(n+4) { text-align: left; white-space: normal; }
    .contractor-history-table td::before { content: attr(data-label); display: block; font-weight: 650; color: light-dark(#607388, var(--theme-muted)); font-size: .75rem; }
}

.payroll-export-selection > .payroll-store-picker { max-width: 32rem; margin-bottom: var(--settings-gap); }
.payroll-export-columns .payroll-selection-heading { min-height: 3.5rem; margin-top: 0; }

/* Shared administration directories: semantic tables, labeled mobile rows and common pills. */
.directory-table-shell { min-width: 0; max-width: 100%; overflow-x: auto; border: 1px solid light-dark(#d5e0ea, var(--theme-line)); border-radius: .65rem; background: light-dark(#fff, var(--theme-surface)); }
.directory-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
.directory-table th { background: light-dark(#f4f7fa, var(--theme-raised)); color: light-dark(#607388, var(--theme-muted)); font-size: .74rem; font-weight: 700; }
.directory-table :is(th, td) { padding: .9rem 1rem; border-bottom: 1px solid light-dark(#e1e7ed, var(--theme-line)); vertical-align: middle; }
.directory-table tbody tr:last-child td { border-bottom: 0; }
.directory-table tbody tr:hover { background: light-dark(#f9fbfd, var(--theme-raised)); }
.directory-table td { overflow-wrap: anywhere; }
.directory-table td small { display: block; color: light-dark(#607388, var(--theme-muted)); line-height: 1.5; margin-top: .2rem; }
.directory-identity { display: flex; align-items: center; gap: .7rem; }
.directory-identity > :last-child { min-width: 0; }
.directory-table .entity-avatar { flex: 0 0 2rem; width: 2rem; height: 2rem; font-size: .7rem; }
.directory-table .table-actions, .directory-table .pill-list { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.directory-table .table-actions .button { margin: 0; }
.directory-table .user-scope-links { margin-top: .4rem; }
.ui-pill, .status-pill, .role-badge { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; max-width: 100%; padding: .22rem .55rem; border: 1px solid light-dark(#d5dfe8, var(--theme-line)); border-radius: 999px; background: light-dark(#f4f7fa, var(--theme-raised)); color: light-dark(#53677b, var(--theme-muted)); font-size: .73rem; font-weight: 600; line-height: 1.4; letter-spacing: normal; text-transform: none; white-space: normal; }
.ui-pill-positive, .status-pill-active { background: light-dark(#edf7f1, var(--theme-positive-soft)); color: light-dark(#286044, var(--theme-positive)); border-color: light-dark(#cce4d6, var(--theme-line)); }
.ui-pill-info, .status-pill-complete { background: light-dark(#edf4fb, var(--theme-raised)); color: light-dark(#315c83, var(--theme-accent)); border-color: light-dark(#cbdfee, var(--theme-line)); }
.ui-pill-warning, .status-pill-review { background: light-dark(#fff7e8, var(--theme-warning-soft)); color: light-dark(#805b20, var(--theme-warning)); border-color: light-dark(#ebd9b2, var(--theme-line)); }
.ui-pill-danger { background: light-dark(#fcf0ef, var(--theme-danger-soft)); color: light-dark(#923d37, var(--theme-danger)); border-color: light-dark(#edcecb, var(--theme-line)); }
.status-pill::before { display: none; }
.template-selection .field { margin-bottom: 0; }
.template-workspace-editor { padding: var(--settings-padding); }
.template-workspace-editor .template-overview { margin: 0 0 var(--settings-gap); flex-wrap: wrap; align-items: center; }
.template-workspace-editor .template-footer { border-top: 1px solid light-dark(#d5e0ea, var(--theme-line)); padding-top: var(--settings-gap); margin-top: var(--settings-gap); }
@media (max-width: 700px) {
    .directory-table thead { display: none; }
    .directory-table, .directory-table tbody, .directory-table tr, .directory-table td { display: block; width: 100%; }
    .directory-table tr { padding: .7rem 0; border-bottom: 1px solid light-dark(#d5e0ea, var(--theme-line)); }
    .directory-table tr:last-child { border-bottom: 0; }
    .directory-table td { padding: .45rem 1rem; border: 0; }
    .directory-table td::before { content: attr(data-label); display: block; color: light-dark(#607388, var(--theme-muted)); font-size: .73rem; font-weight: 650; margin-bottom: .25rem; }
    .directory-table .table-actions { justify-content: flex-start; }
}

.template-selection-value { display: flex; align-items: center; min-height: 2.75rem; padding: .65rem .8rem; border: 1px solid light-dark(#d5e0ea, var(--theme-line)); border-radius: .4rem; background: light-dark(#f4f7fa, var(--theme-raised)); font-size: .9rem; color: light-dark(#53677b, var(--theme-muted)); }

.inventory-workspace-content .settings-stack > :is(.section-title,.section-toolbar,.form-help,.notice) { margin-block:0; }

/* ============ Shared page chrome ============ */
/* One page-title size; :where keeps specialized headings (scanners, sign-in) in charge. */
.workspace-content :where(h1) { font-size: 2rem; line-height: 1.2; }
@media (max-width: 680px) { .workspace-content :where(h1) { font-size: 1.65rem; } }
/* Links use the brand accent unless a component styles them; never the browser default. */
:where(.workspace-content a:link, .workspace-content a:visited) { color: var(--accent); }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 100; padding: .65rem 1rem; border-radius: .4rem; background: light-dark(#fff, var(--theme-surface)); color: light-dark(var(--brand), var(--theme-accent)); font-size: .85rem; font-weight: 700; text-decoration: none; box-shadow: 0 .5rem 1.5rem rgba(10, 22, 38, .25); }
.skip-link:focus { top: .55rem; outline: 2px solid var(--focus-ring); outline-offset: 2px; }
main.workspace-content:focus { outline: none; }
/* Contractor directory: labeled rows on phones, keeping the two sort controls visible. */
@media (max-width: 700px) {
    .contractor-directory-table thead { display: block; background: light-dark(#f4f7fa, var(--theme-raised)); border-bottom: 1px solid light-dark(#d5e0ea, var(--theme-line)); }
    .contractor-directory-table thead tr { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; padding: .55rem 1rem; }
    .contractor-directory-table thead th { display: none; padding: 0; border: 0; }
    .contractor-directory-table thead th[aria-sort] { display: block; width: auto; }
    .contractor-directory-table .contractor-row-action { text-align: left; }
}
/* Secondary row actions read as text links beside the row's main button, with a usable tap target. */
.table-actions .inline-action, .member-row .inline-action { min-height: 2.5rem; padding: .35rem .4rem; font-size: .78rem; font-weight: 700; }
/* Phone rows: the identity and action cells explain themselves, so they carry no label. */
@media (max-width: 700px) {
    .directory-table td:is(:has(> .directory-identity, > .table-actions, > .action-menu), .contractor-name-cell)::before { display: none; }
}
.detail-header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.payroll-entry-table td:is([data-label="Hours"], [data-label="Pay"], [data-label="Rate"]) { white-space: nowrap; }

:is(.directory-table tbody tr, [data-record-row]):has(.directory-entity-link, [data-row-action]) { cursor:pointer; }
:is(.directory-table tbody tr, [data-record-row]):has(.directory-entity-link, [data-row-action]):is(:hover,:focus-within) { background:light-dark(#edf3f6,var(--theme-raised)); }
button.directory-entity-link { padding:0; border:0; background:none; font:inherit; font-weight:600; text-align:left; cursor:pointer; }
.directory-entity-link:focus-visible { outline:2px solid var(--focus-ring); outline-offset:3px; }
