/* ==================== PRODUCTION MODULE (production.js) ==================== */
#view-production, .pd-overlay{ --pd-green:#2f9e5b; --pd-amber:#d99a06; --pd-red:#d64545; --pd-idle:#e7eaf1; --pd-break:#c9ced9; --pd-blue:#4e72b8; }
.pd-head{display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap;}
.pd-head .view-title{margin-bottom:4px;}
.pd-line-sel{width:auto; min-width:240px; max-width:100%; font:inherit; font-size:13.5px; border:1px solid var(--line); border-radius:10px; padding:8px 12px; background:#fff; color:var(--text); min-height:40px;}
.pd-tabs{display:flex; gap:4px; overflow-x:auto; margin:14px 0 18px; padding:4px; background:#fff; border:1px solid var(--line); border-radius:12px; scrollbar-width:none;}
.pd-tabs::-webkit-scrollbar{display:none;}
.pd-tabs button{font:inherit; font-size:13.5px; font-weight:600; border:0; background:none; color:var(--text-dim); padding:9px 14px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; white-space:nowrap; min-height:40px;}
.pd-tabs button:hover{background:var(--steel-tint); color:var(--navy);}
.pd-tabs button.on{background:var(--navy); color:#fff;}
.pd-tabs button:focus-visible{outline:2px solid var(--steel); outline-offset:2px;}

.pd-card{background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px 18px;}
.pd-card + .pd-card{margin-top:14px;}
.pd-card h3{margin:0 0 10px; font-size:15px; font-weight:800;}
.pd-muted{color:var(--text-dim); font-size:12.5px;}
.pd-mono{font-family:'JetBrains Mono', ui-monospace, monospace; direction:ltr; unicode-bidi:isolate; letter-spacing:.01em;}
.pd-row{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.pd-row.between{justify-content:space-between;}
.pd-grow{flex:1 1 auto;}
.pd-empty{padding:36px 16px; text-align:center; color:var(--text-dim); font-size:14px;}
.pd-empty b{display:block; color:var(--text); font-size:15px; margin-bottom:6px;}
.pd-err{color:var(--danger); font-size:13px; margin:8px 0 0; min-height:0;}

.pd-btn{font:inherit; font-size:13.5px; font-weight:700; border:1px solid transparent; border-radius:10px; padding:9px 16px; min-height:42px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:7px; background:var(--navy); color:#fff; white-space:nowrap;}
.pd-btn:hover{background:var(--navy-2);}
.pd-btn:disabled{opacity:.45; cursor:not-allowed;}
.pd-btn:focus-visible{outline:2px solid var(--steel); outline-offset:2px;}
.pd-btn.ghost{background:#fff; color:var(--navy); border-color:var(--line);}
.pd-btn.ghost:hover{background:var(--steel-tint);}
.pd-btn.green{background:var(--pd-green);} .pd-btn.green:hover{background:#278a4f;}
.pd-btn.amber{background:var(--pd-amber);} .pd-btn.amber:hover{background:#c08805;}
.pd-btn.red{background:#fff; color:var(--pd-red); border-color:#f0c7c7;} .pd-btn.red:hover{background:#fdf0f0;}
.pd-btn.sm{min-height:34px; padding:6px 11px; font-size:12.5px; border-radius:8px;}
.pd-btn.xl{min-height:64px; font-size:17px; border-radius:14px; padding:12px 18px;}

.pd-chip{display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700; padding:3px 9px; border-radius:999px; background:var(--steel-tint); color:var(--navy); white-space:nowrap;}
.pd-chip.queued{background:#eef0f5; color:#5b6b7a;}
.pd-chip.in_progress{background:#e6f1fb; color:#2559a8;}
.pd-chip.on_hold{background:#fdf3dd; color:#8a5a00;}
.pd-chip.done{background:#e5f4ec; color:#1d7148;}
.pd-chip.scrapped{background:#f6e6e6; color:#9b2c2c;}
.pd-chip.rework{background:#fbe9e9; color:#a12a2a;}

.pd-weeknav{display:flex; align-items:center; gap:6px;}
.pd-weeknav b{font-size:14px; min-width:150px; text-align:center;}
.pd-weeknav .pd-btn{min-width:42px; padding:6px 10px;}

/* ---- plan ---- */
.pd-plan-wrap{display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:16px; align-items:start;}
@media (max-width:1100px){ .pd-plan-wrap{grid-template-columns:1fr;} }
.pd-table-scroll{overflow-x:auto;}
table.pd-grid{border-collapse:separate; border-spacing:0; width:100%; min-width:720px; font-size:13px;}
.pd-grid th,.pd-grid td{border-bottom:1px solid var(--line); padding:8px 6px; text-align:center;}
.pd-grid th{font-size:12px; color:var(--text-dim); font-weight:700; background:#fafbfc; position:sticky; top:0;}
.pd-grid th.pd-day{cursor:pointer;}
.pd-grid th.pd-day.sel{background:var(--steel-tint); color:var(--navy);}
.pd-grid th.pd-day.today::after{content:'امروز'; display:block; font-size:10.5px; color:var(--steel);}
.pd-grid td.pd-name,.pd-grid th.pd-name{text-align:right; min-width:170px; padding-inline-start:10px;}
.pd-grid td.pd-name b{display:block; font-size:13.5px;}
.pd-grid td.sel{background:#f6f8fd;}
.pd-grid tfoot td{font-weight:800; background:#fafbfc;}
.pd-cell input{width:58px; text-align:center; font:inherit; font-size:14px; font-weight:700; border:1px solid var(--line); border-radius:8px; padding:6px 4px; background:#fff;}
.pd-cell input:focus{outline:2px solid var(--steel); outline-offset:0; border-color:var(--steel);}
.pd-cell input.dirty{background:#fff8e6; border-color:#e9c46a;}
.pd-cell .v{font-size:14px; font-weight:700;}
.pd-cell small{display:block; font-size:11px; color:var(--text-dim); margin-top:3px;}
.pd-cell small.short{color:var(--pd-red); font-weight:700;}
.pd-cell small.ok{color:var(--pd-green); font-weight:700;}
.pd-load-row{display:grid; grid-template-columns:120px minmax(0,1fr) 48px; gap:10px; align-items:center; margin:9px 0; font-size:13px;}
.pd-load-bar{height:12px; border-radius:6px; background:var(--pd-idle); position:relative; overflow:hidden;}
.pd-load-bar i{position:absolute; inset-block:0; inset-inline-start:0; border-radius:6px; background:var(--pd-blue);}
.pd-load-bar i.warn{background:var(--pd-amber);} .pd-load-bar i.over{background:var(--pd-red);}
.pd-load-row b{font-size:12.5px; text-align:left; direction:ltr;}
.pd-alert{padding:10px 12px; border-radius:10px; background:#fdf0f0; color:#8f2424; font-size:13px; margin-top:10px;}
.pd-alert.ok{background:#eaf6ef; color:#1d7148;}
.pd-alert.info{background:var(--steel-tint); color:var(--navy);}

/* ---- board ---- */
.pd-kpis{display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:14px;}
.pd-kpi{background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 16px;}
.pd-kpi span{font-size:12.5px; color:var(--text-dim); font-weight:600;}
.pd-kpi b{display:block; font-size:28px; line-height:1.25; font-weight:800; margin-top:2px;}
.pd-kpi b small{font-size:15px; color:var(--text-dim); font-weight:700;}
.pd-kpi em{display:block; font-style:normal; font-size:12px; margin-top:4px; color:var(--text-dim);}
.pd-kpi em.bad{color:var(--pd-red); font-weight:700;} .pd-kpi em.good{color:var(--pd-green); font-weight:700;}
.pd-board{background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px 14px 16px; overflow-x:auto;}
.pd-board-inner{min-width:860px;}
.pd-tl-head,.pd-tl-row{display:grid; grid-template-columns:170px minmax(0,1fr) 110px; gap:12px; align-items:center;}
.pd-tl-head{font-size:11.5px; color:var(--text-dim); margin-bottom:4px;}
.pd-hours{position:relative; height:18px; direction:ltr;}
.pd-hours span{position:absolute; transform:translateX(-50%); font-family:'JetBrains Mono', monospace; font-size:11px;}
.pd-tl-row{padding:8px 0; border-top:1px solid var(--line);}
.pd-tl-name b{display:block; font-size:13.5px;}
.pd-tl-name .pd-dot{width:9px; height:9px; border-radius:50%; display:inline-block; margin-inline-end:6px; background:var(--pd-idle);}
.pd-dot.work{background:var(--pd-green);} .pd-dot.slow{background:var(--pd-amber);} .pd-dot.hold{background:var(--pd-red);} .pd-dot.break{background:var(--pd-break);}
.pd-lane{position:relative; height:46px; background:var(--pd-idle); border-radius:8px; overflow:hidden; direction:ltr;}
.pd-seg{position:absolute; inset-block:0; display:flex; align-items:center; justify-content:center; overflow:hidden; font-size:11px; font-weight:700; color:#fff; white-space:nowrap;}
.pd-seg.work{background:var(--pd-green);} .pd-seg.slow{background:var(--pd-amber);} .pd-seg.hold{background:var(--pd-red);}
.pd-seg.idle{background:transparent;}
.pd-seg.break{background:repeating-linear-gradient(135deg,#d3d7e0 0 6px,#c4c9d4 6px 12px); color:#5b6475;}
.pd-seg.future{opacity:.55;}
.pd-seg span{padding:0 4px; direction:rtl; text-overflow:ellipsis; overflow:hidden;}
.pd-now{position:absolute; inset-block:-2px; width:2px; background:var(--navy); z-index:2;}
.pd-fin{position:absolute; bottom:4px; width:8px; height:8px; margin-left:-4px; border-radius:50%; background:#fff; border:2px solid #1b4d33; z-index:3;}
.pd-fin.back{border-color:var(--pd-red); background:#ffe3e3;}
.pd-tl-stat{text-align:left; direction:ltr; font-size:13px;}
.pd-tl-stat b{font-size:18px; font-weight:800;}
.pd-tl-stat small{display:block; color:var(--text-dim); font-size:11.5px; direction:rtl; text-align:left;}
.pd-legend{display:flex; gap:14px; flex-wrap:wrap; font-size:12px; color:var(--text-dim); margin-top:12px;}
.pd-legend i{display:inline-block; width:12px; height:12px; border-radius:3px; vertical-align:-2px; margin-inline-end:5px;}
.pd-hourly{margin-top:16px;}
.pd-hourly-scroll{overflow-x:auto;}
.pd-hourly table{border-collapse:collapse; width:100%; min-width:760px; font-size:12.5px;}
.pd-hourly th,.pd-hourly td{padding:6px 4px; text-align:center; border-bottom:1px solid var(--line);}
.pd-hourly th{color:var(--text-dim); font-weight:700; font-size:11.5px;}
.pd-hourly td.nm,.pd-hourly th.nm{text-align:right; direction:rtl; white-space:nowrap; padding-left:12px;}
.pd-hourly td.h{font-family:'JetBrains Mono',monospace; direction:ltr;}
.pd-hourly td.good{color:#1d7148; background:#eef8f2;} .pd-hourly td.mid{color:#8a5a00; background:#fdf6e3;} .pd-hourly td.bad{color:#9b2c2c; background:#fcefef;}

/* TV mode: full-screen dark board for the wall screen */
#pd-board-root.pd-tv{position:fixed; inset:0; z-index:200; background:#0f1322; color:#e8ebf5; padding:22px 28px; overflow:auto;}
#pd-board-root.pd-tv .pd-kpi,#pd-board-root.pd-tv .pd-board{background:#171c30; border-color:#272e48;}
#pd-board-root.pd-tv .pd-kpi span,#pd-board-root.pd-tv .pd-kpi em,#pd-board-root.pd-tv .pd-tl-head,#pd-board-root.pd-tv .pd-tl-stat small,#pd-board-root.pd-tv .pd-legend{color:#9aa3c0;}
#pd-board-root.pd-tv .pd-kpi b small{color:#9aa3c0;}
#pd-board-root.pd-tv .pd-kpi b{font-size:40px;}
#pd-board-root.pd-tv .pd-tl-row{border-color:#272e48;}
#pd-board-root.pd-tv .pd-lane{background:#232a42; height:58px;}
#pd-board-root.pd-tv .pd-tl-name b{font-size:16px;}
#pd-board-root.pd-tv .pd-now{background:#fff;}
#pd-board-root.pd-tv .pd-hourly th,#pd-board-root.pd-tv .pd-hourly td{border-color:#272e48;}
#pd-board-root.pd-tv .pd-hourly td.good{background:#173726; color:#8fe0b0;} #pd-board-root.pd-tv .pd-hourly td.mid{background:#3a2f10; color:#f2c46b;} #pd-board-root.pd-tv .pd-hourly td.bad{background:#3d1b1b; color:#ff9c9c;}
#pd-board-root.pd-tv .pd-btn.ghost{background:#171c30; color:#e8ebf5; border-color:#323a58;}
.pd-tv-title{display:none;}
#pd-board-root.pd-tv .pd-tv-title{display:flex;}

/* ---- WIP flow ---- */
.pd-flow{display:grid; grid-auto-flow:column; grid-auto-columns:minmax(220px,1fr); gap:12px; overflow-x:auto; padding-bottom:6px;}
.pd-col{background:#f7f8fb; border:1px solid var(--line); border-radius:14px; padding:10px; min-height:220px;}
.pd-col.bottleneck{border-color:#f0b4b4; background:#fff7f7;}
.pd-col-h{display:flex; justify-content:space-between; align-items:center; gap:6px; margin-bottom:8px;}
.pd-col-h b{font-size:14px;}
.pd-col-h small{font-size:11.5px; color:var(--text-dim);}
.pd-col-sub{font-size:11.5px; color:var(--text-dim); font-weight:700; margin:10px 2px 6px;}
.pd-ucard{background:#fff; border:1px solid var(--line); border-inline-start:4px solid var(--pd-blue); border-radius:10px; padding:9px 10px; margin-bottom:8px; cursor:pointer; font-size:12.5px;}
.pd-ucard:hover{box-shadow:0 2px 10px -4px rgba(43,40,115,.25);}
.pd-ucard:focus-visible{outline:2px solid var(--steel);}
.pd-ucard.queued{border-inline-start-color:#c6ccd8;}
.pd-ucard.on_hold{border-inline-start-color:var(--pd-amber); background:#fffaf0;}
.pd-ucard.over{border-inline-start-color:var(--pd-red);}
.pd-ucard .c{font-weight:800; font-size:13px;}
.pd-ucard .p{color:var(--text-dim); margin-top:2px;}
.pd-ucard .t{display:flex; justify-content:space-between; gap:6px; margin-top:6px; font-size:11.5px;}
.pd-ucard .t .over{color:var(--pd-red); font-weight:800;}

/* ---- station terminal ---- */
.pd-st-pick{display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px;}
.pd-st-pick button{font:inherit; text-align:right; background:#fff; border:1.5px solid var(--line); border-radius:14px; padding:18px; cursor:pointer;}
.pd-st-pick button:hover{border-color:var(--steel); background:var(--steel-tint);}
.pd-st-pick button b{display:block; font-size:16px; margin-bottom:4px;}
.pd-term{display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:16px; align-items:start;}
@media (max-width:960px){ .pd-term{grid-template-columns:minmax(0,1fr);} }
.pd-term > div{min-width:0;}
@media (max-width:520px){ .pd-scanbox .pd-btn span{display:none;} .pd-scanbox input{font-size:16px;} .pd-unit-code{font-size:24px;} }
.pd-scanbox{display:flex; gap:8px;}
.pd-scanbox input{flex:1; font:inherit; font-size:18px; padding:12px 14px; border:2px solid var(--line); border-radius:12px; direction:ltr; text-align:left; font-family:'JetBrains Mono',monospace; min-width:0;}
.pd-scanbox input:focus{border-color:var(--steel); outline:none; box-shadow:0 0 0 4px rgba(78,114,184,.15);}
#pd-cam{margin-top:12px; border-radius:12px; overflow:hidden; background:#000; max-width:420px;}
#pd-cam video{width:100% !important; height:auto !important;}
.pd-unit-big{margin-top:16px;}
.pd-unit-code{font-size:clamp(26px,4vw,38px); font-weight:800; color:var(--navy);}
.pd-steps{display:flex; gap:4px; margin:12px 0; flex-wrap:wrap;}
.pd-steps span{font-size:11.5px; padding:4px 8px; border-radius:7px; background:#eef0f5; color:var(--text-dim);}
.pd-steps span.done{background:#e5f4ec; color:#1d7148;}
.pd-steps span.cur{background:var(--navy); color:#fff; font-weight:700;}
.pd-timer{display:flex; align-items:baseline; gap:10px; margin:6px 0 4px;}
.pd-timer b{font-size:38px; font-weight:800; font-family:'JetBrains Mono',monospace; direction:ltr;}
.pd-timer b.over{color:var(--pd-red);}
.pd-progress{height:8px; background:var(--pd-idle); border-radius:4px; overflow:hidden;}
.pd-progress i{display:block; height:100%; background:var(--pd-green);}
.pd-progress i.over{background:var(--pd-red);}
.pd-actions{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-top:16px;}
.pd-check{margin:12px 0 0; padding:0; list-style:none;}
.pd-check li{display:flex; gap:8px; align-items:flex-start; padding:7px 0; border-bottom:1px dashed var(--line); font-size:13.5px;}
.pd-check input{width:18px; height:18px; margin-top:2px; accent-color:var(--pd-green);}
.pd-msg{padding:12px 14px; border-radius:12px; font-size:14px; margin-top:14px; background:var(--steel-tint); color:var(--navy);}
.pd-msg.warn{background:#fdf3dd; color:#7a5000;} .pd-msg.ok{background:#e5f4ec; color:#1d7148;} .pd-msg.bad{background:#fcefef; color:#8f2424;}
.pd-qlist{max-height:520px; overflow:auto;}
.pd-qitem{display:flex; justify-content:space-between; align-items:center; gap:8px; padding:9px 4px; border-bottom:1px solid var(--line); cursor:pointer; font-size:13px;}
.pd-qitem:hover{background:var(--steel-tint);}
.pd-sheet-list{display:grid; gap:8px; margin:10px 0;}
.pd-sheet-list label{display:flex; gap:10px; align-items:center; padding:12px 14px; border:1.5px solid var(--line); border-radius:12px; cursor:pointer; font-size:14.5px;}
.pd-sheet-list label:has(input:checked){border-color:var(--navy); background:var(--steel-tint);}
.pd-sheet-list input{width:18px; height:18px; accent-color:var(--navy);}

/* ---- dialogs ---- */
.pd-overlay{position:fixed; inset:0; background:rgba(16,20,40,.45); z-index:150; display:none; align-items:flex-start; justify-content:center; padding:5vh 16px; overflow-y:auto;}
.pd-overlay.open{display:flex;}
.pd-dialog{background:#fff; border-radius:16px; width:100%; max-width:760px; padding:20px 22px; position:relative; box-shadow:0 20px 60px -20px rgba(0,0,0,.45);}
.pd-dialog.narrow{max-width:480px;}
.pd-x{position:absolute; top:12px; left:12px; width:38px; height:38px; border-radius:10px; border:0; background:#f1f3f7; cursor:pointer; display:grid; place-items:center; color:var(--text-dim);}
.pd-x:hover{background:#e4e8ef; color:var(--text);}
.pd-dialog h3{margin:0 0 14px 50px; font-size:16px; font-weight:800; overflow-wrap:anywhere; line-height:1.5;}
.pd-field{display:block; margin-bottom:12px;}
.pd-field > span{display:block; font-size:12.5px; font-weight:700; color:var(--text-dim); margin-bottom:5px;}
.pd-field input,.pd-field select,.pd-field textarea{width:100%; font:inherit; font-size:14px; border:1px solid var(--line); border-radius:10px; padding:9px 11px; background:#fff;}
.pd-field input:focus,.pd-field select:focus,.pd-field textarea:focus{outline:2px solid var(--steel); outline-offset:0;}
.pd-form-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:0 12px;}

/* ---- unit history ---- */
.pd-hist{list-style:none; margin:14px 0 0; padding:0; position:relative;}
.pd-hist li{position:relative; padding:0 26px 16px 0;}
.pd-hist li::before{content:''; position:absolute; right:6px; top:6px; bottom:-6px; width:2px; background:var(--line);}
.pd-hist li:last-child::before{display:none;}
.pd-hist li::after{content:''; position:absolute; right:1px; top:4px; width:12px; height:12px; border-radius:50%; background:#fff; border:3px solid var(--pd-green);}
.pd-hist li.open::after{border-color:var(--pd-blue);}
.pd-hist li.back::after{border-color:var(--pd-red);}
.pd-hist li.scrap::after{border-color:#777;}
.pd-hist .h1{display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; font-size:14px;}
.pd-hist .h2{font-size:12.5px; color:var(--text-dim); margin-top:3px;}
.pd-hist .over{color:var(--pd-red); font-weight:700;}
.pd-split{display:flex; height:12px; border-radius:6px; overflow:hidden; margin:8px 0 6px; background:var(--pd-idle);}
.pd-split i{display:block; height:100%;}
.pd-split i.w{background:var(--pd-green);} .pd-split i.h{background:var(--pd-red);} .pd-split i.q{background:#c6ccd8;}
.pd-meta{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-top:12px;}
.pd-meta div{background:#f7f8fb; border-radius:10px; padding:9px 11px; font-size:13px;}
.pd-meta div span{display:block; font-size:11.5px; color:var(--text-dim); margin-bottom:2px;}

/* ---- orders ---- */
.pd-olist .pd-orow{display:grid; grid-template-columns:120px 90px minmax(0,1.4fr) 70px minmax(0,1.2fr) auto; gap:10px; align-items:center; padding:11px 4px; border-bottom:1px solid var(--line); font-size:13px;}
.pd-olist .pd-ohead{font-size:12px; color:var(--text-dim); font-weight:700; padding-block:6px;}
.pd-obar{display:flex; height:9px; border-radius:5px; overflow:hidden; background:#eef0f5;}
.pd-obar i{display:block; height:100%;}
.pd-obar i.d{background:var(--pd-green);} .pd-obar i.a{background:var(--pd-blue);}
@media (max-width:760px){
  .pd-olist .pd-orow{grid-template-columns:1fr 1fr; row-gap:6px;}
  .pd-olist .pd-ohead{display:none;}
}

/* ---- report ---- */
.pd-charts{display:grid; grid-template-columns:repeat(auto-fit,minmax(360px,1fr)); gap:14px; margin-top:14px;}
@media (max-width:480px){ .pd-charts{grid-template-columns:1fr;} }
svg.pd-ch{width:100%; height:auto; display:block; direction:ltr;}
svg.pd-ch text{font-family:Vazirmatn, sans-serif; font-size:12.5px; fill:var(--text-dim);}
.pd-bars .r{display:grid; grid-template-columns:130px minmax(0,1fr) 92px; gap:10px; align-items:center; margin:8px 0; font-size:12.5px;}
.pd-bars .b{position:relative; height:16px; background:#eef0f5; border-radius:4px;}
.pd-bars .b i{position:absolute; inset-block:0; inset-inline-start:0; border-radius:4px; background:var(--pd-blue);}
.pd-bars .b i.std{background:transparent; border-inline-end:2px dashed #1a1f36; border-radius:0;}
.pd-bars .b i.over{background:var(--pd-red);}
.pd-bars .r b{text-align:left; font-size:12px; white-space:nowrap;}

/* ---- settings ---- */
.pd-set-table{width:100%; border-collapse:collapse; font-size:13px;}
.pd-set-table th{font-size:12px; color:var(--text-dim); text-align:right; padding:6px; border-bottom:1px solid var(--line);}
.pd-set-table td{padding:6px; border-bottom:1px solid var(--line); vertical-align:middle;}
.pd-set-table input[type=text],.pd-set-table input:not([type]),.pd-set-table select{font:inherit; font-size:13px; border:1px solid var(--line); border-radius:8px; padding:6px 8px; width:100%; background:#fff;}
.pd-route{display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:8px; margin-top:8px;}
.pd-route label{display:flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:10px; padding:8px 10px; font-size:13px;}
.pd-route label.on{border-color:var(--steel); background:#f6f8fd;}
.pd-route input[type=checkbox]{width:17px; height:17px; accent-color:var(--navy);}
.pd-route input.std{width:56px; font:inherit; font-size:13px; border:1px solid var(--line); border-radius:7px; padding:4px; text-align:center; margin-inline-start:auto;}
.pd-prod{border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-top:10px;}
.pd-prod.inactive{opacity:.6;}

@media (max-width:760px){
  .pd-card{padding:14px;}
  .pd-tl-head,.pd-tl-row{grid-template-columns:120px minmax(0,1fr) 80px;}
  .pd-load-row{grid-template-columns:100px minmax(0,1fr) 44px;}
  .pd-btn.xl{min-height:58px; font-size:16px;}
}

/* inventory autocomplete (settings → products) */
.pd-ac{position:relative;}
.pd-ac-list{display:none; position:absolute; z-index:30; top:100%; inset-inline:0; margin-top:4px; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 10px 28px -10px rgba(16,20,40,.3); max-height:280px; overflow-y:auto;}
.pd-ac-item{display:flex; gap:10px; align-items:baseline; padding:9px 12px; font-size:13px; cursor:pointer; border-bottom:1px solid var(--line);}
.pd-ac-item:last-child{border-bottom:0;}
.pd-ac-item b{font-size:12.5px; flex:none;}
.pd-ac-item span{color:var(--text);}
.pd-ac-item:hover,.pd-ac-item.on{background:var(--steel-tint);}
.pd-ac-none{padding:10px 12px; font-size:12.5px; color:var(--text-dim);}

/* all-lines overview (management) */
.pd-ov{display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,460px),1fr)); gap:14px;}
.pd-ov-card + .pd-ov-card{margin-top:0;}
.pd-ov-kpis{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:14px 0;}
.pd-ov-kpis > div{background:#f7f8fb; border-radius:10px; padding:10px 12px;}
.pd-ov-kpis span{display:block; font-size:12px; color:var(--text-dim); font-weight:600;}
.pd-ov-kpis b{display:block; font-size:22px; font-weight:800; line-height:1.3;}
.pd-ov-kpis b small{font-size:13px; color:var(--text-dim);}
.pd-ov-kpis em{display:block; font-style:normal; font-size:11.5px; color:var(--text-dim);}
.pd-ov-kpis em.bad{color:var(--pd-red); font-weight:700;} .pd-ov-kpis em.good{color:var(--pd-green); font-weight:700;}
.pd-ov-st > div{display:grid; grid-template-columns:14px minmax(0,1fr) auto 56px; gap:8px; align-items:center; padding:7px 2px; border-top:1px solid var(--line); font-size:13px;}
.pd-ov-st .nm{font-weight:600;}
.pd-ov-st b{text-align:left;}
.pd-ov-st .pd-dot{width:10px; height:10px; border-radius:50%; display:inline-block; background:var(--pd-idle);}
@media (max-width:560px){ .pd-ov-kpis{grid-template-columns:repeat(2,minmax(0,1fr));} }
/* line access checkboxes */
.pd-depts{display:flex; flex-wrap:wrap; gap:8px;}
.pd-depts label{display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); border-radius:9px; padding:7px 11px; font-size:13px; cursor:pointer;}
.pd-depts label:has(input:checked){border-color:var(--navy); background:var(--steel-tint); color:var(--navy); font-weight:700;}
.pd-depts input{width:16px; height:16px; accent-color:var(--navy);}

.pd-field input[type=checkbox]{width:auto;}
.pd-bars-g{font-size:12.5px; font-weight:800; color:var(--navy); margin:12px 0 2px; padding-top:8px; border-top:1px solid var(--line);}
.pd-bars-g:first-child{border-top:0; margin-top:0; padding-top:0;}

/* days the line doesn't work */
.pd-grid th.pd-day.closed{color:#9aa2b4; background:repeating-linear-gradient(135deg,#f4f5f8 0 6px,#eceef3 6px 12px);}
.pd-grid td.closed{background:repeating-linear-gradient(135deg,#fafbfc 0 6px,#f1f2f6 6px 12px);}
.pd-off{display:block; font-size:10.5px; font-weight:800; color:#8a5a00;}
.pd-cd-x{border:0; background:none; cursor:pointer; font-size:15px; line-height:1; padding:0 2px; color:#6b7385; margin-inline-start:4px;}
.pd-cd-x:hover{color:var(--pd-red);}

/* ==================== PHONES ====================
   index.html turns every <table> into a stack of "label: value" cards below
   700px (using each cell's data-label). That suits the list-type tables here
   (line comparison, stations in settings, the release dialog), which carry
   data-labels. The weekly plan and the hourly grid are real grids, so they
   opt out (.pd-keep-table) and get layouts of their own below. */
.pd-wide{overflow-x:auto;}
table.pd-cmp{min-width:640px;}
table.pd-st-table{min-width:720px;}
.pd-kpi b.pd-kpi-txt{font-size:22px;}
.pd-daystrip,.pd-swipe,.pd-m-only{display:none;}

@media (max-width:700px){
  /* tables that stay tables */
  #view-production table.pd-keep-table{display:table; width:100%;}
  #view-production table.pd-keep-table thead{display:table-header-group;}
  #view-production table.pd-keep-table tbody{display:table-row-group;}
  #view-production table.pd-keep-table tfoot{display:table-footer-group;}
  #view-production table.pd-keep-table tr{display:table-row; border:0; border-radius:0; padding:0; margin:0; background:none; box-shadow:none;}
  #view-production table.pd-keep-table th,
  #view-production table.pd-keep-table td{display:table-cell; width:auto; font-size:13px; line-height:1.4; word-break:normal;}
  #view-production table.pd-keep-table td:before{content:none; display:none;}

  /* tables that become cards: drop the desktop min-widths */
  .pd-wide{overflow:visible;}
  table.pd-cmp, table.pd-st-table{min-width:0 !important;}
  #view-production table td > textarea, .pd-overlay table td > textarea{flex:1; min-width:0;}
  #view-production table td > input[type=checkbox]{flex:none; width:22px; height:22px;}
  #view-production .pd-st-table td > input:not([type=checkbox]), #view-production .pd-st-table td > select, #view-production .pd-st-table td > textarea,
  .pd-overlay table td > input{flex:1 1 auto; width:auto !important; min-width:0;}
  #view-production .pd-st-table tr.pd-st-new{background:#f7f8fb;}
  #view-production table td.pd-cmp-name, .pd-overlay table td.pd-cmp-name{font-size:14px; padding-bottom:6px;}
  .pd-overlay table thead{display:none;}
  .pd-d-only{display:none !important;}
  .pd-m-only{display:block;}

  /* tabs: two rows, every tab visible (the active one could scroll out of sight) */
  .pd-tabs{flex-wrap:wrap; overflow:visible; gap:4px; margin:12px 0 14px;}
  .pd-tabs button{flex:1 1 calc(25% - 4px); justify-content:center; min-height:44px; padding:8px 6px; font-size:12.5px; gap:5px;}
  .pd-tabs button svg{width:15px; height:15px;}
  .pd-line-sel{width:100%; min-width:0; min-height:44px;}

  /* touch targets */
  .pd-btn{min-height:44px;}
  .pd-btn.sm{min-height:40px; padding:7px 12px;}
  .pd-field input,.pd-field select,.pd-field textarea,.pd-set-table input:not([type=checkbox]),.pd-set-table select{min-height:42px; font-size:16px;}
  .pd-weeknav{width:100%; justify-content:space-between;}
  .pd-weeknav b{min-width:0; flex:1;}
  .pd-weeknav .pd-btn{min-width:44px;}
  .pd-row.between > .pd-row{width:100%;}
  .pd-row.between > .pd-row > .pd-btn{flex:1;}

  /* KPI tiles: 2 per row, values that are words shrink instead of wrapping */
  .pd-kpis{grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px;}
  .pd-kpi{padding:12px;}
  .pd-kpi b{font-size:24px;}
  .pd-kpi b.pd-kpi-txt, .pd-kpi b[style*="font-size:20px"]{font-size:17px !important; line-height:1.4;}
  .pd-kpi em{font-size:11.5px;}

  /* ---- weekly plan: one day at a time ---- */
  .pd-daystrip{display:flex; gap:6px; overflow-x:auto; margin:0 0 10px; padding:2px; scrollbar-width:none;}
  .pd-daystrip::-webkit-scrollbar{display:none;}
  .pd-daystrip button{flex:1 0 64px; font:inherit; border:1px solid var(--line); background:#fff; border-radius:12px; padding:8px 4px; min-height:64px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:1px; color:var(--text);}
  .pd-daystrip button b{font-size:13px;}
  .pd-daystrip button span{font-size:11.5px; color:var(--text-dim);}
  .pd-daystrip button em{font-style:normal; font-size:11.5px; font-weight:700; color:var(--steel);}
  .pd-daystrip button.today b::after{content:' · امروز'; font-weight:600; font-size:11px; color:var(--steel);}
  .pd-daystrip button.sel{background:var(--navy); border-color:var(--navy); color:#fff;}
  .pd-daystrip button.sel span,.pd-daystrip button.sel em,.pd-daystrip button.sel.today b::after{color:#dfe5f5;}
  .pd-daystrip button.closed:not(.sel){background:repeating-linear-gradient(135deg,#f4f5f8 0 6px,#eceef3 6px 12px); color:#8a91a3;}
  .pd-daystrip button:focus-visible{outline:2px solid var(--steel); outline-offset:2px;}
  table.pd-grid{min-width:0;}
  .pd-grid thead{display:none !important;}
  .pd-grid .pd-cell:not(.sel){display:none !important;}
  .pd-grid td.pd-name{min-width:0; width:62%; padding:10px 8px;}
  .pd-grid td.pd-name b{font-size:14px;}
  .pd-grid td.sel{background:none;}
  .pd-cell input{width:76px; min-height:44px; font-size:17px;}
  .pd-cell small{font-size:12px;}
  .pd-grid tbody td:last-child, .pd-grid tfoot td:last-child{font-size:12px; color:var(--text-dim); width:64px;}
  #view-production table.pd-keep-table.pd-grid tbody td:last-child::before{content:'هفته'; display:block; font-size:11px; font-weight:600; color:var(--text-dim);}
  .pd-table-scroll{overflow:visible;}
  .pd-load-row{grid-template-columns:96px minmax(0,1fr) 44px; gap:8px;}

  /* ---- line board: timeline full width, name above each lane ---- */
  .pd-board{overflow:visible; padding:10px 12px 14px;}
  .pd-board-inner{min-width:0;}
  .pd-tl-head{grid-template-columns:minmax(0,1fr);}
  .pd-tl-head > span{display:none;}
  .pd-hours span:nth-child(even){display:none;}
  .pd-tl-row{grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"n s" "l l"; row-gap:6px; column-gap:10px;}
  .pd-tl-name{grid-area:n; display:flex; align-items:baseline; gap:8px; flex-wrap:wrap;}
  .pd-tl-name b{display:inline; font-size:14px;}
  .pd-lane{grid-area:l; height:34px;}
  .pd-tl-stat{grid-area:s; display:flex; align-items:baseline; gap:6px;}
  .pd-tl-stat b{font-size:16px;}
  .pd-tl-stat small{display:inline;}
  .pd-legend{gap:8px 12px; font-size:11.5px;}
  #pd-tv-btn{display:none;}
  .pd-swipe{display:block; margin:0 0 6px; font-size:12px;}
  .pd-hourly table{min-width:560px;}
  .pd-hourly td.nm, .pd-hourly th.nm{position:sticky; right:0; background:#fff; z-index:1; box-shadow:-6px 0 8px -6px rgba(16,20,40,.18); padding-left:8px; font-size:12.5px;}

  /* ---- work flow: stations stacked, queue trimmed ---- */
  .pd-flow{grid-auto-flow:row; grid-auto-columns:auto; grid-template-columns:minmax(0,1fr); overflow:visible;}
  .pd-col{min-height:0;}
  .pd-m-extra{display:none;}
  .pd-ucard{padding:10px 12px;}

  /* ---- reports: label and value on one line, bar under them ---- */
  .pd-bars .r{grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"l v" "b b"; row-gap:5px; margin:12px 0;}
  .pd-bars .r > span{grid-area:l; font-size:13px; font-weight:600;}
  .pd-bars .r > .b{grid-area:b; height:14px;}
  .pd-bars .r > b{grid-area:v; font-size:12.5px;}
  svg.pd-ch text{font-size:15px;}
  .pd-charts{grid-template-columns:minmax(0,1fr);}

  /* ---- settings: product routes ---- */
  .pd-route{grid-template-columns:minmax(0,1fr);}
  .pd-route label{min-height:48px; padding:6px 12px;}
  .pd-route input[type=checkbox]{width:22px; height:22px;}
  .pd-route input.std{width:76px; min-height:38px; font-size:16px;}
  .pd-depts label{min-height:44px;}
  .pd-depts input{width:20px; height:20px;}

  /* ---- orders ---- */
  .pd-olist .pd-orow{padding:12px 2px;}

  /* ---- dialogs as bottom-friendly sheets ---- */
  .pd-overlay{padding:12px 10px; align-items:flex-start;}
  .pd-dialog{padding:16px 14px; border-radius:14px;}
  .pd-x{width:44px; height:44px;}
}

/* ==================== v1.4: people, station logins, rewards, demo ==================== */
.pd-red{color:var(--pd-red) !important;} .pd-green{color:var(--pd-green) !important;}
.pd-h4{font-size:13.5px; font-weight:800; margin:14px 0 6px;}
/* demo line */
.pd-demo{display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:12px 0 0; padding:12px 14px; border-radius:12px; background:#fff6e0; border:1px solid #f1d58c; color:#6b4a00;}
.pd-demo svg{flex:none; color:#b07a00;}
.pd-demo b{display:block; font-size:14px;} .pd-demo span{font-size:12.5px;}
.pd-demo-card{border-color:#f1d58c; background:#fffcf3;}
.pd-pins{display:flex; flex-wrap:wrap; gap:6px;}
.pd-pins > span{display:inline-flex; gap:8px; align-items:baseline; background:#f7f8fb; border-radius:8px; padding:6px 10px; font-size:13px;}
.pd-cred{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:10px 0;}
.pd-cred div{background:#f7f8fb; border-radius:10px; padding:10px 12px;}
.pd-cred span{display:block; font-size:12px; color:var(--text-dim);}
.pd-cred b{font-size:20px;}
.pd-acct{display:flex; align-items:center; gap:6px; flex-wrap:wrap;}
/* station: who is working */
.pd-crew{border:1px solid var(--line); border-radius:12px; padding:10px 12px; margin:0 0 12px; background:#f9fafc;}
.pd-crew-t{display:inline-flex; align-items:center; gap:6px; font-size:13.5px;}
.pd-people{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px;}
.pd-person{display:inline-flex; align-items:stretch; border:1.5px solid var(--line); border-radius:12px; background:#fff; overflow:hidden;}
.pd-person > button{font:inherit; border:0; background:none; cursor:pointer; color:inherit;}
.pd-person > button:first-child{display:flex; flex-direction:column; align-items:flex-start; padding:7px 12px; min-height:48px; justify-content:center;}
.pd-person b{font-size:14px;} .pd-person small{font-size:11.5px; color:var(--text-dim);}
.pd-person-x{padding:0 10px; color:var(--text-dim); border-inline-start:1px solid var(--line) !important; min-width:44px;}
.pd-person-x:hover{background:#fdf0f0; color:var(--pd-red);}
.pd-person.on{border-color:var(--navy); background:var(--steel-tint);}
.pd-person.on b{color:var(--navy);}
.pd-person.static{flex-direction:column; padding:6px 10px; border-width:1px;}
.pd-people.sm{margin-top:8px;}
.pd-crew-who{margin:8px 0 0; font-size:13px;}
.pd-pick-list{display:grid; gap:8px; margin:10px 0;}
.pd-pick-person{font:inherit; text-align:right; border:1.5px solid var(--line); background:#fff; border-radius:12px; padding:12px 14px; cursor:pointer; display:flex; flex-direction:column; gap:2px; min-height:56px;}
.pd-pick-person:hover,.pd-pick-person:focus-visible{border-color:var(--navy); background:var(--steel-tint); outline:none;}
.pd-pick-person b{font-size:15.5px;} .pd-pick-person span{font-size:12px; color:var(--text-dim);}
.pd-others summary{cursor:pointer; font-size:13px; color:var(--steel); font-weight:700; padding:6px 0;}
.pd-pin-in{width:100%; font:inherit; font-family:'JetBrains Mono',monospace; font-size:30px; letter-spacing:.35em; text-align:center; direction:ltr; border:2px solid var(--line); border-radius:12px; padding:10px; margin:6px 0 4px;}
.pd-pin-in:focus{outline:none; border-color:var(--steel); box-shadow:0 0 0 4px rgba(78,114,184,.15);}
.pd-crew-mini{display:inline-flex; align-items:center; gap:4px; font-size:11.5px; color:var(--navy); background:var(--steel-tint); border-radius:999px; padding:1px 8px; margin-top:3px;}
#pd-board-root.pd-tv .pd-crew-mini{background:#232a42; color:#c9d3f2;}
/* people tab */
.pd-subtabs{display:flex; gap:4px; flex-wrap:wrap; margin:0 0 14px; padding:4px; background:#f1f3f8; border-radius:12px;}
.pd-subtabs button{font:inherit; font-size:13px; font-weight:700; border:0; background:none; color:var(--text-dim); border-radius:9px; padding:8px 12px; min-height:40px; cursor:pointer; display:inline-flex; align-items:center; gap:6px;}
.pd-subtabs button.on{background:#fff; color:var(--navy); box-shadow:0 1px 4px rgba(16,20,40,.12);}
.pd-chips{display:flex; gap:6px; flex-wrap:wrap;}
.pd-chipbtn{font:inherit; font-size:13px; font-weight:700; border:1px solid var(--line); background:#fff; color:var(--text-dim); border-radius:999px; padding:6px 14px; min-height:38px; cursor:pointer;}
.pd-chipbtn.on{background:var(--navy); border-color:var(--navy); color:#fff;}
.pd-st-cards{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px;}
.pd-st-card + .pd-st-card{margin-top:0;}
.pd-st-meta{display:flex; gap:14px; flex-wrap:wrap; font-size:13px; margin-top:8px; color:var(--text-dim);}
.pd-st-meta span{display:inline-flex; align-items:center; gap:5px;}
.pd-st-meta b{color:var(--text);}
.pd-rank tbody tr{cursor:pointer;}
.pd-rank tbody tr:hover{background:#f7f8fb;}
.pd-rank-n b{margin-inline-start:6px;}
.pd-rank-n small{display:block; margin-top:2px;}
.pd-medal{display:inline-grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#eef0f5; color:var(--text-dim); font-weight:800; font-size:12.5px; vertical-align:middle;}
.pd-medal.m1{background:#f7d774; color:#6b4a00;} .pd-medal.m2{background:#dfe3ea; color:#3d4656;} .pd-medal.m3{background:#efc29a; color:#6b3a10;}
.pd-eff{font-weight:800;} .pd-eff.good{color:var(--pd-green);} .pd-eff.bad{color:var(--pd-red);}
.pd-tier{display:inline-flex; align-items:center; gap:4px; font-weight:800; color:#8a5a00; background:#fff3d6; border-radius:999px; padding:2px 9px; font-size:12.5px;}
.pd-howto ul{margin:6px 0 0; padding-inline-start:18px; font-size:13.5px; line-height:1.9;}
.pd-howto h3{display:flex; align-items:center; gap:6px;}
.pd-snap{display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 0; border-bottom:1px solid var(--line);}
.pd-snap:last-child{border-bottom:0;}
table.pd-wk{border-collapse:collapse; width:100%; min-width:520px; font-size:13px;}
.pd-wk th,.pd-wk td{padding:7px 6px; text-align:center; border-bottom:1px solid var(--line);}
.pd-wk th{font-size:12px; color:var(--text-dim);}
.pd-wk td.nm,.pd-wk th.nm{text-align:right; white-space:nowrap; font-weight:600;}
.pd-wk td.pd-late{color:#9b2c2c; background:#fcefef; font-weight:700;}
tr.pd-inactive{opacity:.55;}
.pd-calc td:last-child{text-align:left; font-weight:700; direction:ltr; unicode-bidi:isolate;}
.pd-calc tr.tot td{border-top:2px solid var(--line);}
.pd-kpi b.pd-red{color:var(--pd-red);}

/* ---- station login = kiosk: only this station's terminal ---- */
body.pd-kiosk #app-nav, body.pd-kiosk .v3-search-trigger, body.pd-kiosk .v3-create-wrap, body.pd-kiosk #notif-bell-btn,
body.pd-kiosk #topbar-profile-btn, body.pd-kiosk #view-production .back-link, body.pd-kiosk #pd-tabs, body.pd-kiosk #pd-line{display:none !important;}
body.pd-kiosk .who{pointer-events:none;}
body.pd-kiosk main{margin:0 auto !important; padding-bottom:28px !important;}

@media (max-width:700px){
  .pd-subtabs button{flex:1 1 calc(33% - 4px); justify-content:center; padding:8px 6px; font-size:12.5px;}
  .pd-st-cards{grid-template-columns:minmax(0,1fr);}
  .pd-cred{grid-template-columns:minmax(0,1fr);}
  .pd-person > button:first-child{min-height:52px;}
  #view-production table.pd-wk{display:table;}
  #view-production table.pd-wk thead{display:table-header-group;} #view-production table.pd-wk tbody{display:table-row-group;}
  #view-production table.pd-wk tr{display:table-row; border:0; padding:0; margin:0; background:none; border-radius:0;}
  #view-production table.pd-wk th, #view-production table.pd-wk td{display:table-cell; width:auto;}
  #view-production table.pd-wk td:before{content:none; display:none;}
  .pd-wk td.nm,.pd-wk th.nm{position:sticky; right:0; background:#fff; z-index:1; box-shadow:-6px 0 8px -6px rgba(16,20,40,.18);}
  .pd-rank-n{flex-wrap:wrap;}
  .pd-snap > .pd-row{width:100%; justify-content:space-between;}
}

/* ---------- v1.5: codes follow the plan; reprint labels and sheets ---------- */
.pd-olist .pd-orow{grid-template-columns:minmax(0,1.3fr) 80px minmax(0,1.4fr) auto;}
.pd-oday{margin-bottom:14px;}
.pd-oday-h{padding:2px 4px 10px; border-bottom:2px solid var(--line); gap:10px;}
.pd-oday-h b{font-size:15px;}
.pd-codes{margin-top:16px; padding-top:14px; border-top:1px solid var(--line);}
.pd-codes .pd-h4{display:flex; align-items:center; gap:6px; margin:0 0 8px;}
.pd-codes-list{display:flex; flex-direction:column;}
.pd-codes-row{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line);}
.pd-codes-row:last-child{border-bottom:0;}
.pd-codes-row > span:first-child{display:flex; flex-direction:column; gap:2px; min-width:0; font-size:13.5px;}
.pd-pick-units{display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:6px; max-height:46vh; overflow:auto; padding:2px;}
.pd-pick-units label{display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:8px 10px; border:1px solid var(--line); border-radius:10px; cursor:pointer; font-size:13px;}
.pd-pick-units label:has(input:checked){border-color:var(--pd-blue, #2b2873); background:#f2f3fb;}
.pd-pick-units small{width:100%; padding-inline-start:24px;}
@media (max-width:760px){
  .pd-olist .pd-orow{grid-template-columns:1fr auto;}
  .pd-olist .pd-orow > span:nth-child(3){grid-column:1 / -1;}
  .pd-olist .pd-orow > span:last-child{grid-column:1 / -1; justify-content:flex-start !important; flex-wrap:wrap;}
  .pd-oday-h{flex-wrap:wrap;}
  .pd-codes-row{flex-wrap:wrap;}
}

/* ---------- v1.6: customer box label ---------- */
.pd-boxprint{margin-top:16px; padding-top:14px; border-top:1px dashed var(--line); display:flex; flex-direction:column; gap:6px; align-items:flex-start;}
.pd-lbl-preview{display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap;}
.pd-lbl-mock{width:240px; height:160px; border:1px solid #cfd3de; border-radius:6px; background:#fff; padding:9px 10px; display:flex; flex-direction:column; font-size:11px; box-shadow:0 2px 8px rgba(0,0,0,.06); flex:none;}
.pd-lbl-mock .h{display:flex; align-items:center; gap:6px; border-bottom:1px solid #2b2873; padding-bottom:5px;}
.pd-lbl-mock .h img{height:24px;} .pd-lbl-mock .h b{color:#2b2873; font-size:13px; display:block; line-height:1.1;} .pd-lbl-mock .h span{font-size:9px; color:#666;}
.pd-lbl-mock .m{flex:1; display:flex; gap:8px; align-items:center;} .pd-lbl-mock .q{width:72px; height:72px; flex:none; background:repeating-linear-gradient(45deg,#222 0 3px,#fff 3px 6px); border:4px solid #fff; outline:1px solid #222;}
.pd-lbl-mock .f{border-top:1px solid #ddd; padding-top:3px; font-size:9px; color:#444;} .pd-lbl-mock .f div:last-child{display:flex; justify-content:space-between; color:#2b2873; font-weight:700;}

/* ---- parts from the warehouse for the week + history (README_production_materials.md) ---- */
.pd-mat{margin-bottom:14px; border-inline-start:4px solid var(--steel, #4e72b8);}
.pd-mat-list{margin-top:12px; border-top:1px solid var(--line);}
.pd-mat-row{display:grid; grid-template-columns:minmax(150px,.9fr) minmax(0,1.4fr) auto; gap:12px; align-items:center; padding:10px 4px; border-bottom:1px solid var(--line); cursor:pointer; font-size:13px;}
.pd-mat-row:hover,.pd-mat-row:focus{background:var(--steel-tint); outline:none;}
.pd-mat-tags{justify-content:flex-end; gap:6px; flex-wrap:wrap;}
.pd-mat-tags .pd-chip svg{flex:none;}
.pd-mat-sum{display:flex; flex-wrap:wrap; gap:6px 14px; margin-top:10px; font-size:12.5px; color:var(--text-dim);}
.pd-mat-sum span.due b:last-child{color:#8a5a00;}
.pd-mat-sum span.ok{color:#1d7148;}
.pd-mat-table input{max-width:110px;}
.pd-hist-filters .pd-chips{gap:6px;}
.pd-hist-sel{width:auto !important; max-width:280px; font:inherit; font-size:13.5px; border:1px solid var(--line); border-radius:999px; padding:7px 12px; min-height:38px; background:#fff;}
.pd-hrow{border-bottom:1px solid var(--line);}
.pd-hhead{all:unset; box-sizing:border-box; width:100%; display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1.5fr) minmax(0,1fr) auto; gap:12px; align-items:center; padding:12px 6px; cursor:pointer; font-size:13px; text-align:right;}
.pd-hhead:hover,.pd-hhead:focus-visible{background:var(--steel-tint);}
.pd-hhead::after{content:'‹'; font-size:18px; color:var(--text-dim); transition:transform .15s; grid-column:auto;}
.pd-hhead[aria-expanded="true"]::after{transform:rotate(-90deg);}
.pd-hhead{grid-template-columns:minmax(0,1.3fr) minmax(0,1.5fr) minmax(0,1fr) auto 14px;}
.pd-hunits{padding:4px 6px 12px; background:#fbfcfd;}
.pd-hunit-table tbody tr:hover{background:var(--steel-tint);}
@media (max-width:700px){
  .pd-mat-row{grid-template-columns:1fr; gap:6px;}
  .pd-mat-tags{justify-content:flex-start;}
  .pd-hhead{grid-template-columns:1fr auto; gap:6px 10px;}
  .pd-hhead > span:nth-child(2){grid-column:1 / -1; grid-row:2;}
  .pd-hhead > span:nth-child(3){grid-column:1 / -1; grid-row:3;}
  .pd-hhead::after{display:none;}
}
