.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.production-panel {
  overflow: hidden;
}

.production-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.production-note {
  max-width: 680px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.yabra-stock-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  align-items: center;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.yabra-stock-note,
.yabra-stock-status {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.yabra-stock-note { margin-top: 4px; }

.yabra-stock-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.yabra-stock-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--soft);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.yabra-stock-file input {
  max-width: 155px;
  font-size: 9px;
}

.yabra-stock-form button:disabled {
  cursor: progress;
  opacity: .55;
}

.yabra-stock-status {
  grid-column: 1 / -1;
  padding-top: 3px;
}

.yabra-stock-diagnostics {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-left: 3px solid var(--yellow);
  border-radius: 7px;
  color: var(--muted);
  background: var(--yellow-soft);
  font-size: 10px;
  line-height: 1.45;
}

.yabra-stock-diagnostics strong { color: var(--text); }
.yabra-stock-diagnostics ul { margin: 6px 0 0; padding-left: 18px; }
.yabra-stock-diagnostics li + li { margin-top: 3px; }

.vikunja-stockout-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.vikunja-stockout-actions .yabra-stock-status {
  flex: 1 1 320px;
  padding-top: 0;
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: var(--soft);
  color: var(--text);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.vikunja-stockout-actions button:disabled {
  cursor: progress;
  opacity: .55;
}

.seasonality-panel {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.seasonality-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.seasonality-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.seasonality-toggle:hover,
.seasonality-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--soft);
}

.seasonality-toggle-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--soft);
  font-size: 14px;
  line-height: 1;
}

.seasonality-panel.collapsed .seasonality-note,
.seasonality-panel.collapsed .seasonality-grid,
.seasonality-panel.collapsed .seasonality-method {
  display: none;
}

.seasonality-note,
.seasonality-method {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.seasonality-note {
  margin-top: 5px;
}

.seasonality-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.seasonality-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.seasonality-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}

.seasonality-dot.low { background: var(--accent); }
.seasonality-dot.normal { background: var(--muted-2); }
.seasonality-dot.high { background: var(--yellow); }

.seasonality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.seasonality-card {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.seasonality-card.target {
  border-color: var(--yellow);
  box-shadow: inset 0 0 0 1px var(--yellow-soft);
}

.seasonality-card-head,
.seasonality-channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.seasonality-card-head {
  margin-bottom: 8px;
}

.seasonality-month {
  color: var(--text);
  font-size: 9px;
  font-weight: 850;
}

.seasonality-target {
  color: var(--yellow);
  font-size: 7px;
  font-weight: 850;
  text-transform: uppercase;
}

.seasonality-channel {
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.seasonality-factor {
  font-size: 9px;
  font-weight: 850;
}

.seasonality-factor.low { color: var(--accent); }
.seasonality-factor.normal { color: var(--muted); }
.seasonality-factor.high { color: var(--yellow); }

.seasonality-meter {
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.seasonality-meter-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--muted-2);
}

.seasonality-meter-fill.low { background: var(--accent); }
.seasonality-meter-fill.normal { background: var(--muted-2); }
.seasonality-meter-fill.high { background: var(--yellow); }

.seasonality-method {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.production-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.production-select,
.production-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-size: 10px;
  font-weight: 750;
}

.production-select select,
.production-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.production-search input {
  width: 170px;
}

.production-search input::placeholder {
  color: var(--muted-2);
  font-weight: 600;
}

.production-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 19px 0 16px;
}

.production-summary-card {
  min-height: 69px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
}

.production-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.3;
}

.production-summary-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 19px;
  letter-spacing: -.05em;
}

.production-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.production-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
  font-size: 10px;
}

.production-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--soft);
  font-size: 9px;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--line-strong);
}

.production-table th:first-child,
.production-table th:nth-child(2),
.production-table td:first-child,
.production-table td:nth-child(2) {
  text-align: left;
}

.production-table td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

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

.production-table td:nth-child(2) {
  min-width: 180px;
  max-width: 235px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.production-table .sku-cell {
  color: var(--text);
  font-weight: 800;
}

.production-table .production-number {
  color: var(--accent);
  font-weight: 850;
}

.production-table .muted-number {
  color: var(--muted-2);
}

.forecast-stock-cell {
  min-width: 126px;
  text-align: right;
}

.forecast-stock-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 650;
}

.forecast-stock-cell .forecast-transit-warning {
  color: var(--accent);
}

.forecast-progress {
  width: 100%;
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.forecast-progress-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--muted-2);
}

.forecast-progress-fill.red { background: var(--accent); }
.forecast-progress-fill.yellow { background: var(--yellow); }
.forecast-progress-fill.green { background: var(--green); }

.forecast-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--yellow);
  background: var(--yellow-soft);
  font-size: 9px;
  font-weight: 800;
}

.forecast-status.ready {
  color: var(--green);
  background: var(--green-soft);
}

.forecast-status.red {
  color: var(--accent);
  background: var(--accent-soft);
}

.forecast-status.yellow {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.forecast-status.green {
  color: var(--green);
  background: var(--green-soft);
}

.forecast-status.no_demand {
  color: var(--muted);
  background: var(--soft);
}

.forecast-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.vikunja-task-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  background: var(--soft);
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.vikunja-task-link:hover,
.vikunja-task-link:focus-visible {
  border-color: var(--accent);
  text-decoration: underline;
}

.module-view[hidden] { display: none; }
.module-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 5px 0 22px; }
.module-heading h2 { margin: 7px 0 6px; font-size: 22px; letter-spacing: -.035em; }
.module-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.module-kicker { color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.toolbar-context { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar-context[hidden] { display: none; }
.overview-widget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.overview-empty { min-height: 320px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 42px 24px; text-align: center; }
.overview-empty-mark { width: 43px; height: 43px; display: grid; place-items: center; border: 1px dashed var(--accent); border-radius: 12px; color: var(--accent); font-size: 25px; }
.overview-empty h2 { margin: 2px 0 0; font-size: 18px; letter-spacing: -.025em; }
.overview-empty p { max-width: 490px; margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.overview-widget { min-height: 170px; }
.overview-widget .panel-title { color: var(--text); font-size: 12px; letter-spacing: 0; }
.widget-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.overview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 20px; }
.overview-metrics-panel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.overview-metric { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.overview-metric-label { display: block; color: var(--muted); font-size: 9px; font-weight: 750; }
.overview-metric-value { display: block; margin-top: 8px; color: var(--text); font-size: 19px; letter-spacing: -.05em; }
.overview-metric.warning .overview-metric-value { color: var(--yellow); }
.widget-footnote { margin: 14px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.45; }
.widget-link-state { margin: 22px 0 15px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.widget-link-button { padding: 0; border: 0; color: var(--accent); background: transparent; font-size: 10px; font-weight: 850; cursor: pointer; }
.widget-link-button:hover { text-decoration: underline; }
.result-channel-panel { margin-top: 14px; }
.widget-drawer { position: fixed; z-index: 20; inset: 0; display: flex; justify-content: flex-end; background: rgba(14,20,27,.38); }
.widget-drawer[hidden] { display: none; }
.widget-drawer-panel { width: min(470px, 100%); height: 100%; overflow: auto; padding: 28px 24px; border-left: 1px solid var(--line); background: var(--panel); box-shadow: -15px 0 42px rgba(27,44,55,.14); }
.widget-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.widget-drawer-head h2 { margin: 7px 0 0; font-size: 21px; letter-spacing: -.03em; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--soft); font-size: 22px; line-height: 1; cursor: pointer; }
.widget-drawer-intro { margin: 18px 0 21px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.widget-form { display: grid; gap: 9px; }
.widget-option { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); cursor: pointer; }
.widget-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.widget-option-row { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 11px; }
.widget-option input { accent-color: var(--accent); }
.widget-option small { grid-column: 1; margin-left: 24px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.widget-option select { grid-column: 2; grid-row: 1 / span 2; min-width: 0; padding: 8px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--panel); font-size: 10px; }
.widget-drawer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

@media (max-width: 760px) {
  .module-heading { display: block; }
  .module-heading > .metric-status, .module-heading > .toolbar-button { margin-top: 15px; }
  .overview-widget-grid { grid-template-columns: 1fr; }
  .overview-metrics-panel { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .toolbar-context { display: grid; grid-template-columns: 1fr; width: 100%; }
  .toolbar-context .control { width: 100%; justify-content: space-between; }
  .overview-metrics, .overview-metrics-panel { grid-template-columns: 1fr 1fr; }
  .widget-option { grid-template-columns: 1fr; }
  .widget-option select { grid-column: 1; grid-row: auto; width: 100%; }
}

.sales-channels-panel { overflow: hidden; }
.sales-channels-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.sales-channels-note { max-width: 760px; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.sales-channel-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 19px 0 17px; }
.sales-kpi { min-height: 70px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.sales-kpi span { display: block; color: var(--muted); font-size: 9px; font-weight: 750; line-height: 1.3; }
.sales-kpi strong { display: block; margin-top: 8px; color: var(--text); font-size: 19px; letter-spacing: -.05em; }
.sales-channel-list { display: grid; gap: 10px; }
.sales-channel-row { display: grid; grid-template-columns: minmax(135px, 1fr) minmax(130px, 2.2fr) 82px 94px; gap: 12px; align-items: center; min-height: 48px; padding: 8px 0; border-top: 1px solid var(--line); }
.sales-channel-name { color: var(--text); font-size: 11px; font-weight: 800; }
.sales-channel-share { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.sales-channel-special { margin-top: 3px; color: var(--yellow); font-size: 9px; font-weight: 750; line-height: 1.25; }
.sales-channel-track { height: 9px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.sales-channel-fill { height: 100%; min-width: 2px; border-radius: inherit; background: var(--accent); }
.sales-channel-fill.cyan { background: var(--cyan); }
.sales-channel-fill.pink { background: var(--pink); }
.sales-channel-fill.green { background: var(--green); }
.sales-channel-number { color: var(--text); font-size: 11px; font-weight: 800; text-align: right; white-space: nowrap; }
.sales-channel-number span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9px; font-weight: 650; }
.sales-channel-warning { margin-top: 12px; padding: 9px 11px; border-left: 3px solid var(--yellow); border-radius: 6px; color: var(--muted); background: var(--yellow-soft); font-size: 10px; line-height: 1.4; }

@media (max-width: 700px) {
  .sales-channel-row { grid-template-columns: minmax(125px, 1fr) minmax(90px, 1.3fr) 70px; }
  .sales-channel-row .sales-channel-number:last-child { display: none; }
}

@media (max-width: 480px) {
  .sales-channel-kpis { grid-template-columns: 1fr 1fr; }
  .sales-kpi:last-child { grid-column: span 2; }
  .sales-channel-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .sales-channel-track { grid-column: span 2; grid-row: 2; }
}

@media (max-width: 900px) {
  .production-toolbar {
    display: block;
  }

  .seasonality-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .seasonality-head {
    display: block;
  }

  .seasonality-legend {
    justify-content: flex-start;
    margin-top: 10px;
  }

  .production-controls {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .production-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yabra-stock-panel {
    display: block;
  }

  .yabra-stock-form {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .seasonality-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .production-search input {
    width: 125px;
  }
}

/* Production plan: decision-first view for the kitchen and Yabra production team. */
.production-view-tabs {
  display: flex;
  gap: 4px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}

.production-view-tab {
  position: relative;
  padding: 10px 13px 12px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.production-view-tab::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 3px;
  border-radius: 4px 4px 0 0;
  background: transparent;
  content: "";
}

.production-view-tab.active,
.production-view-tab:hover,
.production-view-tab:focus-visible {
  color: var(--text);
}

.production-view-tab.active::after { background: var(--accent); }

.production-plan-pane[hidden],
.production-analysis-pane[hidden] { display: none; }

.production-cost-summary {
  margin: 18px 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.production-cost-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.production-cost-summary-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.production-cost-summary-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 10px;
  font-weight: 800;
}
.production-cost-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.production-cost-summary-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-2, #f8fafb);
}
.production-cost-summary-card span,
.production-cost-summary-card em {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.production-cost-summary-card strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 19px;
  letter-spacing: -.04em;
}
.production-cost-summary-card em {
  margin-top: 4px;
  color: var(--accent);
  font-size: 13px;
}
.production-cost-summary-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.production-brief {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: clamp(20px, 3vw, 31px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 94% 3%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 31%),
    var(--panel);
}

.production-brief::after {
  position: absolute;
  right: -40px;
  bottom: -80px;
  width: 180px;
  height: 180px;
  border: 28px solid color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.production-brief-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}

.production-brief h3 {
  max-width: 820px;
  margin: 7px 0 8px;
  color: var(--text);
  font-size: clamp(23px, 3.4vw, 39px);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.production-brief-lead {
  max-width: 780px;
  margin: 0;
  color: var(--text);
  font-size: clamp(13px, 1.6vw, 17px);
  font-weight: 730;
  line-height: 1.42;
}

.production-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 22px;
}

.production-metric {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--muted-2);
  border-radius: 10px;
  background: var(--soft);
}

.production-metric.urgent { border-top-color: var(--accent); background: var(--accent-soft); }
.production-metric.soon { border-top-color: var(--yellow); background: var(--yellow-soft); }
.production-metric.horizon { border-top-color: var(--muted-2); }
.production-metric.calm { border-top-color: var(--green); background: var(--green-soft); }

.production-metric-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  font-size: 15px;
  font-weight: 900;
}

.production-metric.urgent .production-metric-icon { color: var(--accent); }
.production-metric.soon .production-metric-icon { color: var(--yellow); }
.production-metric.calm .production-metric-icon { color: var(--green); }
.production-metric-label { display: block; color: var(--muted); font-size: 9px; font-weight: 800; line-height: 1.2; }
.production-metric strong { display: block; margin-top: 5px; color: var(--text); font-size: 18px; letter-spacing: -.05em; }
.production-metric strong small { font-size: 9px; letter-spacing: 0; }
.production-metric em { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-style: normal; font-weight: 700; }

.production-method-strip,
.production-freshness {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.production-method-strip {
  position: relative;
  z-index: 1;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.production-method-icon,
.production-incoming-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 900;
}

.production-method-strip strong { color: var(--text); }
.production-method-edit { color: var(--accent); font-weight: 800; }
.production-freshness { color: var(--muted-2); }

.production-incoming {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--yellow) 45%, var(--line));
  border-radius: 10px;
  color: var(--muted);
  background: var(--yellow-soft);
  font-size: 10px;
  line-height: 1.45;
}

.production-incoming strong,
.production-incoming span { display: block; }
.production-incoming strong { color: var(--text); font-size: 11px; }

.production-sticky-summary {
  position: sticky;
  z-index: 3;
  top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 7px 20px rgba(18, 36, 49, .06);
  font-size: 10px;
  backdrop-filter: blur(12px);
}

.production-sticky-summary strong { color: var(--accent); }

.production-plan-groups { display: grid; gap: 26px; margin-top: 21px; }
.production-group { min-width: 0; }
.production-group.collapsed .production-card-grid { display: none; }
.production-group-heading { display: block; margin-bottom: 10px; }
.production-group-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.production-group-heading-main { min-width: 0; }
.production-group-heading h3 { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--text); font-size: 18px; letter-spacing: -.035em; }
.production-group-heading h3 small { display: inline-grid; min-width: 22px; height: 22px; place-items: center; padding: 0 6px; border-radius: 999px; color: var(--muted); background: var(--soft); font-size: 10px; letter-spacing: 0; }
.production-group-heading p { max-width: 720px; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.production-group-icon { display: inline-grid; width: 23px; height: 23px; place-items: center; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 13px; font-weight: 900; }
.production-group.soon .production-group-icon { color: var(--yellow); background: var(--yellow-soft); }
.production-group.horizon .production-group-icon { color: var(--muted); background: var(--soft); }
.production-group.calm .production-group-icon { color: var(--green); background: var(--green-soft); }
.production-group.data .production-group-icon { color: var(--muted); background: var(--soft); }
.production-group-toggle { flex: 0 0 auto; order: -1; padding: 7px 12px; border: 1px solid var(--accent-soft); border-radius: 7px; color: var(--accent); background: var(--accent-soft); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.production-group-toggle:hover, .production-group-toggle:focus-visible { border-color: var(--accent); color: var(--accent); }

.production-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.production-action-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-top: 4px solid var(--muted-2); border-radius: 12px; background: var(--panel); box-shadow: 0 3px 12px rgba(18, 36, 49, .035); }
.production-action-card.urgent { border-top-color: var(--accent); }
.production-action-card.soon { border-top-color: var(--yellow); }
.production-action-card.horizon { border-top-color: var(--muted-2); }
.production-action-card.calm { border-top-color: var(--green); }
.production-action-card.data { border-top-color: var(--muted); }
.production-card-header { display: grid; grid-template-columns: 45px minmax(0, 1fr); gap: 11px; align-items: center; }
.production-can-art { position: relative; width: 43px; height: 57px; overflow: hidden; border-radius: 10px; background: var(--soft); }
.production-can-art svg, .production-can-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.production-can-art img { position: absolute; inset: 0; box-sizing: border-box; padding: 3px; background: #fff; }
.production-card-identity h4 { margin: 0; color: var(--text); font-size: 15px; line-height: 1.15; letter-spacing: -.03em; }
.production-card-status { display: inline-flex; margin-top: 6px; padding: 4px 7px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 9px; font-weight: 850; }
.production-card-status.soon { color: var(--yellow); background: var(--yellow-soft); }
.production-card-status.horizon { color: var(--muted); background: var(--soft); }
.production-card-status.calm { color: var(--green); background: var(--green-soft); }
.production-card-status.data { color: var(--muted); background: var(--soft); }
.production-card-stockout { margin: 13px 0 9px; color: var(--text); font-size: 14px; font-weight: 850; }
.production-action-card.urgent .production-card-stockout { color: var(--accent); }
.production-card-stock { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 10px; }
.production-card-stock strong { color: var(--text); }
.production-card-recommendation { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.production-card-recommendation strong { color: var(--text); font-size: 12px; text-align: right; }
.production-card-incoming { margin: 10px 0 0; color: var(--yellow); font-size: 10px; font-weight: 750; line-height: 1.35; }
.production-card-incoming.overdue { color: var(--accent); }
.production-card-details { margin-top: 11px; border-top: 1px solid var(--line); }
.production-card-details summary { padding-top: 10px; color: var(--accent); font-size: 10px; font-weight: 800; cursor: pointer; }
.production-card-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.production-card-detail-grid > div { display: flex; flex-direction: column; gap: 3px; padding: 7px; border-radius: 7px; background: var(--soft); }
.production-card-detail-grid span { color: var(--muted-2); font-size: 8px; }
.production-card-detail-grid strong { color: var(--text); font-size: 10px; }
.production-card-seasonality { grid-column: 1 / -1; margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.production-history-label { grid-column: 1 / -1; margin-top: 5px; color: var(--muted); font-size: 9px; }
.production-history { display: flex; grid-column: 1 / -1; align-items: flex-end; gap: 3px; height: 34px; padding: 5px 0 0; border-bottom: 1px solid var(--line); }
.production-history span { min-width: 5px; flex: 1 1 auto; border-radius: 3px 3px 0 0; background: var(--accent); opacity: .72; }
.production-card-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
.production-card-actions .button { font-size: 9px; text-decoration: none; }

@media (max-width: 900px) {
  .production-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .production-view-tabs { margin-top: 13px; }
  .production-view-tab { flex: 1 1 50%; padding-inline: 7px; font-size: 10px; }
  .production-brief { padding: 18px 15px; border-radius: 12px; }
  .production-brief h3 { font-size: 27px; }
  .production-metrics { grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 17px; }
  .production-metric { grid-template-columns: 24px minmax(0, 1fr); gap: 6px; padding: 9px; }
  .production-metric-icon { width: 22px; height: 22px; font-size: 12px; }
  .production-metric strong { font-size: 15px; }
  .production-method-strip { align-items: flex-start; }
  .production-sticky-summary { top: 3px; margin-top: 10px; font-size: 9px; }
  .production-sticky-summary span:last-child { display: none; }
  .production-group-heading { align-items: flex-start; }
  .production-group-heading p { max-width: 85%; }
  .production-card-grid { grid-template-columns: 1fr; gap: 9px; }
  .production-action-card { padding: 13px; }
  .production-card-identity h4 { font-size: 14px; }
  .production-card-stockout { margin-top: 11px; font-size: 13px; }
}

/* Czytelność widoku analitycznego: techniczne dane nie schodzą poniżej 12 px. */
.production-analysis-pane,
.production-analysis-pane .production-table,
.production-analysis-pane .production-analysis-intro,
.production-analysis-pane .production-tools-body { font-size: 12px; }
.production-analysis-pane .seasonality-note,
.production-analysis-pane .seasonality-method,
.production-analysis-pane .seasonality-legend,
.production-analysis-pane .seasonality-month,
.production-analysis-pane .seasonality-target,
.production-analysis-pane .seasonality-channel,
.production-analysis-pane .seasonality-factor,
.production-analysis-pane .production-table,
.production-analysis-pane .production-table th,
.production-analysis-pane .production-table td,
.production-analysis-pane .production-table td small,
.production-analysis-pane .forecast-status,
.production-analysis-pane .vikunja-task-link,
.production-analysis-pane .production-tools-summary-note,
.production-analysis-pane .production-tools-copy .yabra-stock-note,
.production-analysis-pane .production-tools-body,
.production-analysis-pane .production-tools-body .yabra-stock-file,
.production-analysis-pane .production-tools-body .yabra-stock-file strong,
.production-analysis-pane .production-tools-body .yabra-stock-file small,
.production-analysis-pane .production-tools-body .yabra-stock-file-name,
.production-analysis-pane .production-tools-body .button,
.production-analysis-pane .production-tools-body .yabra-stock-status,
.production-analysis-pane .production-tools-body .yabra-stock-diagnostics,
.production-analysis-pane .production-algorithm-note,
.production-analysis-pane .production-analysis-intro p,
.production-analysis-pane .production-analysis-intro .production-note { font-size: 12px; }
.production-analysis-pane .seasonality-target { letter-spacing: .03em; }
.production-analysis-pane .production-table th { padding-block: 12px; }
.production-analysis-pane .production-table td { padding-block: 13px; }
.production-analysis-pane .forecast-stock-cell small { margin-top: 6px; }
.production-order-table-note,
.production-lifecycle-table-note { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.35; white-space: normal; }
.production-lifecycle-table-note { color: var(--yellow); font-weight: 750; }
.production-order-notice { margin: 10px 0 0; padding: 9px 11px; border-left: 3px solid var(--green); border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: 12px; line-height: 1.45; font-weight: 750; }
.production-action-card.phaseout { border-top-color: var(--yellow); }
.production-group.phaseout .production-group-icon { color: var(--yellow); background: var(--yellow-soft); }
.production-card-status.phaseout { color: var(--yellow); background: var(--yellow-soft); }

.production-order-dialog { width: min(680px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; color: var(--text); background: var(--panel); box-shadow: 0 24px 80px rgba(18, 36, 49, .22); }
.production-order-dialog::backdrop { background: rgba(18, 36, 49, .32); backdrop-filter: blur(3px); }
.production-order-form { display: grid; gap: 17px; padding: 24px; }
.production-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.production-order-head h3 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.035em; }
.production-order-product { margin: 0; padding: 11px 13px; border-radius: 8px; color: var(--muted); background: var(--soft); font-size: 13px; font-weight: 750; }
.production-order-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.production-order-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.production-order-fields input { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--panel); font: inherit; font-size: 13px; }
.production-order-fields input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.production-order-note-field { grid-column: 1 / -1; }
.production-order-error { min-height: 18px; margin: 0; color: var(--accent); font-size: 12px; font-weight: 750; }
.production-order-actions { display: flex; justify-content: flex-end; gap: 9px; }
.production-order-actions .button { min-height: 40px; font-size: 12px; }

@media (max-width: 620px) {
  .production-order-form { padding: 18px; }
  .production-order-head h3 { font-size: 21px; }
  .production-order-fields { grid-template-columns: 1fr; }
  .production-order-note-field { grid-column: auto; }
  .production-order-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .production-view-tab, .production-card-actions .button { transition: none; }
}

/* Technical controls belong to the analysis view, not the decision surface. */
.production-analysis-pane {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.production-analysis-pane .seasonality-panel,
.production-analysis-pane .production-summary {
  margin-top: 0;
}

.production-analysis-intro {
  display: grid;
  grid-template-columns: minmax(190px, .55fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: start;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
}

.production-analysis-intro p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.production-analysis-live-note {
  min-width: 0;
}

.production-analysis-intro .production-note {
  max-width: none;
  margin: 0;
  padding-left: 17px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.production-tools-panel {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.production-tools-details {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
}

.production-tools-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 17px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.production-tools-details > summary::-webkit-details-marker { display: none; }
.production-tools-details > summary::after { content: "⌄"; color: var(--muted); font-size: 17px; line-height: 1; }
.production-tools-details[open] > summary { border-bottom: 1px solid var(--line); }
.production-tools-details[open] > summary::after { content: "⌃"; }
.production-tools-summary-title { font-size: 12px; font-weight: 850; }
.production-tools-summary-note { color: var(--muted); font-size: 9px; font-weight: 700; }

.production-tools-body {
  display: grid;
  gap: 13px;
  padding: 17px;
}

.production-tools-copy { max-width: 740px; }
.production-tools-copy .panel-title { font-size: 12px; }
.production-tools-copy .yabra-stock-note { margin-top: 5px; }

.production-tools-body .yabra-stock-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(120px, auto) auto;
  gap: 9px;
  align-items: center;
  justify-content: initial;
  margin: 0;
}

.production-tools-body .yabra-stock-file {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: var(--soft);
  font-size: 10px;
  cursor: pointer;
}

.production-tools-body .yabra-stock-file:hover,
.production-tools-body .yabra-stock-file:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.yabra-stock-file-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--accent);
  background: var(--panel);
  font-size: 16px;
  font-weight: 900;
}

.yabra-stock-file strong,
.yabra-stock-file small { display: block; }
.yabra-stock-file strong { font-size: 10px; }
.yabra-stock-file small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.production-tools-body .yabra-stock-file input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.yabra-stock-file-name { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.production-tools-body .button { min-height: 36px; padding: 0 12px; border-radius: 8px; font-size: 10px; white-space: nowrap; }
.production-tools-body .yabra-stock-status { grid-column: auto; padding-top: 0; }

.production-algorithm-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  padding: 11px 12px;
  border-left: 3px solid var(--muted-2);
  border-radius: 6px;
  color: var(--muted);
  background: var(--soft);
  font-size: 9px;
  line-height: 1.5;
}

.production-algorithm-note strong { color: var(--text); }
.production-tools-body .vikunja-stockout-actions { display: flex; grid-column: auto; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.production-tools-body .vikunja-stockout-actions .yabra-stock-status { flex: 1 1 auto; }

@media (max-width: 700px) {
  .production-analysis-intro { grid-template-columns: 1fr; gap: 10px; }
  .production-analysis-intro .production-note { padding-left: 0; border-top: 2px solid var(--accent); border-left: 0; padding-top: 10px; }
  .production-cost-summary-head { display: block; }
  .production-cost-summary-grid { grid-template-columns: 1fr; }
  .production-cost-summary-status { display: inline-block; margin-top: 10px; }
  .production-tools-body .yabra-stock-form { grid-template-columns: 1fr; }
  .yabra-stock-file-name { min-height: 18px; }
  .production-tools-body .button { width: 100%; }
  .production-tools-body .vikunja-stockout-actions { display: grid; gap: 8px; }
}

/* UX hierarchy: the production view is decision-first; global utilities stay quiet. */
body[data-module="production"] .topbar .toolbar {
  align-items: center;
  gap: 4px;
}

body[data-module="production"] .topbar .toolbar-button {
  height: 30px;
  padding-inline: 9px;
  border-color: transparent;
  color: var(--muted-2);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

body[data-module="production"] .topbar .toolbar-button:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel);
}

body[data-module="production"] .topbar .toolbar-button.primary {
  border-color: var(--line);
  color: var(--muted);
  background: var(--soft);
}

body[data-module="production"] .topbar .toolbar-button.primary:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel);
}

body[data-module="production"] .topbar .toolbar-button:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
  box-shadow: none;
}

/* The two production views are the module's primary navigation. */
.production-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--soft);
}

.production-view-tab,
.production-view-tab:hover,
.production-view-tab:focus-visible {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  letter-spacing: -.01em;
  text-align: center;
}

.production-view-tab {
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.production-view-tab::after { display: none; }

.production-view-tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 62%, transparent);
}

.production-view-tab.active {
  border-color: var(--line);
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(27, 44, 55, .08);
}

.production-view-tab.active::before {
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.production-view-tab:focus-visible {
  z-index: 1;
  outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 2px;
}

@media (max-width: 620px) {
  .production-view-tabs { gap: 4px; margin-top: 13px; padding: 4px; }
  .production-view-tab { min-height: 42px; padding-inline: 8px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .production-view-tab { transition: none; }
}

/* Simplified warehouse view: one calm, scannable table for the production team. */
.production-plan-pane .production-brief {
  margin-top: 18px;
  padding: clamp(18px, 2.6vw, 28px);
  background: var(--panel);
}

.production-plan-pane .production-brief h3 {
  max-width: 900px;
  font-size: clamp(24px, 3.1vw, 36px);
}

.production-plan-pane .production-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.production-plan-pane .production-metric {
  min-height: 84px;
  grid-template-columns: 33px minmax(0, 1fr);
  padding: 13px 14px;
}

.production-plan-pane .production-metric-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .04em;
}

.production-plan-pane .production-metric strong {
  font-size: 23px;
}

.production-plan-pane .production-metric em {
  font-size: 10px;
  line-height: 1.35;
}

.production-plan-pane .production-metric.horizon {
  border-top-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 7%, var(--panel));
}

.production-plan-pane .production-metric.horizon .production-metric-icon {
  color: var(--cyan);
}

.production-warehouse {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.production-warehouse-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.production-warehouse-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.production-warehouse-hint {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.production-warehouse-scroll {
  max-height: min(72vh, 790px);
  overflow: auto;
  overscroll-behavior: contain;
}

.production-warehouse-table {
  width: 100%;
  min-width: 1230px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}

.production-warehouse-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--soft);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.production-warehouse-table th:first-child,
.production-warehouse-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
}

.production-warehouse-table th:first-child {
  z-index: 6;
}

.production-warehouse-table th:not(:first-child),
.production-warehouse-table td:not(:first-child) {
  text-align: right;
}

.production-warehouse-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  vertical-align: middle;
  white-space: nowrap;
}

.production-warehouse-table tbody tr:last-child td { border-bottom: 0; }
.production-warehouse-table tbody tr:hover td { background: color-mix(in srgb, var(--soft) 62%, var(--panel)); }
.production-warehouse-table tbody tr:hover td:first-child { background: var(--soft); }

.warehouse-product-cell {
  width: 268px;
  min-width: 268px;
  max-width: 268px;
  box-shadow: 7px 0 10px -12px rgba(27, 44, 55, .36);
}

.warehouse-product-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.warehouse-product-cell .production-can-art {
  width: 34px;
  height: 45px;
  flex: 0 0 34px;
  border-radius: 8px;
}

.warehouse-product-identity {
  min-width: 0;
}

.warehouse-product-identity strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: normal;
}

.warehouse-product-identity small,
.warehouse-number small,
.warehouse-days-cell small,
.warehouse-status-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.25;
  white-space: normal;
}

.warehouse-product-identity small {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.warehouse-number {
  min-width: 80px;
  font-variant-numeric: tabular-nums;
}

.warehouse-number strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.warehouse-number.muted-number strong { color: var(--muted-2); }

.warehouse-days-cell {
  min-width: 102px;
  font-variant-numeric: tabular-nums;
}

.warehouse-days-cell strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.warehouse-days-meter {
  display: block;
  width: 76px;
  height: 7px;
  margin: 7px 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.warehouse-days-meter span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--muted-2);
}

.warehouse-days-meter.urgent span { background: var(--accent); }
.warehouse-days-meter.soon span { background: var(--yellow); }
.warehouse-days-meter.horizon span { background: var(--cyan); }
.warehouse-days-meter.calm span { background: var(--green); }
.warehouse-days-meter.phaseout span { background: var(--yellow); }

.warehouse-status-cell {
  min-width: 145px;
}

.warehouse-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.warehouse-status-badge::before {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.warehouse-status-badge.urgent { color: var(--accent); background: var(--accent-soft); }
.warehouse-status-badge.soon { color: var(--yellow); background: var(--yellow-soft); }
.warehouse-status-badge.horizon { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, var(--panel)); }
.warehouse-status-badge.calm { color: var(--green); background: var(--green-soft); }
.warehouse-status-badge.phaseout { color: var(--yellow); background: var(--yellow-soft); }

.warehouse-status-cell small {
  max-width: 150px;
  color: var(--green);
  font-weight: 750;
}

.warehouse-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.warehouse-action-button,
.warehouse-task-link,
.warehouse-lifecycle-button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--soft);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.warehouse-action-button:hover,
.warehouse-action-button:focus-visible,
.warehouse-task-link:hover,
.warehouse-task-link:focus-visible,
.warehouse-lifecycle-button:hover,
.warehouse-lifecycle-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.warehouse-task-link { color: var(--accent); }
.warehouse-lifecycle-button { color: var(--muted); }

.warehouse-empty {
  padding: 38px 18px !important;
  color: var(--muted) !important;
  text-align: center !important;
}

.production-plan-pane .production-plan-groups { display: none; }
.production-analysis-freshness { margin-top: 12px; color: var(--muted-2); font-size: 12px; line-height: 1.45; }

@media (max-width: 760px) {
  .production-plan-pane .production-metrics { grid-template-columns: 1fr; }
  .production-plan-pane .production-metric { min-height: 72px; }
  .production-warehouse-head { display: block; }
  .production-warehouse-hint { display: inline-flex; margin-top: 10px; }
  .production-warehouse-scroll { max-height: 67vh; }
  .production-warehouse-table { min-width: 1170px; }
  .warehouse-product-cell { width: 225px; min-width: 225px; max-width: 225px; }
}

@media (prefers-reduced-motion: reduce) {
  .production-warehouse-table tbody tr,
  .warehouse-action-button,
  .warehouse-task-link,
  .warehouse-lifecycle-button { transition: none; }
}

/* Warehouse-inspired production view: visual first, operational data second. */
.production-plan-pane {
  --warehouse-cream: #fbf8e9;
  --warehouse-ink: #2d2828;
  --warehouse-orange: #fa421b;
  --warehouse-pink: #ef76b9;
  --warehouse-yellow: #f7be24;
  --warehouse-cyan: #42b6bb;
  --warehouse-purple: #a97cf0;
}

.production-plan-pane .production-brief {
  position: relative;
  border: 1px solid #e5e8e3;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(27, 44, 55, .05);
}

.production-plan-pane .production-brief::before {
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 4px;
  border-radius: 0 0 6px 6px;
  background: var(--warehouse-orange);
  content: "";
}

.production-plan-pane .production-brief-kicker {
  color: var(--warehouse-orange);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .16em;
}

.production-plan-pane .production-brief h3 {
  color: var(--warehouse-ink);
  letter-spacing: -.045em;
}

.production-plan-pane .production-metrics {
  gap: 12px;
}

.production-plan-pane .production-metric {
  min-height: 96px;
  border: 1px solid #e3e5df;
  border-top: 4px solid var(--warehouse-orange);
  border-radius: 13px;
  background: #fff;
  box-shadow: none;
}

.production-plan-pane .production-metric.soon {
  border-top-color: var(--warehouse-yellow);
  background: #fffdf5;
}

.production-plan-pane .production-metric.horizon {
  border-top-color: var(--warehouse-cyan);
  background: #f5fcfb;
}

.production-plan-pane .production-metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff0eb;
  color: var(--warehouse-orange);
  font-size: 16px;
}

.production-plan-pane .production-metric.soon .production-metric-icon {
  background: #fff5d8;
  color: #a66e00;
}

.production-plan-pane .production-metric.horizon .production-metric-icon {
  background: #e6f7f6;
  color: #168b8a;
}

.production-plan-pane .production-metric strong {
  color: var(--warehouse-ink);
  font-size: 26px;
}

.production-plan-pane .production-warehouse {
  border-color: #e6e2d5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(27, 44, 55, .04);
}

.production-plan-pane .production-warehouse-head {
  padding: 21px 22px 17px;
  background: #fffdf5;
}

.production-plan-pane .production-warehouse-head .panel-title {
  color: var(--warehouse-ink);
  font-size: 20px;
  letter-spacing: -.03em;
}

.production-plan-pane .production-warehouse-head p {
  font-size: 12px;
}

.production-plan-pane .production-warehouse-hint {
  color: var(--warehouse-orange);
  background: #fff0eb;
}

.production-plan-pane .production-warehouse-table th {
  color: #756f65;
  background: #f8f2df;
  font-size: 10px;
  letter-spacing: .03em;
}

.production-plan-pane .production-warehouse-table td {
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: 12px;
}

.production-plan-pane .warehouse-product-cell .production-can-art {
  width: 48px;
  height: 59px;
  flex-basis: 48px;
  border-radius: 12px;
}

.production-plan-pane .warehouse-product-identity strong { font-size: 13px; }
.production-plan-pane .warehouse-product-identity small { font-size: 10px; }

/* Plan partii: the date stock should last to, the plan's rules, promotions and the table. */
.production-batch-pane.is-loading { opacity: .55; transition: opacity .15s; }
.production-batch-pane .batch-brief { margin-bottom: 14px; }
.batch-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 12px 0 10px; }
.batch-target { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.batch-target input { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-weight: 500; }
.batch-settings { margin: 4px 0 12px; }
.batch-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 10px 0; }
.batch-setting { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.batch-setting-input { display: inline-flex; align-items: center; gap: 6px; }
.batch-setting-input input { width: 96px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-weight: 500; }
.batch-setting-input small, .batch-setting-help { color: var(--muted); font-size: 11px; font-weight: 400; }
.batch-promotions { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf4; font-size: 12px; }
.batch-promotion-list { margin: 6px 0; padding-left: 18px; line-height: 1.6; }
.production-batch-pane .batch-table td small, .production-batch-pane .batch-table td .batch-gap { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.production-batch-pane .batch-table td .batch-gap { color: #9f2c13; white-space: normal; }
.production-batch-pane .batch-table td.batch-alert, .production-usage-check td.batch-alert { color: #9f2c13; font-weight: 600; }
.production-usage-check { margin: 0 0 18px; }
.production-usage-check > p { margin: 4px 0 10px; color: var(--muted); font-size: 12px; }
.production-usage-check .usage-table { width: 100%; min-width: 760px; font-variant-numeric: tabular-nums; border-collapse: collapse; }
.production-usage-check .usage-table th, .production-usage-check .usage-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12px; text-align: right; }
.production-usage-check .usage-table th.warehouse-product-heading, .production-usage-check .usage-table td.warehouse-product-cell { text-align: left; }
.production-usage-check .usage-total td { font-weight: 700; border-bottom: 0; }
@media (max-width: 640px) { .batch-target { width: 100%; justify-content: space-between; } }
.production-batch-pane .batch-table { table-layout: auto; min-width: 1100px; }
.production-batch-pane .batch-table th, .production-batch-pane .batch-table td { padding: 9px 10px; font-size: 13px; }
.production-batch-pane .batch-table td.warehouse-product-cell { min-width: 210px; max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.production-batch-pane .batch-table td.warehouse-product-cell strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.production-batch-pane .batch-table td.warehouse-status-cell { min-width: 150px; }
.production-batch-pane .batch-table .warehouse-status-badge { font-size: 12px; }
/* Wycofaj / Przywróć under a product's status, in the plan and the batch plan. */
.production-plan-pane .warehouse-status-cell .warehouse-lifecycle-link { display: block; min-height: 0; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.production-plan-pane .warehouse-status-cell .warehouse-lifecycle-link:hover, .production-plan-pane .warehouse-status-cell .warehouse-lifecycle-link:focus-visible { color: var(--accent); }
