/* Production workspace: shared planning controls and compact task cards. */
.production-toolbar { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 140px; align-items: end; gap: 14px; margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-surface); }
.production-toolbar__priorities { min-width: 0; }
#productionPriorityFilter { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
#productionPriorityFilter .production-priority { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 9px; border-radius: 7px; border: 1px solid transparent; background: var(--ds-inset); color: var(--ds-muted); font-size: 12px; font-weight: 550; white-space: nowrap; }
#productionPriorityFilter .production-priority strong { color: inherit; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
#productionPriorityFilter .production-priority[aria-pressed="true"] { border-color: #314e5b; background: var(--ds-soft); color: var(--ds-accent); }
#productionPriorityFilter .production-priority[data-production-priority="overdue"][aria-pressed="true"] { background: #3a252b; border-color: #69424b; color: var(--ds-danger); }
.production-filter-result { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; margin: 0 0 10px; color: var(--ds-muted); font-size: 11px; }
#productionClearFilters { min-height: 32px; padding: 4px 8px; font-size: 11px; }
#productionClearFilters[hidden] { display: none !important; }
.production-toolbar__colors { min-width: 0; flex: 1; }
.production-toolbar__label, #upsellerKbProjHorizon .kanban-proj-horizon__label { display: block; color: var(--ds-muted); font-size: 11px; font-weight: 550; line-height: 1.4; margin: 0 0 7px; }
.production-toolbar__colors:has(#upsellerKbColorFilter[hidden]) { display: none; }
.production-toolbar:not(:has(#upsellerKbProjHorizon:not([hidden]))) { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
#upsellerKbColorFilter { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; }
#upsellerKbColorFilter[hidden], #upsellerKbProjHorizon[hidden] { display: none; }
#upsellerKbColorFilter .kanban-color-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; min-height: 34px; border: 1px solid transparent; border-radius: 7px; padding: 5px 10px; font-size: 12px; font-weight: 550; color: var(--ds-muted); background: var(--ds-inset); box-shadow: none; white-space: nowrap; }
#upsellerKbColorFilter .kanban-color-chip.is-active { color: var(--ds-accent); border-color: #314e5b; background: var(--ds-soft); }
#upsellerKbColorFilter .kanban-color-chip__n { font-size: 10px; opacity: 1; color: inherit; }
#upsellerKbProjHorizon { display: block; min-width: 0; flex: 0 0 160px; padding: 0; margin: 0; }
#productionHorizon.input { width: 100%; height: 34px; min-height: 34px !important; padding: 5px 10px; font-size: 12px; border-radius: 7px !important; }
#upsellerKanbanBoard { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
#upsellerKanbanBoard .kanban-column { min-height: 0; padding: 0 !important; background: transparent !important; border: 0 !important; border-radius: 0; overflow: visible; backdrop-filter: none; }
#upsellerKanbanBoard .kanban-column__header { gap: 8px; padding: 0 0 12px; margin: 0 0 12px; border-bottom: 1px solid var(--ds-border); min-height: 34px; }
#upsellerKanbanBoard .kanban-column__header h3 { margin: 0; font-size: 13px; font-weight: 650; line-height: 1.4; }
#upsellerKanbanBoard .kanban-column__header h3 small { margin-left: 4px; font-size: 10px; color: var(--ds-muted); font-weight: 450; white-space: nowrap; }
#upsellerKanbanBoard .kanban-column__dot { width: 7px; height: 7px; }
#upsellerKanbanBoard .kanban-column__count { padding: 3px 7px; border-radius: 6px; font-size: 11px; line-height: 1.2; background: var(--ds-elevated); color: var(--ds-text); }
#upsellerKanbanBoard .kanban-column__body { min-height: 0; max-height: none; padding: 0; margin: 0; gap: 10px; flex: none; overflow: visible; }
#upsellerKanbanBoard .kanban-column.drag-over { outline: 2px solid var(--ds-accent); outline-offset: 6px; border-radius: 8px; }
#upsellerKanbanBoard .kanban-column__empty { margin: 0; padding: 26px 20px; border: 1px dashed var(--ds-border); border-radius: 10px; font-size: 12px; line-height: 1.65; text-align: left; opacity: 1; color: var(--ds-muted); background: var(--ds-inset); }
#upsellerKanbanBoard .kanban-card { display: grid !important; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: none; gap: 10px; padding: 14px !important; border-radius: 11px; border: 1px solid var(--ds-border) !important; box-shadow: none !important; background: var(--ds-surface) !important; align-items: center; transform: none; }
#upsellerKanbanBoard .kanban-card:hover { border-color: #496273 !important; transform: none; }
#upsellerKanbanBoard .kanban-card__img { grid-area: auto; grid-column: 1; grid-row: 1; width: 40px !important; height: 40px !important; border-radius: 8px; background: var(--ds-elevated); }
#upsellerKanbanBoard .kanban-card__info { grid-area: auto; grid-column: 2; grid-row: 1; min-width: 0; }
#upsellerKanbanBoard .kanban-card__name { font-size: 13px !important; line-height: 1.4 !important; font-weight: 650; }
#upsellerKanbanBoard .production-card__priority { display: block; margin-top: 4px; color: var(--ds-muted); font-size: 11px; line-height: 1.4; font-weight: 500; }
#upsellerKanbanBoard .production-card__priority[data-priority="overdue"] { color: var(--ds-danger); }
#upsellerKanbanBoard .production-card__priority[data-priority="orders"] { color: var(--ds-warning); }
#upsellerKanbanBoard .kanban-card[data-priority="overdue"] { border-left: 3px solid #d17774 !important; }
#upsellerKanbanBoard .production-queue-group { grid-column: 1 / -1; margin: 10px 0 0; padding: 3px 0 1px; }
#upsellerKanbanBoard .production-queue-group:first-child { margin-top: 0; }
.production-queue-group h4 { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--ds-text); font-size: 12px; font-weight: 650; }
.production-queue-group h4 span { color: var(--ds-muted); font-size: 10px; font-weight: 550; }
.production-queue-group[data-production-group="overdue"] h4 { color: var(--ds-danger); }
.production-queue-group p { margin: 3px 0 0; color: var(--ds-muted); font-size: 10px; line-height: 1.45; }
#upsellerKanbanBoard .production-card__facts { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr 1fr .85fr; gap: 6px; margin: 0; padding: 10px 0; border-top: 1px solid var(--ds-border); border-bottom: 1px solid var(--ds-border); }
.production-card__facts dt { color: var(--ds-muted); font-size: 10px; margin-bottom: 4px; }
.production-card__facts dd { margin: 0; color: var(--ds-text); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.production-card__facts dd small { display: block; font-size: 10px; font-weight: 450; color: var(--ds-muted); margin-top: 3px; }
.production-card__facts .is-danger dd { color: var(--ds-danger); }
.production-card__facts .is-warn dd { color: var(--ds-warning); }
#upsellerKanbanBoard .production-card__facts--replenishment { grid-template-columns: 1fr 1fr; }
#upsellerKanbanBoard .kanban-card__badges { grid-area: auto; grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
#upsellerKanbanBoard .kanban-card__badges > span { grid-area: auto !important; display: flex !important; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; min-width: 0; min-height: 0; height: auto !important; padding: 0 !important; border: 0 !important; border-radius: 0; background: transparent !important; color: var(--ds-text) !important; box-shadow: none; }
#upsellerKanbanBoard .kanban-card__badges .production-qty-caption { color: var(--ds-muted); font-size: 10px; font-weight: 450; }
#upsellerKanbanBoard .kanban-card__badges .production-card__covered { color: var(--ds-muted) !important; font-size: 11px; line-height: 1.45; font-weight: 450; }
#upsellerKanbanBoard .kanban-card__badges strong { font-size: 21px; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
#upsellerKanbanBoard .kanban-card__badges strong small { font-size: 10px; font-weight: 450; color: var(--ds-muted); }
#upsellerKanbanBoard .kanban-card__make-badge.is-need strong { color: var(--ds-warning); }
#upsellerKanbanBoard .kanban-card__actions { grid-area: auto; grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; justify-self: stretch; width: 100%; margin: 2px 0 0; padding: 0; border: 0; }
#upsellerKanbanBoard .kanban-card__move-btn, #upsellerKanbanBoard .kanban-card__archive-btn, #upsellerKanbanBoard .kanban-proj-card__btn { height: 36px; min-height: 36px; font-size: 12px !important; border-radius: 7px; padding: 0 12px !important; }
#upsellerKanbanBoard .kanban-card__move-btn { flex: 1; }
#upsellerKanbanBoard .kanban-card__archive-btn { width: 36px; min-width: 36px; flex: 0 0 36px; padding: 0 !important; display: grid; place-items: center; }
.kanban-card__archive-btn svg { width: 17px; height: 17px; }
#upsellerKanbanBoard .kanban-card__move-btn:hover, #upsellerKanbanBoard .kanban-proj-card__btn:hover { background: #0098db; }
#upsellerKanbanBoard .kanban-card__move-btn--back:hover { background: var(--ds-elevated); }
#upsellerKanbanBoard .kanban-card[data-status="done"] { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
#upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__img { grid-row: 1 / 3; }
#upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__stock { grid-area: auto; grid-column: 2; grid-row: 2; font-size: 11px; margin: 0; }
#upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__qty-produced { grid-area: auto; grid-column: 3; grid-row: 1 / 3; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; background: transparent !important; border: 0 !important; padding: 0; justify-self: end; }
.kanban-card__qty-produced strong { font-size: 20px; font-weight: 650; }
.kanban-card__qty-produced small { font-size: 9px; font-weight: 450; color: var(--ds-muted); }
#upsellerKanbanBoard .kanban-card__stock:not(.kanban-card__stock--multi) { grid-column: 1 / -1; }
#upsellerKanbanBoard .kanban-proj-divider { margin: 8px 0 2px; padding-top: 14px; border-top: 1px solid var(--ds-border); display: flex; flex-direction: column; gap: 4px; }
.kanban-proj-divider span { font-size: 12px; font-weight: 650; }
.kanban-proj-divider small { font-size: 10px; color: var(--ds-muted); }
#upsellerKanbanBoard .kanban-proj-card { padding: 12px; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: 11px; }
#upsellerKanbanBoard .kanban-proj-card__name { font-size: 12px; font-weight: 650; }
#upsellerKanbanBoard .kanban-proj-card__right { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; }
#upsellerKanbanBoard .kanban-proj-card__n { font-size: 22px; color: var(--ds-text); }
#upsellerArchivedWrap { margin-top: 20px; border-radius: 10px; }
#upsellerArchivedWrap .kanban-archived__summary { min-height: 44px; padding: 12px; font-size: 12px; }
@media (max-width: 1199px) {
  .production-toolbar, .production-toolbar:not(:has(#upsellerKbProjHorizon:not([hidden]))) { grid-template-columns: minmax(0, 1fr) 150px; gap: 10px 14px; }
  .production-toolbar__priorities { grid-column: 1 / -1; }
  .production-toolbar__priorities > .production-toolbar__label { display: none; }
  #productionPriorityFilter .production-priority { min-height: 44px; flex: 1 0 auto; justify-content: center; }
  #productionClearFilters { min-height: 44px; }
  #upsellerTabProduction[data-stage="progress"] .production-toolbar, #upsellerTabProduction[data-stage="done"] .production-toolbar,
  #upsellerTabProduction[data-stage="progress"] .production-filter-result, #upsellerTabProduction[data-stage="done"] .production-filter-result { display: none; }
  #productionStageNav { display: flex; gap: 4px; padding: 4px; background: var(--ds-inset); border: 1px solid var(--ds-border); border-radius: 10px; margin: 0 0 16px; }
  #productionStageNav button { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--ds-muted); font-size: 12px; border-radius: 7px; }
  #productionStageNav button span { color: inherit; font-size: 10px; font-weight: 650; }
  #productionStageNav button[aria-pressed="true"] { background: var(--ds-soft); color: var(--ds-accent); }
  #upsellerKanbanBoard { grid-template-columns: minmax(0, 1fr) !important; }
  #upsellerKanbanBoard .kanban-column__header { display: none !important; }
  #upsellerKanbanBoard[data-stage="todo"] .kanban-column:not(.kanban-column--todo), #upsellerKanbanBoard[data-stage="progress"] .kanban-column:not(.kanban-column--progress), #upsellerKanbanBoard[data-stage="done"] .kanban-column:not(.kanban-column--done) { display: none !important; }
  #upsellerKanbanBoard .kanban-card__move-btn, #upsellerKanbanBoard .kanban-card__archive-btn, #upsellerKanbanBoard .kanban-proj-card__btn { min-height: 44px; height: 44px; }
  #upsellerKanbanBoard .kanban-card__archive-btn { width: 44px; flex-basis: 44px; }
  #upsellerKbColorFilter .kanban-color-chip, #productionHorizon.input { min-height: 44px !important; height: 44px; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  #upsellerKanbanBoard .kanban-column__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  #upsellerKanbanBoard .kanban-proj-divider { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .production-toolbar, .production-toolbar:not(:has(#upsellerKbProjHorizon:not([hidden]))) { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; margin-bottom: 4px; }
  .production-toolbar__colors { grid-column: 1 / -1; }
  #productionPriorityFilter .production-priority { padding-inline: 8px; font-size: 11px; gap: 5px; }
  #upsellerKbColorFilter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  #upsellerKbColorFilter .kanban-color-chip { flex: 0 0 auto; padding-inline: 9px; }
  #upsellerKbProjHorizon:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; grid-column: 1 / -1; gap: 12px; padding-top: 10px; border-top: 1px solid var(--ds-border); }
  #upsellerKbProjHorizon .kanban-proj-horizon__label { margin: 0; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
  #productionHorizon.input { width: 100%; font-size: 16px; }
  #upsellerKanbanBoard .kanban-card { padding: 14px !important; }
  #upsellerKanbanBoard .kanban-column__header { margin-bottom: 10px; }
}
body[data-view="upseller"][data-upseller-tab="production"] .upseller__header { justify-content: space-between !important; text-align: left; }
body[data-view="upseller"][data-upseller-tab="production"] .upseller__title-block { text-align: left; }

/* Prioritize uncovered orders; keep replenishment visibly separate. */
.production-plan { grid-column:1/-1; width:100%; min-width:0; }
.production-plan__focus { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px; background:#70adc80d; border-radius:10px; }
.production-plan__focus > span { font-size:13px; font-weight:600; line-height:1.4; }
.production-plan__focus > strong { font-size:30px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.production-plan__focus small { font-size:12px; font-weight:400; }
.production-plan__focus.is-urgent { background:#ff897512; color:#ff9987; }
.production-plan__breakdown { display:flex; flex-wrap:wrap; gap:8px 18px; padding:14px 0 8px; font-size:12px; color:var(--ds-muted); }
.production-plan__breakdown b { color:var(--ds-text); }
.production-plan__total { margin:0; font-size:11px; line-height:1.6; color:var(--ds-muted); }
.production-stock-details { grid-column:1/-1; width:100%; }
.production-stock-details > summary { cursor:pointer; min-height:40px; padding:10px 0; color:var(--ds-muted); font-size:12px; }
.production-stock-details .production-card__facts { margin:0; }
.kanban-card[data-status="todo"] .kanban-card__actions { margin-top:8px; gap:10px; }
@media(max-width:480px) { .production-plan__focus { padding:12px; gap:10px; } .production-plan__focus > strong { font-size:28px; } }

.kanban-card .flow-loss-action { grid-column:1/-1; justify-self:start; width:auto; min-width:140px; white-space:nowrap; padding-inline:14px; }

#productionMoreFilters { display:none; }
@media(max-width:767px) {
 #productionStageNav { margin-bottom:10px; }
 .production-toolbar { padding:8px !important; gap:4px !important; }
 #productionMoreFilters { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:44px; border:0; background:transparent; color:var(--ds-muted); padding:8px; font-size:12px; text-align:left; }
 .production-toolbar:not(.is-expanded) .production-toolbar__colors,
 .production-toolbar:not(.is-expanded) #upsellerKbProjHorizon { display:none !important; }
 .production-toolbar.is-expanded .production-toolbar__colors { padding:6px 4px; }
 .production-filter-result { margin-block:8px !important; }
 .production-queue-group { margin-top:12px !important; }
 .production-queue-group > p { font-size:12px; margin-top:4px; }
 #upsellerKanbanBoard .kanban-card[data-status="todo"] { gap:10px !important; }
 .kanban-card[data-status="todo"] .production-card__priority:not([data-priority="orders"]) { display:none; }
 .production-plan__focus { padding:12px; }
 .production-plan__breakdown { display:grid; grid-template-columns:1fr; gap:5px; padding-block:10px 6px; }
 .production-plan__breakdown span { display:flex; align-items:baseline; gap:6px; }
 .production-plan__breakdown b { min-width:22px; font-variant-numeric:tabular-nums; }
 .production-plan__total { font-size:10px; }
 .kanban-card[data-status="todo"] .kanban-card__actions { margin-top:0; }
 body[data-view="upseller"][data-upseller-tab="production"] #upsellerSyncStatus { font-size:10px !important; margin-block:4px 10px !important; }
 body[data-view="upseller"][data-upseller-tab="production"] .upseller__subtitle { font-size:11px !important; line-height:1.4; }
}
@media(max-width:767px) {
 #upsellerKanbanBoard .kanban-card[data-status="todo"] .production-card__priority:not([data-priority="orders"]) { display:none !important; }
}

@media(min-width:1200px) { #upsellerKanbanBoard { grid-template-columns:minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,.85fr); } }
#upsellerKanbanBoard .kanban-card[data-status="todo"] .production-card__priority[data-priority="overdue"] { display:none !important; }
.production-completed-at { display:block; color:var(--ds-muted); font-size:10px; line-height:1.5; margin-top:6px; }
.production-action-menu { position:relative; flex:0 0 44px; }
.production-action-menu summary { display:grid; place-items:center; width:44px; height:44px; list-style:none; cursor:pointer; border:1px solid var(--ds-border); border-radius:8px; font-size:22px; }
.production-action-menu summary::-webkit-details-marker { display:none; }
.production-action-menu > div { position:absolute; right:0; bottom:calc(100% + 8px); z-index:20; display:grid; gap:8px; padding:10px; min-width:170px; background:var(--ds-surface); border:1px solid var(--ds-border); border-radius:10px; box-shadow:0 8px 24px #0006; }
#upsellerKanbanBoard .production-action-menu > div > button { width:100%; min-width:0; min-height:44px; margin:0; padding:10px 12px; white-space:nowrap; font-size:12px; text-align:left; }

/* Consistent board geometry across the three stages. */
@media(min-width:1200px) {
 #upsellerKanbanBoard { grid-template-columns:repeat(3,minmax(0,1fr)); }
 #upsellerKanbanBoard .kanban-card { min-height:310px; box-sizing:border-box; align-content:start; grid-template-rows:minmax(56px,auto) auto; position:relative; }
 #upsellerKanbanBoard .kanban-card__info { min-height:56px; display:flex; flex-direction:column; justify-content:center; }
 #upsellerKanbanBoard .kanban-card__actions { align-self:end; margin-top:auto; }
 #upsellerKanbanBoard .kanban-card:not([data-status="done"]) { display:flex !important; flex-direction:column; align-items:stretch; }
 #upsellerKanbanBoard .kanban-card:not([data-status="done"]) > .kanban-card__img { position:absolute; left:14px; top:14px; }
 #upsellerKanbanBoard .kanban-card:not([data-status="done"]) > .kanban-card__info { padding-left:50px; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] { align-content:start; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__qty-produced { grid-column:1/-1; grid-row:auto; justify-self:stretch; display:flex; align-items:center; justify-content:space-between; background:#82b7cf0c; border-radius:10px; padding:14px 16px; margin-top:8px; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__qty-produced strong { font-size:30px; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__stock { grid-column:1/-1; grid-row:auto; margin-top:12px; }
 .production-plan__breakdown { gap:5px 12px; padding-top:8px; }
 .production-plan__total { margin-top:2px; }
}
#upsellerKanbanBoard .production-action-menu > div { padding:8px; gap:4px; min-width:180px; }
#upsellerKanbanBoard .production-action-menu > div > button { display:flex; align-items:center; justify-content:flex-start; min-height:44px; border:0 !important; border-radius:6px; background:transparent !important; color:var(--ds-text) !important; font-size:12px !important; font-weight:500; box-shadow:none; }
#upsellerKanbanBoard .production-action-menu > div > button:hover { background:var(--ds-elevated) !important; }
@media(min-width:1200px) {
 #upsellerKanbanBoard .production-queue-group { display:none; }
 #upsellerKanbanBoard .kanban-card { min-height:360px; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] { display:flex !important; flex-direction:column; align-items:stretch; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] > .kanban-card__img { position:absolute; left:14px; top:14px; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] > .kanban-card__info { padding-left:50px; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__qty-produced { display:flex !important; flex-direction:row !important; justify-content:space-between; align-items:center; width:100%; text-align:left; box-sizing:border-box; }
}
@media(min-width:1200px) {
 #upsellerKanbanBoard .kanban-card { justify-content:flex-start !important; gap:10px !important; }
 #upsellerKanbanBoard .kanban-card > .kanban-card__info { flex:0 0 auto !important; margin:0 !important; width:auto; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__stock { margin-top:0; }
}
/* Cards share spacing, not artificial height. Completed lots use compact rows. */
@media(min-width:1200px) {
 #upsellerKanbanBoard .kanban-card { min-height:0; height:auto; }
 #upsellerKanbanBoard .kanban-card:not([data-status="done"]) > .kanban-card__info { min-height:44px; }
 #upsellerKanbanBoard .kanban-card__actions { margin-top:4px; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] { display:grid !important; grid-template-columns:36px minmax(0,1fr) auto; grid-template-rows:auto auto; gap:6px 10px !important; padding:14px !important; align-items:start; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] > .kanban-card__img { position:static; grid-column:1; grid-row:1; width:36px !important; height:36px !important; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] > .kanban-card__info { grid-column:2; grid-row:1; padding:0; min-height:0; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__qty-produced { grid-column:3; grid-row:1; display:flex !important; flex-direction:column !important; gap:2px; margin:0; padding:0; background:transparent; width:auto; align-items:flex-end; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__qty-produced strong { font-size:22px; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__qty-produced small { font-size:10px; }
 #upsellerKanbanBoard .kanban-card[data-status="done"] .kanban-card__stock { grid-column:2/-1; grid-row:2; margin:0; font-size:11px; }
}
#upsellerKanbanBoard .production-plan__focus { padding:12px 14px; }
#upsellerKanbanBoard .production-plan__focus > strong { font-size:26px; }

#upsellerKanbanBoard .production-plan__replenishment { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px 0; color:var(--muted); font-size:13px; }
#upsellerKanbanBoard .production-plan__replenishment strong { color:var(--text); font-size:16px; white-space:nowrap; }
#upsellerKanbanBoard .production-plan__replenishment small { font-size:12px; font-weight:400; color:var(--muted); }

#upsellerKanbanBoard .production-card__order-summary { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; margin-top:7px; font-size:12px; line-height:1.5; color:var(--muted); }
#upsellerKanbanBoard .production-card__order-summary strong { color:var(--text); font-weight:600; }

#upsellerKanbanBoard .production-stock-details .production-card__facts { grid-template-columns:repeat(2,minmax(0,1fr)); }

#upsellerKanbanBoard .production-action-menu > div > button,
#upsellerKanbanBoard .production-action-menu > div > button.btn {
 display:flex !important; align-items:center; justify-content:flex-start !important;
 width:100% !important; height:44px !important; min-height:44px !important;
 margin:0 !important; padding:10px 12px !important; border:0 !important;
 border-radius:6px !important; background:transparent !important; box-shadow:none !important;
 text-align:left !important; font-size:13px !important; font-weight:500 !important; line-height:20px !important;
}
#upsellerKanbanBoard .production-action-menu > div > button:hover,
#upsellerKanbanBoard .production-action-menu > div > button:focus-visible { background:#263541 !important; }

/* Focused production workspace: one stage, compact work items, details on demand. */
.production-guide { color:var(--muted); font-size:13px; margin:0 0 14px; }
#productionStageNav { display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0 0 20px; padding:6px; border:1px solid var(--ds-border); border-radius:16px; background:#18232599; backdrop-filter:blur(18px); }
#productionStageNav button { display:flex; align-items:center; justify-content:center; gap:12px; min-height:64px; border:0; border-radius:11px; background:transparent; color:var(--muted); font-size:15px; font-weight:600; }
#productionStageNav button span { font-size:20px; font-variant-numeric:tabular-nums; }
#productionStageNav button[aria-pressed="true"] { background:#0098db20; color:var(--text); box-shadow:inset 0 0 0 1px #0098db55; }
#upsellerKanbanBoard { display:block !important; }
#upsellerKanbanBoard[data-stage="todo"] .kanban-column:not(.kanban-column--todo),
#upsellerKanbanBoard[data-stage="progress"] .kanban-column:not(.kanban-column--progress),
#upsellerKanbanBoard[data-stage="done"] .kanban-column:not(.kanban-column--done) { display:none !important; }
#upsellerTabProduction[data-stage="progress"] .production-toolbar, #upsellerTabProduction[data-stage="done"] .production-toolbar,
#upsellerTabProduction[data-stage="progress"] .production-filter-result, #upsellerTabProduction[data-stage="done"] .production-filter-result { display:none !important; }
#upsellerKanbanBoard .kanban-column__header { border:0; padding:0 0 12px; }
#upsellerKanbanBoard .kanban-column__body { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; align-items:start; }
#upsellerKanbanBoard .production-queue-group, #upsellerKanbanBoard .kanban-proj-divider { display:none; }
.production-item { min-width:0; }
.production-tile { display:flex; align-items:center; gap:14px; width:100%; min-height:118px; padding:18px; text-align:left; color:var(--text); background:linear-gradient(125deg,#182323bb,#101a1dcc); border:1px solid var(--ds-border); border-radius:16px; cursor:pointer; }
.production-tile:hover { border-color:#0098db7a; background:#1c2a30cc; }
.production-tile:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.production-tile img,.production-tile__placeholder { width:48px; height:48px; object-fit:cover; border-radius:12px; flex-shrink:0; }
.production-tile__placeholder { display:grid; place-items:center; background:#ffffff08; }
.production-tile__main { display:grid; gap:7px; min-width:0; flex:1; }
.production-tile__main > strong { font-size:14px; line-height:1.45; overflow-wrap:anywhere; }
.production-tile small { font-size:11px; color:var(--muted); line-height:1.4; }
.production-tile__main > small:not(.production-tile__note) { color:#8bc1d9; }
.production-tile__quantity { display:grid; text-align:right; gap:3px; flex-shrink:0; }
.production-tile__quantity > strong { font-size:28px; line-height:1; font-variant-numeric:tabular-nums; }
.production-tile__open { color:var(--muted); font-size:24px; }
#productionDetailDialog .kanban-card,#productionDetailDialog .kanban-proj-card { display:flex; flex-direction:column; gap:18px; border:0; padding:0; background:transparent; }
#productionDetailDialog .kanban-card__img,#productionDetailDialog .kanban-proj-card__img { width:80px; height:80px; border-radius:14px; object-fit:cover; }
#productionDetailDialog .kanban-card__name,#productionDetailDialog .kanban-proj-card__name { font-size:21px; line-height:1.4; }
#productionDetailDialog .production-card__priority { display:block !important; margin-top:8px; }
#productionDetailDialog .production-card__facts { display:flex; gap:32px; }
#productionDetailDialog .kanban-card__actions { display:flex; gap:10px; }
#productionDetailDialog .kanban-card__move-btn,#productionDetailDialog .kanban-proj-card__btn { min-height:48px; flex:1; border-radius:10px; }
#productionDetailDialog .production-plan__replenishment { display:flex; justify-content:space-between; padding:12px 14px; }
#productionDetailDialog .kanban-card__qty-produced { font-size:26px; }
@media(max-width:1300px) { #upsellerKanbanBoard .kanban-column__body { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:700px) {
 #upsellerKanbanBoard .kanban-column__body { grid-template-columns:1fr; }
 #productionStageNav { gap:3px; padding:4px; }
 #productionStageNav button { flex-direction:column; gap:4px; font-size:12px; min-height:64px; }
 .production-tile { padding:14px; min-height:104px; gap:10px; }
 .production-tile__quantity > strong { font-size:25px; }
}
.production-tile[data-urgent="true"] { border-left:3px solid #e99379; }
.production-tile[data-urgent="true"] .production-tile__main > small:not(.production-tile__note) { color:#f2a58c; }
#productionDetailDialog { height:auto !important; min-height:0 !important; max-height:90dvh !important; }
#productionDetailDialog .dialog__content { flex:0 1 auto !important; }
#productionDetailDialog .kanban-card,#productionDetailDialog .kanban-proj-card { display:flex !important; align-items:stretch !important; min-height:0 !important; border:0 !important; padding:0 !important; background:transparent !important; box-shadow:none !important; }
#productionDetailDialog .kanban-card__info { text-align:left !important; width:100% !important; padding:0 !important; }
#productionDetailDialog .kanban-card__name { font-size:21px !important; }
#productionDetailDialog .production-card__order-summary { display:flex; gap:12px; margin-top:10px; color:var(--muted); }
#productionDetailDialog .kanban-card__actions { width:100% !important; justify-content:stretch !important; }
#productionDetailDialog .kanban-card__move-btn { width:auto !important; flex:1 !important; font-size:14px !important; }
#productionDetailDialog .production-stock-details > summary { display:none; }
#productionDetailDialog .production-plan__total { font-size:13px; margin-bottom:12px; }
#productionDetailDialog .production-card__facts { font-size:14px; margin:0; }
#productionDetailDialog[open] { height:fit-content !important; block-size:fit-content !important; inset:0 !important; margin:auto !important; }

/* Desktop Kanban keeps the complete flow visible; small screens focus one stage. */
#productionStageNav { grid-template-columns:repeat(4,minmax(0,1fr)); }
#upsellerKanbanBoard .kanban-column__body { grid-template-columns:1fr; }
#upsellerKanbanBoard .kanban-column--review .kanban-column__dot { background:#e9be78; }
#productionBatchForm { display:grid; gap:18px; }
#productionBatchForm label { display:grid; gap:8px; }
#productionBatchForm [data-error] { color:#f2a58c; }
#productionBatchForm p { color:var(--muted); font-size:13px; line-height:1.6; margin:0; }
#upsellerKanbanBoard .production-tile { gap:10px; padding:14px; min-height:112px; }
#upsellerKanbanBoard .production-tile img,#upsellerKanbanBoard .production-tile__placeholder { width:40px; height:40px; }
#upsellerKanbanBoard .production-tile__quantity > strong { font-size:25px; }
#upsellerKanbanBoard .production-tile__main > strong { font-size:13px; }
@media(min-width:1200px) {
 #upsellerTabProduction #upsellerKanbanBoard { display:grid !important; grid-template-columns:repeat(4,minmax(240px,1fr)); gap:16px; align-items:start; overflow-x:auto; padding-bottom:12px; }
 #upsellerTabProduction #upsellerKanbanBoard[data-stage] > .kanban-column { display:flex !important; flex-direction:column; min-width:0; padding:12px; border:1px solid var(--ds-border); border-radius:16px; background:#13202455; }
 #upsellerTabProduction #upsellerKanbanBoard .kanban-column__body { display:grid !important; grid-template-columns:1fr; gap:10px; max-height:68vh; overflow-y:auto; overflow-x:hidden; padding:2px; }
 #upsellerTabProduction #upsellerKanbanBoard .kanban-column__header { min-height:40px; padding:0 2px 12px; }
 #upsellerTabProduction #upsellerKanbanBoard .kanban-column__header h3 { font-size:14px; }
 #upsellerTabProduction[data-stage] .production-toolbar { display:flex !important; }
 #upsellerTabProduction[data-stage] .production-filter-result { display:flex !important; }
 #productionStageNav button { min-height:54px; }
 #upsellerKanbanBoard .kanban-column__empty { font-size:12px; padding:18px 12px; line-height:1.6; }
}
@media(max-width:1199px) {
 #upsellerKanbanBoard[data-stage="review"] .kanban-column:not(.kanban-column--review) { display:none !important; }
 #upsellerKanbanBoard[data-stage="review"] .kanban-column--review { display:block !important; }
 #upsellerTabProduction[data-stage="review"] .production-toolbar,#upsellerTabProduction[data-stage="review"] .production-filter-result { display:none !important; }
 #productionStageNav button { flex-direction:column; font-size:12px; gap:5px; }
}

/* Visible destinations and stage navigation on desktop. */
#upsellerKanbanBoard .production-item[draggable="true"] { cursor:grab; }
#upsellerKanbanBoard .production-item.dragging { opacity:.45; }
#upsellerKanbanBoard .kanban-column { scroll-margin-top:100px; }
#upsellerKanbanBoard .kanban-column.drag-over,
#upsellerKanbanBoard .kanban-column.is-focused { outline:2px solid var(--accent, #0098db); outline-offset:4px; border-radius:16px; background:rgba(0,152,219,.045); }

.production-drop-gap { box-sizing:border-box; min-height:90px; border:2px dashed #0098db; border-radius:18px; background:rgba(0,152,219,.1); display:grid; place-items:center; color:#83c3df; font-size:13px; pointer-events:none; }
#upsellerKanbanBoard:has(.production-item.dragging) .kanban-column__body { min-height:140px; }

.production-tools {display:flex;gap:8px;flex-wrap:wrap;margin:12px 0;}
.production-history-row {padding:16px 0;border-bottom:1px solid rgba(200,220,220,.15);}

#productSourceDialog.production-utility-dialog[open] {height:fit-content!important;block-size:fit-content!important;max-height:85vh!important;inset:0!important;margin:auto!important;}
#productSourceDialog.production-utility-dialog .dialog__content {max-height:65vh;overflow:auto;}

/* Pedidos que aguardam produção têm prioridade visual sobre reposição. */
.production-tile[data-urgent="true"] {
  border: 1px solid rgba(233,147,121,.24);
  border-left: 1px solid rgba(233,147,121,.24);
  background: linear-gradient(110deg,rgba(187,71,45,.20),rgba(187,71,45,.06));
}
.production-tile[data-urgent="true"] .production-tile__main > small:not(.production-tile__note) {
  color: #ffb29c; font-weight: 700;
}
.production-tile[data-urgent="true"] .production-tile__quantity > strong { color: #ffd0c2; }
