:root{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#242424;background:#f5f1e9;
  --ink:#242424;--muted:#746f67;--sage:#3f574b;--sage-dark:#2f4138;--cream:#f8f4ec;
  --panel:#fffdf9;--line:#ddd6ca;--line-soft:#ece6dc;--success:#577061;--shadow:0 14px 38px rgba(42,36,29,.07)
}
*{box-sizing:border-box}html{background:var(--cream)}body{margin:0;min-width:820px;background:linear-gradient(180deg,#f9f6ef 0,#f2ede4 100%);min-height:100vh}button,input,select,textarea{font:inherit}.app-shell{max-width:1500px;margin:0 auto;padding:22px 28px 28px}.topbar{display:flex;justify-content:space-between;align-items:center;gap:30px;margin-bottom:18px}.brand-lockup{display:flex;align-items:center;gap:16px}.brand-mark{width:74px;height:58px;object-fit:contain;object-position:center}.brand-copy{border-left:1px solid #9d998f;padding-left:16px}.eyebrow{margin:0 0 2px;font-size:10px;font-weight:650;letter-spacing:.16em;color:var(--sage)}h1,h2{margin:0;color:var(--ink)}h1{font-size:30px;font-weight:420;letter-spacing:-.025em}h2{font-size:20px;font-weight:520;letter-spacing:-.015em}.brand-tagline{margin:3px 0 0;font-size:12px;color:var(--muted)}.top-actions{display:flex;align-items:center;gap:9px}.button{border:1px solid transparent;border-radius:6px;padding:10px 16px;cursor:pointer;font-weight:580;transition:.16s ease;background:white;color:var(--ink)}.button:hover{transform:translateY(-1px)}.button:active{transform:none}.primary{background:var(--sage);color:#fff}.primary:hover{background:var(--sage-dark)}.primary:disabled{opacity:.55;cursor:not-allowed}.secondary{background:#fffdf9;border-color:#cfc7bb}.secondary:hover{background:#f2eee7}.danger{background:#fff7f5;border-color:#d8aaa2;color:#8a4035}.danger:hover{background:#f7e7e3;border-color:#c88f85}.danger:disabled{opacity:.5;cursor:not-allowed}.ghost{background:transparent;border-color:transparent;color:#57534d}.ghost:hover{background:rgba(63,87,75,.07)}.small{padding:8px 12px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow)}.header-panel{display:grid;grid-template-columns:1.7fr .85fr 1fr .65fr .85fr;gap:12px;padding:18px;margin-bottom:16px}.section-label{grid-column:1/-1;font-size:9px;text-transform:uppercase;letter-spacing:.17em;font-weight:700;color:var(--sage);margin-bottom:-2px}.field{display:flex;flex-direction:column;gap:6px}.field label{font-size:10px;font-weight:700;color:#625e57;text-transform:uppercase;letter-spacing:.07em}input,select,textarea{width:100%;border:1px solid #d2cabf;border-radius:5px;padding:10px 11px;background:#fff;color:var(--ink);transition:border-color .15s,box-shadow .15s}textarea{resize:vertical}input:focus,select:focus,textarea:focus{outline:none;border-color:var(--sage);box-shadow:0 0 0 3px rgba(63,87,75,.12)}.notes-field{grid-column:1/-1}.line-panel{padding:18px}.section-heading{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:12px}.section-heading p{margin:4px 0 0;color:var(--muted);font-size:12px}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:7px;background:#fff}table{width:100%;border-collapse:collapse;table-layout:fixed}th{position:sticky;top:0;background:#f2eee7;color:#5f5a53;font-size:9px;text-transform:uppercase;letter-spacing:.08em;text-align:left;padding:10px 8px;border-bottom:1px solid #d9d1c6}td{padding:4px 6px;border-bottom:1px solid var(--line-soft);vertical-align:middle}tbody tr:last-child td{border-bottom:0}tbody tr:focus-within{background:#faf8f3}td select,td input{border:1px solid transparent;border-radius:4px;padding:8px;background:transparent}td select:hover,td input:hover{border-color:#d8d1c7}.row-num,.row-number{width:38px;text-align:center;color:#99928a}.qty-col{width:78px}.money-col{width:125px}.action-col{width:78px}.line-total{text-align:right;font-variant-numeric:tabular-nums;padding-right:14px}.price-input,.qty-input{text-align:right}.row-actions{display:flex;justify-content:center;gap:2px}.row-actions button{width:30px;height:30px;border:0;border-radius:4px;padding:0;background:transparent;cursor:pointer;font-size:17px}.row-actions button:hover{background:#f0ece5}.duplicate-row{color:#53645b}.remove-row{color:#9a554d;font-size:20px!important}.locked-price{background:#f2eee8!important;color:#55514b;cursor:not-allowed;border-color:transparent!important}.summary-bar{position:sticky;bottom:12px;display:flex;align-items:center;gap:34px;margin-top:14px;padding:14px 18px;background:var(--sage);color:white;border-radius:8px;box-shadow:0 14px 32px rgba(30,46,38,.2)}.summary-metric{display:flex;gap:10px;align-items:baseline}.summary-metric span{color:#dbe3de;font-size:11px;text-transform:uppercase;letter-spacing:.06em}.summary-bar strong{font-size:20px;font-weight:520;font-variant-numeric:tabular-nums}.keyboard-hint{color:#c2cec7;font-size:11px}.status{margin-left:auto;color:#edf2ef;font-size:12px}.print-sheet{display:none}

.account-insight{padding:18px;margin-bottom:16px}.account-insight-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px}.account-type{font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:var(--sage);border:1px solid #cfd8d1;background:#f1f5f2;border-radius:999px;padding:6px 10px}.account-insight-grid{display:grid;grid-template-columns:1.05fr 1.25fr .95fr 1.7fr;gap:12px}.customer-card{border:1px solid var(--line-soft);background:#fff;border-radius:7px;padding:14px;min-height:132px}.card-label{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.11em;font-weight:700;color:var(--sage);margin-bottom:10px}.contact-card strong{display:block;font-size:14px;margin-bottom:5px}.contact-card a{display:block;color:#4f5f56;text-decoration:none;font-size:12px;margin-top:3px}.contact-card a:hover{text-decoration:underline}.contact-card p{white-space:pre-line;color:var(--muted);font-size:11px;line-height:1.4;margin:8px 0 0}.metric-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.metric-grid div{display:flex;flex-direction:column}.metric-grid strong{font-size:18px;font-weight:520;font-variant-numeric:tabular-nums}.metric-grid span{font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-top:2px}.preference-row{padding:8px 0;border-bottom:1px solid var(--line-soft)}.preference-row:last-child{border-bottom:0}.preference-row span{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.preference-row strong{display:block;font-size:12px;margin-top:3px}.recent-card-head{display:flex;justify-content:space-between;align-items:center}.recent-card-head #historyStatus{font-size:10px;color:var(--muted)}.recent-orders{display:flex;flex-direction:column;gap:7px}.recent-order{display:grid;grid-template-columns:82px 1fr auto;gap:9px;align-items:start;padding:7px 0;border-top:1px solid var(--line-soft)}.recent-order:first-child{border-top:0;padding-top:0}.recent-order-date{font-size:10px;color:var(--muted)}.recent-order-main strong{display:block;font-size:11px}.recent-order-main span{display:block;font-size:10px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}.recent-order-total{font-size:11px;font-weight:600;text-align:right}.empty-history{font-size:11px;color:var(--muted);padding-top:6px}
@media(max-width:1200px){.account-insight-grid{grid-template-columns:repeat(2,1fr)}}

@media(max-width:1050px){body{min-width:760px}.header-panel{grid-template-columns:repeat(3,1fr)}.account-field{grid-column:span 2}.notes-field{grid-column:1/-1}.keyboard-hint{display:none}.brand-mark{width:62px}}
@media print{
 @page{size:letter;margin:.45in}body{min-width:0;background:white}.app-shell{display:none!important}.print-sheet{display:block!important;color:#202020;font-family:Arial,sans-serif}.print-header{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1.5px solid #2a2a2a;padding-bottom:13px}.print-brand-block{display:flex;align-items:center;gap:16px}.print-logo{width:210px;height:auto;object-fit:contain}.print-contact{font-size:8.5px;line-height:1.55;color:#555;border-left:1px solid #aaa;padding-left:14px}.print-title-block{text-align:right}.print-title{font-size:19px;font-weight:700;letter-spacing:.11em}.print-order-name{margin-top:7px;font-size:10px;color:#666;max-width:180px}.print-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:12px 22px;padding:17px 0}.print-meta div{display:flex;flex-direction:column;gap:3px}.print-meta span{font-size:8px;text-transform:uppercase;letter-spacing:.09em;color:#666}.print-meta strong{font-size:11px}.print-table{width:100%;border-collapse:collapse;table-layout:auto}.print-table th{position:static;background:#3f574b!important;color:white!important;font-size:8px;padding:8px;text-transform:uppercase;letter-spacing:.08em;-webkit-print-color-adjust:exact;print-color-adjust:exact}.print-table th:nth-child(n+3),.print-table td:nth-child(n+3){text-align:right}.print-table td{font-size:10px;padding:8px;border-bottom:1px solid #ddd}.print-footer{display:grid;grid-template-columns:1fr 250px;gap:30px;margin-top:22px}.print-notes{font-size:10px;line-height:1.5}.print-notes strong{display:block;font-size:8px;text-transform:uppercase;letter-spacing:.08em;margin-bottom:6px}.print-totals{border-top:1.5px solid #222;padding-top:8px}.print-totals div{display:flex;justify-content:space-between;padding:5px 0;font-size:10px}.print-totals div:last-child{font-size:13px}.print-document-footer{position:fixed;bottom:0;left:0;right:0;border-top:1px solid #ccc;padding-top:7px;text-align:center;font-size:7px;letter-spacing:.12em;color:#777}
}

.studio-orders-card { grid-column: 1 / -1; }
.invoice-status { display:block; font-size:.68rem; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin-bottom:.15rem; }
.recent-order-total small { display:block; color:var(--muted); font-size:.72rem; margin-top:.15rem; }

.account-head-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}.health-badge{display:inline-flex;align-items:center;border-radius:999px;padding:7px 11px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;background:#eaf2ec;color:#365345;border:1px solid #ccdacf}.health-badge.slow{background:#f6f0dd;color:#745d19;border-color:#e5d8ad}.health-badge.past-due{background:#f7e7e3;color:#8a4035;border-color:#e8c5be}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-dialog{width:min(1180px,94vw);max-height:90vh;border:0;border-radius:18px;padding:0;background:#fbfaf6;box-shadow:0 30px 90px rgba(42,44,38,.28)}.profile-dialog::backdrop{background:rgba(37,41,35,.48);backdrop-filter:blur(2px)}.profile-shell{padding:26px}.profile-header{display:flex;justify-content:space-between;align-items:flex-start;padding-bottom:18px;border-bottom:1px solid #ddd8cc}.profile-header h2{margin:4px 0 0;font-size:30px}.icon-button{border:0;background:transparent;font-size:30px;line-height:1;cursor:pointer;color:#4f524c}.profile-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;padding:18px 0}.profile-stat{padding:14px;border:1px solid #e3ded3;border-radius:12px;background:#fff}.profile-stat span{display:block;font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:#6d7069;margin-bottom:7px}.profile-stat strong{font-size:20px}.profile-columns{display:grid;grid-template-columns:1fr 1fr;gap:18px}.profile-columns section{border:1px solid #e3ded3;border-radius:14px;background:#fff;overflow:hidden}.profile-section-head{display:flex;align-items:center;justify-content:space-between;padding:15px 17px;border-bottom:1px solid #e7e2d8}.profile-section-head h3{margin:0;font-size:15px}.profile-list{max-height:48vh;overflow:auto}.profile-row{display:grid;grid-template-columns:100px 1fr auto;gap:14px;align-items:center;padding:13px 17px;border-bottom:1px solid #eee9df}.profile-row:last-child{border-bottom:0}.profile-row-main strong,.profile-row-main span{display:block}.profile-row-main span{font-size:12px;color:#6c6e68;margin-top:3px}.profile-row-value{text-align:right;font-weight:700}.profile-row-value small{display:block;font-weight:500;color:#6c6e68;margin-top:3px}.order-actions{display:flex;align-items:center;gap:10px}.reorder-button{border:1px solid #bcc9c0;background:#f5f8f5;color:#345044;border-radius:8px;padding:7px 10px;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap}.reorder-button:hover{background:#eaf1ec}.recent-order.has-action{grid-template-columns:90px 1fr auto auto}@media(max-width:900px){.profile-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-columns{grid-template-columns:1fr}.account-head-actions{justify-content:flex-start}.recent-order.has-action{grid-template-columns:80px 1fr auto}.recent-order.has-action .reorder-button{grid-column:2/4;justify-self:start}}

/* Order management dashboard */
.dashboard-view{display:flex;flex-direction:column;gap:16px}.dashboard-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:24px 26px;border:1px solid var(--line);border-radius:12px;background:linear-gradient(135deg,#fffdf9 0%,#f2f0e7 100%);box-shadow:var(--shadow)}.dashboard-hero h2{font-size:30px;font-weight:430;margin-top:4px}.dashboard-hero p{margin:8px 0 0;color:var(--muted)}.dashboard-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.stat-card{text-align:left;border:1px solid var(--line);border-radius:10px;background:var(--panel);padding:17px 18px;cursor:pointer;box-shadow:0 8px 24px rgba(42,36,29,.04);transition:.15s ease}.stat-card:hover{transform:translateY(-2px);border-color:#b7c3ba;box-shadow:var(--shadow)}.stat-card span,.stat-card small{display:block}.stat-card span{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.09em;color:var(--sage)}.stat-card strong{display:block;font-size:34px;font-weight:430;margin:7px 0 3px}.stat-card small{color:var(--muted);font-size:11px}.dashboard-panel{padding:20px}.dashboard-toolbar{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:14px}.dashboard-toolbar h2{margin-top:3px}.dashboard-controls{display:flex;align-items:center;gap:8px}.dashboard-controls input{width:260px}.dashboard-controls select{width:190px}.dashboard-status{font-size:12px;color:var(--muted);margin:4px 0 10px}.management-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:8px}.management-table{min-width:1050px;table-layout:auto}.management-table th{position:sticky;top:0;z-index:1}.management-table td{padding:11px 10px}.queue-number{font-size:16px;font-weight:650;color:var(--sage);text-align:center}.order-customer strong,.order-customer span{display:block}.order-customer span{font-size:11px;color:var(--muted);margin-top:3px}.status-pill{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:9px;font-weight:750;letter-spacing:.07em;text-transform:uppercase;border:1px solid #d8d2c7;background:#f4f1eb;color:#555}.status-pill.awaitingPayment{background:#f6f0dd;border-color:#e5d8ad;color:#745d19}.status-pill.paidWaiting{background:#eaf2ec;border-color:#ccdacf;color:#365345}.status-pill.inProduction{background:#e8eef2;border-color:#cbd8df;color:#38586a}.status-pill.readyToShip{background:#eee9f4;border-color:#d7cbe2;color:#654c78}.workflow-actions{display:flex;justify-content:flex-end;gap:6px;white-space:nowrap}.workflow-button{border:1px solid #c8cfc9;background:white;color:#344b3f;border-radius:6px;padding:7px 9px;font-size:10px;font-weight:700;cursor:pointer}.workflow-button:hover{background:#eff4f0}.workflow-button.primary-action{background:var(--sage);color:white;border-color:var(--sage)}.empty-dashboard{text-align:center;color:var(--muted);padding:34px!important}.priority-rush{color:#8a4035;font-weight:700}.date-overdue{color:#8a4035;font-weight:700}.order-entry-action[hidden]{display:none!important}
@media(max-width:1100px){.dashboard-stats{grid-template-columns:repeat(2,1fr)}.dashboard-toolbar{align-items:stretch;flex-direction:column}.dashboard-controls{width:100%}.dashboard-controls input{flex:1}.dashboard-controls select{width:210px}}

/* Studio command center */
.studio-welcome{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:28px 30px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(135deg,#fffdf9 0%,#f2f0e7 100%);box-shadow:var(--shadow)}
.studio-welcome h2{font-size:36px;font-weight:430;margin-top:4px;letter-spacing:-.02em}.studio-welcome p{margin:9px 0 0;color:var(--muted);font-size:13px}.welcome-actions{display:flex;gap:9px;align-items:center}
.studio-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.studio-stat-card{text-align:left;border:1px solid var(--line);border-radius:12px;background:var(--panel);padding:18px 19px;cursor:pointer;box-shadow:0 8px 24px rgba(42,36,29,.04);transition:.15s ease;position:relative;overflow:hidden}.studio-stat-card::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:#c9c5bb}.studio-stat-card.attention::before{background:#c89d55}.studio-stat-card.paid::before{background:#6f8d79}.studio-stat-card.active::before{background:#6b8798}.studio-stat-card.ready::before{background:#8a729c}.studio-stat-card:hover{transform:translateY(-2px);border-color:#b7c3ba;box-shadow:var(--shadow)}.studio-stat-card span,.studio-stat-card small{display:block}.studio-stat-card span{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.09em;color:var(--sage)}.studio-stat-card strong{display:block;font-size:36px;font-weight:430;margin:8px 0 4px}.studio-stat-card small{color:var(--muted);font-size:12px;font-weight:600}
.today-grid{display:grid;grid-template-columns:1.15fr 1fr 1fr;gap:12px}.today-card{border:1px solid var(--line);border-radius:12px;background:var(--panel);box-shadow:0 8px 24px rgba(42,36,29,.04);overflow:hidden;min-height:250px}.today-card header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:18px 18px 14px;border-bottom:1px solid var(--line-soft)}.today-card h3{margin:3px 0 0;font-size:17px;font-weight:560}.text-button{border:0;background:transparent;color:var(--sage);font-size:11px;font-weight:750;cursor:pointer;padding:3px}.text-button:hover{text-decoration:underline}.today-list{display:flex;flex-direction:column}.today-order{width:100%;border:0;border-bottom:1px solid var(--line-soft);background:transparent;padding:13px 17px;display:flex;justify-content:space-between;gap:14px;text-align:left;cursor:pointer;transition:.12s}.today-order:last-child{border-bottom:0}.today-order:hover{background:#f7f6f1}.today-order-main strong,.today-order-main small,.today-order-meta small{display:block}.today-order-main strong{font-size:12px}.today-order-main small,.today-order-meta small{font-size:10px;color:var(--muted);margin-top:3px}.today-order-meta{text-align:right;min-width:105px}.mini-badge{display:inline-block;border-radius:999px;padding:3px 6px;font-size:8px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;margin-bottom:2px}.mini-badge.rush{background:#f7e7e3;color:#8a4035;border:1px solid #e8c5be}.today-empty{padding:24px 18px;color:var(--muted);font-size:12px}.dashboard-toolbar p{margin:6px 0 0;color:var(--muted);font-size:11px}.wait-cell{font-variant-numeric:tabular-nums;color:var(--muted);font-size:11px}
@media(max-width:1180px){.today-grid{grid-template-columns:1fr 1fr}.next-up-card{grid-column:1/-1}.studio-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:850px){.studio-welcome{align-items:flex-start;flex-direction:column}.today-grid{grid-template-columns:1fr}.next-up-card{grid-column:auto}}

/* WIP capacity and optimized release planning */
.capacity-panel{padding:22px}.capacity-head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px}.capacity-head h2{margin:4px 0}.capacity-head p{margin:6px 0 0;color:var(--muted);font-size:12px}.capacity-settings{display:flex;gap:9px;align-items:flex-end}.capacity-settings label{font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}.capacity-settings input{display:block;width:105px;margin-top:5px}.capacity-meter{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0}.capacity-meter>div{border:1px solid var(--line);border-radius:10px;padding:14px;background:#faf9f5}.capacity-meter strong,.capacity-meter span{display:block}.capacity-meter strong{font-size:23px;font-weight:500}.capacity-meter span{font-size:10px;color:var(--muted);margin-top:4px;text-transform:uppercase;letter-spacing:.06em}.release-recommendation{border-top:1px solid var(--line-soft);padding-top:16px}.recommend-summary{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.recommend-summary strong,.recommend-summary small{display:block}.recommend-summary small{color:var(--muted);margin-top:4px}.recommend-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}.recommend-order{display:grid;grid-template-columns:auto 1fr auto;gap:10px;border:1px solid var(--line);border-radius:10px;padding:12px;background:#fff;cursor:pointer}.recommend-order strong,.recommend-order small{display:block}.recommend-order small{color:var(--muted);margin-top:3px}.recommend-order ul{margin:7px 0 0;padding-left:16px;color:var(--muted);font-size:10px}.recommend-order>b{color:var(--sage);font-size:18px}.batch-preview{display:flex;flex-wrap:wrap;gap:7px;margin-top:13px}.batch-preview>.section-label{width:100%}.batch-preview>span:not(.section-label){background:#eef2ed;border:1px solid #d3ddd5;border-radius:999px;padding:6px 9px;font-size:10px}.status-pill.paidBacklog{background:#f6f0dd;border-color:#e5d8ad;color:#745d19}.status-pill.releasedWaiting{background:#eaf2ec;border-color:#ccdacf;color:#365345}
@media(max-width:950px){.capacity-head{align-items:stretch;flex-direction:column}.capacity-settings{flex-wrap:wrap}.recommend-grid{grid-template-columns:1fr}.capacity-meter{grid-template-columns:1fr}}


/* Calendar */
.calendar-view{display:flex;flex-direction:column;gap:16px;background:#f6f2e8;padding:2px 0 8px}.calendar-shell{padding:24px;border:1px solid #d9d0bf;border-radius:16px;background:linear-gradient(180deg,#fffdf9 0%,#f7f2e7 100%);box-shadow:0 10px 28px rgba(42,36,29,.05)}.calendar-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:18px}.calendar-head h2{margin:4px 0 0;font-size:28px;font-weight:500}.calendar-head p{margin:6px 0 0;color:var(--muted);font-size:12px}.calendar-nav{display:flex;gap:8px;flex-wrap:wrap}.calendar-summary{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:14px 16px;margin-bottom:12px;border:1px solid var(--line);border-radius:10px;background:#faf7ef}.calendar-month-title{font-size:21px;font-weight:600}.calendar-summary-stats{display:flex;gap:16px;flex-wrap:wrap;justify-content:flex-end}.calendar-summary-stats span{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.calendar-summary-stats strong{font-size:13px;color:var(--ink);margin-right:3px}.calendar-grid{overflow:auto;border:1px solid var(--line);border-radius:10px;background:#fff}.calendar-weekdays{display:grid;grid-template-columns:repeat(7,minmax(150px,1fr));min-width:1050px;background:#f2eee4;border-bottom:1px solid var(--line)}.calendar-weekday{padding:9px 10px;font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--sage);text-align:center}.calendar-days{display:grid;grid-template-columns:repeat(7,minmax(150px,1fr));min-width:1050px}.calendar-day{min-height:150px;padding:9px;border-right:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft);background:#fff}.calendar-day:nth-child(7n){border-right:0}.calendar-day.outside-month{background:#f7f5ef}.calendar-day.today{background:#f4f8f4;box-shadow:inset 0 0 0 2px #8fa393}.calendar-day-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:7px}.calendar-day-head>strong{font-size:12px}.calendar-day-head>span{font-size:8px;color:var(--muted);text-align:right}.calendar-day-orders{display:flex;flex-direction:column;gap:6px}.calendar-order{width:100%;text-align:left;border:1px solid #d7ddd8;border-radius:7px;background:#f6f9f6;overflow:hidden}.calendar-order:hover{background:#edf3ee}.calendar-order.unpaid{background:#fbf7ea;border-color:#eadfbd}.calendar-order.unpaid:hover{background:#f7efd5}.calendar-order-main{display:block;width:100%;border:0;background:transparent;text-align:left;padding:7px 8px;cursor:pointer;color:inherit}.calendar-order strong,.calendar-order small,.calendar-order span{display:block}.calendar-order strong{font-size:10px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.calendar-order small{font-size:8px;color:var(--muted);margin-top:2px}.calendar-order span{font-size:8px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--sage);margin-top:4px}.calendar-order.unpaid span{color:#80631b}.calendar-order-detail{padding:8px;border-top:1px solid rgba(0,0,0,.08);background:rgba(255,255,255,.65)}.calendar-order-detail-meta{display:flex;flex-wrap:wrap;gap:5px 8px;margin-bottom:6px}.calendar-order-detail-meta span{font-size:8px;font-weight:500;text-transform:none;letter-spacing:0;color:var(--muted)}.calendar-order-detail ul{list-style:none;margin:0 0 8px;padding:0}.calendar-order-detail li{padding:3px 0;font-size:9px;border-bottom:1px solid rgba(0,0,0,.05)}.calendar-order-detail li:last-child{border-bottom:0}.calendar-order-detail li small{white-space:normal;margin-top:2px}.calendar-order-actions{display:flex;gap:5px;flex-wrap:wrap}.calendar-order-actions .workflow-button{font-size:8px;padding:5px 7px}@media(max-width:900px){.calendar-head,.calendar-summary{align-items:stretch;flex-direction:column}.calendar-summary-stats{justify-content:flex-start}}


.calendar-capacity {
  margin-bottom: 12px;
}

.calendar-weekly-staffing {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf7ef;
}

.calendar-weekly-staffing-head {
  margin-bottom: 12px;
}

.calendar-weekly-staffing-head strong,
.calendar-weekly-staffing-head span {
  display: block;
}

.calendar-weekly-staffing-head strong {
  font-size: 12px;
}

.calendar-weekly-staffing-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.calendar-weekly-staffing-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(95px, 1fr));
  gap: 8px;
}

.calendar-weekly-staffing-day {
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #faf8f2;
}

.calendar-weekly-staffing-day > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
}

.calendar-weekly-staffing-day label {
  display: block;
  margin-top: 5px;
}

.calendar-weekly-staffing-day label span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.calendar-weekly-staffing-day input {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid #d8d1c7;
  border-radius: 5px;
  background: #fff;
  font-size: 11px;
}

@media(max-width:900px) {
  .calendar-weekly-staffing-grid {
    grid-template-columns: repeat(4, minmax(95px, 1fr));
  }
}

/* Production planning */
.production-planning-view{display:flex;flex-direction:column;gap:16px;background:#f6f2e8;padding:2px 0 8px}.planning-shell{padding:24px;display:flex;flex-direction:column;gap:18px;border:1px solid #d9d0bf;border-radius:16px;background:linear-gradient(180deg,#fffdf9 0%,#f7f2e7 100%);box-shadow:0 10px 28px rgba(42,36,29,.05)}.planning-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.planning-head p{margin:6px 0 0;color:var(--muted);font-size:12px}.planning-head-actions{display:flex;gap:8px}.planning-target-panel{display:flex;flex-direction:column;gap:14px;padding:18px;border:1px solid var(--line);border-radius:12px;background:#fffdf9}.planning-target-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end}.planning-custom-target{display:flex;flex-direction:column;gap:5px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.planning-custom-target input{width:140px;padding:8px 10px;border:1px solid var(--line);border-radius:6px;background:#fff}.planning-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.planning-metric-card{border:1px solid var(--line);border-radius:10px;padding:14px;background:#fff;display:flex;flex-direction:column;gap:6px}.planning-metric-card span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.planning-metric-card strong{font-size:22px;color:var(--ink)}.planning-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px}.planning-toolbar-actions{display:flex;gap:8px}.planning-status{font-size:12px;color:var(--muted)}.planning-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:10px;background:#fff}.planning-table{width:100%;border-collapse:collapse;min-width:900px}.planning-table th,.planning-table td{padding:12px 10px;border-bottom:1px solid var(--line-soft);text-align:left;vertical-align:top}.planning-table th{position:sticky;top:0;background:#f8f5ec;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--sage)}.planning-table tbody tr:hover{background:#fbf8f2}.planning-order-account{font-weight:600}.planning-order-account small,.planning-order-meta{display:block;font-size:11px;color:var(--muted);margin-top:3px}.planning-priority{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;background:#eef2ed;color:#43594b;font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.planning-priority.rush{background:#f7e7e3;color:#8a4035}.planning-drag-col{width:48px;min-width:48px;text-align:center}.planning-check-col{width:42px;min-width:42px;text-align:center}.planning-batch-card{border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}.planning-batch-card[open]{box-shadow:0 8px 20px rgba(42,36,29,.04)}.planning-batch-card summary{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 16px;cursor:pointer;list-style:none}.planning-batch-card summary::-webkit-details-marker{display:none}.planning-batch-card summary:hover{background:#f8f6f1}.planning-batch-name strong,.planning-batch-name small,.planning-batch-meta small{display:block}.planning-batch-name strong{font-size:14px}.planning-batch-name small,.planning-batch-meta small{font-size:10px;color:var(--muted);margin-top:3px}.planning-batch-meta{display:flex;align-items:center;gap:12px;text-align:right}.planning-batch-meta b{display:inline-flex;align-items:center;justify-content:center;min-width:42px;height:42px;border-radius:999px;background:var(--sage);color:white;font-size:16px}.planning-batch-list{border-top:1px solid var(--line-soft);padding:10px 16px;background:#faf8f2}.planning-batch-list ul{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px}.planning-batch-list li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;border-bottom:1px solid var(--line-soft)}.planning-batch-list li:last-child{border-bottom:0}.planning-batch-list li span{font-size:12px}.planning-batch-list li b{font-size:12px;color:var(--sage)}.planning-plan-section{border:1px solid var(--line);border-radius:12px;padding:18px;background:#fbfaf6}.planning-plan-head{margin-bottom:12px}.planning-batches-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.planning-empty{padding:16px;border:1px dashed var(--line);border-radius:10px;color:var(--muted);background:#fff;text-align:center;font-size:12px}@media(max-width:980px){.planning-metrics{grid-template-columns:repeat(2,1fr)}.planning-batches-list{grid-template-columns:1fr}}@media(max-width:760px){.planning-head,.planning-toolbar{flex-direction:column;align-items:stretch}.planning-target-actions{flex-direction:column;align-items:stretch}.planning-custom-target input{width:100%}.planning-metrics{grid-template-columns:1fr}}

/* Production Planning committed and proposed sections */
.planning-section-row td {
  padding: 12px 14px !important;
  background: #eaf2ec !important;
  border-top: 2px solid #91aa97;
  border-bottom: 1px solid #cddacf;
}

.planning-section-row.available td {
  background: #f5f1e8 !important;
  border-top-color: #b9aa8c;
  border-bottom-color: #ddd4c3;
}

.planning-section-row strong,
.planning-section-row span {
  display: block;
}

.planning-section-row strong {
  font-size: 12px;
  color: var(--ink);
}

.planning-section-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.planning-committed-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid #9bb7a1;
  border-radius: 50%;
  background: #e8f2ea;
  color: #42634b;
  font-size: 12px;
  font-weight: 800;
}

/* Production Planning queue drag order */
.planning-drag-cell,
.planning-check-cell {
  text-align: center !important;
  vertical-align: middle !important;
}

.planning-check-cell input {
  display: block;
  margin: 0 auto;
}

.planning-drag-handle {
  width: 24px;
  min-width: 24px;
  padding: 3px 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f5f2ea;
  color: var(--sage);
  font-size: 13px;
  line-height: 1;
  cursor: grab;
}

.planning-drag-handle:active {
  cursor: grabbing;
}

.planning-drag-spacer {
  display: inline-block;
  width: 24px;
  min-width: 24px;
}

.planning-queue-row {
  transition:
    background 0.12s ease,
    box-shadow 0.12s ease;
}

.planning-queue-row.dragging {
  opacity: 0.48;
}

.planning-queue-row.drag-over {
  background: #edf4ee;
  box-shadow: inset 0 3px 0 #78947f;
}

/* Production build list */
.make-today-panel{padding:22px}.make-today-head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-bottom:15px}.make-today-head h2{margin:4px 0}.make-today-head p{margin:6px 0 0;color:var(--muted);font-size:12px}.make-today-total{text-align:right}.make-today-total strong,.make-today-total span{display:block}.make-today-total strong{font-size:38px;font-weight:430;line-height:1}.make-today-total span{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.07em;margin-top:5px}.make-today-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.make-batch{border:1px solid var(--line);border-radius:11px;background:#fff;overflow:hidden}.make-batch[open]{box-shadow:0 8px 20px rgba(42,36,29,.04)}.make-batch summary{list-style:none;display:flex;justify-content:space-between;align-items:center;gap:16px;padding:15px 16px;cursor:pointer}.make-batch summary::-webkit-details-marker{display:none}.make-batch summary:hover{background:#f8f6f1}.make-batch-name strong,.make-batch-name small,.make-batch-meta small{display:block}.make-batch-name strong{font-size:14px}.make-batch-name small,.make-batch-meta small{font-size:10px;color:var(--muted);margin-top:3px}.make-batch-meta{display:flex;align-items:center;gap:14px;text-align:right}.make-batch-meta b{display:inline-flex;align-items:center;justify-content:center;min-width:42px;height:42px;border-radius:999px;background:var(--sage);color:white;font-size:18px}.make-order-list{border-top:1px solid var(--line-soft);background:#faf9f5}.make-order-row{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:10px 16px;border-bottom:1px solid var(--line-soft)}.make-order-row:last-child{border-bottom:0}.make-order-row span strong,.make-order-row span small{display:block}.make-order-row span strong{font-size:11px}.make-order-row span small{font-size:9px;color:var(--muted);margin-top:2px}.make-order-row>b{font-size:15px;color:var(--sage)}@media(max-width:900px){.make-today-list{grid-template-columns:1fr}.make-today-head{align-items:flex-start}.make-today-total{min-width:110px}}

/* Ensure app views using the hidden attribute are actually hidden */
[hidden] {
  display: none !important;
}


.email-confirmation-dialog{width:min(760px,94vw)}
.email-review-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:20px 0}
.email-review-field{border:1px solid #e3ded3;border-radius:12px;background:#fff;padding:14px}
.email-review-field span{display:block;font-size:9px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:#6d7069;margin-bottom:6px}
.email-review-field strong{font-size:14px;font-weight:600;overflow-wrap:anywhere}
.email-review-wide{grid-column:1/-1}
.email-review-message{border:1px solid #e3ded3;border-radius:14px;background:#fff;padding:18px;margin-bottom:14px}
.email-review-message #emailReviewMessage{font-size:14px;line-height:1.65;white-space:pre-wrap;margin-top:12px;color:#343631}
.email-review-attachment{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid #d8dfda;background:#f4f7f4;border-radius:12px;padding:15px 17px}
.email-review-attachment strong{display:block;margin-top:5px;font-size:13px}
.email-review-actions{display:flex;justify-content:flex-end;gap:10px;padding-top:20px}
@media(max-width:700px){.email-review-grid{grid-template-columns:1fr}.email-review-wide{grid-column:auto}.email-review-attachment{align-items:flex-start;flex-direction:column}.email-review-actions{flex-direction:column-reverse}.email-review-actions .button{width:100%}}


/* Faire import preview */
#faireImportDialog {
  width: min(1100px, 94vw);
  max-width: 1100px;
  padding: 0;
  border: 0;
  border-radius: 14px;
}

#faireImportDialog .email-dialog-card {
  width: 100%;
  box-sizing: border-box;
  padding: 24px;
}

#faireImportDialog #faireImportText {
  width: 100%;
  min-height: 520px;
  box-sizing: border-box;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#faireImportDialog .email-dialog-head,
#faireImportDialog .email-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#faireImportDialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

@media (max-width: 700px) {
  #faireImportDialog {
    width: 96vw;
  }

  #faireImportDialog .email-dialog-card {
    padding: 16px;
  }

  #faireImportDialog #faireImportText {
    min-height: 420px;
  }
}

#faireImportDialog #faireImportText {
  line-height: 1.55;
}


/* Faire structured review */
#faireImportDialog .faire-review-card {
  max-height: 90vh;
  overflow: auto;
}

.faire-filename {
  margin: 4px 0 0;
  color: #777168;
  font-size: 0.85rem;
}

.faire-order-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.faire-order-summary > div {
  padding: 14px;
  border: 1px solid #ded8cf;
  border-radius: 10px;
  background: #faf8f4;
}

.faire-order-summary span,
.faire-order-summary small {
  display: block;
  font-size: 0.76rem;
  color: #777168;
}

.faire-order-summary strong {
  display: block;
  margin: 4px 0;
}

.faire-review-table-wrap {
  overflow-x: auto;
  border: 1px solid #ded8cf;
  border-radius: 10px;
}

.faire-review-table {
  width: 100%;
  border-collapse: collapse;
}

.faire-review-table th,
.faire-review-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #ece7df;
  text-align: left;
  white-space: nowrap;
}

.faire-review-table th {
  background: #f5f2ec;
  font-size: 0.78rem;
  color: #666159;
}

.faire-review-table td small {
  display: block;
  color: #89837a;
  font-size: 0.72rem;
}

.faire-review-table tr:last-child td {
  border-bottom: 0;
}

.match-ok {
  color: #3f6b50 !important;
}

.match-warning {
  color: #9a5c2f !important;
}

.faire-unmatched-row {
  background: #fff9ef;
}

.faire-review-warning {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff3df;
  color: #815225;
}

.faire-raw-details {
  margin-top: 16px;
}

.faire-raw-details summary {
  cursor: pointer;
  color: #666159;
  font-size: 0.85rem;
}

.faire-raw-details textarea {
  margin-top: 10px;
}

@media (max-width: 760px) {
  .faire-order-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.profile-customer-info{border:1px solid #e3ded3;border-radius:14px;background:#fff;margin-bottom:18px;overflow:hidden}.profile-customer-details{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;padding:16px 17px}.profile-customer-details div{min-width:0}.profile-customer-details span{display:block;font-size:9px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#6d7069;margin-bottom:5px}.profile-customer-details strong{display:block;font-size:13px;font-weight:600;overflow-wrap:anywhere}.profile-customer-edit{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:17px}.profile-customer-edit label{display:flex;flex-direction:column;gap:6px;font-size:10px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:#6d7069}.profile-customer-edit input,.profile-customer-edit textarea{width:100%;box-sizing:border-box;border:1px solid #d8d3c8;border-radius:8px;background:#fff;padding:9px 10px;font:inherit;color:var(--ink)}.profile-address-field{grid-column:1/-1}.profile-edit-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:9px}@media(max-width:900px){.profile-customer-details{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-customer-edit{grid-template-columns:1fr}.profile-address-field,.profile-edit-actions{grid-column:auto}}
.custom-product-input{display:block;width:100%;box-sizing:border-box;margin-top:6px;padding:7px 8px;border:1px solid #cfc9bd;border-radius:6px;background:#fff;font-size:11px}.custom-product-input[hidden]{display:none!important}.price-input:not(.locked-price){background:#fff;border-color:#9caf9f;box-shadow:inset 0 0 0 1px rgba(80,112,91,.08)}
.order-detail-row td{background:#faf8f2;padding:0!important}.order-detail-panel{display:grid;grid-template-columns:220px 1fr auto;gap:22px;align-items:start;padding:16px 18px;border-top:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft)}.order-detail-panel>div:first-child strong,.order-detail-panel>div:first-child span{display:block}.order-detail-panel>div:first-child span{margin-top:4px;font-size:11px;color:var(--muted)}.order-detail-panel ul{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px}.order-detail-panel li{font-size:12px}.order-detail-panel li small{display:block;margin-top:2px;color:var(--muted)}.order-detail-meta{display:flex;flex-direction:column;gap:4px;text-align:right;font-size:11px;color:var(--muted)}@media(max-width:900px){.order-detail-panel{grid-template-columns:1fr}.order-detail-meta{text-align:left}}

.planning-plan-input {
  width: 100%;
  min-width: 110px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
}

.planning-group-input {
  min-width: 90px;
}

.planning-hours-input {
  min-width: 72px;
  max-width: 90px;
}

.planning-plan-input:disabled {
  opacity: 0.6;
}

.planning-group-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.planning-group-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.planning-group-field label {
  font-size: 12px;
  font-weight: 600;
}

.planning-group-field input,
.planning-group-field select {
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
}

#planningGroupHours {
  min-width: 120px;
  width: 120px;
}

.planning-groups-list {
  display: grid;
  gap: 8px;
}

.planning-group-summary-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.planning-group-summary-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.planning-group-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.planning-group-swatch[data-color="blue"] { background: #4f7cff; }
.planning-group-swatch[data-color="green"] { background: #4ea66a; }
.planning-group-swatch[data-color="orange"] { background: #e89a3d; }
.planning-group-swatch[data-color="purple"] { background: #8b63c7; }
.planning-group-swatch[data-color="red"] { background: #d95f5f; }
.planning-group-swatch[data-color="yellow"] { background: #e6c84f; }
.planning-group-swatch[data-color="teal"] { background: #4aa6a1; }
.planning-group-swatch[data-color="pink"] { background: #d77fa3; }

@media (max-width: 760px) {
  .planning-group-summary-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Production Settings table */
.production-settings-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.production-settings-row-actions .button.small {
  padding: 6px 9px;
  font-size: 11px;
  line-height: 1.2;
  min-height: 30px;
  white-space: nowrap;
}

.production-settings-row-actions .button.danger {
  flex-shrink: 0;
}

.production-settings-row-actions .button.secondary {
  flex-shrink: 0;
}

/* Give the Production Settings table a clean grid */
.production-settings-row-actions {
  min-width: 230px;
}

/* Vertical column dividers */
.production-settings-row-actions {
  border-left: 0;
}

.production-settings-row-actions .button + .button {
  margin-left: 0;
}

/* Keep each settings row compact */
.production-settings-row-actions {
  padding: 0;
}


/* Production Settings grid */
.production-settings-table {
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 980px;
}

.production-settings-table th,
.production-settings-table td {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.production-settings-table th:last-child,
.production-settings-table td:last-child {
  border-right: 0;
}

.production-settings-table th {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
}

.production-settings-table td {
  padding: 5px 8px;
}

.production-settings-table th:nth-child(1) {
  width: 16%;
}

.production-settings-table th:nth-child(2) {
  width: 19%;
}

.production-settings-table th:nth-child(3) {
  width: 20%;
}

.production-settings-table th:nth-child(4) {
  width: 11%;
}

.production-settings-table th:nth-child(5) {
  width: 8%;
}

.production-settings-table th:nth-child(6) {
  width: 10%;
}

.production-settings-table th:nth-child(7) {
  width: 16%;
}

.production-settings-table tbody tr:last-child td {
  border-bottom: 0;
}

.production-settings-table tbody tr:hover {
  background: #fbf9f5;
}


/* Production Settings saved state */
.production-settings-row-actions [data-save-production-settings]:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
  background: #f2eee7;
  border-color: #d8d1c7;
  color: #8b857d;
}

.production-settings-row-actions [data-save-production-settings]:disabled:hover {
  transform: none;
  background: #f2eee7;
}


/* Daily calendar capacity */
.calendar-capacity {
  margin-bottom: 12px;
}

.calendar-capacity-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.calendar-capacity-head h3 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 560;
}

.calendar-capacity-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.calendar-capacity-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
}

.calendar-capacity-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #faf9f5;
}

.calendar-capacity-date {
  margin-bottom: 8px;
  font-size: 11px;
}

.calendar-capacity-day label {
  display: block;
}

.calendar-capacity-day label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.calendar-capacity-day input {
  padding: 7px 8px;
  font-size: 12px;
  background: #fff;
}

.calendar-capacity-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
}

.calendar-capacity-stat strong {
  font-size: 13px;
  font-weight: 600;
}

.calendar-capacity-stat span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

@media(max-width:900px) {
  .calendar-capacity-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

/* Calendar production workload */
.calendar-workload {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf9f5;
}

.calendar-workload-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.calendar-workload-title strong {
  font-size: 10px;
}

.calendar-workload-title span {
  max-width: 230px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-align: right;
}

.calendar-workload-product {
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

.calendar-workload-product:last-of-type {
  border-bottom: 0;
}

.calendar-workload-product > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 9px;
}

.calendar-workload-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 2px 0;
}

.calendar-workload-line span {
  color: var(--muted);
  font-size: 8px;
}

.calendar-workload-line strong {
  font-size: 8px;
  font-weight: 650;
}

.calendar-workload-total {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.calendar-workload-total div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.calendar-workload-total span {
  color: var(--muted);
  font-size: 8px;
}

.calendar-workload-total strong {
  font-size: 9px;
}

.calendar-workload-empty {
  color: var(--muted);
  font-size: 9px;
  padding: 4px 0;
}

/* Calendar capacity / production scheduling */
.calendar-day {
  background: #faf8f2;
}

.calendar-day.outside-month {
  background: #f1eee5;
}

.calendar-day.today {
  background: #f7faf5;
}

.calendar-day-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.calendar-day-heading > strong {
  font-size: 12px;
}

.calendar-capacity-select {
  width: 74px;
  min-width: 74px;
  padding: 3px 18px 3px 5px;
  border: 1px solid #d8d1c7;
  border-radius: 4px;
  background: #fffdf9;
  font-size: 8px;
  line-height: 1.1;
}

.calendar-capacity-summary {
  display: block;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.25;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.calendar-order.scheduled-segment {
  border-radius: 5px;
}

.calendar-order.scheduled-segment:not(.segment-start) {
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

.calendar-order.scheduled-segment:not(.segment-end) {
  border-bottom-left-radius: 3px;
  border-bottom-right-radius: 3px;
}

.calendar-ready-marker {
  margin-top: 2px;
  border: 1px dashed #aeb9b0;
  border-radius: 5px;
  background: #f5f8f4;
}

.calendar-ready-marker button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 5px 7px;
  text-align: left;
  color: var(--sage);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.calendar-ready-marker button:hover {
  background: #edf3ed;
}

.calendar-order-summary {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #faf8f2;
}

.calendar-order-summary-title {
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}

.calendar-order-summary-title strong {
  font-size: 9px;
}

.calendar-family-totals {
  list-style: none;
  margin: 0;
  padding: 0;
}

.calendar-family-totals li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px solid var(--line-soft);
}

.calendar-family-totals li:last-child {
  border-bottom: 0;
}

.calendar-family-totals span,
.calendar-family-totals strong {
  font-size: 8px;
}

.calendar-family-totals span {
  color: var(--muted);
}

.calendar-order-labor {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.calendar-order-labor span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.calendar-order-labor strong {
  font-size: 9px;
}


/* Calendar staffing dropdown readability */
.calendar-capacity-select {
  width: 112px;
  min-width: 112px;
}


/* Calendar daily production view */

.calendar-day-production-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 2px 5px;
  margin: -2px 0 -2px -5px;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  border-radius: 5px;
}

.calendar-day-production-button:hover,
.calendar-day-production-button:focus-visible {
  background: rgba(0, 0, 0, 0.06);
}

.calendar-day-production-detail {
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line, #d9d9d9);
  border-radius: 7px;
  background: var(--panel, #fff);
}

.calendar-day-production-capacity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  font-size: 12px;
}

.calendar-day-production-section + .calendar-day-production-section {
  margin-top: 12px;
}

.calendar-day-production-section h4 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-day-batch {
  padding: 7px 0;
  border-top: 1px solid var(--line, #e3e3e3);
}

.calendar-day-batch:first-child {
  border-top: 0;
  padding-top: 0;
}

.calendar-day-batch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.calendar-day-batch-head span {
  min-width: 0;
}

.calendar-day-batch-head strong,
.calendar-day-batch-head small {
  display: block;
}

.calendar-day-batch-head small {
  margin-top: 1px;
  opacity: 0.7;
}

.calendar-day-batch-head b {
  white-space: nowrap;
}

.calendar-day-batch-orders,
.calendar-day-stage-list {
  list-style: none;
  padding: 0;
  margin: 5px 0 0;
}

.calendar-day-batch-orders li,
.calendar-day-stage-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  font-size: 11px;
}

.calendar-day-batch-orders li span,
.calendar-day-stage-list li span {
  min-width: 0;
}

.calendar-day-empty {
  font-size: 11px;
  opacity: 0.65;
}


/* Production Log visual refresh */

#productionLogView {
  background: #f6f2e8;
  padding: 2px 0 8px;
}

#productionLogView .production-settings-shell {
  padding: 28px;
  border: 1px solid #d9d0bf;
  border-radius: 16px;
  background:
    linear-gradient(
      180deg,
      #fffdf9 0%,
      #f8f4eb 100%
    );
  box-shadow: 0 10px 28px rgba(42,36,29,.05);
}

#productionLogView > .production-settings-shell > .planning-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

#productionLogView > .production-settings-shell > .planning-head h2 {
  margin-top: 4px;
  font-size: 30px;
  font-weight: 460;
  letter-spacing: -.02em;
}

#productionLogView > .production-settings-shell > .planning-head p {
  max-width: 620px;
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.5;
}

#productionLogStatus {
  margin: 16px 0 18px;
  padding: 10px 13px;
  border: 1px solid #d7dfd8;
  border-radius: 8px;
  background: #f3f7f3;
  color: #526158;
  font-size: 11px;
}

/* Main run card */

#productionLogView .production-settings-add {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(42,36,29,.045);
}

#productionLogView .production-settings-add-header {
  padding: 18px 20px;
  border-bottom: 1px solid #dce2dc;
  background:
    linear-gradient(
      135deg,
      #eef3ef 0%,
      #f7f6f0 100%
    );
}

#productionLogView .production-settings-add-header h3 {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 580;
  letter-spacing: -.01em;
}

#productionLogView .production-settings-add-form {
  padding: 22px;
}

#productionLogView .production-settings-add-grid {
  display: grid;
  grid-template-columns:
    minmax(150px,.85fr)
    minmax(170px,1fr)
    minmax(130px,.65fr)
    minmax(240px,1.5fr);
  gap: 14px;
}

#productionLogView .production-settings-add-grid label,
#productionLogView .production-settings-add-form > div > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#productionLogView .production-settings-add-grid label > span,
#productionLogView .production-settings-add-form > div > label > span {
  color: #666159;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

#productionLogView input,
#productionLogView select,
#productionLogView textarea {
  border-color: #d8d1c7;
  border-radius: 7px;
  background: #fff;
}

#productionLogView input:hover,
#productionLogView select:hover,
#productionLogView textarea:hover {
  border-color: #bcb5aa;
}

/* Team members */

#productionLogTeam {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

#productionLogTeam label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d8d3c9;
  border-radius: 999px;
  background: #faf9f5;
  color: #514e49;
  font-size: 11px;
  font-weight: 620;
  cursor: pointer;
  transition:
    background .15s,
    border-color .15s,
    transform .15s;
}

#productionLogTeam label:hover {
  border-color: #aebcaf;
  background: #f2f6f2;
  transform: translateY(-1px);
}

#productionLogTeam label:has(input:checked) {
  border-color: #93a597;
  background: #eaf1eb;
  color: #30483a;
}

#productionLogTeam input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--sage);
}

/* Production output */

#productionRunItems {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 16px !important;
}

#productionRunItems > div {
  position: relative;
  padding: 13px;
  border: 1px solid #ddd8ce;
  border-radius: 10px;
  background: #fcfbf8;
  transition:
    border-color .15s,
    box-shadow .15s,
    background .15s;
}

#productionRunItems > div:hover {
  border-color: #c7d0c8;
  background: #fff;
  box-shadow: 0 5px 14px rgba(42,36,29,.04);
}

#productionRunItems label {
  min-width: 0;
}

#productionRunItems label > span {
  display: block;
  margin-bottom: 5px;
  color: #777168;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#productionRunItems input,
#productionRunItems select {
  min-height: 38px;
  padding: 8px 9px;
  background: #fff;
}

#productionRunItems input[type="number"] {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#productionRunItems button {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

#productionRunItems button:last-child {
  color: #8a4035;
}

#addProductionRunItemBtn {
  border-color: #bfcac1;
  background: #f5f8f5;
  color: #355044;
  font-size: 11px;
  font-weight: 700;
}

#addProductionRunItemBtn:hover {
  border-color: #9eaea2;
  background: #eaf1ec;
}

/* Notes */

#productionLogNotes {
  min-height: 94px;
  line-height: 1.5;
  background: #fdfcf9;
}

/* Save area */

#saveProductionLogBtn {
  min-width: 190px;
  padding: 11px 20px;
  box-shadow: 0 5px 14px rgba(47,65,56,.14);
}

#cancelProductionRunEditBtn {
  border-color: #d7d1c7;
  background: #faf9f5;
}

/* Recent Runs */

#productionLogHistory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 10px;
}

#productionLogHistory > div {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 6px 18px rgba(42,36,29,.035);
  transition:
    transform .15s,
    border-color .15s,
    box-shadow .15s;
}

#productionLogHistory > div:hover {
  transform: translateY(-1px);
  border-color: #c5cfc6;
  box-shadow: 0 9px 24px rgba(42,36,29,.06);
}

#productionLogHistory strong {
  color: var(--ink);
}

#productionLogHistory small {
  color: var(--muted);
}

#productionLogHistory ul {
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

#productionLogHistory li {
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  line-height: 1.4;
}

#productionLogHistory .button {
  min-height: 30px;
  padding: 6px 10px;
  border-color: #d6d0c6;
  font-size: 10px;
}

#productionLogHistory .button:hover {
  border-color: #bcc7be;
}

#productionLogHistory .button:last-child {
  color: #87483f;
}

/* Responsive Production Log */

@media(max-width:1100px) {
  #productionLogView .production-settings-add-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  #productionLogHistory {
    grid-template-columns: 1fr;
  }
}

@media(max-width:850px) {
  #productionLogView .production-settings-shell {
    padding: 20px;
  }

  #productionLogView .production-settings-add-grid {
    grid-template-columns: 1fr;
  }
}


/* Production Log warm card refinement */

/* Remove the stark white from the main run card */
#productionLogView .production-settings-add {
  background: #f8f4ec;
}

#productionLogView .production-settings-add-form {
  background: #f8f4ec;
}

/* Keep actual fields white so they remain easy to read */
#productionLogView input,
#productionLogView select,
#productionLogView textarea {
  background: #fffdf9;
}

/* Give the team area a little more separation */
#productionLogTeam {
  padding: 12px;
  border: 1px solid #e1dbd0;
  border-radius: 10px;
  background: #f2eee6;
}

/* Make the production output section feel like its own area */
#productionRunItems {
  padding: 12px;
  border-radius: 12px;
  background: #f1ece3;
}

#productionRunItems > div {
  background: #fffdf9;
  border-color: #d5cec2;
}

/* Saved Production Runs — each run gets its own distinct card */
#productionLogHistory {
  gap: 16px;
}

#productionLogHistory > div {
  padding: 18px !important;
  border: 1px solid #cec5b7 !important;
  border-radius: 14px !important;
  background: #f8f4ec !important;
  box-shadow:
    0 7px 18px rgba(42,36,29,.055),
    0 1px 2px rgba(42,36,29,.035);
}

/* Make each saved run feel separate when stacked */
#productionLogHistory > div + div {
  margin-top: 0;
}

/* Product lines inside saved runs */
#productionLogHistory ul {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid #ded7cb;
  border-radius: 9px;
  background: #fffdf9;
}

#productionLogHistory li {
  padding: 9px 11px;
  border-top: 1px solid #ebe5db;
}

#productionLogHistory li:first-child {
  border-top: 0;
}

/* Keep history actions visually separate */
#productionLogHistory .button {
  background: #fffdf9;
}




/* Production Log date-grouped history */

#productionLogHistory {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.production-history-day {
  overflow: hidden;
  border: 1px solid #d4ccbf;
  border-radius: 12px;
  background: #f8f4ec;
  box-shadow: 0 5px 14px rgba(42,36,29,.04);
}

.production-history-day[open] {
  border-color: #bec9c0;
  box-shadow: 0 8px 20px rgba(42,36,29,.055);
}

.production-history-day-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 17px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background .15s;
}

.production-history-day-summary::-webkit-details-marker {
  display: none;
}

.production-history-day-summary:hover {
  background: #f1eee6;
}

.production-history-day-label {
  display: block;
  margin-bottom: 3px;
  color: var(--sage);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.production-history-day-summary > div:first-child > strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.production-history-day-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.production-history-day-stats > span:not(.production-history-chevron) {
  padding: 5px 8px;
  border: 1px solid #ddd6ca;
  border-radius: 999px;
  background: #fffdf9;
  color: #666159;
  font-size: 9px;
  font-weight: 650;
}

.production-history-chevron {
  margin-left: 3px;
  color: var(--sage);
  font-size: 15px;
  transition: transform .18s;
}

.production-history-day[open] .production-history-chevron {
  transform: rotate(180deg);
}

.production-history-day-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #ddd6ca;
  background: #f1ede5;
}

.production-history-run {
  padding: 16px;
  border: 1px solid #d9d2c7;
  border-radius: 10px;
  background: #fffdf9;
}

.production-history-run-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.production-history-stage {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 4px 7px;
  border: 1px solid #cbd6cd;
  border-radius: 999px;
  background: #edf3ee;
  color: #3d5949;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.production-history-team {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.production-history-hours {
  min-width: 80px;
  text-align: right;
}

.production-history-hours strong,
.production-history-hours span {
  display: block;
}

.production-history-hours strong {
  font-size: 20px;
  font-weight: 520;
  color: var(--sage);
}

.production-history-hours span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.production-history-meta {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 13px;
}

.production-history-meta > div {
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #faf8f3;
}

.production-history-meta span,
.production-history-notes > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.production-history-meta strong {
  display: block;
  font-size: 10px;
  line-height: 1.4;
}

.production-history-items {
  overflow: hidden;
  margin-top: 11px;
  border: 1px solid #e0d9ce;
  border-radius: 8px;
}

.production-history-item {
  display: grid;
  grid-template-columns: minmax(180px,2fr) minmax(150px,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
}

.production-history-item:first-child {
  border-top: 0;
}

.production-history-item-name strong,
.production-history-item-name span {
  display: block;
}

.production-history-item-name strong {
  font-size: 11px;
}

.production-history-item-name span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.production-history-item-yield {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.production-history-item-total {
  color: var(--sage);
  font-size: 11px;
  text-align: right;
}

.production-history-empty {
  padding: 11px;
  color: var(--muted);
  font-size: 10px;
}

.production-history-notes {
  margin-top: 11px;
  padding: 10px 11px;
  border-left: 3px solid #b7c4b9;
  border-radius: 0 7px 7px 0;
  background: #f6f4ee;
}

.production-history-notes p {
  margin: 0;
  color: #55514b;
  font-size: 10px;
  line-height: 1.5;
}

.production-history-actions {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.production-history-actions .button {
  border-color: #d9d3c9;
  background: #faf9f5;
  font-size: 9px;
}

.production-history-actions .button:last-child {
  color: #8a4035;
}

@media(max-width:850px) {
  .production-history-meta {
    grid-template-columns: 1fr;
  }

  .production-history-item {
    grid-template-columns: 1fr auto;
  }

  .production-history-item-yield {
    grid-column: 1 / -1;
  }
}


/* Production Log order selector */
.production-log-order-list {
  max-height: 150px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf9;
}

.production-log-order-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  margin: 0;
  cursor: pointer;
}

.production-log-order-option + .production-log-order-option {
  border-top: 1px solid var(--line-soft);
}

.production-log-order-option input {
  margin: 0;
  flex: 0 0 auto;
}

.production-log-order-option span {
  line-height: 1.25;
}


/* Backstock */

#backstockView .production-settings-shell > .planning-head {
  padding: 24px 24px 10px;
}

#backstockView .production-settings-shell > .planning-head h2 {
  margin: 3px 0 6px;
}

#backstockView .production-settings-shell > .planning-head p {
  margin: 0;
  color: #625e58;
  line-height: 1.45;
}

#backstockView #backstockStatus {
  margin: 0 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  border-radius: 0;
}



.backstock-add-panel {
  margin: 24px 0 34px;
  padding: 22px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
}

.backstock-add-panel
.production-settings-add-header p {
  margin: 5px 0 0;
  color: #6b665f;
  font-size: 12px;
}

.backstock-add-grid {
  display: grid;
  grid-template-columns:
    minmax(220px, 2fr)
    minmax(160px, 1fr)
    110px
    minmax(180px, 1.5fr)
    auto;
  gap: 14px;
  align-items: end;
}

.backstock-add-grid label {
  margin: 0;
}

.backstock-add-grid label span,
.backstock-add-grid label {
  font-size: 11px;
}

.backstock-add-grid select,
.backstock-add-grid input {
  width: 100%;
  margin-top: 6px;
}

.backstock-add-action {
  display: flex;
  align-items: end;
}

.backstock-inventory-section {
  margin-top: 28px;
}

.backstock-card-list {
  display: grid;
  gap: 14px;
}

.backstock-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
  overflow: hidden;
}

.backstock-card-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 20px 22px;
  align-items: start;
}

.backstock-card-product h3 {
  margin: 4px 0 2px;
  font-size: 18px;
}

.backstock-color-name {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid #c9c2b7;
  border-radius: 999px;
  background: #f7f4ee;
  color: #25221e;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.backstock-note {
  margin-top: 10px;
  color: #777169;
  font-size: 11px;
  line-height: 1.45;
}

.backstock-card-quantity {
  min-width: 180px;
  text-align: right;
}

.backstock-quantity-number {
  margin-top: 2px;
  font-size: 32px;
  line-height: 1;
  font-weight: 600;
}

.backstock-quantity-edit {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 10px;
}

.backstock-quantity-edit input {
  width: 68px;
  text-align: center;
}

.backstock-card-allocation {
  padding: 15px 22px 18px;
  border-top: 1px solid var(--line-soft);
  background: #faf9f5;
}

.backstock-card-allocation
.backstock-order-select {
  min-width: 260px;
}

.backstock-card-allocation
.backstock-allocation-quantity {
  width: 72px !important;
}

@media(max-width:850px) {
  .backstock-add-grid {
    grid-template-columns: 1fr 1fr;
  }

  .backstock-add-action {
    grid-column: 1 / -1;
  }

  .backstock-card-main {
    grid-template-columns: 1fr;
  }

  .backstock-card-quantity {
    text-align: left;
  }

  .backstock-quantity-edit {
    justify-content: flex-start;
  }
}

@media(max-width:600px) {
  .backstock-add-grid {
    grid-template-columns: 1fr;
  }

  .backstock-card-main,
  .backstock-card-allocation {
    padding-left: 16px;
    padding-right: 16px;
  }

  .backstock-card-allocation
  .backstock-order-select {
    min-width: 0;
    width: 100%;
  }
}

/* Keep Studio order-management controls aligned when multiple workflow actions are shown */
.management-table {
  min-width: 1250px;
}

.management-table td:nth-child(9) {
  min-width: 115px;
}

.management-table td:nth-child(10) {
  min-width: 310px;
}

.order-production-priority {
  width: 100px;
  min-width: 100px;
}

.workflow-actions {
  align-items: center;
  flex-wrap: nowrap;
}


/* Secondary production release action beneath customer name */
.order-unrelease-link {
  display: block;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sage);
  font-size: 9px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.order-unrelease-link:hover {
  opacity: .7;
}

.workflow-placeholder {
  visibility: hidden;
  pointer-events: none;
}

/* Unrelease is a destructive/reversal action */
.order-unrelease-link {
  color: #a4473d;
}

/* Simplified Studio command center */
.studio-stats-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.studio-production-today,
.studio-current-production {
  padding: 20px;
}

.studio-dashboard-placeholder {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #faf9f5;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media(max-width:850px) {
  .studio-stats-compact {
    grid-template-columns: 1fr;
  }
}

/* Calendar projected-order status colors */
.calendar-summary {
  flex-wrap: wrap;
}

.calendar-status-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.calendar-status-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calendar-status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1px solid transparent;
  border-radius: 50%;
}

.calendar-status-dot.released {
  background: #e5f0e7;
  border-color: #7fa087;
}

.calendar-status-dot.paid {
  background: #eee7f5;
  border-color: #967cab;
}

.calendar-status-dot.unpaid {
  background: #fbf3d9;
  border-color: #c9ab55;
}

.calendar-status-dot.draft {
  background: #f5dfdc;
  border-color: #bd7d75;
}

.calendar-status-dot.ready {
  background: #cfe5d4;
  border-color: #4f795a;
}

.calendar-status-dot.actual {
  background: #dce9ef;
  border-color: #5f8295;
}

.calendar-order.calendar-status-released {
  background: #edf5ee;
  border-color: #9db7a2;
}

.calendar-order.calendar-status-released:hover {
  background: #e2eee4;
}

.calendar-order.calendar-status-paid {
  background: #f3eef8;
  border-color: #b29fc2;
}

.calendar-order.calendar-status-paid:hover {
  background: #ebe2f2;
}

.calendar-order.calendar-status-unpaid {
  background: #fff8e5;
  border-color: #dec77f;
}

.calendar-order.calendar-status-unpaid:hover {
  background: #fbf1d4;
}

.calendar-order.calendar-status-draft {
  background: #faecea;
  border-color: #d3a09a;
}

.calendar-order.calendar-status-draft:hover {
  background: #f5dfdc;
}


/* Distinct Ready to Ship marker */
.calendar-ready-marker {
  background: #e0efe3;
  border-color: #78a183;
}

.calendar-ready-marker button {
  color: #315f3d;
  font-weight: 700;
}

/* Calendar selected-day production popup */
.calendar-day-dialog {
  width: min(1120px, 94vw);
  max-width: none;
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(35, 31, 26, 0.24);
  overflow: hidden;
}

.calendar-day-dialog::backdrop {
  background: rgba(39, 36, 31, 0.48);
  backdrop-filter: blur(2px);
}

.calendar-day-dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.calendar-day-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #faf9f5;
}

.calendar-day-dialog-head h3 {
  margin: 3px 0 0;
  font-size: 22px;
}

.calendar-day-dialog-content {
  padding: 20px;
  overflow-y: auto;
}

.calendar-day-dialog .daily-production-matrix {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.calendar-day-dialog .daily-matrix-group {
  min-width: 0;
}

.calendar-day-dialog .daily-matrix-table .daily-matrix-color {
  width: 24%;
  min-width: 135px;
  max-width: 180px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.25;
}

@media(max-width:800px) {
  .calendar-day-dialog {
    width: 96vw;
  }

  .calendar-day-dialog .daily-production-matrix {
    grid-template-columns: 1fr;
  }
}

/* Historical actual production */
.calendar-order.actual-production {
  background: #e8f0f4;
  border-color: #8ba6b5;
  box-shadow: inset 3px 0 0 #5f8295;
}

.calendar-order.actual-production:hover {
  background: #deeaef;
}

.calendar-order.actual-production .calendar-order-main > span {
  color: #456b80;
}

/* Studio operational card lists */
.studio-stat-card.selected {
  border-color: #879c8c;
  box-shadow: 0 0 0 2px rgba(111, 141, 121, 0.16);
}

.studio-status-panel {
  overflow: hidden;
}

.studio-status-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #faf9f5;
}

.studio-status-panel-head h2 {
  margin: 2px 0 0;
}

.studio-status-table-wrap {
  overflow-x: auto;
}

.studio-status-table {
  width: 100%;
  border-collapse: collapse;
}

.studio-status-table th,
.studio-status-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.studio-status-table th {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  background: #fff;
}

.studio-status-table td {
  font-size: 12px;
}

.studio-status-table tbody tr:last-child td {
  border-bottom: 0;
}

.studio-status-table tbody tr:hover {
  background: #faf9f5;
}

.studio-status-empty {
  padding: 28px 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Daily production matrix readability */
.daily-matrix-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.daily-matrix-table tbody tr:nth-child(even) {
  background: #f2f0ea;
}

.daily-matrix-table tbody tr:hover {
  background: #e9e6de;
}

.daily-matrix-color {
  font-weight: 700;
  color: var(--ink);
}

.daily-matrix-table tbody .daily-matrix-color {
  font-size: 11px;
  letter-spacing: 0.04em;
}

.daily-matrix-table td {
  font-weight: 500;
}

.daily-matrix-table tfoot {
  background: #e7e3da;
}

.daily-matrix-table tfoot th,
.daily-matrix-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--line);
}

.daily-matrix-total {
  font-weight: 700;
}

.daily-matrix-group {
  margin-bottom: 18px;
}

.daily-matrix-group + .daily-matrix-group {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.daily-matrix-group-title {
  margin-bottom: 5px;
}

.daily-matrix-group-title strong {
  font-size: 15px;
  font-weight: 700;
}

.daily-matrix-group-title span {
  font-weight: 600;
}

/* Daily production matrix column alignment */
.daily-matrix-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.daily-matrix-table th,
.daily-matrix-table td {
  border-right: 1px solid var(--line);
}

.daily-matrix-table th:last-child,
.daily-matrix-table td:last-child {
  border-right: 0;
}

.daily-matrix-table .daily-matrix-color {
  width: 18%;
  min-width: 110px;
  max-width: 150px;
}

.daily-matrix-table th:not(.daily-matrix-color),
.daily-matrix-table td:not(.daily-matrix-color) {
  text-align: center;
}

/* Studio expandable dashboard sections */
.studio-expandable {
  padding: 0;
  overflow: hidden;
}

.studio-expandable-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.studio-expandable-summary::-webkit-details-marker {
  display: none;
}

.studio-expandable-summary:hover {
  background: #faf9f5;
}

.studio-expandable-summary h2 {
  margin: 2px 0 0;
}

.studio-expandable-arrow {
  flex: 0 0 auto;
  font-size: 20px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.studio-expandable[open] .studio-expandable-arrow {
  transform: rotate(180deg);
}

.studio-expandable-content {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
}

.studio-expandable[open] .studio-expandable-summary {
  background: #faf9f5;
}

.studio-expandable .dashboard-toolbar {
  padding-top: 18px;
}

.studio-production-today,
.studio-current-production {
  padding: 0;
}

/* Studio Current Production compact overview */
.studio-current-production-list {
  width: 100%;
}

.studio-current-production-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.6fr)
    minmax(160px, 1fr)
    90px
    120px;
  gap: 18px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.studio-current-production-row:last-child {
  border-bottom: 0;
}

.studio-current-production-row:nth-child(even) {
  background: #f7f5f0;
}

.studio-current-production-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.studio-current-production-order strong {
  font-size: 13px;
}

.studio-current-production-order span {
  color: var(--muted);
  font-size: 11px;
}

.studio-current-production-status {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.studio-current-production-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.studio-current-production-metric small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.studio-current-production-metric strong {
  font-size: 12px;
}

.studio-production-priority {
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.studio-production-priority.next {
  background: #e7efe7;
}

.studio-production-priority.hold {
  background: #eeeae1;
  color: var(--muted);
}

@media(max-width:850px) {
  .studio-current-production-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Studio Current Production compact overview */
.studio-current-production-list {
  width: 100%;
}

.studio-current-production-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.6fr)
    minmax(160px, 1fr)
    90px
    120px;
  gap: 18px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.studio-current-production-row:last-child {
  border-bottom: 0;
}

.studio-current-production-row:nth-child(even) {
  background: #f7f5f0;
}

.studio-current-production-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.studio-current-production-order strong {
  font-size: 13px;
}

.studio-current-production-order span {
  color: var(--muted);
  font-size: 11px;
}

.studio-current-production-status {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.studio-current-production-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.studio-current-production-metric small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.studio-current-production-metric strong {
  font-size: 12px;
}

.studio-production-priority {
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.studio-production-priority.next {
  background: #e7efe7;
}

.studio-production-priority.hold {
  background: #eeeae1;
  color: var(--muted);
}

@media(max-width:850px) {
  .studio-current-production-row {
    grid-template-columns: 1fr 1fr;
  }
}


/* Calendar Primary Maker Hot Shop hours */
.calendar-primary-maker-hours {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  line-height: 1.2;
}

.calendar-primary-maker-hours input {
  width: 48px;
  min-width: 0;
  padding: 3px 4px;
  border: 1px solid #c9c2b7;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: right;
}

.calendar-primary-maker-hours input:focus {
  border-color: #799680;
  outline: 2px solid rgba(87, 118, 101, .18);
  outline-offset: 1px;
}


/* Backstock inventory matrix */
.backstock-matrix {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.backstock-matrix-group {
  margin: 0;
}

.backstock-matrix-cell-button {
  width: 100%;
  min-width: 34px;
  padding: 7px 6px;
  border: 1px solid #b8cbbb;
  border-radius: 5px;
  background: #edf5ee;
  color: #355743;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.backstock-matrix-cell-button:hover,
.backstock-matrix-cell-button.active {
  border-color: #6f9179;
  background: #dbeade;
}

.backstock-matrix-details {
  margin-top: 16px;
}

.backstock-matrix-detail {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf7ef;
}

.backstock-matrix-inventory-record +
.backstock-matrix-inventory-record {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.backstock-matrix-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.backstock-matrix-detail-head strong,
.backstock-matrix-detail-head span {
  display: block;
}

.backstock-matrix-detail-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.backstock-matrix-quantity-edit,
.backstock-matrix-allocation-controls,
.backstock-matrix-allocation-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.backstock-matrix-quantity-edit input,
.backstock-matrix-allocation-controls
.backstock-allocation-quantity {
  width: 76px;
}

.backstock-matrix-allocation-controls {
  margin-top: 7px;
}

.backstock-matrix-allocation-history {
  margin-top: 14px;
}

.backstock-matrix-allocation-entry {
  justify-content: space-between;
  margin-top: 7px;
}

@media(max-width:700px) {
  .backstock-matrix {
    grid-template-columns: 1fr;
  }

  .backstock-matrix-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Unconfirmed historical production plan */
.calendar-order.unconfirmed-production {
  border-color: #d8b66f;
  background: #fff5dc;
}

.calendar-order.unconfirmed-production:hover {
  background: #f9ebc8;
}

.calendar-order.unconfirmed-production span {
  color: #81601e;
}


/* Production Day reconciliation */
.calendar-reconciliation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #d8b66f;
  border-radius: 10px;
  background: #fff5dc;
}

.calendar-reconciliation[hidden] {
  display: none;
}

.calendar-reconciliation-copy {
  display: grid;
  gap: 3px;
}

.calendar-reconciliation-copy > strong {
  font-size: 14px;
}

.calendar-reconciliation-copy > span {
  color: var(--muted);
  font-size: 10px;
}

.calendar-reconciliation-warning {
  color: #80601f !important;
  font-weight: 600;
}

.calendar-production-day-status {
  margin-bottom: 6px;
  padding: 6px 7px;
  border: 1px dashed #a8b7aa;
  border-radius: 6px;
  background: #f3f7f3;
  color: #496453;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.3;
}

@media(max-width:700px) {
  .calendar-reconciliation {
    align-items: stretch;
    flex-direction: column;
  }
}


.calendar-schedule-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.calendar-schedule-control > div {
  display: grid;
  gap: 3px;
}

.calendar-schedule-control strong {
  font-size: 13px;
}

.calendar-schedule-control span {
  color: var(--muted);
  font-size: 10px;
}

.calendar-schedule-control.forecast {
  background: #fff8e8;
  border-color: #d8b66f;
}

.calendar-schedule-control.confirmed {
  background: #edf5ee;
  border-color: #9eb7a3;
}

.calendar-schedule-control.closed {
  background: #f3f3f1;
}

@media(max-width:700px) {
  .calendar-schedule-control {
    align-items: stretch;
    flex-direction: column;
  }
}


.calendar-schedule-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-schedule-editor {
  display: grid;
  gap: 16px;
}

.calendar-schedule-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.calendar-schedule-editor-heading h4 {
  margin: 3px 0 4px;
  font-size: 20px;
}

.calendar-schedule-editor-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.calendar-schedule-editor-capacity {
  display: grid;
  gap: 2px;
  min-width: 120px;
  text-align: right;
}

.calendar-schedule-editor-capacity strong {
  font-size: 16px;
}

.calendar-schedule-editor-capacity span {
  color: var(--muted);
  font-size: 10px;
}

.calendar-schedule-editor-batches {
  display: grid;
  gap: 12px;
}

.calendar-schedule-editor-batch {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.calendar-schedule-editor-batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: #faf9f5;
}

.calendar-schedule-editor-batch-head > div {
  display: grid;
  gap: 2px;
}

.calendar-schedule-editor-batch-head span {
  color: var(--muted);
  font-size: 10px;
}

.calendar-schedule-editor-allocations {
  display: grid;
}

.calendar-schedule-allocation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-top: 1px solid var(--line-soft);
}

.calendar-schedule-allocation-row > span {
  display: grid;
  gap: 2px;
}

.calendar-schedule-allocation-row small {
  color: var(--muted);
  font-size: 9px;
}

.calendar-schedule-allocation-row input {
  width: 88px;
  text-align: right;
}

.calendar-schedule-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.calendar-schedule-editor-empty {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

@media(max-width:700px) {
  .calendar-schedule-actions,
  .calendar-schedule-editor-heading,
  .calendar-schedule-allocation-row {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-schedule-editor-capacity {
    text-align: left;
  }

  .calendar-schedule-allocation-row input {
    width: 100%;
  }
}


/* Production Log family matrix */

.production-run-family-block {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface, #fff);
}

.production-family-block-head {
  display: grid;
  grid-template-columns:
    minmax(190px, 1fr)
    minmax(160px, 1fr)
    auto;
  gap: 12px;
  align-items: end;
}

.production-family-block-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.production-family-total {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-right: 4px;
}

.production-family-matrix-container {
  margin-top: 14px;
}

.production-family-matrix-scroll {
  overflow-x: auto;
}

.production-family-matrix {
  width: 100%;
  min-width: 520px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.production-family-matrix th,
.production-family-matrix td {
  padding: 9px;
  text-align: center;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.production-family-matrix th:first-child {
  width: 100px;
  text-align: left;
}

.production-family-matrix tr:last-child th,
.production-family-matrix tr:last-child td {
  border-bottom: 0;
}

.production-family-matrix th:last-child,
.production-family-matrix td:last-child {
  border-right: 0;
}

.production-family-matrix thead th,
.production-family-total-row {
  background: var(--soft, #f3f5f1);
}

.production-family-matrix input {
  width: 76px;
  max-width: 100%;
  text-align: center;
}

.production-family-row-total {
  font-weight: 800;
}

.production-family-allocations {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.production-family-variant-allocation {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--soft, #f8f7f2);
}

.production-family-variant-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.production-family-variant-title span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.production-family-allocation-list {
  display: grid;
  gap: 7px;
}

.production-family-allocation-row,
.production-run-family-block
  .production-run-backstock-row {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr)
    100px;
  gap: 10px;
  align-items: center;
}

.production-run-family-block
  .production-run-backstock-row {
  margin-top: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

#addProductionRunItemBtn {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .production-family-block-head {
    grid-template-columns: 1fr;
  }

  .production-family-block-meta {
    justify-content: flex-start;
  }
}

/* Direct calendar Hot Shop matrix editing */

.calendar-schedule-editor-team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.calendar-schedule-editor-team {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.calendar-schedule-editor-team.primary-maker {
  border-color: #b9cfbd;
  background: #f1f6f2;
}

.calendar-schedule-editor-team.general {
  background: #faf9f5;
}

.calendar-schedule-editor-team-head {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.calendar-schedule-editor-team-head strong {
  color: var(--ink);
  font-size: 13px;
}

.calendar-schedule-editor-team-head span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.calendar-day-dialog
.calendar-schedule-team-matrix {
  grid-template-columns: 1fr;
}

.calendar-schedule-editor-team
.calendar-schedule-matrix-empty {
  padding: 18px 8px;
}

.calendar-schedule-editor-team
.calendar-schedule-matrix-empty[hidden] {
  display: none;
}

@media(max-width:1000px) {
  .calendar-schedule-editor-team-grid {
    grid-template-columns: 1fr;
  }
}

.calendar-schedule-edit-matrix
.daily-matrix-group-title {
  align-items: center;
}

.calendar-schedule-edit-matrix
.daily-matrix-group-title > div {
  display: grid;
  gap: 2px;
}

.calendar-schedule-edit-matrix
.daily-matrix-group-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.calendar-schedule-edit-matrix
.daily-matrix-table input {
  width: 64px;
  min-width: 54px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: right;
}

.calendar-schedule-edit-matrix
.daily-matrix-table input:focus {
  border-color: #7f9d84;
  outline: 2px solid rgba(127, 157, 132, 0.2);
}

.calendar-schedule-matrix-empty {
  color: var(--muted);
  text-align: center;
}

.calendar-schedule-editor
.calendar-schedule-editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 18px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

/* Calendar matrix Add Color controls */

.calendar-schedule-matrix-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.calendar-schedule-matrix-actions select {
  width: auto;
  min-width: 145px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

@media(max-width:700px) {
  .calendar-schedule-matrix-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-schedule-matrix-actions select {
    width: 100%;
  }
}

/* Calendar cell yield instructions */

.calendar-schedule-make-instruction {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.calendar-schedule-make-instruction[hidden] {
  display: none;
}

.calendar-schedule-edit-matrix
.daily-matrix-number {
  vertical-align: top;
  white-space: normal;
}

.calendar-schedule-edit-matrix
.daily-matrix-number > input:first-of-type {
  display: block;
  margin: 0 auto;
}

.calendar-editor-backstock-control {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.calendar-editor-backstock-label {
  position: absolute;
  top: 50%;
  right: calc(50% + 38px);
  margin: 0;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}

.calendar-schedule-edit-matrix
.daily-matrix-table
input[data-calendar-editor-backstock-quantity] {
  display: block;
  width: 64px;
  min-width: 54px;
  margin: 0 auto;
  border-color: #9fb8a4;
  background: #f1f6f2;
}

/* Production Settings cards */
.production-settings-add {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface, #fff);
}

.production-settings-add-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.production-settings-add-header h3,
.production-yield-settings-head h3 {
  margin: 3px 0 5px;
}

.production-settings-add-header p,
.production-yield-settings-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.production-settings-add-form {
  margin-top: 16px;
}

.production-settings-add-grid {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(190px, 1fr)
    );
  align-items: end;
  gap: 14px;
}

.production-settings-add-grid label {
  display: grid;
  gap: 6px;
}

.production-settings-add-grid label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.production-settings-add-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Separate Yield Settings table */
.production-yield-settings {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.production-yield-settings-head {
  max-width: 720px;
  margin-bottom: 14px;
}

.production-yield-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.production-yield-table th,
.production-yield-table td {
  padding: 9px 10px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.production-yield-table th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.production-yield-table th:last-child,
.production-yield-table td:last-child {
  border-right: 0;
}

.production-yield-table th:nth-child(1) {
  width: 25%;
}

.production-yield-table th:nth-child(2) {
  width: 14%;
}

.production-yield-table th:nth-child(3) {
  width: 14%;
}

.production-yield-table th:nth-child(4) {
  width: 18%;
}

.production-yield-table th:nth-child(5) {
  width: 18%;
}

.production-yield-table th:nth-child(6) {
  width: 11%;
}

.production-yield-table tbody tr:hover {
  background: #fbf9f5;
}

.production-yield-input {
  display: flex;
  align-items: center;
  gap: 5px;
}

.production-yield-input input {
  width: 72px;
}

.production-yield-input span {
  color: var(--muted);
  font-weight: 700;
}

.production-yield-observed {
  white-space: nowrap;
}

.production-yield-history {
  display: grid;
  gap: 2px;
  font-size: 11px;
  white-space: nowrap;
}

.production-yield-history span {
  color: var(--muted);
}

.production-yield-recommendation {
  display: flex;
  align-items: center;
  gap: 9px;
}

.production-yield-recommendation strong {
  min-width: 40px;
}

.production-yield-insufficient {
  color: var(--muted);
  font-size: 11px;
}

.production-yield-table button:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
}

@media(max-width:700px) {
  .production-settings-add-header {
    flex-direction: column;
  }

  .production-settings-add-grid {
    grid-template-columns: 1fr;
  }
}

/* Refined Production Settings layout */
#productionSettingsView .production-settings-shell {
  overflow: hidden;
  border-radius: 22px;
  background: #f6f0e5;
  border-color: #ddd2c2;
}

#productionSettingsView .production-settings-add {
  border-radius: 18px;
  background: #fbf6ed;
  border-color: #ded3c4;
  box-shadow:
    0 1px 0 rgba(76, 61, 42, 0.04);
}

#productionSettingsView .production-yield-settings {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #ded3c4;
  border-radius: 18px;
  background: #fbf6ed;
}

.production-yield-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fffdf9;
}

.production-yield-table {
  min-width: 820px;
}

.production-yield-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eee7dc;
  box-shadow:
    0 1px 0 var(--line-soft);
}

.production-yield-table tbody tr {
  background: #fffdf9;
}

.production-yield-table tbody tr:nth-child(even) {
  background: #faf6ef;
}

.production-yield-table tbody tr:hover {
  background: #f3ecdf;
}

.production-settings-inactive-toggle {
  margin-top: 18px;
}

#productionSettingsView
  > .production-settings-shell
  > .production-settings-table-wrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fffdf9;
}

@media(max-width:700px) {
  #productionSettingsView .production-settings-shell {
    border-radius: 16px;
  }

  #productionSettingsView .production-settings-add,
  #productionSettingsView .production-yield-settings {
    border-radius: 14px;
    padding: 14px;
  }

  .production-yield-table-wrap {
    max-height: 440px;
  }
}

/* Final Production Settings spacing and scrolling */
#productionSettingsView .production-settings-shell {
  box-sizing: border-box;
  padding: 24px;
}

#productionSettingsView
  .production-settings-shell
  > .planning-head {
  margin: 0;
  padding: 2px 2px 0;
}

#productionSettingsView
  .production-settings-shell
  > .planning-head h2 {
  margin-top: 3px;
  margin-bottom: 5px;
}

#productionSettingsStatus {
  margin: 0;
  padding: 0 2px 4px;
  color: var(--muted);
}

#productionSettingsView
  .production-settings-inactive-toggle {
  margin-top: 22px;
  margin-bottom: 10px;
}

#productionSettingsView
  .production-settings-table-wrap:not(
    .production-yield-table-wrap
  ) {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fffdf9;
}

#productionSettingsView
  .production-settings-table
  thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eee7dc;
  box-shadow:
    0 1px 0 var(--line-soft);
}

#productionSettingsView
  .production-settings-table
  tbody tr {
  background: #fffdf9;
}

#productionSettingsView
  .production-settings-table
  tbody tr:nth-child(even) {
  background: #faf6ef;
}

#productionSettingsView
  .production-settings-table
  tbody tr:hover {
  background: #f3ecdf;
}

@media(max-width:700px) {
  #productionSettingsView
    .production-settings-shell {
    padding: 14px;
  }

  #productionSettingsView
    .production-settings-table-wrap:not(
      .production-yield-table-wrap
    ) {
    max-height: 440px;
  }
}

/* Cohesive Backstock matrix layout */
#backstockView .production-settings-shell {
  box-sizing: border-box;
  padding: 24px;
  overflow: hidden;
  border: 1px solid #ddd2c2;
  border-radius: 22px;
  background: #f6f0e5;
}

#backstockView
  .production-settings-shell
  > .planning-head {
  margin: 0;
  padding: 2px 2px 0;
}

#backstockView #backstockStatus {
  margin: 0;
  padding: 0 2px 4px;
  color: var(--muted);
}

#backstockView .backstock-add-panel,
#backstockView .backstock-inventory-section {
  border: 1px solid #ded3c4;
  border-radius: 18px;
  background: #fbf6ed;
}

#backstockView .backstock-inventory-section {
  margin-top: 22px;
  padding: 20px;
}

#backstockView .backstock-matrix {
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(420px, 1fr)
    );
}

#backstockView .backstock-matrix-group {
  overflow: hidden;
  border: 1px solid #ded3c4;
  border-radius: 14px;
  background: #fffdf9;
}

.backstock-matrix-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.backstock-matrix-group-title > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.backstock-matrix-group
  .daily-matrix-color {
  box-sizing: border-box;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.backstock-family-add-color {
  margin: 0 12px 12px;
  padding: 14px;
  border: 1px solid #d8cdbc;
  border-radius: 10px;
  background: #f5eee3;
}

.backstock-family-color-choice {
  display: grid;
  gap: 5px;
  max-width: 280px;
}

.backstock-family-color-choice > span,
.backstock-family-variant-quantities
  label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.backstock-family-variant-quantities {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(90px, 1fr)
    );
  gap: 10px;
  margin-top: 12px;
}

.backstock-family-variant-quantities label {
  display: grid;
  gap: 5px;
}

.backstock-family-variant-quantities input {
  width: 100%;
  box-sizing: border-box;
}

.backstock-family-add-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

@media(max-width:700px) {
  #backstockView .production-settings-shell {
    padding: 14px;
    border-radius: 16px;
  }

  #backstockView .backstock-add-panel,
  #backstockView .backstock-inventory-section {
    border-radius: 14px;
  }

  #backstockView .backstock-inventory-section {
    padding: 14px;
  }

  #backstockView .backstock-matrix {
    grid-template-columns: 1fr;
  }

  .backstock-matrix-group
    .daily-matrix-color {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
  }
}

/* Multi-color Backstock family entry */
.backstock-family-color-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.backstock-family-color-picker-head > div {
  display: grid;
  gap: 3px;
}

.backstock-family-color-picker-head span {
  color: var(--muted);
  font-size: 11px;
}

.backstock-family-color-options {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(125px, 1fr)
    );
  gap: 6px;
  max-height: 170px;
  margin-top: 12px;
  padding: 10px;
  overflow: auto;
  border: 1px solid #d8cdbc;
  border-radius: 9px;
  background: #fffdf9;
}

.backstock-family-color-option {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
}

.backstock-family-color-option:hover {
  background: #f1eadf;
}

.backstock-family-color-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
}

.backstock-family-color-option span {
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.backstock-family-entry-matrix {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #d8cdbc;
  border-radius: 9px;
  background: #fffdf9;
}

.backstock-family-entry-matrix
  .daily-matrix-table {
  min-width: 100%;
}

.backstock-family-entry-matrix
  .daily-matrix-color {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.backstock-family-entry-matrix
  input[
    data-backstock-family-entry-quantity
  ] {
  box-sizing: border-box;
  width: 70px;
  min-width: 58px;
  padding: 7px 6px;
  text-align: center;
}

@media(max-width:700px) {
  .backstock-family-color-picker-head {
    align-items: stretch;
    flex-direction: column;
  }

  .backstock-family-color-options {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .backstock-family-entry-matrix
    .daily-matrix-color {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
  }
}

/* Inline Backstock quantity editing */
.backstock-matrix-inline-cell {
  display: grid;
  gap: 3px;
  min-width: 64px;
}

.backstock-matrix-inline-cell
  input[data-backstock-inline-quantity] {
  box-sizing: border-box;
  width: 100%;
  min-width: 52px;
  padding: 7px 5px;
  border: 1px solid #b8cbbb;
  border-radius: 5px;
  background: #edf5ee;
  color: #355743;
  font: inherit;
  font-weight: 700;
  text-align: center;
}

.backstock-matrix-inline-cell
  input[data-backstock-inline-quantity]:hover,
.backstock-matrix-inline-cell
  input[data-backstock-inline-quantity]:focus {
  border-color: #6f9179;
  background: #dbeade;
  outline: none;
}

.backstock-matrix-inline-cell
  input[data-backstock-inline-quantity].saving {
  opacity: 0.58;
}

.backstock-matrix-manage-button {
  padding: 2px 3px;
  border: 0;
  background: transparent;
  color: #587060;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.backstock-matrix-manage-button:hover,
.backstock-matrix-manage-button.active {
  color: #294c36;
  text-decoration: underline;
}

/* Editable zero-stock Backstock cells */
.backstock-matrix-inline-cell.empty
  input[data-backstock-inline-quantity] {
  border-color: #d7d0c5;
  background: #faf7f1;
  color: #7a746b;
}

.backstock-matrix-inline-cell.empty
  input[data-backstock-inline-quantity]:hover,
.backstock-matrix-inline-cell.empty
  input[data-backstock-inline-quantity]:focus {
  border-color: #8fae96;
  background: #edf5ee;
  color: #355743;
}

/* Align populated and zero-stock Backstock cells */
.backstock-matrix-inline-cell.empty::after {
  content: "Manage";
  visibility: hidden;
  padding: 2px 3px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
}

.backstock-matrix-inline-cell
  input[data-backstock-inline-quantity] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.backstock-matrix-inline-cell
  input[data-backstock-inline-quantity]
 ::-webkit-inner-spin-button,
.backstock-matrix-inline-cell
  input[data-backstock-inline-quantity]
  ::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.backstock-matrix-group
  .daily-matrix-table td {
  vertical-align: middle;
}

.backstock-matrix-group
  .backstock-matrix-inline-cell {
  align-content: center;
}

/* Keep Backstock editors inside their table cells */
.backstock-matrix-group
  .daily-matrix-table td {
  box-sizing: border-box;
  overflow: hidden;
  padding-left: 5px;
  padding-right: 5px;
}

.backstock-matrix-group
  .backstock-matrix-inline-cell {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.backstock-matrix-group
  .backstock-matrix-inline-cell
  input[data-backstock-inline-quantity] {
  display: block;
  box-sizing: border-box;
  width: calc(100% - 4px);
  min-width: 0;
  max-width: 96px;
  margin-left: auto;
  margin-right: auto;
}

.backstock-matrix-group
  .backstock-matrix-manage-button {
  display: block;
  width: 100%;
  max-width: 96px;
  margin-left: auto;
  margin-right: auto;
}

/* Backstock family card header spacing */
#backstockView
  .backstock-matrix-group-title {
  box-sizing: border-box;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fffaf2;
}

#backstockView
  .backstock-matrix-group-title
  > div {
  min-width: 0;
}

#backstockView
  .backstock-matrix-group-title
  > div > strong {
  line-height: 1.2;
}

#backstockView
  .backstock-matrix-group-title
  .button {
  flex: 0 0 auto;
  margin: 0;
}

/* Studio production workspace tabs */
.studio-production-plan-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5eee3;
  color: var(--muted);
  font-size: 12px;
}

.studio-production-plan-status strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.studio-production-plan-status.confirmed {
  border-color: #b8cbbb;
  background: #edf5ee;
}

.studio-production-plan-status.confirmed strong {
  color: #355743;
}

.studio-production-tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eee6d9;
  overflow-x: auto;
}

.studio-production-tabs button {
  flex: 1 0 auto;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.studio-production-tabs button:hover {
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
}

.studio-production-tabs button.active {
  background: #fffaf2;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(70, 55, 35, 0.12);
}

.studio-production-summary {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.studio-production-summary > div {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f2e8;
}

.studio-production-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.studio-production-summary strong {
  font-size: 18px;
}

.studio-production-subsection {
  margin-top: 18px;
}

.studio-production-subsection h3 {
  margin: 0 0 10px;
}

.studio-next-batch-explanation {
  display: grid;
  grid-template-columns:
    minmax(170px, auto)
    minmax(260px, 1fr)
    auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #d8cdbc;
  border-radius: 12px;
  background: #f5eee3;
}

.studio-next-batch-explanation > div {
  display: grid;
  gap: 3px;
}

.studio-next-batch-explanation span,
.studio-next-batch-explanation p {
  color: var(--muted);
  font-size: 11px;
}

.studio-next-batch-explanation p {
  margin: 0;
  line-height: 1.45;
}

.studio-production-order-scroll {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf2;
}

.studio-production-order-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.studio-production-order-table th,
.studio-production-order-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.studio-production-order-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eee6d9;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.studio-production-order-table tbody tr:nth-child(even) {
  background: #f8f2e8;
}

.studio-production-order-table tbody tr:last-child td {
  border-bottom: 0;
}

.studio-production-reasons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.studio-production-reasons span {
  padding: 3px 6px;
  border-radius: 999px;
  background: #eee6d9;
  color: #5f574d;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

@media(max-width:800px) {
  .studio-production-summary {
    grid-template-columns: 1fr;
  }

  .studio-next-batch-explanation {
    grid-template-columns: 1fr;
  }

  .studio-production-plan-status {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Next Batch Backstock suggestions */
.studio-production-subsection-note {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.studio-backstock-opportunities {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf2;
}

.studio-backstock-opportunity {
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr)
    auto
    auto;
  gap: 16px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.studio-backstock-opportunity:last-child {
  border-bottom: 0;
}

.studio-backstock-opportunity:nth-child(even) {
  background: #f8f2e8;
}

.studio-backstock-opportunity > div:first-child {
  display: grid;
  gap: 3px;
}

.studio-backstock-opportunity > div:first-child span {
  color: var(--muted);
  font-size: 10px;
}

.studio-backstock-opportunity-quantity {
  display: flex;
  gap: 12px;
}

.studio-backstock-opportunity-quantity span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.studio-backstock-opportunity-quantity strong {
  color: var(--ink);
  font-size: 14px;
}

.studio-backstock-none {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #f8f2e8;
  color: var(--muted);
  font-size: 11px;
}

@media(max-width:700px) {
  .studio-backstock-opportunity {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Inline Next Batch Backstock controls */
.studio-matrix-backstock {
  display: grid;
  gap: 4px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid #c8d8ca;
}

.studio-matrix-backstock span {
  color: #55705d;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.studio-matrix-backstock span strong {
  display: inline;
  color: #355743;
  font-size: inherit;
}

.studio-backstock-plan-summary {
  display: grid;
  gap: 2px;
}

.studio-matrix-backstock
  .studio-backstock-plan-summary span {
  display: block;
  letter-spacing: 0;
  text-transform: none;
}

.studio-matrix-backstock
  .studio-backstock-plan-summary
  span:first-child {
  text-transform: uppercase;
  letter-spacing: .03em;
}

.studio-backstock-plan-summary {
  display: grid;
  justify-items: center;
  gap: 1px;
}

.studio-backstock-plan-summary span {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 3px;
  line-height: 1.25;
  white-space: nowrap;
}

.studio-backstock-plan-line b {
  color: #9aab9d;
  font-weight: 400;
}

.studio-matrix-backstock button {
  padding: 3px 5px;
  border: 1px solid #8ead96;
  border-radius: 5px;
  background: #edf5ee;
  color: #355743;
  font: inherit;
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}

.studio-matrix-backstock button:hover {
  background: #dbeade;
}

.studio-matrix-backstock button:disabled {
  cursor: default;
  opacity: 0.55;
}

.studio-backstock-planner-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #c9c2b7;
  border-radius: 14px;
  background: #fffdf9;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(42, 36, 29, .28);
}

.studio-backstock-planner-dialog::backdrop {
  background: rgba(42, 36, 29, .48);
}

.studio-backstock-planner-dialog form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.studio-backstock-planner-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.studio-backstock-planner-head > div {
  display: grid;
  gap: 3px;
}

.studio-backstock-planner-head span,
.studio-backstock-planner-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.studio-backstock-planner-head h3 {
  margin: 0;
}

.studio-backstock-planner-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.studio-backstock-planner-summary > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #ddd4c7;
  border-radius: 8px;
  background: #f7f1e7;
}

.studio-backstock-planner-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.studio-backstock-planner-orders {
  display: grid;
  gap: 7px;
}

.studio-backstock-planner-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #ddd4c7;
  border-radius: 8px;
  background: #fff;
}

.studio-backstock-planner-order > div {
  display: grid;
  gap: 2px;
}

.studio-backstock-planner-order span {
  color: var(--muted);
  font-size: 11px;
}

.studio-backstock-planner-order em {
  width: fit-content;
  color: #355743;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.studio-backstock-planner-order input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px;
  border: 1px solid #c9c2b7;
  border-radius: 6px;
  font: inherit;
  text-align: right;
}

.studio-backstock-planner-validation {
  min-height: 18px;
  color: #9a3e32;
  font-size: 11px;
  font-weight: 700;
}

.studio-backstock-planner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media(max-width:600px) {
  .studio-backstock-planner-summary {
    grid-template-columns: 1fr;
  }

  .studio-backstock-planner-actions {
    display: grid;
  }
}

.studio-allocated-backstock {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #b8cbbb;
  border-radius: 10px;
  background: #edf5ee;
}

.studio-allocated-backstock-title {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border-bottom: 1px solid #c8d8ca;
}

.studio-allocated-backstock-title span {
  color: #55705d;
  font-size: 9px;
}

.studio-allocated-backstock-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr)
    auto
    auto;
  gap: 12px;
  align-items: center;
  padding: 8px 11px;
  border-bottom: 1px solid #c8d8ca;
}

.studio-allocated-backstock-row:last-child {
  border-bottom: 0;
}

.studio-allocated-backstock-row > div {
  display: grid;
  gap: 2px;
}

.studio-allocated-backstock-row > div span {
  color: #55705d;
  font-size: 9px;
}

.studio-allocated-backstock-row > span {
  color: #55705d;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.studio-allocated-backstock-row > span strong {
  color: #355743;
  font-size: 13px;
}

@media(max-width:700px) {
  .studio-allocated-backstock-row {
    grid-template-columns: 1fr;
  }
}

/* Next Batch print and bulk actions */
.studio-next-batch-actions {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(165px, 1fr));
  gap: 7px;
  min-width: 350px;
}

.studio-next-batch-actions .button {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}

@media(max-width:1050px) {
  .studio-next-batch-explanation {
    grid-template-columns: 1fr;
  }

  .studio-next-batch-actions {
    min-width: 0;
  }
}

@media(max-width:520px) {
  .studio-next-batch-actions {
    grid-template-columns: 1fr;
  }
}

/* Today's Production print action */
.studio-production-plan-status .button {
  flex: 0 0 auto;
  margin-left: auto;
}

@media(max-width:700px) {
  .studio-production-plan-status .button {
    width: 100%;
    margin-left: 0;
  }
}

/* Bulk Backstock allocation review */
.studio-backstock-review-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #c9c2b7;
  border-radius: 14px;
  background: #fffdf9;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(42, 36, 29, .28);
}

.studio-backstock-review-dialog::backdrop {
  background: rgba(42, 36, 29, .48);
}

.studio-backstock-review-shell {
  display: grid;
  gap: 16px;
  padding: 20px 20px 0;
  overflow-wrap: anywhere;
}

.studio-backstock-review-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-backstock-review-controls > span {
  flex: 1 1 220px;
  font-size: 12px;
  color: var(--muted);
}

.studio-backstock-review-order {
  border-top: 1px solid #ddd4c7;
}

.studio-backstock-review-order summary {
  display: list-item;
  padding: 10px 4px;
  cursor: pointer;
  font-size: 13px;
}

.studio-backstock-review-order-name,
.studio-backstock-review-quantity {
  display: inline-grid;
  gap: 3px;
  vertical-align: top;
}

.studio-backstock-review-order-name {
  width: 57%;
}

.studio-backstock-review-quantity {
  width: 36%;
  text-align: right;
}

.studio-backstock-review-order-name > span,
.studio-backstock-review-quantity > span {
  font-size: 12px;
  color: var(--muted);
}

.studio-backstock-review-order-name > strong {
  font-size: 15px;
}

.studio-backstock-review-lines {
  padding: 0 4px 12px 20px;
}

.studio-backstock-review-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid #eee7dc;
  font-size: 12px;
}

.studio-backstock-review-line > div {
  display: grid;
  gap: 3px;
}

.studio-backstock-review-line > div > span:last-child {
  color: var(--muted);
}

.studio-backstock-review-line-quantity {
  text-align: right;
}

.studio-backstock-review-actions {
  position: sticky;
  bottom: 0;
  padding: 14px 0;
  border-top: 1px solid #ddd4c7;
  background: #fffdf9;
}

@media (max-width: 600px) {
  .studio-backstock-review-shell {
    padding: 14px 14px 0;
    gap: 12px;
  }

  .studio-backstock-review-dialog .studio-backstock-planner-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Read-only current-batch campaign forecast */
.calendar-campaign-forecast {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #b9cbbd;
  border-radius: 12px;
  background: #f4f8f4;
}

.calendar-campaign-forecast-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 12px;
}

.calendar-campaign-forecast-head h3 {
  margin: 3px 0 4px;
  font-size: 18px;
}

.calendar-campaign-forecast-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.calendar-campaign-forecast-head > strong {
  color: var(--sage);
  font-size: 11px;
  text-align: right;
}

.calendar-campaign-forecast-protected {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #e8f0e9;
  color: #526957;
  font-size: 10px;
  font-weight: 700;
}

.calendar-campaign-forecast-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: start;
  gap: 10px;
}

.calendar-campaign-forecast-day {
  min-width: 0;
  padding: 11px;
  border: 1px solid #d7e1d9;
  border-radius: 9px;
  background: #fff;
}

.calendar-campaign-forecast-day h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.calendar-campaign-forecast-block {
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}

.calendar-campaign-forecast-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.calendar-campaign-forecast-time {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.calendar-campaign-forecast-lane {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 0;
}

.calendar-campaign-forecast-lane strong,
.calendar-campaign-forecast-lane small {
  display: block;
}

.calendar-campaign-forecast-lane strong {
  font-size: 11px;
}

.calendar-campaign-forecast-lane small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.calendar-campaign-forecast-lane > span {
  flex: 0 0 auto;
  color: var(--sage);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

@media(max-width:900px) {
  .calendar-campaign-forecast-head {
    flex-direction: column;
    gap: 8px;
  }

  .calendar-campaign-forecast-head > strong {
    text-align: left;
  }
}

.calendar-campaign-forecast-days {
  grid-template-columns: 1fr;
}

.calendar-campaign-forecast-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.calendar-campaign-forecast-day-head h4 {
  margin: 0;
}

.calendar-campaign-forecast-day-head span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #e7efe8;
  color: #526957;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.calendar-campaign-forecast-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.calendar-campaign-forecast-team {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #faf9f5;
}

.calendar-campaign-forecast-team.primary-maker {
  border-color: #b9cbbd;
  background: #f2f7f3;
}

.calendar-campaign-forecast-team h5 {
  margin: 0 0 8px;
  color: var(--sage);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.calendar-campaign-forecast-lane em {
  display: inline-block;
  margin-right: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #e8f0e9;
  color: #526957;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

@media(max-width:900px) {
  .calendar-campaign-forecast-teams {
    grid-template-columns: 1fr;
  }
}

summary.calendar-campaign-forecast-day-head {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0;
}

summary.calendar-campaign-forecast-day-head::-webkit-details-marker {
  display: none;
}

summary.calendar-campaign-forecast-day-head::before {
  content: "▸";
  color: var(--sage);
  font-size: 12px;
}

.calendar-campaign-forecast-day[open] > summary::before {
  content: "▾";
}

.calendar-campaign-forecast-day-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.calendar-campaign-forecast-day-head > div > strong {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.calendar-campaign-forecast-day[open] .calendar-campaign-forecast-teams {
  margin-top: 10px;
}

/* Named weekly employee availability */
.calendar-weekly-staffing-days {
  display: grid;
  gap: 8px;
}

.calendar-weekly-staffing-day {
  padding: 0;
  overflow: hidden;
}

.calendar-weekly-staffing-day > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 700;
}

.calendar-weekly-staffing-day > summary::-webkit-details-marker {
  display: none;
}

.calendar-weekly-staffing-day > summary:hover {
  background: #f4f1e9;
}

.calendar-weekly-staffing-day > summary span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.calendar-employee-hours-list {
  display: grid;
  gap: 1px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.calendar-employee-hours-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 120px 140px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #fffdf9;
}

.calendar-employee-hours-row.header {
  background: #f2eee4;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.calendar-employee-hours-row input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #d8d1c7;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.calendar-employee-hours-name strong,
.calendar-employee-hours-name small {
  display: block;
}

.calendar-employee-hours-name strong {
  font-size: 11px;
}

.calendar-employee-hours-name small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.calendar-employee-hours-row label {
  display: grid;
  grid-template-columns: 70px minmax(90px, 1fr) 42px;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.calendar-employee-hours-row label span {
  margin: 0;
  font-size: 8px;
  white-space: nowrap;
}

.calendar-employee-hours-row input[type="range"] {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  accent-color: var(--sage);
}

.calendar-employee-hours-row output {
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media(max-width:800px) {
  .calendar-employee-hours-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .calendar-employee-hours-row label {
    grid-template-columns: 70px minmax(90px, 1fr) 42px;
  }
}

/* Date-specific team availability */
.calendar-day-staffing {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf7ef;
}

.calendar-day-staffing-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.calendar-day-staffing-head h4 {
  margin: 0;
  font-size: 13px;
}

.calendar-day-staffing-head p {
  margin: 4px 0 0;
  max-width: 580px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.calendar-day-staffing-table {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.calendar-day-staffing-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 120px 140px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.calendar-day-staffing-row:last-child {
  border-bottom: 0;
}

.calendar-day-staffing-row.header {
  background: #f2eee4;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.calendar-day-staffing-row label strong,
.calendar-day-staffing-row label small {
  display: block;
}

.calendar-day-staffing-row label strong {
  font-size: 11px;
}

.calendar-day-staffing-row label small {
  margin-top: 2px;
  color: var(--sage);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.calendar-day-staffing-row input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #d8d1c7;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

@media(max-width:700px) {
  .calendar-day-staffing-head {
    flex-direction: column;
  }

  .calendar-day-staffing-row {
    grid-template-columns: minmax(110px, 1fr) 90px 110px;
  }
}

/* Production Totals */
.production-totals-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.production-totals-cell span {
  font-size: 12px;
  font-weight: 700;
}

.production-totals-cell input {
  width: 64px;
  min-width: 64px;
  height: 36px;
  padding: 4px 8px;
  border: 1px solid #aaa;
  border-radius: 6px;
  background: #fff;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  box-sizing: border-box;
}

.production-totals-cell input:focus {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}
