.staff-workspace {
    --worksheet-columns: minmax(0, 1.45fr) minmax(0, 1.05fr) minmax(66px, .65fr) minmax(74px, .75fr) minmax(82px, .85fr) minmax(78px, .8fr);
}

.staff-workspace main { max-width: none; padding: 18px clamp(16px, 2vw, 32px); }
.staff-workspace .topbar { height: auto; padding-block: 6px; justify-content: flex-end; }
.staff-workspace .topbar > span:first-child { display: none; }
.staff-workspace .session-bar { padding: 5px clamp(16px, 2vw, 32px); font-size: 13px; }
.staff-workspace .sidebar-note { display: none; }
.staff-workspace [data-rate][aria-invalid="true"] { border-color: #a92332; outline: 1px solid #a92332; }
.staff-workspace .unit-price-error { color: #a92332; font-size: .82rem; }
.upload-example { overflow-x: auto; padding: 12px; background: #f4f8fb; }
.upload-order { padding-block: 12px; border-top: 1px solid var(--line); }
.staff-workspace .page-heading { margin-bottom: 12px; align-items: center; }
.staff-workspace .page-heading h1 { font-size: clamp(24px, 3vw, 32px); }
.staff-workspace .list-panel, .staff-workspace .panel { padding: 14px; margin-bottom: 12px; }
.staff-workspace .filters { padding: 0; margin: 0 0 10px; border: 0; }
.staff-workspace .filters label, .staff-workspace .row-actions { font-size: 14px; }
.staff-workspace .order-customer-panel label { font-size: 14px; }
.staff-workspace input, .staff-workspace select, .staff-workspace textarea { font-size: 16px; }
.staff-workspace .button { font-size: 14px; }
.staff-workspace .filters .button, .staff-workspace .order-action-bar .button { margin-top: 0; }
.staff-workspace .page-heading > .button { flex-shrink: 0; }
.staff-workspace .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.staff-workspace .numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.staff-workspace :is(.work-table, .weight-table, .production-item-table) { min-width: 0; width: 100%; }
.staff-workspace :is(.work-table, .weight-table, .production-item-table) th {
    font-size: 13px;
    letter-spacing: 0;
    line-height: 1.25;
    text-transform: none;
}
.staff-workspace :is(.work-table, .weight-table, .production-item-table) td { font-size: 15px; padding: 9px 10px; }
.staff-workspace :is(.work-table, .weight-table, .production-item-table) td strong { font-size: inherit; }
.staff-workspace :is(.work-table, .weight-table, .production-item-table) td small { font-size: 13px; margin-top: 2px; }
.staff-workspace :is(.work-table, .weight-table, .production-item-table) tbody tr:nth-child(even) { background: #f6f8f3; }
.staff-workspace .work-table td, .staff-workspace .weight-table td { overflow-wrap: anywhere; }
.staff-workspace .row-actions { align-items: center; gap: 6px 12px; min-width: 0; }
.staff-workspace .row-actions a { text-underline-offset: 3px; }
.staff-workspace .row-primary { background: #e4eee2; border-radius: 4px; padding: 6px 8px; font-weight: 650; }
.staff-workspace .pill { font-size: 13px; font-weight: 650; }
.staff-workspace .status-preparing { background: #fff0cf; color: #614000; }
.staff-workspace .status-ready, .staff-workspace .status-completed { background: #deeee1; color: #184c2c; }
.staff-workspace .status-cancelled { background: #f8e3e5; color: #7e2231; }
.staff-workspace .alphabet a { padding: 7px; min-width: 34px; }
.frequent-customers { margin-top: 16px; }
.frequent-customers > p { margin-bottom: 0; }
.frequent-customer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.frequent-customer-grid a {
    display: block;
    height: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--control-border, var(--line));
    border-radius: 6px;
    color: var(--teal);
    font-weight: 600;
    overflow-wrap: anywhere;
}
.frequent-customer-grid a:hover { text-decoration: underline; }
.frequent-customer-grid small { margin-inline-start: 6px; color: var(--muted); font-weight: 400; white-space: nowrap; }
@media (max-width: 960px) {
    .frequent-customer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .frequent-customer-grid { grid-template-columns: minmax(0, 1fr); }
}
.staff-workspace .pending-summary { margin: 8px 0; }
.staff-workspace .queue-filters .filter-advanced { flex-basis: 100%; padding: 0; border: 0; }
.staff-workspace .queue-filters .filter-advanced > summary { padding: 4px 0; }
.staff-workspace .queue-filters .filter-advanced .filters { margin: 6px 0 0; }

.staff-workspace .production-date-form { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(145px, 200px)) auto; }
.production-extra { grid-column: 1 / -1; padding: 0; border-bottom: 0; }
.staff-workspace .production-extra summary { padding: 4px 0; }
.staff-workspace .production-extra .filters { margin: 8px 0 0; }
.staff-workspace .production-table-heading { padding: 0; margin: 0 0 8px; }
.staff-workspace .production-table-heading h2 { margin: 0; }
.staff-workspace #product-weights { padding: 14px; margin: 0 0 12px; }
.staff-workspace .stage-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.staff-workspace .stage-links [aria-current] { background: #e4eee2; border-color: #77927b; }
.staff-workspace .production-drilldown { margin-top: 12px; }

.staff-workspace .customer-finder { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: end; }
.customer-finder #customer-search-status, .customer-finder #customer-results { grid-column: 1 / -1; grid-row: auto; }
.customer-finder #clear-customer { grid-column: 2; grid-row: 1; margin: 0; }
.customer-finder #customer-search-status:empty, .customer-finder #customer-results:empty,
#customer-selection:empty, #customer-save-message:empty { display: none; }
#selected-customer, #new-customer-fields { min-width: 0; overflow-wrap: anywhere; }
.staff-workspace .order-customer-panel .form-grid { gap: 8px 14px; }
.staff-workspace .order-schedule { margin-top: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.staff-workspace .order-date { margin: 0; }
.staff-workspace .order-date dt { font-size: .9rem; font-weight: 600; }
.staff-workspace .order-date dd { margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.staff-workspace .order-products h2 { margin-bottom: 8px; }
.staff-workspace .line-headings { display: none; }
.staff-workspace .catalogue-line { padding: 3px 8px; margin: 2px 0 5px; }
.staff-workspace .catalogue-line > [data-line-disclosure] { padding: 0; border: 0; }
.staff-workspace .catalogue-line > [data-line-disclosure] > summary { font-size: 14px; padding-block: 7px; min-height: 38px; }
.staff-workspace .line-edit-label { font-size: 13px; }
.staff-workspace .catalogue-line > .line-summary-remove { min-height: 32px; font-size: 13px; top: 4px; right: 6px; }
.staff-workspace .catalogue-line .line-fields { padding-top: 6px; margin: 0; gap: 6px; align-items: end; }
.staff-workspace .line-cell { min-width: 0; }
.staff-workspace .line-cell > span { display: block; font-size: 14px; }
.staff-workspace .line-cell input, .staff-workspace .line-cell select { padding-inline: 7px; }
.staff-workspace .line-cell input, .staff-workspace .line-cell output { text-align: right; font-variant-numeric: tabular-nums; }
.staff-workspace .line-net output { display: block; padding: 10px 0; font-weight: 700; overflow-wrap: anywhere; }
.staff-workspace .line-fields > [data-line-weight] { font-size: 14px; margin: 0; }
.staff-workspace .line-fields > [data-custom] { padding: 0; border: 0; }
.staff-workspace .line-fields > [data-custom] > summary { padding: 2px 0; }
.staff-workspace #order-totals { max-width: 440px; }

@media screen and (min-width: 1050px) {
    .staff-workspace .line-headings,
    .staff-workspace .catalogue-line .line-fields { display: grid; grid-template-columns: var(--worksheet-columns); gap: 8px; }
    .staff-workspace .line-headings {
        padding: 7px 9px;
        background: #ecf0e8;
        font-size: 13px;
        font-weight: 650;
    }
    .staff-workspace .line-headings span:nth-child(n+3) { text-align: right; }
    .staff-workspace .line-cell > span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
}

@media screen and (max-width: 760px) {
    .staff-workspace main { padding: 12px; }
    .staff-workspace .brand { padding: 5px 0; }
    .staff-workspace .nav-label { display: none; }
    .staff-workspace .mobile-workspace-tools { margin-top: 6px; }
    .staff-workspace .production-date-form, .staff-workspace .order-schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .staff-workspace .production-date-form > .row-actions { grid-column: 1 / -1; }
    .staff-workspace .customer-finder { grid-template-columns: minmax(0, 1fr); }
    .customer-finder #clear-customer { grid-column: 1; grid-row: auto; justify-self: start; }
    .staff-workspace .catalogue-line .line-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .staff-workspace .line-fields > .line-cell:nth-of-type(-n+3) { grid-column: 1 / -1; }
    .staff-workspace .line-net { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
    .staff-workspace .line-net output { padding: 4px 0; }
    .staff-workspace .date-entry { gap: 3px; }
    .staff-workspace .date-entry [data-date-open] { padding: 3px; flex-basis: 34px; }
    .staff-workspace .page-heading { flex-wrap: wrap; }
    .staff-workspace .desktop-order-action { display: none; }
    .staff-workspace .queue-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .staff-workspace .queue-filters > label { min-width: 0; }
    .staff-workspace .queue-filters > :is(label:first-child, details) { grid-column: 1 / -1; }
    .staff-workspace .queue-filters > .button { margin: 0; }
    .staff-workspace :is(.weight-table, .work-table) thead { display: none; }
    .staff-workspace :is(.weight-table, .work-table) tbody { display: block; }
    .staff-workspace :is(.weight-table, .work-table) tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
    .staff-workspace :is(.weight-table, .work-table) td { display: block; text-align: left; width: auto; border: 0; padding: 6px 8px; }
    .staff-workspace :is(.weight-table, .work-table) td:is(:first-child, [data-label="Actions"], .empty) { grid-column: 1 / -1; }
    .staff-workspace .weight-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
    .staff-workspace .weight-table td:first-child::before { display: none; }
    .staff-workspace .weight-table td.numeric { font-size: 14px; }
    .staff-workspace .stage-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .staff-workspace td[data-label]::before { font-size: 12px; white-space: normal; }
    .staff-workspace .row-actions a { padding: 7px 2px; }
}

@media print {
    .staff-workspace .weight-table { display: table; }
    .staff-workspace .weight-table thead { display: table-header-group !important; }
    .staff-workspace .weight-table tbody { display: table-row-group; }
    .staff-workspace .weight-table tr { display: table-row; break-inside: avoid; }
    .staff-workspace .weight-table td { display: table-cell; }
    .staff-workspace .weight-table td::before { content: none !important; }
}
