/* Product order form: two columns on desktop, one comfortable column on mobile. */
.modal-backdrop:has(#po-project-form){padding:0}
.modal:has(#po-project-form){display:flex;flex-direction:column;margin:0;width:min(1040px,calc(100vw - 48px));max-height:calc(100dvh - 48px);overflow:hidden;border-radius:22px}
.modal:has(#po-project-form) .modal-head{position:static;flex:none;padding:20px 28px;background:var(--surface,#fff)}
.modal:has(#po-project-form) .modal-head h2{font-size:21px;line-height:1.4;letter-spacing:-.5px}
.modal:has(#po-project-form)>.modal-content{min-height:0;overflow-y:auto;padding:24px 28px;scrollbar-gutter:stable;background:var(--surface-2,#f7f8fc)}
.modal:has(#po-project-form)>.modal-foot{flex:none;align-items:center;padding:16px 28px;border-top:1px solid var(--line,#e5e1ef);background:var(--surface,#fff)}
.modal:has(#po-project-form)>.modal-foot .btn{min-height:46px;min-width:88px;font-size:14px;font-weight:650}
.modal:has(#po-project-form)>.modal-foot .primary{min-width:146px}
.po-save-note{margin-right:auto;color:var(--muted,#737080);font-size:12px;line-height:1.5}
#po-project-form{margin:0;color:var(--ink,#282536);font-size:14px;line-height:1.55}
.po-intro{margin-bottom:20px}
.po-intro>span{display:block;color:var(--accent-ink,#6543ad);font-size:12px;font-weight:700;letter-spacing:.3px}
.po-intro p{margin:5px 0 0;font-size:14px;color:var(--muted,#737080);line-height:1.6;word-break:keep-all}
.po-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.po-section{min-width:0;padding:20px;background:var(--surface,#fff);border:1px solid var(--line,#e5e1ef);border-radius:16px}
.po-section[data-po-section="11"],.po-section[data-po-section="12"]{grid-column:1/-1}
.po-section h3{display:flex;gap:9px;align-items:center;font-size:15px;font-weight:700;line-height:1.5;letter-spacing:-.3px;margin:0 0 16px}
.po-section h3 b{display:inline-grid;place-items:center;flex:0 0 26px;height:26px;border-radius:9px;background:var(--accent-weak,#f0ebfa);color:var(--accent-ink,#6543ad);font-size:12px;font-weight:750}
.po-section .field{display:flex;flex-direction:column;gap:7px;min-width:0;margin:0;font-size:12px;line-height:1.5;color:var(--muted,#737080)}
.po-section .field>span{font-weight:550}
.po-section .field input:not([type=checkbox]),.po-section .field select{box-sizing:border-box;width:100%;min-width:0;height:46px;padding:10px 12px;border:1px solid var(--line,#e5e1ef);border-radius:10px;font-size:15px;line-height:1.5;color:var(--ink,#282536);background:var(--surface,#fff);transition:border-color .15s,box-shadow .15s}
.po-section .field select{padding-right:28px}
.po-section input[data-po-number]{font-variant-numeric:tabular-nums;letter-spacing:.15px}
.po-section input[readonly]{background:var(--surface-2,#f7f8fc)!important;color:var(--ink-2,#555166)!important}
.po-section input:focus-visible,.po-section select:focus-visible{outline:0;border-color:var(--accent,#7654c8);box-shadow:0 0 0 3px var(--accent-weak,#f0ebfa)}
.po-section .btn{min-height:44px;padding:9px 12px;font-size:12px;white-space:nowrap}
.po-inline{display:flex;align-items:flex-end;gap:10px;min-width:0}
.po-inline>.field{flex:1}
.po-inline>.btn{flex:none}
.po-with-unit{display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:8px}
.po-round-fields{display:grid;grid-template-columns:minmax(0,1fr) 76px minmax(0,1fr);gap:8px}
.po-with-unit>.field:last-child select{background:var(--surface-2,#f7f8fc);font-weight:650}
.po-due-fields{display:grid;grid-template-columns:100px minmax(0,1fr)}
.po-amount{position:relative;display:block}
.po-amount .field input{padding-right:65px!important;font-size:18px!important;font-weight:650}
.po-amount>[data-po-make-unit],.po-amount>[data-po-pack-unit]{position:absolute;right:14px;bottom:12px;min-width:33px;padding-left:12px;border-left:1px solid var(--line,#e5e1ef);color:var(--muted,#737080);font-size:14px;font-weight:600;line-height:22px}
.po-calculation{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 10px;margin-top:8px}
.po-calculation>span{font-size:12px;color:var(--muted,#737080);line-height:1.5}
.po-calculation .btn{min-height:34px;padding:5px 9px;font-size:11px;color:var(--accent-ink,#6543ad);background:var(--accent-weak,#f0ebfa);border-color:transparent}
.po-section small{display:block;font-size:12px;color:var(--muted,#737080);margin-top:10px;line-height:1.7;word-break:keep-all}
.po-sub{display:grid;grid-template-columns:106px 18px minmax(0,1fr);align-items:end;gap:8px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line,#e5e1ef)}
.po-sub>span{padding-bottom:12px;font-size:13px;color:var(--muted,#737080)}
.po-sub>.field:has(input[type=checkbox]){flex-direction:row-reverse;justify-content:flex-end;align-items:center;gap:8px;min-height:46px;padding-left:8px;color:var(--ink,#282536);font-size:13px}
.po-section input[type=checkbox]{flex:none;width:18px;height:18px;margin:0;accent-color:var(--accent,#7654c8)}
.po-materials{display:grid;gap:12px}
.po-material{display:grid;grid-template-columns:58px 82px minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:end;padding:16px;border:1px solid var(--line,#e5e1ef);border-radius:12px;background:var(--surface-2,#f7f8fc)}
.po-material-inactive{opacity:.62}
.po-material-inactive .field input:disabled,.po-material-inactive .field select:disabled{cursor:not-allowed;background:var(--surface-2,#f7f8fc);color:var(--muted,#737080)}
.po-material>strong{align-self:center;font-size:14px;font-weight:650}
.po-material .field:has([name^=spec]){grid-column:2/4}
.po-material>.btn{grid-column:4;justify-self:start;min-height:40px}
.po-design-options{gap:12px;align-items:stretch}
.po-design-options>.field{flex:0 1 180px;flex-direction:row-reverse;justify-content:flex-end;align-items:center;gap:10px;min-height:48px;padding:12px 16px;border:1px solid var(--line,#e5e1ef);border-radius:10px;color:var(--ink,#282536);font-size:14px;cursor:pointer}
.po-design-options>.field:has(:checked){border-color:var(--accent,#7654c8);background:var(--accent-weak,#f0ebfa);color:var(--accent-ink,#6543ad)}
.po-inactive{opacity:.55}
.po-section [hidden]{display:none!important}
#po-error:empty{display:none}
#po-error:not(:empty){padding:12px 14px;border-radius:10px;background:#fff0ed;line-height:1.6}
@media(max-width:760px){
 .modal:has(#po-project-form){width:calc(100vw - 24px);max-height:calc(100dvh - 24px);border-radius:18px}
 .modal:has(#po-project-form) .modal-head{padding:16px 18px}
 .modal:has(#po-project-form) .modal-head h2{font-size:19px}
 .modal:has(#po-project-form)>.modal-content{padding:18px;scrollbar-gutter:auto}
 .modal:has(#po-project-form)>.modal-foot{padding:12px 18px calc(12px + env(safe-area-inset-bottom,0px));gap:10px}
 .po-grid{grid-template-columns:minmax(0,1fr);gap:12px}
 .po-section{padding:18px;border-radius:14px}
 .po-section h3{margin-bottom:14px}
 .po-section .field input:not([type=checkbox]),.po-section .field select{font-size:16px;min-height:48px}
 .po-save-note{display:none}
 .modal:has(#po-project-form)>.modal-foot .primary{flex:1}
 .po-material{grid-template-columns:minmax(0,1fr) 90px;padding:14px;gap:12px}
 .po-material>strong{grid-column:1}
 .po-material .field:has([name^=orderer]),.po-material .field:has(input[type=date]),.po-material .field:has([name^=spec]){grid-column:1/-1}
 .po-material>.btn{grid-column:1/-1;justify-self:end}
}
@media(max-width:380px){
 .modal:has(#po-project-form){width:calc(100vw - 12px);max-height:calc(100dvh - 12px)}
 .modal:has(#po-project-form)>.modal-content{padding:12px}
 .po-section{padding:14px}
 .po-section .btn{padding-inline:9px}
 .po-with-unit{grid-template-columns:minmax(0,1fr) 76px}
 .po-due-fields{grid-template-columns:86px minmax(0,1fr);gap:8px}
 .po-sub{grid-template-columns:88px 14px minmax(0,1fr)}
 .po-sub>.field:has(input[type=checkbox]){padding-left:0;font-size:12px}
}
/* Project summary: the order facts fit in two rows on desktop instead of one long list. */
.po-summary .card-head{padding-block:12px}
.po-summary .card-body{padding:14px 20px 16px}
.po-summary-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.po-summary .details{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px 20px}
.po-summary .details>div{display:block;padding:0;border:0}
.po-summary .details dt{font-size:12px;line-height:1.4;color:var(--ink-3)}
.po-summary .details dd{margin:2px 0 0;text-align:left;font-size:14px;font-weight:600;line-height:1.4;font-variant-numeric:tabular-nums;word-break:keep-all;overflow-wrap:anywhere}
.po-plan-line{display:flex;gap:12px;margin:12px 0 0;padding:8px 12px;border-radius:10px;background:var(--surface-2);color:var(--ink-2);font-size:13px;line-height:1.5;word-break:keep-all}
.po-plan-line b{flex:none;font-weight:600}
.po-plan-line.is-warn{background:var(--warn-weak);color:var(--warn)}
.po-summary .table-wrap{margin:12px 0 0}
.po-summary th,.po-summary td{padding:5px 12px;font-size:13px}
@media(max-width:1100px){.po-summary .details{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:760px){.po-summary .card-head{flex-wrap:wrap}.po-summary .card-body{padding:12px 15px 15px}.po-summary .details{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}}
@media print{.modal:has(#po-project-form){display:block;max-height:none;overflow:visible}.modal:has(#po-project-form)>.modal-content{overflow:visible}.po-section{break-inside:avoid}}
