/* Wynik firmy — lighter, data-first variant of the Magazyn style.
   Thin rules, white panels, ink numbers; brand colour only in micro icons
   and in the few marks that carry meaning. */

.board {
  --board-ink: #0a0a0a;
  --board-muted: #65665f;
  --board-rule: #e8e9e0;
  --board-rule-strong: #d9d7c8;
  --board-good: #2f6b1f;
  --board-bad: #b3330e;
  --board-positive: #3fb2ab;
  --board-negative: #ff3d00;
  --board-current: #1f7f79;
  --board-revenue: #3fb2ab;
  --board-costs: #b184ff;
  display: grid;
  gap: 16px;
  font-variant-numeric: tabular-nums;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--board-rule);
}
.board-head h2 { margin: 4px 0 4px; font-size: 22px; font-weight: 600; }
.board-head p { margin: 0; color: var(--board-muted); font-size: 11px; }

.board-icon { flex: 0 0 auto; width: 20px; height: 20px; }

.board-alerts { display: grid; gap: 6px; }
.board-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--board-rule);
  border-left-width: 3px;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  line-height: 1.4;
}
.board-alert.calm { border-left-color: #9dcb5a; color: var(--board-muted); }
.board-alert.warning { border-left-color: #fdc61e; background: #fffbea; }
.board-alert.critical { border-left-color: var(--board-negative); background: #fff4f0; }

.board-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.board-kpi {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--board-rule);
  border-radius: 10px;
  background: #fff;
}
.board-kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  color: var(--board-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .02em;
}
.board-kpi-value {
  margin: 2px 0 4px;
  color: var(--board-ink);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}
.board-kpi-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px dashed var(--board-rule);
  color: var(--board-muted);
  font-size: 10.5px;
}
.board-kpi-line strong { color: var(--board-ink); font-weight: 600; white-space: nowrap; }

.board .good { color: var(--board-good); }
.board .bad { color: var(--board-bad); }
.board .neutral { color: var(--board-muted); }

.board-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.board-panel {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--board-rule);
  border-radius: 10px;
  background: #fff;
}
.board-panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 10px;
}
.board-panel-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.board-panel-head p { margin: 0; color: var(--board-muted); font-size: 10.5px; }

.board-chart { width: 100%; }
.board-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.board-grid { stroke: var(--board-rule); stroke-width: 1; }
.board-axis-zero { stroke: var(--board-rule-strong); stroke-width: 1.2; }
.board-tick { fill: var(--board-muted); font-size: 10px; font-family: inherit; }
.board-bar.positive { fill: var(--board-positive); }
.board-bar.negative { fill: var(--board-negative); }
.board-bar.current { fill: var(--board-current); }
.board-hit { fill: transparent; cursor: crosshair; }
.board-hit:hover { fill: rgba(10, 10, 10, .04); }
.board-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.board-line.revenue { stroke: var(--board-revenue); }
.board-line.costs { stroke: var(--board-costs); stroke-dasharray: 5 4; }

.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  color: var(--board-muted);
  font-size: 10.5px;
}
.board-legend span { display: inline-flex; align-items: center; gap: 6px; }
.board-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.board-legend .swatch.positive { background: var(--board-positive); }
.board-legend .swatch.negative { background: var(--board-negative); }
.board-legend .swatch.current { background: var(--board-current); }
.board-legend .swatch.line { width: 16px; height: 0; border-radius: 0; border-top: 2px solid; }
.board-legend .swatch.line.revenue { border-color: var(--board-revenue); }
.board-legend .swatch.line.costs { border-color: var(--board-costs); border-top-style: dashed; }

.board-tooltip {
  position: fixed;
  z-index: 50;
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--line, #e8e9e0);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(10, 10, 10, .08);
  font-size: 11px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.board-tooltip-title { margin-bottom: 4px; font-weight: 600; }
.board-tooltip-row { display: flex; justify-content: space-between; gap: 14px; color: #65665f; }
.board-tooltip-row strong { color: #0a0a0a; font-weight: 600; }

.board-table-wrap { overflow-x: auto; }
.board-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.board-table th,
.board-table td { padding: 8px 10px; border-bottom: 1px solid var(--board-rule); text-align: left; white-space: nowrap; }
.board-table thead th {
  border-bottom-color: var(--board-rule-strong);
  color: var(--board-muted);
  font-size: 10px;
  font-weight: 500;
}
.board-table tbody th { font-weight: 500; }
.board-table tbody tr:last-child > * { border-bottom: 0; }
.board-table .num { text-align: right; }
.board-table thead th:not(:first-child) { text-align: right; }
.board-table thead th.left,
.board-table td.empty { text-align: left; }
.board-table td.empty { color: var(--board-muted); }

.board-share { min-width: 240px; }
.board-share-bars { display: inline-grid; gap: 2px; width: 90px; margin-right: 10px; vertical-align: middle; }
.board-share-now,
.board-share-before { display: block; height: 4px; border-radius: 2px; }
.board-share-now { background: var(--board-ink); }
.board-share-before { background: var(--board-rule-strong); }
.board-share-text { color: var(--board-muted); font-size: 10.5px; }

.board-footnote { margin: 10px 0 0; color: var(--board-muted); font-size: 10px; line-height: 1.5; }

@media (max-width: 1100px) {
  .board-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-charts { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .board-kpis { grid-template-columns: 1fr; }
  .board-head { flex-direction: column; }
  .board-kpi-value { font-size: 21px; }
}

/* The chef assistant covers the tables here; the board view does without it. */
body[data-module="operating-result"] #asystent-produkcji,
body[data-module="sales"] #asystent-produkcji { display: none !important; }

/* Sprzedaż — shares the board style; only the controls and product cells are new. */
.sales-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; }
.sales-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.sales-tab {
  padding: 6px 12px;
  border: 1px solid var(--board-rule-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--board-ink);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.sales-tab:hover { border-color: var(--board-ink); }
.sales-tab[aria-pressed="true"] { border-color: var(--board-ink); background: var(--board-ink); color: #fff; }
.sales-month { display: inline-flex; align-items: center; gap: 8px; color: var(--board-muted); font-size: 11px; }
.sales-month select { padding: 6px 10px; border: 1px solid var(--board-rule-strong); border-radius: 8px; background: #fff; font: inherit; font-size: 11px; }
.sales-channel-table tbody tr { cursor: pointer; }
.sales-channel-table tbody tr:hover > *,
.sales-channel-table tbody tr.selected > * { background: #fffdf3; }
.sales-channel-table tbody tr.selected th { font-weight: 600; }
.board-table td.rank { width: 28px; color: var(--board-muted); }
.sales-product { display: flex; align-items: center; gap: 10px; }
.sales-thumb { flex: 0 0 auto; display: inline-flex; justify-content: center; width: 24px; height: 32px; }
.sales-thumb img { width: 24px; height: 32px; object-fit: contain; }
.sales-thumb.missing { border: 1px solid var(--board-rule); border-radius: 5px; background: #fffdf3; }
/* The button under the product table that shows every can or only the top ten. */
.sales-more { display: flex; justify-content: center; margin-top: 10px; }
.sales-more[hidden] { display: none; }
/* Sales shows five numbers: revenue, margin, units, orders and price. */
#salesKpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1300px) { #salesKpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { #salesKpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { #salesKpis { grid-template-columns: 1fr; } }

/* Months the algorithm still estimates: same hue, hatched, so they read as provisional. */
.board-bar.estimate { fill-opacity: .45; stroke: var(--board-current); stroke-width: 1.2; stroke-dasharray: 3 2; }
.board-bar.estimate.negative { stroke: var(--board-negative); }
.board-legend .swatch.estimate { background: rgba(31, 127, 121, .45); border: 1px dashed var(--board-current); }
.board-alert.estimate { align-items: flex-start; border-left-color: #fdc61e; background: #fffbea; }
.board-alert.estimate strong { font-weight: 600; }
.board .estimate-mark { color: #5e4d00; }
.board-notes { display: grid; gap: 6px; }
.board-notes-title { margin: 0; color: var(--board-muted); font-size: 10px; font-weight: 500; letter-spacing: .02em; }
.board-head-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; }
.board-table tr.total > * { border-top: 1px solid var(--board-rule-strong); font-weight: 600; }
.board-month-costs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--board-rule); }
.board-month-cost { display: grid; gap: 2px; }
.board-month-cost span { color: var(--board-muted); font-size: 10px; }
.board-month-cost strong { font-size: 12.5px; font-weight: 600; }
.board-month-cost small { color: var(--board-muted); font-size: 10px; }
.board-compare { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 4px; }
.board-compare-label { color: var(--board-muted); font-size: 10.5px; }

/* Sprzedaż — charts and quick facts. */
.board-bar.weekend { fill-opacity: .55; }
.board-legend .swatch.weekend { background: rgba(63, 178, 171, .55); }
.sales-insights ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 24px; }
.sales-insights li { position: relative; padding-left: 14px; font-size: 11.5px; line-height: 1.5; }
.sales-insights li::before { content: ''; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: #fdc61e; border: 1px solid #0a0a0a; }
.sales-weekdays { display: grid; gap: 8px; padding-top: 4px; }
.sales-weekday { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 11px; }
.sales-weekday-name { color: var(--board-muted); }
.sales-weekday-bar { display: block; height: 10px; border-radius: 3px; background: var(--board-rule); overflow: hidden; }
.sales-weekday-bar span { display: block; height: 100%; border-radius: 3px; background: var(--board-positive); }
.sales-weekday-bar span.best { background: var(--board-current); }
.sales-weekday strong { font-weight: 600; white-space: nowrap; }

/* Header tidy-up: the overview's own tools and the general notice belong to the overview only. */
body:not([data-module="overview"]) #openWidgetDrawer,
body:not([data-module="overview"]) #demoToggle,
body:not([data-module="overview"]) #dataNotice { display: none; }

/* Prognoza sprzedaży — plan a wykonanie. */
.revenue-plan-verdict { margin: 0 0 4px; padding: 10px 12px; border: 1px solid var(--board-rule); border-left-width: 3px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; }
.revenue-plan-verdict.good { border-left-color: #9dcb5a; color: var(--board-ink); }
.revenue-plan-verdict.bad { border-left-color: #fdc61e; background: #fffbea; color: var(--board-ink); }
.revenue-plan-verdict strong { font-weight: 600; }
.revenue-plan-note { margin: 0 0 12px; color: var(--board-muted); font-size: 11px; line-height: 1.5; }
.revenue-plan-progress { position: relative; height: 10px; margin-top: 14px; border-radius: 5px; background: var(--board-rule); }
.revenue-plan-progress span { display: block; height: 100%; border-radius: 5px; background: var(--board-positive); }
.revenue-plan-progress span.bad { background: #fdc61e; }
.revenue-plan-progress i { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--board-ink); }
.board-line.projection { stroke: var(--board-revenue); stroke-dasharray: 2 5; }
.board-legend .swatch.line.projection { border-color: var(--board-revenue); border-top-style: dotted; }
.revenue-plan-dot { fill: var(--board-current); stroke: #fff; stroke-width: 2; }
.revenue-plan-outlook-head { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--board-rule); }
#revenuePlan .board-chart { margin-top: 14px; }

.revenue-plan-levers { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--board-rule); border-radius: 8px; background: #fff; }
.revenue-plan-levers h4 { margin: 0 0 6px; font-size: 12px; font-weight: 800; color: var(--board-ink); }
.revenue-plan-levers ul { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.55; color: var(--board-ink); }
.revenue-plan-levers a, .revenue-forecast-why { color: var(--board-ink); font-weight: 700; text-decoration: underline; }
.revenue-forecast-why { display: inline-block; margin-top: 8px; font-size: 11.5px; }
.board-alert-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
