*{box-sizing:border-box}body{margin:0;background:#f4f7fb;color:#16253a;font:16px system-ui,-apple-system,Segoe UI,sans-serif}header{background:#12355b;color:white;padding:20px max(16px,calc((100vw - 1120px)/2))}header h1{margin:0;font-size:1.45rem}nav{display:flex;gap:18px;margin-top:10px}nav a{color:#dbeafe;text-decoration:none}nav a[aria-current=page]{color:white;font-weight:700;text-decoration:underline}main{max-width:1120px;margin:auto;padding:22px 16px}.toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:16px}.toolbar input{flex:1;min-width:200px}.toolbar select{min-width:150px}input,select,textarea,button{font:inherit;border-radius:9px;padding:11px;border:1px solid #c9d3e1}button{cursor:pointer;background:#e8eef5;color:#183554;font-weight:650}button.primary{background:#16803d;border-color:#16803d;color:white}button:disabled{opacity:.65;cursor:not-allowed}input:focus,textarea:focus,button:focus-visible,select:focus{outline:3px solid #9cc4ff;outline-offset:1px}.card{background:white;border:1px solid #dce3ed;border-radius:14px;padding:18px;margin:12px 0;box-shadow:0 2px 8px #1835540a}.topline{display:flex;justify-content:space-between;gap:12px;align-items:center}.invoice{font-size:1.12rem;font-weight:750}.muted{color:#5e6f82}.customer{font-weight:650;margin:12px 0}.details{margin:14px 0;padding:12px;background:#f3f6fb;border-radius:8px}.details div{display:flex;justify-content:space-between;gap:10px;margin:5px 0}.card label{display:block;font-weight:600;margin:14px 0 6px}.card textarea{width:100%;resize:vertical;min-height:75px}.actions{display:flex;justify-content:flex-end;margin-top:14px}.pending{opacity:.55;pointer-events:none}.confirmed{border-color:#8dc7a4;background:#f0fff4}.message{padding:13px;border-radius:9px;background:#e8eef5;margin:12px 0}.error{background:#fee2e2;color:#8a1e1e}.hidden{display:none}#count{font-size:.9rem}.spinner{display:inline-block;width:16px;height:16px;border:2px solid #ffffff80;border-top-color:white;border-radius:50%;animation:spin .8s linear infinite;vertical-align:middle;margin-right:7px}@keyframes spin{to{transform:rotate(360deg)}}@media(max-width:600px){header{padding:18px 16px}.topline{align-items:flex-start}.invoice{font-size:1rem}.toolbar>*{width:100%}.actions button{width:100%}main{padding:12px}.card{padding:14px}}

/* Compact mobile-first layout for Picking START and COMPLETE */
body:is([data-step="received"],[data-step="logistics-received"]) header{padding-top:12px;padding-bottom:12px}
body:is([data-step="received"],[data-step="logistics-received"]) header h1{font-size:clamp(1.05rem,3.5vw,1.35rem);line-height:1.3}
body:is([data-step="received"],[data-step="logistics-received"]) main{padding-top:12px;padding-bottom:18px}
body:is([data-step="received"],[data-step="logistics-received"]) main h2{font-size:1.15rem;margin:2px 0 3px}
body:is([data-step="received"],[data-step="logistics-received"]) main>p.muted{margin:0 0 10px;font-size:.88rem}
body:is([data-step="received"],[data-step="logistics-received"]) .toolbar{gap:7px;margin-bottom:9px}
body:is([data-step="received"],[data-step="logistics-received"]) .toolbar input,body:is([data-step="received"],[data-step="logistics-received"]) .toolbar select,body:is([data-step="received"],[data-step="logistics-received"]) .toolbar button{padding:9px 10px;min-height:42px}
body:is([data-step="received"],[data-step="logistics-received"]) .card{padding:10px 12px;margin:7px 0;border-radius:10px}
body:is([data-step="received"],[data-step="logistics-received"]) .invoice{font-size:1rem}
body:is([data-step="received"],[data-step="logistics-received"]) .card .muted{font-size:.82rem}
body:is([data-step="received"],[data-step="logistics-received"]) .customer{margin:5px 0 3px;font-size:.94rem;line-height:1.25}
body:is([data-step="received"],[data-step="logistics-received"]) .details{margin:7px 0;padding:7px 9px;font-size:.85rem}
body:is([data-step="received"],[data-step="logistics-received"]) .details div{margin:3px 0}
body:is([data-step="received"],[data-step="logistics-received"]) .card label{margin:7px 0 3px;font-size:.84rem}
body:is([data-step="received"],[data-step="logistics-received"]) .card textarea{min-height:42px;height:42px;padding:7px 9px;font-size:16px}
body:is([data-step="received"],[data-step="logistics-received"]) .actions{margin-top:7px}
body:is([data-step="received"],[data-step="logistics-received"]) .actions button{padding:9px 12px;min-height:42px}
body:is([data-step="received"],[data-step="logistics-received"]) .message{padding:9px;margin:7px 0}
@media(max-width:600px){
 body:is([data-step="received"],[data-step="logistics-received"]) header{padding:12px}
 body:is([data-step="received"],[data-step="logistics-received"]) main{padding:10px}
 body:is([data-step="received"],[data-step="logistics-received"]) .toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
 body:is([data-step="received"],[data-step="logistics-received"]) .toolbar input{grid-column:1/-1;min-width:0;width:100%}
 body:is([data-step="received"],[data-step="logistics-received"]) .toolbar select{min-width:0;width:100%}
 body:is([data-step="received"],[data-step="logistics-received"]) .toolbar button{width:auto;white-space:nowrap}
 body:is([data-step="received"],[data-step="logistics-received"]) .topline{align-items:center;gap:7px}
 body:is([data-step="received"],[data-step="logistics-received"]) .card .topline{flex-wrap:wrap}
 body:is([data-step="received"],[data-step="logistics-received"]) .card{padding:10px}
 body:is([data-step="received"],[data-step="logistics-received"]) .actions button{width:100%}
}

/* Matching layout for Picking COMPLETE */

body[data-step="complete"] header{padding-top:12px;padding-bottom:12px}
body[data-step="complete"] header h1{font-size:clamp(1.05rem,3.5vw,1.35rem);line-height:1.3}
body[data-step="complete"] main{padding-top:12px;padding-bottom:18px}
body[data-step="complete"] main h2{font-size:1.15rem;margin:2px 0 3px}
body[data-step="complete"] main>p.muted{margin:0 0 10px;font-size:.88rem}
body[data-step="complete"] .toolbar{gap:7px;margin-bottom:9px}
body[data-step="complete"] .toolbar input,body[data-step="complete"] .toolbar select,body[data-step="complete"] .toolbar button{padding:9px 10px;min-height:42px}
body[data-step="complete"] .card{padding:10px 12px;margin:7px 0;border-radius:10px}
body[data-step="complete"] .invoice{font-size:1rem}
body[data-step="complete"] .card .muted{font-size:.82rem}
body[data-step="complete"] .customer{margin:5px 0 3px;font-size:.94rem;line-height:1.25}
body[data-step="complete"] .details{margin:7px 0;padding:7px 9px;font-size:.85rem}
body[data-step="complete"] .details div{margin:3px 0}
body[data-step="complete"] .card label{margin:7px 0 3px;font-size:.84rem}
body[data-step="complete"] .card textarea{min-height:42px;height:42px;padding:7px 9px;font-size:16px}
body[data-step="complete"] .actions{margin-top:7px}
body[data-step="complete"] .actions button{padding:9px 12px;min-height:42px}
body[data-step="complete"] .message{padding:9px;margin:7px 0}
@media(max-width:600px){
 body[data-step="complete"] header{padding:12px}
 body[data-step="complete"] main{padding:10px}
 body[data-step="complete"] .toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
 body[data-step="complete"] .toolbar input{grid-column:1/-1;min-width:0;width:100%}
 body[data-step="complete"] .toolbar select{min-width:0;width:100%}
 body[data-step="complete"] .toolbar button{width:auto;white-space:nowrap}
 body[data-step="complete"] .topline{align-items:center;gap:7px}
 body[data-step="complete"] .card .topline{flex-wrap:wrap}
 body[data-step="complete"] .card{padding:10px}
 body[data-step="complete"] .actions button{width:100%}
}

/* Compact 3-row invoice layout, shared by both picking pages */
body[data-step] .compact-order{display:grid;grid-template-columns:minmax(0,1fr) 150px;gap:8px;align-items:stretch;padding:8px 10px;margin:5px 0}
body[data-step] .order-content{display:grid;grid-template-rows:auto auto auto;min-width:0;gap:4px}
body[data-step] .order-identity{display:grid;grid-template-columns:minmax(95px,1fr) minmax(160px,2.3fr) minmax(90px,1.3fr) auto;align-items:center;gap:10px;min-width:0;font-size:.85rem;line-height:1.2}
body[data-step] .order-identity>span{min-width:0;overflow-wrap:anywhere}
body[data-step] .order-identity .invoice{font-size:.88rem;font-weight:750}
body[data-step] .order-identity .customer{margin:0;font-size:.85rem;font-weight:600}
body[data-step] .order-identity .area{color:#52667c}
body[data-step] .order-identity .order-date{white-space:nowrap;color:#52667c;font-variant-numeric:tabular-nums}
body[data-step] .compact-details{margin:0;padding:0;background:none;font-size:.81rem}
body[data-step] .compact-details summary{cursor:pointer;width:max-content;max-width:100%;color:#205b92;font-weight:600;list-style:none}
body[data-step] .compact-details summary::-webkit-details-marker{display:none}
body[data-step] .compact-details summary::after{content:' ▾'}
body[data-step] .compact-details[open] summary::after{content:' ▴'}
body[data-step] .compact-details div{justify-content:flex-start;gap:12px;margin:3px 0}
body[data-step] .remark-row{display:flex;align-items:center;gap:8px;min-width:0}
body[data-step] .card .remark-row label{margin:0;flex:0 0 auto;font-size:.78rem;white-space:nowrap}
body[data-step] .remark-row .remark-input{min-width:0;flex:1;width:100%;height:32px;min-height:32px;padding:4px 8px;border-radius:6px;font-size:16px}
body[data-step] .compact-order .actions{margin:0;display:flex;align-items:stretch}
body[data-step] .compact-order .actions button{width:100%;min-height:100%;padding:6px 8px;font-size:.85rem;white-space:normal}
@media(max-width:700px){
 body[data-step] .compact-order{grid-template-columns:minmax(0,1fr) 94px;gap:6px;padding:7px}
 body[data-step] .order-identity{grid-template-columns:minmax(74px,.95fr) minmax(0,1.5fr);gap:3px 7px;font-size:.78rem}
 body[data-step] .order-identity .invoice,body[data-step] .order-identity .customer{font-size:.8rem}
 body[data-step] .order-identity .order-date{grid-column:1;grid-row:2;justify-self:start;font-size:.78rem}
 body[data-step] .order-identity .area{grid-column:2;grid-row:2}
 body[data-step] .card .remark-row label{font-size:.7rem}
 body[data-step] .remark-row{gap:5px}
 body[data-step] .compact-order .actions button{width:100%;font-size:.74rem;padding:5px;overflow-wrap:anywhere}
}
@media(max-width:360px){body[data-step] .compact-order{grid-template-columns:minmax(0,1fr) 82px}body[data-step] .remark-row{flex-wrap:wrap}body[data-step] .remark-row .remark-input{flex-basis:100%}}

/* Step 6 planning-only selectors */

/* Step 6 layout only; no new stylesheet or changes to existing steps. */
.planning-layout{display:grid;grid-template-columns:minmax(290px,1fr) minmax(320px,1.4fr);gap:12px;align-items:start}.planning-pane{border:1px solid #cbd5e1;border-radius:12px;padding:12px;min-width:0}.planning-pane h3{margin:0 0 10px}.planning-toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0}.planning-toolbar input,.planning-toolbar select{min-width:0;flex:1;padding:9px}.planning-item{display:flex;gap:8px;align-items:center;justify-content:space-between;border:1px solid #e2e8f0;border-radius:8px;padding:8px;margin:6px 0;min-width:0}.planning-item .details{min-width:0;overflow-wrap:anywhere;flex:1}.planning-item small{display:block;color:#475569}.planning-item button{flex-shrink:0;min-height:40px}.planning-item.assigned{background:#e5e7eb;color:#6b7280}.planning-item.assigned button{opacity:.55}.planning-item .invoice-date{font-size:.85em}.planning-status{font-size:.8em;font-weight:600}.planning-pane button.primary{padding:12px;width:100%}.planning-pane button:disabled{cursor:not-allowed;opacity:.55}.planning-banner{margin:10px 0;padding:8px;border-radius:8px;background:#f1f5f9}.planning-banner.error{background:#fee2e2;color:#991b1b}.planning-count{font-size:.85em;color:#475569}.planning-pane label{display:block;font-weight:600;margin:8px 0 4px}.planning-pane textarea{width:100%;min-height:48px;resize:vertical}.planning-pane .vehicle-select{width:100%;padding:11px}.planning-empty{padding:14px;color:#64748b}.planning-meta{display:flex;gap:8px;flex-wrap:wrap}.planning-meta span{font-size:.85em}
@media(max-width:760px){.planning-layout{grid-template-columns:minmax(0,1fr)}.planning-pane{padding:9px}.planning-item{padding:7px}.planning-item button{font-size:.83em;padding:8px}.planning-toolbar{gap:5px}.planning-toolbar input{flex-basis:100%}}

/* Step 6-only layout refinements; all earlier steps remain unchanged. */
.planning-page .planning-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.planning-page .planning-heading h3{margin:0}
.planning-page .planning-heading button{white-space:nowrap;padding:7px 12px}
.planning-page .planning-filters{flex-wrap:nowrap}
.planning-page .planning-filters input{flex:1 1 auto;min-width:0}
.planning-page .planning-filters select{flex:0 0 auto;width:132px;max-width:40%;min-width:0;padding:9px 5px}
.planning-page .planning-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;padding:6px 9px;margin:5px 0;align-items:center}
.planning-page .planning-item-info{min-width:0}
.planning-page .planning-item-top{display:grid;grid-template-columns:minmax(80px,1.1fr) minmax(105px,1fr) auto;align-items:center;gap:7px;font-size:.81rem;line-height:1.25}
.planning-page .planning-tax{overflow-wrap:anywhere;font-weight:750}
.planning-page .planning-status{font-size:.75rem;overflow-wrap:anywhere}
.planning-page .planning-date{white-space:nowrap;font-size:.76rem}
.planning-page .planning-item-bottom{display:flex;justify-content:space-between;gap:7px;margin-top:3px;font-size:.78rem;line-height:1.25}
.planning-page .planning-customer{min-width:0;overflow-wrap:anywhere}
.planning-page .planning-qty{white-space:nowrap;font-weight:600}
.planning-page .planning-item-actions{align-self:stretch;display:flex;align-items:center}
.planning-page .planning-item-actions button{min-height:30px;padding:4px 8px;font-size:.79rem;line-height:1.2;min-width:78px}
.planning-page .planning-assign{background:#16803d;border-color:#16803d;color:#fff}
.planning-page .planning-remove{background:#c62828;border-color:#c62828;color:#fff}
.planning-page .planning-item.assigned{background:#e5e7eb;color:#6b7280}
.planning-page .planning-item.logistics-ready{background:rgba(22,163,74,.70);color:#102b1c;border-color:#229847}
.planning-page .planning-item.logistics-not-ready{background:rgba(220,38,38,.70);color:#3e1111;border-color:#b91c1c}
.planning-page .planning-item.logistics-ready .planning-status,.planning-page .planning-item.logistics-not-ready .planning-status{color:inherit}
.planning-page .planning-assignment-note{display:block;margin-top:2px;font-size:.72rem;color:#5b6470}
.planning-page #complete{margin-top:10px}
.planning-page .planning-spinner{display:inline-block;width:13px;height:13px;border:2px solid rgba(255,255,255,.5);border-top-color:white;border-radius:50%;animation:spin .7s linear infinite;vertical-align:-2px;margin-right:5px}
@media(max-width:520px){.planning-page .planning-item-top{grid-template-columns:minmax(65px,1fr) minmax(90px,1fr) auto;gap:4px;font-size:.74rem}.planning-page .planning-item{padding:6px;gap:5px}.planning-page .planning-item-actions button{min-width:69px;padding:4px 5px;font-size:.72rem}.planning-page .planning-item-bottom{font-size:.73rem}.planning-page .planning-filters select{width:116px}}

.planning-admin-page main{max-width:1250px;padding-top:14px}
.planning-admin-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.planning-admin-heading h2{margin:0;font-size:1.2rem}
.planning-admin-heading p{margin:3px 0 10px;font-size:.85rem}
.planning-admin-filters{display:grid;grid-template-columns:160px 190px minmax(170px,1fr) 130px;gap:8px;margin:10px 0}
.planning-admin-filters label{display:flex;flex-direction:column;gap:4px;font-size:.77rem;font-weight:650}
.planning-admin-filters input,.planning-admin-filters select{min-width:0;width:100%;padding:8px;font-size:16px}
.planning-admin-summary{font-size:.83rem;color:#475569;margin:8px 0}
.planning-admin-batch{border:1px solid #d3deea;background:#fff;border-radius:10px;margin:9px 0;padding:9px}
.planning-admin-batch-title{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:3px 2px 8px;border-bottom:1px solid #e2e8f0}
.planning-admin-batch-title>div{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.planning-admin-date,.planning-admin-tag{font-size:.8rem;color:#52647b}
.planning-admin-invoice{display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:9px;align-items:center;padding:6px 3px;border-bottom:1px solid #eef2f7}
.planning-admin-invoice:last-child{border-bottom:0}
.planning-admin-line{display:grid;grid-template-columns:minmax(90px,1fr) minmax(145px,1.35fr) 115px;gap:8px;align-items:center;font-size:.83rem}
.planning-admin-line>*{overflow-wrap:anywhere;min-width:0}
.planning-admin-second{grid-template-columns:minmax(0,1fr) auto;color:#52647b;margin-top:3px;font-size:.78rem}
.planning-admin-invoice-actions button{width:100%;padding:7px 5px;font-size:.8rem;min-height:35px}
.planning-admin-danger{background:#bb2525;color:white;border-color:#bb2525}
.planning-admin-locked{display:block;font-size:.75rem;text-align:center;color:#6b7280}
.planning-admin-invoice.admin-unassigned{opacity:.63;background:#f3f4f6}
.planning-admin-empty{padding:18px;color:#64748b}
.planning-admin-dialog{border:0;border-radius:13px;box-shadow:0 12px 40px #11182755;width:min(95vw,490px);padding:20px}
.planning-admin-dialog::backdrop{background:#0f172a88}
.planning-admin-dialog h3{margin-top:0}
.planning-admin-dialog label{font-weight:650;display:block;margin:12px 0 6px}
.planning-admin-dialog textarea{width:100%;min-height:94px;resize:vertical}
.planning-admin-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
@media(max-width:800px){.planning-admin-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.planning-admin-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.planning-admin-filters label:nth-child(3){grid-column:1/-1}.planning-admin-invoice{grid-template-columns:minmax(0,1fr) 76px;gap:5px}.planning-admin-line{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:3px 7px;font-size:.73rem}.planning-admin-line>*:last-child{grid-column:1/-1}.planning-admin-second{grid-template-columns:minmax(0,1fr) auto;font-size:.71rem}.planning-admin-second>*:last-child{grid-column:auto}.planning-admin-invoice-actions button{font-size:.73rem;padding:6px 3px}.planning-admin-batch{padding:7px}}

