:root {
  color-scheme: light;
  --ink: #131313;
  --muted: #696866;
  --line: #ddd9cf;
  --soft-line: #ece8de;
  --surface: #ffffff;
  --surface-2: #f6f4ef;
  --dark: #080807;
  --dark-2: #1c1b18;
  --amber: #f2b42f;
  --amber-2: #d5971c;
  --amber-dark: #b77905;
  --amber-soft: #fff1cf;
  --steel: #7d7b75;
  --success: #157a47;
  --warning: #b16b08;
  --danger: #a5352f;
  --chart-receipt: #1677d2;
  --chart-open-order: #dc2626;
  --chart-purchase: #7c3aed;
  --chart-sales-expense: #008f6f;
  --chart-management-expense: #d97706;
  --chart-safety: #00a6ff;
  --chart-risk: #d9363e;
  --hub-bg: #f5f7fa;
  --hub-panel: #ffffff;
  --hub-panel-soft: #f8fafc;
  --hub-line: #cfd5df;
  --hub-node: #ffffff;
  --shadow: 0 18px 46px rgba(10, 10, 8, 0.12);
  --radius: 8px;
  font-family:
    Inter, Arial, "Noto Sans SC", "Microsoft YaHei", "PingFang SC",
    "Segoe UI", sans-serif;
}

/* Auth gateway */
.auth-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #0b1019;
  color: #f7f8fb;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: url("../assets/images/auth-factory.jpg") center / cover no-repeat;
  filter: saturate(0.82) contrast(1.02);
  transform: scale(1.01);
}

.auth-backdrop::after {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 15, 0.73);
  content: "";
}

.auth-header,
.auth-content,
.auth-footer {
  position: relative;
  z-index: 1;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 18px clamp(24px, 5vw, 72px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-header img {
  width: 176px;
  height: auto;
  display: block;
}

.auth-language {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  overflow: hidden;
}

.auth-language button {
  width: 50px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: rgba(8, 14, 24, 0.72);
  color: #d7dce5;
  font-size: 13px;
  font-weight: 800;
}

.auth-language button + button {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-language button.is-active {
  background: var(--amber);
  color: #111;
}

.auth-content {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 480px);
  align-items: center;
  gap: clamp(48px, 8vw, 128px);
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 142px);
  margin: 0 auto;
  padding: 48px 0 72px;
}

.auth-brand-copy {
  align-self: center;
  max-width: 600px;
}

.auth-brand-copy p {
  margin: 0 0 14px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 820;
  text-transform: uppercase;
}

.auth-brand-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.98;
  font-weight: 840;
  letter-spacing: 0;
}

html[lang="zh-CN"] .auth-brand-copy h1 {
  font-size: clamp(48px, 5.2vw, 68px);
  white-space: nowrap;
}

html[lang="en"] .auth-brand-copy h1 {
  font-size: clamp(42px, 4.4vw, 58px);
  white-space: nowrap;
}

.auth-brand-copy span {
  display: block;
  max-width: 520px;
  margin-top: 24px;
  color: #d0d6df;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.7;
}

.auth-panel {
  width: 100%;
  max-height: calc(100vh - 126px);
  overflow-y: auto;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 3px solid var(--amber);
  border-radius: 8px;
  background: rgba(249, 250, 252, 0.97);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.38);
  color: #171a20;
}

.auth-panel-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.auth-panel-heading.compact {
  margin-bottom: 22px;
}

.auth-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: #111723;
  color: var(--amber);
}

.auth-heading-icon svg {
  width: 22px;
  height: 22px;
}

.auth-panel-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.auth-panel-heading p {
  margin: 6px 0 0;
  color: #687181;
  font-size: 13px;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field > span {
  color: #2a303a;
  font-size: 13px;
  font-weight: 780;
}

.auth-field > small {
  color: #687181;
  font-size: 12px;
  line-height: 1.5;
}

.auth-input,
.auth-email-input {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid #cbd0d8;
  border-radius: 5px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-input:focus-within,
.auth-email-input:focus-within {
  border-color: #bd850c;
  box-shadow: 0 0 0 3px rgba(227, 167, 35, 0.16);
}

.auth-input > svg,
.auth-email-input > svg {
  width: 18px;
  height: 18px;
  margin-left: 14px;
  flex: 0 0 auto;
  color: #757d89;
}

.auth-input input,
.auth-email-input input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #15181e;
  font: inherit;
  letter-spacing: 0;
}

.auth-email-input b {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-left: 1px solid #d8dce3;
  background: #f1f3f6;
  color: #3d4653;
  font-size: 13px;
  white-space: nowrap;
}

.auth-password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  margin-right: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #687181;
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
}

.auth-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
  padding: 0 18px;
  border: 1px solid #c78c10;
  border-radius: 5px;
  background: var(--amber);
  color: #111;
  font-weight: 820;
}

.auth-primary:hover:not(:disabled) {
  background: #f7c34f;
}

.auth-primary svg {
  width: 18px;
  height: 18px;
}

.auth-switch {
  margin: 22px 0 0;
  color: #687181;
  text-align: center;
  font-size: 13px;
}

.auth-switch button,
.auth-secondary-link {
  border: 0;
  background: transparent;
  color: #9a6800;
  font-weight: 780;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.auth-steps li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #858c97;
  text-align: center;
}

.auth-steps li::before {
  position: absolute;
  top: 16px;
  right: calc(50% + 20px);
  left: calc(-50% + 20px);
  height: 1px;
  background: #d8dce3;
  content: "";
}

.auth-steps li:first-child::before {
  display: none;
}

.auth-steps li > span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #cfd4dc;
  border-radius: 50%;
  background: #f8f9fb;
}

.auth-steps svg {
  width: 15px;
  height: 15px;
}

.auth-steps small {
  font-size: 11px;
  font-weight: 720;
}

.auth-steps li.is-active,
.auth-steps li.is-complete {
  color: #835900;
}

.auth-steps li.is-active > span,
.auth-steps li.is-complete > span {
  border-color: #ce9215;
  background: #f3bd43;
  color: #111;
}

.auth-feedback {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #cfd6df;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.5;
}

.auth-feedback svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.auth-feedback.is-error {
  border-color: #e6b6b2;
  background: #fff1f0;
  color: #9c2f29;
}

.auth-feedback.is-success {
  border-color: #a9d6bb;
  background: #edf8f1;
  color: #16693d;
}

.auth-code-recipient,
.auth-verified-person {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 13px 14px;
  border-left: 3px solid var(--amber);
  background: #f0f2f5;
  color: #525b68;
  font-size: 13px;
  line-height: 1.5;
}

.auth-code-recipient > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #9a6800;
}

.auth-code-recipient span,
.auth-verified-person div {
  display: grid;
  gap: 2px;
}

.auth-code-recipient strong,
.auth-verified-person strong {
  color: #1c2129;
}

.auth-secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 14px auto 0;
}

.auth-secondary-link svg {
  width: 15px;
  height: 15px;
}

.auth-person-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #121923;
  color: var(--amber);
}

.auth-person-icon svg {
  width: 19px;
  height: 19px;
}

.auth-verified-person small,
.auth-verified-person span {
  color: #687181;
}

.auth-footer {
  position: absolute;
  right: clamp(24px, 5vw, 72px);
  bottom: 22px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  text-transform: uppercase;
}

.auth-checking {
  display: grid;
  place-items: center;
}

.auth-checking-mark {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 18px;
  color: #d9dee7;
}

.auth-checking-mark img {
  width: 190px;
}

.auth-checking-mark p {
  margin: 0;
  font-size: 13px;
}

.auth-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: auth-spin 800ms linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
  .auth-content {
    grid-template-columns: 1fr;
    width: min(520px, calc(100% - 32px));
    gap: 28px;
    padding-top: 36px;
  }

  .auth-brand-copy {
    text-align: center;
  }

  .auth-brand-copy h1 {
    font-size: 48px;
  }

  html[lang="en"] .auth-brand-copy h1 {
    font-size: 44px;
  }

  .auth-brand-copy span {
    margin: 14px auto 0;
    font-size: 15px;
  }

  .auth-panel {
    max-height: none;
  }

  .auth-footer {
    display: none;
  }
}

@media (max-width: 520px) {
  .auth-header {
    min-height: 68px;
    padding: 12px 16px;
  }

  .auth-header img {
    width: 142px;
  }

  .auth-content {
    width: 100%;
    min-height: calc(100vh - 68px);
    padding: 28px 14px;
  }

  .auth-brand-copy {
    display: none;
  }

  .auth-panel {
    padding: 24px 18px;
  }

  .auth-panel-heading h2 {
    font-size: 21px;
  }

  .auth-email-input b {
    padding: 0 9px;
    font-size: 12px;
  }
}

/* Foreign-customer receipt ledger V2 */
.receipt-v2 {
  --receipt-blue: #1769aa;
  --receipt-green: #15805f;
  --receipt-red: #b03a37;
  --receipt-violet: #6950b8;
  --receipt-quiet: color-mix(in srgb, var(--surface-2) 80%, var(--surface));
}

.receipt-v2-head,
.receipt-v2-panel,
.receipt-v2-chart-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-v2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
}

.receipt-v2-head > div:first-child,
.receipt-v2-head-actions,
.receipt-v2-head-actions button,
.receipt-v2-panel > header,
.receipt-v2-panel > header > div,
.receipt-v2-panel > header > button,
.receipt-v2-panel > header > span,
.receipt-v2-notice,
.receipt-v2-dialog > header,
.receipt-v2-dialog > header > div,
.receipt-v2-dialog > header > div > span,
.receipt-v2-dialog footer,
.receipt-v2-dialog footer > p,
.receipt-v2-dialog footer > div {
  display: flex;
  align-items: center;
}

.receipt-v2-head > div:first-child {
  min-width: 0;
  gap: 14px;
}

.receipt-v2-head > div:first-child > span {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #e6f0f8;
  color: var(--receipt-blue);
}

.receipt-v2-head svg {
  width: 22px;
  height: 22px;
}

.receipt-v2-head h2,
.receipt-v2-head p,
.receipt-v2-panel h3,
.receipt-v2-panel p,
.receipt-v2-chart-panel h3,
.receipt-v2-chart-panel p {
  margin: 0;
}

.receipt-v2-head h2 {
  font-size: 24px;
  line-height: 1.2;
}

.receipt-v2-head p,
.receipt-v2-panel > header p,
.receipt-v2-chart-panel > header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.receipt-v2-head-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.receipt-v2-head-actions button,
.receipt-v2-panel > header > button,
.receipt-v2-filters button,
.receipt-v2-dialog button,
.receipt-v2-row-actions button {
  min-height: 38px;
  padding: 0 13px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 760;
}

.receipt-v2-head-actions .is-primary,
.receipt-v2-panel > header > .is-primary,
.receipt-v2-filters .is-primary,
.receipt-v2-dialog .is-primary {
  border-color: var(--amber);
  background: var(--amber);
  color: #111;
}

.receipt-v2-head-actions button.is-view-active {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--amber);
}

.receipt-v2-head-actions button:disabled,
.receipt-v2-panel button:disabled,
.receipt-v2-dialog button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.receipt-v2-dialog button.is-primary:disabled {
  border-color: #d2b064;
  background: #efe2bd;
  color: #5d4a1d;
  opacity: 1;
}

.receipt-v2-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.receipt-v2-tabs button {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--soft-line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 780;
}

.receipt-v2-tabs button:last-child {
  border-right: 0;
}

.receipt-v2-tabs button.is-active {
  background: var(--dark);
  color: var(--amber);
}

.receipt-v2-tabs svg,
.receipt-v2-filters svg,
.receipt-v2-head-actions svg,
.receipt-v2-panel > header button svg,
.receipt-v2-row-actions svg {
  width: 17px;
  height: 17px;
}

.receipt-v2-filters {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) repeat(4, minmax(130px, 0.8fr)) auto auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-v2-filters input,
.receipt-v2-filters select,
.receipt-v2-form-grid input,
.receipt-v2-form-grid select,
.receipt-v2-form-grid textarea,
.receipt-v2-allocations input[type="number"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.receipt-v2-filters select,
.receipt-v2-form-grid input,
.receipt-v2-form-grid select,
.receipt-v2-form-grid textarea,
.receipt-v2-allocations input[type="number"] {
  padding: 8px 10px;
}

.receipt-v2-search,
.receipt-v2-month {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.receipt-v2-search input,
.receipt-v2-month input {
  min-width: 0;
  border: 0;
  padding: 0;
  outline: 0;
}

.receipt-v2-month {
  min-width: 150px;
}

.receipt-v2-overview {
  display: grid;
  gap: 14px;
}

.receipt-v2-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.receipt-v2-kpis article,
.receipt-v2-kpis button {
  display: grid;
  min-width: 0;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 2px 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--receipt-blue);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.receipt-v2-kpis button {
  --receipt-kpi-accent: var(--receipt-blue);
  position: relative;
  cursor: pointer;
}

.receipt-v2-kpis button:hover,
.receipt-v2-kpis button.is-active {
  border-color: var(--receipt-kpi-accent);
  background: color-mix(in srgb, var(--receipt-kpi-accent) 7%, var(--surface));
}

.receipt-v2-kpis button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--receipt-kpi-accent) 30%, transparent);
  outline-offset: 2px;
}

.receipt-v2-kpis button > b {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--muted);
}

.receipt-v2-kpis button > b svg { width: 16px; height: 16px; }

.receipt-v2-account-breakdown {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-style: normal;
  color: var(--muted);
}
.receipt-v2-usd-value {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .01em;
}

.receipt-v2-account-breakdown i { font-style: normal; font-size: 11px; }

.receipt-v2-chart-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.receipt-v2-kpis .tone-actual { --receipt-kpi-accent: var(--receipt-blue); }
.receipt-v2-kpis .tone-total { --receipt-kpi-accent: #246b4b; border-top-color: #246b4b; }
.receipt-v2-kpis .tone-pending { --receipt-kpi-accent: var(--receipt-violet); border-top-color: var(--receipt-violet); }
.receipt-v2-kpis .tone-reference { --receipt-kpi-accent: #c88718; border-top-color: #c88718; }
.receipt-v2-kpis .tone-risk { --receipt-kpi-accent: var(--receipt-red); border-top-color: var(--receipt-red); }
.receipt-v2-kpis .tone-future { --receipt-kpi-accent: var(--receipt-green); border-top-color: var(--receipt-green); }
.receipt-v2-kpis .tone-history { --receipt-kpi-accent: #8a5a19; border-top-color: #8a5a19; }

.receipt-v2-timeline-detail {
  display: grid;
  gap: 14px;
}

.receipt-v2-account-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.receipt-v2-account-section > header h4 {
  margin: 0;
  font-size: 16px;
}

.receipt-v2-account-section > header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.receipt-v2-gap-group {
  display: grid;
  gap: 8px;
}

.receipt-v2-gap-group > h4 { margin: 0; }

.receipt-v2-gap-group > article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.receipt-v2-gap-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.receipt-v2-gap-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.receipt-v2-gap-actions svg { width: 15px; height: 15px; }

.receipt-v2-kpis :is(article, button) > span {
  display: grid;
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: var(--receipt-quiet);
  color: var(--receipt-blue);
}

.receipt-v2-kpis .tone-pending > span { color: var(--receipt-violet); }
.receipt-v2-kpis .tone-reference > span { color: #a36c0c; }
.receipt-v2-kpis .tone-risk > span { color: var(--receipt-red); }
.receipt-v2-kpis .tone-future > span { color: var(--receipt-green); }
.receipt-v2-kpis .tone-history > span { color: #8a5a19; }

.receipt-v2-kpis :is(article, button) > small {
  color: var(--muted);
  font-weight: 700;
}

.receipt-v2-kpis :is(article, button) > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 21px;
  line-height: 1.15;
}

.receipt-v2-overdue-detail {
  --receipt-detail-accent: var(--receipt-red);
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--receipt-detail-accent) 40%, var(--line));
  border-left: 4px solid var(--receipt-detail-accent);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-v2-rule-note {
  margin: 0;
  padding: 9px 12px;
  border-left: 3px solid #c88718;
  background: color-mix(in srgb, #c88718 8%, var(--surface));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.receipt-v2-overdue-detail > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.receipt-v2-overdue-detail h3,
.receipt-v2-overdue-detail p { margin: 0; }
.receipt-v2-overdue-detail p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.receipt-v2-overdue-detail > header > strong { flex: 0 0 auto; color: var(--receipt-detail-accent); }
.receipt-v2-overdue-detail.is-actual { --receipt-detail-accent: var(--receipt-blue); }
.receipt-v2-overdue-detail.is-reference { --receipt-detail-accent: #c88718; }
.receipt-v2-overdue-detail.is-pending { --receipt-detail-accent: var(--receipt-violet); }
.receipt-v2-overdue-detail.is-future { --receipt-detail-accent: var(--receipt-green); }
.receipt-v2-overdue-detail.is-history { --receipt-detail-accent: #8a5a19; }
.receipt-v2-reconcile-note { padding: 9px 12px; border-left: 3px solid #c88718; background: color-mix(in srgb, #c88718 7%, var(--surface-soft)); }

.receipt-v2-overdue-groups { display: grid; gap: 8px; }
.receipt-v2-overdue-groups details { overflow: hidden; border: 1px solid var(--soft-line); border-radius: 6px; background: var(--surface-soft); }
.receipt-v2-overdue-groups summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.receipt-v2-overdue-groups summary::-webkit-details-marker { display: none; }
.receipt-v2-overdue-groups summary > span { min-width: 0; }
.receipt-v2-overdue-groups summary strong,
.receipt-v2-overdue-groups summary small { display: block; }
.receipt-v2-overdue-groups summary small { margin-top: 2px; color: var(--muted); }
.receipt-v2-overdue-groups summary > b { color: var(--receipt-detail-accent); }
.receipt-v2-overdue-groups summary > svg { width: 16px; transition: transform 160ms ease; }
.receipt-v2-overdue-groups details[open] summary > svg { transform: rotate(180deg); }
.receipt-v2-overdue-dispatches { border-top: 1px solid var(--soft-line); }
.receipt-v2-overdue-dispatches article { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 0.8fr) 100px minmax(140px, auto); align-items: center; gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--soft-line); }
.receipt-v2-overdue-dispatches article:last-child { border-bottom: 0; }
.receipt-v2-overdue-dispatches article span { min-width: 0; }
.receipt-v2-overdue-dispatches article strong,
.receipt-v2-overdue-dispatches article small { display: block; overflow-wrap: anywhere; }
.receipt-v2-overdue-dispatches article small { color: var(--muted); }
.receipt-v2-overdue-dispatches article > b { text-align: right; }
.receipt-v2-overdue-dispatches article.is-payment-drill { cursor: pointer; transition: background-color 160ms ease, box-shadow 160ms ease; }
.receipt-v2-overdue-dispatches article.is-payment-drill:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.receipt-v2-overdue-dispatches article.is-payment-drill:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.receipt-v2-drill-hint { display: flex !important; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 4px; color: var(--accent) !important; font-weight: 700; }
.receipt-v2-drill-hint svg { width: 15px; height: 15px; }
.receipt-v2-prefill-note { display: flex; gap: 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--soft-line)); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.receipt-v2-prefill-note > svg { flex: 0 0 auto; width: 21px; height: 21px; color: var(--accent); }
.receipt-v2-prefill-note strong,
.receipt-v2-prefill-note p { display: block; margin: 0; }
.receipt-v2-prefill-note p { margin-top: 3px; color: var(--muted); line-height: 1.45; }
.receipt-v2-overdue-dispatches .is-risk { color: var(--receipt-red); }
.receipt-v2-overdue-dispatches .is-future { color: var(--receipt-green); }
.receipt-v2-overdue-dispatches footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface)); }
.receipt-v2-overdue-dispatches footer span,
.receipt-v2-overdue-dispatches footer small { display: block; }
.receipt-v2-overdue-dispatches footer small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.receipt-v2-overdue-dispatches footer strong { flex: 0 0 auto; text-align: right; }

.receipt-v2-chart-panel,
.receipt-v2-panel {
  padding: 18px 20px;
}

.receipt-v2-chart-panel > header,
.receipt-v2-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.receipt-v2-chart-panel > header > span,
.receipt-v2-panel > header > strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.receipt-v2-chart {
  display: grid;
  grid-template-columns: repeat(10, minmax(58px, 1fr));
  gap: 6px;
  min-width: 680px;
  min-height: 230px;
  padding: 14px 6px 0;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0 54px, var(--soft-line) 55px 56px);
  overflow: hidden;
}

.receipt-v2-chart-panel {
  overflow-x: auto;
}

.receipt-v2-chart button {
  display: grid;
  min-width: 0;
  min-height: 214px;
  grid-template-rows: 1fr auto auto;
  gap: 3px;
  padding: 0 4px 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
}

.receipt-v2-chart button:hover,
.receipt-v2-chart button.is-active {
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber-soft) 50%, transparent);
}

.receipt-v2-bars {
  display: flex;
  height: 170px;
  align-items: end;
  justify-content: center;
  gap: 5px;
}

.receipt-v2-bars i {
  width: min(18px, 34%);
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--receipt-blue);
}

.receipt-v2-bars .is-expected {
  background: var(--receipt-violet);
}

.receipt-v2-bars .is-u8-reference {
  background: #c88718;
}

.receipt-v2-chart button small {
  color: var(--muted);
  font-size: 10px;
}

.receipt-v2-legend {
  display: flex;
  gap: 18px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.receipt-v2-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.receipt-v2-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--receipt-blue);
}

.receipt-v2-legend .is-expected { background: var(--receipt-violet); }
.receipt-v2-legend .is-u8-reference { background: #c88718; }

.receipt-v2-u8-evidence {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--soft-line);
}

.receipt-v2-u8-evidence > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.receipt-v2-u8-evidence > header h3,
.receipt-v2-u8-evidence > header p {
  margin: 0;
}

.receipt-v2-u8-evidence > header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.receipt-v2-u8-evidence > header > strong {
  flex: 0 0 auto;
  color: #a36c0c;
  font-size: 13px;
}

.receipt-v2-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
}

.receipt-v2-table-wrap table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.receipt-v2-table-wrap th,
.receipt-v2-table-wrap td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.receipt-v2-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.receipt-v2-table-wrap tr:last-child td { border-bottom: 0; }
.receipt-v2-table-wrap td small,
.receipt-v2-payment-list small,
.receipt-v2-import-list small,
.receipt-v2-sync-list small,
.receipt-v2-history small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.receipt-v2-table-wrap .is-overpaid { color: var(--receipt-red); }

.receipt-v2-table-wrap [class^="status-"],
.receipt-v2-sync-list [class^="status-"] {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.receipt-v2-table-wrap .status-received,
.receipt-v2-sync-list .status-synced { background: #e0f3e9; color: var(--receipt-green); }
.receipt-v2-table-wrap .status-overpaid,
.receipt-v2-sync-list .status-failed { background: #fae8e7; color: var(--receipt-red); }
.receipt-v2-sync-list .status-needs_resync { background: #fff0cf; color: var(--warning); }

.receipt-v2-payment-list,
.receipt-v2-import-list,
.receipt-v2-sync-list,
.receipt-v2-history {
  display: grid;
  gap: 8px;
}

.receipt-v2-payment-list article,
.receipt-v2-import-list article,
.receipt-v2-sync-list article,
.receipt-v2-history article {
  display: grid;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr) minmax(140px, auto) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--receipt-quiet);
}

.receipt-v2-payment-list article.is-new,
.receipt-v2-import-list article.is-new {
  border-color: color-mix(in srgb, var(--gold) 72%, var(--soft-line));
  box-shadow: inset 3px 0 0 var(--gold);
}

.receipt-v2-new-badge {
  display: inline-flex;
  min-width: 24px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--gold);
  color: #111;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: 2px;
}

.receipt-v2-list-toggle {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.receipt-v2-list-toggle:hover {
  border-color: var(--gold);
  color: var(--gold-ink);
}

.receipt-v2-list-toggle svg {
  width: 16px;
  height: 16px;
}

.receipt-v2-sync-list article {
  grid-template-columns: minmax(170px, 1fr) auto minmax(120px, auto) minmax(235px, auto);
}

.receipt-v2-import-list article,
.receipt-v2-history article {
  grid-template-columns: 42px minmax(0, 1fr) minmax(150px, auto);
}

.receipt-v2-payment-list article > span:first-child,
.receipt-v2-import-list article > span:first-child,
.receipt-v2-history article > span:first-child {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface);
  color: var(--receipt-blue);
}

.receipt-v2-payment-list article > div,
.receipt-v2-import-list article > div,
.receipt-v2-sync-list article > div,
.receipt-v2-history article > div {
  min-width: 0;
}

.receipt-v2-payment-list article strong,
.receipt-v2-payment-list article p,
.receipt-v2-import-list article strong,
.receipt-v2-sync-list article strong,
.receipt-v2-history article strong {
  overflow-wrap: anywhere;
}

.receipt-v2-payment-list article p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.receipt-v2-payment-audit {
  margin-top: 8px;
  border-top: 1px solid var(--soft-line);
}

.receipt-v2-payment-audit summary {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.receipt-v2-payment-audit summary svg { width: 15px; height: 15px; }
.receipt-v2-payment-audit ul { display: grid; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.receipt-v2-payment-audit li { display: grid; grid-template-columns: minmax(110px, auto) minmax(120px, 1fr) auto; gap: 8px; padding: 7px 8px; border-radius: 4px; background: var(--surface); font-size: 12px; }
.receipt-v2-payment-audit li span,
.receipt-v2-payment-audit li time { color: var(--muted); }

.receipt-v2-match-evidence {
  margin-top: 9px;
  border-top: 1px solid var(--soft-line);
}

.receipt-v2-match-evidence summary {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.receipt-v2-match-evidence summary::-webkit-details-marker { display: none; }
.receipt-v2-match-evidence summary > svg { width: 15px; height: 15px; color: var(--receipt-blue); }
.receipt-v2-match-evidence summary > svg:last-child { margin-left: auto; transition: transform 160ms ease; }
.receipt-v2-match-evidence[open] summary > svg:last-child { transform: rotate(180deg); }
.receipt-v2-match-evidence summary > span { color: var(--muted); font-size: 11px; font-weight: 800; }

.receipt-v2-match-evidence ul {
  display: grid;
  margin: 0;
  padding: 0 0 3px;
  list-style: none;
}

.receipt-v2-match-rule {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.receipt-v2-match-audit {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0 0 4px;
  padding: 8px 10px;
  border-left: 3px solid currentColor;
  background: color-mix(in srgb, currentColor 7%, transparent);
  font-size: 12px;
  line-height: 1.55;
}

.receipt-v2-match-audit svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }
.receipt-v2-match-audit.is-balanced { color: var(--receipt-green); }
.receipt-v2-match-audit.is-conflict { color: var(--danger); }
.receipt-v2-match-audit span { color: var(--text); }

.receipt-v2-reconciliation-warning {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--soft-line));
  border-left: 4px solid var(--warning);
  border-radius: 6px;
  background: color-mix(in srgb, var(--warning) 9%, var(--panel));
}

.receipt-v2-reconciliation-warning > svg { width: 18px; height: 18px; color: var(--warning); }
.receipt-v2-reconciliation-warning strong { color: var(--text); }
.receipt-v2-reconciliation-warning p,
.receipt-v2-reconciliation-warning small { display: block; color: var(--muted); line-height: 1.55; }
.receipt-v2-reconciliation-warning ul { margin: 7px 0; }
.receipt-v2-match-evidence .receipt-v2-reconciliation-warning li {
  grid-template-columns: minmax(150px, 1fr) auto;
  padding: 6px 0;
}
.receipt-v2-match-evidence .receipt-v2-reconciliation-warning li > span:last-child { font-weight: 900; color: var(--text); }

.receipt-v2-match-evidence li {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(210px, 1.25fr) minmax(135px, .7fr) minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--soft-line);
  font-size: 12px;
}

.receipt-v2-match-evidence li > span { min-width: 0; overflow-wrap: anywhere; }
.receipt-v2-match-evidence li > span:first-child { display: flex; align-items: center; gap: 5px; }
.receipt-v2-match-evidence li > span:first-child svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--muted); }
.receipt-v2-match-evidence li small { display: block; color: var(--muted); }
.receipt-v2-match-evidence li > span:first-child small { margin-left: 4px; }
.receipt-v2-match-evidence li > span:nth-child(2) { font-weight: 800; }
.receipt-v2-match-evidence li > span:nth-child(2).is-received { color: var(--receipt-green); }
.receipt-v2-match-evidence li > span:nth-child(2).is-closed { color: var(--warning); }
.receipt-v2-match-evidence li > span:nth-child(2).is-open { color: var(--receipt-blue); }

.receipt-v2-payment-list article > b,
.receipt-v2-import-list article > b,
.receipt-v2-sync-list article > b,
.receipt-v2-history time {
  text-align: right;
  white-space: nowrap;
}

.receipt-v2-row-actions {
  display: flex;
  gap: 5px;
}

.receipt-v2-row-actions button {
  display: grid;
  width: 34px;
  min-height: 34px;
  padding: 0;
  place-items: center;
}

.receipt-v2-sync-head-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.receipt-v2-locate-sync,
.receipt-v2-sync-action,
.receipt-v2-clear-action {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 780;
}

.receipt-v2-locate-sync {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
}

.receipt-v2-locate-sync svg,
.receipt-v2-sync-action svg,
.receipt-v2-clear-action svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.receipt-v2-sync-guide {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid var(--soft-line);
  border-left: 4px solid var(--warning);
  background: #fff9ea;
}

.receipt-v2-sync-guide.is-ready {
  border-left-color: var(--receipt-green);
  background: #edf8f2;
}

.receipt-v2-sync-guide > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--warning);
}

.receipt-v2-sync-guide.is-ready > svg { color: var(--receipt-green); }
.receipt-v2-sync-guide strong,
.receipt-v2-sync-guide p,
.receipt-v2-sync-guide small { display: block; }
.receipt-v2-sync-guide p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.receipt-v2-sync-guide small { margin-top: 3px; color: var(--warning); font-size: 11px; font-weight: 800; }
.receipt-v2-sync-guide.is-ready small { color: var(--receipt-green); }

.receipt-v2-sync-actions {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.receipt-v2-sync-action {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-color: var(--amber);
  background: var(--amber);
  color: #111;
  text-align: left;
}

.receipt-v2-sync-action > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.receipt-v2-sync-action strong { font-size: 12px; line-height: 1.25; }
.receipt-v2-sync-action small { margin: 0; color: currentColor; font-size: 10px; font-weight: 650; opacity: 0.76; }
.receipt-v2-sync-action:disabled { border-color: var(--line); background: var(--surface-2); color: var(--muted); opacity: 0.82; }

.receipt-v2-clear-action {
  display: inline-flex;
  min-width: 62px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
}

.receipt-v2-sync-gate {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--warning) !important;
  text-align: right;
  font-weight: 800;
}

.receipt-v2-flag {
  min-height: 31px;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
}

.receipt-v2-flag.is-on {
  border-color: var(--receipt-green);
  color: var(--receipt-green);
}

.receipt-v2-notice {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border-left: 4px solid var(--warning);
  background: #fff6e2;
}

.receipt-v2-scan-state {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--receipt-quiet);
}

.receipt-v2-scan-state > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface);
  color: var(--receipt-green);
}

.receipt-v2-scan-state > div { min-width: 0; }
.receipt-v2-scan-state small,
.receipt-v2-scan-state strong { display: block; }
.receipt-v2-scan-state strong { margin-top: 2px; overflow-wrap: anywhere; }
.receipt-v2-scan-state p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.receipt-v2-scan-state dl { display: flex; gap: 18px; margin: 0; }
.receipt-v2-scan-state dl > div { min-width: 62px; text-align: right; }
.receipt-v2-scan-state dt { color: var(--muted); font-size: 11px; }
.receipt-v2-scan-state dd { margin: 2px 0 0; font-size: 18px; font-weight: 800; }

.receipt-v2-notice > svg {
  flex: 0 0 20px;
}

.receipt-v2-notice p { margin-top: 3px; }

.receipt-v2-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.receipt-v2-empty svg {
  width: 28px;
  height: 28px;
}

.receipt-v2-dialog-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 13, 18, 0.66);
}

.receipt-v2-dialog {
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  overflow: auto;
}

.receipt-v2-dialog > header {
  position: sticky;
  top: 0;
  z-index: 2;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.receipt-v2-dialog > header > div { min-width: 0; gap: 11px; }
.receipt-v2-dialog > header > div > span {
  width: 40px;
  height: 40px;
  justify-content: center;
  border-radius: 7px;
  background: var(--amber-soft);
  color: var(--amber-dark);
}
.receipt-v2-dialog > header small { color: var(--muted); }
.receipt-v2-dialog > header h3 { margin: 2px 0 0; font-size: 20px; }
.receipt-v2-dialog > header > button { width: 38px; padding: 0; justify-content: center; }

.receipt-v2-dialog form { padding: 18px; }

.receipt-v2-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.receipt-v2-form-grid label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.receipt-v2-form-grid label > span,
.receipt-v2-allocations legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.receipt-v2-form-grid .is-wide { grid-column: span 2; }
.receipt-v2-form-grid textarea { min-height: 78px; resize: vertical; }
.receipt-v2-file input { padding: 7px; }
.receipt-v2-file span { display: flex; align-items: center; gap: 6px; }

.receipt-v2-allocations {
  display: grid;
  gap: 7px;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.receipt-v2-allocation-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(230px, 0.9fr) 40px;
  align-items: end;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--soft-line);
}

.receipt-v2-allocation-filter {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.receipt-v2-allocation-filter > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.receipt-v2-allocation-filter > div {
  position: relative;
}

.receipt-v2-allocation-filter > div > svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.receipt-v2-allocation-filter input,
.receipt-v2-allocation-filter select {
  width: 100%;
  min-height: 40px;
}

.receipt-v2-allocation-filter input { padding-left: 35px; }

.receipt-v2-allocation-clear {
  width: 40px;
  min-height: 40px;
  padding: 0;
  justify-content: center;
}

.receipt-v2-allocation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 2px 4px;
  color: var(--muted);
  font-size: 12px;
}

.receipt-v2-allocation-summary strong { color: var(--text); }

.receipt-v2-allocation-results {
  max-height: 420px;
  overflow: auto;
  overscroll-behavior: contain;
}

.receipt-v2-allocation-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-bottom: 1px solid var(--soft-line);
}

.receipt-v2-allocation-row:last-child { border-bottom: 0; }
.receipt-v2-allocations input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--amber-dark); }
.receipt-v2-allocations small { display: block; margin-top: 3px; color: var(--muted); }
.receipt-v2-allocation-empty {
  margin: 0;
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
}

.receipt-v2-dialog footer {
  position: sticky;
  bottom: -18px;
  justify-content: space-between;
  gap: 14px;
  margin: 18px -18px -18px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.receipt-v2-dialog footer > p {
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.receipt-v2-dialog footer > div { gap: 8px; }

:root[data-theme="dark"] .receipt-v2-head,
:root[data-theme="dark"] .receipt-v2-panel,
:root[data-theme="dark"] .receipt-v2-chart-panel,
:root[data-theme="dark"] .receipt-v2-tabs,
:root[data-theme="dark"] .receipt-v2-filters,
:root[data-theme="dark"] .receipt-v2-kpis article,
:root[data-theme="dark"] .receipt-v2-kpis button,
:root[data-theme="dark"] .receipt-v2-overdue-detail,
:root[data-theme="dark"] .receipt-v2-overdue-groups details,
:root[data-theme="dark"] .receipt-v2-dialog,
:root[data-theme="dark"] .receipt-v2-dialog > header,
:root[data-theme="dark"] .receipt-v2-dialog footer,
:root[data-theme="dark"] .receipt-v2-filters input,
:root[data-theme="dark"] .receipt-v2-filters select,
:root[data-theme="dark"] .receipt-v2-search,
:root[data-theme="dark"] .receipt-v2-month,
:root[data-theme="dark"] .receipt-v2-form-grid input,
:root[data-theme="dark"] .receipt-v2-form-grid select,
:root[data-theme="dark"] .receipt-v2-form-grid textarea,
:root[data-theme="dark"] .receipt-v2-allocations input[type="number"],
:root[data-theme="dark"] .receipt-v2-head-actions button,
:root[data-theme="dark"] .receipt-v2-panel > header > button,
:root[data-theme="dark"] .receipt-v2-filters button,
:root[data-theme="dark"] .receipt-v2-dialog button,
:root[data-theme="dark"] .receipt-v2-row-actions button,
:root[data-theme="dark"] .receipt-v2-payment-list article > span:first-child,
:root[data-theme="dark"] .receipt-v2-import-list article > span:first-child,
:root[data-theme="dark"] .receipt-v2-history article > span:first-child {
  background: var(--surface-2);
}

:root[data-theme="dark"] .receipt-v2-payment-list article,
:root[data-theme="dark"] .receipt-v2-import-list article,
:root[data-theme="dark"] .receipt-v2-sync-list article,
:root[data-theme="dark"] .receipt-v2-history article,
:root[data-theme="dark"] .receipt-v2-kpis :is(article, button) > span {
  background: var(--surface);
}

:root[data-theme="dark"] .receipt-v2-tabs button {
  background: transparent;
  color: #d7dfed;
}

:root[data-theme="dark"] .receipt-v2-tabs button:hover,
:root[data-theme="dark"] .receipt-v2-tabs button:focus-visible {
  background: #111c31;
  color: #fff;
}

:root[data-theme="dark"] .receipt-v2-tabs button.is-active {
  background: var(--amber);
  color: #111;
}

:root[data-theme="dark"] .receipt-v2-head-actions .is-primary,
:root[data-theme="dark"] .receipt-v2-panel > header > .is-primary,
:root[data-theme="dark"] .receipt-v2-filters .is-primary {
  border-color: var(--amber);
  background: var(--amber);
  color: #111;
  opacity: 1;
}

:root[data-theme="dark"] .receipt-v2-head-actions .is-primary:disabled,
:root[data-theme="dark"] .receipt-v2-panel > header > .is-primary:disabled,
:root[data-theme="dark"] .receipt-v2-filters .is-primary:disabled {
  border-color: #6f5a28;
  background: #3d3219;
  color: #f0cd78;
  opacity: 1;
}

:root[data-theme="dark"] .receipt-v2-dialog button.is-primary {
  border-color: var(--amber);
  background: var(--amber);
  color: #111;
  opacity: 1;
}

:root[data-theme="dark"] .receipt-v2-dialog button.is-primary:disabled {
  border-color: #6f5a28;
  background: #3d3219;
  color: #f0cd78;
}

:root[data-theme="dark"] .receipt-v2-notice {
  background: #2d2515;
}

:root[data-theme="dark"] .receipt-v2-sync-guide {
  background: #2d2515;
}

:root[data-theme="dark"] .receipt-v2-sync-guide.is-ready {
  background: #153627;
}

:root[data-theme="dark"] .receipt-v2-locate-sync,
:root[data-theme="dark"] .receipt-v2-clear-action,
:root[data-theme="dark"] .receipt-v2-sync-action:disabled {
  background: var(--surface-2);
}

:root[data-theme="dark"] .receipt-v2-scan-state > span {
  background: var(--surface-2);
}

:root[data-theme="dark"] .receipt-v2-table-wrap .status-received,
:root[data-theme="dark"] .receipt-v2-sync-list .status-synced { background: #153627; color: #57d99f; }
:root[data-theme="dark"] .receipt-v2-table-wrap .status-overpaid,
:root[data-theme="dark"] .receipt-v2-sync-list .status-failed { background: #3a1d1c; color: #ff8d88; }
:root[data-theme="dark"] .receipt-v2-sync-list .status-needs_resync { background: #3b2c12; color: #ffc85a; }

@media (max-width: 1180px) {
  .receipt-v2-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .receipt-v2-search { grid-column: span 2; }
  .receipt-v2-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .receipt-v2-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .receipt-v2-head {
    align-items: flex-start;
    padding: 14px;
  }

  .receipt-v2-head > div:first-child > span { display: none; }
  .receipt-v2-head h2 { font-size: 20px; }
  .receipt-v2-head p { font-size: 12px; }
  .receipt-v2-head-actions button { width: 40px; padding: 0; justify-content: center; }
  .receipt-v2-head-actions button span { display: none; }

  .receipt-v2-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .receipt-v2-tabs button {
    flex: 0 0 112px;
    border-right: 1px solid var(--soft-line);
  }

  .receipt-v2-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .receipt-v2-search { grid-column: 1 / -1; }
  .receipt-v2-filters select,
  .receipt-v2-month { min-width: 0; }
  .receipt-v2-filters button { justify-content: center; }
  .receipt-v2-kpis { grid-template-columns: 1fr 1fr; }
  .receipt-v2-kpis :is(article, button) { grid-template-columns: 30px minmax(0, 1fr); padding: 11px; }
  .receipt-v2-kpis :is(article, button) > span { width: 30px; height: 30px; }
  .receipt-v2-kpis :is(article, button) > strong { font-size: 16px; }
  .receipt-v2-overdue-detail > header { display: grid; }
  .receipt-v2-overdue-detail > header > strong { white-space: normal; }
  .receipt-v2-overdue-dispatches article { grid-template-columns: 1fr 1fr; }
  .receipt-v2-overdue-dispatches article > b { text-align: left; }
  .receipt-v2-drill-hint { justify-content: flex-start; }
  .receipt-v2-overdue-dispatches footer { align-items: flex-start; }
  .receipt-v2-chart-panel,
  .receipt-v2-panel { padding: 14px; }

  .receipt-v2-payment-list article,
  .receipt-v2-import-list article,
  .receipt-v2-history article {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .receipt-v2-sync-list article {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
  }

  .receipt-v2-payment-list article > span:first-child,
  .receipt-v2-import-list article > span:first-child,
  .receipt-v2-history article > span:first-child {
    width: 36px;
    height: 36px;
  }

  .receipt-v2-payment-list article > b,
  .receipt-v2-sync-list article > b {
    grid-column: 2;
    text-align: left;
  }

  .receipt-v2-sync-list article > b { grid-column: 1; }
  .receipt-v2-sync-actions { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; }
  .receipt-v2-sync-head-actions { width: 100%; justify-content: flex-start; }
  .receipt-v2-locate-sync { flex: 1 1 210px; justify-content: center; }

  .receipt-v2-row-actions { grid-column: 3; grid-row: 1 / span 2; }
  .receipt-v2-match-evidence li { grid-template-columns: 1fr; gap: 4px; }
  .receipt-v2-match-evidence li > span:first-child { flex-wrap: wrap; }
  .receipt-v2-import-list article > b,
  .receipt-v2-history time { font-size: 11px; }

  .receipt-v2-dialog-backdrop {
    align-items: end;
    padding: 0;
  }

  .receipt-v2-dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: 8px 8px 0 0;
  }

  .receipt-v2-dialog form { padding: 14px; }
  .receipt-v2-form-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .receipt-v2-form-grid .is-wide { grid-column: 1 / -1; }
  .receipt-v2-allocations { margin-top: 14px; padding: 10px; }
  .receipt-v2-allocation-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .receipt-v2-allocation-row { grid-template-columns: 20px minmax(0, 1fr); }
  .receipt-v2-allocation-row input[type="number"] { grid-column: 2; }
  .receipt-v2-dialog footer { bottom: -14px; margin: 14px -14px -14px; }
  .receipt-v2-dialog footer > p { display: none; }
  .receipt-v2-dialog footer > div { width: 100%; }
  .receipt-v2-dialog footer button { flex: 1; justify-content: center; }
  .receipt-v2-scan-state { grid-template-columns: 34px minmax(0, 1fr); }
  .receipt-v2-scan-state > span { width: 34px; height: 34px; }
  .receipt-v2-scan-state dl { grid-column: 2; justify-content: flex-start; }
  .receipt-v2-scan-state dl > div { text-align: left; }
}

@media (max-width: 480px) {
  .receipt-v2-filters { grid-template-columns: 1fr; }
  .receipt-v2-search { grid-column: 1; }
  .receipt-v2-kpis { grid-template-columns: 1fr; }
  .receipt-v2-overdue-dispatches article { grid-template-columns: 1fr; }
  .receipt-v2-overdue-dispatches footer { display: grid; }
  .receipt-v2-overdue-dispatches footer strong { text-align: left; }
  .receipt-v2-form-grid { grid-template-columns: 1fr; }
  .receipt-v2-allocation-tools { grid-template-columns: 1fr 40px; }
  .receipt-v2-allocation-filter:first-child { grid-column: 1 / -1; }
  .receipt-v2-allocation-summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .receipt-v2-form-grid .is-wide { grid-column: 1; }
  .receipt-v2-chart-panel > header,
  .receipt-v2-panel > header { align-items: flex-start; }
  .receipt-v2-panel > header > button span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-spinner {
    animation-duration: 1600ms;
  }
}


/* Versioned production-planning simulation */
.planning-page {
  display: grid;
  gap: 12px;
}

.planning-safety-strip,
.planning-recommendation-band {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, #147d67 32%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, #147d67 7%, var(--surface));
}

.planning-safety-strip > span,
.planning-recommendation-band > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: #147d67;
  font-size: 12px;
  font-weight: 850;
}

.planning-safety-strip > span.is-locked {
  color: #a94137;
}

.planning-safety-strip svg,
.planning-recommendation-band svg {
  width: 16px;
  height: 16px;
}

.planning-safety-strip > small,
.planning-recommendation-band > small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.planning-warning-band {
  border: 1px solid color-mix(in srgb, #bd7a0c 42%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, #f1ae27 9%, var(--surface));
}

.planning-warning-band summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  color: #9a5d00;
  cursor: pointer;
}

.planning-warning-band summary svg {
  width: 17px;
  height: 17px;
}

.planning-warning-band summary span {
  color: var(--muted);
  font-size: 12px;
}

.planning-warning-band > div {
  display: grid;
  gap: 5px;
  padding: 0 13px 12px 38px;
}

.planning-warning-band p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.planning-kpi-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.planning-kpi-band > button,
.planning-kpi-band > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  min-width: 0;
  min-height: 116px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.planning-kpi-band > button {
  cursor: pointer;
}

.planning-kpi-band > button:hover,
.planning-kpi-band > button:focus-visible {
  border-color: #147d67;
}

.planning-kpi-band > * > span {
  display: grid;
  grid-row: 1 / 4;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, #147d67 12%, var(--surface-2));
  color: #147d67;
}

.planning-kpi-band > * > span svg {
  width: 18px;
  height: 18px;
}

.planning-kpi-band small,
.planning-kpi-band em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-kpi-band strong {
  font-size: 26px;
  line-height: 1.15;
}

.planning-kpi-band .tone-risk strong {
  color: #b13c35;
}

.planning-kpi-band .tone-warning strong {
  color: #a06300;
}

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

.planning-chart-panel,
.planning-gantt-panel {
  min-width: 0;
  overflow: hidden;
}

.planning-month-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 244px;
  padding: 16px 0 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.planning-month-column {
  min-width: 72px;
}

.planning-month-column summary {
  display: grid;
  grid-template-rows: 170px auto auto;
  gap: 6px;
  list-style: none;
  text-align: center;
  cursor: pointer;
}

.planning-month-column summary::-webkit-details-marker,
.planning-gantt-row summary::-webkit-details-marker,
.planning-machining-chart summary::-webkit-details-marker,
.planning-material-chart summary::-webkit-details-marker {
  display: none;
}

.planning-month-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  min-height: 170px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 41px,
    color-mix(in srgb, var(--line) 65%, transparent) 42px
  );
}

.planning-month-bars i {
  width: 14px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}

.planning-month-bars .is-capacity,
.planning-chart-legend .is-capacity {
  background: #147d67;
}

.planning-month-bars .is-demand,
.planning-chart-legend .is-demand {
  background: #2d72c4;
}

.planning-month-bars .is-unassigned,
.planning-chart-legend .is-unassigned {
  background: #d69214;
}

.planning-month-column.is-risk .planning-month-bars {
  box-shadow: inset 0 -3px #b13c35;
}

.planning-month-column summary strong {
  color: var(--ink);
  font-size: 12px;
}

.planning-month-column summary small {
  color: var(--muted);
  font-size: 10px;
}

.planning-month-column > div {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 11px;
}

.planning-month-column > div span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.planning-chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

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

.planning-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.planning-chart-legend .is-covered {
  background: #147d67;
}

.planning-overview-pair {
  grid-template-columns: 1.35fr 0.65fr;
}

.planning-exception-list,
.planning-version-list {
  display: grid;
  gap: 6px;
}

.planning-exception-list article,
.planning-version-list article {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(110px, 0.8fr) minmax(90px, 0.65fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.planning-exception-list article:last-child,
.planning-version-list article:last-child {
  border-bottom: 0;
}

.planning-exception-list article > span,
.planning-version-list article > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.planning-exception-list strong,
.planning-exception-list b,
.planning-version-list strong,
.planning-version-list b {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-exception-list small,
.planning-version-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-confidence-meter {
  display: grid;
  gap: 8px;
}

.planning-confidence-meter div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 9px 11px;
  border-left: 4px solid #147d67;
  background: var(--surface-2);
}

.planning-confidence-meter span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.planning-confidence-meter strong {
  color: var(--ink);
  font-size: 17px;
}

.planning-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.planning-schedule-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.planning-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.planning-filter-grid label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.planning-filter-grid select,
.planning-group-adjustment input,
.planning-source-form select,
.planning-source-form input {
  width: 100%;
  min-height: 38px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.planning-group-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.planning-group-toggle button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.planning-group-toggle button.active {
  border-color: #147d67;
  background: #147d67;
  color: #fff;
}

.planning-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.planning-group-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  min-width: 0;
  min-height: 112px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.planning-group-card:hover,
.planning-group-card:focus-visible {
  border-color: #147d67;
  box-shadow: inset 3px 0 #147d67;
}

.planning-group-card.is-risk {
  box-shadow: inset 3px 0 #b13c35;
}

.planning-group-card > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.planning-group-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-group-card small,
.planning-group-card em,
.planning-group-card i {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.planning-group-card b {
  color: #147d67;
  font-size: 19px;
}

.planning-group-card em {
  align-self: end;
}

.planning-group-card i {
  align-self: end;
  text-align: right;
}

.planning-more-groups {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.planning-more-groups > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  color: #147d67;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.planning-more-groups > summary svg {
  width: 15px;
  height: 15px;
}

.planning-group-detail {
  display: grid;
  gap: 12px;
}

.planning-group-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.planning-group-detail-header button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.planning-group-detail-header button svg {
  width: 16px;
  height: 16px;
}

.planning-group-detail-header > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.planning-group-detail-header strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.planning-group-detail-header small {
  color: var(--muted);
  font-size: 11px;
}

.planning-group-adjustment {
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) auto minmax(240px, 1fr);
  align-items: end;
  gap: 10px;
  padding: 10px;
  border-left: 4px solid #d69214;
  background: color-mix(in srgb, #d69214 8%, var(--surface-2));
}

.planning-group-adjustment label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.planning-group-adjustment button,
.planning-source-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #147d67;
  border-radius: 6px;
  background: #147d67;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.planning-group-adjustment small {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.planning-gantt {
  min-width: 760px;
  overflow-x: auto;
}

.planning-gantt-axis {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) repeat(12, minmax(54px, 0.55fr));
  gap: 4px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10px;
}

.planning-gantt-axis b {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-gantt-row {
  border-top: 1px solid var(--line);
}

.planning-gantt-row summary {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(420px, 5fr) minmax(120px, 0.8fr);
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 10px;
  cursor: pointer;
}

.planning-gantt-row summary > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.planning-gantt-row summary strong,
.planning-gantt-row summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-gantt-row summary i {
  position: relative;
  display: block;
  height: 24px;
  border-radius: 4px;
  background: #147d67;
  color: #fff;
  font-style: normal;
}

.planning-gantt-row summary i b {
  position: absolute;
  left: 7px;
  top: 4px;
  font-size: 10px;
  white-space: nowrap;
}

.planning-gantt-row summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.planning-gantt-row.tone-risk summary i {
  background: #b13c35;
}

.planning-gantt-row.tone-warning summary i {
  background: #d69214;
}

.planning-gantt-row.tone-neutral summary i {
  background: #66717c;
}

.planning-gantt-row > p {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 11px;
}

.planning-evidence-grid,
.planning-material-detail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  background: var(--surface-2);
}

.planning-evidence-grid span,
.planning-material-detail span {
  display: grid;
  gap: 3px;
}

.planning-evidence-grid small,
.planning-material-detail small {
  color: var(--muted);
  font-size: 10px;
}

.planning-evidence-grid b,
.planning-material-detail b {
  color: var(--ink);
  font-size: 12px;
}

.planning-machining-chart,
.planning-material-chart {
  display: grid;
}

.planning-machining-chart details,
.planning-material-chart details {
  border-bottom: 1px solid var(--line);
}

.planning-machining-chart details:last-child,
.planning-material-chart details:last-child {
  border-bottom: 0;
}

.planning-machining-chart summary,
.planning-material-chart summary {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(220px, 2fr) minmax(120px, 0.7fr);
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 9px 6px;
  cursor: pointer;
}

.planning-machining-chart summary > span,
.planning-material-chart summary > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.planning-machining-chart summary strong,
.planning-material-chart summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-machining-chart summary small,
.planning-material-chart summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-machining-chart summary > i,
.planning-material-chart summary > i {
  position: relative;
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-2);
}

.planning-machining-chart summary > i b,
.planning-material-chart summary > i b,
.planning-material-chart summary > i em {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  border-radius: 6px;
  background: #2d72c4;
}

.planning-material-chart summary > i em {
  background: color-mix(in srgb, #147d67 72%, transparent);
}

.planning-machining-chart details.is-risk summary > i b,
.planning-material-chart details.is-risk summary > i b {
  background: #b13c35;
}

.planning-machining-chart details > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 0.4fr)) minmax(220px, 1fr);
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
}

.planning-machining-chart details > div span {
  display: grid;
  gap: 3px;
}

.planning-machining-chart details > div p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.planning-machining-anomaly {
  border-color: color-mix(in srgb, #b13c35 48%, var(--line));
  box-shadow: inset 4px 0 #b13c35;
}

.planning-anomaly-list {
  display: grid;
  gap: 6px;
}

.planning-anomaly-list article {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(90px, 0.35fr) minmax(260px, 1.4fr);
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, #b13c35 35%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, #b13c35 6%, var(--surface));
}

.planning-anomaly-list article > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.planning-anomaly-list small {
  color: var(--muted);
  font-size: 10px;
}

.planning-anomaly-list article > b {
  color: #b13c35;
  font-size: 18px;
}

.planning-source-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.planning-source-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-top: 3px solid #66717c;
  border-radius: 6px;
  background: var(--surface-2);
}

.planning-source-summary strong {
  color: var(--ink);
  font-size: 17px;
}

.planning-source-summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-source-summary .source-self_made { border-top-color: #147d67; }
.planning-source-summary .source-purchased_semi_finished { border-top-color: #2d72c4; }
.planning-source-summary .source-blank_outsourced { border-top-color: #7a50c7; }
.planning-source-summary .source-purchased_rework { border-top-color: #d69214; }
.planning-source-summary .source-unconfirmed { border-top-color: #b13c35; }

.planning-source-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 0.7fr) auto;
  align-items: end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.planning-source-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.planning-rule-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.planning-rule-form label {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.planning-rule-form label > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.planning-rule-form output {
  color: var(--ink);
  font-weight: 850;
}

.planning-rule-form input[type="range"] {
  width: 100%;
  accent-color: #147d67;
}

.planning-rule-form input[type="text"] {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}

.planning-adjustment-note,
.planning-rule-actions {
  grid-column: 1 / -1;
}

.planning-rule-actions,
.planning-approval-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.planning-rule-actions button,
.planning-approval-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #147d67;
  border-radius: 5px;
  background: #147d67;
  color: #fff;
  font-weight: 850;
}

.planning-rule-actions button:disabled,
.planning-approval-actions button:disabled {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

.planning-rule-actions svg,
.planning-approval-actions svg {
  width: 16px;
  height: 16px;
}

.planning-form-message {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-left: 4px solid #147d67;
  background: color-mix(in srgb, #147d67 7%, var(--surface));
  color: #147d67;
  font-size: 12px;
  font-weight: 750;
}

.planning-form-message.is-error {
  border-color: #b13c35;
  background: color-mix(in srgb, #b13c35 7%, var(--surface));
  color: #b13c35;
}

.planning-approval-panel {
  display: grid;
  gap: 14px;
}

.planning-approval-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.planning-approval-flow li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-height: 66px;
  padding: 10px;
  background: var(--surface);
}

.planning-approval-flow li > span {
  display: grid;
  grid-row: 1 / 3;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.planning-approval-flow li strong {
  color: var(--ink);
  font-size: 12px;
}

.planning-approval-flow li small {
  color: var(--muted);
  font-size: 10px;
}

.planning-approval-flow li.is-current > span {
  background: #147d67;
  color: #fff;
}

:root[data-theme="dark"] .planning-month-bars {
  background-color: transparent;
}

:root[data-theme="dark"] .planning-safety-strip,
:root[data-theme="dark"] .planning-recommendation-band,
:root[data-theme="dark"] .planning-warning-band {
  background: var(--surface);
}

@media (max-width: 980px) {
  .planning-kpi-band,
  .planning-kpi-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planning-overview-pair {
    grid-template-columns: 1fr;
  }

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

  .planning-group-adjustment {
    grid-template-columns: minmax(160px, 0.6fr) auto;
  }

  .planning-group-adjustment small {
    grid-column: 1 / -1;
  }

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

  .planning-evidence-grid,
  .planning-material-detail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .planning-approval-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .planning-safety-strip > small,
  .planning-recommendation-band > small {
    flex-basis: 100%;
    margin-left: 0;
  }

  .planning-kpi-band,
  .planning-kpi-compact,
  .planning-rule-form {
    grid-template-columns: 1fr;
  }

  .planning-kpi-band > button,
  .planning-kpi-band > div {
    min-height: 92px;
  }

  .planning-filter-grid,
  .planning-group-grid,
  .planning-group-adjustment,
  .planning-source-form,
  .planning-anomaly-list article {
    grid-template-columns: 1fr;
  }

  .planning-group-toggle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planning-group-detail-header {
    align-items: flex-start;
  }

  .planning-group-adjustment small,
  .planning-source-form {
    grid-column: 1;
  }

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

  .planning-anomaly-list article > b {
    font-size: 16px;
  }

  .planning-month-chart {
    grid-template-columns: repeat(12, minmax(68px, 1fr));
  }

  .planning-warning-band summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .planning-warning-band summary span {
    display: none;
  }

  .planning-exception-list article,
  .planning-version-list article {
    grid-template-columns: 1fr 1fr;
  }

  .planning-exception-list article > span:last-child,
  .planning-version-list article > span:last-child {
    grid-column: 1 / -1;
  }

  .planning-machining-chart summary,
  .planning-material-chart summary {
    grid-template-columns: minmax(140px, 1fr) minmax(90px, 0.8fr);
  }

  .planning-machining-chart summary > i,
  .planning-material-chart summary > i {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .planning-machining-chart details > div,
  .planning-evidence-grid,
  .planning-material-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planning-machining-chart details > div p {
    grid-column: 1 / -1;
  }

  .planning-approval-flow {
    grid-template-columns: 1fr;
  }
}

:root[data-theme="dark"] .production-department-filter button,
:root[data-theme="dark"] .production-schedule-row,
:root[data-theme="dark"] .production-main-material-empty {
  background: color-mix(in srgb, #5aa9ee 6%, var(--surface-2));
}

:root[data-theme="dark"] .production-department-filter button.is-active {
  background: var(--amber);
  color: #151515;
}

:root[data-theme="dark"] .production-department-filter button.is-active strong {
  color: #151515;
}

:root[data-theme="dark"] .production-schedule-readiness.is-ready,
:root[data-theme="dark"] .production-execution-kpis article.is-ready strong,
:root[data-theme="dark"] .production-execution-kpis article.is-ready > i {
  color: #56d9bd;
}

:root[data-theme="dark"] .production-schedule-readiness.is-purchase_covered,
:root[data-theme="dark"] .production-execution-kpis article.is-work strong,
:root[data-theme="dark"] .production-execution-kpis article.is-work > i {
  color: #b7a0ff;
}

@media (max-width: 1000px) {
  .production-execution-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .production-schedule-row > summary {
    grid-template-columns: 82px minmax(150px, 1.4fr) minmax(120px, 1fr) auto 18px;
  }

  .production-schedule-row > summary > span:nth-of-type(4) {
    display: none;
  }
}

@media (max-width: 700px) {
  .workbench-hero {
    align-items: flex-start;
    padding: 14px;
  }

  .workbench-hub-hero {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workbench-hub-count,
  .workbench-level-count {
    justify-items: start;
  }

  .workbench-department-grid,
  .workbench-tool-grid {
    grid-template-columns: 1fr;
  }

  .workbench-department-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-height: 92px;
    padding: 13px;
  }

  .workbench-department-icon {
    width: 40px;
    height: 40px;
  }

  .workbench-level-header {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .workbench-back {
    width: 36px;
    height: 36px;
  }

  .workbench-level-title > span {
    display: none;
  }

  .workbench-level-title h2 {
    font-size: 17px;
  }

  .workbench-level-title small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workbench-level-header > .report-refresh {
    min-width: 40px;
    padding-inline: 8px;
    font-size: 0;
  }

  .workbench-level-header > .report-refresh::after {
    content: "↻";
    font-size: 17px;
  }

  .workbench-tool-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 88px;
    padding: 12px;
  }

  .workbench-tool-card > svg {
    display: none;
  }

  .workbench-tool-icon {
    width: 38px;
    height: 38px;
  }

  .workbench-hero h2 {
    font-size: 19px;
  }

  .workbench-hero > .report-refresh {
    flex: 0 0 auto;
    min-width: 42px;
    padding-inline: 9px;
    font-size: 0;
  }

  .workbench-hero > .report-refresh::after {
    content: "↻";
    font-size: 18px;
  }

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

  .workbench-summary article:nth-child(2),
  .production-weight-kpis article:nth-child(2) {
    border-right: 0;
  }

  .workbench-summary article:nth-child(-n + 2),
  .production-weight-kpis article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--soft-line);
  }

  .production-weight-row {
    grid-template-columns: minmax(0, 1fr) 94px;
  }

  .production-weight-row > i {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .production-machining-batch-list {
    grid-template-columns: 1fr;
  }

  .production-machining-batch > summary {
    grid-template-columns: 26px minmax(0, 1fr) 18px;
  }

  .production-machining-batch > summary > span:nth-of-type(2) {
    grid-column: 2 / -1;
  }

  .production-machining-batch > div {
    padding-left: 10px;
  }

  .production-machining-batch > div > span {
    grid-template-columns: 1fr;
    gap: 2px;
  }

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

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

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

  .production-schedule-breakdown article {
    grid-template-columns: minmax(0, 1fr) 88px auto;
  }

  .production-schedule-row > summary {
    grid-template-columns: 78px minmax(0, 1fr) 18px;
    align-items: start;
  }

  .production-schedule-row > summary > span:nth-of-type(3),
  .production-schedule-row > summary > span:nth-of-type(4) {
    display: none;
  }

  .production-schedule-readiness {
    grid-column: 2;
    justify-self: start;
  }

  .production-schedule-row > summary > i:last-child {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 460px) {
  .production-execution-kpis,
  .production-department-filter {
    grid-template-columns: 1fr;
  }

  .production-schedule-breakdown article {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .production-schedule-breakdown article > i {
    grid-column: 1 / -1;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f6f8fb;
  --muted: #9aa8bd;
  --line: #1f2b42;
  --soft-line: #1a2437;
  --surface: #0c1424;
  --surface-2: #070b18;
  --dark: #f5b82e;
  --dark-2: #182136;
  --success: #45d483;
  --warning: #f5b82e;
  --danger: #f87171;
  --amber-dark: #f5c451;
  --chart-open-order: #f87171;
  --chart-management-expense: #fb923c;
  --amber-soft: #1f2534;
  --steel: #8190a6;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  --hub-bg: #091221;
  --hub-panel: #0c1628;
  --hub-panel-soft: #111c2f;
  --hub-line: #3b4659;
  --hub-node: #111b2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(8, 8, 7, 0.04), transparent 220px),
    var(--surface-2);
  color: var(--ink);
}

body::before {
  position: fixed;
  inset: 68px 0 auto 0;
  z-index: -1;
  height: 260px;
  background:
    linear-gradient(90deg, rgba(8, 8, 7, 0.9), rgba(8, 8, 7, 0.48), rgba(8, 8, 7, 0)),
    url("../assets/images/factory-hero.jpg") center 42% / cover;
  opacity: 0.12;
  content: "";
  pointer-events: none;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.erp-ai-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.ai-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(8, 8, 7, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 148px;
  height: auto;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 34px;
  background: var(--line);
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.18;
  font-weight: 820;
  letter-spacing: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 760;
}

.topbar-tool-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.topbar-tool-label {
  min-height: 0;
}

.env-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--success);
}

.language-switcher {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.language-button {
  min-width: 58px;
  min-height: 34px;
  border: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.language-label-compact {
  display: none;
}

.language-button + .language-button {
  border-left: 1px solid var(--line);
}

.language-button.is-active {
  background: var(--amber);
  color: var(--dark);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 0;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.theme-toggle.is-dark {
  border-color: var(--amber);
  background: var(--amber);
  color: #080807;
}

.theme-toggle.is-dark svg {
  color: #080807;
  stroke: currentColor;
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(24, 33, 54, 0.62), transparent 260px),
    #070b18;
}

:root[data-theme="dark"] body::before {
  opacity: 0.08;
}

:root[data-theme="dark"] .ai-topbar,
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .side-panel,
:root[data-theme="dark"] .chat-main,
:root[data-theme="dark"] .chat-header,
:root[data-theme="dark"] .composer,
:root[data-theme="dark"] .report-main {
  background: var(--surface);
}

:root[data-theme="dark"] .ai-topbar {
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .language-button.is-active,
:root[data-theme="dark"] .mobile-nav-button.is-active {
  color: #080807;
}

:root[data-theme="dark"] .topbar-status {
  color: var(--ink);
}

:root[data-theme="dark"] .bubble {
  color: var(--ink);
}

:root[data-theme="dark"] .composer-box {
  background: var(--surface-2);
}

:root[data-theme="dark"] .composer textarea {
  background: var(--surface-2);
  color: var(--ink);
}

:root[data-theme="dark"] :is(.secondary-button, .voice-button, .upload-button, .new-chat) {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

:root[data-theme="dark"] .send-button {
  color: #080807;
}

:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .message:not(.assistant) .avatar {
  color: #080807;
}

:root[data-theme="dark"] .assistant .bubble.pending-bubble {
  background: var(--amber-soft);
  color: var(--ink);
}

:root[data-theme="dark"] .markdown-table-scroll,
:root[data-theme="dark"] .markdown-table td,
:root[data-theme="dark"] .markdown-table tbody tr:nth-child(even) td {
  background: var(--surface-2);
}

:root[data-theme="dark"] .markdown-table th {
  background: var(--dark-2);
}

:root[data-theme="dark"] .markdown-table tbody tr:hover td {
  background: #182136;
}

:root[data-theme="dark"] .bubble.markdown a {
  color: #71b7ff;
}

:root[data-theme="dark"] .theme-toggle {
  border-color: rgba(242, 180, 47, 0.58);
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  flex: 1;
  height: calc(100vh - 68px);
  min-height: 0;
}

.layout.nav-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

.layout.report-layout {
  grid-template-columns: 220px minmax(0, 1fr);
}

.layout.report-layout.nav-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  overflow: auto;
  padding: 20px 12px;
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--line);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #403f3b;
  font-size: 15px;
  font-weight: 680;
  overflow: hidden;
  text-align: left;
}

.nav-item.active {
  background: var(--dark);
  color: var(--amber);
  font-weight: 820;
  box-shadow: inset 3px 0 0 var(--amber);
}

.nav-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 22px;
  place-items: center;
  color: currentColor;
  font-size: 17px;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout.nav-collapsed .sidebar {
  padding-right: 8px;
  padding-left: 8px;
}

.layout.nav-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 0;
}

.layout.nav-collapsed .nav-item.active {
  box-shadow: inset 0 -3px 0 var(--amber);
}

.layout.nav-collapsed .nav-icon {
  width: 100%;
}

.layout.nav-collapsed .nav-label {
  display: none;
}

.collapse {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  color: var(--muted);
  padding: 14px;
  border: 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  text-align: left;
}

.layout.nav-collapsed .collapse {
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #fff, rgba(255, 241, 207, 0.5));
}

.chat-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 820;
}

.new-chat {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--dark);
  border-radius: 4px;
  background: #fff;
  color: var(--dark);
  font-weight: 800;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px;
}

.message {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  max-width: 1080px;
  margin-bottom: 28px;
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 4px;
  background: var(--dark);
  color: var(--amber);
  font-weight: 820;
}

.message.assistant .avatar {
  border: 1px solid var(--amber);
  background: var(--dark-2);
}

.message-body {
  min-width: 0;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.message-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.message-meta strong {
  color: var(--ink);
}

.bubble {
  width: fit-content;
  max-width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-2);
  color: #2f2d29;
  line-height: 1.7;
  white-space: pre-wrap;
}

.bubble.markdown {
  width: 100%;
  white-space: normal;
  font-size: 15px;
  line-height: 1.78;
}

.bubble.markdown p {
  max-width: 82ch;
  margin: 0 0 16px;
}

.bubble.markdown p:last-child,
.bubble.markdown ul:last-child,
.bubble.markdown ol:last-child,
.bubble.markdown blockquote:last-child,
.bubble.markdown .markdown-table-frame:last-child,
.bubble.markdown .markdown-image:last-child,
.bubble.markdown .markdown-code:last-child {
  margin-bottom: 0;
}

.bubble.markdown h2,
.bubble.markdown h3,
.bubble.markdown h4 {
  margin: 4px 0 12px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.bubble.markdown h4 {
  font-size: 16px;
}

.bubble.markdown h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 20px;
}

.bubble.markdown h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bubble.markdown h3::before {
  width: 3px;
  height: 1.05em;
  border-radius: 2px;
  background: var(--amber-2);
  content: "";
}

.bubble.markdown ul,
.bubble.markdown ol {
  max-width: 82ch;
  margin: 0 0 14px;
  padding-left: 24px;
}

.bubble.markdown li {
  margin: 6px 0;
  padding-left: 3px;
}

.bubble.markdown li::marker {
  color: var(--amber-dark);
  font-weight: 800;
}

.bubble.markdown strong {
  font-weight: 850;
}

.bubble.markdown code {
  padding: 1px 5px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-2);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.92em;
}

.bubble.markdown a {
  color: #1464a5;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.bubble.markdown blockquote {
  max-width: 82ch;
  margin: 4px 0 18px;
  padding: 12px 16px;
  border-left: 3px solid var(--amber-2);
  background: color-mix(in srgb, var(--amber-soft) 58%, transparent);
  color: var(--muted);
}

.bubble.markdown blockquote p {
  margin: 0;
}

.bubble.markdown hr {
  max-width: 82ch;
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--soft-line);
}

.markdown-code {
  max-width: 82ch;
  margin: 8px 0 18px;
  overflow: auto;
  padding: 15px 16px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #111827;
  color: #edf2f7;
  font: 13px/1.65 Consolas, "SFMono-Regular", monospace;
  white-space: pre;
}

.markdown-code code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.markdown-table-frame {
  max-width: 100%;
  margin: 12px 0 20px;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.markdown-table-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.markdown-table-caption span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.markdown-table-caption svg {
  width: 16px;
  height: 16px;
  color: var(--amber-dark);
}

.markdown-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  background: #fff;
  scrollbar-color: var(--amber-2) var(--surface-2);
}

.markdown-table {
  min-width: 640px;
  font-size: 14px;
  border-collapse: separate;
  border-spacing: 0;
}

.markdown-table th,
.markdown-table td {
  padding: 11px 13px;
  border-right: 1px solid var(--soft-line);
  white-space: normal;
  vertical-align: top;
}

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

.markdown-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff7e0;
  color: var(--ink);
  font-weight: 850;
}

.markdown-table td {
  background: #fff;
}

.markdown-table tbody tr:nth-child(even) td {
  background: #fbfaf7;
}

.markdown-table tbody tr:hover td {
  background: #fff7e0;
}

.markdown-table .align-center {
  text-align: center;
}

.markdown-table .align-right,
.markdown-table .is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.markdown-image,
.response-image {
  max-width: min(720px, 100%);
  margin: 10px 0 18px;
}

.markdown-image img,
.response-image img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 520px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
  object-fit: contain;
}

.markdown-image figcaption,
.response-image figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.markdown-inline-image {
  max-width: min(100%, 640px);
  max-height: 420px;
  border-radius: 6px;
  vertical-align: middle;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.message-image-link {
  display: block;
  width: min(260px, 100%);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.message-image-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.message-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
}

.message-attachment-file svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--amber-dark);
}

.message-attachment-file small {
  color: var(--muted);
}

.response-artifacts {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 9px 12px;
  max-width: 100%;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.response-artifacts-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.response-artifacts-label svg,
.response-file-link svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.response-artifact-list {
  display: flex;
  align-items: flex-start;
  flex: 1 1 420px;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.response-artifact-list .response-image {
  flex: 0 1 178px;
  width: min(178px, 100%);
  margin: 0;
}

.response-image-link {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.response-artifact-list .response-image img {
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: center top;
  transition: transform 160ms ease;
}

.response-image-link:hover img {
  transform: scale(1.025);
}

.response-artifact-list .response-image figcaption {
  overflow: hidden;
  margin-top: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.response-file-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.response-file-link:hover {
  border-color: var(--amber-2);
  background: var(--amber-soft);
}

.response-file-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.response-file-link small {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 500;
}

.assistant .bubble {
  border: 0;
  background: transparent;
  padding: 0;
}

.message.is-pending .message-meta span {
  color: var(--warning);
}

.assistant .bubble.pending-bubble {
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--soft-line);
  background: rgba(255, 241, 207, 0.5);
}

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: var(--dark);
  font-weight: 760;
  white-space: nowrap;
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.thinking-dots i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber-2);
  animation: thinking-pulse 1.05s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes thinking-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.result-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.table-scroll {
  max-width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
}

.composer {
  padding: 16px 28px 22px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(246, 244, 239, 0.35), #fff);
}

.voice-status {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--amber);
  border-radius: 4px;
  background: var(--amber-soft);
  color: var(--dark);
  font-size: 13px;
  font-weight: 760;
}

.composer-box {
  border: 1px solid var(--dark);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(8, 8, 7, 0.08);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 88px;
  max-height: 220px;
  resize: vertical;
  padding: 18px;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.composer textarea::placeholder {
  color: var(--steel);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 12px;
}

.composer-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-select {
  min-width: 180px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
}

.send-button,
.secondary-button,
.voice-button,
.upload-button {
  height: 38px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 820;
}

.send-button {
  min-width: 82px;
  padding: 0 18px;
  border: 1px solid var(--amber);
  background: var(--amber);
  color: var(--dark);
}

.send-button:hover {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--amber);
}

.send-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.secondary-button {
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.voice-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.voice-button.is-listening {
  border-color: var(--amber);
  background: var(--dark);
  color: var(--amber);
}

.voice-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.upload-button {
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.file-input {
  display: none;
}

.file-selection {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 13px;
}

.file-chips {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-chip img,
.file-chip svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 3px;
  object-fit: cover;
}

.file-selection button {
  border: 0;
  background: transparent;
  color: var(--amber-2);
  font-size: 13px;
  font-weight: 800;
}

.file-selection em {
  color: var(--success);
  font-style: normal;
  font-weight: 760;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: rgba(246, 244, 239, 0.9);
  border-left: 1px solid var(--line);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(8, 8, 7, 0.04);
}

.panel h3 {
  margin: 0;
  padding: 17px 18px 8px;
  font-size: 17px;
  font-weight: 820;
}

.panel h3::after {
  display: block;
  width: 34px;
  height: 3px;
  margin-top: 8px;
  background: var(--amber);
  content: "";
}

.source-card,
.rule-row,
.history-row {
  margin: 12px 18px;
}

.source-card {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-2);
}

.answer-provider-card {
  background: #fff;
}

.source-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 820;
}

.status-ok,
.status-warn {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}

.status-ok {
  background: rgba(21, 122, 71, 0.1);
  color: var(--success);
}

.status-warn {
  background: var(--amber-soft);
  color: var(--warning);
}

.source-meta,
.rule-row,
.history-row {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.rule-row {
  display: flex;
  gap: 9px;
}

.rule-ok {
  color: var(--success);
  font-weight: 900;
}

.rule-warn {
  color: var(--warning);
  font-weight: 900;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--soft-line);
}

.history-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  margin: 20px 18px;
  color: var(--steel);
  font-size: 13px;
}

.mobile-nav {
  display: none;
}

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

.report-main {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px;
  background: #f4f5f7;
}

.report-hub-main {
  padding: 36px 34px 24px;
  background: var(--hub-bg);
}

.report-hub {
  width: min(100%, 1280px);
  margin: 0 auto;
  color: var(--ink);
}

.report-hub-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  min-height: 48px;
  margin-bottom: 42px;
  border: 1px solid var(--hub-line);
  border-radius: 7px;
  background: var(--hub-panel);
  overflow: hidden;
}

.report-hub-search,
.report-hub-role {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--muted);
}

.report-hub-search {
  gap: 12px;
  padding: 0 16px;
}

.report-hub-search svg,
.report-hub-role svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.report-hub-search input,
.report-hub-role select {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.report-hub-search input::placeholder {
  color: var(--muted);
}

.report-hub-search:focus-within,
.report-hub-role:focus-within {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
  background: var(--hub-panel-soft);
}

.report-hub-search input:focus-visible,
.report-hub-role select:focus-visible {
  outline: 0;
}

.report-hub-role {
  gap: 10px;
  padding: 0 14px;
  border-left: 1px solid var(--hub-line);
  background: var(--hub-panel-soft);
}

.report-hub-role select {
  appearance: none;
  font-weight: 800;
}

.report-hub-role > svg:last-child {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.report-hub-status {
  margin: -26px 0 28px;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: var(--hub-panel-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.report-hub-status:empty {
  display: none;
}

.report-hub-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.35fr) minmax(330px, 0.78fr);
  gap: 30px;
  min-width: 0;
}

.report-hub-map {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.report-hub-center {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 100px;
  padding: 18px 20px;
  border: 1px solid var(--hub-line);
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  background: var(--hub-node);
  color: var(--ink);
  text-align: left;
}

.report-hub-center > span:first-child {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 10px;
  background: var(--amber-soft);
}

.report-hub-center svg {
  width: 30px;
  height: 30px;
  color: var(--amber);
}

.report-hub-center > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.report-hub-center small,
.report-hub-center em {
  color: var(--muted);
  font-style: normal;
}

.report-hub-center small {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.report-hub-center strong {
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.report-hub-center em {
  font-size: 13px;
}

.report-hub-department-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-hub-department {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 112px;
  padding: 15px 34px 15px 15px;
  border: 1px solid var(--hub-line);
  border-radius: 10px;
  background: var(--hub-node);
  color: var(--ink);
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.report-hub-department:not([aria-disabled="true"]):hover,
.report-hub-department:focus-visible {
  border-color: var(--department-accent, var(--amber));
  outline: 2px solid rgba(242, 180, 47, 0.18);
  outline-offset: 2px;
  background: var(--hub-panel-soft);
  transform: translateY(-2px);
}

.report-hub-department:not([aria-disabled="true"]):active {
  transform: translateY(0);
}

.report-hub-department[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.82;
}

.report-hub-department.is-selected {
  border-color: var(--department-accent, var(--amber));
  background: var(--amber-soft);
}

.report-hub-department-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--department-accent, var(--amber)) 13%, transparent);
}

.report-hub-department-icon svg {
  width: 24px;
  height: 24px;
  color: var(--department-accent, var(--amber));
}

.report-hub-department-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.report-hub-department-copy strong {
  line-height: 1.15;
  font-weight: 820;
}

.report-hub-department-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-wrap: pretty;
}

.report-hub-access {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid var(--hub-node);
  border-radius: 50%;
  background: var(--success);
  color: #fff;
}

.report-hub-access.is-requestable {
  background: var(--warning);
}

.report-hub-access.is-locked {
  background: var(--steel);
}

.report-hub-access svg {
  width: 12px;
  height: 12px;
}

.report-hub-department.is-ceo {
  grid-column: 1 / -1;
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 100px;
  border-color: color-mix(in srgb, var(--amber) 68%, var(--hub-line));
  background: linear-gradient(100deg, var(--amber-soft), var(--hub-node) 58%);
  --department-accent: var(--amber);
}

.report-hub-department.is-ceo .report-hub-department-icon {
  width: 52px;
  height: 52px;
  border-radius: 11px;
}

.report-hub-department.is-ceo .report-hub-department-icon svg {
  width: 30px;
  height: 30px;
}

.report-hub-department.is-ceo .report-hub-department-copy strong {
  font-size: 18px;
  letter-spacing: -0.01em;
}

.report-hub-department.is-sales {
  --department-accent: var(--amber);
}

.report-hub-department.is-finance {
  --department-accent: #4e83d9;
}

.report-hub-department.is-production {
  --department-accent: #3e9c87;
}

.report-hub-department.is-procurement {
  --department-accent: #8c68ce;
}

.report-hub-department.is-quality {
  --department-accent: #e98a38;
}

.report-hub-department.is-management {
  --department-accent: #7d8798;
}

.report-hub-panel {
  min-width: 0;
  padding: 10px 0 0 30px;
  border-left: 1px solid var(--hub-line);
}

.report-hub-panel h2,
.report-hub-recent h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 850;
}

.report-hub-panel h2 {
  color: var(--amber-dark);
}

:root[data-theme="dark"] .report-hub-panel h2 {
  color: var(--amber);
}

.report-hub-panel-accent {
  width: 36px;
  height: 3px;
  margin: 13px 0 28px;
  border-radius: 3px;
  background: var(--amber);
}

.report-hub-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.report-hub-shortcut {
  display: grid;
  gap: 12px;
  min-width: 0;
  min-height: 128px;
  place-items: center;
  align-content: center;
  padding: 14px 10px;
  border: 1px solid var(--hub-line);
  border-radius: 7px;
  background: var(--hub-panel);
  color: var(--ink);
  text-align: center;
}

.report-hub-shortcut:hover,
.report-hub-shortcut:focus-visible {
  border-color: var(--amber);
  outline: 2px solid rgba(242, 180, 47, 0.18);
  outline-offset: 2px;
  background: var(--hub-panel-soft);
}

.report-hub-shortcut svg {
  width: 35px;
  height: 35px;
  color: var(--amber-dark);
}

:root[data-theme="dark"] .report-hub-shortcut svg {
  color: var(--amber);
}

.report-hub-shortcut strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.report-hub-panel.is-ceo .report-hub-shortcuts {
  grid-template-columns: minmax(0, 1fr);
}

.report-hub-panel.is-ceo .report-hub-shortcut {
  min-height: 160px;
  border-color: color-mix(in srgb, var(--amber) 54%, var(--hub-line));
  background: linear-gradient(145deg, var(--amber-soft), var(--hub-panel) 62%);
}

.report-hub-panel.is-ceo .report-hub-shortcut svg {
  width: 44px;
  height: 44px;
}

.report-hub-recent {
  margin-top: 60px;
  padding-top: 2px;
}

.report-hub-recent h2 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15px;
}

.report-hub-recent-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.report-hub-recent-list button {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.report-hub-recent-list button:hover,
.report-hub-recent-list button:focus-visible {
  outline: 1px solid var(--hub-line);
  background: var(--hub-panel-soft);
}

.report-hub-recent-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 6px;
  background: var(--hub-panel-soft);
  color: var(--muted);
}

.report-hub-recent-icon svg {
  width: 23px;
  height: 23px;
}

.report-hub-recent-list button > span:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.report-hub-recent-list strong,
.report-hub-recent-list time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-hub-recent-list strong {
  font-size: 13px;
}

.report-hub-recent-list time {
  color: var(--muted);
  font-size: 12px;
}

.bi-report-header,
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(8, 8, 7, 0.04);
}

.bi-report-title {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 10px;
}

.bi-report-header h2,
.report-toolbar h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.16;
  font-weight: 850;
  white-space: nowrap;
}

.bi-report-header p,
.report-toolbar p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bi-report-actions,
.report-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.bi-report-actions {
  flex-wrap: nowrap;
}

.bi-report-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.bi-report-actions .report-refresh {
  min-height: 30px;
  border-color: var(--dark);
  background: var(--dark);
  color: var(--amber);
}

.bi-filter-panel {
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(8, 8, 7, 0.035);
}

.bi-filter-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 7px 10px;
  cursor: pointer;
  list-style: none;
}

.bi-filter-panel > summary::-webkit-details-marker,
.foreign-price-months > summary::-webkit-details-marker {
  display: none;
}

.bi-filter-panel > summary > span:first-child {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 9px;
}

.bi-filter-panel > summary strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.bi-filter-panel > summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bi-filter-panel-action {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.bi-filter-panel-action i {
  font-style: normal;
}

.bi-filter-panel-action .is-expanded,
.bi-filter-panel[open] .bi-filter-panel-action .is-collapsed {
  display: none;
}

.bi-filter-panel[open] .bi-filter-panel-action .is-expanded {
  display: inline;
}

.bi-filter-panel[open] > summary {
  border-bottom: 1px solid var(--soft-line);
}

.bi-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(8, 8, 7, 0.035);
}

.bi-filter-panel .bi-filter-bar {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.bi-filter-item,
.bi-filter-select {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
}

.bi-filter-select {
  grid-column: 1 / -1;
}

.bi-filter-item span,
.bi-filter-select > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.bi-filter-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-date-input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.bi-filter-buttons {
  margin: 0;
}

.report-freshness {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.report-refresh {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--dark);
  border-radius: 4px;
  background: var(--dark);
  color: var(--amber);
  font-size: 13px;
  font-weight: 850;
}

.report-refresh:disabled {
  cursor: progress;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.report-view-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(8, 8, 7, 0.035);
}

.report-view-tabs button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.report-view-tabs button.is-active,
.report-view-tabs button:hover {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--amber);
}

.overview-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  min-height: 98px;
  overflow: hidden;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(8, 8, 7, 0.04);
  text-align: left;
}

.kpi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.kpi-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.05;
  font-weight: 900;
}

.kpi-card em {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #56534c;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.overview-kpi {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.overview-kpi:hover {
  border-color: var(--dark);
  box-shadow: 0 10px 22px rgba(8, 8, 7, 0.08);
  transform: translateY(-1px);
}

.bi-overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.bi-overview-card {
  grid-column: span 4;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(8, 8, 7, 0.04);
}

.bi-overview-card-wide {
  grid-column: span 4;
}

.bi-overview-card header,
.report-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.bi-overview-card h3,
.report-detail-hero h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
}

.bi-overview-card p,
.report-detail-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.report-detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr) auto;
  align-items: stretch;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(8, 8, 7, 0.035);
}

.report-detail-copy {
  min-width: 0;
}

.report-detail-hero span {
  display: block;
  margin-bottom: 5px;
  color: var(--amber-dark);
  font-size: 11px;
  font-weight: 900;
}

.report-detail-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.report-detail-kpi {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
}

.report-detail-kpi span,
.report-detail-kpi em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-detail-kpi strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.report-detail-kpi.tone-risk strong {
  color: var(--danger);
}

.report-detail-kpi.tone-good strong,
.report-detail-kpi.tone-receipt strong {
  color: var(--success);
}

.report-detail-kpi.tone-purchase strong {
  color: #5b4abf;
}

.report-detail-kpi.tone-expense strong {
  color: #cf5d55;
}

.report-detail-kpi.tone-sales strong {
  color: var(--amber-dark);
}

.detail-hero-cash {
  border-color: rgba(255, 255, 255, 0.08);
  background: #080807;
}

.detail-hero-cash h3,
.detail-hero-cash p,
.detail-hero-cash .report-detail-copy span {
  color: #fff;
}

.detail-hero-cash p,
.detail-hero-cash .report-detail-kpi span,
.detail-hero-cash .report-detail-kpi em {
  color: #a9b3c0;
}

.detail-hero-cash .report-detail-kpi {
  border-color: rgba(255, 255, 255, 0.08);
  background: #151515;
}

.detail-hero-cash .report-detail-kpi strong {
  color: #fff;
}

.report-detail-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.report-detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.report-detail-nav a {
  min-height: 30px;
  padding: 7px 11px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.report-detail-nav a:hover,
.report-detail-nav a:focus-visible {
  border-color: var(--dark);
  color: var(--ink);
}

.detail-section-feature {
  border-color: rgba(226, 176, 66, 0.36);
  background: linear-gradient(180deg, #fffdf8, #fff);
}

.drilldown-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--dark);
  border-radius: 5px;
  background: var(--dark);
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.overview-metric-list,
.cashflow-snapshot,
.risk-snapshot {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.overview-metric-row {
  display: grid;
  grid-template-columns: minmax(94px, 0.85fr) minmax(0, 1.15fr) minmax(84px, max-content);
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
}

.overview-metric-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.overview-metric-row strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

.overview-metric-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-align: right;
}

.cashflow-snapshot .overview-metric-row {
  grid-template-columns: minmax(92px, 0.75fr) minmax(64px, 1fr) minmax(126px, max-content);
  row-gap: 4px;
}

.cashflow-snapshot .overview-metric-row > * {
  min-width: 0;
}

.cashflow-snapshot .overview-metric-row strong {
  white-space: nowrap;
}

.cashflow-snapshot .overview-metric-row em {
  grid-column: 2 / -1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.overview-metric-row.tone-good .bar-track i,
.risk-bucket-row.tone-good .bar-track i {
  background: var(--success);
}

.overview-metric-row.tone-work .bar-track i,
.risk-bucket-row.tone-work .bar-track i {
  background: #5f6f8f;
}

.overview-metric-row.tone-warn .bar-track i,
.risk-bucket-row.tone-warn .bar-track i {
  background: var(--warning);
}

.overview-metric-row.tone-risk .bar-track i,
.risk-bucket-row.tone-risk .bar-track i {
  background: var(--danger);
}

.overview-sparkline {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 112px;
  margin-top: 14px;
  padding: 12px 10px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
}

.overview-sparkline span {
  display: grid;
  flex: 1 1 0;
  min-width: 16px;
  height: 88px;
  align-items: end;
  gap: 5px;
}

.overview-sparkline i {
  display: block;
  min-height: 8px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--amber), #d6a027);
}

.overview-sparkline b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
}

.risk-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.risk-summary-strip span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(165, 53, 47, 0.18);
  border-radius: 6px;
  background: #fff8f6;
}

.risk-summary-strip strong {
  color: var(--danger);
  font-size: 18px;
  font-weight: 900;
}

.risk-summary-strip em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.risk-bucket-list,
.risk-top-list {
  display: grid;
  gap: 8px;
}

.risk-bucket-row,
.risk-top-list button {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
  color: var(--ink);
  text-align: left;
}

.risk-bucket-row {
  grid-template-columns: 100px minmax(0, 1fr) 56px;
  gap: 8px;
  padding: 7px 9px;
}

.risk-bucket-row span,
.risk-bucket-row strong {
  font-size: 12px;
  font-weight: 850;
}

.risk-bucket-row strong {
  text-align: right;
}

.risk-top-list button {
  grid-template-columns: 82px minmax(0, 1fr) 70px;
  gap: 8px;
  padding: 8px 10px;
}

.risk-top-list strong,
.risk-top-list span,
.risk-top-list em {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-top-list strong {
  color: var(--ink);
  font-weight: 900;
}

.risk-top-list span {
  color: var(--muted);
}

.risk-top-list em {
  color: var(--danger);
  font-style: normal;
  text-align: right;
}

.risk-shortage-preview {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.tone-risk strong,
.tone-risk .bar-track i {
  color: var(--danger);
}

.tone-risk {
  border-color: rgba(165, 53, 47, 0.22);
}

.tone-finance {
  border-color: rgba(21, 122, 71, 0.2);
}

.ceo-cockpit-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 50px;
  margin: 0 8px 8px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.ceo-cockpit-title,
.ceo-cockpit-actions {
  display: flex;
  align-items: center;
}

.ceo-cockpit-title {
  gap: 10px;
  min-width: 0;
}

.ceo-cockpit-title span {
  display: grid;
  min-width: 42px;
  min-height: 28px;
  place-items: center;
  border-radius: 5px;
  background: var(--amber);
  color: #080807;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.ceo-cockpit-title strong {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.ceo-cockpit-actions {
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.ceo-cockpit-actions small {
  margin-right: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ceo-cockpit-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.ceo-cockpit-actions button:hover,
.ceo-cockpit-actions button:focus-visible {
  border-color: var(--amber);
  outline: 2px solid rgba(242, 180, 47, 0.18);
  outline-offset: 1px;
}

.ceo-cockpit-actions .report-refresh {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--amber);
}

.executive-command {
  display: grid;
  grid-template-columns: minmax(240px, 286px) minmax(0, 1fr) minmax(236px, 284px);
  gap: 24px;
  min-height: calc(100vh - 124px);
  padding: 10px 8px 28px;
}

.command-cash-rail,
.command-chart-panel,
.command-customer-panel,
.command-entry-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.command-cash-rail {
  display: flex;
  flex-direction: column;
  gap: 34px;
  min-height: 720px;
  padding: 38px 28px;
  background: #080807;
  color: #fff;
}

.command-cash-rail h1,
.command-section-heading h2,
.command-entry-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 900;
}

.command-cash-rail p,
.command-section-heading p,
.command-entry-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.command-cash-rail p {
  color: #94a0ad;
}

.command-rail-metrics {
  display: grid;
  gap: 42px;
}

.command-rail-card {
  display: grid;
  gap: 10px;
  min-height: 82px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  background: #151515;
}

.command-rail-card span {
  color: #9aa8bd;
  font-size: 12px;
  font-weight: 800;
}

.command-rail-card strong {
  font-size: 25px;
  line-height: 1.1;
  font-weight: 900;
}

.command-rail-card.tone-risk strong {
  color: var(--amber);
}

.command-rail-card.tone-receipt strong {
  color: #65d9ff;
}

.command-rail-card.tone-purchase strong {
  color: #b096ff;
}

.command-rail-card.tone-expense strong {
  color: #ff877d;
}

.command-assumptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.command-assumption-slider {
  display: grid;
  grid-template-columns: auto auto minmax(90px, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.command-assumption-slider span,
.command-assumptions p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.command-assumption-slider strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.command-assumption-slider input[type="range"] {
  width: 100%;
  height: 20px;
  accent-color: var(--amber);
}

.command-assumption-slider input[type="range"]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.command-assumptions p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 11px;
}

.cash-forecast-scope-switch {
  display: grid;
  grid-template-columns: auto minmax(0, max-content) minmax(180px, 1fr);
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.cash-forecast-scope-switch > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.cash-forecast-scope-options {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
}

.cash-forecast-scope-options button {
  min-height: 30px;
  padding: 5px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.cash-forecast-scope-options button:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}

.cash-forecast-scope-options button.is-active {
  color: #17130b;
  background: var(--amber);
  box-shadow: 0 1px 3px rgba(32, 24, 8, 0.16);
}

.cash-forecast-scope-options button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.cash-forecast-scope-switch em {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
  text-align: right;
}

.command-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.command-chart-panel,
.command-customer-panel {
  min-width: 0;
}

.command-chart-panel,
.command-customer-panel,
.command-entry-panel {
  background: #f6f4ef;
  box-shadow: 0 8px 18px rgba(8, 8, 7, 0.035);
}

.command-chart-panel {
  min-height: 410px;
  padding: 28px 30px 24px;
}

.command-customer-panel {
  min-height: 264px;
  padding: 28px 30px;
}

.command-section-heading,
.command-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.command-detail-link,
.command-entry-card em {
  color: var(--amber-dark);
  font-size: 12px;
  font-weight: 900;
}

.command-detail-link {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  white-space: nowrap;
}

.command-cash-chart {
  min-height: 282px;
  margin-top: 26px;
  overflow: hidden;
}

.command-chart-scroll {
  overflow: hidden;
}

.command-chart-window-control {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 8px 8px 4px;
}

.command-chart-window-control input[type="range"] {
  width: 100%;
  accent-color: var(--amber);
}

.command-chart-plot {
  position: relative;
  min-height: 238px;
}

.command-chart-redraw {
  animation: command-chart-window-redraw 240ms ease-out both;
}

.command-chart-grid {
  position: absolute;
  inset: 6px 0 52px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  pointer-events: none;
}

.command-chart-grid i {
  border-top: 1px solid var(--soft-line);
}

.command-safety-line {
  position: absolute;
  inset: 28px 12px 52px;
  z-index: 2;
  width: calc(100% - 24px);
  height: calc(100% - 80px);
  overflow: visible;
  pointer-events: none;
}

.command-safety-segment,
.command-safety-point,
.command-safety-zero-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: command-safety-line-redraw 280ms ease-out both;
  vector-effect: non-scaling-stroke;
}

.command-safety-segment {
  stroke-width: 2.4;
}

.command-safety-segment.is-positive {
  stroke: var(--chart-safety);
}

.command-safety-segment.is-risk {
  stroke: var(--chart-risk);
}

.command-safety-point.is-positive {
  stroke: var(--chart-safety);
}

.command-safety-point.is-risk {
  stroke: var(--chart-risk);
}

.command-safety-point {
  stroke-width: 7;
}

.command-safety-zero-line {
  stroke: color-mix(in srgb, var(--ink) 48%, transparent);
  stroke-dasharray: 5 4;
  stroke-width: 1.2;
}

.command-chart-series {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(7, minmax(58px, 1fr));
  gap: 16px;
  min-height: 238px;
  padding: 22px 12px 0;
}

.command-month {
  position: relative;
  display: grid;
  grid-template-rows: minmax(156px, 1fr) 22px;
  align-items: end;
  min-width: 0;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  transition:
    transform 220ms ease-out,
    border-color 180ms ease-out,
    background-color 180ms ease-out,
    box-shadow 220ms ease-out;
}

.command-month:hover,
.command-month:focus-visible {
  border-color: color-mix(in srgb, var(--chart-safety) 48%, transparent);
  outline: none;
}

.command-month.is-selected {
  border-color: var(--chart-safety);
  background: color-mix(in srgb, var(--chart-safety) 9%, transparent);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--chart-safety) 62%, transparent);
  transform: translateY(-4px);
}

.command-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  height: 160px;
}

.command-bars b {
  display: block;
  width: 10px;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  transform-origin: bottom;
  transition: height 260ms ease-out, opacity 180ms ease-out, transform 220ms ease-out;
  animation: command-chart-bar-redraw 220ms ease-out both;
}

.command-bars .is-receipt,
.command-chart-legend .is-receipt {
  background: var(--chart-receipt);
}

.command-bars .is-open-order,
.command-chart-legend .is-open-order {
  background: var(--chart-open-order);
}

.command-bars .is-purchase,
.command-chart-legend .is-purchase {
  background: var(--chart-purchase);
}

.command-bars .is-sales-expense,
.command-chart-legend .is-sales-expense {
  background: var(--chart-sales-expense);
}

.command-bars .is-management-expense,
.command-chart-legend .is-management-expense {
  background: var(--chart-management-expense);
}

.command-month span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  transition: color 180ms ease-out;
  animation: command-chart-label-redraw 220ms ease-out both;
}

@keyframes command-chart-window-redraw {
  from {
    opacity: 0.58;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes command-chart-bar-redraw {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

@keyframes command-chart-label-redraw {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes command-safety-line-redraw {
  from {
    opacity: 0.35;
    stroke-dashoffset: 1;
  }
  to {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

.command-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 8px 8px 0;
}

.command-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.command-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.command-chart-legend .is-safety {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--chart-safety) 0 50%, var(--chart-risk) 50% 100%);
}

.command-month-detail {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 10px 8px 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.command-month-detail-title {
  font-size: 14px;
  white-space: nowrap;
}

.command-month-detail-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px 14px;
}

.command-month-detail-values > div {
  min-width: 0;
}

.command-month-detail-values span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
}

.command-month-detail-values span i {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
}

.command-month-detail-values strong {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
}

.command-month-detail-values .is-open-order span { color: var(--chart-open-order); }
.command-month-detail-values .is-receipt span { color: var(--chart-receipt); }
.command-month-detail-values .is-purchase span { color: var(--chart-purchase); }
.command-month-detail-values .is-sales-expense span { color: var(--chart-sales-expense); }
.command-month-detail-values .is-management-expense span { color: var(--chart-management-expense); }
.command-month-detail-values .is-safety span { color: var(--chart-safety); }

.command-customer-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.command-customer-list button {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, max-content) 58px;
  align-items: center;
  gap: 18px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.command-customer-list span,
.command-customer-list em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-customer-list span {
  font-size: 13px;
}

.command-customer-list strong {
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.command-customer-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.command-entry-panel {
  display: grid;
  align-content: start;
  gap: 28px;
  min-height: 700px;
  padding: 30px 24px;
  background: #fff;
}

.command-entry-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border: 0;
  border-radius: 6px;
  background: #f3f1ed;
  color: var(--ink);
  text-align: left;
}

.command-entry-card strong,
.command-entry-card small {
  display: block;
  min-width: 0;
}

.command-entry-card strong {
  font-size: 15px;
  font-weight: 900;
}

.command-entry-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.command-mobile-note {
  align-self: end;
  display: grid;
  gap: 7px;
  margin-top: 6px;
  padding: 14px 16px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  background: var(--amber-soft);
}

.command-mobile-note strong {
  font-size: 13px;
  font-weight: 900;
}

.command-mobile-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

:root[data-theme="dark"] .command-cash-rail {
  background: #050813;
  border-color: rgba(242, 180, 47, 0.28);
  box-shadow: inset 0 0 0 1px rgba(242, 180, 47, 0.06);
}

:root[data-theme="dark"] .command-rail-card {
  background: #11192a;
  border-color: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .command-assumptions {
  background: #101a2c;
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .cash-forecast-scope-switch {
  background: #101a2c;
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .cash-forecast-scope-options {
  background: #070b18;
}

:root[data-theme="dark"] .cash-forecast-scope-options button:hover {
  background: #182238;
}

:root[data-theme="dark"] .command-assumptions input {
  background: #070b18;
}

:root[data-theme="dark"] .command-chart-panel,
:root[data-theme="dark"] .command-customer-panel,
:root[data-theme="dark"] .command-entry-panel,
:root[data-theme="dark"] .command-customer-list button,
:root[data-theme="dark"] .command-entry-card {
  background: #0c1424;
}

:root[data-theme="dark"] .command-chart-panel,
:root[data-theme="dark"] .command-customer-panel,
:root[data-theme="dark"] .command-entry-panel {
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .command-entry-card,
:root[data-theme="dark"] .command-customer-list button {
  border: 1px solid var(--soft-line);
}

:root[data-theme="dark"] .command-mobile-note {
  background: rgba(242, 180, 47, 0.1);
}

.bi-canvas,
.report-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.report-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(8, 8, 7, 0.04);
}

.bi-visual {
  grid-column: span 6;
}

.bi-visual-wide,
.report-section-wide {
  grid-column: 1 / -1;
}

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

.section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 850;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.sales-execution-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sales-execution-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
}

.sales-execution-head,
.sales-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sales-execution-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.sales-execution-main {
  display: grid;
  gap: 4px;
}

.sales-execution-main b {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.sales-execution-main em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.stacked-bar {
  display: flex;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece8de;
}

.stacked-bar i {
  display: block;
  min-width: 1px;
}

.stacked-bar .is-shipped {
  background: var(--success);
}

.stacked-bar .is-open {
  background: var(--warning);
}

.sales-legend {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.sales-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 999px;
}

.legend-shipped {
  background: var(--success);
}

.legend-open {
  background: var(--warning);
}

.donut-layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.donut-chart {
  display: grid;
  width: 176px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
}

.donut-chart > div {
  display: grid;
  width: 116px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.donut-chart strong {
  align-self: end;
  font-size: 22px;
  line-height: 1;
}

.donut-chart span {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.donut-legend {
  display: grid;
  gap: 8px;
}

.donut-legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.donut-legend-row i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.donut-legend-row span {
  color: var(--ink);
  font-weight: 800;
}

.donut-legend-row strong {
  color: var(--ink);
}

.donut-legend-row em {
  min-width: 38px;
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.donut-legend-row.is-active {
  border-radius: 4px;
  background: #fff8e5;
}

.bi-bar-chart {
  display: grid;
  gap: 10px;
}

.bi-bar-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.bi-bar-row.is-active {
  border-color: var(--dark);
  background: #fff8e5;
}

.bi-bar-row span {
  font-size: 12px;
  font-weight: 850;
}

.bi-bar-row strong {
  font-size: 12px;
  text-align: right;
}

.bi-bar-row em {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.section-heading > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.risk-method-note {
  grid-column: 1 / -1;
}

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

.risk-method-grid > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
}

.risk-method-grid strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.risk-method-grid p,
.risk-method-status,
.mrp-drilldown-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.risk-method-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--success);
  background: #f2fbf6;
}

.risk-method-status.is-warning,
.mrp-drilldown-note.is-warning {
  border-left-color: var(--warning);
  background: #fff8e5;
}

.execution-bars,
.product-groups,
.family-bars,
.receipt-list {
  display: grid;
  gap: 11px;
}

.receipt-month-chart {
  display: grid;
  gap: 10px;
}

.receipt-month {
  display: grid;
  gap: 8px;
}

.receipt-month-row {
  display: grid;
  grid-template-columns: 78px minmax(90px, 1fr) minmax(172px, max-content) 48px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
  color: var(--ink);
  text-align: left;
}

.receipt-month-row:hover,
.receipt-month.is-expanded .receipt-month-row {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.receipt-month-label,
.receipt-month-amount strong {
  font-size: 13px;
  font-weight: 850;
}

.receipt-month-amount {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.receipt-month-amount strong {
  white-space: nowrap;
}

.receipt-month-amount small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.25;
  max-width: 260px;
}

.receipt-month-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.receipt-month-bar {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e1d6;
}

.receipt-month-bar i {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: var(--amber);
}

.receipt-month-detail {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.payment-forecast-grid,
.foreign-outstanding-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(300px, 1.08fr);
  gap: 12px;
  align-items: start;
}

.foreign-price-basis {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.foreign-price-month-chart {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.foreign-price-months {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--surface);
}

.foreign-price-months > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
}

.foreign-price-months > summary > span {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 8px;
}

.foreign-price-months > summary strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.foreign-price-months > summary small,
.foreign-price-months > summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.foreign-price-months > summary::after {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-left: -4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.foreign-price-months[open] > summary {
  border-bottom: 1px solid var(--soft-line);
}

.foreign-price-months[open] > summary::after {
  transform: rotate(225deg);
}

.foreign-price-months .foreign-price-month-chart {
  max-height: 500px;
  padding: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.foreign-price-month {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.foreign-price-month:hover,
.foreign-price-month:focus-visible {
  border-color: color-mix(in srgb, var(--amber) 72%, var(--soft-line));
}

.foreign-price-month:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--amber) 44%, transparent);
  outline-offset: 2px;
}

.foreign-price-month.is-selected {
  border-color: var(--amber);
  background: var(--amber-soft);
  box-shadow: inset 3px 0 0 var(--amber);
}

.foreign-price-month-head,
.foreign-price-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 10px;
}

.foreign-price-month-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.foreign-price-month-head span,
.foreign-price-balance span,
.foreign-price-balance small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.foreign-price-month-head span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.foreign-current-month-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--dark);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.foreign-month-detail-panel {
  max-height: 566px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.foreign-month-detail-head > span {
  display: grid;
  gap: 2px;
  color: var(--ink);
  text-align: left;
}

.foreign-month-detail-head small {
  color: var(--muted);
  font-size: 11px;
}

.foreign-month-detail-head > em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.foreign-month-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.foreign-month-status-grid > span {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.foreign-month-status-grid small,
.foreign-month-status-grid em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

.foreign-month-status-grid strong {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.foreign-month-status-grid .is-paid {
  border-top: 3px solid var(--success);
}

.foreign-month-status-grid .is-unpaid {
  border-top: 3px solid var(--amber);
}

.foreign-month-document-section {
  display: grid;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.foreign-month-document-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px 0;
}

.foreign-month-document-section > header strong {
  color: var(--ink);
  font-size: 12px;
}

.foreign-month-document-section > header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.foreign-month-document-section .summary-drilldown-list {
  padding: 0 8px 8px;
}

.foreign-month-document-section .empty {
  margin: 0 8px 8px;
}

.foreign-price-series {
  display: grid;
  gap: 8px;
}

.foreign-price-series > div {
  display: grid;
  grid-template-columns: minmax(118px, 0.7fr) minmax(70px, 1fr) minmax(112px, max-content);
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.foreign-price-series > div > * {
  min-width: 0;
}

.foreign-price-series span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.foreign-price-series i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e1d6;
}

.foreign-price-series b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.foreign-price-series b.is-shanghai {
  background: var(--amber);
}

.foreign-price-series b.is-end-customer {
  background: #2878c8;
}

.foreign-price-series strong,
.foreign-price-balance strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.foreign-price-balance {
  flex-wrap: wrap;
  padding-top: 9px;
  border-top: 1px solid var(--soft-line);
}

.foreign-price-balance.is-credit strong {
  color: var(--danger);
}

.foreign-price-balance small {
  flex: 0 0 100%;
  text-align: right;
}

.foreign-price-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.foreign-price-totals > span {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #fbfaf7;
}

.foreign-price-totals small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.foreign-price-totals strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.expense-actuals {
  display: grid;
  gap: 16px;
}

.expense-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.expense-kpi-grid > div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
}

.expense-kpi-grid span,
.expense-kpi-grid em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.expense-kpi-grid strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.expense-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.expense-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.expense-month-chart {
  display: grid;
  gap: 9px;
}

.expense-month-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.28fr) minmax(0, 1fr);
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.expense-month-heading {
  display: grid;
  align-content: center;
  gap: 4px;
}

.expense-month-heading strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.expense-month-heading span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.expense-month-bars {
  display: grid;
  grid-template-columns: 64px minmax(80px, 1fr) minmax(132px, max-content);
  align-items: center;
  gap: 7px 10px;
}

.expense-month-bars span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.expense-month-bars div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e3d9;
}

.expense-month-bars i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
}

.expense-month-bars b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.expense-chart-legend .is-sales,
.expense-month-bars .is-sales {
  background: var(--amber);
}

.expense-chart-legend .is-management,
.expense-month-bars .is-management {
  background: #5f6f8f;
}

.purchase-payment-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(300px, 1.08fr);
  gap: 12px;
  align-items: start;
}

.payment-overdue-list {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.purchase-order-spend-list {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.payment-overdue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px;
  color: var(--ink);
}

.payment-overdue-head strong {
  font-size: 14px;
  font-weight: 850;
}

.payment-overdue-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.summary-group-item {
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
  overflow: hidden;
}

.summary-group-item summary {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(118px, max-content) minmax(54px, max-content);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.summary-group-item summary::-webkit-details-marker {
  display: none;
}

.summary-group-item summary span,
.summary-group-item summary b,
.summary-group-item summary em {
  min-width: 0;
}

.summary-group-item summary span {
  display: grid;
  gap: 3px;
}

.summary-group-item summary strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.summary-group-item summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.summary-group-item summary b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.summary-group-item summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.summary-group-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.summary-group-meta span,
.summary-drilldown-row span {
  overflow-wrap: anywhere;
}

.summary-drilldown-list {
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
}

.summary-drilldown-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(150px, 1fr) minmax(118px, 0.8fr) minmax(74px, max-content);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.summary-drilldown-row strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.summary-drilldown-row em {
  color: var(--ink);
  font-style: normal;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.foreign-outstanding-grid .summary-drilldown-row em {
  white-space: normal;
  overflow-wrap: anywhere;
}

.summary-more {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  padding: 2px 4px;
}

.execution-row {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
}

.execution-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.execution-row-head strong {
  color: var(--ink);
  font-weight: 850;
}

.execution-row-head span,
.execution-row p,
.execution-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.execution-row p {
  margin: 0;
}

.execution-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: #fff8e5;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe7dd;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.execution-row.tone-good .bar-track i {
  background: var(--success);
}

.execution-row.tone-work .bar-track i {
  background: #5f6f8f;
}

.execution-row.tone-risk .bar-track i {
  background: var(--danger);
}

.execution-row.tone-warn .bar-track i {
  background: var(--warning);
}

.product-group {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.product-group.is-active {
  border-color: var(--dark);
  box-shadow: inset 3px 0 0 var(--amber);
}

.product-group span {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
}

.product-group strong {
  font-size: 14px;
}

.product-group em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.product-group b {
  position: relative;
  z-index: 1;
  font-size: 18px;
}

.product-group i {
  position: absolute;
  inset: auto auto 0 0;
  height: 3px;
  background: var(--amber);
}

.family-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.family-row span {
  color: var(--ink);
  font-weight: 850;
}

.family-row strong {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.shipment-summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.shipment-summary-strip strong {
  color: var(--dark);
  font-size: 15px;
  font-weight: 900;
}

.shipment-table-scroll {
  max-height: 360px;
}

.shipment-table {
  min-width: 760px;
}

.shipment-table td:nth-child(n+3) {
  text-align: right;
  white-space: nowrap;
}

.shipment-mini-bar {
  display: block;
  width: min(220px, 100%);
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e3d7;
}

.shipment-mini-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.report-table-scroll {
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
}

.detail-table-scroll {
  max-height: 420px;
}

.report-table {
  min-width: 860px;
  background: #fff;
}

.report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f4ef;
}

.report-table td {
  white-space: normal;
}

.report-table td strong,
.report-table td span {
  display: block;
}

.report-table td span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.report-table td button {
  border: 0;
  background: transparent;
  color: var(--dark);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-table tr.is-selected td {
  background: #fff8e5;
}

.report-table tr.is-expanded td {
  border-bottom-color: #ead098;
}

.risk-expanded-row td {
  background: #fffaf0;
}

.risk-expanded-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-left: 3px solid var(--amber);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.risk-expanded-card strong {
  color: var(--ink);
  font-size: 13px;
}

.risk-expanded-card button {
  justify-self: start;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: var(--dark);
  color: var(--amber);
  font-weight: 850;
}

.mrp-drilldown-panel {
  scroll-margin-top: 12px;
  outline: none;
}

.mrp-inline-detail > td {
  padding: 0 !important;
  border-bottom: 1px solid var(--amber);
  background: var(--surface-2) !important;
}

.mrp-inline-detail .mrp-drilldown-panel {
  margin: 0;
  border: 0;
  border-left: 3px solid var(--amber);
  border-radius: 0;
  box-shadow: none;
}

.report-table td .mrp-material-link {
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.mrp-drilldown-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--success);
  background: #f2fbf6;
}

.mrp-table-scroll {
  max-height: 360px;
}

.mrp-drilldown-table {
  min-width: 920px;
}

.mrp-match-status.is-unmatched {
  color: #9a6100;
}

.mrp-drilldown-table td .mrp-match-status + span {
  max-width: 340px;
  margin-top: 4px;
  line-height: 1.45;
}

.mrp-shortage-row td {
  padding-top: 0;
  background: #fffaf0;
  border-top: 0;
}

.mrp-shortage-detail {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  border-radius: 4px;
  background: #fff7e2;
}

.mrp-shortage-detail strong {
  color: var(--ink);
  font-size: 13px;
}

.mrp-shortage-detail div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mrp-shortage-pill {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #ead6a4;
  border-radius: 999px;
  background: #fffdf7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.receipt-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfaf7;
}

.receipt-item strong {
  font-size: 14px;
}

.receipt-item span,
.receipt-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.due-summary-chart {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.due-summary-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(96px, 1fr) minmax(74px, max-content) minmax(96px, 1fr) minmax(82px, max-content);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
}

.due-summary-row.is-active {
  border-color: var(--dark);
  background: #fff8e5;
}

.due-summary-row span,
.due-summary-row label,
.due-summary-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.due-summary-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.due-summary-row b {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.bar-track.amount i {
  background: var(--success);
}

.detail-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-filters button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.detail-filters button.is-active {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--amber);
}

.report-loading,
.report-empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}

.report-empty h2 {
  margin: 0;
  color: var(--ink);
}

.selected-order {
  display: grid;
  gap: 8px;
  margin: 12px 18px 18px;
  color: var(--muted);
  font-size: 13px;
}

.selected-order strong {
  color: var(--ink);
  font-size: 18px;
}

.selected-order p {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-2);
}

.error {
  color: var(--danger);
}

.cash-safety-forecast {
  display: grid;
  gap: 18px;
}

.cash-safety-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid #e2ded4;
}

.cash-safety-summary span {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-right: 1px solid #e2ded4;
}

.cash-safety-summary span:last-child {
  border-right: 0;
}

.cash-safety-summary strong {
  font-size: 20px;
}

.cash-safety-summary em,
.cash-safety-month em {
  color: #6f6d68;
  font-style: normal;
}

.cash-safety-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  color: #5f5d58;
  font-size: 13px;
}

.cash-safety-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cash-safety-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.cash-safety-legend .is-receipt,
.cash-safety-bar.is-receipt i {
  background: var(--chart-receipt);
}

.cash-safety-legend .is-purchase,
.cash-safety-bar.is-purchase i {
  background: var(--chart-purchase);
}

.cash-safety-legend .is-sales-expense,
.cash-safety-bar.is-sales-expense i {
  background: var(--chart-sales-expense);
}

.cash-safety-legend .is-management-expense,
.cash-safety-bar.is-management-expense i {
  background: var(--chart-management-expense);
}

.cash-safety-scope {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #d39b21;
  background: #fff8e8;
  color: #68645b;
  font-size: 13px;
  line-height: 1.55;
}

.cash-safety-chart {
  display: grid;
  border-top: 1px solid #e2ded4;
}

.cash-safety-month {
  border-bottom: 1px solid #e2ded4;
}

.cash-safety-month summary {
  display: grid;
  grid-template-columns: 100px minmax(180px, 1fr) minmax(150px, max-content) 72px;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 4px;
  cursor: pointer;
  list-style: none;
}

.cash-safety-month summary::-webkit-details-marker,
.purchase-cash-month summary::-webkit-details-marker {
  display: none;
}

.cash-safety-series {
  display: grid;
  grid-template-columns: repeat(4, minmax(28px, 1fr));
  align-items: center;
  gap: 5px;
}

.cash-safety-bar {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: #ebe8e0;
}

.cash-safety-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.cash-safety-value {
  text-align: right;
  font-weight: 800;
}

.cash-safety-value.is-risk {
  color: #a93b34;
}

.cash-safety-value.is-safe {
  color: #19754d;
}

.cash-safety-month.is-risk {
  border-left: 3px solid #b3433c;
}

.cash-safety-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 4px 14px 18px;
}

.cash-safety-breakdown span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-left: 2px solid #d7d2c7;
  color: #64615b;
  font-size: 12px;
}

.cash-safety-breakdown strong {
  color: #171717;
  font-size: 15px;
}

.cash-safety-formula,
.cash-sales-required {
  grid-column: span 2;
}

.cash-sales-required {
  border-left-color: #b3433c !important;
}

.cash-sales-required small {
  color: #8b3a34;
}

.purchase-cash-forecast {
  display: grid;
  gap: 16px;
}

.purchase-cash-overdue {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, max-content) minmax(180px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #d8d2c6;
  border-left: 4px solid #5b4abf;
  border-radius: 6px;
}

.purchase-cash-overdue.has-risk {
  border-left-color: #b3433c;
}

.purchase-cash-overdue strong {
  font-size: 20px;
}

.purchase-cash-overdue em {
  color: #6f6d68;
  font-style: normal;
  text-align: right;
}

.purchase-cash-month {
  border: 1px solid #e1ddd3;
  border-radius: 6px;
}

.purchase-cash-month .receipt-month-row {
  border: 0;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .layout.nav-collapsed,
  .layout.report-layout.nav-collapsed {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .layout.report-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .side-panel {
    display: none;
  }

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

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

  .bi-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .bi-canvas,
  .bi-overview-grid {
    grid-template-columns: 1fr;
  }

  .bi-visual,
  .bi-visual-wide,
  .bi-overview-card,
  .bi-overview-card-wide {
    grid-column: auto;
  }

  .report-detail-hero {
    grid-template-columns: 1fr;
  }

  .report-detail-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .report-detail-actions {
    justify-content: flex-start;
  }

  .report-section-wide {
    grid-column: auto;
  }

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

  .executive-command {
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: 0;
    padding: 4px 0 24px;
  }

  .command-cash-rail {
    min-height: 0;
    padding: 22px;
  }

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

  .command-assumptions p {
    grid-column: 1 / -1;
  }

  .command-rail-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .command-entry-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 0;
    gap: 12px;
  }

  .command-entry-head,
  .command-mobile-note {
    grid-column: 1 / -1;
  }
}

@media (min-width: 641px) and (max-width: 1240px) {
  .report-hub-main {
    padding: 24px 20px;
  }

  .report-hub-toolbar {
    margin-bottom: 28px;
  }

  .report-hub-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .report-hub-panel {
    padding: 24px 0 0;
    border-top: 1px solid var(--hub-line);
    border-left: 0;
  }

  .report-hub-panel-accent {
    margin-bottom: 20px;
  }

  .report-hub-recent {
    margin-top: 36px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .report-hub-department-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-hub-department.is-ceo {
    grid-column: 1 / -1;
  }

  .ceo-cockpit-actions small {
    display: none;
  }

  .ai-topbar {
    gap: 10px;
    min-height: 48px;
    padding: 6px 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 88px;
  }

  .brand-divider {
    height: 28px;
  }

  .brand-title {
    max-width: 122px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-subtitle {
    display: none;
  }

  .topbar-tools {
    gap: 6px;
    font-size: 12px;
  }

  .topbar-status {
    width: 32px;
    min-height: 32px;
    padding: 0;
  }

  .topbar-tool-label {
    display: none;
  }

  .production-status {
    gap: 2px;
  }

  .production-status .env-dot {
    width: 6px;
    height: 6px;
    margin-left: -5px;
    margin-top: 13px;
  }

  .language-button {
    min-width: 38px;
    min-height: 32px;
    font-size: 12px;
  }

  .language-label-full {
    display: none;
  }

  .language-label-compact {
    display: inline;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
  }

  .layout {
    height: calc(100vh - 52px);
  }

  .chat-header {
    min-height: 48px;
    padding: 0 16px;
  }

  .chat-header h2 {
    font-size: 18px;
  }

  .new-chat {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .messages {
    padding: 22px 16px;
  }

  .composer {
    padding: 12px 16px 14px;
  }

  .composer-box {
    box-shadow: 0 8px 20px rgba(8, 8, 7, 0.07);
  }

  .composer textarea {
    min-height: 64px;
    max-height: 160px;
    padding: 12px;
  }

  .composer-actions {
    gap: 8px;
    padding: 8px;
  }

  .composer-actions > div {
    flex: 1 1 auto;
    gap: 6px;
    min-width: 0;
  }

  .composer-actions .file-input {
    display: none;
  }

  .source-select {
    width: 150px;
    min-width: 0;
    height: 32px;
    padding: 0 9px;
    font-size: 13px;
  }

  .send-button,
  .secondary-button,
  .voice-button,
  .upload-button {
    height: 32px;
    font-size: 13px;
  }

  .send-button {
    flex: 0 0 auto;
    min-width: 72px;
    padding: 0 14px;
  }

  .secondary-button,
  .voice-button,
  .upload-button {
    padding: 0 10px;
  }
}

@media (max-width: 900px) {
  .cash-forecast-scope-switch {
    grid-template-columns: auto 1fr;
  }

  .cash-forecast-scope-switch em {
    grid-column: 1 / -1;
    text-align: left;
  }

  .command-rail-metrics,
  .command-entry-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-chart-panel,
  .command-customer-panel,
  .command-entry-panel {
    padding: 22px;
  }

  .command-chart-series {
    gap: 10px;
    grid-template-columns: repeat(7, minmax(48px, 1fr));
    padding-inline: 4px;
  }

  .command-customer-list button {
    grid-template-columns: minmax(0, 1fr) minmax(104px, max-content) 46px;
    gap: 10px;
  }

  .risk-method-grid {
    grid-template-columns: 1fr;
  }

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

  .due-summary-row > span,
  .due-summary-row > div {
    min-width: 0;
  }

  .due-summary-row b {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .cash-forecast-scope-switch {
    grid-template-columns: 1fr;
  }

  .cash-forecast-scope-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .cash-forecast-scope-options button {
    padding-inline: 6px;
  }

  .cash-forecast-scope-switch em {
    grid-column: auto;
  }

  body::before {
    inset-top: 104px;
  }

  .erp-ai-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .ai-topbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
  }

  .brand {
    align-items: center;
    flex: 1 1 auto;
    gap: 8px;
  }

  .brand-logo {
    width: 92px;
  }

  .brand-divider,
  .brand-copy {
    display: none;
  }

  .topbar-tools {
    gap: 4px;
  }

  .topbar-status {
    width: 30px;
    min-height: 30px;
    padding: 0;
  }

  .topbar-tool-label {
    display: none;
  }

  .production-status {
    gap: 1px;
  }

  .production-status .env-dot {
    width: 5px;
    height: 5px;
    margin-left: -5px;
    margin-top: 12px;
  }

  .language-button {
    min-width: 34px;
    min-height: 30px;
  }

  .language-label-full {
    display: none;
  }

  .language-label-compact {
    display: inline;
  }

  .theme-toggle {
    width: 30px;
    height: 30px;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    flex-basis: 100%;
  }

  .mobile-nav-button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
  }

  :root[data-theme="dark"] .mobile-nav-button:not(.is-active) {
    border-color: var(--line);
    background: var(--surface-2);
    color: var(--ink);
  }

  .mobile-nav-button.is-active {
    border-color: var(--dark);
    background: var(--dark);
    color: var(--amber);
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .layout.nav-collapsed,
  .layout.report-layout,
  .layout.report-layout.nav-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .chat-header,
  .messages,
  .composer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .message {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-actions > div {
    display: grid;
  }

  .source-select,
  .send-button,
  .secondary-button,
  .voice-button,
  .upload-button {
    width: 100%;
  }

  .file-selection {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-chip {
    max-width: 300px;
  }

  .bubble.markdown {
    font-size: 14px;
  }

  .bubble.markdown h2 {
    font-size: 18px;
  }

  .markdown-table {
    min-width: 560px;
    font-size: 13px;
  }

  .markdown-table th,
  .markdown-table td {
    padding: 9px 10px;
  }

  .response-artifacts {
    display: block;
  }

  .response-artifact-list {
    margin-top: 7px;
  }

  .response-file-link {
    width: 100%;
  }

  .message-image-link {
    width: 100%;
    max-width: 360px;
  }

  .report-main {
    padding: 16px;
    overflow: visible;
  }

  .ceo-cockpit-strip {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 10px;
    padding: 10px;
  }

  .ceo-cockpit-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .ceo-cockpit-actions small {
    width: 100%;
    margin: 0;
  }

  .report-hub-main {
    padding: 16px 12px 28px;
    overflow: visible;
  }

  .report-hub-toolbar {
    grid-template-columns: 1fr;
    margin-bottom: 18px;
  }

  .report-hub-role {
    min-height: 46px;
    border-top: 1px solid var(--hub-line);
    border-left: 0;
  }

  .report-hub-status {
    margin: -6px 0 18px;
  }

  .report-hub-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .report-hub-map {
    gap: 10px;
  }

  .report-hub-department-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .report-hub-center {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    min-height: 78px;
    padding: 12px 14px;
    border-radius: 8px;
  }

  .report-hub-center > span:first-child {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }

  .report-hub-center svg {
    width: 25px;
    height: 25px;
  }

  .report-hub-center strong {
    font-size: 18px;
  }

  .report-hub-center em {
    font-size: 12px;
  }

  .report-hub-department {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    min-height: 76px;
    padding: 10px 34px 10px 11px;
    border-radius: 8px;
  }

  .report-hub-department.is-ceo {
    grid-column: auto;
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 82px;
  }

  .report-hub-department-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .report-hub-department-icon svg {
    width: 22px;
    height: 22px;
  }

  .report-hub-department.is-ceo .report-hub-department-icon {
    width: 44px;
    height: 44px;
  }

  .report-hub-department-copy strong {
    font-size: 13px;
  }

  .report-hub-access {
    right: 7px;
    top: 7px;
  }

  .report-hub-panel {
    padding: 20px 0 0;
    border-top: 1px solid var(--hub-line);
    border-left: 0;
  }

  .report-hub-panel h2 {
    font-size: 18px;
  }

  .report-hub-panel-accent {
    margin-bottom: 18px;
  }

  .report-hub-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .report-hub-shortcut {
    min-height: 92px;
    padding: 11px 8px;
  }

  .report-hub-shortcut svg {
    width: 30px;
    height: 30px;
  }

  .report-hub-recent {
    margin-top: 24px;
  }

  .report-hub-recent-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .report-hub-recent-list button {
    border-top: 1px solid var(--hub-line);
    border-radius: 0;
  }

  .executive-command {
    gap: 12px;
  }

  .command-cash-rail {
    gap: 18px;
    padding: 18px;
  }

  .command-assumptions {
    grid-template-columns: 1fr;
  }

  .command-assumptions input {
    width: 100%;
  }

  .command-cash-rail h1,
  .command-section-heading h2,
  .command-entry-head h2 {
    font-size: 20px;
  }

  .command-rail-metrics,
  .command-entry-panel {
    grid-template-columns: 1fr;
  }

  .command-rail-card {
    min-height: 70px;
    padding: 13px 14px;
  }

  .command-rail-card strong {
    font-size: 22px;
  }

  .command-chart-panel,
  .command-customer-panel,
  .command-entry-panel {
    padding: 16px;
  }

  .command-chart-panel,
  .command-customer-panel {
    min-height: 0;
  }

  .command-section-heading,
  .command-entry-head {
    display: grid;
  }

  .command-detail-link {
    justify-self: start;
    padding: 0;
  }

  .command-cash-chart {
    overflow: hidden;
  }

  .command-chart-scroll {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .command-chart-window-control {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .command-chart-plot {
    min-width: 460px;
  }

  .command-chart-series {
    grid-template-columns: repeat(7, 52px);
    min-height: 218px;
  }

  .command-month.is-selected {
    transform: translateY(-2px);
  }

  .command-month-detail {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-inline: 0;
  }

  .command-month-detail-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .command-month-detail-values strong {
    white-space: normal;
  }

  .command-safety-line {
    width: 436px;
  }

  .command-customer-list button {
    grid-template-columns: 1fr;
    gap: 5px;
    min-height: 76px;
    padding: 12px;
  }

  .command-customer-list strong,
  .command-customer-list em {
    text-align: left;
  }

  .bi-report-header,
  .report-toolbar {
    display: grid;
  }

  .bi-report-header h2,
  .report-toolbar h2 {
    font-size: 22px;
  }

  .bi-report-title {
    display: grid;
    gap: 3px;
  }

  .bi-report-title p {
    display: none;
  }

  .bi-report-header .report-freshness {
    display: none;
  }

  .bi-report-actions,
  .report-toolbar-actions {
    justify-content: flex-start;
  }

  .bi-report-actions {
    flex-wrap: wrap;
  }

  .bi-filter-panel > summary small,
  .foreign-price-months > summary em {
    display: none;
  }

  .bi-filter-bar {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .report-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .overview-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .report-view-tabs {
    overflow-x: auto;
  }

  .report-view-tabs button {
    flex: 0 0 auto;
  }

  .kpi-card {
    min-height: 112px;
    padding: 13px;
  }

  .kpi-card strong {
    font-size: 20px;
  }

  .report-section {
    padding: 14px;
  }

  .sales-execution-grid {
    grid-template-columns: 1fr;
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .donut-legend {
    width: 100%;
  }

  .bi-bar-row {
    grid-template-columns: 76px minmax(0, 1fr) 62px;
  }

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

  .due-summary-row b {
    text-align: left;
  }

  .receipt-month-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .receipt-month-label {
    grid-column: 1;
    grid-row: 1;
  }

  .receipt-month-amount {
    grid-column: 1;
    grid-row: 2;
    justify-items: start;
    text-align: left;
  }

  .receipt-month-row em {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .receipt-month-bar {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .payment-forecast-grid,
  .foreign-outstanding-grid,
  .purchase-payment-grid {
    grid-template-columns: 1fr;
  }

  .payment-overdue-head {
    display: grid;
  }

  .payment-overdue-head span {
    text-align: left;
  }

  .summary-group-item summary,
  .summary-drilldown-row {
    grid-template-columns: 1fr;
  }

  .summary-group-item summary b,
  .summary-group-item summary em,
  .summary-drilldown-row em {
    text-align: left;
  }

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

  .section-heading {
    display: grid;
  }

  .bi-overview-card header,
  .report-detail-hero {
    display: grid;
  }

  .report-detail-hero {
    gap: 10px;
    padding: 12px;
  }

  .report-detail-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .report-detail-kpi {
    gap: 3px;
    padding: 8px;
  }

  .report-detail-kpi span,
  .report-detail-kpi em {
    font-size: 10px;
  }

  .report-detail-kpi strong {
    font-size: 15px;
  }

  .report-detail-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
  }

  .report-detail-nav a {
    flex: 0 0 auto;
  }

  .overview-metric-row,
  .cashflow-snapshot .overview-metric-row,
  .risk-bucket-row,
  .risk-top-list button {
    grid-template-columns: 1fr;
  }

  .risk-shortage-preview {
    grid-column: auto;
  }

  .overview-metric-row strong,
  .overview-metric-row em,
  .risk-bucket-row strong,
  .risk-top-list em {
    text-align: left;
  }

  .cashflow-snapshot .overview-metric-row em {
    grid-column: auto;
  }

  .overview-sparkline {
    overflow-x: auto;
  }

  .overview-sparkline span {
    flex: 0 0 32px;
  }

  .expense-kpi-grid,
  .expense-month-row {
    grid-template-columns: 1fr;
  }

  .expense-month-bars {
    grid-template-columns: 56px minmax(80px, 1fr);
  }

  .expense-month-bars b {
    grid-column: 2;
    text-align: left;
  }

  .execution-row-head {
    display: grid;
  }

  .family-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .family-row strong {
    grid-column: 1 / -1;
    text-align: left;
  }

  .report-table {
    min-width: 760px;
  }
}

@media (max-width: 900px) {
  .cash-safety-summary {
    grid-template-columns: 1fr 1fr;
  }

  .cash-safety-summary span:nth-child(2) {
    border-right: 0;
  }

  .cash-safety-summary span:nth-child(-n + 2) {
    border-bottom: 1px solid #e2ded4;
  }

  .cash-safety-month summary {
    grid-template-columns: 86px minmax(120px, 1fr) minmax(130px, max-content);
  }

  .cash-safety-month summary > em {
    grid-column: 3;
    text-align: right;
  }

  .cash-safety-breakdown {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .cash-safety-summary,
  .cash-safety-breakdown,
  .purchase-cash-overdue {
    grid-template-columns: 1fr;
  }

  .cash-safety-summary span {
    border-right: 0;
    border-bottom: 1px solid #e2ded4;
  }

  .cash-safety-summary span:last-child {
    border-bottom: 0;
  }

  .cash-safety-month summary {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .cash-safety-series {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .cash-safety-value {
    grid-column: 2;
    grid-row: 1;
  }

  .cash-safety-month summary > em {
    grid-column: 1 / -1;
    grid-row: 3;
    text-align: left;
  }

  .cash-safety-formula,
  .cash-sales-required {
    grid-column: auto;
  }

  .purchase-cash-overdue em {
    text-align: left;
  }
}

/* Sales reporting workspace */
.sales-workspace-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(9, minmax(72px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 8px 20px rgba(8, 8, 7, 0.05);
  backdrop-filter: blur(12px);
}

.sales-workspace-nav button {
  display: grid;
  grid-template-columns: 20px minmax(0, auto);
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.sales-workspace-nav button:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.sales-workspace-nav button.is-active {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--surface);
}

.sales-workspace-nav svg,
.sales-view-heading svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.sales-workspace-nav span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-overdue-summary summary {
  grid-template-columns: minmax(132px, 0.72fr) minmax(260px, 1.6fr) minmax(72px, max-content);
}

.customer-price-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  gap: 6px;
}

.customer-price-summary > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.customer-price-summary small {
  line-height: 1.25;
}

.customer-price-summary b {
  font-size: 11px !important;
  text-align: left !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.sales-workspace {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(8, 8, 7, 0.055);
}

.sales-view-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--soft-line);
}

.sales-view-heading > span {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.sales-view-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
}

.sales-view-heading p {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.sales-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sales-view-stack {
  display: grid;
  gap: 12px;
}

.sales-workspace-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--surface-2);
}

.sales-workspace-panel.is-wide {
  grid-column: 1 / -1;
}

.sales-workspace-panel :is(.report-section, .bi-visual, .command-customer-panel, .payment-overdue-list) {
  box-shadow: none;
}

.sales-drill-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 0.8fr));
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--surface-2);
}

.sales-filter-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.sales-filter-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.sales-filter-field :is(input, select) {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 760;
}

.sales-filter-field :is(input, select):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.sales-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.sales-filter-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sales-filter-actions button,
.sales-panel-title button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.sales-filter-actions button[type="submit"] {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--amber);
}

.sales-filter-actions .sales-export-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: var(--amber-dark);
  background: var(--amber);
  color: #17130a;
}

.sales-filter-actions .sales-export-button svg {
  width: 15px;
  height: 15px;
}

.sales-unshipped-filters {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.sales-unshipped-table-scroll {
  max-height: 620px;
}

.sales-unshipped-table {
  min-width: 1060px;
}

.sales-unshipped-date-list {
  display: grid;
  gap: 10px;
}

.sales-unshipped-date-group {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--surface);
}

.sales-unshipped-date-toggle {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(138px, 1.2fr) repeat(6, minmax(72px, 0.65fr)) 24px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.sales-unshipped-date-toggle:hover,
.sales-unshipped-date-toggle:focus-visible,
.sales-unshipped-date-group.is-expanded .sales-unshipped-date-toggle {
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
}

.sales-unshipped-date-toggle:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
}

.sales-unshipped-date-toggle > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.sales-unshipped-date-toggle small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.sales-unshipped-date-toggle strong,
.sales-unshipped-date-toggle time {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-unshipped-date-primary time {
  color: var(--amber-dark);
  font-size: 14px;
}

.sales-unshipped-date-toggle > i {
  display: grid;
  color: var(--muted);
  place-items: center;
}

.sales-unshipped-date-toggle > i svg {
  width: 16px;
  height: 16px;
}

.sales-unshipped-date-detail {
  padding: 0 12px 12px;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.sales-unshipped-date-toggle > .sales-unshipped-date-summary {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--soft-line);
  text-align: left;
}

.sales-unshipped-date-summary b,
.sales-unshipped-date-summary i {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11px;
  font-style: normal;
}

.sales-unshipped-date-summary b {
  background: var(--amber-soft);
}

.sales-unshipped-date-summary em {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.sales-unshipped-detail-table {
  min-width: 1040px;
}

.sales-unshipped-detail-table td > span,
.sales-unshipped-detail-table td > strong + span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.sales-unshipped-table td > span,
.sales-unshipped-table td > strong + span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.sales-shipment-status {
  display: inline-flex !important;
  width: max-content;
  margin: 0 !important;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted) !important;
  font-weight: 850;
}

.sales-shipment-status.is-partial {
  background: var(--amber-soft);
  color: var(--amber-dark) !important;
}

.sales-shipment-status.is-closed {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger) !important;
}

.sales-filter-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.sales-filter-summary > span {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.sales-filter-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.sales-filter-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 900;
}

.sales-workspace-panel > .sales-filter-summary:last-child,
.sales-order-drilldown > .sales-filter-summary {
  margin-bottom: 0;
}

.sales-panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sales-panel-title > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.sales-panel-title strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.sales-panel-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.sales-family-bars .family-row {
  width: 100%;
  grid-template-columns: 58px minmax(0, 1fr) minmax(78px, max-content);
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.sales-family-bars .family-row:hover,
.sales-family-bars .family-row.is-active {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.sales-family-bars .family-row em {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.sales-family-drilldown {
  grid-column: 1 / -1;
}

.sales-order-inline-detail > td {
  padding: 0 !important;
  border-bottom: 1px solid var(--amber);
  background: var(--surface-2) !important;
}

.sales-order-inline-detail .sales-order-drilldown {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
  border-left: 3px solid var(--amber);
  background: color-mix(in srgb, var(--surface-2) 88%, var(--amber-soft));
}

.sales-order-inline-detail .sales-panel-title {
  margin-bottom: 0;
}

.sales-order-drilldown .report-table-scroll {
  max-height: 360px;
}

.sales-detail-table-panel tr[data-sales-order-row] {
  cursor: pointer;
}

.sales-detail-table-panel tr[data-sales-order-row]:hover td,
.sales-detail-table-panel tr[data-sales-order-row]:focus-visible td {
  background: var(--amber-soft);
}

.sales-detail-table-panel tr[data-sales-order-row]:focus-visible td {
  box-shadow: inset 0 2px 0 var(--amber), inset 0 -2px 0 var(--amber);
}

.sales-customer-portfolio {
  min-width: 0;
}

.group-sales-report {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.group-sales-report > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.group-sales-report h4 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.group-sales-report header p,
.group-sales-basis,
.group-sales-warning {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.group-sales-source {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.group-sales-source.is-ready {
  border-color: color-mix(in srgb, var(--success) 42%, var(--line));
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
  color: var(--success);
}

.group-sales-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.group-sales-item {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
}

.group-sales-operator {
  position: absolute;
  top: 50%;
  left: -13px;
  z-index: 1;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
  transform: translateY(-50%);
}

.group-sales-item:first-child .group-sales-operator {
  display: none;
}

.group-sales-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.group-sales-copy small,
.group-sales-copy em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-sales-copy small {
  color: var(--muted);
  font-weight: 800;
}

.group-sales-copy strong {
  color: var(--ink);
  font-size: clamp(15px, 1.45vw, 21px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.group-sales-copy em {
  min-height: 32px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.45;
}

.group-sales-copy > i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--soft-line);
}

.group-sales-copy > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.group-sales-item.is-cambodia .group-sales-copy > i b {
  background: #16836a;
}

.group-sales-item.is-internal .group-sales-copy > i b {
  background: #c94d49;
}

.group-sales-item.is-gross,
.group-sales-item.is-consolidated {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
}

.group-sales-item.is-consolidated .group-sales-copy strong {
  color: var(--success);
}

.group-sales-basis {
  padding: 9px 11px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
}

.group-sales-warning {
  color: var(--danger);
  font-weight: 750;
}

.sales-detail-table-panel {
  overflow: hidden;
}

.sales-detail-table-panel .report-table-scroll {
  max-width: 100%;
}

.shipment-basis {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.sales-target-controls {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--surface-2);
}

.sales-target-controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sales-target-controls label strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}

.sales-target-controls input {
  width: min(210px, 100%);
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.sales-target-controls input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.sales-target-controls p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.sales-target-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sales-target-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.sales-target-progress > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--surface-2);
}

.sales-target-progress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sales-target-progress strong {
  color: var(--ink);
  font-size: 13px;
}

.sales-target-progress i {
  grid-column: 1 / -1;
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.sales-target-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

:root[data-theme="dark"] .sales-workspace-nav,
:root[data-theme="dark"] .sales-workspace,
:root[data-theme="dark"] .sales-workspace-panel,
:root[data-theme="dark"] .detail-hero-sales,
:root[data-theme="dark"] .detail-hero-sales .report-detail-kpi,
:root[data-theme="dark"] .sales-workspace .overview-sparkline,
:root[data-theme="dark"] .sales-workspace .risk-summary-strip span,
:root[data-theme="dark"] .sales-workspace .risk-bucket-row,
:root[data-theme="dark"] .sales-workspace .risk-top-list button,
:root[data-theme="dark"] .sales-target-controls,
:root[data-theme="dark"] .sales-target-progress > div,
:root[data-theme="dark"] .sales-target-controls input,
:root[data-theme="dark"] .sales-drill-filters,
:root[data-theme="dark"] .sales-filter-field :is(input, select),
:root[data-theme="dark"] .sales-filter-summary > span,
:root[data-theme="dark"] .sales-filter-actions button,
:root[data-theme="dark"] .sales-panel-title button,
:root[data-theme="dark"] .sales-unshipped-date-group,
:root[data-theme="dark"] .sales-unshipped-date-toggle,
:root[data-theme="dark"] .sales-unshipped-date-detail,
:root[data-theme="dark"] .sales-family-bars .family-row,
:root[data-theme="dark"] .foreign-price-month,
:root[data-theme="dark"] .foreign-price-totals > span,
:root[data-theme="dark"] .customer-overdue-summary,
:root[data-theme="dark"] .group-sales-item {
  background: var(--hub-panel);
}

:root[data-theme="dark"] .sales-workspace-nav button.is-active {
  color: #080807;
}

:root[data-theme="dark"] .detail-hero-sales .drilldown-button {
  color: #080807;
}

:root[data-theme="dark"] .foreign-price-month.is-selected {
  border-color: var(--amber);
  background: var(--amber-soft);
}

:root[data-theme="dark"] .foreign-current-month-badge {
  color: #080807;
}

:root[data-theme="dark"] .sales-filter-actions button[type="submit"] {
  border-color: var(--dark);
  background: var(--dark);
  color: #080807;
}

:root[data-theme="dark"] .sales-workspace .mrp-drilldown-panel,
:root[data-theme="dark"] .sales-workspace .mrp-drilldown-panel .report-table,
:root[data-theme="dark"] .sales-workspace .mrp-drilldown-panel .report-table th {
  border-color: var(--soft-line);
  background: var(--hub-panel);
  color: var(--ink);
}

:root[data-theme="dark"] .sales-workspace .mrp-drilldown-panel .report-table td {
  border-color: var(--soft-line);
  background: var(--hub-panel-soft);
  color: var(--ink);
}

:root[data-theme="dark"] .sales-workspace .mrp-drilldown-note,
:root[data-theme="dark"] .sales-workspace .mrp-shortage-detail,
:root[data-theme="dark"] .sales-workspace .mrp-shortage-pill {
  border-color: var(--soft-line);
  background: var(--hub-panel-soft);
  color: var(--muted);
}

:root[data-theme="dark"] .sales-workspace .mrp-drilldown-note.is-warning {
  border-left-color: var(--warning);
  background: var(--amber-soft);
}

:root[data-theme="dark"] .sales-workspace .mrp-shortage-row td {
  background: var(--hub-panel);
}

:root[data-theme="dark"] .sales-workspace .mrp-match-status.is-unmatched {
  color: var(--amber);
}

:root[data-theme="dark"] .sales-workspace .mrp-shortage-detail strong,
:root[data-theme="dark"] .sales-workspace .mrp-shortage-pill {
  color: var(--ink);
}

:root[data-theme="dark"] .sales-workspace :is(.bar-track, .stacked-bar, .sales-target-progress i) {
  background: var(--soft-line);
}

:root[data-theme="dark"] .sales-workspace-panel :is(.report-section, .bi-overview-card, .sales-execution-card, .family-row, .due-summary-row, .report-table td) {
  border-color: var(--soft-line);
  background: var(--hub-panel-soft);
  color: var(--ink);
}

:root[data-theme="dark"] :is(.bi-report-header, .report-toolbar, .bi-filter-panel, .bi-filter-bar, .report-view-tabs) {
  background: var(--hub-panel);
}

:root[data-theme="dark"] :is(.bi-filter-item, .bi-filter-select, .report-view-tabs button, .detail-filters button, .report-date-input) {
  border-color: var(--soft-line);
  background: var(--hub-panel-soft);
  color: var(--ink);
}

:root[data-theme="dark"] :is(.report-refresh, .report-view-tabs button.is-active, .report-view-tabs button:hover, .detail-filters button.is-active) {
  border-color: var(--dark);
  background: var(--dark);
  color: #080807;
}

:root[data-theme="dark"] .report-main :is(
  .bi-overview-card,
  .report-detail-hero:not(.detail-hero-cash),
  .report-detail-nav,
  .report-section,
  .kpi-card,
  .payment-overdue-list,
  .purchase-order-spend-list,
  .foreign-price-months
) {
  border-color: var(--soft-line);
  background: var(--hub-panel);
  color: var(--ink);
}

:root[data-theme="dark"] .report-main :is(
  .report-detail-hero:not(.detail-hero-cash) .report-detail-kpi,
  .report-detail-nav a,
  .overview-metric-row,
  .overview-sparkline,
  .risk-summary-strip span,
  .sales-execution-card,
  .receipt-month-row,
  .receipt-month-detail,
  .receipt-item,
  .foreign-price-month,
  .foreign-price-totals > span,
  .expense-kpi-grid > div,
  .expense-month-row,
  .sales-target-kpis .report-detail-kpi,
  .summary-group-item,
  .summary-drilldown-row,
  .due-summary-row,
  .risk-method-grid > div,
  .donut-chart > div,
  .donut-legend-row,
  .execution-row
) {
  border-color: var(--soft-line);
  background: var(--hub-panel-soft);
  color: var(--ink);
}

:root[data-theme="dark"] .report-main .detail-section-feature {
  background: var(--hub-panel);
}

:root[data-theme="dark"] .report-main :is(
  .receipt-month-row:hover,
  .receipt-month.is-expanded .receipt-month-row,
  .donut-legend-row.is-active,
  .bi-bar-row.is-active,
  .due-summary-row.is-active,
  .report-table tr.is-selected td,
  .risk-expanded-row td
) {
  border-color: var(--dark);
  background: var(--amber-soft);
  color: var(--ink);
}

:root[data-theme="dark"] .report-main :is(.report-table, .report-table th) {
  border-color: var(--soft-line);
  background: var(--hub-panel);
  color: var(--ink);
}

:root[data-theme="dark"] .report-main .report-table td {
  border-color: var(--soft-line);
  background: var(--hub-panel-soft);
  color: var(--ink);
}

:root[data-theme="dark"] .report-main :is(
  .receipt-month-bar,
  .foreign-price-series i,
  .expense-month-bars div,
  .shipment-mini-bar,
  .cash-safety-bar,
  .bar-track,
  .stacked-bar
) {
  background: var(--hub-line);
}

:root[data-theme="dark"] .report-main :is(.risk-method-status, .mrp-drilldown-note, .cash-safety-scope) {
  background: var(--hub-panel-soft);
  color: var(--muted);
}

:root[data-theme="dark"] .report-main .execution-note {
  background: var(--amber-soft);
  color: var(--muted);
}

:root[data-theme="dark"] .report-main :is(.risk-method-status.is-warning, .mrp-drilldown-note.is-warning) {
  background: var(--amber-soft);
}

:root[data-theme="dark"] .report-main :is(.drilldown-button, .risk-expanded-card button) {
  border-color: var(--dark);
  background: var(--dark);
  color: #080807;
}

:root[data-theme="dark"] .report-main :is(.cash-safety-summary, .cash-safety-chart, .cash-safety-month) {
  border-color: var(--soft-line);
}

:root[data-theme="dark"] .report-main .cash-safety-summary span {
  border-color: var(--soft-line);
}

:root[data-theme="dark"] .report-main :is(
  .cash-safety-summary em,
  .cash-safety-month em,
  .cash-safety-legend,
  .cash-safety-breakdown span,
  .purchase-cash-overdue em
) {
  color: var(--muted);
}

:root[data-theme="dark"] .report-main .cash-safety-breakdown strong {
  color: var(--ink);
}

:root[data-theme="dark"] .report-main .cash-safety-value.is-risk,
:root[data-theme="dark"] .report-main .cash-sales-required small {
  color: var(--danger);
}

:root[data-theme="dark"] .report-main .cash-safety-value.is-safe {
  color: var(--success);
}

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

  .sales-workspace-nav {
    grid-template-columns: repeat(4, minmax(88px, 1fr));
  }

  .sales-drill-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-unshipped-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-unshipped-date-toggle {
    grid-template-columns: minmax(126px, 1.2fr) minmax(100px, 0.9fr) repeat(3, minmax(62px, 0.55fr)) 24px;
  }

  .sales-unshipped-date-toggle > span:nth-of-type(3),
  .sales-unshipped-date-toggle > span:nth-of-type(5) {
    display: none;
  }

  .sales-filter-field.is-search {
    grid-column: 1 / -1;
  }

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

  .sales-target-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foreign-outstanding-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .foreign-outstanding-grid > * {
    min-width: 0;
  }

  .customer-overdue-summary summary {
    grid-template-columns: minmax(132px, 0.72fr) minmax(0, 1.6fr);
  }

  .customer-overdue-summary summary > em {
    grid-column: 1 / -1;
    text-align: left;
  }

  .group-sales-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-sales-item.is-consolidated {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .sales-workspace-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .sales-workspace-nav button {
    flex: 0 0 94px;
    grid-template-columns: 18px minmax(0, auto);
    min-height: 38px;
    padding: 7px;
    font-size: 12px;
  }

  .sales-workspace {
    padding: 12px;
  }

  .sales-drill-filters {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .sales-unshipped-filters {
    grid-template-columns: 1fr;
  }

  .sales-unshipped-date-toggle {
    grid-template-columns: minmax(112px, 1fr) minmax(92px, 0.8fr) minmax(64px, 0.55fr) 22px;
    gap: 8px;
    padding: 10px;
  }

  .sales-unshipped-date-toggle > span:nth-of-type(3),
  .sales-unshipped-date-toggle > span:nth-of-type(4),
  .sales-unshipped-date-toggle > span:nth-of-type(5),
  .sales-unshipped-date-toggle > span:nth-of-type(6) {
    display: none;
  }

  .sales-unshipped-date-detail {
    padding: 0 8px 8px;
  }

  .sales-unshipped-date-toggle > .sales-unshipped-date-summary {
    gap: 4px;
  }

  .sales-unshipped-date-summary b,
  .sales-unshipped-date-summary i {
    padding: 4px 6px;
  }

  .sales-filter-field.is-search {
    grid-column: auto;
  }

  .sales-filter-actions {
    justify-content: stretch;
  }

  .sales-filter-actions > span {
    width: 100%;
    margin-right: 0;
  }

  .sales-filter-actions button {
    flex: 1 1 120px;
  }

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

  .sales-panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  .sales-panel-title button {
    align-self: flex-start;
  }

  .sales-family-bars .family-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .sales-family-bars .family-row strong {
    grid-column: 2;
    text-align: left;
  }

  .sales-view-heading {
    margin-bottom: 12px;
  }

  .sales-view-heading h3 {
    font-size: 18px;
  }

  .sales-overview-grid,
  .sales-target-controls,
  .sales-target-progress {
    grid-template-columns: 1fr;
  }

  .sales-workspace-panel.is-wide {
    grid-column: auto;
  }

  .sales-target-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .sales-workspace-panel {
    padding: 10px;
  }

  .group-sales-flow {
    grid-template-columns: 1fr;
  }

  .group-sales-item.is-consolidated {
    grid-column: auto;
  }

  .group-sales-operator {
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
  }

  .group-sales-copy em {
    min-height: 0;
  }

  .foreign-price-series > div {
    grid-template-columns: minmax(0, 1fr) minmax(112px, max-content);
  }

  .foreign-price-month-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .foreign-price-series i {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .foreign-price-totals,
  .customer-price-summary {
    grid-template-columns: 1fr;
  }

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

  .customer-overdue-summary summary > em {
    grid-column: auto;
  }

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

  .summary-drilldown-row em {
    text-align: left;
    white-space: normal;
  }
}

.report-detail-kpi.tone-production strong {
  color: #147d67;
}

.detail-hero-production {
  border-color: color-mix(in srgb, #1f9d84 35%, var(--line));
  background: linear-gradient(100deg, color-mix(in srgb, #1f9d84 8%, var(--surface)), var(--surface) 58%);
}

.production-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(8, 8, 7, 0.045);
}

.production-workspace-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.production-workspace-title > span {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, #147d67 28%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, #1f9d84 10%, var(--surface-2));
  color: #147d67;
}

.production-workspace-title svg,
.production-home-card svg,
.production-source-strip svg,
.production-drill-panel svg,
.production-page-back svg,
.production-report-center svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.production-workspace-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.2;
}

.production-workspace-title p {
  max-width: 760px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.production-workspace-actions {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 7px;
}

.production-workspace-actions > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.production-workspace-actions > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.production-page-back,
.production-report-center {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--dark);
  border-radius: 6px;
  background: var(--dark);
  color: var(--surface);
  font-weight: 850;
  cursor: pointer;
}

.production-report-center {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.production-workspace {
  min-width: 0;
}

.production-workspace-nav {
  display: flex;
  min-width: 0;
  gap: 6px;
  margin-bottom: 12px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  scrollbar-width: thin;
}

.production-workspace-nav button {
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.production-workspace-nav button:hover,
.production-workspace-nav button:focus-visible {
  border-color: color-mix(in srgb, #147d67 35%, var(--line));
  color: #147d67;
}

.production-workspace-nav button.is-active {
  border-color: #147d67;
  background: #147d67;
  color: #fff;
}

.production-workspace-nav svg {
  width: 17px;
  height: 17px;
}

.production-source-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--surface);
}

.production-source-strip > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.production-source-strip > span.is-ready {
  border-color: color-mix(in srgb, #147d67 35%, var(--line));
  color: #147d67;
}

.production-source-strip > span.is-pending {
  border-color: color-mix(in srgb, var(--amber) 40%, var(--line));
  color: var(--amber-dark);
}

.production-source-strip > small {
  margin-left: auto;
  color: var(--muted);
  line-height: 1.4;
}

.production-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.production-home-insights {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.production-insight-panel {
  display: grid;
  min-width: 0;
  min-height: 210px;
  align-content: start;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.production-insight-panel > header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.production-insight-panel > header > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, #147d67 12%, var(--surface-2));
  color: #147d67;
}

.production-insight-panel > header svg {
  width: 18px;
  height: 18px;
}

.production-insight-panel > header div {
  display: grid;
  gap: 2px;
}

.production-insight-panel > header strong {
  color: var(--ink);
  font-size: 14px;
}

.production-insight-panel > header small,
.production-insight-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.production-home-load-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(34px, 1fr));
  align-items: end;
  gap: 7px;
  min-height: 118px;
  overflow-x: auto;
}

.production-home-load-chart > div {
  display: grid;
  min-width: 34px;
  gap: 5px;
  text-align: center;
}

.production-home-load-chart > div > span {
  display: flex;
  height: 92px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  border-bottom: 1px solid var(--soft-line);
}

.production-home-load-chart i {
  display: block;
  width: 9px;
  border-radius: 2px 2px 0 0;
}

.production-home-load-chart i.is-demand,
.production-insight-panel footer i.is-demand {
  background: #216db2;
}

.production-home-load-chart i.is-capacity,
.production-insight-panel footer i.is-capacity {
  background: #d49317;
}

.production-home-load-chart small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-insight-panel > footer {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
}

.production-insight-panel > footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.production-insight-panel > footer i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.production-readiness-ring {
  --ready-rate: 0;
  display: grid;
  width: 96px;
  height: 96px;
  margin: 2px auto 0;
  place-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--surface) 55%, transparent 57%), conic-gradient(#147d67 calc(var(--ready-rate) * 1%), var(--soft-line) 0);
  text-align: center;
}

.production-readiness-ring strong,
.production-readiness-ring small {
  display: block;
}

.production-readiness-ring strong {
  color: #147d67;
  font-size: 19px;
}

.production-readiness-ring small {
  color: var(--muted);
  font-size: 9px;
}

.production-readiness-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.production-readiness-legend > span {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
}

.production-readiness-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.production-readiness-legend .is-ready i { background: #147d67; }
.production-readiness-legend .is-covered i { background: #216db2; }
.production-readiness-legend .is-blocked i { background: #b3423c; }
.production-readiness-legend .is-pending i { background: #8b8a84; }

.production-readiness-legend small {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
}

.production-readiness-legend strong {
  color: var(--ink);
  font-size: 11px;
}

.production-home-hours-chart {
  display: grid;
  gap: 10px;
}

.production-home-hours-chart > span {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) minmax(70px, 1.5fr) auto;
  align-items: center;
  gap: 8px;
}

.production-home-hours-chart small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-home-hours-chart i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-line);
}

.production-home-hours-chart b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0c8a58;
}

.production-home-hours-chart strong {
  color: var(--ink);
  font-size: 10px;
}

.production-home-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 9px;
}

.production-home-section-heading > div {
  display: grid;
  gap: 2px;
}

.production-home-section-heading strong {
  color: var(--ink);
  font-size: 16px;
}

.production-home-section-heading small,
.production-home-section-heading > span {
  color: var(--muted);
  font-size: 10px;
}

.production-home-section-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.production-home-section-heading svg {
  width: 15px;
  height: 15px;
}

.production-home-card {
  --production-tone: #147d67;
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-rows: auto 6px auto;
  min-width: 0;
  min-height: 190px;
  gap: 14px 12px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 24px rgba(8, 8, 7, 0.05);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.production-home-card:hover,
.production-home-card:focus-visible {
  border-color: var(--production-tone);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--production-tone) 14%, transparent);
  transform: translateY(-2px);
}

.production-home-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--production-tone) 55%, transparent);
  outline-offset: 2px;
}

.production-home-card.tone-capacity { --production-tone: #147d67; }
.production-home-card.tone-maintenance { --production-tone: #59647b; }
.production-home-card.tone-load { --production-tone: #216db2; }
.production-home-card.tone-orders { --production-tone: #7254c7; }
.production-home-card.tone-execution { --production-tone: #bc6a18; }
.production-home-card.tone-hours { --production-tone: #0c8a58; }
.production-home-card.tone-risk { --production-tone: #b3423c; }

.production-home-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--production-tone) 12%, var(--surface-2));
  color: var(--production-tone);
}

.production-home-card-copy {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 2px;
}

.production-home-card-copy small,
.production-home-card-copy em {
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
}

.production-home-card-copy strong {
  overflow-wrap: anywhere;
  color: var(--production-tone);
  font-size: 28px;
  line-height: 1.15;
}

.production-home-card-copy em {
  font-size: 11px;
}

.production-home-card-open {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.production-home-card-progress {
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-line);
}

.production-home-card-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--production-tone);
}

.production-home-card-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.production-home-card-stats > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.production-home-card-stats small {
  color: var(--muted);
  font-size: 10px;
}

.production-home-card-stats b {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.production-page-stack {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.production-section-command {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #147d67;
  border-radius: 5px;
  background: transparent;
  color: #147d67;
  font-weight: 850;
  cursor: pointer;
}

.production-section-command:hover,
.production-section-command:focus-visible {
  background: #147d67;
  color: #fff;
}

.production-section-command svg {
  width: 16px;
  height: 16px;
}

.production-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 10px;
}

.production-pager > div {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.production-pager button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}

.production-pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.production-pager svg {
  width: 15px;
  height: 15px;
}

.production-page-stack > .report-section,
.production-visual-pair > .report-section {
  min-width: 0;
  margin: 0;
}

.production-visual-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.production-size-capacity-chart {
  display: grid;
  gap: 7px;
}

.production-size-capacity-row {
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.production-size-capacity-row summary {
  display: grid;
  grid-template-columns: 84px minmax(120px, 1fr) minmax(150px, auto) minmax(92px, auto);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 9px 12px;
  list-style: none;
  cursor: pointer;
}

.production-size-capacity-row summary::-webkit-details-marker {
  display: none;
}

.production-size-capacity-row summary > strong {
  color: var(--ink);
  font-size: 15px;
}

.production-size-capacity-track {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-line);
}

.production-size-capacity-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #147d67;
}

.production-size-capacity-row summary > span:nth-of-type(2) {
  display: grid;
  gap: 2px;
  text-align: right;
}

.production-size-capacity-row summary small,
.production-size-capacity-row summary em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.production-size-capacity-row summary em {
  text-align: right;
}

.production-size-capacity-details {
  display: grid;
  gap: 5px;
  padding: 0 12px 12px;
}

.production-size-capacity-details > span {
  display: grid;
  grid-template-columns: minmax(140px, 0.65fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--soft-line);
}

.production-size-capacity-details small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.production-size-capacity-details b {
  color: #147d67;
}

.production-size-capacity-details p,
.production-data-basis-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.production-drill-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.production-drill-panel > summary {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
}

.production-drill-panel > summary::-webkit-details-marker {
  display: none;
}

.production-drill-panel > summary > svg:first-child {
  color: #147d67;
}

.production-drill-panel > summary > svg:last-child {
  color: var(--muted);
  transition: transform 0.16s ease;
}

.production-drill-panel[open] > summary > svg:last-child {
  transform: rotate(180deg);
}

.production-drill-panel > summary span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.production-drill-panel > summary small {
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.4;
}

.production-drill-panel > div {
  min-width: 0;
  padding: 0 14px 14px;
  border-top: 1px solid var(--soft-line);
}

.production-capacity-canvas {
  align-items: start;
}

.production-capacity-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(150px, 1fr));
  align-items: start;
  gap: 10px;
  margin-top: 14px;
  overflow: visible;
}

.production-capacity-filters > .production-filter-field {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 6px;
  overflow: visible;
}

.production-capacity-filters > .production-filter-field.is-expanded {
  z-index: 55;
}

.production-filter-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.production-site-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 46px;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.production-capacity-filters button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.production-capacity-filters button:hover,
.production-capacity-filters button:focus-visible {
  border-color: #1f9d84;
  color: var(--ink);
}

.production-capacity-filters button:focus-visible {
  outline: 2px solid color-mix(in srgb, #1f9d84 45%, transparent);
  outline-offset: 2px;
}

.production-capacity-filters button.is-active {
  border-color: #147d67;
  background: #147d67;
  color: #fff;
}

.production-site-switch button {
  min-width: 0;
  min-height: 38px;
  padding-inline: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-quick-selects {
  align-items: center;
}

.production-quick-selects select {
  width: min(320px, 100%);
  min-height: 32px;
  padding: 5px 28px 5px 9px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.production-quick-selects select:focus-visible {
  border-color: #1f9d84;
  outline: 2px solid color-mix(in srgb, #1f9d84 35%, transparent);
  outline-offset: 2px;
}

.production-quick-selects > span {
  color: var(--muted);
  font-size: 11px;
}

.production-quick-selects > span strong {
  color: var(--ink);
}

.production-category-multiselect,
.production-size-multiselect {
  align-items: center;
}

.production-category-multiselect > span,
.production-size-multiselect > span {
  align-self: center;
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.production-category-multiselect > span strong,
.production-size-multiselect > span strong {
  color: var(--ink);
}

.production-category-multiselect button {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-capacity-filters > .production-option-picker {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.production-option-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.production-option-list > button {
  max-width: min(240px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-filter-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px !important;
  gap: 8px;
  padding: 7px 9px !important;
  background: var(--surface);
  text-align: left;
}

.production-filter-trigger > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.production-filter-trigger strong,
.production-filter-trigger small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-filter-trigger strong {
  color: var(--ink);
  font-size: 12px;
}

.production-filter-trigger small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.production-filter-trigger small strong {
  display: inline;
  color: var(--ink);
  font-size: inherit;
}

.production-filter-trigger.has-selection {
  border-color: #1f9d84;
}

.production-filter-trigger svg,
.production-option-search svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.production-option-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  display: grid;
  width: min(380px, calc(100vw - 40px));
  max-height: 350px;
  overflow: auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(18, 24, 31, 0.2);
}

.production-filter-field:last-child .production-option-panel {
  right: 0;
  left: auto;
}

.production-option-search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(320px, 100%);
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
}

.production-option-search:focus-within {
  border-color: #1f9d84;
  outline: 2px solid color-mix(in srgb, #1f9d84 30%, transparent);
}

.production-option-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.production-option-search input::placeholder {
  color: var(--muted);
}

.production-option-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.production-option-footer {
  position: sticky;
  bottom: -10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px -10px -10px;
  padding: 9px 10px;
  border-top: 1px solid var(--soft-line);
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
}

.production-option-footer > button {
  min-height: 30px;
  border-color: #147d67;
  background: #147d67;
  color: #fff;
}

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

  .production-filter-field:nth-child(even) .production-option-panel {
    right: 0;
    left: auto;
  }
}

.production-capacity-warning {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.production-site-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.production-site-card.is-combined {
  border-color: color-mix(in srgb, #1f9d84 55%, var(--line));
  background: color-mix(in srgb, #1f9d84 7%, var(--surface));
}

.production-site-card > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.production-site-card > span small {
  color: var(--muted);
  font-size: 10px;
}

.production-site-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.production-site-card dl div {
  display: grid;
  gap: 3px;
}

.production-site-card dt,
.production-site-card dd {
  margin: 0;
}

.production-site-card dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.production-site-card dd {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.production-site-card dl div:last-child dd {
  color: #147d67;
}

.production-capacity-bars {
  display: grid;
  gap: 8px;
}

.production-capacity-bar {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(120px, 1.4fr) minmax(64px, auto);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

button.production-capacity-bar:hover,
button.production-capacity-bar:focus-visible,
.production-capacity-bar.is-active {
  border-color: #1f9d84;
  background: color-mix(in srgb, #1f9d84 8%, var(--surface));
}

button.production-capacity-bar:focus-visible {
  outline: 2px solid color-mix(in srgb, #1f9d84 45%, transparent);
  outline-offset: 2px;
}

.production-capacity-bar > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.production-capacity-bar > span strong,
.production-capacity-bar > span small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.production-capacity-bar > span strong {
  font-size: 12px;
  white-space: nowrap;
}

.production-capacity-bar > span small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.production-capacity-bar > i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.production-capacity-bar > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f9d84;
}

.production-capacity-bars.is-demand .production-capacity-bar > i b {
  background: #d5a42e;
}

.production-capacity-bar > em {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--ink);
  font-style: normal;
  text-align: right;
}

.production-capacity-bar > em strong {
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.production-capacity-bar > em small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.production-capacity-table-scroll {
  max-height: 560px;
}

.production-capacity-table {
  min-width: 1260px;
}

.production-capacity-table .capacity-number {
  text-align: right;
}

.production-capacity-table .capacity-total strong {
  color: #147d67;
}

.production-capacity-table input,
.production-capacity-table select {
  width: 100%;
  min-width: 86px;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.production-capacity-table input:focus,
.production-capacity-table select:focus {
  border-color: #1f9d84;
  outline: 2px solid color-mix(in srgb, #1f9d84 22%, transparent);
}

.production-capacity-table .production-code-input {
  min-height: 26px;
  margin-top: 5px;
  font-size: 10px;
}

.production-row-audit {
  display: grid;
  gap: 3px;
  min-width: 128px;
}

.production-row-audit strong {
  color: var(--ink);
  font-size: 11px;
}

.production-row-audit small {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.production-site-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, #1f9d84 12%, var(--surface));
  color: #147d67;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.production-site-badge.is-cambodia {
  background: color-mix(in srgb, var(--amber) 15%, var(--surface));
  color: #956100;
}

.production-maintenance-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.production-maintenance-toolbar > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.production-maintenance-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.production-maintenance-toolbar strong {
  color: var(--ink);
  font-size: 14px;
}

.production-maintenance-toolbar span {
  color: var(--muted);
  font-size: 11px;
}

.production-maintenance-toolbar .primary-button,
.production-maintenance-toolbar .secondary-button,
.table-danger-button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 850;
}

.production-maintenance-toolbar .primary-button {
  border-color: #147d67;
  background: #147d67;
  color: #fff;
}

.production-maintenance-toolbar .primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.table-danger-button {
  background: color-mix(in srgb, var(--risk) 7%, var(--surface));
  color: var(--risk);
}

.production-plan-status {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
}

.production-plan-status.is-success {
  background: color-mix(in srgb, #1f9d84 10%, var(--surface));
  color: #147d67;
}

.production-plan-status.is-error {
  background: color-mix(in srgb, var(--risk) 9%, var(--surface));
  color: var(--risk);
}

.production-audit-history {
  display: grid;
  gap: 9px;
  margin: 2px 0 16px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--surface-2);
}

.production-audit-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.production-audit-heading > div {
  display: grid;
  gap: 3px;
}

.production-audit-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.production-audit-heading span,
.production-audit-heading small {
  color: var(--muted);
  font-size: 10px;
}

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

.production-audit-list details {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
}

.production-audit-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.production-audit-list summary::-webkit-details-marker {
  display: none;
}

.production-audit-list summary > span {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.production-audit-list summary strong {
  color: var(--ink);
  font-size: 11px;
}

.production-audit-list summary time,
.production-audit-list summary em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.production-audit-list details[open] summary {
  border-bottom: 1px solid var(--soft-line);
}

.production-audit-list ul {
  display: grid;
  gap: 6px;
  max-height: 360px;
  margin: 0;
  padding: 9px 10px;
  overflow-y: auto;
  list-style: none;
}

.production-audit-list li {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.4fr);
  gap: 10px;
  padding: 7px 9px;
  border-left: 3px solid #287fd1;
  background: var(--surface-2);
}

.production-audit-list li.is-added {
  border-left-color: #1f9d84;
}

.production-audit-list li.is-deleted {
  border-left-color: var(--risk);
}

.production-audit-list li strong,
.production-audit-list li span,
.production-audit-list details > p,
.production-audit-empty {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.production-audit-list li strong {
  color: var(--ink);
}

.production-audit-list details > p {
  margin: 0;
  padding: 0 10px 9px;
}

.production-audit-empty {
  padding: 9px 10px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
}

.production-load-panel {
  display: grid;
  gap: 13px;
}

.production-load-heading {
  margin-bottom: 0;
}

.production-load-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.production-load-months button {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
}

.production-load-months button:hover,
.production-load-months button:focus-visible {
  border-color: #287fd1;
  outline: none;
}

.production-load-months button.is-active {
  border-color: #287fd1;
  background: color-mix(in srgb, #287fd1 10%, var(--surface));
}

.production-load-months span,
.production-load-months small {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-load-months strong {
  color: var(--ink);
  font-size: 19px;
}

.production-load-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.production-load-kpis article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.production-load-kpis span,
.production-load-kpis small,
.production-load-assumption,
.production-load-more {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.production-load-kpis strong {
  color: #147d67;
  font-size: 20px;
}

.production-load-kpis article.is-risk strong {
  color: var(--risk);
}

.production-load-assumption {
  margin: -3px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
}

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

.production-load-group {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-left: 4px solid #1f9d84;
  border-radius: 6px;
  background: var(--surface);
}

.production-load-group.is-warning {
  border-left-color: var(--amber);
}

.production-load-group.is-overload,
.production-load-group.is-unassigned {
  border-left-color: var(--risk);
}

.production-load-group summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
  gap: 14px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.production-load-group summary::-webkit-details-marker {
  display: none;
}

.production-load-group summary > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.production-load-group summary > span:last-child {
  grid-template-columns: auto auto;
  justify-content: end;
  text-align: right;
}

.production-load-group summary > span:last-child small {
  grid-column: 1 / -1;
}

.production-load-group summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-load-group summary small {
  color: var(--muted);
  font-size: 9px;
}

.production-load-group summary em {
  align-self: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, #1f9d84 12%, var(--surface));
  color: #147d67;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
}

.production-load-group.is-warning summary em {
  background: var(--amber-soft);
  color: #956100;
}

.production-load-group.is-overload summary em,
.production-load-group.is-unassigned summary em {
  background: color-mix(in srgb, var(--risk) 10%, var(--surface));
  color: var(--risk);
}

.production-load-group[open] summary {
  border-bottom: 1px solid var(--soft-line);
}

.production-load-detail-scroll {
  max-height: 310px;
}

.production-load-detail {
  min-width: 760px;
}

.production-load-group > p,
.production-load-more {
  margin: 0;
  padding: 8px 12px;
}

.production-load-empty {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px dashed var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.production-load-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.production-load-empty span {
  color: var(--muted);
  font-size: 10px;
}

.production-order-capacity-panel {
  display: grid;
  gap: 12px;
}

.production-order-capacity-heading {
  margin-bottom: 0;
}

.production-order-bundle-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 8px;
  align-items: stretch;
}

.production-order-bundle-switch {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.production-order-bundle-switch button {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  min-width: 150px;
  padding: 9px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

.production-order-bundle-switch button:hover,
.production-order-bundle-switch button:focus-visible {
  border-color: var(--amber);
  outline: none;
}

.production-order-bundle-switch button.is-active {
  border-color: #111;
  background: #111;
  color: #fff;
}

.production-order-bundle-switch strong {
  font-size: 11px;
}

.production-order-bundle-switch small {
  color: var(--muted);
  font-size: 9px;
}

.production-order-bundle-switch button.is-active small {
  color: #d9d9d9;
}

.production-order-customer-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
}

.production-order-customer-select.is-active {
  border-color: var(--amber);
}

.production-order-customer-select span {
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.production-order-customer-select select {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 10px;
}

.production-order-customer-select select:focus-visible {
  border-color: var(--amber);
  outline: 2px solid color-mix(in srgb, var(--amber) 28%, transparent);
  outline-offset: 1px;
}

.production-order-capacity-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.production-order-capacity-kpis.is-audit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.production-order-capacity-kpis article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.production-order-capacity-kpis span,
.production-order-capacity-kpis small {
  color: var(--muted);
  font-size: 10px;
}

.production-order-capacity-kpis strong {
  color: #147d67;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.production-order-capacity-kpis article.is-risk strong {
  color: var(--risk);
}

.production-order-capacity-kpis article.is-success strong {
  color: #147d67;
}

.production-order-month-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.production-order-month-overview article {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--soft-line);
  border-top: 3px solid #1f9d84;
  border-radius: 6px;
  background: var(--surface);
}

.production-order-month-overview article.is-risk {
  border-top-color: var(--risk);
}

.production-order-month-overview header,
.production-order-month-overview footer,
.production-order-month-overview article > div {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.production-order-month-overview header,
.production-order-month-overview footer {
  justify-content: space-between;
}

.production-order-month-overview header strong {
  color: var(--ink);
  font-size: 11px;
}

.production-order-month-overview header span,
.production-order-month-overview footer,
.production-order-month-overview article > div > span {
  color: var(--muted);
  font-size: 9px;
}

.production-order-month-overview article > div > span {
  flex: 0 0 26px;
}

.production-order-month-overview article > div > i {
  position: relative;
  flex: 1 1 auto;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
}

.production-order-month-overview article > div > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.production-order-month-overview .is-demand {
  background: #287fd1;
}

.production-order-month-overview .is-other-demand {
  background: #cf3f4f;
}

.production-order-month-overview .is-capacity {
  background: #1f9d84;
}

.production-order-month-overview article > div > em {
  flex: 0 0 68px;
  overflow: hidden;
  color: var(--ink);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-order-recommendations {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--risk) 28%, var(--soft-line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--risk) 4%, var(--surface));
}

.production-order-recommendations .section-heading {
  margin: 0;
}

.production-order-recommendations .section-heading h4 {
  margin: 0;
  font-size: 12px;
}

.production-order-recommendations .section-heading p,
.production-order-recommendations .section-heading > span {
  font-size: 9px;
}

.production-order-recommendations > div:last-child {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.production-order-recommendations article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border-left: 3px solid var(--risk);
  background: var(--surface-2);
}

.production-order-recommendations article strong,
.production-order-recommendations article span,
.production-order-recommendations article small {
  overflow-wrap: anywhere;
}

.production-order-recommendations article strong {
  color: var(--ink);
  font-size: 10px;
}

.production-order-recommendations article span {
  color: var(--risk);
  font-size: 10px;
  font-weight: 800;
}

.production-order-recommendations article small {
  color: var(--muted);
  font-size: 8px;
}

.production-order-audit-note {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid #1f9d84;
  background: color-mix(in srgb, #1f9d84 7%, var(--surface-2));
  color: #147d67;
  font-size: 9px;
  font-weight: 750;
}

.production-order-audit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.production-order-audit-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
}

.production-order-audit-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  font-size: 9px;
  list-style: none;
}

.production-order-audit-panel > summary::-webkit-details-marker {
  display: none;
}

.production-order-audit-panel > summary > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.production-order-audit-panel > summary > span:first-child {
  display: grid;
  gap: 2px;
}

.production-order-audit-panel > summary small,
.production-order-audit-panel > summary > span:last-child {
  color: var(--muted);
  font-size: 8px;
}

.production-order-audit-panel[open] > summary {
  border-bottom: 1px solid var(--soft-line);
}

.production-order-audit-panel > section + section {
  border-top: 1px solid var(--soft-line);
}

.production-order-audit-panel > section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 9px;
}

.production-order-audit-panel > section > header span {
  color: var(--muted);
  font-size: 8px;
}

.production-order-matrix-scroll {
  overflow-x: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
}

.production-order-matrix {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  background: var(--surface);
}

.production-order-matrix th,
.production-order-matrix td {
  min-width: 118px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--soft-line);
  border-right: 1px solid var(--soft-line);
  color: var(--ink);
  font-size: 10px;
  text-align: left;
  vertical-align: top;
}

.production-order-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
}

.production-order-matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 130px;
  background: var(--surface);
}

.production-order-matrix strong,
.production-order-matrix small,
.production-order-matrix em {
  display: block;
  overflow-wrap: anywhere;
}

.production-order-matrix strong {
  font-size: 11px;
}

.production-order-matrix small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.production-order-matrix em {
  margin-top: 5px;
  color: #147d67;
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
}

.production-order-matrix td.is-warning {
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
}

.production-order-matrix td.is-overload,
.production-order-matrix td.is-unassigned {
  background: color-mix(in srgb, var(--risk) 8%, var(--surface));
}

.production-order-matrix td.is-overload em,
.production-order-matrix td.is-unassigned em {
  color: var(--risk);
}

.production-order-matrix td.is-idle {
  color: var(--muted);
}

.production-order-month-details {
  display: grid;
  gap: 7px;
}

.production-order-month-details details {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
}

.production-order-month-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
  list-style: none;
}

.production-order-month-details summary::-webkit-details-marker {
  display: none;
}

.production-order-month-details summary > span:first-child {
  display: grid;
  gap: 2px;
}

.production-order-month-details summary small {
  color: var(--muted);
  font-size: 9px;
}

.production-order-month-details details[open] summary {
  border-bottom: 1px solid var(--soft-line);
}

.production-order-month-details details > p {
  margin: 0;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 9px;
}

.production-order-detail-table {
  min-width: 920px;
}

.production-order-match {
  display: inline-flex;
  padding: 3px 6px;
  border-radius: 999px;
  color: #147d67;
  background: color-mix(in srgb, #1f9d84 12%, var(--surface));
  font-size: 8px;
  font-weight: 850;
}

.production-order-match.is-unassigned {
  color: var(--risk);
  background: color-mix(in srgb, var(--risk) 10%, var(--surface));
}

.production-execution-panel {
  display: grid;
  gap: 12px;
}

.production-execution-heading {
  margin-bottom: 0;
}

.production-execution-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-left: 3px solid #287fd1;
  background: color-mix(in srgb, #287fd1 6%, var(--surface-2));
}

.production-execution-source span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
}

.production-execution-source small {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.production-execution-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.production-execution-kpis article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
}

.production-execution-kpis span,
.production-execution-kpis small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-execution-kpis strong {
  color: #216db2;
  font-size: 20px;
}

.production-execution-kpis article.is-risk strong {
  color: var(--risk);
}

.production-execution-table-scroll {
  max-height: 620px;
}

.production-execution-table {
  min-width: 1320px;
}

.production-execution-table td {
  vertical-align: top;
}

.production-execution-table td > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.production-execution-table td > i {
  display: block;
  width: 130px;
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 76%, transparent);
}

.production-execution-table td > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f9d84;
}

.production-execution-table tr.is-overdue td {
  background: color-mix(in srgb, var(--risk) 4%, var(--surface));
}

.production-execution-status,
.production-execution-mrp {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, #287fd1 10%, var(--surface-2));
  color: #216db2;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.production-execution-status.is-in_process,
.production-execution-status.is-completed,
.production-execution-mrp.is-completed,
.production-execution-mrp.is-in_process {
  background: color-mix(in srgb, #1f9d84 11%, var(--surface-2));
  color: #147d67;
}

.production-execution-status.is-unaudited,
.production-execution-mrp.is-shortage {
  background: color-mix(in srgb, var(--risk) 9%, var(--surface-2));
  color: var(--risk);
}

.production-execution-status.is-approved,
.production-execution-status.is-pending,
.production-execution-mrp.is-pending,
.production-execution-mrp.is-mrp_unavailable {
  background: var(--amber-soft);
  color: #956100;
}

.production-department-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.production-department-filter button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
}

.production-department-filter button > i {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.production-department-filter button > span,
.production-department-filter button small {
  display: block;
  min-width: 0;
}

.production-department-filter button strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.production-department-filter button small {
  margin-top: 2px;
  font-size: 8px;
}

.production-department-filter button.is-active {
  border-color: var(--amber);
  background: #111;
  color: var(--amber);
}

.production-department-filter button.is-active strong {
  color: #fff;
}

.production-execution-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.production-execution-kpis article > i {
  width: 17px;
  height: 17px;
  color: #287fd1;
}

.production-execution-kpis article.is-ready strong,
.production-execution-kpis article.is-ready > i {
  color: #147d67;
}

.production-execution-kpis article.is-work strong,
.production-execution-kpis article.is-work > i {
  color: #7757d7;
}

.production-schedule-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--soft-line);
}

.production-schedule-visuals > section {
  min-width: 0;
  padding: 10px 0;
}

.production-schedule-visuals .section-heading h4,
.production-schedule-section .section-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.production-schedule-visuals .section-heading p,
.production-schedule-section .section-heading p {
  margin-top: 3px;
  font-size: 9px;
}

.production-schedule-visuals .section-heading > i {
  width: 20px;
  height: 20px;
  color: var(--amber-strong);
}

.production-schedule-breakdown {
  display: grid;
  gap: 7px;
}

.production-schedule-breakdown article {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(80px, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.production-schedule-breakdown article strong,
.production-schedule-breakdown article small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-schedule-breakdown article strong {
  color: var(--ink);
  font-size: 10px;
}

.production-schedule-breakdown article small,
.production-schedule-breakdown article em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.production-schedule-breakdown article > i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.production-schedule-breakdown article > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #287fd1;
}

.production-schedule-section {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.production-machining-batches {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--soft-line);
}

.production-machining-batches .section-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.production-machining-batches .section-heading p {
  margin-top: 3px;
  font-size: 9px;
}

.production-machining-batch-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.production-machining-batch {
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #287fd1 30%, var(--soft-line));
  border-radius: 6px;
  background: color-mix(in srgb, #287fd1 5%, var(--surface-2));
}

.production-machining-batch > summary {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.2fr) minmax(150px, 1fr) 18px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  cursor: pointer;
  list-style: none;
}

.production-machining-batch > summary::-webkit-details-marker {
  display: none;
}

.production-machining-batch > summary > i:first-child {
  width: 24px;
  height: 24px;
  padding: 5px;
  border-radius: 6px;
  background: color-mix(in srgb, #287fd1 13%, var(--surface));
  color: #287fd1;
}

.production-machining-batch > summary span,
.production-machining-batch > summary strong,
.production-machining-batch > summary small {
  display: block;
  min-width: 0;
}

.production-machining-batch > summary strong,
.production-machining-batch > summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-machining-batch > summary strong {
  color: var(--ink);
  font-size: 10px;
}

.production-machining-batch > summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.production-machining-batch[open] > summary > i:last-child {
  transform: rotate(180deg);
}

.production-machining-batch > div {
  display: grid;
  gap: 5px;
  padding: 0 10px 10px 47px;
}

.production-machining-batch > div > span {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid var(--soft-line);
}

.production-machining-batch > div strong,
.production-machining-batch > div small {
  overflow-wrap: anywhere;
}

.production-machining-batch > div strong {
  color: var(--ink);
  font-size: 9px;
}

.production-machining-batch > div small {
  color: var(--muted);
  font-size: 8px;
}

.production-schedule-queue {
  display: grid;
  gap: 6px;
}

.production-schedule-row {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-left: 4px solid #8a9098;
  border-radius: 6px;
  background: var(--surface-2);
}

.production-schedule-row.is-risk {
  border-left-color: var(--risk);
}

.production-schedule-row.is-warning {
  border-left-color: var(--amber-strong);
}

.production-schedule-row.is-work {
  border-left-color: #7757d7;
}

.production-schedule-row.is-ok {
  border-left-color: #147d67;
}

.production-schedule-row > summary {
  display: grid;
  grid-template-columns: 90px minmax(160px, 1.4fr) minmax(130px, 1fr) minmax(150px, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 11px;
  cursor: pointer;
  list-style: none;
}

.production-schedule-row > summary::-webkit-details-marker {
  display: none;
}

.production-schedule-row > summary > span:not(.production-schedule-priority):not(.production-schedule-readiness),
.production-schedule-row > summary small {
  display: block;
  min-width: 0;
}

.production-schedule-row > summary strong,
.production-schedule-row > summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-schedule-row > summary strong {
  color: var(--ink);
  font-size: 10px;
}

.production-schedule-row > summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.production-schedule-priority,
.production-schedule-readiness {
  display: inline-flex;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 850;
  white-space: nowrap;
}

.production-schedule-priority {
  background: color-mix(in srgb, var(--amber) 18%, var(--surface));
  color: #865900;
}

.production-schedule-readiness {
  background: color-mix(in srgb, #287fd1 9%, var(--surface));
  color: #216db2;
}

.production-schedule-readiness.is-ready {
  background: color-mix(in srgb, #1f9d84 12%, var(--surface));
  color: #147d67;
}

.production-schedule-readiness.is-shortage {
  background: color-mix(in srgb, var(--risk) 10%, var(--surface));
  color: var(--risk);
}

.production-schedule-readiness.is-purchase_covered {
  background: color-mix(in srgb, #7757d7 11%, var(--surface));
  color: #6242c5;
}

.production-schedule-row[open] > summary > i:last-child {
  transform: rotate(180deg);
}

.production-schedule-detail {
  display: grid;
  gap: 9px;
  padding: 0 11px 11px;
}

.production-schedule-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.production-schedule-context span {
  padding: 4px 7px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
}

.production-demand-links {
  display: grid;
  gap: 5px;
  padding-top: 7px;
  border-top: 1px solid var(--soft-line);
}

.production-demand-links > strong {
  color: var(--ink);
  font-size: 10px;
}

.production-demand-links > small {
  color: var(--muted);
  font-size: 8px;
}

.production-demand-links .report-table {
  min-width: 760px;
}

.production-demand-links td > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.production-main-material-scroll {
  max-height: 340px;
}

.production-main-material-table {
  min-width: 920px;
}

.production-main-material-table td > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.production-main-material-table .purchase-arrival-status {
  font-weight: 800;
}

.production-main-material-table .purchase-arrival-status.is-on_time {
  color: var(--ok);
}

.production-main-material-table .purchase-arrival-status.is-late,
.production-main-material-table .purchase-arrival-status.is-overdue,
.production-main-material-table .purchase-arrival-status.is-insufficient {
  color: var(--risk);
}

.production-main-material-table .purchase-arrival-status.is-date_missing,
.production-main-material-table .purchase-arrival-status.is-requirement_missing,
.production-main-material-table .purchase-arrival-status.is-unknown {
  color: var(--amber-strong);
}

.production-main-material-table tr.is-shortage td {
  background: color-mix(in srgb, var(--risk) 5%, var(--surface));
}

.production-main-material-empty {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
  border-left: 3px solid var(--amber);
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}

.production-main-material-empty > i {
  width: 17px;
  height: 17px;
  color: var(--amber-strong);
}

.production-main-material-empty strong,
.production-main-material-empty small {
  display: block;
}

.production-main-material-empty strong {
  color: var(--ink);
  font-size: 10px;
}

.production-main-material-empty small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.production-detail-heading {
  margin-top: 4px;
}

.production-output-reference {
  display: grid;
  gap: 11px;
  margin: 2px 0 16px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, #287fd1 42%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, #287fd1 5%, var(--surface-2));
}

.production-reference-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.production-reference-heading > div {
  display: grid;
  gap: 3px;
}

.production-reference-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.production-reference-heading span,
.production-reference-heading small {
  color: var(--muted);
  font-size: 10px;
}

.production-reference-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.production-reference-kpis article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
}

.production-reference-kpis span,
.production-reference-kpis small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-reference-kpis strong {
  color: var(--ink);
  font-size: 17px;
}

.production-reference-kpis article:nth-child(n + 2) strong {
  color: #216db2;
}

.production-reference-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.production-reference-breakdown {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.production-reference-breakdown > strong {
  padding-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.production-reference-sizes > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: var(--surface);
}

.production-reference-sizes b {
  color: var(--ink);
  font-size: 11px;
}

.production-reference-sizes small,
.production-reference-empty,
.production-reference-basis {
  color: var(--muted);
  font-size: 10px;
}

.production-reference-empty,
.production-reference-basis {
  margin: 0;
  line-height: 1.5;
}

.production-reference-basis {
  padding-top: 2px;
  border-top: 1px solid var(--soft-line);
}

.production-merged-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.production-merged-controls label {
  display: grid;
  gap: 4px;
}

.production-merged-controls label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.production-merged-controls input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.production-merged-controls input:focus-visible {
  border-color: #287fd1;
  outline: 2px solid color-mix(in srgb, #287fd1 30%, transparent);
  outline-offset: 1px;
}

.production-merged-controls .primary-button,
.production-merged-controls .secondary-button {
  min-height: 34px;
  height: auto;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.production-merged-controls .primary-button {
  border: 1px solid #216db2;
  background: #216db2;
  color: #fff;
}

.production-merged-controls .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.production-batch-panel {
  display: grid;
  gap: 11px;
  margin: 2px 0 16px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, #1f9d84 48%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, #1f9d84 6%, var(--surface-2));
}

.production-batch-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.production-batch-heading > div {
  display: grid;
  gap: 3px;
}

.production-batch-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.production-batch-heading span,
.production-batch-heading small {
  color: var(--muted);
  font-size: 10px;
}

.production-batch-controls {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(140px, 0.9fr) minmax(140px, 0.8fr) auto auto;
  align-items: end;
  gap: 8px;
}

.production-batch-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.production-batch-controls label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.production-batch-controls select,
.production-batch-controls input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.production-batch-controls select:focus-visible,
.production-batch-controls input:focus-visible {
  border-color: #1f9d84;
  outline: 2px solid color-mix(in srgb, #1f9d84 30%, transparent);
  outline-offset: 1px;
}

.production-batch-controls .primary-button,
.production-batch-controls .secondary-button {
  min-height: 34px;
  height: auto;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.production-batch-controls .primary-button {
  border: 1px solid #147d67;
  background: #147d67;
  color: #fff;
}

.production-batch-controls .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.production-batch-preview {
  min-height: 34px;
  padding: 8px 10px;
  border-left: 3px solid #1f9d84;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.production-batch-preview strong {
  color: var(--ink);
}

.production-batch-preview .is-positive {
  color: #147d67;
}

.production-batch-preview .is-negative,
.production-batch-preview .is-error {
  color: var(--risk);
}

.production-batch-message {
  margin: 0;
  color: #147d67;
  font-size: 11px;
  font-weight: 800;
}

.production-output-overview {
  border-color: color-mix(in srgb, #147d67 38%, var(--line));
}

.production-output-chart-scroll {
  margin-top: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 7px;
}

.production-output-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(82px, 1fr));
  align-items: end;
  gap: 9px;
  min-width: 690px;
  min-height: 222px;
  padding: 16px 10px 8px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0, transparent 49px, color-mix(in srgb, var(--line) 62%, transparent) 50px);
}

.production-output-month {
  display: grid;
  grid-template-rows: 24px 138px 25px;
  align-items: end;
  gap: 7px;
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.production-output-month:hover,
.production-output-month:focus-visible {
  border-color: color-mix(in srgb, #147d67 50%, var(--line));
  background: color-mix(in srgb, #147d67 6%, var(--surface-2));
}

.production-output-month:focus-visible {
  outline: 2px solid color-mix(in srgb, #147d67 42%, transparent);
  outline-offset: 2px;
}

.production-output-month.is-active {
  border-color: #147d67;
  background: color-mix(in srgb, #147d67 9%, var(--surface-2));
}

.production-output-month > strong {
  align-self: start;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-output-month > span {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 4px 4px 0 0;
  background: color-mix(in srgb, #147d67 8%, var(--surface-2));
}

.production-output-month > span i {
  display: block;
  width: min(52px, 66%);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: #147d67;
  transition: height 180ms ease, background-color 180ms ease;
}

.production-output-month.is-active > span i {
  background: #e5a81a;
}

.production-output-month > small {
  align-self: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.production-output-kpis article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px 7px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: color-mix(in srgb, #147d67 5%, var(--surface-2));
}

.production-output-kpis span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.production-output-kpis strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1;
}

.production-output-kpis small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.production-work-hour-overview {
  border-color: color-mix(in srgb, #287fd1 36%, var(--line));
}

.production-work-hour-filters {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px 14px;
  margin-top: 14px;
}

.production-work-hour-filters > span {
  padding-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.production-work-hour-filters > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.production-work-hour-filters button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.production-work-hour-filters button:hover,
.production-work-hour-filters button:focus-visible {
  border-color: #287fd1;
  color: var(--ink);
}

.production-work-hour-filters button:focus-visible {
  outline: 2px solid color-mix(in srgb, #287fd1 42%, transparent);
  outline-offset: 2px;
}

.production-work-hour-filters button.is-active {
  border-color: #216db2;
  background: #216db2;
  color: #fff;
}

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

.production-work-hour-kpis article {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4px 7px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: color-mix(in srgb, #287fd1 5%, var(--surface-2));
}

.production-work-hour-kpis span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.production-work-hour-kpis strong {
  color: var(--ink);
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1;
}

.production-work-hour-kpis small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.production-work-hour-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, #287fd1 45%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, #287fd1 5%, var(--surface-2));
}

.production-work-hour-empty > span {
  min-width: 62px;
  color: #287fd1;
  font-size: 28px;
  font-weight: 950;
  text-align: center;
}

.production-work-hour-empty > div {
  display: grid;
  gap: 5px;
}

.production-work-hour-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.production-work-hour-empty p,
.production-work-hour-empty small {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.production-work-hour-empty p {
  font-size: 12px;
}

.production-work-hour-empty small {
  font-size: 10px;
}

.production-work-hour-bars {
  display: grid;
  gap: 8px;
}

.production-work-hour-bar {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(100px, 1.2fr) minmax(82px, auto);
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

button.production-work-hour-bar:hover,
button.production-work-hour-bar:focus-visible,
.production-work-hour-bar.is-active {
  border-color: #287fd1;
  background: color-mix(in srgb, #287fd1 7%, var(--surface));
}

button.production-work-hour-bar:focus-visible {
  outline: 2px solid color-mix(in srgb, #287fd1 42%, transparent);
  outline-offset: 2px;
}

.production-work-hour-bar > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.production-work-hour-bar strong,
.production-work-hour-bar small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-work-hour-bar strong {
  font-size: 12px;
}

.production-work-hour-bar small {
  color: var(--muted);
  font-size: 10px;
}

.production-work-hour-bar > i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.production-work-hour-bar > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #287fd1;
}

.production-work-hour-bar > em {
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.production-work-hour-table-scroll {
  max-height: 520px;
}

.production-work-hour-people-table {
  min-width: 720px;
}

.production-work-hour-detail-table {
  min-width: 1080px;
}

.production-work-hour-people-table td > span:not(.production-site-badge),
.production-work-hour-detail-table td > span:not(.production-site-badge) {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.work-hour-number {
  white-space: nowrap;
  text-align: right;
}

.work-hour-number strong {
  color: #216db2;
}

.workbench-main {
  display: grid;
  align-content: start;
  gap: 14px;
}

.workbench-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid #147d67;
  border-radius: 8px;
  background: var(--surface);
}

.workbench-hero > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.workbench-hero > div > span {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 7px;
  background: #147d67;
  color: #fff;
}

.workbench-hero svg {
  width: 22px;
  height: 22px;
}

.workbench-hero p,
.workbench-hero h2,
.workbench-hero small {
  margin: 0;
}

.workbench-hero p {
  color: #147d67;
  font-size: 11px;
  font-weight: 900;
}

.workbench-hero h2 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 23px;
}

.workbench-hero small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.workbench-hub-count,
.workbench-level-count {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  color: var(--muted);
}

.workbench-hub-count strong {
  color: #147d67;
  font-size: 25px;
}

.workbench-hub-count small,
.workbench-level-count {
  font-size: 10px;
  font-weight: 800;
}

.workbench-department-grid,
.workbench-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workbench-department-card,
.workbench-tool-card {
  --workbench-tone: #147d67;
  position: relative;
  display: grid;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.workbench-department-card {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 118px;
  padding: 18px;
  box-shadow: inset 3px 0 0 var(--workbench-tone);
}

.workbench-department-card:hover,
.workbench-department-card:focus-visible,
.workbench-tool-card:hover,
.workbench-tool-card:focus-visible {
  border-color: var(--workbench-tone);
  outline: 0;
  box-shadow: inset 3px 0 0 var(--workbench-tone), 0 8px 22px color-mix(in srgb, var(--workbench-tone) 10%, transparent);
}

.tone-sales {
  --workbench-tone: #c38a18;
}

.tone-production {
  --workbench-tone: #147d67;
}

.tone-quality {
  --workbench-tone: #c3573f;
}

.tone-procurement {
  --workbench-tone: #7159b8;
}

.tone-finance {
  --workbench-tone: #2473a8;
}

.workbench-department-icon,
.workbench-tool-icon,
.workbench-level-title > span {
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--workbench-tone) 13%, var(--surface-2));
  color: var(--workbench-tone);
}

.workbench-department-icon {
  width: 46px;
  height: 46px;
}

.workbench-department-icon svg,
.workbench-tool-icon svg,
.workbench-level-title > span svg {
  width: 22px;
  height: 22px;
}

.workbench-department-copy,
.workbench-tool-copy {
  min-width: 0;
}

.workbench-department-copy strong,
.workbench-department-copy small,
.workbench-tool-copy strong,
.workbench-tool-copy small {
  display: block;
}

.workbench-department-copy strong,
.workbench-tool-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.workbench-department-copy small,
.workbench-tool-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.workbench-department-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.workbench-department-meta b {
  color: var(--workbench-tone);
}

.workbench-department-meta svg,
.workbench-tool-card > svg {
  width: 17px;
  height: 17px;
}

.workbench-level-header {
  --workbench-tone: #147d67;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--workbench-tone);
  border-radius: 8px;
  background: var(--surface);
}

.workbench-level-header.tone-sales {
  --workbench-tone: #c38a18;
}

.workbench-level-header.tone-production {
  --workbench-tone: #147d67;
}

.workbench-level-header.tone-quality {
  --workbench-tone: #c3573f;
}

.workbench-level-header.tone-procurement {
  --workbench-tone: #7159b8;
}

.workbench-level-header.tone-finance {
  --workbench-tone: #2473a8;
}

.workbench-back {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}

.workbench-back span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.workbench-back svg {
  width: 18px;
  height: 18px;
}

.workbench-level-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.workbench-level-title > span {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.workbench-level-title p,
.workbench-level-title h2,
.workbench-level-title small {
  margin: 0;
}

.workbench-level-title p {
  color: var(--workbench-tone);
  font-size: 9px;
  font-weight: 900;
}

.workbench-level-title h2 {
  margin-top: 1px;
  color: var(--ink);
  font-size: 20px;
}

.workbench-level-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.workbench-tool-card {
  grid-template-columns: 40px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  min-height: 104px;
  padding: 15px;
}

.workbench-tool-card.is-planned {
  cursor: default;
  opacity: 0.66;
}

.workbench-tool-card.is-planned:hover,
.workbench-tool-card.is-planned:focus-visible {
  border-color: var(--line);
  box-shadow: none;
}

.workbench-tool-icon {
  width: 40px;
  height: 40px;
}

.workbench-tool-status {
  padding: 4px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--workbench-tone) 10%, var(--surface-2));
  color: var(--workbench-tone);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.workbench-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.workbench-summary article {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 16px;
  border-right: 1px solid var(--soft-line);
}

.workbench-summary article:last-child {
  border-right: 0;
}

.workbench-summary article > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, #147d67 12%, var(--surface-2));
  color: #147d67;
}

.workbench-summary article.is-warning > span {
  background: color-mix(in srgb, #c4473d 12%, var(--surface-2));
  color: #c4473d;
}

.workbench-summary small,
.workbench-summary strong {
  display: block;
}

.workbench-summary small {
  color: var(--muted);
  font-size: 10px;
}

.workbench-summary strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
}

.production-weight-panel {
  min-width: 0;
}

.production-weight-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  border-block: 1px solid var(--soft-line);
}

.production-weight-kpis article {
  padding: 11px 14px;
  border-right: 1px solid var(--soft-line);
}

.production-weight-kpis article:last-child {
  border-right: 0;
}

.production-weight-kpis small,
.production-weight-kpis strong {
  display: block;
}

.production-weight-kpis small {
  color: var(--muted);
  font-size: 10px;
}

.production-weight-kpis strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
}

.production-weight-kpis article.is-warning strong {
  color: #b43b33;
}

.production-weight-bars {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.production-weight-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(120px, 1fr) minmax(104px, auto);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.production-weight-row > span,
.production-weight-row > em {
  min-width: 0;
}

.production-weight-row strong,
.production-weight-row small {
  display: block;
}

.production-weight-row > span strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-weight-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.production-weight-row > i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-line);
}

.production-weight-row > i > b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #147d67;
}

.production-weight-row > em {
  color: var(--ink);
  font-style: normal;
  text-align: right;
}

.production-weight-detail {
  margin-top: 14px;
  border-top: 1px solid var(--soft-line);
}

.production-weight-detail > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 2px 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.production-weight-detail > summary svg:last-child {
  margin-left: auto;
}

.production-weight-detail .table-scroll {
  margin-top: 10px;
  max-height: 430px;
}

.production-weight-detail table {
  min-width: 980px;
}

.is-workbench-tool {
  margin-top: 0;
}

.customer-receipt-workbench {
  --receipt-gold: #b87908;
  --receipt-green: #147d67;
  --receipt-red: #b43b33;
}

.customer-receipt-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-receipt-summary button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 13px 14px;
  border: 0;
  border-right: 1px solid var(--soft-line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.customer-receipt-summary button:last-child {
  border-right: 0;
}

.customer-receipt-summary button:hover,
.customer-receipt-summary button:focus-visible,
.customer-receipt-summary button.is-active {
  outline: 0;
  background: color-mix(in srgb, var(--receipt-gold) 9%, var(--surface));
}

.customer-receipt-summary button > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--receipt-gold) 12%, var(--surface-2));
  color: var(--receipt-gold);
}

.customer-receipt-summary button.tone-received > span {
  background: color-mix(in srgb, var(--receipt-green) 12%, var(--surface-2));
  color: var(--receipt-green);
}

.customer-receipt-summary button.tone-inconsistent > span {
  background: color-mix(in srgb, var(--receipt-red) 12%, var(--surface-2));
  color: var(--receipt-red);
}

.customer-receipt-summary svg {
  width: 17px;
  height: 17px;
}

.customer-receipt-summary small,
.customer-receipt-summary strong {
  min-width: 0;
}

.customer-receipt-summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-receipt-summary strong {
  color: var(--ink);
  font-size: 18px;
}

.customer-receipt-console {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-receipt-console-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--soft-line);
}

.customer-receipt-console-header > div {
  min-width: 0;
}

.customer-receipt-console-header h3,
.customer-receipt-console-header p {
  margin: 0;
}

.customer-receipt-console-header h3 {
  color: var(--ink);
  font-size: 17px;
}

.customer-receipt-console-header p {
  max-width: 780px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.customer-receipt-permission {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.customer-receipt-permission.is-write {
  border-color: color-mix(in srgb, var(--receipt-green) 40%, var(--line));
  color: var(--receipt-green);
}

.customer-receipt-permission svg,
.customer-receipt-toolbar svg,
.customer-receipt-message svg,
.customer-receipt-status svg,
.customer-receipt-recorded h4 svg,
.customer-receipt-entry-heading h4 svg,
.customer-receipt-warning svg,
.customer-receipt-review svg,
.customer-receipt-readonly svg {
  width: 16px;
  height: 16px;
}

.customer-receipt-toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(150px, 1fr) minmax(125px, 0.75fr) minmax(120px, 0.75fr) auto auto;
  gap: 8px;
  margin-top: 13px;
}

.customer-receipt-toolbar > label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
}

.customer-receipt-toolbar input,
.customer-receipt-toolbar select,
.customer-receipt-toolbar button {
  min-width: 0;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
}

.customer-receipt-toolbar input {
  width: 100%;
  height: 37px;
  border: 0;
  outline: 0;
  background: transparent;
}

.customer-receipt-toolbar select {
  padding: 0 9px;
}

.customer-receipt-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  cursor: pointer;
}

.customer-receipt-toolbar button[type="submit"] {
  border-color: #111;
  background: #111;
  color: #fff;
}

.customer-receipt-toolbar button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.customer-receipt-date-range {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
}

.customer-receipt-date-range > span,
.customer-receipt-date-range label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.customer-receipt-date-range > span {
  margin-right: auto;
}

.customer-receipt-date-range svg {
  width: 15px;
  height: 15px;
}

.customer-receipt-date-range input {
  width: 142px;
  height: 32px;
  padding: 0 8px;
  background: var(--surface);
}

.customer-receipt-date-range i {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.customer-receipt-message {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 11px 0 0;
  padding: 9px 11px;
  border-left: 3px solid currentColor;
  background: var(--surface-2);
  color: var(--receipt-green);
  font-size: 10px;
  line-height: 1.45;
}

.customer-receipt-message.is-error {
  color: var(--receipt-red);
}

.customer-receipt-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  gap: 13px;
  min-width: 0;
  margin-top: 13px;
}

.customer-receipt-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  max-height: 630px;
  overflow: auto;
  padding-right: 3px;
}

.customer-receipt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(115px, auto);
  gap: 7px 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--receipt-gold);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.customer-receipt-row.tone-received {
  border-left-color: var(--receipt-green);
}

.customer-receipt-row.tone-inconsistent {
  border-left-color: var(--receipt-red);
}

.customer-receipt-row:hover,
.customer-receipt-row:focus-visible,
.customer-receipt-row.is-active {
  border-color: var(--receipt-gold);
  outline: 0;
  background: color-mix(in srgb, var(--receipt-gold) 8%, var(--surface-2));
}

.customer-receipt-row.tone-received.is-active {
  border-color: var(--receipt-green);
  background: color-mix(in srgb, var(--receipt-green) 8%, var(--surface-2));
}

.customer-receipt-row.tone-inconsistent.is-active {
  border-color: var(--receipt-red);
  background: color-mix(in srgb, var(--receipt-red) 7%, var(--surface-2));
}

.customer-receipt-row-main,
.customer-receipt-row-amount {
  min-width: 0;
}

.customer-receipt-row-main strong,
.customer-receipt-row-main small,
.customer-receipt-row-amount strong,
.customer-receipt-row-amount small {
  display: block;
  min-width: 0;
}

.customer-receipt-row-main strong {
  color: var(--ink);
  font-size: 12px;
}

.customer-receipt-row-main small,
.customer-receipt-row-amount small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-receipt-row-amount {
  text-align: right;
}

.customer-receipt-row-amount strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-receipt-status {
  display: inline-flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 5px;
  width: fit-content;
  color: var(--receipt-gold);
  font-size: 9px;
  font-weight: 850;
}

.tone-received .customer-receipt-status {
  color: var(--receipt-green);
}

.tone-inconsistent .customer-receipt-status {
  color: var(--receipt-red);
}

.customer-receipt-detail {
  align-self: start;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--receipt-gold);
  border-radius: 8px;
  background: var(--surface-2);
}

.customer-receipt-detail.tone-received {
  border-top-color: var(--receipt-green);
}

.customer-receipt-detail.tone-inconsistent {
  border-top-color: var(--receipt-red);
}

.customer-receipt-detail > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-receipt-detail > header > div {
  min-width: 0;
}

.customer-receipt-detail > header small,
.customer-receipt-detail > header h3,
.customer-receipt-detail > header p {
  display: block;
  margin: 0;
}

.customer-receipt-detail > header small {
  color: var(--muted);
  font-size: 9px;
}

.customer-receipt-detail > header h3 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 20px;
}

.customer-receipt-detail > header p {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}

.customer-receipt-detail > header .customer-receipt-status {
  grid-column: auto;
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid currentColor;
  border-radius: 5px;
  white-space: nowrap;
}

.customer-receipt-system-grid,
.customer-receipt-recorded dl,
.customer-receipt-dialog dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 14px 0 0;
  border-top: 1px solid var(--soft-line);
  border-left: 1px solid var(--soft-line);
}

.customer-receipt-system-grid > div,
.customer-receipt-recorded dl > div,
.customer-receipt-dialog dl > div {
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
}

.customer-receipt-system-grid dt,
.customer-receipt-recorded dt,
.customer-receipt-dialog dt {
  color: var(--muted);
  font-size: 9px;
}

.customer-receipt-system-grid dd,
.customer-receipt-recorded dd,
.customer-receipt-dialog dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.customer-receipt-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 11px;
  border-left: 3px solid var(--receipt-red);
  background: color-mix(in srgb, var(--receipt-red) 8%, var(--surface));
  color: var(--receipt-red);
}

.customer-receipt-warning div {
  min-width: 0;
}

.customer-receipt-warning strong,
.customer-receipt-warning p {
  margin: 0;
}

.customer-receipt-warning p {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.customer-receipt-recorded,
.customer-receipt-entry {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--soft-line);
}

.customer-receipt-recorded h4,
.customer-receipt-entry-heading h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.customer-receipt-recorded h4 {
  color: var(--receipt-green);
}

.customer-receipt-recorded dd.is-variance {
  color: var(--receipt-red);
}

.customer-receipt-entry-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-receipt-entry-heading > div {
  min-width: 0;
}

.customer-receipt-entry-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.customer-receipt-entry-heading > span {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

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

.customer-receipt-fields label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.customer-receipt-fields input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.customer-receipt-money-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.customer-receipt-money-input b {
  padding: 0 9px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.customer-receipt-money-input input {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
}

.customer-receipt-review,
.customer-receipt-readonly {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
}

.customer-receipt-review {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid #111;
  border-radius: 6px;
  background: #111;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.customer-receipt-readonly {
  color: var(--muted);
  font-size: 10px;
}

.customer-receipt-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.customer-receipt-empty svg {
  width: 24px;
  height: 24px;
}

.customer-receipt-empty strong {
  color: var(--ink);
  font-size: 12px;
}

.customer-receipt-empty span {
  font-size: 9px;
}

.customer-receipt-dialog-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 8, 12, 0.66);
}

.customer-receipt-dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--receipt-gold);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

.customer-receipt-dialog > header {
  display: flex;
  align-items: center;
  gap: 11px;
}

.customer-receipt-dialog > header > span {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--receipt-gold) 13%, var(--surface-2));
  color: var(--receipt-gold);
}

.customer-receipt-dialog > header svg {
  width: 21px;
  height: 21px;
}

.customer-receipt-dialog > header small,
.customer-receipt-dialog > header h3,
.customer-receipt-dialog > p {
  margin: 0;
}

.customer-receipt-dialog > header small {
  color: var(--receipt-gold);
  font-size: 9px;
  font-weight: 850;
}

.customer-receipt-dialog > header h3 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
}

.customer-receipt-dialog > p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.customer-receipt-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
}

.customer-receipt-dialog-actions button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.customer-receipt-dialog-actions button:last-child {
  border-color: var(--receipt-gold);
  background: var(--receipt-gold);
  color: #111;
}

.customer-receipt-dialog-actions button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.customer-receipt-received-summary {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-receipt-received-summary > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.customer-receipt-received-summary > header > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.customer-receipt-received-summary > header > div > span {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--receipt-green) 12%, var(--surface-2));
  color: var(--receipt-green);
}

.customer-receipt-received-summary > header svg {
  width: 19px;
  height: 19px;
}

.customer-receipt-received-summary h3,
.customer-receipt-received-summary p {
  margin: 0;
}

.customer-receipt-received-summary h3 {
  color: var(--ink);
  font-size: 16px;
}

.customer-receipt-received-summary p {
  max-width: 620px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.customer-receipt-received-summary > header dl {
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
  margin: 0;
}

.customer-receipt-received-summary > header dl > div {
  min-width: 74px;
  text-align: right;
}

.customer-receipt-received-summary dt {
  color: var(--muted);
  font-size: 8px;
}

.customer-receipt-received-summary dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.customer-receipt-summary-table-wrap {
  max-height: 440px;
  margin-top: 13px;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
}

.customer-receipt-summary-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 10px;
}

.customer-receipt-summary-table th,
.customer-receipt-summary-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--soft-line);
  text-align: right;
  vertical-align: middle;
}

.customer-receipt-summary-table th:first-child,
.customer-receipt-summary-table td:first-child {
  min-width: 220px;
  text-align: left;
}

.customer-receipt-summary-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
}

.customer-receipt-summary-table tbody tr:last-child td {
  border-bottom: 0;
}

.customer-receipt-summary-table tbody tr:hover {
  background: color-mix(in srgb, var(--receipt-green) 6%, var(--surface));
}

.customer-receipt-summary-table td strong,
.customer-receipt-summary-table td small {
  display: block;
}

.customer-receipt-summary-table td strong {
  overflow-wrap: anywhere;
}

.customer-receipt-summary-table td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.customer-receipt-summary-empty {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 13px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
}

:root[data-theme="dark"] .customer-receipt-summary,
:root[data-theme="dark"] .customer-receipt-console,
:root[data-theme="dark"] .customer-receipt-received-summary,
:root[data-theme="dark"] .customer-receipt-dialog {
  background: var(--surface-2);
}

:root[data-theme="dark"] .customer-receipt-row,
:root[data-theme="dark"] .customer-receipt-detail,
:root[data-theme="dark"] .customer-receipt-toolbar label,
:root[data-theme="dark"] .customer-receipt-toolbar input,
:root[data-theme="dark"] .customer-receipt-toolbar select,
:root[data-theme="dark"] .customer-receipt-toolbar button,
:root[data-theme="dark"] .customer-receipt-fields input,
:root[data-theme="dark"] .customer-receipt-money-input,
:root[data-theme="dark"] .customer-receipt-dialog-actions button {
  background: var(--surface);
}

:root[data-theme="dark"] .customer-receipt-toolbar button[type="submit"],
:root[data-theme="dark"] .customer-receipt-review {
  border-color: var(--amber);
  background: var(--amber);
  color: #111;
}

:root[data-theme="dark"] .customer-receipt-permission.is-write,
:root[data-theme="dark"] .tone-received .customer-receipt-status,
:root[data-theme="dark"] .customer-receipt-recorded h4 {
  color: #56d9bd;
}

@media (max-width: 1000px) {
  .customer-receipt-layout {
    grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1.28fr);
  }

  .customer-receipt-toolbar {
    grid-template-columns: minmax(190px, 1.4fr) minmax(140px, 1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto;
  }

  .customer-receipt-toolbar [data-customer-receipt-refresh] {
    grid-column: 1 / -1;
  }

  .customer-receipt-received-summary > header {
    display: grid;
  }

  .customer-receipt-received-summary > header dl {
    justify-content: space-between;
  }
}

@media (max-width: 760px) {
  .customer-receipt-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-receipt-summary button:nth-child(2) {
    border-right: 0;
  }

  .customer-receipt-summary button:nth-child(-n + 2) {
    border-bottom: 1px solid var(--soft-line);
  }

  .customer-receipt-console {
    padding: 13px;
  }

  .customer-receipt-console-header {
    display: grid;
  }

  .customer-receipt-permission {
    width: fit-content;
  }

  .customer-receipt-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .customer-receipt-toolbar > label,
  .customer-receipt-toolbar select {
    grid-column: 1 / -1;
  }

  .customer-receipt-toolbar select {
    min-width: 0;
  }

  .customer-receipt-toolbar [data-customer-receipt-refresh] {
    grid-column: auto;
    font-size: 0;
  }

  .customer-receipt-toolbar [data-customer-receipt-refresh] svg {
    width: 18px;
    height: 18px;
  }

  .customer-receipt-date-range {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .customer-receipt-date-range > span {
    grid-column: 1 / -1;
  }

  .customer-receipt-date-range label {
    min-width: 0;
  }

  .customer-receipt-date-range input {
    width: 100%;
  }

  .customer-receipt-layout {
    grid-template-columns: 1fr;
  }

  .customer-receipt-list {
    max-height: 330px;
  }

  .customer-receipt-detail {
    padding: 13px;
  }

  .customer-receipt-system-grid,
  .customer-receipt-recorded dl,
  .customer-receipt-dialog dl,
  .customer-receipt-fields {
    grid-template-columns: 1fr;
  }

  .customer-receipt-received-summary {
    padding: 13px;
  }

  .customer-receipt-received-summary > header dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .customer-receipt-received-summary > header dl > div {
    min-width: 0;
    text-align: left;
  }

  .receipt-v2-u8-evidence > header {
    flex-direction: column;
  }

  .receipt-v2-u8-evidence > header > strong {
    align-self: flex-start;
  }
}

@media (max-width: 440px) {
  .customer-receipt-summary button {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    padding: 10px;
  }

  .customer-receipt-summary button > span {
    width: 28px;
    height: 28px;
  }

  .customer-receipt-row {
    grid-template-columns: 1fr;
  }

  .customer-receipt-row-amount {
    text-align: left;
  }

  .customer-receipt-entry-heading,
  .customer-receipt-detail > header {
    display: grid;
  }

  .customer-receipt-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .customer-receipt-date-range {
    grid-template-columns: 1fr;
  }

  .customer-receipt-date-range > span,
  .customer-receipt-date-range label,
  .customer-receipt-date-range i {
    grid-column: 1;
  }

  .customer-receipt-date-range i {
    display: none;
  }

  .customer-receipt-received-summary > header dl {
    grid-template-columns: 1fr;
  }
}

:root[data-theme="dark"] .detail-hero-production,
:root[data-theme="dark"] .production-workspace-header,
:root[data-theme="dark"] .production-workspace-nav,
:root[data-theme="dark"] .production-source-strip,
:root[data-theme="dark"] .production-insight-panel,
:root[data-theme="dark"] .production-home-card,
:root[data-theme="dark"] .production-size-capacity-row,
:root[data-theme="dark"] .production-drill-panel,
:root[data-theme="dark"] .production-capacity-bar,
:root[data-theme="dark"] .production-capacity-filters button,
:root[data-theme="dark"] .production-work-hour-bar,
:root[data-theme="dark"] .production-work-hour-filters button {
  background: var(--surface-2);
}

:root[data-theme="dark"] .workbench-hero,
:root[data-theme="dark"] .workbench-summary,
:root[data-theme="dark"] .workbench-department-card,
:root[data-theme="dark"] .workbench-tool-card,
:root[data-theme="dark"] .workbench-level-header {
  background: var(--surface-2);
}

:root[data-theme="dark"] .production-workspace-nav button:hover,
:root[data-theme="dark"] .production-workspace-nav button:focus-visible,
:root[data-theme="dark"] .production-section-command {
  border-color: #56d9bd;
  color: #56d9bd;
}

:root[data-theme="dark"] .production-workspace-nav button.is-active,
:root[data-theme="dark"] .production-section-command:hover,
:root[data-theme="dark"] .production-section-command:focus-visible {
  border-color: #29b89b;
  background: #29b89b;
  color: #061510;
}

:root[data-theme="dark"] .production-insight-panel > header > span {
  background: color-mix(in srgb, #29b89b 14%, var(--surface));
  color: #56d9bd;
}

:root[data-theme="dark"] .production-readiness-ring {
  background: radial-gradient(circle at center, var(--surface-2) 55%, transparent 57%), conic-gradient(#29b89b calc(var(--ready-rate) * 1%), var(--soft-line) 0);
}

:root[data-theme="dark"] .production-readiness-ring strong {
  color: #56d9bd;
}

:root[data-theme="dark"] .production-pager button {
  background: var(--surface);
}

:root[data-theme="dark"] .production-home-card-icon,
:root[data-theme="dark"] .production-workspace-title > span {
  background: color-mix(in srgb, var(--production-tone, #29b89b) 14%, var(--surface-2));
}

:root[data-theme="dark"] .production-page-back {
  border-color: var(--amber);
  background: var(--amber);
  color: #111;
}

:root[data-theme="dark"] .production-report-center {
  border-color: var(--soft-line);
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] .production-source-strip > span.is-ready,
:root[data-theme="dark"] .production-size-capacity-details b {
  color: #56d9bd;
}

:root[data-theme="dark"] .production-source-strip > span.is-pending {
  color: #ffd36f;
}

:root[data-theme="dark"] .production-capacity-warning {
  background: color-mix(in srgb, var(--amber) 10%, var(--surface-2));
  color: var(--muted);
}

:root[data-theme="dark"] .production-site-card.is-combined,
:root[data-theme="dark"] .production-plan-status.is-success,
:root[data-theme="dark"] .production-batch-panel {
  background: color-mix(in srgb, #29b89b 10%, var(--surface-2));
}

:root[data-theme="dark"] .production-output-reference {
  background: color-mix(in srgb, #5aa9ee 9%, var(--surface-2));
}

:root[data-theme="dark"] .production-audit-history,
:root[data-theme="dark"] .production-audit-list li {
  background: color-mix(in srgb, #5aa9ee 5%, var(--surface-2));
}

:root[data-theme="dark"] .production-audit-empty {
  background: color-mix(in srgb, var(--amber) 9%, var(--surface-2));
}

:root[data-theme="dark"] .production-load-months button.is-active,
:root[data-theme="dark"] .production-load-kpis article,
:root[data-theme="dark"] .production-load-empty,
:root[data-theme="dark"] .production-order-capacity-kpis article,
:root[data-theme="dark"] .production-order-month-overview article,
:root[data-theme="dark"] .production-execution-kpis article,
:root[data-theme="dark"] .production-execution-source {
  background: color-mix(in srgb, #5aa9ee 7%, var(--surface-2));
}

:root[data-theme="dark"] .production-load-kpis strong,
:root[data-theme="dark"] .production-order-capacity-kpis strong,
:root[data-theme="dark"] .production-load-group summary em {
  color: #56d9bd;
}

:root[data-theme="dark"] .production-order-bundle-switch button.is-active {
  border-color: var(--amber);
  background: var(--amber);
  color: #111;
}

:root[data-theme="dark"] .production-order-capacity-panel {
  background: var(--surface);
}

:root[data-theme="dark"] .production-order-bundle-switch button.is-active small {
  color: #332400;
}

:root[data-theme="dark"] .production-order-customer-select,
:root[data-theme="dark"] .production-order-customer-select select {
  background: var(--surface-2);
}

:root[data-theme="dark"] .production-order-matrix thead th,
:root[data-theme="dark"] .production-order-matrix tbody th {
  background: var(--surface-2);
}

:root[data-theme="dark"] .production-order-matrix td.is-warning {
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
}

:root[data-theme="dark"] .production-order-matrix td.is-overload,
:root[data-theme="dark"] .production-order-matrix td.is-unassigned {
  background: color-mix(in srgb, var(--risk) 13%, var(--surface));
}

:root[data-theme="dark"] .production-order-recommendations,
:root[data-theme="dark"] .production-order-audit-panel {
  background: color-mix(in srgb, #5aa9ee 5%, var(--surface));
}

:root[data-theme="dark"] .production-order-capacity-kpis article.is-success strong,
:root[data-theme="dark"] .production-order-audit-note {
  color: #56d9bd;
}

:root[data-theme="dark"] .production-execution-kpis strong,
:root[data-theme="dark"] .production-execution-status,
:root[data-theme="dark"] .production-execution-mrp {
  color: #79bdf5;
}

:root[data-theme="dark"] .production-execution-status.is-in_process,
:root[data-theme="dark"] .production-execution-status.is-completed,
:root[data-theme="dark"] .production-execution-mrp.is-completed,
:root[data-theme="dark"] .production-execution-mrp.is-in_process {
  color: #56d9bd;
}

:root[data-theme="dark"] .production-reference-kpis article,
:root[data-theme="dark"] .production-reference-sizes > span {
  background: color-mix(in srgb, #5aa9ee 5%, var(--surface));
}

:root[data-theme="dark"] .production-reference-kpis article:nth-child(n + 2) strong {
  color: #79bdf5;
}

:root[data-theme="dark"] .production-site-card dl div:last-child dd,
:root[data-theme="dark"] .production-capacity-table .capacity-total strong,
:root[data-theme="dark"] .production-plan-status.is-success,
:root[data-theme="dark"] .production-batch-message,
:root[data-theme="dark"] .production-batch-preview .is-positive {
  color: #56d9bd;
}

:root[data-theme="dark"] .production-site-badge {
  color: #56d9bd;
}

:root[data-theme="dark"] .production-site-badge.is-cambodia {
  color: #ffd36f;
}

:root[data-theme="dark"] .production-capacity-filters button.is-active {
  background: #29b89b;
  color: #061510;
}

:root[data-theme="dark"] .production-option-panel,
:root[data-theme="dark"] .production-option-search {
  background: var(--surface-2);
}

:root[data-theme="dark"] .production-option-footer {
  background: var(--surface-2);
}

:root[data-theme="dark"] .production-option-footer > button {
  border-color: #29b89b;
  background: #29b89b;
  color: #061510;
}

:root[data-theme="dark"] .production-work-hour-filters button.is-active {
  background: #5aa9ee;
  color: #06101a;
}

:root[data-theme="dark"] .production-work-hour-empty,
:root[data-theme="dark"] .production-work-hour-kpis article {
  background: color-mix(in srgb, #5aa9ee 8%, var(--surface-2));
}

:root[data-theme="dark"] .production-output-month.is-active,
:root[data-theme="dark"] .production-output-kpis article {
  background: color-mix(in srgb, #56d9bd 9%, var(--surface-2));
}

:root[data-theme="dark"] .production-output-month > span i {
  background: #56d9bd;
}

:root[data-theme="dark"] .production-output-month.is-active > span i {
  background: #ffd36f;
}

:root[data-theme="dark"] .production-work-hour-empty > span,
:root[data-theme="dark"] .work-hour-number strong {
  color: #79bdf5;
}

@media (max-width: 1100px) {
  .production-visual-pair {
    grid-template-columns: 1fr;
  }

  .production-capacity-bar {
    grid-template-columns: minmax(210px, 1fr) minmax(120px, 1.4fr) minmax(112px, auto);
  }
}

@media (max-width: 700px) {
  .workbench-hero {
    align-items: flex-start;
    padding: 14px;
  }

  .workbench-hub-hero {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workbench-hub-count,
  .workbench-level-count {
    justify-items: start;
  }

  .workbench-department-grid,
  .workbench-tool-grid {
    grid-template-columns: 1fr;
  }

  .workbench-department-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-height: 92px;
    padding: 13px;
  }

  .workbench-department-icon {
    width: 40px;
    height: 40px;
  }

  .workbench-level-header {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .workbench-back {
    width: 36px;
    height: 36px;
  }

  .workbench-level-title > span {
    display: none;
  }

  .workbench-level-title h2 {
    font-size: 17px;
  }

  .workbench-level-title small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workbench-level-header > .report-refresh {
    min-width: 40px;
    padding-inline: 8px;
    font-size: 0;
  }

  .workbench-level-header > .report-refresh::after {
    content: "↻";
    font-size: 17px;
  }

  .workbench-tool-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 88px;
    padding: 12px;
  }

  .workbench-tool-card > svg {
    display: none;
  }

  .workbench-tool-icon {
    width: 38px;
    height: 38px;
  }

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

  .workbench-summary article:nth-child(2),
  .production-weight-kpis article:nth-child(2) {
    border-right: 0;
  }

  .workbench-summary article:nth-child(-n + 2),
  .production-weight-kpis article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--soft-line);
  }

  .production-weight-row {
    grid-template-columns: minmax(0, 1fr) 94px;
  }

  .production-weight-row > i {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .production-machining-batch-list {
    grid-template-columns: 1fr;
  }

  .production-machining-batch > summary {
    grid-template-columns: 26px minmax(0, 1fr) 18px;
  }

  .production-machining-batch > summary > span:nth-of-type(2) {
    grid-column: 2 / -1;
  }

  .production-machining-batch > div {
    padding-left: 10px;
  }

  .production-machining-batch > div > span {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .production-workspace-header {
    align-items: flex-start;
    padding: 12px;
  }

  .production-workspace-actions > small {
    white-space: normal;
    text-align: right;
  }

  .production-workspace-nav {
    margin-right: -2px;
    margin-left: -2px;
  }

  .production-workspace-nav button {
    flex-basis: auto;
    min-width: 94px;
  }

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

  .production-insight-panel {
    min-height: 0;
  }

  .production-home-load-chart {
    grid-template-columns: repeat(6, minmax(42px, 1fr));
  }

  .production-workspace-title > span {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .production-workspace-title h2 {
    font-size: 19px;
  }

  .production-workspace-title p {
    font-size: 11px;
  }

  .production-page-back span,
  .production-report-center span {
    display: none;
  }

  .production-section-command span {
    display: none;
  }

  .production-source-strip > small {
    flex-basis: 100%;
    margin-left: 0;
  }

  .production-home-grid,
  .production-visual-pair {
    grid-template-columns: 1fr;
  }

  .production-pager {
    align-items: flex-start;
  }

  .production-home-card {
    min-height: 174px;
  }

  .production-size-capacity-row summary {
    grid-template-columns: 64px minmax(0, 1fr) auto;
  }

  .production-size-capacity-row summary > span:nth-of-type(2) {
    grid-column: 2 / -1;
    grid-row: 2;
    text-align: left;
  }

  .production-size-capacity-row summary > em {
    text-align: right;
  }

  .production-size-capacity-details > span {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .production-size-capacity-details small {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .production-order-bundle-controls {
    grid-template-columns: 1fr;
  }

  .production-order-customer-select {
    grid-template-columns: 56px minmax(0, 1fr);
  }

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

  .production-work-hour-filters {
    grid-template-columns: 1fr;
  }

  .production-work-hour-filters > span {
    padding-top: 0;
  }

  .production-capacity-filters > .production-option-picker {
    overflow: visible;
    padding-bottom: 0;
  }

  .production-option-panel {
    right: auto !important;
    left: 0 !important;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
  }

  .production-work-hour-filters > div {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .production-work-hour-filters button {
    flex: 0 0 auto;
  }

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

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

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

  .production-maintenance-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .production-batch-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .production-reference-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .production-audit-heading,
  .production-audit-list summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .production-audit-list li {
    grid-template-columns: 1fr;
  }

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

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

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

  .production-order-capacity-kpis.is-audit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .production-order-month-details summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .production-order-recommendations > div:last-child,
  .production-order-audit-grid {
    grid-template-columns: 1fr;
  }

  .production-order-audit-panel > summary {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .production-execution-source {
    align-items: flex-start;
    flex-direction: column;
  }

  .production-execution-source small {
    text-align: left;
  }

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

  .production-load-group summary > span:last-child {
    justify-content: start;
    text-align: left;
  }

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

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

  .production-merged-controls label {
    grid-column: 1 / -1;
  }

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

  .production-batch-controls .primary-button,
  .production-batch-controls .secondary-button {
    width: 100%;
  }

  .production-capacity-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
  }

  .production-capacity-bar > i {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .production-work-hour-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
  }

  .production-work-hour-bar > i {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 440px) {
  .production-output-kpis,
  .production-work-hour-kpis {
    grid-template-columns: 1fr;
  }

  .production-workspace-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .production-workspace-actions {
    width: 100%;
    justify-items: stretch;
  }

  .production-workspace-actions > small {
    text-align: left;
  }

  .production-workspace-actions > div {
    justify-content: flex-start;
  }

  .production-workspace-title p {
    display: none;
  }

  .production-home-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 164px;
    padding: 13px;
  }

  .production-home-section-heading > span {
    display: none;
  }

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

  .production-pager {
    flex-direction: column;
  }

  .production-home-card-icon {
    width: 38px;
    height: 38px;
  }

  .production-home-card-copy strong {
    font-size: 24px;
  }

  .production-size-capacity-row summary {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .production-size-capacity-row summary > em {
    grid-column: 1 / -1;
    text-align: left;
  }

  .production-order-capacity-kpis,
  .production-order-month-overview {
    grid-template-columns: 1fr;
  }

  .production-order-capacity-kpis.is-audit-grid {
    grid-template-columns: 1fr;
  }

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

  .production-reference-kpis,
  .production-merged-controls {
    grid-template-columns: 1fr;
  }

  .production-merged-controls label {
    grid-column: auto;
  }

  .sales-target-kpis {
    grid-template-columns: 1fr;
  }

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

  .sales-view-heading > span {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .command-chart-redraw,
  .command-chart-redraw *,
  .command-bars b,
  .command-month,
  .command-month span,
  .command-safety-segment,
  .command-safety-point,
  .command-safety-zero-line {
    transition: none !important;
    animation: none !important;
  }
}

/* EMV application content rail -----------------------------------------
 * Portal, workbench and report entry pages share one centered desktop
 * track. Keep this final in the cascade so feature-specific releases cannot
 * silently move an entry page to a different horizontal origin.
 */
:root {
  --emv-entry-max-width: 1680px;
  --emv-entry-gutter: clamp(18px, 1.8vw, 28px);
}

.report-main {
  padding-inline: var(--emv-entry-gutter);
}

.report-hub-main {
  padding: 18px var(--emv-entry-gutter) 36px;
}

.report-hub,
.workbench-main > :where(header, section, div) {
  width: min(100%, var(--emv-entry-max-width));
  margin-inline: auto;
  box-sizing: border-box;
}

.workbench-department-grid,
.workbench-tool-grid {
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.workbench-department-card,
.workbench-tool-card {
  height: 100%;
}

@media (max-width: 700px) {
  :root {
    --emv-entry-gutter: 10px;
  }
}
