/* Saved records stay green. Unsaved additions use amber with explicit text. */
:root{--draft-bg:#fff6e5;--draft-line:#e4c88b;--draft-ink:#866025;--saved-bg:#edf5ec;--saved-ink:#3d6840}
.work-state-legend{display:flex;align-items:center;gap:14px;flex-basis:100%;font-size:10px;color:#87907e;line-height:1.5}
.work-state-legend .legend-saved{color:var(--saved-ink)}.work-state-legend .legend-draft{color:var(--draft-ink)}
#workForm .visual-component.is-draft{border-color:var(--draft-line)}
#workForm .visual-component.is-draft .component-state{color:var(--draft-ink);font-weight:500}
#workForm .visual-quantity.has-addition,#workForm .visual-quantity.is-draft,#workForm .visual-task.is-draft{background:var(--draft-bg)}
#workForm .visual-quantity.has-addition .part-status,#workForm .visual-quantity.is-draft .part-status,#workForm .visual-task.is-draft small,#workForm .visual-task.is-draft .task-tick{color:var(--draft-ink)}
#workForm .visual-task:has(input:checked):not(.already-done){background:var(--draft-bg)}
#workForm .visual-task input{accent-color:#a77b31}
#workForm .visual-task.already-done input{accent-color:#4b7044}
#workForm .visual-task .task-tick svg{width:20px;height:20px}
#workForm .visual-quantity.is-saved,#workForm .visual-task.is-saved{background:var(--saved-bg)}
#workForm .visual-quantity.is-saved .part-status{color:var(--saved-ink)}
#workForm .report-total.is-draft,#workForm .report-total.is-draft b{color:var(--draft-ink)}
.save-validation{grid-column:1/-1;margin:0;color:#9b4e2f;background:#fff0e8;border-radius:7px;padding:8px 12px;font-size:12px;line-height:1.5}
.quantity-copy label svg{width:19px;height:19px;vertical-align:middle;margin-right:6px;color:#647555;flex-shrink:0}
.finishing-sequence{display:flex;align-items:center;gap:7px;padding:11px 13px;background:#fafbf7;border-bottom:1px solid #e5eadf}
.finishing-step{display:flex;align-items:center;gap:7px;flex:1;min-width:0;color:#6f7a64;background:#f1f3ed;border:1px solid #e3e7db;border-radius:9px;padding:9px}
.finishing-step>svg{width:23px;height:23px;flex-shrink:0}
.finishing-step b{display:block;font-size:11px;line-height:1.5;font-weight:600}
.finishing-step small{display:block;font-size:9px;line-height:1.6;margin-top:3px}
.finishing-step.is-saved{color:var(--saved-ink);background:var(--saved-bg);border-color:#c9d9c5}
.finishing-step.is-draft{color:var(--draft-ink);background:var(--draft-bg);border-color:var(--draft-line)}
.finishing-arrow{width:16px;height:16px;color:#869376;flex-shrink:0}
.finishing-availability{grid-column:1/-1;font-size:11px;line-height:1.6;color:#61754e;margin:0;background:#f0f4e8;padding:8px 10px;border-radius:7px}
.finishing-availability.has-error{color:#9c4d29;background:#fff0e5;font-weight:500}
#workForm .visual-quantity.has-error{box-shadow:inset 3px 0 0 #c4764c;background:#fff9f3}
#workForm[data-stage="ACABADO"] .quantity-copy label{display:flex;align-items:center}
.upholstery-progress{display:flex;align-items:center;justify-content:space-between;gap:15px;background:#f0f4e9;border:1px solid #dce5cf;border-radius:12px;padding:15px 17px}
.upholstery-progress .eyebrow{font-size:8px;letter-spacing:1.2px;margin:0 0 6px;color:#7c8a6b;display:block}
.upholstery-progress h3{font-size:18px;line-height:1.4;margin:0;font-weight:500;color:#3f5633}
.upholstery-progress p{font-size:12px;line-height:1.5;margin:5px 0 0;color:#758467}
.upholstery-dots{display:flex;gap:5px;flex-shrink:0}
.upholstery-dots>span{width:25px;height:25px;border-radius:50%;background:#e3e8db;display:flex;align-items:center;justify-content:center;font-size:10px;color:#839175;border:1px solid #d5ddca}
.upholstery-dots>.is-saved{background:#4d7545;color:#fff;border-color:#4d7545}
.upholstery-dots>.is-draft{background:#f6dfad;color:#866025;border-color:#dec087}
.upholstery-dots>.is-current{border:2px solid #526a3e;color:#405c2c;background:#fff}
.upholstery-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.upholstery-step{position:relative;display:flex;flex-direction:column;gap:9px;align-items:flex-start;text-align:left;min-height:155px;padding:17px;border:1px solid #dfe5d7;border-radius:12px;background:#fff;cursor:pointer;min-width:0}
.upholstery-step input{position:absolute;right:14px;top:14px;width:23px;height:23px;min-height:23px;margin:0;accent-color:#b0853c;cursor:pointer}
.upholstery-step-number{font-size:10px;background:#eef1e8;border:1px solid #e0e6d7;min-width:23px;height:23px;display:flex;align-items:center;justify-content:center;border-radius:50%;color:#728262}
.upholstery-action-icon{display:flex;align-items:center;justify-content:center;width:43px;height:43px;border-radius:10px;color:#7b8b6a;background:#f3f5ed;margin:0}
.upholstery-action-icon svg{width:27px;height:27px}
.upholstery-step strong{font-size:13px;line-height:1.45;font-weight:600;color:#445537}
.upholstery-step small{font-size:10px;line-height:1.5;color:#7e8a70;margin-top:auto}
.upholstery-step.is-saved{background:var(--saved-bg);border-color:#c2d5bb;cursor:default}
.upholstery-step.is-saved input{accent-color:#55794b}
.upholstery-step.is-saved .upholstery-action-icon{background:#e0ecd9;color:#55774a}
.upholstery-step.is-saved small{color:var(--saved-ink)}
.upholstery-step.is-draft{border-color:var(--draft-line);background:var(--draft-bg)}
.upholstery-step.is-draft .upholstery-action-icon{color:var(--draft-ink);background:#f8e9c8}
.upholstery-step.is-draft small{color:var(--draft-ink)}
.upholstery-step.is-current{border:2px solid #799364;padding:16px;box-shadow:0 2px 8px #324c1610}
.upholstery-step:has(input:disabled):not(.is-saved){background:#f5f6f2;border-color:#e6e9df;cursor:default}
.upholstery-step:has(input:disabled):not(.is-saved) .upholstery-action-icon{color:#a5af9a;background:#eef0e8}
.upholstery-step:has(input:disabled):not(.is-saved) strong{color:#929c88}
.upholstery-step:focus-within{outline:3px solid #6e8d78;outline-offset:3px}
.queue-upholstery{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;margin:17px 0 12px}
.queue-upholstery-step{position:relative;display:flex;align-items:center;flex-direction:column;gap:7px;text-align:center;padding:10px 6px;border:1px solid #e4e8dd;border-radius:9px;background:#f6f7f2;min-width:0}
.queue-upholstery-step>span{font-size:9px;color:#879574}
.queue-upholstery-step svg{width:25px;height:25px;color:#9aa68c}
.queue-upholstery-step b{font-size:10px;line-height:1.5;font-weight:500;color:#6a7a5b}
.queue-upholstery-step small{font-size:9px;color:#8b987d;line-height:1.5;margin-top:auto}
.queue-upholstery-step.is-saved{background:#edf4e7;border-color:#cbdcc0}.queue-upholstery-step.is-saved svg,.queue-upholstery-step.is-saved small{color:#527247}
.queue-upholstery-step.is-current{background:#fff;border-color:#889e75}.queue-upholstery-step.is-current small{color:#56723f;font-weight:600}
.paint-draft-status{font-size:12px;line-height:1.6;color:#786134;background:#fbf4e5;border-radius:8px;padding:11px 14px;margin:0}
#modal:has(#paintForm){max-height:94dvh;overflow:auto}
#paintForm{gap:12px}
#paintForm .finish-color-card{margin:0;padding:13px}
#paintForm .finish-piece-reference{height:82px}
#paintForm .finish-color-card .finish-color-copy{gap:8px}
#paintForm .paint-options{gap:9px}
#paintForm .paint-option{min-height:65px;padding:11px;font-size:13px}
#paintForm .paint-options .paint-option:last-child{grid-column:auto}
#paintForm .process-actions{position:sticky;bottom:-24px;background:#fff;padding-top:12px;z-index:2;box-shadow:0 -6px 16px #fff}
#paintForm .process-actions .button{min-height:46px;padding:10px 13px;font-size:12px}
#modal:has(.warehouse-summary){width:min(850px,calc(100vw - 28px));max-height:94dvh;overflow:auto}
#modal:has(.warehouse-summary) .warehouse-piece-reference{height:145px}
@media(max-width:850px){.upholstery-progress{flex-wrap:wrap}.upholstery-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.queue-upholstery{grid-template-columns:repeat(4,minmax(0,1fr))}.finishing-step{padding:8px 7px}.finishing-step>svg{width:18px;height:18px}.finishing-step b{font-size:10px}.finishing-step small{font-size:8px}}
@media(max-width:650px){.work-state-legend{font-size:9px;gap:12px}.upholstery-progress{padding:13px}.upholstery-progress h3{font-size:16px}.upholstery-progress p{font-size:11px}.upholstery-dots>span{width:23px;height:23px}.upholstery-steps{gap:9px}.upholstery-step{padding:13px;min-height:159px}.upholstery-step.is-current{padding:12px}.upholstery-step input{right:12px;top:12px}.upholstery-step strong{font-size:12px}.upholstery-step small{font-size:9px}.upholstery-action-icon{width:40px;height:40px}.queue-upholstery{gap:7px}.queue-upholstery-step b{font-size:9px}.finishing-sequence{gap:7px;padding:10px}.finishing-step{padding:9px 7px}.finishing-step b{font-size:10px}.finishing-step small{font-size:9px}.finishing-step>svg{width:19px;height:19px}#workForm .report-total{font-size:11px}#paintForm .process-actions{bottom:-22px}#paintForm .paint-options{grid-template-columns:repeat(2,minmax(0,1fr))}#paintForm .paint-option{min-height:63px}#paintForm .paint-options .paint-option:last-child{grid-column:1/-1}.save-validation{font-size:11px}}
@media(min-width:851px){.upholstery-step{min-height:142px;padding:14px;gap:8px}.upholstery-step.is-current{padding:13px}.upholstery-step-number{position:absolute;top:14px;left:14px}.upholstery-action-icon{align-self:center;width:38px;height:38px}.upholstery-action-icon svg{width:25px;height:25px}.upholstery-progress{padding:12px 16px}.upholstery-progress .eyebrow{display:none}}
@media(max-width:650px){#modal:has(.warehouse-summary) .modalactions{display:grid;grid-template-columns:1fr;gap:9px}#modal:has(.warehouse-summary) .modalactions .button{width:100%;min-height:49px;padding:12px 14px;font-size:14px}#modal:has(.warehouse-summary) #saveAdvance{order:-1}}

/* Completed work has an explicit, prominent handoff to the next station. */
#workForm .visual-save-actions #finishWorkButton.ready-delivery{grid-row:2;grid-column:1/-1;background:#344f2c;color:#fff;border-color:#344f2c;min-height:51px;font-size:14px;font-weight:600}
#workForm .visual-save-actions:has(#saveWorkButton[hidden])>.button[data-action="close"]{grid-column:1/-1}
