: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;
}

: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: 24px;
  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;
  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-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.topbar-tools span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
}

.topbar-tools > span:nth-of-type(2) {
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--dark);
  font-weight: 800;
}

.env-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 7px;
  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: 62px;
  min-height: 30px;
  border: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

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

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

.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ece8de;
  padding: 0;
}

.theme-toggle span {
  position: absolute;
  top: 4px;
  left: 5px;
  width: 18px;
  height: 18px;
  min-height: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(8, 8, 7, 0.2);
  transition: transform 0.18s ease, background 0.18s ease;
}

.theme-toggle.is-dark {
  background: #f2b42f;
}

.theme-toggle.is-dark span {
  background: #080807;
  transform: translateX(23px);
}

: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-tools > span:nth-of-type(2) {
  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"] .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: 980px;
  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 {
  white-space: normal;
}

.bubble.markdown p {
  margin: 0 0 14px;
}

.bubble.markdown p:last-child,
.bubble.markdown ul:last-child,
.bubble.markdown .markdown-table-scroll: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 ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.bubble.markdown li {
  margin: 5px 0;
}

.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;
}

.markdown-table-scroll {
  max-width: 100%;
  margin: 12px 0 18px;
  overflow-x: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

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

.markdown-table th,
.markdown-table td {
  white-space: normal;
  vertical-align: top;
}

.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;
}

.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-chips span {
  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-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-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-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: 96px;
  }

  .brand-divider {
    height: 28px;
  }

  .brand-title {
    max-width: none;
    font-size: 15px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .brand-subtitle {
    display: none;
  }

  .topbar-tools {
    gap: 8px;
    font-size: 12px;
  }

  .topbar-tools span {
    min-height: 26px;
  }

  .topbar-tools > span:nth-of-type(2) {
    padding: 0 8px;
  }

  .language-button {
    min-width: 52px;
    min-height: 26px;
    font-size: 12px;
  }

  .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: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .brand {
    align-items: flex-start;
    gap: 10px;
  }

  .brand-logo {
    width: 128px;
  }

  .brand-divider {
    height: 42px;
  }

  .brand-title {
    font-size: 16px;
  }

  .topbar-tools {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 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-chips span {
    max-width: 300px;
  }

  .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(8, minmax(78px, 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-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,
.sales-order-drilldown {
  grid-column: 1 / -1;
}

.sales-order-drilldown .report-table-scroll {
  max-height: 480px;
}

.sales-detail-table-panel tr[data-sales-order-row] {
  cursor: pointer;
}

.sales-detail-table-panel tr[data-sales-order-row]:hover td {
  background: var(--amber-soft);
}

.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-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-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) {
  .sales-workspace-nav {
    grid-template-columns: repeat(4, minmax(88px, 1fr));
  }

  .sales-drill-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .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-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-capacity-canvas {
  align-items: start;
}

.production-capacity-filters {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px 14px;
  margin-top: 14px;
}

.production-capacity-filters > span {
  padding-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.production-capacity-filters > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.production-site-switch {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft-line);
}

.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-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-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;
  white-space: nowrap;
}

.production-capacity-bar > span strong {
  font-size: 12px;
}

.production-capacity-bar > span small {
  color: var(--muted);
  font-size: 10px;
}

.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-bar > em {
  color: var(--ink);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.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-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-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-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;
}

:root[data-theme="dark"] .detail-hero-production,
: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"] .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-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-load-group summary em {
  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-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-work-hour-empty > span,
:root[data-theme="dark"] .work-hour-number strong {
  color: #79bdf5;
}

@media (max-width: 700px) {
  .production-capacity-filters {
    grid-template-columns: 1fr;
  }

  .production-work-hour-filters {
    grid-template-columns: 1fr;
  }

  .production-capacity-filters > span {
    padding-top: 0;
  }

  .production-work-hour-filters > span {
    padding-top: 0;
  }

  .production-capacity-filters > div {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .production-work-hour-filters > div {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .production-capacity-filters button {
    flex: 0 0 auto;
  }

  .production-work-hour-filters button {
    flex: 0 0 auto;
  }

  .production-work-hour-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-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-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;
  }
}
