/* Reference layout: ordered form sections and a live companion column. */
main{container-type:inline-size;container-name:workspace}
main:has(.editor-layout){padding:20px 24px 40px}
.editor-toolbar{max-width:none;margin-bottom:10px;min-height:20px;font-size:11px}.editor-toolbar .back-link{font-size:12px}
.record-heading{display:flex;align-items:flex-start;gap:12px;margin:0 0 18px}.record-heading-icon{width:30px;height:30px;display:grid;place-items:center;background:var(--soft);border-radius:8px;color:var(--muted);flex-shrink:0}.record-heading-icon svg{width:21px;height:21px}.record-heading h1{font-size:24px;letter-spacing:-.4px;margin:0 0 4px}.record-heading p{color:var(--muted);font-size:12px;margin:0}.preview-jump{display:none;margin-left:auto}.preview-jump svg{width:16px;height:16px}
.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,32%);gap:22px;align-items:start;max-width:1800px}
.editor-primary,.editor-record,.editor-related,.record-aside{min-width:0}.editor-sections{display:grid;gap:14px;border:0;padding:0;margin:0;min-width:0}
.editor-section{display:block;min-width:0;margin:0;border:1px solid var(--border);border-radius:11px;overflow:hidden;background:linear-gradient(135deg,color-mix(in srgb,var(--panel) 97%,var(--text)),var(--panel));box-shadow:var(--shadow)}
.record-section-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 16px;border-bottom:1px solid var(--border)}.record-section-heading h2{display:flex;align-items:center;gap:12px;font-size:14px;line-height:1.4;font-weight:600;margin:0;min-width:0}.record-section-heading h2 svg{width:22px;height:22px;color:var(--accent);flex-shrink:0}.record-section-heading>span{font-size:10px;line-height:1.4;text-align:right;color:var(--muted);max-width:40%}
.editor-section>.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px;padding:16px;margin:0;border:0;min-width:0}.editor-section .form-grid>*{min-width:0}
#editor-form label{font-size:11px;font-weight:500;gap:5px;line-height:1.45}#editor-form input:not([type=checkbox]),#editor-form select,#editor-form .control-trigger{min-height:36px;padding:7px 10px;font-size:12px}#editor-form textarea{min-height:58px;font-size:12px;padding:9px 10px;line-height:1.5}#editor-form .hint{font-size:10px;line-height:1.55;margin:0}#editor-form .inline-check{font-size:10px;gap:7px}#editor-form .inline-check input{width:14px;height:14px;min-height:14px;flex-shrink:0}#editor-form .row-action{font-size:10px;padding:3px 0;text-align:left}
.editor-section .related-actions{margin:0;gap:18px;flex-wrap:wrap}.placement-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,2.1fr)!important}.placement-column{display:flex;flex-direction:column;align-items:stretch;gap:8px;min-width:0}.placement-column .full{grid-column:auto}.placement-column .row-action{align-self:flex-start}.placement-column #worker-fit{font-size:10px;line-height:1.45}.request-and-create{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.request-and-create>.row-action{min-height:36px}.schedule-fields{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.editor-section .rate-card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;align-content:start;background:none;border:0;border-radius:0;padding:0;min-width:0}.editor-section .rate-card+.rate-card{border-left:1px solid var(--border);padding-left:18px}.editor-section .rate-card .hint{grid-column:1/-1;min-height:0}.editor-section .rate-card label:nth-of-type(3){grid-column:1/-1}.editor-section #actual-field{max-width:none}.editor-section #actual-field>.row-action{justify-self:end}.editor-section #actual-field input{max-width:100%}
.editor-record #form-error:not(:empty){padding:12px 16px;background:color-mix(in srgb,var(--danger) 7%,var(--panel));border:1px solid var(--danger);border-radius:9px;margin:14px 0}
.editor-record .form-actions{border:0;background:none;border-radius:0;margin:0;padding:12px 0 0;display:flex;justify-content:space-between}.editor-record .form-actions .primary{min-width:150px;background:linear-gradient(120deg,color-mix(in srgb,var(--accent) 80%,#fff),var(--accent));box-shadow:0 2px 5px #0001}.editor-record .form-actions .secondary{min-width:86px}.editor-record .form-actions button,.editor-record .form-actions a{font-size:11px;min-height:36px;padding:8px 16px}
.editor-related{margin-top:18px}.editor-related>.related-card{max-width:none;margin:0 0 14px;padding:18px;border:1px solid var(--border);border-radius:11px}.editor-related>.related-card .table-scroll{margin:0 -18px -18px}.editor-related .documents-card>.toolbar{flex-wrap:wrap;margin-bottom:12px}.editor-related h2{font-size:14px}.editor-related .hint,.editor-related .quiet-empty{font-size:11px}.editor-related .quiet-empty{padding:8px 0 0}
.record-aside{display:grid;gap:14px;border-left:1px solid var(--border);padding-left:20px}.record-aside:focus{outline:none}.preview-panel{min-width:0;border:1px solid var(--border);border-radius:11px;background:linear-gradient(135deg,color-mix(in srgb,var(--panel) 97%,var(--text)),var(--panel));overflow:hidden}.preview-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;border-bottom:1px solid var(--border)}.preview-panel-heading h2{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:600;min-width:0}.preview-panel-heading h2 svg{width:22px;height:22px;flex-shrink:0;color:var(--accent)}.preview-panel-body{padding:14px}.preview-badge{display:inline-flex;align-items:center;gap:4px;border-radius:20px;padding:5px 8px;font-size:9px;line-height:1.3;flex-shrink:0;background:var(--soft);color:var(--muted)}.preview-badge svg{width:11px;height:11px}.preview-badge.ok{color:var(--success);background:color-mix(in srgb,var(--success) 12%,transparent)}.preview-badge.attention{color:var(--accent-ink);background:var(--active)}
.preview-fact{display:flex;gap:12px;align-items:flex-start;margin-bottom:18px;min-width:0}.preview-fact:last-child{margin-bottom:0}.preview-fact>svg{width:19px;height:19px;flex-shrink:0;color:var(--accent);margin-top:1px}.preview-fact>div{min-width:0}.preview-fact strong{display:block;font-size:12px;font-weight:500;overflow-wrap:anywhere;white-space:pre-line}.preview-fact small{display:block;font-size:10px;color:var(--muted);margin-top:5px}.shift-preview-grid{display:grid;grid-template-columns:1.15fr 1fr;gap:12px;margin-bottom:18px}.shift-preview-grid .preview-fact{margin-bottom:23px}.shift-preview-grid .preview-fact:last-child{margin:0}.preview-timeline{position:relative}.preview-timeline:before{content:'';position:absolute;left:7px;top:10px;bottom:35px;width:1px;background:var(--accent)}.preview-timeline .preview-fact>svg{width:14px;height:14px;border-radius:50%;background:var(--accent);box-shadow:0 0 9px color-mix(in srgb,var(--accent) 35%,transparent);color:var(--accent);z-index:1}
.preview-payments{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.preview-payment{min-width:0;padding:13px 12px;border:1px solid var(--border);border-radius:8px;background:var(--soft)}.preview-payment.pay{background:color-mix(in srgb,var(--success) 9%,var(--panel));border-color:color-mix(in srgb,var(--success) 30%,var(--border))}.preview-payment.bill{background:var(--soft);border-color:color-mix(in srgb,var(--accent) 32%,var(--border))}.preview-payment>span{display:block;font-size:11px;color:var(--accent-ink);margin-bottom:6px}.preview-payment.pay>span{color:var(--success)}.preview-payment strong{display:block;font-size:23px;line-height:1.25;font-weight:600;overflow-wrap:anywhere;letter-spacing:-.5px}.preview-payment small{display:block;font-size:10px;line-height:1.5;color:var(--muted);margin-top:6px}.preview-margin{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px;padding:10px 12px;border:1px solid var(--border);border-radius:7px;font-size:10px}.preview-margin strong{font-size:12px;margin-left:auto}.preview-margin>span:last-child{color:var(--muted)}.preview-panel-body>.hint{margin:10px 0 0;font-size:10px;line-height:1.5}
.preview-check{display:flex;align-items:flex-start;gap:10px;margin:0 0 12px;padding:0;width:100%;text-align:left;font-size:11px;line-height:1.5}.preview-check>svg{width:21px;height:21px;flex-shrink:0}.preview-check span{min-width:0;overflow-wrap:anywhere}.preview-check strong{font-size:11px;font-weight:500}.preview-check small{display:block;font-size:10px;color:var(--muted);margin-top:3px}.preview-check:last-child{margin:0}.good-check>svg{color:var(--success)}.error-check{color:var(--danger)}.warning-check{color:var(--accent-ink)}.preview-check:hover span{text-decoration-color:var(--border)}button.preview-check:hover{text-decoration:underline;text-underline-offset:3px}
.preview-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px}.preview-actions button{font-size:10px;min-height:37px;line-height:1.4;padding:8px;border-color:color-mix(in srgb,var(--accent) 65%,var(--border));color:var(--accent-ink);background:transparent}.preview-actions svg{width:17px;height:17px;flex-shrink:0}
.editor-panel,.shift-detail{max-width:1200px}.editor-panel:has(input[name=current_password]){max-width:760px}.detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
@container workspace (max-width:980px){.editor-layout{grid-template-columns:minmax(0,1fr);max-width:1120px}.record-aside{grid-template-columns:repeat(2,minmax(0,1fr));border:0;padding:0;align-items:start}.record-heading .preview-jump{display:inline-flex}.preview-panel-heading{flex-wrap:wrap}}
@container workspace (max-width:720px){.placement-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important}.placement-worker{grid-column:1/-1}.schedule-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important}.record-section-heading>span{display:none}.record-aside{grid-template-columns:minmax(0,1fr)}.editor-section .rate-card{grid-template-columns:minmax(0,1fr)}.record-heading h1{font-size:21px}.record-heading .preview-jump{font-size:0;min-width:34px;padding:6px}.record-heading .preview-jump svg{width:18px;height:18px}}
@container workspace (max-width:440px){.editor-section>.form-grid,.placement-fields,.schedule-fields{grid-template-columns:minmax(0,1fr)!important}.placement-worker{grid-column:auto}.editor-section .rate-card+.rate-card{border-left:0;border-top:1px solid var(--border);padding:14px 0 0}.record-section-heading{padding:12px}.record-section-heading h2{font-size:12px;gap:8px}.editor-section>.form-grid{padding:14px}.record-heading p{font-size:11px}.preview-panel-heading h2{font-size:13px}.shift-preview-grid{grid-template-columns:minmax(0,1fr)}.preview-payment strong{font-size:20px}.editor-record .form-actions .primary{min-width:120px}.detail-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:720px){main:has(.editor-layout){padding:18px 14px 30px}}
/* Keep the existing navigation structure, with the requested brand and active accents. */
.sidebar::after{content:'';position:absolute;top:75px;left:0;right:0;height:1px;background:var(--border);pointer-events:none}.brand-image{display:flex;align-items:center;gap:9px;width:100%;height:40px}.brand-image img.brand-sign{width:32px;height:32px;object-fit:contain;filter:none!important;flex-shrink:0}.brand-wordmark{display:block;font-size:16px;font-weight:750;line-height:1.2;white-space:nowrap;color:var(--text)}.brand-wordmark small{display:block;font-size:7px;letter-spacing:.7px;font-weight:500;margin-top:4px;text-transform:uppercase;color:var(--muted)}.collapsed .brand-image{display:none}.nav-link.active{box-shadow:inset 2px 0 0 var(--accent);color:var(--accent-ink);background:var(--active)}
.notification-button.has-unread{color:var(--accent);filter:drop-shadow(0 0 5px color-mix(in srgb,var(--accent) 25%,transparent))}.notification-button.has-unread>span{box-shadow:0 0 8px color-mix(in srgb,var(--accent) 25%,transparent)}
.header-search{position:relative;display:flex;align-items:center;gap:10px;flex:1;max-width:920px;min-width:0;color:var(--muted);border:1px solid var(--border);border-radius:8px;background:var(--input);padding:0 12px}.header-search>svg{width:18px;height:18px;flex-shrink:0}.header-search input{width:100%;min-width:0;min-height:38px;border:0;box-shadow:none;background:none;padding:8px 0;font-size:12px}.header-search input:focus{border:0;box-shadow:none}.header-search:focus-within{border-color:var(--accent)}.header-search input::-webkit-search-cancel-button{display:none}.header-search>button{font-size:21px;padding:0;min-width:23px;color:var(--muted)}.topbar .header-actions{margin-left:auto}.section-search-results{position:absolute;left:0;right:0;top:calc(100% + 8px);border:1px solid var(--border);border-radius:10px;background:var(--panel);box-shadow:0 12px 36px #0002;max-height:360px;overflow:auto;z-index:70;padding:6px}.section-search-results a{display:block;padding:11px;border-radius:6px}.section-search-results a:hover,.section-search-results a:focus{background:var(--active);outline:0}.section-search-results strong{display:block;font-size:12px;font-weight:500}.section-search-results small{display:block;font-size:10px;color:var(--muted);margin-top:4px}.section-search-results p{margin:8px;font-size:12px}.section-search-status{margin:0 0 15px}.topbar .account-menu{padding-left:18px;border-left:1px solid var(--border)}
@media(max-width:720px){.brand-image{display:none}.sidebar::after{top:63px}.header-search{padding:0 8px;gap:6px}.header-search input{font-size:11px;min-height:36px}.header-search>svg{width:15px;height:15px}.topbar .account-menu{padding-left:10px}.topbar .header-actions{gap:8px}.topbar{gap:10px}.section-search-results{right:-78px}.topbar:has(.overview-greeting:not([hidden])) .header-actions{margin-left:0}}
.weekday-field{border:0;padding:0;margin:0;min-width:0}.weekday-field legend{font-size:13px;font-weight:500;padding:0;margin-bottom:10px}
.weekday-choices{display:flex;flex-wrap:wrap;gap:7px}.weekday-choices label{position:relative;display:block}.weekday-choices input{position:absolute;opacity:0;width:100%;height:100%;min-height:0;margin:0;inset:0;cursor:pointer}.weekday-choices span{display:grid;place-items:center;min-width:36px;height:36px;border:1px solid var(--border);border-radius:8px;background:var(--input);font-size:12px}.weekday-choices input:checked+span{background:var(--active);color:var(--accent-ink);border-color:var(--accent)}.weekday-choices input:focus-visible+span{outline:2px solid var(--accent);outline-offset:3px}.weekday-field .hint{margin-top:10px}
.worker-fit[data-fit=mismatch],.worker-fit[data-fit=busy]{color:var(--danger)}.worker-fit[data-fit=match]{color:var(--success)}
/* Native dialog keeps keyboard focus in the drawer and closes with Escape. */
body.drawer-open{overflow:hidden}.notification-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(460px,100%);height:100dvh;max-width:100%;max-height:100dvh;padding:0;border:0;border-left:1px solid var(--border);background:var(--panel);color:var(--text);box-shadow:-12px 0 40px #0002;overflow:hidden}.notification-drawer[open]{display:flex;flex-direction:column}.notification-drawer::backdrop{background:#0005}
.notification-drawer-header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:24px;border-bottom:1px solid var(--border);flex-shrink:0}.notification-drawer-header h2{font-size:18px;margin-bottom:5px}.notification-drawer-header .muted{font-size:12px}.notification-drawer-header .icon-button{width:36px;height:36px;font-size:24px}
.notification-drawer-body{overflow:auto;overscroll-behavior:contain;min-height:0;flex:1}.drawer-loading{padding:24px;font-size:13px;color:var(--muted)}.drawer-notification{padding:20px 24px;border-bottom:1px solid var(--border)}.drawer-notification.unread{background:var(--soft)}.drawer-notification>a{display:flex;gap:12px;align-items:start}.drawer-notification .dot{margin-top:7px}.drawer-notification strong{display:block;font-size:14px;font-weight:500;overflow-wrap:anywhere}.drawer-notification small{display:block;font-size:12px;color:var(--muted);margin-top:8px}.drawer-notification .row-action{margin:8px 0 0 18px;white-space:normal;text-align:left}
@media(prefers-reduced-motion:no-preference){.notification-drawer[open]{animation:notification-slide .2s ease-out}@keyframes notification-slide{from{transform:translateX(100%)}to{transform:translateX(0)}}}

@container workspace (min-width:981px) and (max-width:1250px){.placement-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important}.placement-worker{grid-column:1/-1}.schedule-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important}.record-section-heading>span{display:none}.preview-panel-heading{flex-wrap:wrap}}
@container workspace (max-width:440px){.request-and-create{grid-template-columns:minmax(0,1fr)}.request-and-create>.row-action{min-height:0}.preview-payments{grid-template-columns:minmax(0,1fr)}}

#editor-form #actual-field{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:16px}#actual-field>.actual-caption{grid-column:1/-1}#actual-field>input{grid-column:1;grid-row:2}#actual-field>.row-action{grid-column:2;grid-row:2;align-self:center}#actual-field>.hint{grid-column:1/-1;grid-row:3}[data-entity=shifts] #editor-form textarea{min-height:40px}
@container workspace (max-width:440px){#editor-form #actual-field{grid-template-columns:minmax(0,1fr)}#actual-field>.row-action{grid-column:1;grid-row:4}}

.readonly-section-body{padding:18px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.readonly-section-body .preview-fact{margin:0}.readonly-section-body p{grid-column:1/-1;margin:0;font-size:13px}@container workspace (max-width:440px){.readonly-section-body{grid-template-columns:minmax(0,1fr)}}

.preview-payment:only-child{grid-column:1/-1}

/* Worker documents follow identity fields, ahead of schedule and pay. */
.editor-inline-related{margin:14px 0}.editor-inline-related>.documents-card{margin-bottom:0}

/* Customer attendance is a visible record-level action; contracts follow company details. */
.record-heading-copy{min-width:0;flex:1}.record-heading-copy h1{overflow-wrap:anywhere}
.record-heading:has(.record-attendance){flex-wrap:wrap}.record-heading-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex-shrink:0}.record-attendance{white-space:nowrap;border-color:color-mix(in srgb,var(--accent) 45%,var(--border));color:var(--accent-ink)}.record-attendance svg{width:17px;height:17px;flex-shrink:0}.record-heading-actions .preview-jump{margin-left:0}
@container workspace (max-width:720px){.record-heading-actions{flex-basis:calc(100% - 42px);margin-left:42px;flex-wrap:wrap;min-width:0}.record-heading-actions .record-attendance{font-size:11px}}
