:root {
  color-scheme: light;
  --bg: #f3f5f3;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --surface-teal: #edf7f4;
  --text: #1c2421;
  --muted: #66716d;
  --border: #d7dedb;
  --border-strong: #b9c5c0;
  --teal: #007c68;
  --teal-strong: #005f51;
  --teal-soft: #d9eee8;
  --gold: #b9780b;
  --gold-soft: #fff4d8;
  --blue: #1f6793;
  --blue-soft: #e9f2f8;
  --red: #b42318;
  --red-soft: #fff0ee;
  --green: #147a4b;
  --green-soft: #eaf6ef;
  --shadow: 0 8px 24px rgba(28, 36, 33, 0.06);
  --radius: 6px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Noto Sans Arabic", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.site-shell {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  padding: 12px max(24px, calc((100vw - 1760px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 12px rgba(28, 36, 33, 0.05);
  backdrop-filter: blur(12px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 48px;
  flex: 0 0 76px;
  border: 2px solid var(--text);
  border-radius: 4px;
  color: var(--text);
  background: var(--surface);
  font-size: 21px;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h1,
.access-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
}

.title-ar,
.access-ar,
.exception-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.snapshot-label,
.sample-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.button-primary,
.button-secondary,
.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 8px 14px;
  text-decoration: none;
  font-weight: 750;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 120ms ease;
}

.button-primary {
  color: #ffffff;
  background: var(--teal);
}

.button-primary:hover {
  background: var(--teal-strong);
  border-color: var(--teal-strong);
}

.button-secondary,
.button-icon {
  color: var(--teal-strong);
  background: var(--surface);
}

.button-secondary:hover,
.button-icon:hover {
  background: var(--surface-teal);
}

.button-icon {
  width: 42px;
  padding: 0;
  font-size: 22px;
}

.button-primary:active,
.button-secondary:active,
.button-icon:active {
  transform: scale(0.97);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(0, 124, 104, 0.25);
  outline-offset: 2px;
}

.section-nav {
  position: sticky;
  top: 88px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(8, minmax(150px, 1fr));
  gap: 1px;
  padding: 0 max(24px, calc((100vw - 1760px) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}

.section-nav a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 64px;
  padding: 8px 10px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  text-decoration: none;
}

.section-nav a > span {
  color: var(--teal);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.section-nav b {
  display: grid;
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.section-nav small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-nav a.is-active {
  border-bottom-color: var(--teal);
  color: var(--text);
  background: var(--surface-teal);
}

.review-section {
  scroll-margin-top: 158px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.review-section:nth-child(even) {
  background: var(--surface-soft);
}

.section-inner {
  width: min(1760px, calc(100% - 48px));
  min-height: 720px;
  margin: 0 auto;
  padding: 34px 0 42px;
}

.section-overview .section-inner {
  min-height: calc(100vh - 152px);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-index {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.section-heading h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
}

.section-heading h2 span {
  color: var(--muted);
  font-size: 19px;
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-grid.is-five {
  grid-template-columns: repeat(5, minmax(180px, 1fr));
}

.kpi-card {
  min-width: 0;
  min-height: 128px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card.is-gold {
  border-top-color: var(--gold);
}

.kpi-card.is-blue {
  border-top-color: var(--blue);
}

.kpi-card.is-red {
  border-top-color: var(--red);
}

.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 750;
}

.kpi-label small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 650;
}

.kpi-value {
  display: block;
  margin-top: 9px;
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.kpi-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.kpi-value.is-negative,
.number-negative {
  color: var(--red);
}

.kpi-value.is-positive,
.number-positive {
  color: var(--green);
}

.channel-amount {
  white-space: nowrap;
}

.channel-amount small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.overview-body,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.two-column.wide-left {
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.8fr);
}

.chart-surface,
.people-snapshot,
.score-rule,
.sample-notice,
.confirmed-results {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.chart-surface h3,
.people-snapshot h3,
.confirmed-results h3 {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

.chart-surface h3 small,
.people-snapshot h3 small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: -6px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--teal);
}

.legend-swatch.is-gold {
  background: var(--gold);
}

.legend-swatch.is-blue {
  background: var(--blue);
}

.legend-swatch.is-negative,
.metric-bar-fill.is-negative {
  background: var(--red);
}

.legend-swatch.is-target {
  width: 18px;
  height: 3px;
  border-radius: 0;
  background: var(--red);
}

.svg-chart {
  display: block;
  width: 100%;
  min-height: 260px;
  aspect-ratio: 3 / 1;
}

.svg-chart text {
  font-family: inherit;
  fill: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.people-list,
.progress-list,
.bar-list {
  display: grid;
  gap: 13px;
}

.person-line,
.progress-line {
  display: grid;
  grid-template-columns: 118px minmax(180px, 1fr) 110px;
  gap: 12px;
  align-items: center;
}

.person-name {
  font-weight: 800;
}

.person-name small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.progress-track {
  position: relative;
  height: 24px;
  overflow: hidden;
  border: 1px solid #c5ddd7;
  border-radius: 4px;
  background: #edf5f2;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  max-width: 100%;
  background: var(--teal);
}

.progress-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 8px;
  color: #ffffff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.progress-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.progress-value small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.business-conclusions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.conclusion-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 104px;
  padding: 16px;
  border-left: 4px solid var(--teal);
  background: var(--surface-soft);
}

.conclusion-item.is-gold {
  border-left-color: var(--gold);
}

.conclusion-item.is-blue {
  border-left-color: var(--blue);
}

.conclusion-number {
  color: var(--teal);
  font-size: 24px;
  line-height: 1;
  font-weight: 850;
}

.conclusion-item p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 700;
}

.conclusion-item p small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.daily-bars {
  display: grid;
  grid-template-columns: repeat(31, minmax(10px, 1fr));
  gap: 4px;
  align-items: end;
  height: 238px;
  padding-top: 12px;
  border-bottom: 1px solid var(--border-strong);
}

.daily-bar-column {
  display: grid;
  align-content: end;
  min-width: 0;
  height: 100%;
}

.daily-total {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.daily-bar {
  display: flex;
  flex-direction: column-reverse;
  min-height: 2px;
  overflow: hidden;
  border-radius: 2px 2px 0 0;
  background: #e7ecea;
}

.daily-bar span {
  display: block;
  width: 100%;
}

.daily-bar .cash {
  background: var(--teal);
}

.daily-bar .pos {
  background: var(--gold);
}

.daily-bar .transfer {
  background: var(--blue);
}

.daily-label {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  width: 100%;
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #f0f4f2;
  color: #49534f;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.data-table th small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.data-table td {
  font-weight: 650;
}

.data-table tbody tr:hover {
  background: var(--surface-teal);
}

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

.data-table .team-row td {
  background: var(--surface-soft);
  font-weight: 800;
}

.value-bridge {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.bridge-step {
  position: relative;
  min-height: 158px;
  padding: 18px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
}

.bridge-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -17px;
  z-index: 2;
  color: var(--muted);
  font-size: 22px;
  transform: translateY(-50%);
}

.bridge-step.is-na {
  border-top-color: var(--border-strong);
  background: var(--surface-soft);
}

.bridge-step h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.bridge-step h3 small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.bridge-step strong {
  display: block;
  margin-top: 18px;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.bridge-step p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-bar-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(240px, 2fr) 90px;
  gap: 12px;
  align-items: center;
}

.metric-bar-label {
  min-width: 0;
  font-size: 13px;
  font-weight: 750;
}

.metric-bar-label small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-bar-track {
  height: 18px;
  overflow: hidden;
  border-radius: 3px;
  background: #e7ecea;
}

.metric-bar-fill {
  height: 100%;
  background: var(--teal);
}

.metric-bar-fill.is-gold {
  background: var(--gold);
}

.metric-bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.sku-pair-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(260px, 2fr) 110px;
  gap: 12px;
  align-items: center;
}

.sku-pair-bars {
  display: grid;
  gap: 5px;
}

.sku-overview {
  min-width: 0;
}

.sku-chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.sku-chart-heading h3 {
  margin-bottom: 4px;
}

.sku-chart-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sku-line-tabs {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}

.sku-line-tab {
  min-height: 48px;
  padding: 6px 14px;
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}

.sku-line-tab:last-child {
  border-right: 0;
}

.sku-line-tab b,
.sku-line-tab small {
  display: block;
}

.sku-line-tab b {
  font-size: 13px;
}

.sku-line-tab small {
  margin-top: 1px;
  font-size: 10px;
}

.sku-line-tab.is-active {
  color: var(--surface);
  background: var(--teal);
}

.sku-column-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.sku-column-chart {
  display: block;
  width: 100%;
  height: 320px;
}

.sku-chart-grid,
.sku-chart-negative-grid {
  stroke: #dfe7e3;
  stroke-width: 1;
}

.sku-chart-negative-grid {
  stroke-dasharray: 3 3;
}

.sku-chart-baseline {
  stroke: #7a8781;
  stroke-width: 1.2;
}

.sku-chart-axis,
.sku-chart-label,
.sku-chart-label-ar,
.sku-chart-value {
  font-family: inherit;
}

.sku-chart-axis {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.sku-chart-column {
  rx: 2px;
}

.sku-chart-column.is-sell {
  fill: var(--teal);
}

.sku-chart-column.is-net {
  fill: var(--gold);
}

.sku-chart-value {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.sku-chart-label {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 750;
}

.sku-chart-label-ar {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.inventory-layer-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.inventory-layer-summary article {
  display: grid;
  align-content: center;
  min-height: 164px;
  padding: 16px;
  border-left: 4px solid var(--teal);
  background: var(--surface-soft);
}

.inventory-layer-summary article:nth-child(2) {
  border-left-color: var(--gold);
}

.inventory-layer-summary article:nth-child(3) {
  border-left-color: var(--blue);
}

.inventory-layer-summary strong {
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}

.inventory-layer-summary span {
  margin-top: 6px;
  font-weight: 800;
}

.inventory-layer-summary small {
  margin-top: 3px;
  color: var(--muted);
}

.inventory-tabs {
  display: flex;
  gap: 0;
  margin-top: 22px;
  border-bottom: 1px solid var(--border-strong);
}

.tab-button {
  min-width: 190px;
  min-height: 54px;
  padding: 8px 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab-button small {
  display: block;
  font-size: 11px;
  font-weight: 650;
}

.tab-button.is-active {
  border-bottom-color: var(--teal);
  color: var(--text);
  background: var(--surface-teal);
}

.inventory-panel {
  min-height: 360px;
  padding-top: 18px;
}

.inventory-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.inventory-panel-heading h3,
.inventory-panel-heading p,
.inventory-panel-heading > div {
  margin: 0;
}

.inventory-panel-heading h3 small {
  color: var(--muted);
  font-size: 13px;
}

.inventory-panel-heading p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.inventory-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.inventory-choice {
  display: grid;
  min-height: 92px;
  padding: 14px 18px;
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.inventory-choice:last-child {
  border-right: 0;
}

.inventory-choice:hover,
.inventory-choice.is-active {
  background: var(--surface-teal);
}

.inventory-choice.is-active {
  box-shadow: inset 0 -4px 0 var(--teal);
}

.inventory-choice strong {
  font-size: 17px;
}

.inventory-choice span {
  margin-top: 5px;
  font-size: 22px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.inventory-choice small {
  color: var(--muted);
  font-weight: 750;
}

.inventory-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 12px 16px;
  border-left: 4px solid var(--teal);
  background: var(--surface-soft);
}

.inventory-detail-heading > div {
  display: grid;
  gap: 2px;
}

.inventory-detail-heading span,
.inventory-detail-heading p small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inventory-detail-heading strong {
  font-size: 20px;
}

.inventory-detail-heading p {
  display: grid;
  gap: 2px;
  margin: 0;
  text-align: right;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.inventory-detail-heading.is-store {
  border-left-color: var(--blue);
}

.inventory-scope-note {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-top: 14px;
  padding: 10px 14px;
  border-left: 4px solid var(--gold);
  background: var(--gold-soft);
}

.inventory-scope-note strong {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.inventory-scope-note span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inventory-store-toolbar {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.inventory-store-toolbar label > span {
  display: grid;
  font-weight: 850;
}

.inventory-store-toolbar label small {
  color: var(--muted);
  font-size: 11px;
}

.inventory-store-picker {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
}

.inventory-store-picker select,
.inventory-step-button {
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
}

.inventory-store-picker select {
  width: 100%;
  padding: 0 12px;
  font-weight: 750;
}

.inventory-step-button {
  padding: 0;
  font-size: 26px;
  line-height: 1;
}

.inventory-step-button:hover {
  border-color: var(--teal);
  background: var(--surface-teal);
}

.inventory-sku-table {
  min-width: 760px;
}

.inventory-sku-table th:nth-child(1),
.inventory-sku-table td:nth-child(1) {
  width: 31%;
}

.inventory-sku-table th:nth-child(2),
.inventory-sku-table td:nth-child(2) {
  width: 24%;
}

.inventory-sku-table th:nth-child(n + 3),
.inventory-sku-table td:nth-child(n + 3) {
  text-align: right;
}

.inventory-product-row td {
  padding-block: 8px;
  background: #eaf1ee;
  color: var(--teal-dark);
}

.inventory-product-row td strong {
  display: inline-block;
  min-width: 84px;
  font-size: 13px;
}

.inventory-product-row td span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.inventory-sku-name {
  display: grid;
  gap: 1px;
}

.inventory-sku-name small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.no-top-margin {
  margin-top: 0;
}

.sample-notice {
  margin-top: 0;
  border-left: 4px solid var(--gold);
  background: var(--gold-soft);
  font-weight: 700;
}

.sample-notice p {
  margin: 0;
}

.score-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
}

.score-rule strong {
  font-size: 20px;
}

.score-rule p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.confirmed-results {
  margin-top: 18px;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
}

.confirmed-results ul {
  margin: 0;
  padding-left: 20px;
}

.confirmed-results li + li {
  margin-top: 8px;
}

.action-form {
  display: grid;
  grid-template-columns: 130px 170px minmax(260px, 1fr) 145px 145px minmax(220px, 0.8fr) 126px;
  gap: 10px;
  align-items: end;
  margin-top: 18px;
}

.action-form label,
.exception-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
}

.action-buttons {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.action-buttons button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--teal-strong);
  background: var(--surface);
  font-weight: 800;
}

.action-buttons button.danger {
  color: var(--red);
}

.status-chip,
.priority-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip.is-open,
.priority-chip.is-high {
  color: #8c251d;
  background: var(--red-soft);
}

.status-chip.is-closed {
  color: var(--green);
  background: var(--green-soft);
}

.status-chip.is-excluded,
.priority-chip.is-medium {
  color: #805b0a;
  background: var(--gold-soft);
}

.priority-chip.is-low {
  color: var(--blue);
  background: var(--blue-soft);
}

.host-guide {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: min(390px, calc(100vw - 40px));
  border: 1px solid #bdd5ce;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(28, 36, 33, 0.16);
  transition: transform 180ms ease, opacity 180ms ease;
}

.host-guide-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  border: 0;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--teal-strong);
  font-weight: 800;
}

.host-guide-body {
  padding: 13px 16px 15px;
}

.host-guide-body ol {
  margin: 0;
  padding-left: 20px;
}

.host-guide-body li {
  font-size: 13px;
  line-height: 1.55;
  font-weight: 650;
}

.host-guide.is-collapsed .host-guide-body {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  min-width: 240px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: #ffffff;
  background: #24312d;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: var(--shadow);
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #e9eeeb;
}

.access-card {
  width: min(460px, 100%);
  padding: 32px;
  border: 1px solid var(--border-strong);
  border-top: 5px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 52px rgba(28, 36, 33, 0.14);
}

.access-card > label {
  display: block;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.access-card > .button-primary {
  width: 100%;
  margin-top: 16px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 8px;
  margin-top: 6px;
}

.field-error {
  margin: 7px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.exception-shell .topbar {
  position: relative;
}

.exception-main {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 60px;
}

.exception-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.exception-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1.8fr) repeat(3, minmax(180px, 0.7fr));
  gap: 12px;
  margin: 24px 0 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.exception-count {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.exception-card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.exception-card.is-high {
  border-left-color: var(--red);
}

.exception-card.is-closed {
  border-left-color: var(--green);
}

.exception-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.exception-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.exception-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.exception-card-status {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.exception-description-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.exception-description-grid h3 {
  margin: 0 0 6px;
  color: var(--teal-strong);
  font-size: 13px;
}

.exception-description-grid p {
  margin: 0;
  color: #343f3b;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 620;
}

.load-more {
  width: 220px;
  margin: 24px auto 0;
}

.empty-state {
  padding: 48px 24px;
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  font-weight: 700;
}

.empty-cell {
  padding: 28px !important;
  color: var(--muted);
  text-align: center !important;
}

.fatal-error {
  width: min(900px, calc(100% - 48px));
  margin: 60px auto;
  padding: 28px;
  border-left: 5px solid var(--red);
  background: var(--surface);
}

@media (max-width: 1260px) {
  .section-nav {
    grid-template-columns: repeat(8, minmax(142px, 1fr));
  }

  .person-line,
  .progress-line {
    grid-template-columns: minmax(80px, 100px) minmax(100px, 1fr) minmax(90px, 100px);
    gap: 8px;
  }

  .metric-bar-row,
  .sku-pair-row {
    grid-template-columns: minmax(100px, 120px) minmax(110px, 1fr) minmax(70px, 80px);
    gap: 8px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .kpi-grid.is-five {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }

  .value-bridge {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .bridge-step::after {
    display: none;
  }

  .action-form {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .action-form .action-wide {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: relative;
    align-items: flex-start;
    padding: 14px 18px;
  }

  .section-nav {
    top: 0;
    padding-inline: 12px;
  }

  .brand-mark {
    display: none;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .section-inner,
  .exception-main {
    width: min(100% - 28px, 1760px);
  }

  .overview-body,
  .two-column,
  .two-column.wide-left,
  .business-conclusions,
  .exception-description-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid.is-five {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .sku-chart-heading {
    display: grid;
  }

  .sku-line-tabs {
    width: 100%;
  }

  .value-bridge,
  .exception-summary {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .exception-toolbar {
    grid-template-columns: 1fr 1fr;
  }

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

  .inventory-choice:nth-child(2) {
    border-right: 0;
  }

  .inventory-choice:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .snapshot-label {
    display: none;
  }

  .section-heading {
    display: grid;
  }

  .section-heading h2 {
    font-size: 22px;
  }

  .section-heading h2 span {
    display: block;
    margin-top: 3px;
    font-size: 15px;
  }

  .kpi-grid,
  .kpi-grid.is-five,
  .value-bridge,
  .exception-summary,
  .exception-toolbar,
  .action-form {
    grid-template-columns: 1fr;
  }

  .action-form .action-wide {
    grid-column: auto;
  }

  .sku-line-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sku-line-tab:nth-child(2) {
    border-right: 0;
  }

  .sku-line-tab:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .kpi-value {
    font-size: 28px;
  }

  .person-line,
  .progress-line,
  .metric-bar-row,
  .sku-pair-row {
    grid-template-columns: 100px minmax(130px, 1fr) 78px;
    gap: 8px;
  }

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

  .daily-bars {
    grid-template-columns: repeat(31, minmax(4px, 1fr));
    gap: 1px;
  }

  .daily-label {
    display: none;
  }

  .inventory-tabs {
    overflow-x: auto;
  }

  .tab-button {
    min-width: 160px;
  }

  .inventory-panel-heading,
  .inventory-detail-heading,
  .inventory-scope-note {
    display: grid;
  }

  .inventory-detail-heading p {
    text-align: left;
  }

  .inventory-choice-grid,
  .inventory-store-toolbar {
    grid-template-columns: 1fr;
  }

  .inventory-choice {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .inventory-choice:last-child {
    border-bottom: 0;
  }

  .exception-card-header {
    display: grid;
  }

  .exception-card-status {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .access-gate,
  .section-nav,
  .top-actions,
  .host-guide,
  .action-form,
  .action-buttons {
    display: none !important;
  }

  .topbar {
    position: relative;
    box-shadow: none;
  }

  .review-section {
    break-inside: avoid;
  }

  .section-inner {
    min-height: 0;
  }
}
