/* Shared full-width, compact workspace. Loaded after page styles. */
body main.container{width:calc(100% - 24px);max-width:none;margin:10px 12px 16px}
body main .container,body main .bp-form-page,body main .employee-profile-page,body main .bp-unit-page,body main .materials-page,body main .lab-workspace{width:100%;max-width:none;margin-left:0;margin-right:0}
body main .card{padding:12px}
body main h1{margin:4px 0 8px;font-size:calc(20px * var(--interface-font-scale, 1))}
body main h2{margin:4px 0 8px;font-size:calc(15px * var(--interface-font-scale, 1))}
body main .bp-form-back,body main .materials-back{margin-bottom:6px}
body main .bp-form-description{margin:3px 0 8px}
body main .bp-form-accent{margin-bottom:6px}
body main .form-group label{margin-bottom:3px;font-size:calc(12px * var(--interface-font-scale, 1))}
body main .form-group{min-width:0;margin-bottom:0}
body main .form-control,body main .bp-form-card input:not([type=checkbox]):not([type=hidden]),body main .bp-form-card select,body main .bp-form-card textarea{width:100%;min-height:max(24px, calc(32px * var(--interface-font-scale, 1)));padding:calc(5px * var(--interface-font-scale, 1)) calc(8px * var(--interface-font-scale, 1));font-size:calc(13px * var(--interface-font-scale, 1));line-height:calc(20px * var(--interface-font-scale, 1));border-radius:5px}
body main textarea.form-control,body main .bp-form-card textarea{height:max(24px, calc(48px * var(--interface-font-scale, 1)));min-height:max(24px, calc(48px * var(--interface-font-scale, 1)));resize:vertical}
body main .bp-form-card form,body main .employee-profile-form,body main .materials-form,body main .service-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 12px;max-width:none;align-items:start}
body main .bp-form-card form>.form-group:has(textarea),body main .employee-profile-form>.form-group.employee-wide{grid-column:span 2}
body main .bp-form-card form>.form-group:has(.errorlist){grid-column:auto}
body main .employee-access-heading{margin:0;padding:6px 0 0}
body main .employee-access-heading h2,body main .employee-access-heading p{margin:0 0 4px;font-size:calc(12px * var(--interface-font-scale, 1))}
body main .employee-form-errors{grid-column:1/-1}
body main .bp-form-actions,body main .materials-actions{margin:6px 0 0;gap:8px}
body main .materials-page .card{margin:8px 0}
body main .materials-page .materials-form>.form-group.materials-wide,body main .service-form>.form-group.materials-wide{grid-column:span 2}
body main .service-checkbox{padding-top:22px}
body main .bp-unit-form>.bp-unit-address{grid-column:span 2}
body main .service-heading,body main .lab-heading{margin-bottom:8px}
body main .order-page-heading{display:flex;align-items:center;gap:16px;margin-bottom:8px}
body main .order-page-heading h1{margin:0}
body main .order-compact .lab-order-form{display:block}
body main .order-fields{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px 12px;align-items:start}
body main .order-description{grid-column:span 2}
body main .order-fields textarea{height:max(24px, calc(32px * var(--interface-font-scale, 1)));min-height:max(24px, calc(32px * var(--interface-font-scale, 1)))}
body main .order-calculation-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:10px;align-items:start}
body main .order-calculation-columns>.calculation{grid-column:auto;min-width:0;margin:0;border-top:1px solid var(--border);padding-top:8px}
body main .calculation-heading h2{margin:0}
body main .calculation p.lab-muted{margin:5px 0;font-size:calc(11px * var(--interface-font-scale, 1))}
body main .order-calculation-columns .calculation-scroll{max-height:clamp(130px,27vh,320px);overflow:auto;scrollbar-gutter:stable}
body main .calculation-table{table-layout:fixed}
body main .calculation-table th:first-child,body main .calculation-table td:first-child{width:40%}
body main .order-calculation-columns .calculation-table th:last-child,body main .order-calculation-columns .calculation-table td:last-child{width:68px;white-space:nowrap;overflow-wrap:normal;word-break:normal;text-align:center}
body main .calculation-table th,body main .calculation-table td{padding:4px;overflow-wrap:anywhere}
body main .calculation-table th{position:sticky;top:0;background:var(--surface);z-index:1}
body main .calculation-table select,body main .calculation-table input[type=number]{min-width:0;width:100%}
body main .calculation-table .line-amount{white-space:nowrap;font-variant-numeric:tabular-nums}
body main .calculation-totals{margin-top:6px;font-size:calc(13px * var(--interface-font-scale, 1))}
body main .extra-labor{margin-top:4px}
body main .order-save-bar{position:sticky;bottom:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--surface);border-top:1px solid var(--border);padding:8px 0 0;margin-top:10px;box-shadow:0 -4px 10px var(--surface)}
body main .order-save-bar .calculation-grand-total{margin:0;padding:6px 10px;gap:16px}
body main .order-save-bar .lab-form-actions{margin:0;flex-wrap:wrap}
body main .restore-lines{border:0;background:none;color:var(--primary);font:inherit;font-size:calc(12px * var(--interface-font-scale, 1));padding:4px 0;cursor:pointer;text-decoration:underline}
body main [hidden]{display:none!important}
body main .company-login-card{max-width:none;margin:8px 0}
body main .company-login-card form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:12px;align-items:start}
body main .company-login-card form>button{margin-top:23px}
body main .company-login-card form>.alert{grid-column:1/-1}
body main .registration-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 14px}
body main .registration-form{width:min(100%,980px);max-width:980px;margin:0 auto}
body main .registration-form + *{text-align:center}
body main .registration-form{position:relative}
body main .registration-form h1{ text-align:center }
body main .card:has(.registration-form)>h1{text-align:center}
body main .registration-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px;grid-column:1/-1}
body main .registration-grid{justify-items:center}
body main .registration-grid>.form-group{width:100%;max-width:250px;text-align:center}
body main .registration-grid>.form-group label{ text-align:center }
body main .registration-grid>.form-group input,
body main .registration-grid>.form-group select,
body main .registration-grid>.form-group textarea{ text-align:center }
body main .registration-grid .company-other{grid-column:3;grid-row:3 / span 2}
body main .registration-grid .company-other #company-fields{display:grid;gap:4px}
body main .registration-grid .company-other{width:100%}
body main .registration-grid .registration-individual{grid-column:1 / span 2}
body main .registration-grid .password-confirm{grid-column:2;grid-row:4;margin-top:0}
body main .registration-grid>.registration-actions{grid-column:1 / span 2;grid-row:4;align-self:end;text-align:center;white-space:nowrap}
body main .registration-grid>.registration-actions .btn{padding:calc(7px * var(--interface-font-scale, 1)) calc(13px * var(--interface-font-scale, 1));font-size:calc(13px * var(--interface-font-scale, 1))}
body main .registration-grid .company-main,
body main .registration-grid>.form-group:not(.company-other){max-width:none}
body main .registration-grid .company-other{max-width:none}
body main .registration-grid .company-other #company-fields>*{width:100%;min-width:0}
body main .registration-user-fields,body main .registration-company-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px;grid-column:1/-1}
body main .registration-company-fields h2{grid-column:1/-1;margin:4px 0 0;font-size:calc(18px * var(--interface-font-scale, 1))}
body main .registration-company-fields .registration-individual{grid-column:1/-1;margin:0}
body main .registration-company-grid{display:contents}
body main .registration-form .form-group{margin:0}
body main .registration-form .form-group label{margin-bottom:2px;font-size:calc(12px * var(--interface-font-scale, 1))}
body main .registration-form .form-help{font-size:calc(11px * var(--interface-font-scale, 1));line-height:1.25}
body main .registration-form input{width:100%;padding:calc(5px * var(--interface-font-scale, 1)) calc(8px * var(--interface-font-scale, 1));min-height:max(24px, calc(32px * var(--interface-font-scale, 1)));border:1px solid var(--border);border-radius:5px;background:#EAF0F7;font:inherit}
body main .registration-form .form-help{font-size:calc(12px * var(--interface-font-scale, 1))}
body main .registration-form .form-help ul{padding-left:18px;margin:4px 0}
body main .registration-actions{grid-column:1/-1}
@media(min-width:1650px){body main .bp-form-card form:not(.bp-unit-form),body main .employee-profile-form,body main .materials-form{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:1199px){body main .order-fields{grid-template-columns:repeat(4,minmax(0,1fr))}body main .order-calculation-columns{grid-template-columns:1fr}body main .bp-form-card form,body main .employee-profile-form,body main .materials-form,body main .service-form{grid-template-columns:repeat(3,minmax(0,1fr))}body main .bp-unit-form>.bp-unit-address{grid-column:auto}}
@media(max-width:850px){body main .order-fields,body main .bp-form-card form,body main .employee-profile-form,body main .materials-form,body main .service-form,body main .registration-form,body main .company-login-card form,body main .registration-user-fields,body main .registration-company-fields,body main .registration-grid{grid-template-columns:repeat(2,minmax(0,1fr))}body main .order-save-bar{flex-wrap:wrap}body main .order-page-heading{flex-wrap:wrap}}
@media(max-width:550px){body main.container{width:calc(100% - 16px);margin:8px}body main .card{padding:10px}body main .order-fields,body main .bp-form-card form,body main .employee-profile-form,body main .materials-form,body main .service-form,body main .registration-form,body main .company-login-card form,body main .registration-user-fields,body main .registration-company-fields,body main .registration-grid{grid-template-columns:minmax(0,1fr)}body main .registration-grid .company-other,body main .registration-grid .registration-individual,body main .registration-grid .password-confirm{grid-column:1;grid-row:auto}body main .form-group,body main .bp-form-card form>.form-group:has(textarea),body main .employee-profile-form>.form-group.employee-wide,body main .materials-page .materials-form>.form-group.materials-wide,body main .service-form>.form-group.materials-wide,body main .bp-unit-form>.bp-unit-address{grid-column:1/-1}body main .calculation-table{min-width:580px}body main .order-save-bar .calculation-grand-total{width:100%;justify-content:space-between}body main .order-calculation-columns .calculation-scroll{max-height:260px}body main .company-login-card form>button{margin-top:0}}
@media(max-width:550px){body main .registration-grid .company-other{position:static;width:100%;}}
body main .registration-grid .company-main{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:end}
body main .registration-grid .company-main>label:first-child{grid-column:1;grid-row:1;align-self:end}
body main .registration-grid .company-main>input{grid-column:1;grid-row:2;width:100%;min-width:0}
body main .registration-grid .company-main .inline-individual{grid-column:2;grid-row:2;align-self:center;font-size:calc(11px * var(--interface-font-scale, 1));white-space:nowrap;margin:0}
body main .registration-grid>.registration-actions{grid-column:1/-1;grid-row:auto;justify-self:center;margin-top:8px}
body main .inline-field-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body main .form-group.inline-date-field{position:relative}
body main .form-group.inline-date-field>label.inline-date-label{position:absolute;z-index:1;top:0;left:9px;max-width:calc(100% - 145px);height:34px;margin:0;font-size:calc(12px * var(--interface-font-scale, 1));line-height:34px;font-weight:400;color:var(--text-secondary);pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body main .form-group.inline-date-field>input.form-control,
body main .bp-form-card .form-group.inline-date-field>input{height:max(24px, calc(34px * var(--interface-font-scale, 1)));min-height:max(24px, calc(34px * var(--interface-font-scale, 1)));box-sizing:border-box;padding:5px 8px 5px 45%;font-size:calc(12px * var(--interface-font-scale, 1));line-height:calc(22px * var(--interface-font-scale, 1));text-align:right}
body main .inline-date-field>input::-webkit-datetime-edit{padding:0;text-align:right;flex:1}
body main .inline-date-field>input::-webkit-datetime-edit-fields-wrapper{display:flex;justify-content:flex-end}
body main .inline-date-field>input::-webkit-calendar-picker-indicator{margin-left:6px}
body main input::placeholder,body main textarea::placeholder{color:var(--text-secondary);opacity:.9}
body main .registration-grid .company-other>label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
/* Stable registration alignment */
body main .registration-grid{align-items:start}
body main .registration-grid{position:relative;padding-bottom:8px}
body main .registration-grid .company-other{position:absolute;right:0;top:108px;width:calc((100% - 24px) / 3);z-index:1}
body main .registration-grid .company-main{display:block;position:relative;width:100%;padding-top:0}
body main .registration-grid .company-main>label:first-child{display:block;width:100%}
body main .registration-grid .company-main>input{display:block;width:100%;min-width:0}
body main .registration-grid .company-main .inline-individual{position:absolute;left:calc(100% + 12px);top:27px;width:max-content;margin:0;display:inline-flex;align-items:center;gap:3px;white-space:nowrap}
body main .registration-grid .company-other #company-fields.is-disabled,
body main .registration-grid .company-other.is-disabled{opacity:.5}
body main .registration-grid .company-other:has(#company-fields.is-disabled){opacity:.55}
body main .registration-grid .company-main .inline-individual input{width:auto}

/* Read-only calculation has an amount column, not a deletion checkbox. */
body main .calculation-table:not(:has(input)) th:last-child,
body main .calculation-table:not(:has(input)) td:last-child{width:18%;min-width:130px;text-align:right;white-space:nowrap;overflow-wrap:normal;font-variant-numeric:tabular-nums}
body main .calculation-table:not(:has(input)) td:nth-child(3),
body main .calculation-table:not(:has(input)) td:nth-child(4){white-space:nowrap;overflow-wrap:normal;font-variant-numeric:tabular-nums}
body main .calculation-totals strong,body main .calculation-grand-total strong{white-space:nowrap}
body main .order-calculation-columns .calculation-table th:nth-child(4),
body main .order-calculation-columns .calculation-table td:nth-child(4){width:20%;white-space:nowrap;overflow-wrap:normal;text-align:right}

/* Compact order summary: status closes the second row on desktop. */
body main .order-summary-card{padding:8px 12px}
body main .lab-detail.order-summary{grid-template-columns:repeat(6,minmax(0,1fr));gap:6px 12px;align-items:start}
body main .order-summary dt{margin-bottom:2px;color:var(--text-secondary);font-size:calc(11px * var(--interface-font-scale, 1))}
body main .order-summary dd{margin:0;font-size:calc(13px * var(--interface-font-scale, 1));line-height:1.35;overflow-wrap:anywhere}
body main .order-summary-status{grid-column:-2/-1}
body main .order-summary-description{margin:6px 0 0;border-top:1px solid var(--border);padding-top:6px}
@media(max-width:1100px){body main .lab-detail.order-summary{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:800px){body main .lab-detail.order-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:450px){body main .lab-detail.order-summary{grid-template-columns:1fr}}

body main .materials-page form.catalog-search-row{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
body main .materials-page form.catalog-search-row>label{display:flex;flex-direction:column;gap:3px;margin:0;font-size:calc(12px * var(--interface-font-scale, 1))}
body main .materials-page form.catalog-search-row .form-control,body main .materials-page form.catalog-search-row>.btn{height:max(24px, calc(32px * var(--interface-font-scale, 1)));min-height:max(24px, calc(32px * var(--interface-font-scale, 1)));margin:0;box-sizing:border-box}
body main .materials-page form.catalog-search-row>.btn{display:inline-flex;align-items:center;justify-content:center;padding:calc(5px * var(--interface-font-scale, 1)) calc(13px * var(--interface-font-scale, 1))}
body.has-workspace-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.workspace-shell {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(12rem, 14rem) minmax(0, 1fr);
}

.workspace-sidebar {
    border-inline-end: 1px solid var(--border);
    background: var(--surface);
}

.workspace-sidebar nav {
    position: sticky;
    top: 0;
    box-sizing: border-box;
    max-height: 100dvh;
    overflow-y: auto;
    padding: .4rem .5rem;
}

.workspace-sidebar .lab-menu-link,
.workspace-sidebar .menu-group > summary {
    font-family: "Segoe UI Light", "Segoe UI", "Helvetica Neue", sans-serif !important;
    font-size: calc(13px * var(--interface-font-scale, 1));
    font-weight: 300;
    letter-spacing: .015em;
    line-height: 1.3;
    padding-block: .3rem;
}

.workspace-sidebar .menu-group {
    margin-top: .2rem;
    padding-top: .15rem;
}

.workspace-sidebar .lab-menu-link[aria-current="page"] {
    font-family: "Segoe UI", "Helvetica Neue", sans-serif !important;
    font-weight: 400;
}

@media (max-width: 760px) {
    .workspace-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    .workspace-sidebar {
        border-inline-end: 0;
        border-bottom: 1px solid var(--border);
    }

    .workspace-sidebar nav {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
        align-items: start;
    }
}

