:root{font-family:system-ui,-apple-system,"Noto Sans",sans-serif;color:#18332c;background:#f3f6f4;font-size:17px;--green:#11664d;--border:#dce5df;--red:#a33725;--yellow:#8a6a12}
*{box-sizing:border-box}body{margin:0}
header{background:#123b30;color:white;padding:24px max(20px,calc((100vw - 1180px)/2)) 16px}
.head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.head>div{display:flex;gap:14px;align-items:center}
.logo{font-weight:850;font-size:32px;background:#d5f4a3;color:#163b2c;padding:8px 12px;border-radius:12px}
h1{font-size:27px;margin:0}small{color:#c0d5ca}
.snapshot{font-size:13px;border-top:1px solid #466557;padding-top:12px;margin-top:18px;color:#d9e6de}
#sync{font-size:13px;color:#d5f4a3}
.draft-banner{background:#fff4c8;color:#5c4708;text-align:center;font-weight:750;padding:10px 16px;border-bottom:1px solid #e6d48a}
.stale-bar{background:#ffd8ce;color:#8a2416;padding:10px 20px;font-weight:700;border-bottom:2px solid #c44732}
main{max-width:1220px;margin:auto;padding:20px}
h2{font-size:24px;margin:18px 0 8px}h3{margin:22px 0 10px;font-size:19px}
p{line-height:1.6}
input,select,textarea,button{font:inherit;border:1px solid #c3d3c9;border-radius:8px;padding:12px;min-height:48px;color:inherit;background:white}
button{cursor:pointer;font-weight:650}button:hover{border-color:var(--green);background:#eaf5ed}
button:disabled{opacity:.45;cursor:wait}
label{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:600}
nav{display:flex;gap:8px;margin:18px 0;border-bottom:1px solid var(--border);padding-bottom:12px;flex-wrap:wrap}
nav button{flex:1;min-width:100px;border:0;background:transparent}
nav .active,.primary{background:var(--green);color:white}
.primary:hover{background:#0e503c}
.identity{display:flex;align-items:center;gap:16px}
#whoText{font-weight:700}#logout{min-height:40px;padding:8px 14px}
.muted,.identity span{font-size:14px;color:#63756c}
.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.filters{display:flex;gap:12px;margin:8px 0 16px;flex-wrap:wrap}
.filters input[type=search]{flex:1;min-width:180px}
.check{flex-direction:row;align-items:center;gap:8px}
.check input{min-height:22px;width:22px}
.clear-filters{background:#f7faf7}
.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:12px;background:white;max-height:calc(100vh - 280px)}
table{width:100%;border-collapse:separate;border-spacing:0;font-size:15px}
th,td{border-bottom:1px solid #e6eee8;padding:9px 8px;text-align:left;vertical-align:top}
thead th{position:sticky;top:0;background:#123b30;color:white;font-weight:700;z-index:2;white-space:nowrap}
tbody tr{cursor:pointer}tbody tr:hover td{background:#f3faf4}
.sticky-name{position:sticky;left:0;background:white;font-weight:650;min-width:180px}
thead .sticky-name{background:#123b30;color:white;z-index:3}
.tag{display:inline-block;font-size:12px;font-weight:800;border-radius:999px;padding:2px 8px}
.tag.red{background:#ffd8ce;color:#8a2416}
.tag.yellow{background:#fff3c0;color:#6b5610}
.tag.green{background:#d5f4a3;color:#163b2c}
.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.heat-wrap td,.heat-wrap th{text-align:center;padding:7px 5px;white-space:nowrap}
.heat-wrap .sticky-name{text-align:left}
.cell{display:block;border-radius:6px;padding:6px 4px;font-weight:750;min-width:36px}
.cell.red{background:#ffd8ce;color:#8a2416}
.cell.yellow{background:#fff3c0;color:#6b5610}
.cell.green{background:#d5f4a3;color:#163b2c}
.cell.na{background:#f4f5f4;color:#8a948e;font-weight:500}
.param-card{background:white;border:1px solid var(--border);border-radius:12px;padding:20px;margin-bottom:16px}
.param-card h3{margin-top:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.switch{display:flex;align-items:center;gap:8px;font-size:15px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.prov{display:inline-block;background:#fff3c0;color:#6b5610;font-size:11px;font-weight:800;border-radius:6px;padding:2px 6px;margin-left:6px}
.param-actions{display:flex;gap:10px;margin-top:16px}
.order-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.order-tabs button{background:white}
.order-tabs button.active{background:var(--green);color:white}
.order-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0}
.order-text{background:#0f241c;color:#e7f5ea;border-radius:12px;padding:16px;white-space:pre-wrap;overflow:auto;min-height:240px;font-size:14px;line-height:1.55}
.empty{padding:30px;background:white;border-radius:12px;color:#708075}
footer{font-size:12px;color:#6e7e72;border-top:1px solid var(--border);margin:35px auto 0;max-width:1220px;padding:20px;line-height:1.8}
#login{position:fixed;inset:0;background:rgba(12,28,22,.72);display:flex;align-items:center;justify-content:center;z-index:30;padding:24px}
#login[hidden],#cardModal[hidden],[hidden]{display:none!important}
#login form{background:white;border-radius:16px;padding:28px 24px;width:min(420px,100%);display:grid;gap:14px}
#login h2{margin:0}
#loginError{color:#a13524;background:#fff1ed;border:1px solid #e7b1a6;border-radius:8px;padding:10px 12px;margin:0}
#cardModal{position:fixed;inset:0;background:rgba(12,28,22,.72);display:flex;align-items:flex-end;justify-content:center;z-index:25;padding:12px}
.card-sheet{background:#f3f6f4;width:min(860px,100%);max-height:92vh;overflow:auto;border-radius:16px 16px 8px 8px;padding:16px 16px 24px}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.step{background:white;border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin:10px 0}
.step h4{margin:0 0 8px;font-size:16px}
.step .nums{font-size:13px;color:#4e6258;white-space:pre-wrap;font-variant-numeric:tabular-nums}
.chart{display:flex;align-items:flex-end;gap:3px;height:80px;margin-top:10px}
.chart .bar{flex:1;background:#11664d;min-width:3px;border-radius:2px 2px 0 0;opacity:.85}
.chart .miss{background:#e2e8e4;opacity:.5}
#notice:not(:empty){padding:12px 16px;border-radius:10px;margin:8px 0 12px;background:#d5f4a3}
#notice.error{background:#ffd8ce;color:#8a2416}
@media(max-width:700px){
  main{padding:14px}header{padding:18px 16px 14px}h1{font-size:22px}
  nav button{padding:10px 8px;font-size:14px}
  .filters select{flex:1}
  .sticky-name{min-width:130px}
  table{font-size:13px}
}

.badge-nocost{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:999px;background:#f3e8d3;color:#7a4d00;font-size:11px;}
.badge-assumed{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:999px;background:#eee;color:#555;font-size:11px;}
.lost-main{font-weight:600;}
.lost-sub{color:var(--muted,#667);font-size:12px;}
.copy-wa{background:#128c4b;color:#fff;border:0;border-radius:12px;padding:14px 22px;font-size:18px;font-weight:700;cursor:pointer;line-height:1.2;}
.copy-wa:hover{background:#0e703c;}
.copy-wa:disabled{opacity:.55;cursor:not-allowed;}
.copy-status{margin-left:10px;color:#128c4b;font-weight:700;}
.order-totals{background:#f4faf6;border:1px solid #cfe6d6;border-radius:12px;padding:12px 16px;margin:8px 0 12px;display:flex;flex-wrap:wrap;gap:8px 24px;font-size:15px;}
.order-totals strong{font-size:16px;}
.order-editor{overflow:auto;margin:8px 0 16px;max-height:420px;border:1px solid #e2e2e2;border-radius:12px;}
.order-editor table{width:100%;border-collapse:collapse;font-size:14px;}
.order-editor th,.order-editor td{padding:8px 10px;border-bottom:1px solid #eee;vertical-align:middle;}
.order-editor th{position:sticky;top:0;background:#f7f7f5;text-align:left;}
.order-editor input[type=number]{width:56px;padding:4px 6px;}
.order-editor .size-edits{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;}
.order-editor .size-edits label{display:flex;gap:4px;align-items:center;font-variant-numeric:tabular-nums;}
.preview-label{margin:16px 0 8px;font-size:14px;}
.held-box{margin-top:20px;background:#fff8e8;border:1px solid #ead8a0;border-radius:12px;padding:12px 16px;}
.held-box h3{margin:0 0 8px;font-size:15px;}
.held-box ul{margin:0;padding-left:18px;}
.profit-card{background:#f4faf6;border:1px solid #cfe6d6;border-radius:16px;padding:16px 18px;margin-bottom:18px;}
.profit-card .grid label{display:flex;flex-direction:column;gap:4px;font-size:13px;}
.profit-card input{padding:6px 8px;}
