/* Service screens: real CRM forms and APIs, styled to the approved v4 handoff. */
.v4-service-register,.v4-schedule,.v4-order-editor{color:var(--fg,#262726);font-size:13px;line-height:1.4;font-variant-numeric:tabular-nums}
.v4-service-register .page-heading{display:flex;align-items:center;gap:8px;margin:0 0 12px;flex-wrap:wrap}
.v4-service-register .page-heading>div{margin-right:auto}.v4-service-register .page-heading h1{font-size:20px;letter-spacing:-.3px}.v4-service-register .page-heading p{margin:2px 0 0;color:var(--fg-3,#6e737b);font-size:12px}
.v4-service-register .history-panel{padding:0;border:1px solid var(--line,#e3e6ea);border-radius:8px;background:var(--surface,#fff);box-shadow:none;overflow:clip;margin-bottom:12px}
.v4-service-register .report-scroll{margin:0}.v4-service-register .report-table{width:100%;border-collapse:collapse;background:var(--surface,#fff)}
.v4-service-register .report-table th{height:32px;padding:7px 10px;background:var(--surface-2,var(--bg,#f3f4f6));color:var(--fg-2,#5d626a);font-size:10px;letter-spacing:.65px;text-transform:uppercase;font-weight:500;white-space:nowrap;border-bottom:1px solid var(--line,#e3e6ea)}
.v4-service-register .report-table td{height:38px;padding:6px 10px;font-size:12px;vertical-align:middle;border-bottom:1px solid var(--line,#e3e6ea);color:var(--fg,#262726);background:var(--surface,#fff)}
.v4-service-register .report-table td small{display:block;font-size:11px;color:var(--fg-3,#6e737b);line-height:1.35}.v4-service-register .report-table tr:last-child td{border-bottom:0}
.v4-service-register .report-table tr:hover>td,.v4-service-register .report-table .order-open-row:hover>td{background:var(--surface-2,var(--bg,#f3f4f6))}
.v4-service-register .report-table .order-open-row>td{box-shadow:none;border-bottom:1px solid var(--line,#e3e6ea);background:var(--surface,#fff)}
.v4-service-register .report-table .order-open-row>td:first-child strong{color:var(--info,#2f64c8)}
.v4-service-register .report-table .secondary{min-height:28px;height:28px;padding:4px 9px;font-size:12px;background:var(--surface,#fff);color:var(--fg,#262726)}
.v4-service-register .receipt-posted .receipt-status,.v4-service-register .order-state-paid,.v4-service-register .order-state-closed{background:var(--ok-soft,#e8f4ec);color:var(--ok,#1e7a45)}
.v4-service-register .order-state-working{background:var(--accent-soft,#fff1e8);color:var(--accent-ink,#9a3f06)}
.v4-service-register .receipt-draft .receipt-status,.v4-service-register .order-state-draft{background:var(--warn-soft,#fff4d8);color:var(--warn,#8f5600)}
.v4-service-register .order-state-ready{background:var(--info-soft,#eaf0fc);color:var(--info,#2f64c8)}
.v4-service-register .order-state-cancelled{background:var(--bad-soft,#fceae8);color:var(--bad,#b9342b)}
.v4-service-register .access-pill,.v4-service-register .receipt-status{border:0;border-radius:4px;font-size:11px;padding:3px 5px;white-space:nowrap;display:inline-block}
.v4-service-register .order-filters{display:flex;align-items:end;flex-wrap:wrap;padding:12px;gap:8px;margin:0;border-bottom:1px solid var(--line,#e3e6ea)}
.v4-service-register .order-filters>label:first-child{flex:1;min-width:230px}.v4-service-register .order-filters>label{min-width:130px}.v4-service-register .order-filters>button{flex:none}
.v4-service-register .order-filters input,.v4-service-register .order-filters select{margin:0}.v4-service-register .order-pagination{padding:8px 12px;margin:0;font-size:11px;color:var(--fg-3,#6e737b)}
.v4-service-segments{display:flex;align-items:stretch;gap:0;max-width:100%;overflow:auto;border:1px solid var(--line,#e3e6ea);border-radius:6px;width:max-content;background:var(--surface,#fff);margin:0 0 12px}
.v4-service-segments button{min-height:30px;padding:5px 11px;border:0;border-right:1px solid var(--line,#e3e6ea);border-radius:0;background:transparent;color:var(--fg-2,#5d626a);white-space:nowrap;font:inherit;font-size:12px;cursor:pointer}.v4-service-segments button:last-child{border-right:0}
.v4-service-segments button[aria-pressed=true]{background:var(--fg,#262726);color:var(--surface,#fff)}.v4-service-segments button span{font-size:11px;opacity:.8;margin-left:3px}
.v4-register-controls{display:flex;align-items:start;justify-content:space-between;gap:12px;margin:0 0 12px;flex-wrap:wrap}.v4-register-controls .v4-service-segments{margin:0}.v4-register-controls>input{width:280px;max-width:100%;margin:0}
.v4-stock-summary{display:flex;gap:16px;margin-bottom:12px;flex-wrap:wrap}.v4-stock-summary>span{display:flex;gap:12px;align-items:center;color:var(--fg-2,#5d626a);padding:8px 12px;background:var(--surface,#fff);border:1px solid var(--line,#e3e6ea);border-radius:6px;font-size:12px}.v4-stock-summary strong{font-size:17px;color:var(--fg,#262726)}
.v4-stock-bar{display:block;width:64px;height:3px;border-radius:2px;margin-top:4px;background:var(--line,#e3e6ea);overflow:hidden}.v4-stock-bar i{display:block;height:100%;background:var(--ok,#1e7a45)}
.v4-service-register .stock-ok{color:var(--ok,#1e7a45)!important}.v4-service-register .stock-low{color:var(--bad,#b9342b)!important}
.v4-stock-movements>summary{padding:10px 12px;font-weight:600;cursor:pointer}.v4-stock-movements>summary span{font-weight:400;color:var(--fg-3,#6e737b);margin-left:6px}
.v4-service-empty{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:12px;min-height:110px;color:var(--fg-3,#6e737b)}
.v4-receipt-advisory{padding:10px 12px;border-radius:6px;margin:0 0 12px;background:var(--warn-soft,#fff4d8);color:var(--warn,#8f5600);font-size:12px}
.v4-service-register .v4-receipt-duplicate{color:var(--warn,#8f5600);font-size:10px}.v4-receipt-comment{max-width:400px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.v4-money{font-weight:600;white-space:nowrap}.v4-mono{font-family:var(--font-mono,'JetBrains Mono',ui-monospace,monospace);font-size:11px}
.v4-service-register #ic-order-sync{font-size:12px;margin:0 0 10px;color:var(--fg-3,#6e737b)}
/* Order: a fixed-size calculation/contact rail, with workspace width for the real editable form. */
.order-form.v4-order-editor{overflow:visible;background:transparent;border:0;border-radius:0}
.v4-order-editor>.order-toolbar{padding:0 0 12px;min-height:44px;gap:8px;border:0;background:var(--bg,#f3f4f6);flex-wrap:wrap;z-index:5}
.v4-order-editor>.order-toolbar h1{font-size:20px;letter-spacing:-.3px}.v4-order-editor>.order-toolbar #save-state{font-size:11px;color:var(--fg-3,#6e737b)}.v4-order-editor>.order-toolbar #order-total{font-size:22px;letter-spacing:-.3px}
.v4-order-editor>.error:not(:empty){margin:0 0 12px;padding:9px 12px;background:var(--bad-soft,#fceae8);border:1px solid var(--bad,#b9342b);border-radius:6px}
.v4-order-body{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:12px;align-items:start}.v4-order-main{min-width:0;border:1px solid var(--line,#e3e6ea);border-radius:8px;background:var(--surface,#fff);overflow:visible}.v4-order-aside{display:grid;gap:12px;min-width:0}
.v4-service-card{min-width:0;border:1px solid var(--line,#e3e6ea);border-radius:8px;background:var(--surface,#fff);overflow:clip}.v4-service-card>h2{font-size:14px;font-weight:600;margin:0;padding:10px 14px;border-bottom:1px solid var(--line,#e3e6ea);color:var(--fg,#262726)}
.v4-calculation,.v4-order-contact{padding:12px 14px}.v4-calculation>div{display:flex;justify-content:space-between;gap:12px;margin:0 0 5px;font-size:12px}.v4-calculation>div>span{color:var(--fg-2,#5d626a)}.v4-calculation>div>strong{font-weight:500}.v4-calculation .v4-calculation-total{border-top:1px solid var(--line,#e3e6ea);padding-top:6px;font-weight:600}.v4-calculation .v4-calculation-total>*{color:var(--fg,#262726);font-weight:600}.v4-calculation .v4-calculation-due strong{color:var(--bad,#b9342b);font-weight:600}.v4-calculation>p{font-size:11px;color:var(--fg-3,#6e737b);margin:10px 0 0;line-height:1.5}
.v4-contact-heading{display:flex;gap:10px;align-items:center;margin-bottom:12px}.v4-contact-heading>strong{overflow-wrap:anywhere}.v4-contact-heading button{margin-left:auto;flex:none;min-height:28px;padding:3px 8px}.v4-contact-avatar{width:36px;height:36px;flex:none;display:grid;place-items:center;background:var(--accent-soft,#fff1e8);color:var(--accent-ink,#9a3f06);border-radius:50%;font-weight:600}
.v4-order-contact dl{display:grid;grid-template-columns:90px minmax(0,1fr);gap:7px 12px;margin:0;font-size:12px}.v4-order-contact dt{color:var(--fg-3,#6e737b)}.v4-order-contact dd{margin:0;overflow-wrap:anywhere}.v4-order-contact .field-help{font-size:11px;color:var(--fg-3,#6e737b);margin:12px 0 0}
.v4-order-editor .order-meta{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:12px 14px 8px}.v4-order-editor .order-author{grid-column:1/-1;color:var(--fg-3,#6e737b);font-size:11px;display:flex;gap:6px;align-items:center}.v4-order-editor .order-author br{display:none}.v4-order-editor .order-author span{color:var(--fg-2,#5d626a)}
.v4-order-editor .order-lifecycle{margin:0 14px;padding:0 0 6px;border:0}.v4-order-editor .order-lifecycle h2{display:none}.v4-order-editor .order-lifecycle-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}.v4-order-editor .order-life-stage{background:none!important;border:0;border-top:3px solid var(--line,#e3e6ea);border-radius:0;gap:1px;padding:4px 0 0}.v4-order-editor .order-life-stage.recorded{border-top-color:var(--ok,#1e7a45)}.v4-order-editor .order-life-stage>span{color:var(--fg,#262726);font-size:10px;font-weight:600}.v4-order-editor .order-life-stage>strong{font-size:10px;font-weight:400;color:var(--fg-3,#6e737b)}
.v4-order-editor .order-tabs{padding:0 10px;gap:2px;overflow:auto;background:var(--surface,#fff);border-color:var(--line,#e3e6ea)}.v4-order-editor .order-tabs button{padding:9px 10px;white-space:nowrap;font-size:12px;color:var(--fg-2,#5d626a);border-bottom-width:2px}.v4-order-editor .order-tabs button[aria-selected=true]{background:var(--surface,#fff);color:var(--fg,#262726);border-color:var(--accent,#f46b18)}
.v4-order-editor .order-tab-panel{padding:14px;min-height:300px}.v4-order-editor .order-main-grid{gap:18px}.v4-order-editor .order-main-grid h2{font-size:10px;text-transform:uppercase;letter-spacing:.8px;color:var(--fg-2,#5d626a);margin:0 0 10px;font-weight:500}.v4-order-editor .order-main-grid h2:not(:first-child){margin-top:10px}.v4-order-editor .order-main-grid label{display:flex;flex-direction:column;align-items:stretch;font-size:12px;gap:4px;margin-bottom:10px;color:var(--fg-2,#5d626a)}
.v4-order-editor input,.v4-order-editor select,.v4-order-editor textarea{background:var(--surface,#fff);color:var(--fg,#262726);border-color:var(--line,#e3e6ea);font-size:12px;border-radius:5px}.v4-order-editor input,.v4-order-editor select{height:32px;padding:5px 9px}.v4-order-editor .order-main-grid textarea{min-height:85px;line-height:1.5}.v4-order-editor input:disabled,.v4-order-editor textarea:disabled,.v4-order-editor select:disabled{color:var(--fg-2,#5d626a);background:var(--surface-2,var(--bg,#f3f4f6));opacity:1}
.v4-order-editor .order-lookup-button{width:28px;height:30px;min-height:28px;font-size:19px;background:var(--surface,#fff);border-color:var(--line,#e3e6ea);color:var(--fg-2,#5d626a)}.v4-order-editor .vin-input-row>button{height:32px;min-height:32px;padding:4px 8px}.v4-order-editor .order-line-tools{flex-wrap:wrap;margin-bottom:10px}.v4-order-editor .order-line-tools>span{flex-basis:100%;font-size:11px}.v4-order-editor .order-footnote{color:var(--fg-3,#6e737b);background:var(--surface-2,var(--bg,#f3f4f6));border-color:var(--line,#e3e6ea);font-size:10px}
.v4-order-editor .card{padding:12px;margin:0 14px 12px;border:1px solid var(--line,#e3e6ea);border-radius:6px;background:var(--surface,#fff)}
.receipt-editor{background:var(--surface,#fff);border-color:var(--line,#e3e6ea)}.receipt-editor .order-toolbar{background:var(--surface,#fff);border-color:var(--line,#e3e6ea)}.receipt-editor .receipt-meta{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.receipt-editor .receipt-table{padding-bottom:80px;min-height:250px}.receipt-editor .receipt-table th,.receipt-editor .receipt-table td{font-size:12px}.receipt-editor .receipt-source{background:var(--warn-soft,#fff4d8);border-color:var(--line,#e3e6ea);color:var(--warn,#8f5600);font-size:12px;border-radius:6px}.receipt-editor .receipt-confirm{color:var(--fg,#262726)}
/* Calendar positions and quarter-hour cells share the same 0.8px/minute scale. */
.v4-schedule .schedule-toolbar{gap:8px;margin:0 0 8px;align-items:center}.v4-schedule .schedule-toolbar h1{font-size:20px;letter-spacing:-.3px;margin-right:4px}.v4-schedule .schedule-toolbar .primary{margin-left:auto}.v4-schedule .schedule-toolbar input,.v4-schedule .schedule-toolbar select,.v4-schedule .schedule-toolbar button{height:32px;min-height:32px;font-size:12px;padding:5px 9px;border-radius:5px;background:var(--surface,#fff);color:var(--fg,#262726);border:1px solid var(--line,#e3e6ea)}.v4-schedule .schedule-toolbar .primary{background:var(--accent-strong,#c4500a);color:#fff;border-color:var(--accent-strong,#c4500a)}
.v4-schedule .v4-calendar-modes{margin:0;border-radius:5px}.v4-schedule .v4-calendar-modes button{border:0;border-right:1px solid var(--line,#e3e6ea);border-radius:0}.v4-schedule .v4-calendar-modes button[aria-pressed=true]{background:var(--fg,#262726);color:var(--surface,#fff)}
.v4-schedule #sch-mode{max-width:125px}.v4-schedule #sch-post{max-width:125px}.v4-schedule .sch-summary{font-size:11px;margin:0 0 10px;color:var(--fg-2,#5d626a);gap:12px}.v4-schedule .sch-summary span{color:var(--fg-3,#6e737b)}
.v4-schedule .schedule-scroll{max-height:calc(100dvh - 150px);border-color:var(--line,#e3e6ea);border-radius:8px;background:var(--surface,#fff)}.v4-schedule .schedule-column-title{text-align:left;padding:7px 9px;background:var(--surface-2,var(--bg,#f3f4f6));border-color:var(--line,#e3e6ea);font-size:12px}.v4-schedule .schedule-column-title small{font-size:10px;color:var(--fg-3,#6e737b)}
.v4-schedule .schedule-hours>div,.v4-schedule .schedule-slot{height:12px;min-height:12px;box-sizing:border-box;line-height:12px;padding:0;border-bottom:1px solid var(--line,#e3e6ea);background:var(--surface,#fff)}.v4-schedule .schedule-hours>div{font-size:10px;padding-right:6px;text-align:right;color:var(--fg-3,#6e737b);border-bottom-color:transparent}.v4-schedule .schedule-track{border-color:var(--line,#e3e6ea)}.v4-schedule .schedule-slot:nth-child(4n+1){border-top:0}.v4-schedule .schedule-slot:disabled{background:repeating-linear-gradient(135deg,var(--surface,#fff),var(--surface,#fff) 3px,var(--line,#e3e6ea) 4px,var(--surface,#fff) 5px)}.v4-schedule .schedule-slot:not(:disabled):hover{background:var(--accent-soft,#fff1e8)}
.v4-schedule .schedule-event{border:1px solid color-mix(in srgb,var(--info,#2f64c8) 25%,var(--line,#e3e6ea));background:var(--info-soft,#eaf0fc);color:var(--fg,#262726);border-radius:5px;font-size:11px;line-height:1.2}.v4-schedule .schedule-position .schedule-event{padding:3px 6px;display:flex;flex-direction:column;justify-content:center;align-items:start;position:relative}.v4-schedule .schedule-position .schedule-event b{font-size:10px;font-weight:400;order:2}.v4-schedule .schedule-position .schedule-event span{font-size:11px;font-weight:600;order:1;max-width:100%}.v4-schedule .schedule-position .schedule-event small{display:block;font-size:10px;order:3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.v4-schedule .sch-week-scroll,.v4-schedule .sch-agenda{border-color:var(--line,#e3e6ea);background:var(--surface,#fff);border-radius:8px}.v4-schedule .sch-week th{background:var(--surface-2,var(--bg,#f3f4f6));color:var(--fg,#262726)}.v4-schedule .sch-week th,.v4-schedule .sch-week td{border-color:var(--line,#e3e6ea)}
.schedule-appointment-dialog .booking-board,.schedule-appointment-dialog .booking-details{background:var(--surface,#fff);color:var(--fg,#262726)}.schedule-appointment-dialog .booking-layout{gap:14px}.schedule-appointment-dialog .booking-selection{font-size:12px;background:var(--info-soft,#eaf0fc);border-radius:5px;padding:8px}.schedule-appointment-dialog .booking-selection.ready{background:var(--ok-soft,#e8f4ec);color:var(--ok,#1e7a45)}
@media(min-width:1600px){.v4-order-body{grid-template-columns:minmax(0,1fr) 400px}}
@media(max-width:1100px){.v4-order-body{grid-template-columns:minmax(0,1fr) 280px}.v4-order-editor .order-toolbar #save-state{display:none}.v4-order-editor .order-toolbar h1{font-size:18px}.v4-order-editor .order-main-grid{gap:12px}.v4-order-contact dl{grid-template-columns:72px minmax(0,1fr);gap:7px}.v4-schedule .schedule-toolbar #sch-post{display:none}}
@media(max-width:860px){.v4-order-body{grid-template-columns:1fr}.v4-order-aside{grid-template-columns:1fr 1fr}.v4-order-editor .order-toolbar{position:sticky;top:0}.v4-order-editor .order-toolbar #order-total{font-size:18px}.v4-service-register .order-filters{gap:8px}.v4-schedule .schedule-toolbar{flex-wrap:wrap}.v4-schedule .schedule-scroll{max-height:calc(100dvh - 195px)}}
@media(max-width:600px){.v4-order-aside{grid-template-columns:1fr}.v4-order-editor .order-main-grid{grid-template-columns:1fr}.v4-order-editor .order-meta{grid-template-columns:1fr 1fr}.v4-order-editor .order-meta>label:nth-child(3){grid-column:1/-1}.v4-order-editor .order-life-stage>span{font-size:9px}.v4-order-editor .order-life-stage>strong{font-size:9px}.v4-order-editor .order-tabs{padding:0}.v4-order-editor .order-tab-panel{padding:12px}.v4-order-editor .order-toolbar .primary,.v4-order-editor .order-toolbar .secondary{font-size:11px;padding:5px 8px}.v4-register-controls>input{width:100%}.v4-service-register .order-filters>label{min-width:100px;flex:1}.v4-service-register .order-filters>label:first-child{min-width:100%;flex-basis:100%}.v4-service-register .report-table{min-width:760px}.v4-stock-summary{gap:6px}.v4-stock-summary>span{font-size:10px;padding:6px 8px;gap:7px}.v4-stock-summary strong{font-size:15px}.receipt-editor .receipt-meta{grid-template-columns:1fr 1fr}.v4-schedule .schedule-toolbar h1{width:100%;margin:0}.v4-schedule .schedule-toolbar #sch-date{width:130px}.v4-schedule .schedule-toolbar #sch-dep{max-width:150px}.v4-schedule .schedule-toolbar #sch-mode{max-width:100px}.v4-schedule .sch-summary span{display:none}}
.v4-schedule .schedule-toolbar #sch-date{width:138px;flex:none;margin:0}.v4-schedule .schedule-toolbar select{width:auto;margin:0}.v4-schedule .schedule-toolbar .v4-calendar-modes{flex:none}
.v4-order-editor .danger-link{height:30px;min-height:30px;border:1px solid var(--line,#e3e6ea);border-radius:5px;background:var(--surface,#fff);color:var(--bad,#b9342b);font-size:12px;padding:5px 9px;cursor:pointer}
.v4-contact-copy-row{display:flex;align-items:center;gap:5px;min-width:0}.v4-contact-copy-row>span{min-width:0;overflow-wrap:anywhere}.v4-contact-copy-row>.contact-copy{border:0;background:transparent;color:var(--fg-3,#6e737b);font-size:13px;padding:2px 4px;height:24px;min-height:24px;border-radius:4px;cursor:pointer}.v4-contact-copy-row>.contact-copy:hover{background:var(--surface-2,#f8f9fa);color:var(--accent-ink,#9a3f06)}
.v4-service-error{background:var(--surface,#fff);border:1px solid var(--bad-line,#edb3ad);border-radius:8px;padding:24px;max-width:600px;margin:30px auto;text-align:center}.v4-service-error h2{font-size:17px}.v4-service-error p{color:var(--fg-2,#5d626a);font-size:13px}
.v4-order-more{position:relative;flex:none}.v4-order-more>summary{display:grid;place-items:center;list-style:none;border:1px solid var(--line,#e3e6ea);border-radius:5px;background:var(--surface,#fff);color:var(--fg,#262726);width:32px;height:32px;font-size:13px;cursor:pointer}.v4-order-more>summary::-webkit-details-marker{display:none}.v4-order-more>div{position:absolute;right:0;top:36px;min-width:210px;display:grid;gap:4px;background:var(--surface,#fff);border:1px solid var(--line,#e3e6ea);border-radius:6px;box-shadow:var(--shadow-pop,0 10px 30px #0002);padding:6px;z-index:20}.v4-order-more>div>button{text-align:left;width:100%;white-space:normal}.v4-manager-hint{color:var(--warn,#8f5600);font-size:10px;line-height:1.3}.v4-manager-hint:empty{display:none}.v4-order-editor .v4-unassigned{border-color:var(--warn-line,#edd08a)}
/* Full-row status colours, using the current theme palette. */
.orders-compact.v4-service-register .report-table .order-open-row{--order-row-bg:var(--surface-2);--order-row-accent:var(--fg-3);--order-row-hover:color-mix(in srgb,var(--order-row-bg) 88%,var(--order-row-accent))}
.orders-compact.v4-service-register .report-table .order-open-row:has(.order-state-accepted){--order-row-bg:var(--ai-soft);--order-row-accent:var(--ai)}
.orders-compact.v4-service-register .report-table .order-open-row:has(.order-state-working){--order-row-bg:var(--warn-soft);--order-row-accent:var(--warn)}
.orders-compact.v4-service-register .report-table .order-open-row:has(.order-state-ready){--order-row-bg:var(--info-soft);--order-row-accent:var(--info)}
.orders-compact.v4-service-register .report-table .order-open-row:has(.order-state-paid,.order-state-closed){--order-row-bg:var(--ok-soft);--order-row-accent:var(--ok)}
.orders-compact.v4-service-register .report-table .order-open-row:has(.order-state-cancelled){--order-row-bg:var(--bad-soft);--order-row-accent:var(--bad)}
.orders-compact.v4-service-register .report-table .order-open-row>td{background:var(--order-row-bg);color:var(--fg);border-bottom:2px solid var(--surface);box-shadow:none}
.orders-compact.v4-service-register .report-table .order-open-row>td:first-child{box-shadow:inset 3px 0 var(--order-row-accent)}
.orders-compact.v4-service-register .report-table .order-open-row:hover>td,.orders-compact.v4-service-register .report-table .order-open-row:focus-within>td{background:var(--order-row-hover)}
.orders-compact.v4-service-register .report-table tr.receipt-posted>td{background:var(--surface);color:var(--fg);border-bottom-color:var(--line);box-shadow:none}
.orders-compact.v4-service-register .report-table tr.receipt-posted:hover>td{background:var(--surface-2)}
.orders-compact.v4-service-register .report-table .order-open-row .secondary{background:var(--surface);color:var(--fg);border-color:var(--line)}
.orders-compact .v4-order-editor .order-line:is(.work-line,.part-line),.v4-order-editor .work-details-body,.v4-order-editor .part-details-body{background:var(--surface);color:var(--fg);border-color:var(--line)}.orders-compact .v4-order-editor .order-line:is(.work-line,.part-line)>div{border-color:var(--line)}.orders-compact .v4-order-editor .order-line:is(.work-line,.part-line) input:focus,.orders-compact .v4-order-editor .order-line:is(.work-line,.part-line) select:focus{background:var(--surface-2)}.orders-compact .v4-order-editor .order-line:is(.work-line,.part-line) input[readonly]{background:var(--surface-2);color:var(--fg-2)}
.v4-order-editor [hidden]{display:none!important}.v4-order-editor .order-line-head{background:var(--surface-2);color:var(--fg-2)}.orders-compact .v4-order-editor .order-line{border-color:var(--line)}.v4-order-editor .order-line input[readonly],.v4-order-editor .order-line .line-name>input[aria-label="Печатное название детали на польском"]{background:var(--surface-2);color:var(--fg-2)}.v4-order-editor .order-subtotal{border-color:var(--line)}.v4-order-editor .estimate-grid th{background:var(--surface-2);color:var(--fg-2);border-color:var(--line)}.v4-order-editor .estimate-grid td{border-color:var(--line);background:var(--surface)}.v4-order-editor .estimate-grid tr:nth-child(even) td{background:var(--surface-2)}
.receipt-editor .receipt-table td,.receipt-parts-picker .report-table td{background:var(--surface);color:var(--fg);border-color:var(--line)}.receipt-parts-picker select{background:var(--surface);color:var(--fg);border-color:var(--line)}
.v4-schedule .schedule-days{background:var(--surface);border-color:var(--line)}.v4-schedule .schedule-days section,.v4-schedule .sch-agenda section{border-color:var(--line)}.v4-schedule .schedule-day-title,.v4-schedule .sch-week th button,.v4-schedule .sch-cell-add{color:var(--accent-ink)}.v4-schedule .sch-week td{background:var(--surface)}.v4-schedule .sch-week th small,.v4-schedule .sch-week td>small,.v4-schedule .sch-agenda section>small{color:var(--fg-3)}
.schedule-appointment-dialog .booking-board{border-color:var(--line)}.schedule-appointment-dialog .booking-board button{background:var(--surface);color:var(--fg-2);border-color:var(--line)}.schedule-appointment-dialog .booking-month button.selected{background:var(--accent-soft);color:var(--accent-ink);border-color:var(--accent-line)}.schedule-appointment-dialog .booking-month .outside{color:var(--fg-3)}.schedule-appointment-dialog .booking-slots{border-color:var(--line)}.schedule-appointment-dialog .booking-slots thead{background:var(--surface-2)}.schedule-appointment-dialog .booking-slots td,.schedule-appointment-dialog .booking-slots .hour td,.schedule-appointment-dialog .booking-slots .hour th{border-color:var(--line)}.schedule-appointment-dialog .booking-slots button{background:var(--ok-soft);color:var(--ok)}.schedule-appointment-dialog .booking-slots button:empty{background:var(--surface)}.schedule-appointment-dialog .booking-slots button:hover:not(:disabled){background:var(--ok-soft)}.schedule-appointment-dialog .booking-slots button:disabled{background:var(--surface-2);color:var(--fg-3)}.schedule-appointment-dialog .booking-slots button:disabled:empty{background:repeating-linear-gradient(135deg,var(--surface),var(--surface) 5px,var(--line) 5px,var(--line) 6px)}.schedule-appointment-dialog .booking-slots button.busy{background:var(--ai-soft);color:var(--ai)}.schedule-appointment-dialog .booking-slots button.selected{background:var(--accent-soft)!important;color:var(--accent-ink)!important;border-color:var(--accent)}

/* A focused workspace for assigned masters; touch controls share the v4 tokens. */
.master-workspace{background:var(--bg);color:var(--fg);font:13px/1.45 var(--font);min-height:100dvh}
.master-workspace .master-header{max-width:1160px;padding:12px 24px;gap:16px;background:var(--surface);border-bottom:1px solid var(--line)}
.master-workspace .master-header img{width:120px;height:40px;object-fit:contain;background:#fff;border-radius:6px;padding:3px}
.master-workspace .master-header span{color:var(--fg-3);font-size:11px}.master-workspace .master-header strong{font-size:13px}
.master-workspace .master-nav{border-bottom:1px solid var(--line);padding:12px 24px;max-width:1160px;gap:6px;background:var(--surface)}
.master-workspace .master-nav button{border:0;border-radius:6px;padding:8px 14px;background:transparent;color:var(--fg-2);font-size:13px;min-height:40px}
.master-workspace .master-nav button.active{background:var(--accent-soft);color:var(--accent-ink)}.master-workspace .master-nav svg{width:18px;height:18px}
.master-workspace .master-content{max-width:1160px;padding:20px 24px 40px}.master-workspace .master-heading{margin-bottom:16px;gap:12px}.master-workspace .master-heading h1{font-size:22px;margin:0 0 4px;letter-spacing:-.35px}.master-workspace .master-heading p{font-size:12px;color:var(--fg-3);margin:3px 0}
.master-workspace .primary,.master-workspace .secondary{min-height:40px;font-size:13px;padding:9px 13px;border-radius:6px}.master-workspace .secondary{color:var(--fg);background:var(--surface);border:1px solid var(--line)}
.master-workspace .master-date-controls{margin:0 0 14px;gap:6px}.master-workspace .master-date-controls input{padding:8px 10px;min-height:40px;border-radius:6px;background:var(--surface);color:var(--fg);border:1px solid var(--line);font-size:13px}
.master-workspace .master-date-controls .secondary{min-height:40px;min-width:40px}
.master-pay-card{display:flex;justify-content:space-between;align-items:center;gap:20px;background:#232423;color:#fff;padding:20px;border-radius:10px;margin:0 0 20px;box-shadow:var(--shadow)}
.master-pay-card>div{display:grid;gap:6px}.master-pay-card>div+div{padding-left:24px;border-left:1px solid #494b4d}.master-pay-card span{font-size:12px;color:#c2c6cc}.master-pay-card strong{font-size:28px;line-height:1.2;letter-spacing:-.6px}.master-pay-card b{font-size:22px;line-height:1.2}.master-pay-card small{font-size:11px;color:#c2c6cc;line-height:1.5}.master-pay-card p{font-size:15px;line-height:1.5;margin:3px 0}
.master-workspace .master-section-caption{font-size:14px;margin:18px 0 10px;font-weight:650}
.master-workspace .master-event,.master-workspace .master-order-card{padding:14px 16px;border-radius:8px;border:1px solid var(--line);background:var(--surface);gap:16px;margin-bottom:10px}
.master-workspace .master-order-card.master-current{border-left:3px solid var(--accent)}.master-workspace .master-current>.primary{margin-left:auto;flex-shrink:0}.master-workspace .master-current .master-payment{background:var(--accent-soft);color:var(--accent-ink)}
.master-workspace .master-event-time{min-width:65px;gap:3px}.master-workspace .master-event-time strong{font-size:18px}.master-workspace .master-event-time span,.master-workspace .master-event-body small,.master-workspace .master-order-card small{font-size:11px;color:var(--fg-3)}
.master-workspace .master-event-body h2,.master-workspace .master-order-card h2{font-size:15px;margin:3px 0 5px;overflow-wrap:anywhere}.master-workspace .master-event-body p,.master-workspace .master-order-card p{margin:4px 0;font-size:12px;overflow-wrap:anywhere}.master-workspace .master-event-meta{font-size:12px;gap:8px;color:var(--fg-2)}
.master-workspace .master-payment{padding:3px 6px;border-radius:4px;font-size:11px;background:var(--warn-soft);color:var(--warn)}.master-workspace .master-payment-paid{background:var(--ok-soft);color:var(--ok)}.master-workspace .master-payment-cancelled,.master-workspace .master-payment-no_charge{background:var(--surface-3);color:var(--fg-2)}
.master-workspace .master-empty{padding:28px 16px;border-radius:8px;background:var(--surface);border:1px dashed var(--line-strong)}.master-workspace .master-empty h2{font-size:17px}.master-workspace .master-empty p{color:var(--fg-3)}
.master-workspace .master-filters{gap:8px;padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:8px}.master-workspace .master-filters label{font-size:11px;gap:4px;min-width:120px;color:var(--fg-2)}.master-workspace .master-filters .master-search{min-width:230px}.master-workspace .master-filters input,.master-workspace .master-filters select{font-size:13px;padding:8px 10px;min-height:40px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--fg)}
.master-workspace .master-order-action>strong{font-size:18px}.master-workspace .master-order-action{gap:6px}.master-workspace .master-pagination{font-size:12px;margin:16px 0;color:var(--fg-3)}
.master-workspace .master-note{font-size:11px;color:var(--fg-3);margin:12px 0;line-height:1.5}.master-workspace .master-detail-section{margin:14px 0;padding:16px;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.master-workspace .master-detail-section h2{font-size:15px;margin:0 0 12px}.master-workspace .master-content>#master-order-back{margin-bottom:14px}.master-workspace .master-work-table td,.master-workspace .master-work-table th{padding:9px 10px;border-bottom:1px solid var(--line);background:var(--surface);font-size:12px}.master-workspace .master-work-table th{background:var(--surface-2);color:var(--fg-3);font-size:10px;text-transform:uppercase;letter-spacing:.4px}.master-workspace .master-work-total{margin-top:14px;font-size:13px}.master-workspace .master-work-total strong{font-size:20px}
.master-workspace .master-manager-note{background:var(--info-soft);color:var(--info);border-radius:6px;padding:10px;font-size:12px;line-height:1.5;margin:0 0 12px}
.master-checklist{display:grid;gap:0;margin-bottom:12px}.master-checklist label{display:flex;align-items:center;gap:10px;min-height:48px;padding:8px 0;margin:0;border-bottom:1px solid var(--line);color:var(--fg)}.master-checklist input[type=checkbox]{flex:0 0 18px;width:18px;height:18px;min-height:18px;margin:0;accent-color:var(--accent-strong)}.master-checklist label>span{display:grid;gap:3px;font-size:13px}.master-checklist small{font-size:11px;color:var(--fg-3)}
.master-work-buttons{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.master-workspace .master-diagnostic-form{display:grid;gap:8px;border-top:1px solid var(--line);padding-top:16px;margin-top:16px}.master-workspace .master-diagnostic-form label,.master-workspace .master-photo-upload label{display:grid;gap:6px;font-size:12px;color:var(--fg-2)}.master-workspace .master-diagnostic-form textarea{font:13px/1.5 var(--font);resize:vertical;border:1px solid var(--line);border-radius:6px;padding:10px;background:var(--surface);color:var(--fg);width:100%;min-height:90px}.master-workspace .master-diagnostic-form button{justify-self:start}.master-workspace .master-photo-upload{display:grid;gap:8px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}.master-workspace .master-photo-upload input{max-width:100%;font-size:12px;background:var(--surface);color:var(--fg);border:1px solid var(--line);border-radius:6px;min-height:40px;padding:8px}.master-workspace .master-photo-upload button{justify-self:start}.master-workspace .master-photo-upload small{color:var(--fg-3);font-size:11px}
.master-photo-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;margin:12px 0}.master-photo-list:empty{display:none}.master-photo-list a{display:grid;gap:5px;text-decoration:none;color:var(--fg-3);font-size:11px;overflow-wrap:anywhere}.master-photo-list img{width:100%;height:130px;object-fit:cover;border:1px solid var(--line);border-radius:6px}.master-diagnostic-note{border:1px solid var(--line-strong);border-left:3px solid var(--info);background:var(--surface-2);border-radius:6px;padding:12px;margin:10px 0}.master-diagnostic-note header{display:flex;align-items:center;flex-wrap:wrap;gap:6px;justify-content:space-between;font-size:12px}.master-diagnostic-note header span,.master-diagnostic-note>small{font-size:11px;color:var(--fg-3)}.master-diagnostic-note p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0;font-size:13px;line-height:1.5;color:var(--fg)}
.master-pay-row{display:flex;gap:12px;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line);font-size:12px}.master-pay-row strong{white-space:nowrap}.v4-master-report{padding:14px 16px;border-top:1px solid var(--line);background:var(--surface);color:var(--fg)}.v4-master-report summary{font-size:13px;font-weight:650;cursor:pointer;min-height:28px}.v4-master-report-warning{background:var(--warn-soft);color:var(--warn);padding:10px;border-radius:6px;font-size:12px}.v4-master-readiness>div{display:grid;grid-template-columns:18px 1fr;gap:3px 8px;padding:8px 0;border-bottom:1px solid var(--line);font-size:12px}.v4-master-readiness>div>span{grid-row:span 2;color:var(--fg-3)}.v4-master-readiness>div>.is-ready{color:var(--ok)}.v4-master-readiness small{color:var(--fg-3);grid-column:2;font-size:11px}
@media(max-width:680px){
 .master-workspace .master-header{padding:10px 16px;gap:10px}.master-workspace .master-header img{width:90px;height:34px}.master-workspace .master-header .secondary{font-size:11px;padding:7px 9px}.master-workspace .master-header strong{font-size:12px}.master-workspace .master-header>div{max-width:150px;overflow-wrap:anywhere}
 .master-workspace .master-nav{position:fixed;bottom:0;left:0;right:0;z-index:45;padding:8px 8px calc(8px + env(safe-area-inset-bottom));margin:0;border:0;border-radius:0;background:#232423;gap:4px}.master-workspace .master-nav button{flex:1;flex-direction:column;gap:3px;min-height:48px;font-size:11px;padding:5px 4px;color:#c2c6cc;border-radius:6px}.master-workspace .master-nav button.active{background:#383b3b;color:#fff}.master-workspace .master-nav button.active svg{color:#f46b18}
 .master-workspace .master-content{padding:18px 16px calc(90px + env(safe-area-inset-bottom))}.master-workspace .master-heading h1{font-size:21px}.master-workspace .master-heading>.secondary{max-width:105px}.master-workspace .master-date-controls{flex-wrap:wrap}.master-workspace .master-date-controls label{flex:1;min-width:140px}.master-workspace .master-date-controls input{width:100%}.master-pay-card{display:grid;gap:16px;padding:18px;border-radius:10px}.master-pay-card>div+div{padding:13px 0 0;border-left:0;border-top:1px solid #494b4d;grid-template-columns:1fr auto}.master-pay-card>div+div small{grid-column:1/-1}.master-pay-card strong{font-size:28px}.master-pay-card b{font-size:20px}
 .master-workspace .master-event,.master-workspace .master-order-card{padding:14px;gap:12px}.master-workspace .master-current{flex-wrap:wrap}.master-workspace .master-current>.primary{width:100%;margin:0}.master-workspace .master-event-time{min-width:55px}.master-workspace .master-event-body{flex-basis:calc(100% - 70px)}.master-workspace .master-event>.primary{margin-left:67px}.master-workspace .master-order-card>div:first-child{min-width:0}.master-workspace .master-order-action{min-width:100px}.master-workspace .master-order-action .secondary{font-size:11px;padding:8px}.master-workspace .master-filters .master-search{min-width:100%}.master-workspace .master-detail-section{padding:14px}.master-workspace .master-work-table td,.master-workspace .master-work-table th{padding:8px 6px;font-size:11px}.master-workspace .master-work-total{font-size:12px}.master-workspace .master-work-buttons .primary{flex:1}.master-workspace .master-diagnostic-form button,.master-workspace .master-photo-upload button{justify-self:stretch}
}
.v4-order-photo-upload{display:flex;flex-wrap:wrap;align-items:end;gap:8px;border-top:1px solid var(--line);padding-top:12px;margin-top:12px}.v4-order-photo-upload label{display:grid;gap:5px;flex:1;min-width:180px;font-size:12px;color:var(--fg-2)}.v4-order-photo-upload input{max-width:100%;width:100%;font-size:12px;background:var(--surface);color:var(--fg);border:1px solid var(--line);border-radius:6px;padding:6px}.v4-order-photo-upload small{width:100%;color:var(--fg-3);font-size:11px}.v4-order-photo-upload .error{width:100%;margin:0;font-size:12px}
.schedule-notifications{border:1px solid var(--line);border-radius:8px;background:var(--surface-2);padding:12px;display:grid;gap:8px;margin:4px 0}.schedule-notifications h3{margin:0;font-size:13px;color:var(--fg)}.schedule-notifications .field-help{margin:0;font-size:11px;color:var(--fg-3);line-height:1.5}.schedule-notifications .schedule-notify-option{display:flex;align-items:center;gap:8px;margin:0;font-size:12px;color:var(--fg);min-height:28px}.schedule-notifications input[type=checkbox]{width:16px;height:16px;min-height:16px;margin:0;flex:0 0 16px;accent-color:var(--accent-strong)}.schedule-notifications .schedule-notify-language{display:grid;grid-template-columns:1fr 150px;align-items:center;gap:12px;font-size:12px;margin:0}.schedule-notification-history{border:1px solid var(--line);border-radius:6px;padding:10px 12px;margin:8px 0 12px;background:var(--surface);font-size:12px;color:var(--fg)}.schedule-notification-history.has-error{border-color:var(--warn-line)}.schedule-notification-history summary{cursor:pointer;font-weight:600;min-height:22px}.schedule-notification-history article{border-top:1px solid var(--line);padding:9px 0}.schedule-notification-history article:first-child{margin-top:6px}.schedule-notification-history article.has-error{border-left:3px solid var(--warn);padding-left:9px}.schedule-notification-history header{display:flex;align-items:start;justify-content:space-between;gap:10px;flex-wrap:wrap}.schedule-notification-history header small{color:var(--fg-2)}.schedule-notification-history p{margin:4px 0;font-size:12px;line-height:1.5}.schedule-notification-history small{color:var(--fg-3);font-size:11px}.schedule-notification-history .notification-error{color:var(--bad);white-space:pre-wrap;overflow-wrap:anywhere}.schedule-notification-history details{margin-top:6px}.schedule-notification-history details summary{font-size:11px;color:var(--fg-3);font-weight:400}.schedule-notification-text{white-space:pre-wrap;overflow-wrap:anywhere}.schedule-notifications .schedule-notification-history{margin:0;background:var(--surface);padding:8px}
.schedule-appointment-dialog .schedule-notifications .schedule-notify-option{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;text-align:left;gap:8px}.schedule-appointment-dialog .schedule-notifications .schedule-notify-language{display:grid;grid-template-columns:1fr 150px;text-align:left}.schedule-appointment-dialog .schedule-notifications .schedule-notify-option input{width:16px;height:16px;min-width:16px;min-height:16px;flex:0 0 16px;align-self:center;margin:0}
@media(max-width:680px){.schedule-appointment-dialog .schedule-notifications .schedule-notify-language{grid-template-columns:1fr;gap:5px}.schedule-appointment-dialog .schedule-notifications .schedule-notify-option{min-height:36px}}

.schedule-notification-preview{border:1px solid var(--line);border-radius:6px;padding:8px 10px;background:var(--surface);color:var(--fg);font-size:12px}.schedule-notification-preview>summary{cursor:pointer;font-weight:600;min-height:24px;display:list-item}.schedule-notification-preview article{padding:8px 0;border-top:1px solid var(--line)}.schedule-notification-preview article:first-child{margin-top:6px}.schedule-notification-preview strong{color:var(--fg-3);font-size:11px;font-weight:500}.schedule-notification-preview p{font-size:12px;line-height:1.5;margin:4px 0 0}

/* Legacy screens share the v4 dark palette; print and light theme stay independent. */
html[data-theme=dark]{--text:var(--fg);--text-secondary:var(--fg-2);--text-muted:var(--fg-3);--border:var(--line);scrollbar-color:var(--line-strong) var(--surface)}
html[data-theme=dark] :is(.settings-menu,.settings-detail,.system-cards button,.system-kpis>div,.cash-count-card,.master-event,.master-order-card,.master-empty,.master-detail-section,.master-nav button,.cash-icon-action,.orders-compact .order-line.part-line,.orders-compact .order-line.work-line){background:var(--surface);color:var(--fg);border-color:var(--line)}
html[data-theme=dark] :is(.settings-menu h1,.system-kpis strong,.shift-report-totals strong){color:var(--fg)}
html[data-theme=dark] :is(.system-cards span,.system-kpis small,.settings-menu h2,.settings-menu nav button,.cash-count-card small,.part-details summary,.work-details summary,.work-details-body small,.work-details-body .work-select,.order-line .part-details-body .work-select,.chat-filter-summary,.master-header span,.master-heading p,.master-event-time span,.master-event-body small,.master-order-card small,.master-event-meta,.master-empty p,.master-filters label,.master-pagination,.master-note,.cash-audit-list small,.cash-audit-event small,.return-results small,.shift-report-dialog .shift-report-period,.shift-report-totals span,.shift-report-totals small,.shift-report-dialog .shift-report-note,.shift-report-dialog summary,.shift-report-operations-title span,.shift-report-dialog td small,.shift-report-footer span){color:var(--fg-2)}
html[data-theme=dark] :is(.part-details-body,.work-details-body,.order-line-head.part-line,.order-line-head.work-line,.return-results thead,.master-work-table th,.cash-journal .cash-j-table th,.shift-report-dialog th){background:var(--surface-2);color:var(--fg-2);border-color:var(--line)}
html[data-theme=dark] :is(.settings-menu nav button:hover,.part-details summary:hover,.work-details summary:hover,.cash-journal .cash-j-table tbody tr:hover){background:var(--surface-3)}
html[data-theme=dark] :is(.settings-menu nav button.is-current,.master-nav button.active,.settings-bell.has-pending,.return-selected,.cash-icon-action:hover){background:var(--accent-soft);color:var(--accent-ink);border-color:var(--accent-line)}
html[data-theme=dark] :is(.receipt-source,.master-payment,.sys-state){background:var(--warn-soft);color:var(--warn);border-color:var(--warn-line)}
html[data-theme=dark] :is(.receipt-status,.deletion-label,.deletion-label.approved,.deletion-label.corrected,.master-payment-cancelled,.master-payment-no_charge,.sys-state.rejected){background:var(--surface-3);color:var(--fg-2);border-color:var(--line-strong)}
html[data-theme=dark] :is(.receipt-posted .receipt-status,.receipt-status.is-posted,.master-payment-paid,.sys-state.approved){background:var(--ok-soft);color:var(--ok);border-color:var(--ok-line)}
html[data-theme=dark] .report-table tr.receipt-posted>td{background:var(--ok-soft);color:var(--fg)}
html[data-theme=dark] .report-table tr.receipt-posted:hover>td{background:var(--surface-3)}
html[data-theme=dark] :is(.receipt-product-link,.chat-filter-summary .back-link){color:var(--accent-ink)}
html[data-theme=dark] .master-workspace{background:var(--bg);color:var(--fg)}
html[data-theme=dark] :is(.sys-notice,.cash-journal .cash-j-date-search){background:var(--info-soft);border-color:var(--info-line);color:var(--fg)}
html[data-theme=dark] .cash-journal .cash-j-date-search label{color:var(--info)}
html[data-theme=dark] .shift-report-totals section{background:var(--ok-soft);border-color:var(--ok-line)}
html[data-theme=dark] .shift-report-totals section+section{background:var(--info-soft);border-color:var(--info-line)}
html[data-theme=dark] .shift-report-breakdown{border-color:var(--line)}
html[data-theme=dark] .shift-report-dialog .is-income{color:var(--ok)}
html[data-theme=dark] :is(.shift-report-dialog .is-expense,button.danger-link){color:var(--bad)}
html[data-theme=dark] .deletion-muted,html[data-theme=dark] .deletion-muted :is(strong,td,small){background:var(--surface-3)!important;color:var(--fg-2)!important}
html[data-theme=dark] .trash-button{background:var(--bad-soft)!important;color:var(--bad)!important;border-color:var(--bad-line)!important}
html[data-theme=dark] .trash-button:hover{background:var(--surface-3)!important}
html[data-theme=dark] input:-webkit-autofill{-webkit-text-fill-color:var(--fg);box-shadow:0 0 0 1000px var(--surface) inset}
html[data-theme=dark] :is(.settings-bell,.calls-panel){background:var(--surface);color:var(--fg-2);border-color:var(--line)}
html[data-theme=dark] :is(.access-pill,.currency-symbol,.calls-filters,.employee-view-switch.segmented){background:var(--surface-3);color:var(--fg-2);border-color:var(--line)}
html[data-theme=dark] :is(.employee-view-switch button.selected,.calls-panel .secondary.active){background:var(--accent-soft);color:var(--accent-ink);border-color:var(--accent-line)}
html[data-theme=dark] .shift-pill.is-open{background:var(--ok-soft);color:var(--ok)}
html[data-theme=dark] .wa-notice{background:var(--warn-soft);color:var(--warn);border-color:var(--warn-line)}
html[data-theme=dark] .agent-settings-card{background:var(--surface);color:var(--fg);border-color:var(--line)}
html[data-theme=dark] :is(.agent-account,.agent-pill){background:var(--surface-3);color:var(--fg-2);border-color:var(--line)}
html[data-theme=dark] .agent-mode-note{background:var(--warn-soft);color:var(--warn);border-color:var(--warn-line)}
html[data-theme=dark] .settings-list>div{border-color:var(--line)}
html[data-theme=dark] .settings-menu nav button.is-current{color:var(--accent-ink)}

/* Compact booking: customer left, vehicle right, one shared comment. */
.schedule-appointment-dialog .schedule-person-column{display:flex;flex-direction:column;gap:8px;min-width:0}
.schedule-appointment-dialog .cash-form{gap:8px 12px!important}
.schedule-appointment-dialog .cash-form label{font-size:12px;gap:3px!important;margin:0!important}
.schedule-appointment-dialog .cash-form input:not([type=checkbox]),.schedule-appointment-dialog .cash-form select{height:34px!important;min-height:34px!important;padding:5px 8px!important;margin:0!important;box-sizing:border-box;font-size:13px}
.schedule-appointment-dialog .cash-form textarea{min-height:62px!important;height:62px;padding:6px 8px!important;margin:0!important;font-size:13px;resize:vertical}
.schedule-appointment-dialog .schedule-notifications{padding:10px!important;margin:0!important;gap:6px}
.schedule-appointment-dialog .booking-selection{padding:7px 9px!important;margin-bottom:2px!important}

/* Compact, touch-friendly master workspace on phones. */
@media(max-width:680px){
 .master-workspace .master-header{padding:10px 12px;gap:8px}
 .master-workspace .master-header img{width:88px;height:30px}
 .master-workspace .master-header strong{font-size:12px}
 .master-workspace .master-header button,.master-workspace .master-content button{min-height:40px;padding:8px 12px;font-size:13px;line-height:1.25}
 .master-workspace .master-content{padding:14px 12px calc(82px + env(safe-area-inset-bottom))}
 .master-workspace .master-heading{margin-bottom:14px;gap:10px}
 .master-workspace .master-heading h1{font-size:20px;margin-bottom:5px}
 .master-workspace .master-heading p{font-size:12px}
 .master-workspace .master-date-controls{display:grid;grid-template-columns:36px minmax(0,1fr) 36px auto;gap:6px;align-items:center}
 .master-workspace .master-date-controls label{min-width:0;width:100%}
 .master-workspace .master-date-controls .sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .master-workspace .master-date-controls input{min-width:0;width:100%;height:40px;min-height:40px;padding:6px;font-size:16px}
 .master-workspace .master-date-controls button{min-width:0;width:100%;padding:8px 6px}
 .master-workspace .master-pay-card{padding:14px;gap:10px;margin-bottom:16px}
 .master-workspace .master-pay-card strong{font-size:24px}
 .master-workspace .master-pay-card b{font-size:18px}
 .master-workspace .master-pay-card>div{gap:4px}
 .master-workspace .master-pay-card>div+div{padding-top:10px}
 .master-workspace .master-order-card,.master-workspace .master-event{padding:12px;gap:10px;border-radius:10px}
 .master-workspace .master-order-card h2{font-size:16px;margin:4px 0}
 .master-workspace .master-order-card p{font-size:13px;margin:5px 0}
 .master-workspace .master-filters{gap:8px}
 .master-workspace .master-filters label{min-width:0;flex-basis:calc(50% - 8px)}
 .master-workspace .master-filters .master-search{flex-basis:100%}
 .master-workspace .master-filters input,.master-workspace .master-filters select{min-width:0;font-size:16px;padding:7px;min-height:40px}
 .master-workspace .master-nav{padding-top:5px;padding-bottom:calc(5px + env(safe-area-inset-bottom))}
 .master-workspace .master-nav button{min-height:44px;padding:4px;font-size:11px}
}

/* Work-order undo/redo: compact, visible alongside the document title. */
.order-toolbar .order-undo-tools{display:inline-flex;gap:3px;flex:none;align-items:center}
.order-toolbar .order-undo-tools button.secondary{display:grid;place-items:center;width:30px;height:30px;min-width:30px;min-height:30px;padding:5px;border-radius:6px;box-shadow:none}
.order-undo-tools svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.order-undo-tools button:disabled{opacity:.35;cursor:default}
.order-undo-tools button:focus-visible{outline:2px solid var(--accent,#e55b0a);outline-offset:2px}
/* Orders list: several workshops at once */
.order-filters .order-shops{position:relative;display:flex;flex-direction:column;gap:9px;font-size:14px;min-width:170px}
.order-shops details>summary{list-style:none;cursor:pointer;border:1px solid var(--line,#d5d9df);border-radius:8px;padding:0 30px 0 10px;height:auto;line-height:1.2;padding-top:8px;padding-bottom:8px;box-sizing:border-box;background:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px;position:relative}
.order-shops details>summary::-webkit-details-marker{display:none}
.order-shops details>summary::after{content:'▾';position:absolute;right:10px;top:0;color:var(--fg-3,#6e737b)}
.order-shops details[open]>summary{border-color:var(--accent,#c2540a)}
/* fixed: the panel around the filters clips anything that hangs below it */
.order-shops-list{position:fixed;z-index:60;min-width:210px;background:#fff;border:1px solid var(--line,#d5d9df);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.14);padding:8px;display:grid;gap:2px}
.order-shops-list label{display:flex;flex-direction:row;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:pointer;font-size:14px}
.order-shops-list label:hover{background:var(--bg-2,#f3f4f6)}
.order-shops-list input{width:16px;height:16px;margin:0;flex:none}
.order-shops-list button{margin-top:6px}

/* Open orders as tabs above the editor, and the workshop picture behind it. */
.order-sheets{display:flex;flex-wrap:wrap;align-items:flex-end;gap:4px;margin:0 0 8px}
.order-sheet,.order-sheet-shop,.order-form[data-shop]{--shop:#E8590C}
.order-sheet[data-shop="1"],.order-sheet-shop[data-shop="1"],.order-form[data-shop="1"]{--shop:#C2255C}.order-sheet[data-shop="2"],.order-sheet-shop[data-shop="2"],.order-form[data-shop="2"]{--shop:#5F6B7A}
.order-sheet[data-shop="3"],.order-sheet-shop[data-shop="3"],.order-form[data-shop="3"]{--shop:#8D6E00}.order-sheet[data-shop="4"],.order-sheet-shop[data-shop="4"],.order-form[data-shop="4"]{--shop:#1971C2}
.order-sheet[data-shop="5"],.order-sheet-shop[data-shop="5"],.order-form[data-shop="5"]{--shop:#0C8599}.order-sheet[data-shop="6"],.order-sheet-shop[data-shop="6"],.order-form[data-shop="6"]{--shop:#6741D9}
.order-sheet{display:inline-flex;align-items:stretch;max-width:260px;border:1px solid var(--line,#e3e6ea);border-bottom:3px solid color-mix(in srgb,var(--shop) 45%,transparent);border-radius:8px 8px 0 0;background:var(--surface-2,#f3f4f6);color:var(--fg-2,#4b5563)}
.order-sheet.is-current{background:var(--surface,#fff);border-bottom-color:var(--shop);color:var(--fg,#111)}
.order-sheet>button{all:unset;box-sizing:border-box;cursor:pointer;padding:5px 10px;min-width:0;font:inherit}
.order-sheet>button:focus-visible,.order-sheet-add:focus-visible{outline:2px solid var(--accent,#E8590C);outline-offset:1px}
.order-sheet strong{display:block;font-size:13px;line-height:1.25}.order-sheet strong i{font-style:normal;color:var(--warn,#E8590C);font-size:10px}
.order-sheet small{display:block;max-width:180px;font-size:11px;line-height:1.25;color:var(--fg-3,#6b7280);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-sheet>.order-sheet-close{padding:5px 9px 5px 4px;font-size:17px;line-height:1;color:var(--fg-3,#6b7280);align-self:center}.order-sheet>.order-sheet-close:hover{color:var(--bad,#c92a2a)}
.order-sheet-add{all:unset;box-sizing:border-box;cursor:pointer;width:34px;height:34px;margin-left:2px;border:1px dashed var(--line-strong,#c9ced6);border-radius:8px;text-align:center;font-size:20px;line-height:32px;color:var(--fg-2,#4b5563);background:var(--surface,#fff)}.order-sheet-add:hover{border-style:solid;color:var(--accent,#E8590C)}
.order-sheet-modes{display:grid;gap:6px;border:0;padding:0;margin:0 0 6px}.order-sheet-modes legend{font-weight:600;margin-bottom:4px}
.order-sheet-shops{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.order-sheet-shops .order-sheet-shop{display:inline-flex;align-items:center;gap:6px;border-color:var(--shop);color:var(--shop)}.order-sheet-shops .order-sheet-shop:hover{background:var(--shop);color:#fff}.order-sheet-shop svg{width:16px;height:16px}
.order-form.compact-editor[data-shop]{position:relative}
.order-form[data-shop] .order-meta{box-shadow:inset 0 3px 0 var(--shop);background:color-mix(in srgb,var(--shop) 5%,transparent)}
.order-shop-art{position:absolute;z-index:1;right:27%;bottom:8px;width:min(30%,360px);color:var(--shop);opacity:.11;pointer-events:none;line-height:0;text-align:center}
.order-shop-art svg{width:100%;height:auto}.order-shop-art b{display:block;margin-top:6px;font-size:clamp(18px,2.4vw,34px);line-height:1.1;letter-spacing:.04em;text-transform:uppercase}
html[data-theme=dark] .order-shop-art{opacity:.16}
@media(max-width:900px){.order-shop-art{right:4%;width:46%}}
@media print{.order-sheets,.order-shop-art{display:none}}
.order-sheet-joint{align-self:center;margin-left:8px;padding:6px 12px;font-size:13px}
.print-form-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start}
.print-form-preview{position:sticky;top:0;max-height:calc(100vh - 120px);overflow:auto;padding:2px}
.print-form-preview-title{margin:0 0 8px;font-weight:600}.print-form-preview-title small{display:block;font-weight:400;color:var(--fg-3,#6b7280)}
.pv-sheet{background:#fff;color:#222;border:1px solid #d9dce1;box-shadow:0 2px 10px rgba(0,0,0,.08);padding:22px;font:11px/1.35 Arial,sans-serif;cursor:default}
.pv-sheet header{display:flex;justify-content:space-between;gap:12px;border-bottom:3px solid #222;padding-bottom:8px;margin-bottom:10px}.pv-sheet header strong{font-size:18px}.pv-sheet header small{display:block;font-size:9px;color:#777}.pv-sheet header>div:last-child{text-align:right;font-size:13px;color:#999}
.pv-parties{display:grid;grid-template-columns:1.3fr .9fr 1fr;gap:10px;margin-bottom:10px}.pv-parties>div{display:grid;gap:2px;align-content:start;min-width:0;overflow-wrap:anywhere}.pv-parties>div+div{border-left:1px solid #ccc;padding-left:10px;color:#999}.pv-parties i{font-style:normal;font-size:9px;font-weight:700;color:#888}
.pv-sample{color:#aaa}.pv-sheet h6{margin:8px 0 4px;font-size:11px}.pv-sample table{width:100%;border-collapse:collapse;font-size:10px}.pv-sample td,.pv-sample th{padding:3px;border-bottom:1px solid #eee;text-align:left}.pv-total{text-align:right;margin:6px 0}
.pv-warranty{border-top:1px solid #ddd;margin-top:8px;padding-top:6px;font-size:9px;color:#555}.pv-warranty h6{font-size:10px;margin:0 0 4px;color:#333}.pv-warranty p{margin:0 0 4px}
.pv-sheet footer{border-top:1px solid #c66a31;margin-top:8px;padding-top:6px;display:grid;gap:4px;font-size:9px}.pv-services{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;color:#aaa}
.pv-sheet [data-pv]{border-radius:3px;transition:background .15s,box-shadow .15s}.pv-sheet span[data-pv]:empty{display:none}.pv-sheet [data-pv]:hover{background:#fff4ec;cursor:pointer}
.pv-sheet [data-pv].is-on{background:#ffe8d6;box-shadow:0 0 0 2px #E8590C}
@media (max-width:1000px){.print-form-layout{grid-template-columns:1fr}.print-form-preview{position:static;max-height:none}}
