:root {
  --canvas: #f4f6f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #172033;
  --muted: #687386;
  --line: #dfe5ec;
  --line-strong: #cdd5df;
  --chart-axis: #4f5d70;
  --chart-grid: #e6ebf1;
  --navy: #0d2138;
  --navy-soft: #173451;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #edf4ff;
  --green: #17835c;
  --green-soft: #eaf7f1;
  --amber: #b96f08;
  --amber-soft: #fff6e6;
  --orange: #d65320;
  --red: #c9343b;
  --red-soft: #fff0f1;
  --purple: #7156c7;
  --shadow: 0 8px 24px rgba(20, 36, 58, .055);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #08121f;
  --surface: #101d2c;
  --surface-muted: #162536;
  --ink: #eef4fb;
  --muted: #9cacc0;
  --line: #26394e;
  --line-strong: #40566f;
  --chart-axis: #bcc9d8;
  --chart-grid: #2b3e53;
  --navy: #050e19;
  --navy-soft: #173450;
  --blue: #73a2ff;
  --blue-dark: #94b8ff;
  --blue-soft: #172d4c;
  --green: #48c99a;
  --green-soft: #12372f;
  --amber: #f0ae4f;
  --amber-soft: #3b2c14;
  --orange: #f0804f;
  --red: #ff727c;
  --red-soft: #3c1d25;
  --purple: #a88cff;
  --shadow: 0 12px 32px rgba(0, 0, 0, .24);
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
}
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 9px;
  color: #fff;
  background: var(--blue-dark);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .16s ease;
}
.skip-link:focus { transform: translateY(0); }

.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.sidebar {
  position: sticky;
  inset: 0 auto 0 0;
  z-index: 20;
  height: 100vh;
  padding: 22px 14px 16px;
  color: #fff;
  background: var(--navy);
  display: flex;
  flex-direction: column;
}
.brand { flex: 0 0 auto; display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; color: #fff; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border: 1px solid rgba(78,179,255,.35); border-radius: 11px; display: grid; place-items: center; overflow: hidden; background: #020b1f; color: var(--navy); box-shadow: 0 0 22px rgba(26,161,255,.16); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(1.1); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; line-height: 1.05; letter-spacing: -.35px; }
.brand small { margin-top: 3px; color: #9fb1c4; font-size: 11px; letter-spacing: .02em; }
.sidebar-toggle { position: absolute; top: 28px; right: -14px; z-index: 2; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(159,185,211,.38); border-radius: 999px; display: grid; place-items: center; color: #d9e7f5; background: #163653; box-shadow: 0 6px 18px rgba(0,0,0,.22); cursor: pointer; transition: color .16s ease, background .16s ease, transform .16s ease; }
.sidebar-toggle:hover { color: #fff; background: #24527a; transform: translateY(-1px); }
.sidebar-toggle svg { width: 15px; height: 15px; transition: transform .2s ease; }
.nav { min-height: 0; flex: 1 1 auto; display: grid; grid-auto-rows: max-content; align-content: start; gap: 4px; padding: 0 4px 7px 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(151,180,212,.42) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(151,180,212,.42); }
.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #b7c5d4;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; border-left-color: #6da0ff; background: var(--navy-soft); }
.sidebar-footer { flex: 0 0 auto; margin-top: auto; padding: 15px 7px 0; border-top: 1px solid rgba(255,255,255,.11); }
.mobile-logout-button { display: none; }
.mobile-nav-toggle, .mobile-filters-toggle { display: none; }
.source-status, .operator-card { display: flex; align-items: center; gap: 9px; }
.source-status { padding-bottom: 15px; }
.source-status strong, .source-status small, .operator-card strong, .operator-card small { display: block; }
.source-status strong, .operator-card strong { font-size: 11px; font-weight: 700; }
.source-status small, .operator-card small { margin-top: 2px; color: #91a6ba; font-size: 10px; line-height: 1.35; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #3bc987; box-shadow: 0 0 0 4px rgba(59,201,135,.11); }
.operator-card { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; background: #244564; color: #dbe8f4; font-size: 10px; font-weight: 800; }

.main { min-width: 0; padding: 22px 26px 40px; }
.topbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.page-heading { min-width: 210px; }
.page-heading h1 { margin: 0; color: var(--ink); font-size: clamp(22px, 2vw, 28px); line-height: 1.1; letter-spacing: -.7px; }
.page-heading h1:focus { outline: 0; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.theme-toggle { width: 40px; height: 40px; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; color: var(--muted); background: var(--surface); transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.theme-toggle:hover { color: var(--blue); border-color: var(--line-strong); background: var(--surface-muted); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-icon { grid-area: 1 / 1; }
.theme-icon svg { width: 18px; height: 18px; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
.search-box { width: min(300px, 25vw); height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.search-box svg { width: 18px; height: 18px; flex: 0 0 auto; color: #7e8999; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #97a0ad; }
.button { min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 750; white-space: nowrap; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.button svg { width: 17px; height: 17px; }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button:disabled { cursor: not-allowed; opacity: .56; }
.button.secondary { color: #344054; background: var(--surface); border-color: var(--line); }
.button.secondary:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.button.compact { min-height: 35px; padding-inline: 12px; }
.export-actions { display: flex; gap: 7px; }
.button.export { min-width: 66px; }
.button.export.csv { color: #127050; background: #f2faf6; border-color: #bfe2d3; }
.button.export.csv:hover { background: #e8f6ef; }
.button.export.pdf { color: #b52d36; background: #fff5f5; border-color: #efc6c8; }
.button.export.pdf:hover { background: #ffebec; }
.button.export[aria-busy="true"] { min-width: 104px; cursor: wait; opacity: .78; }
.button.export[aria-busy="true"]::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.button.export:disabled { pointer-events: none; }

.filterbar { min-height: 64px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 11px; background: var(--surface); box-shadow: var(--shadow); }
.period-filter { display: flex; align-items: flex-end; gap: 10px; padding-right: 12px; border-right: 1px solid var(--line); }
.period-filter label, .select-field, .multi-select-field { display: grid; gap: 4px; color: #5f6b7c; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.period-filter input, .select-field select { height: 35px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); font-size: 11px; font-weight: 600; }
.period-filter input { width: 145px; padding: 0 9px; }
.purchase-period-note { max-width: 215px; align-self: center; color: #667386; font-size: 10px; font-weight: 650; line-height: 1.35; text-transform: none; }
.select-field select { min-width: 165px; padding: 0 30px 0 9px; }
.multi-select-field { flex: 1 1 165px; min-width: 155px; max-width: 245px; }
.filter-label { min-height: 11px; }
.sales-type-filters { min-width: 230px; margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 7px; }
.sales-type-filters legend { width: 100%; margin: 0 0 4px; padding: 0; color: #5f6b7c; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sales-type-filters label { min-height: 35px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); background: var(--surface); font-size: 11px; font-weight: 700; cursor: pointer; user-select: none; }
.sales-type-filters label:has(input:checked) { color: #174ea6; border-color: #8eb0ed; background: #edf4ff; }
.sales-type-filters input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.purchase-entry-type-filters { min-width: 410px; flex-wrap: wrap; }
.purchase-entry-type-filters label { min-height: 32px; padding-inline: 8px; }
.purchase-entry-type-filters input { width: 14px; height: 14px; }
.purchase-planning-controls { min-width: 560px; display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.purchase-planning-controls.hidden { display: none; }
.purchase-planning-controls > label { display: grid; gap: 5px; color: #536174; font-size: 10px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.planning-number-input, .planning-date-input { min-height: 35px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; gap: 6px; color: var(--ink); background: var(--surface); }
.planning-number-input input { width: 58px; padding: 0; border: 0; color: inherit; background: transparent; font-size: 12px; font-weight: 650; outline: 0; }
.planning-date-input input { width: 132px; min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; font-size: 12px; font-weight: 650; outline: 0; }
.planning-number-input small { color: #667386; font-size: 11px; font-weight: 650; text-transform: none; }
.purchase-planning-reason { min-width: 250px; max-width: 380px; display: block; line-height: 1.45; }
.purchase-planning-reason small, .purchase-order-breakdown small, .purchase-package small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.35; }
.overdue-order { display: block; margin-top: 3px; color: var(--danger); font-weight: 750; }
.purchase-package strong { display: block; white-space: nowrap; }
.planning-calendar-note { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.multi-select { position: relative; text-transform: none; letter-spacing: 0; }
.multi-select-trigger { width: 100%; height: 35px; padding: 0 9px 0 11px; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; gap: 7px; color: var(--ink); background: var(--surface); font-size: 11px; font-weight: 650; text-align: left; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.multi-select-trigger:hover { border-color: #b7c4d4; background: #fbfcfe; }
.multi-select-trigger:focus-visible, .multi-select.open .multi-select-trigger { border-color: #7aa4ee; outline: 0; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.multi-select-summary { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-select-count { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--blue); font-size: 9px; font-weight: 800; }
.multi-select-trigger > svg { width: 15px; height: 15px; flex: 0 0 auto; color: #718096; transition: transform .16s ease; }
.multi-select.open .multi-select-trigger > svg { transform: rotate(180deg); }
.multi-select-menu { width: max(100%, 260px); max-width: min(340px, calc(100vw - 32px)); margin-top: 6px; padding: 8px; border: 1px solid #cfd8e5; border-radius: 10px; position: absolute; z-index: 80; left: 0; top: 100%; color: var(--ink); background: var(--surface); box-shadow: 0 18px 45px rgba(15,39,68,.18); text-transform: none; letter-spacing: 0; }
#departmentFilter .multi-select-menu, #categoryFilter .multi-select-menu { right: 0; left: auto; }
.multi-select-search { height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; gap: 7px; background: var(--surface-muted); }
.multi-select-search:focus-within { border-color: #8eb0ed; box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.multi-select-search svg { width: 15px; height: 15px; flex: 0 0 auto; color: #7b8797; }
.multi-select-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.2; }
.multi-select-search input::placeholder { color: #929dad; }
.multi-select-hint { display: block; padding: 6px 3px 1px; color: var(--muted); font-size: 9px; font-weight: 600; line-height: 1.35; text-transform: none; }
.multi-select-options { max-height: 248px; margin: 7px -2px 5px; padding: 0 2px; overflow-y: auto; display: grid; gap: 2px; scrollbar-width: thin; }
.multi-select-option { width: 100%; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 7px; display: flex; align-items: center; gap: 9px; color: #344054; background: transparent; font-size: 11px; font-weight: 600; line-height: 1.25; text-align: left; }
.multi-select-option:hover, .multi-select-option:focus-visible { outline: 0; background: #f0f5ff; }
.multi-select-option[aria-selected="true"] { color: #174ea6; background: #edf4ff; }
.multi-check { width: 17px; height: 17px; flex: 0 0 auto; border: 1.5px solid #b7c2d1; border-radius: 5px; display: grid; place-items: center; color: transparent; background: #fff; }
.multi-check svg { width: 12px; height: 12px; stroke-width: 2.5; }
.multi-select-option[aria-selected="true"] .multi-check { color: #fff; border-color: var(--blue); background: var(--blue); }
.multi-option-label { min-width: 0; overflow-wrap: anywhere; }
.multi-option-label strong, .multi-option-label small { display: block; }
.multi-option-label strong { color: inherit; font-size: 11px; line-height: 1.25; }
.multi-option-label small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 600; line-height: 1.25; }
.multi-select-empty { padding: 18px 10px; color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; }
.multi-select-feedback { min-height: 70px; padding: 14px 10px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.4; text-align: center; }
.multi-select-feedback.error-options { color: var(--danger); flex-direction: column; }
.multi-select-feedback button { min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--blue); background: var(--surface); font: inherit; font-weight: 750; }
.multi-select-clear { width: 100%; min-height: 31px; padding: 5px 8px; border: 0; border-top: 1px solid var(--line); color: var(--blue); background: transparent; font-size: 10px; font-weight: 750; text-align: left; }
.multi-select-clear:hover { text-decoration: underline; }
.period-status { min-height: 35px; padding: 0 3px; display: inline-flex; align-items: center; color: var(--green); font-size: 9px; font-weight: 750; white-space: nowrap; }
.period-status::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.text-button { min-height: 35px; padding: 0 7px; border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 750; }
.text-button:hover { text-decoration: underline; }
.filter-actions { min-height: 35px; margin-left: auto; display: flex; align-items: center; gap: 7px; }
.filter-apply-button { min-height: 35px; padding-inline: 13px; }
.filter-apply-button[aria-busy="true"] { cursor: wait; }
.filter-apply-status { min-height: 25px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 800; white-space: nowrap; }
.filter-apply-status::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.filter-apply-status.pending { color: #8a5a08; background: var(--amber-soft); }
.filterbar.has-pending-filters { border-color: #e3c274; box-shadow: 0 0 0 2px rgba(217, 155, 30, .08), var(--shadow); }
.expiry-risk-actions { min-height: 35px; display: flex; align-items: stretch; gap: 6px; }
.expiry-risk-actions .button { min-height: 35px; white-space: nowrap; }
.expiry-risk-gear { width: 37px; min-width: 37px !important; padding: 0 !important; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-color: #bed4f7; }
.expiry-risk-gear svg { width: 17px; height: 17px; }

.loading { display: none; min-height: 40px; margin-bottom: 14px; padding: 10px 13px; border: 1px solid #cbdcf9; border-radius: 8px; align-items: center; gap: 9px; color: #315a94; background: var(--blue-soft); font-size: 12px; }
.loading.visible { display: flex; }
.spinner { width: 15px; height: 15px; border: 2px solid #b6cdf2; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #efc2c5; border-radius: 8px; color: #93252b; background: var(--red-soft); font-size: 12px; }
.view { display: none; }
.view.active { display: block; }
.temporal-context { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; background: var(--surface); box-shadow: var(--shadow); }
.temporal-context:empty { display: none; }
.analysis-state { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--success); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: .82rem; }
.analysis-state strong { color: var(--ink); margin-right: 6px; }
.analysis-state.partial, .analysis-state.stale { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.analysis-state.unavailable { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.analysis-state .quality-alerts { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px 12px; }
.temporal-item { min-width: 0; padding: 4px 9px; border-left: 3px solid #8eb0ed; }
.temporal-item strong, .temporal-item span { display: block; }
.temporal-item strong { color: var(--muted); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.temporal-item span { margin-top: 3px; overflow: hidden; color: var(--ink); font-size: 10px; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.temporal-item.unavailable { border-left-color: #c8d0da; }
.temporal-item.unavailable span { color: var(--muted); font-weight: 600; }

.kpi-rail { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.kpi-rail.kpi-v2 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-rail.kpi-v2 .kpi:nth-child(-n+5) { border-bottom: 1px solid var(--line); }
.kpi-rail.kpi-v2 .kpi:nth-child(5n) { border-right: 0; }
.kpi { min-width: 0; min-height: 118px; padding: 17px 15px 14px; border-right: 1px solid var(--line); position: relative; }
.kpi:last-child { border-right: 0; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 750; }
.kpi-icon { width: 27px; height: 27px; flex: 0 0 auto; border-radius: 7px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.kpi-icon svg { width: 15px; height: 15px; }
.kpi-value { margin-top: 9px; color: var(--ink); font-size: clamp(19px, 1.55vw, 25px); line-height: 1; font-weight: 820; letter-spacing: -.55px; white-space: nowrap; }
.kpi-foot { margin-top: 7px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.kpi.danger .kpi-value { color: var(--red); }
.kpi.warning .kpi-value { color: var(--amber); }
.kpi.success .kpi-value { color: var(--green); }
.kpi.danger .kpi-icon { color: var(--red); background: var(--red-soft); }
.kpi.warning .kpi-icon { color: var(--amber); background: var(--amber-soft); }
.kpi.success .kpi-icon { color: var(--green); background: var(--green-soft); }

.dashboard-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.charts-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.charts-grid > .chart-panel { grid-column: span 2; }
.charts-grid > .ranking-panel { grid-column: span 3; }
.operations-grid { grid-template-columns: minmax(380px, .95fr) minmax(520px, 1.35fr); }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.chart-panel { min-height: 286px; padding: 15px; }
.dashboard-only-filter { display: none; }
.planning-only-filter { display: none; }
.dashboard-layout-active .dashboard-only-filter { display: grid; }
.supplier-filter-active #supplierFilterField { display: grid; }
.planning-filter-active #buyerFilterField { display: grid; }
.planning-filter-active #supplierFilterField, .planning-filter-active #buyerFilterField { flex: 1 1 200px; max-width: 270px; }
.dashboard-layout-active .topbar .search-box { display: none; }
.dashboard-product-filter { min-width: 190px; max-width: 270px; flex: 1 1 210px; gap: 4px; color: #5f6b7c; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.dashboard-product-search { height: 35px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; gap: 7px; background: var(--surface); }
.dashboard-product-search svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted); }
.dashboard-product-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 600; }
.executive-dashboard > .charts-grid, .executive-dashboard > .operations-grid { display: none; }
.executive-dashboard .executive-kpis { grid-template-columns: repeat(10, minmax(105px, 1fr)); gap: 8px; border: 0; overflow: visible; background: transparent; box-shadow: none; }
.executive-dashboard .executive-kpis .kpi { min-height: 112px; padding: 13px 12px 11px; border: 1px solid var(--line) !important; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.executive-dashboard .executive-kpis .kpi-head { align-items: flex-start; font-size: 9px; line-height: 1.25; }
.executive-dashboard .executive-kpis .kpi-icon { width: 23px; height: 23px; }
.executive-dashboard .executive-kpis .kpi-value { margin-top: 10px; font-size: clamp(17px, 1.25vw, 22px); }
.executive-dashboard .executive-kpis .kpi-foot { margin-top: 7px; font-size: 8px; white-space: normal; }
.executive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 278px; align-items: start; gap: 12px; }
.executive-main-column { min-width: 0; }
.executive-charts-primary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.executive-charts-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.executive-chart-panel { min-height: 255px; padding: 13px; }
.executive-chart-panel .chart { min-height: 192px; }
.executive-insight-rail { min-width: 0; display: grid; align-content: start; gap: 12px; position: sticky; top: 12px; }
.executive-insight-rail .insights-panel { padding: 14px; }
.executive-insight-rail .insights-list { display: grid; gap: 7px; }
.executive-insight-rail .insight { width: 100%; padding: 10px; text-align: left; }
.executive-insight-rail .insight strong { font-size: 10px; }
.executive-insight-rail .insight p { margin: 5px 0; font-size: 9px; line-height: 1.45; }
.executive-insight-rail .insight small { font-size: 8px; }
.ai-context-panel { min-height: 250px; }
.ai-context-help { margin: 10px 0 12px; border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--blue-soft) 45%, transparent); }
.ai-context-help summary { padding: 10px 11px; color: var(--blue); font-size: 10px; font-weight: 800; cursor: pointer; }
.ai-context-help ol { margin: 0; padding: 0 24px 8px 32px; color: var(--text); font-size: 9.5px; line-height: 1.55; }
.ai-context-help p { margin: 0; padding: 0 11px 11px; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.executive-bottom-grid { margin-bottom: 12px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 12px; }
.executive-priorities, .kpi-explanations-panel { padding: 15px; }
.executive-priorities { align-self: start; container: priorities / inline-size; }
.priority-table.executive-priority-table { min-width: 0; }
.priority-table.executive-priority-table th:nth-child(1) { width: 36%; }
.priority-table.executive-priority-table th:nth-child(2) { width: 27%; }
.priority-table.executive-priority-table th:nth-child(3) { width: 37%; }
.priority-table.executive-priority-table th { padding: 9px 10px; font-size: 10px; background: var(--surface-muted); }
.priority-table.executive-priority-table td { padding: 12px 10px; vertical-align: top; color: var(--ink); font-size: 12px; font-weight: 400; line-height: 1.45; border-color: var(--line); overflow-wrap: anywhere; }
.executive-priority-product > strong { display: block; font-size: 12px; line-height: 1.4; }
.executive-priority-product > small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.executive-priority-stores { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.executive-priority-stores span { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); color: var(--muted); font-size: 10px; white-space: nowrap; }
.executive-priority-metrics { display: grid; gap: 7px; margin: 0; }
.executive-priority-metrics > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; }
.executive-priority-metrics dt { color: var(--muted); font-size: 11px; }
.executive-priority-metrics dd { margin: 0; font-weight: 700; font-size: 11px; font-variant-numeric: tabular-nums; }
.executive-priority-metrics dd small { font-size: 10px; font-weight: 400; }
.executive-priority-action .priority-level { padding: 2px 7px; border-radius: 5px; background: var(--surface-muted); font-size: 10px; }
.executive-priority-action p { margin: 6px 0; line-height: 1.45; }
.executive-priority-action summary { padding: 3px 0; color: var(--blue); cursor: pointer; font-size: 11px; font-weight: 600; }
.executive-priority-action summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.executive-priority-action ul { margin: 5px 0; padding-left: 16px; font-size: 11px; }
.executive-priority-action li + li { margin-top: 5px; }
.executive-priority-reasons { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
@container priorities (max-width: 620px) {
  .executive-priority-table, .executive-priority-table tbody { display: block; }
  .executive-priority-table thead { display: none; }
  .executive-priority-table tr { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .executive-priority-table tr:last-child { border-bottom: 0; }
  .priority-table.executive-priority-table td { display: block; width: auto; padding: 0; border: 0; }
  .executive-priority-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 9px; border-radius: 6px; background: var(--surface-muted); }
  .executive-priority-metrics > div { display: block; }
  .executive-priority-metrics dd { margin-top: 3px; }
}
.kpi-explanations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.kpi-explanations article { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 7px; background: var(--surface-muted); }
.kpi-explanations article > span { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 800; }
.kpi-explanations strong { display: block; font-size: 9px; line-height: 1.3; }
.kpi-explanations p { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.4; }
.line-chart { width: 100%; height: auto; overflow: visible; }
.line-chart line { stroke: var(--line); stroke-width: 1; }
.line-chart text { fill: var(--muted); stroke: none; font-size: 9px; }
.line-chart .line-area { fill: color-mix(in srgb, var(--blue) 12%, transparent); stroke: none; }
.line-chart .line-path { fill: none; stroke: var(--blue); stroke-width: 2.4; }
.line-chart circle { fill: var(--surface); stroke: var(--blue); stroke-width: 2; }
.executive-donut { grid-template-columns: 94px minmax(0, 1fr); gap: 10px; }
.executive-donut .donut { width: 92px; height: 92px; }
.executive-donut .donut-center { width: 57px; height: 57px; }
.executive-donut .donut-center strong { font-size: 12px; }
.criticality-matrix { min-width: 0; display: grid; grid-template-columns: 55px repeat(var(--matrix-columns), minmax(22px, 1fr)); gap: 3px; align-items: center; }
.criticality-matrix strong { overflow: hidden; color: var(--muted); font-size: 7px; font-weight: 700; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.criticality-matrix b { overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.matrix-cell { height: 21px; border-radius: 2px; background: var(--surface-muted); }
.matrix-cell.level-1, .matrix-legend .level-1 { background: #55b879; }
.matrix-cell.level-2, .matrix-legend .level-2 { background: #e4ac33; }
.matrix-cell.level-3, .matrix-legend .level-3 { background: #ef7d32; }
.matrix-cell.level-4, .matrix-legend .level-4 { background: #d94751; }
.matrix-legend { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; color: var(--muted); font-size: 8px; }
.matrix-legend span { display: inline-flex; align-items: center; gap: 4px; }
.matrix-legend i { width: 9px; height: 6px; border-radius: 2px; }
.drilldown-trigger { position: relative; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.dashboard-analysis-trigger { position: relative; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.drilldown-trigger:hover, .drilldown-trigger:focus-visible, .dashboard-analysis-trigger:hover, .dashboard-analysis-trigger:focus-visible { z-index: 1; border-color: #a8c2ef; box-shadow: 0 10px 28px rgba(37, 99, 235, .12); outline: none; }
.kpi.drilldown-trigger:hover, .kpi.drilldown-trigger:focus-visible, .kpi.dashboard-analysis-trigger:hover, .kpi.dashboard-analysis-trigger:focus-visible { transform: translateY(-1px); }

.report-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.report-catalog button { min-height: 112px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); text-align: left; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; transition: border-color .18s ease, transform .18s ease; }
.report-catalog button:hover, .report-catalog button:focus-visible { border-color: var(--blue); transform: translateY(-2px); outline: none; }
.report-catalog strong, .report-catalog span { display: block; }
.report-catalog strong { margin-bottom: 8px; font-size: 16px; }
.report-catalog span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.chart-panel.drilldown-trigger::after { content: "Clique para detalhar"; position: absolute; right: 14px; bottom: 10px; color: #8b96a5; font-size: 8px; font-weight: 700; opacity: 0; transition: opacity .16s ease; }
.chart-panel.dashboard-analysis-trigger::after { content: "Clique para ampliar"; position: absolute; right: 14px; bottom: 10px; color: #8b96a5; font-size: 8px; font-weight: 700; opacity: 0; transition: opacity .16s ease; }
.chart-panel.drilldown-trigger:hover::after, .chart-panel.drilldown-trigger:focus-visible::after, .chart-panel.dashboard-analysis-trigger:hover::after, .chart-panel.dashboard-analysis-trigger:focus-visible::after { opacity: 1; }
.panel-heading { min-height: 34px; margin-bottom: 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.panel-heading h2 { margin: 0 0 3px; color: var(--ink); font-size: 14px; line-height: 1.25; letter-spacing: -.25px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.panel-link { padding: 2px 0; border: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 750; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
.metric-note, .row-count, .analysis-status { padding: 5px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-muted); font-size: 9px; font-weight: 750; white-space: nowrap; }
.analysis-status.connected { color: var(--green); border-color: #bfe2d3; background: var(--green-soft); }
.analysis-status.fallback { color: var(--amber); border-color: #ecd2a6; background: var(--amber-soft); }
.chart { min-height: 213px; display: grid; align-items: center; }
.empty-chart { padding: 28px 10px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }
.purchase-planning-empty { min-height: 112px; padding: 20px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; color: var(--muted); text-align: center; }
.purchase-planning-empty strong { color: var(--ink); font-size: 12px; }
.purchase-planning-empty span { font-size: 10px; }
.purchase-planning-empty .button { margin-top: 3px; }

.donut-layout { min-width: 0; display: grid; grid-template-columns: 114px minmax(0, 1fr); align-items: center; gap: 15px; }
.donut { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; }
.donut-center { width: 68px; height: 68px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--surface); box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.donut-center strong, .donut-center small { display: block; }
.donut-center strong { font-size: 20px; line-height: 1; }
.donut-center small { margin-top: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.legend { min-width: 0; display: grid; gap: 7px; }
.legend-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 6px; color: #4f5b6c; font-size: 9px; }
.legend-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row span:last-child { color: var(--ink); font-weight: 750; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; }

.horizontal-chart { display: grid; gap: 12px; }
.horizontal-row { min-width: 0; display: grid; grid-template-columns: minmax(70px, .9fr) minmax(70px, 1.15fr) auto; align-items: center; gap: 7px; }
.horizontal-label { overflow: hidden; color: #566273; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-track { height: 7px; border-radius: 2px; overflow: hidden; background: #edf0f4; }
.horizontal-fill { height: 100%; min-width: 2px; border-radius: 2px; background: var(--blue); }
.horizontal-row:nth-child(2n) .horizontal-fill { background: #5584e8; }
.horizontal-value { color: var(--ink); font-size: 9px; font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }

.ranking-panel { min-height: 330px; }
.ranking-heading { align-items: flex-start; }
.ranking-actions { display: flex; align-items: center; gap: 6px; }
.metric-toggle { padding: 2px; border: 1px solid var(--line); border-radius: 7px; display: flex; background: var(--surface-muted); }
.metric-toggle button { min-height: 25px; padding: 0 8px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 8px; font-weight: 800; }
.metric-toggle button.active { color: #fff; background: var(--blue); box-shadow: 0 2px 6px rgba(37,99,235,.18); }
.ranking-gear { width: 31px; height: 31px; padding: 0; border: 1px solid var(--line); border-radius: 7px; display: grid; place-items: center; color: var(--blue); background: var(--surface); }
.ranking-gear:hover { border-color: #9eb9e9; background: var(--blue-soft); }
.ranking-gear svg { width: 15px; height: 15px; }
.ranking-chart { min-height: 248px; align-items: start; }
.ranking-list { display: grid; gap: 8px; }
.ranking-row { display: grid; grid-template-columns: 22px minmax(120px, 1.15fr) minmax(90px, .9fr) auto; align-items: center; gap: 8px; }
.ranking-position { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #315a94; background: var(--blue-soft); font-size: 8px; font-weight: 900; }
.ranking-product { min-width: 0; }
.ranking-product strong, .ranking-product small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-product strong { color: var(--ink); font-size: 9px; }
.ranking-product small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.ranking-track { height: 7px; border-radius: 3px; overflow: hidden; background: #edf0f4; }
.ranking-fill { height: 100%; min-width: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--blue), #77a0ef); }
.ranking-value { color: var(--ink); font-size: 8px; font-weight: 800; white-space: nowrap; }
.ranking-footer { margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 8px; }

.line-chart-wrap { min-width: 0; }
.line-chart { width: 100%; height: 160px; overflow: visible; }
.line-chart .grid-line { stroke: #e8ecf1; stroke-width: 1; }
.line-chart .risk-line { stroke: var(--red); stroke-width: 2.2; }
.line-chart .no-sales-line { stroke: var(--blue); stroke-width: 2.2; }
.line-chart .point-risk { fill: var(--red); stroke: #fff; stroke-width: 1.4; }
.line-chart .point-no-sales { fill: var(--blue); stroke: #fff; stroke-width: 1.4; }
.line-chart text { fill: #7b8594; stroke: none; font-size: 8px; }
.line-legend { display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--muted); font-size: 9px; }
.line-legend span { display: flex; align-items: center; gap: 5px; }
.line-legend i { width: 13px; height: 2px; background: var(--red); }
.line-legend span:last-child i { background: var(--blue); }

.insights-panel, .priorities-panel { min-height: 318px; padding: 16px; }
.insight-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.insight-columns > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.insight-columns h3 { margin: 0 0 10px; color: #4f5b6b; font-size: 10px; text-transform: uppercase; letter-spacing: .045em; }
.insights-list { display: grid; gap: 8px; }
.insight { padding: 9px 9px 9px 10px; border-left: 3px solid var(--blue); background: var(--surface-muted); }
.insight.critical { border-left-color: var(--red); background: #fff7f7; }
.insight.warning { border-left-color: var(--amber); background: #fffbf2; }
.insight.success { border-left-color: var(--green); background: #f4fbf7; }
.insight strong { display: block; color: #2f3948; font-size: 10px; line-height: 1.35; }
.insight p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.insight small { display: block; margin-top: 4px; color: #7d8795; font-size: 8px; line-height: 1.35; }
.ai-insight-state { min-height: 180px; }
.ai-empty { min-height: 180px; padding: 18px 12px; border: 1px dashed var(--line-strong); border-radius: 9px; display: grid; align-content: center; justify-items: center; color: var(--muted); text-align: center; }
.ai-empty svg { width: 28px; height: 28px; margin-bottom: 10px; color: var(--blue); }
.ai-empty strong { color: var(--ink); font-size: 11px; }
.ai-empty p { max-width: 245px; margin: 5px 0 0; font-size: 9px; line-height: 1.45; }
.ai-empty button { margin-top: 10px; border: 0; color: var(--blue); background: transparent; font-size: 9px; font-weight: 750; }

.priority-table-wrap { overflow-x: auto; }
.priority-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.priority-table th { padding: 8px 7px; border-bottom: 1px solid var(--line); color: #798392; text-align: left; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.priority-table td { padding: 9px 7px; border-bottom: 1px solid #edf0f3; color: #4a5666; font-size: 9px; line-height: 1.35; vertical-align: middle; }
.priority-table tr:last-child td { border-bottom: 0; }
.priority-table th:nth-child(1) { width: 17%; }
.priority-table th:nth-child(2) { width: 35%; }
.priority-table th:nth-child(3) { width: 18%; }
.priority-table th:nth-child(4) { width: 16%; }
.priority-table th:nth-child(5) { width: 14%; }
.priority-table td:nth-child(2) { color: var(--ink); font-weight: 650; }
.priority-level { display: inline-flex; align-items: center; gap: 5px; font-weight: 750; }
.priority-level::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.priority-level.high::before { background: var(--red); }

.report-summary { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); overflow: auto hidden; background: var(--surface); box-shadow: var(--shadow); }
.purchase-planning-analysis { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.purchase-planning-analysis.hidden { display: none; }
.planning-analysis-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.planning-analysis-heading h2, .planning-chart-heading h3 { margin: 0; color: var(--ink); }
.planning-analysis-heading h2 { font-size: 14px; }
.planning-analysis-heading p, .planning-chart-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.planning-active-focus { margin-top: 11px; padding: 8px 10px; border-left: 3px solid var(--blue); border-radius: 6px; color: var(--blue-dark); background: var(--blue-soft); font-size: 10px; font-weight: 750; }
.planning-active-focus.hidden { display: none; }
.planning-status-filters { margin-top: 12px; display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.planning-status-button { min-width: max-content; min-height: 40px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: var(--surface-muted); font-size: 10px; font-weight: 750; cursor: pointer; }
.planning-status-button strong { min-width: 24px; padding: 3px 6px; border-radius: 999px; color: var(--ink); background: var(--surface); font-size: 10px; }
.planning-status-button.active { border-color: #82a9f5; color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 -2px 0 var(--blue); }
.purchase-planning-charts { margin-top: 13px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.planning-chart-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.planning-chart-heading h3 { font-size: 12px; }
.planning-bar-chart { min-height: 142px; margin-top: 12px; display: grid; align-content: start; gap: 7px; }
.planning-bar-row { width: 100%; min-width: 0; min-height: 40px; padding: 5px 6px; border: 1px solid transparent; border-radius: 7px; display: grid; grid-template-columns: minmax(90px, 1fr) minmax(90px, 1.45fr) auto; align-items: center; gap: 8px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.planning-bar-row:hover, .planning-bar-row:focus-visible, .planning-bar-row.active { border-color: #9dbaf4; background: var(--surface); }
.planning-bar-label { overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.planning-bar-track { height: 8px; border-radius: 999px; display: flex; overflow: hidden; background: var(--line); }
.planning-bar-track i { height: 100%; display: block; }
.planning-bar-rupture { background: var(--red); }
.planning-bar-risk { background: var(--amber); }
.planning-bar-value { border-radius: inherit; background: var(--blue); }
.planning-bar-row > strong { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.planning-product-cell { min-width: 170px; display: flex; align-items: center; gap: 7px; }
.purchase-planning-row { cursor: pointer; }
.purchase-planning-row td, .planning-product-cell .cell-product strong,
.planning-product-cell .cell-product small, .purchase-planning-row .purchase-order-breakdown small,
.purchase-planning-row .purchase-package strong, .purchase-planning-row .purchase-package small,
.purchase-planning-row .purchase-planning-reason small { font-size: 11px; }
.planning-stacked-cell { min-width: 0; display: grid; gap: 2px; line-height: 1.25; }
.planning-stacked-cell strong, .planning-stacked-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planning-stacked-cell strong { color: var(--ink); font-size: 11px; }
.planning-stacked-cell small { color: var(--muted); font-size: 10px; }
.planning-status-cell { display: inline-flex; align-items: center; gap: 5px; }
.planning-reason-button { width: 24px; height: 24px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; display: inline-grid; place-items: center; color: var(--blue-dark); background: var(--surface); font-size: 11px; font-weight: 900; cursor: help; }
.planning-reason-button:hover, .planning-reason-button:focus-visible { border-color: #78a5ee; background: var(--blue-soft); outline: none; }
.purchase-planning-row:focus-visible { outline: 2px solid #60a5fa; outline-offset: -2px; }
.purchase-planning-row.expanded { background: var(--blue-soft); }
.planning-detail-panel { padding: 9px 10px 10px; }
.planning-detail-panel > .purchase-detail-heading,
.planning-detail-panel > .planning-compact-summary,
.planning-detail-panel > .planning-evidence-strip,
.planning-detail-layout { width: min(100%, 1110px); }
.planning-compact-summary { margin: 6px 0; padding: 6px 8px; border-left: 3px solid var(--blue); border-radius: 5px; color: var(--ink); background: var(--blue-soft); font-size: 11px; font-weight: 700; line-height: 1.35; }
.planning-compact-summary.critical, .planning-compact-summary.severe { border-left-color: var(--red); background: var(--red-soft); }
.planning-compact-summary.warning, .planning-compact-summary.attention { border-left-color: var(--amber); background: var(--amber-soft); }
.planning-summary-note { max-width: none; display: inline; overflow: visible; text-decoration-thickness: 1px; text-overflow: clip; white-space: normal; }
.planning-evidence-strip { margin: 0; border: 1px solid var(--line); border-radius: 6px; display: flex; overflow-x: auto; background: var(--surface); scrollbar-width: thin; }
.planning-evidence-strip > div { min-width: max-content; padding: 5px 8px; border-right: 1px solid var(--line); display: inline-flex; align-items: baseline; gap: 5px; outline: none; }
.planning-evidence-strip > div:last-child { border-right: 0; }
.planning-evidence-strip > div:focus-visible { box-shadow: inset 0 0 0 2px #60a5fa; }
.planning-evidence-strip dt, .planning-evidence-strip dd { margin: 0; font-size: 10px; line-height: 1.25; white-space: nowrap; }
.planning-evidence-strip dt { color: var(--muted); }
.planning-evidence-strip dd { color: var(--ink); font-weight: 800; }
.transfer-suggestion-row { cursor: pointer; }
.transfer-suggestion-row:focus-visible { outline: 2px solid #60a5fa; outline-offset: -2px; }
.transfer-suggestion-row.expanded { background: var(--blue-soft); }
.transfer-product-cell { min-width: 0; }
.transfer-route-cell { min-width: 0; display: grid; gap: 2px; line-height: 1.25; }
.transfer-route-cell strong, .transfer-route-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-route-cell strong { color: var(--ink); font-size: 11.5px; }
.transfer-route-cell small { color: var(--muted); font-size: 10.5px; }
.transfer-status-cell { min-width: 0; display: grid; grid-template-columns: auto auto minmax(0, 1fr); }
.transfer-status-cell small { overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.transfer-detail-panel { padding: 9px 10px 10px; }
.transfer-detail-panel > .purchase-detail-heading,
.transfer-detail-panel > .transfer-compact-summary,
.transfer-detail-layout { width: min(100%, 1320px); }
.transfer-compact-summary { margin: 6px 0; padding: 6px 8px; border-left: 3px solid var(--blue); border-radius: 5px; color: var(--ink); background: var(--blue-soft); font-size: 11px; font-weight: 700; line-height: 1.35; }
.transfer-compact-summary .compact-report-note { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; }
.transfer-detail-layout { margin-top: 6px; display: grid; grid-template-columns: minmax(0, 930px) minmax(310px, 370px); align-items: start; gap: 8px; }
.transfer-detail-primary, .transfer-detail-sidebar { min-width: 0; }
.transfer-evidence-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.transfer-evidence-grid > article { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.transfer-evidence-grid > article > span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.transfer-evidence-grid h3 { margin: 4px 0 0; color: var(--ink); font-size: 11px; line-height: 1.35; }
.transfer-evidence-list { margin: 6px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 8px; }
.transfer-evidence-list div { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.transfer-evidence-list dt, .transfer-evidence-list dd { margin: 0; font-size: 9.5px; line-height: 1.35; }
.transfer-evidence-list dt { color: var(--muted); }
.transfer-evidence-list dd { color: var(--ink); font-weight: 800; text-align: right; white-space: nowrap; }
.transfer-potential-card { border-color: #9dbaf4 !important; background: var(--blue-soft) !important; }
.transfer-potential-card > strong { margin-top: 10px; display: block; color: var(--blue-dark); font-size: 11px; line-height: 1.45; }
.transfer-potential-card p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.planning-detail-layout { margin-top: 6px; display: grid; grid-template-columns: minmax(0, 790px) minmax(280px, 312px); align-items: start; gap: 8px; }
.planning-detail-primary, .planning-detail-sidebar { min-width: 0; }
.planning-detail-sidebar { display: grid; align-content: start; gap: 6px; }
.weekly-performance-panel { margin: 0; max-width: 790px; padding: 7px; border: 1px solid #b9cdf1; border-radius: 7px; background: color-mix(in srgb, var(--blue-soft) 34%, var(--surface)); }
.weekly-performance-heading { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.weekly-performance-heading h3 { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.25; }
.weekly-performance-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.3; white-space: nowrap; }
.weekly-performance-state { min-height: 52px; margin-top: 5px; padding: 8px; border: 1px dashed var(--line-strong); border-radius: 6px; display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted); background: var(--surface); text-align: center; }
.weekly-performance-state strong { color: var(--ink); font-size: 11px; }
.weekly-performance-state small { font-size: 9px; }
.weekly-performance-state.is-error { border-color: #efb4b7; background: var(--red-soft); }
.weekly-performance-state.is-error strong { color: var(--red); }
.weekly-performance-scope { margin-top: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.weekly-performance-scope + .weekly-performance-scope { margin-top: 5px; }
.weekly-performance-scope-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.weekly-performance-scope-heading h4 { margin: 0; color: var(--ink); font-size: 12px; }
.weekly-performance-scope-heading p { margin: 1px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.weekly-performance-raw-material-alert { margin-top: 5px; padding: 5px 7px; border: 1px solid #efb4b7; border-left: 3px solid var(--red); border-radius: 5px; display: flex; align-items: baseline; gap: 5px; color: var(--red); background: var(--red-soft); }
.weekly-performance-raw-material-alert strong { font-size: 10px; }
.weekly-performance-raw-material-alert span { font-size: 9px; line-height: 1.4; }
.weekly-performance-kpis { margin-top: 5px; border: 1px solid var(--line); border-radius: 5px; display: flex; overflow-x: auto; background: var(--surface-muted); scrollbar-width: thin; }
.weekly-performance-kpi { min-width: max-content; min-height: 29px; padding: 4px 7px; border-right: 1px solid var(--line); display: inline-flex; align-items: baseline; gap: 5px; outline: none; }
.weekly-performance-kpi:last-child { border-right: 0; }
.weekly-performance-kpi:focus-visible { box-shadow: inset 0 0 0 2px #60a5fa; }
.weekly-performance-kpi span { color: var(--muted); font-size: 10px; font-weight: 750; }
.weekly-performance-kpi strong { color: var(--ink); font-size: 11px; white-space: nowrap; }
.weekly-performance-kpi.is-financial { background: var(--green-soft); }
.weekly-performance-kpi.is-financial strong { color: #116947; }
.weekly-performance-kpi.is-unavailable { background: var(--amber-soft); }
.weekly-performance-table-wrap { width: min(100%, 772px); max-width: 772px; margin-top: 5px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); outline: none; }
.weekly-performance-table-wrap:focus-visible { box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.weekly-performance-table { width: 754px; min-width: 754px; max-width: 754px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.weekly-performance-table .weekly-col-week { width: 150px; }
.weekly-performance-table .weekly-col-day { width: 50px; }
.weekly-performance-table .weekly-col-total { width: 170px; }
.weekly-performance-table .weekly-col-delta { width: 84px; }
.weekly-performance-table th, .weekly-performance-table td { height: 30px; padding: 5px 6px; border-top: 1px solid var(--line); overflow: hidden; color: var(--ink); background: var(--surface); font-size: 11px; line-height: 1.25; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.weekly-performance-table thead th { color: var(--muted); background: var(--surface-muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; }
.weekly-performance-table th:first-child { position: sticky; left: 0; z-index: 2; text-align: left; box-shadow: 1px 0 0 var(--line); }
.weekly-performance-table thead th:first-child { z-index: 3; }
.weekly-performance-table tbody th strong, .weekly-performance-table tbody th small { display: inline; }
.weekly-performance-table tbody th small { color: #8a5700; font-size: 9px; }
.weekly-total-cell strong, .weekly-total-cell small { display: inline; }
.weekly-total-cell small { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.weekly-day-cell.is-closed { color: var(--muted); background: var(--surface-muted); font-style: italic; }
.weekly-day-cell.is-unknown { color: var(--muted); background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 5px, var(--surface-muted) 5px, var(--surface-muted) 10px); }
.weekly-day-cell.is-partial { color: #8a5700; background: var(--amber-soft); }
.weekly-day-cell.is-partial small { font-size: 9px; font-weight: 800; }
.weekly-day-cell.has-anomaly { box-shadow: inset 0 -3px 0 var(--red); }
.weekly-performance-table .is-partial-week th:first-child { border-left: 3px solid var(--amber); }
.weekly-performance-empty { margin-top: 5px; padding: 8px; border: 1px dashed var(--line-strong); border-radius: 5px; color: var(--muted); background: var(--surface); text-align: center; }
.planning-pending-strip { margin: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 5px; display: grid; gap: 3px; color: var(--muted); background: var(--surface); font-size: 10px; line-height: 1.35; }
.planning-pending-strip strong { color: var(--ink); white-space: nowrap; }
.planning-orders-detail { margin: 0; padding: 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.planning-orders-detail > strong { color: var(--ink); font-size: 11px; }
.planning-order-list { margin-top: 5px; display: grid; gap: 5px; }
.planning-order-card { width: 100%; min-height: 70px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 3px; color: var(--ink); background: var(--surface-muted); text-align: left; cursor: pointer; }
.planning-order-card:hover, .planning-order-card:focus-visible { border-color: #78a5ee; background: var(--blue-soft); outline: none; box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.planning-order-card-head, .planning-order-card-values { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.planning-order-card-head strong, .planning-order-card-values strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.planning-order-card-values span, .planning-order-card small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.planning-order-card-footer { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.planning-order-card-footer small { min-width: 0; }
.planning-order-card-action { flex: 0 0 auto; color: var(--blue-dark); font-size: 10px; font-weight: 850; white-space: nowrap; }
.planning-orders-empty { padding: 9px; border: 1px dashed var(--line-strong); border-radius: 5px; color: var(--muted); background: var(--surface); font-size: 10px; line-height: 1.35; }
.planning-detail-panel .purchase-detail-heading { margin-bottom: 0; }
.planning-detail-panel .purchase-detail-heading strong { font-size: 13px; }
.planning-detail-panel .purchase-detail-heading small { margin-top: 2px; font-size: 10px; line-height: 1.35; }
.planning-detail-panel .badge { font-size: 10px; }
.planning-daily-sales-card { grid-column: 1 / -1; }
.planning-daily-sales-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.planning-daily-sales-heading > strong { color: var(--blue); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.planning-daily-sales-chart { min-height: 250px; margin-top: 10px; position: relative; overflow-x: auto; }
.planning-daily-sales-chart svg { width: 100%; min-width: 650px; height: 250px; display: block; overflow: visible; }
.planning-daily-sales-grid line { stroke: var(--chart-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.planning-daily-sales-grid text { fill: var(--chart-axis); font-family: inherit; font-size: 11px; font-weight: 500; }
.planning-daily-sales-line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.planning-daily-sales-point { cursor: crosshair; outline: none; }
.planning-daily-sales-point circle { fill: var(--surface); stroke: var(--blue); stroke-width: 2.5; vector-effect: non-scaling-stroke; transition: r .12s ease, fill .12s ease; }
.planning-daily-sales-point:hover circle, .planning-daily-sales-point:focus circle { r: 6; fill: var(--blue-soft); }
.planning-daily-sales-point:focus-visible circle { stroke: #174ea6; stroke-width: 4; }
.planning-daily-sales-tooltip { min-width: 185px; padding: 9px 11px; border: 1px solid #31465f; border-radius: 8px; position: absolute; z-index: 5; transform: translate(-50%, -100%); color: #eef7ff; background: rgba(7, 20, 38, .97); box-shadow: 0 10px 26px rgba(2, 8, 23, .28); font-size: 10px; font-weight: 700; text-align: center; pointer-events: none; }
.planning-daily-sales-tooltip.hidden { display: none; }
.planning-daily-sales-caption { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.planning-daily-empty { min-height: 230px; display: grid; place-items: center; }
.planning-daily-sales-loading, .planning-daily-sales-error { min-height: 230px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-size: 11px; text-align: center; }
.planning-daily-sales-loading strong, .planning-daily-sales-error strong { color: var(--ink); font-size: 11px; }
.planning-daily-sales-skeleton { width: min(620px, 74vw); height: 112px; display: flex; align-items: flex-end; gap: 7%; overflow: hidden; opacity: .7; }
.planning-daily-sales-skeleton i { width: 18%; border-radius: 7px 7px 2px 2px; display: block; background: linear-gradient(100deg, var(--line) 20%, var(--surface) 45%, var(--line) 70%); background-size: 220% 100%; animation: planning-skeleton 1.35s ease-in-out infinite; }
.planning-daily-sales-skeleton i:nth-child(1) { height: 38%; }
.planning-daily-sales-skeleton i:nth-child(2) { height: 72%; }
.planning-daily-sales-skeleton i:nth-child(3) { height: 54%; }
.planning-daily-sales-skeleton i:nth-child(4) { height: 88%; }
.planning-daily-sales-error .button { min-height: 40px; }
@keyframes planning-skeleton { to { background-position-x: -220%; } }
@media (prefers-reduced-motion: reduce) { .planning-daily-sales-skeleton i { animation: none; } }
.overview-commercial-summary { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
.summary-item { min-height: 92px; padding: 15px 18px; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.summary-item:last-child { border-right: 0; }
.summary-icon { width: 31px; height: 31px; flex: 0 0 auto; border-radius: 8px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.summary-icon svg { width: 17px; height: 17px; }
.summary-item.danger .summary-icon { color: var(--red); background: var(--red-soft); }
.summary-item.warning .summary-icon { color: var(--amber); background: var(--amber-soft); }
.summary-item.success .summary-icon { color: var(--green); background: var(--green-soft); }
.summary-label { color: var(--muted); font-size: 9px; font-weight: 700; }
.summary-value { margin-top: 3px; color: var(--ink); font-size: 18px; line-height: 1.1; font-weight: 820; letter-spacing: -.35px; }
.summary-note { margin-top: 3px; color: #87909c; font-size: 8px; }
.sales-performance-panel { margin-bottom: 12px; overflow: hidden; }
.sales-performance-heading { margin: 0; padding: 16px 18px 8px; align-items: flex-start; gap: 18px; }
.sales-performance-heading h2 { margin: 0; font-size: 15px; }
.sales-performance-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.sales-performance-legend { max-width: 900px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px 8px; }
.sales-legend-item { min-width: 155px; padding: 5px 8px; border: 1px solid transparent; border-radius: 7px; display: grid; grid-template-columns: 18px auto; align-items: center; column-gap: 6px; color: var(--muted); background: transparent; font-size: 8px; text-align: left; transition: opacity .18s ease, background .18s ease, border-color .18s ease; }
.sales-legend-item i { width: 18px; border-top: 2px solid #22bce8; }
.sales-legend-item strong { grid-column: 2; color: var(--ink); font-size: 9px; font-weight: 650; }
.sales-legend-item small { grid-column: 2; margin-top: 2px; color: var(--muted); font-size: 7px; font-weight: 500; line-height: 1.3; }
.sales-legend-item.target i { border-top-style: dashed; border-color: #8b5cf6; }
.sales-legend-item.previous-month i { border-top-style: dashed; border-color: #f59e0b; }
.sales-legend-item.previous-year i { border-top-style: dotted; border-color: #7d91ad; }
.sales-legend-item:hover:not(:disabled) { background: var(--surface-muted); }
.sales-legend-item[aria-pressed="true"] { border-color: #8bc5ef; background: var(--blue-soft); }
.sales-legend-item:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.sales-legend-item.muted { opacity: .48; }
.sales-legend-item.unavailable { opacity: .5; cursor: default; }
.sales-performance-chart { position: relative; min-height: 370px; padding: 0 12px 4px; }
.sales-performance-chart svg { width: 100%; height: 380px; display: block; overflow: visible; }
.sales-chart-grid line { stroke: var(--chart-grid); stroke-width: .9; opacity: .88; vector-effect: non-scaling-stroke; }
.sales-chart-grid text, .sales-chart-grid .sales-axis-label { fill: var(--chart-axis); stroke: none; stroke-width: 0; opacity: 1; font-family: inherit; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 400 !important; font-style: normal; letter-spacing: .01em; paint-order: fill; text-shadow: none; }
.sales-series-group { opacity: 1; transition: opacity .2s ease; }
.sales-series-group.series-muted { opacity: .16; }
.sales-series-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: stroke-width .2s ease; }
.sales-series-group.series-highlighted .sales-series-line { stroke-width: 4; }
.sales-series-line.current { stroke: #22bce8; }
.sales-series-line.target { stroke: #8b5cf6; stroke-width: 2; stroke-dasharray: 7 6; }
.sales-series-line.previous-month { stroke: #f59e0b; stroke-width: 2; stroke-dasharray: 5 5; }
.sales-series-line.previous-year { stroke: #7d91ad; stroke-width: 2; stroke-dasharray: 2 6; }
.sales-series-point { stroke-width: 2; fill: var(--surface); vector-effect: non-scaling-stroke; }
.sales-series-point.current { stroke: #22bce8; }
.sales-series-point.target { stroke: #8b5cf6; }
.sales-series-point.previous-month { stroke: #f59e0b; }
.sales-series-point.previous-year { stroke: #7d91ad; }
.sales-chart-hit-area { fill: transparent; stroke: none; stroke-width: 0; pointer-events: all; cursor: crosshair; }
.sales-chart-hover-guide { pointer-events: none; }
.sales-chart-hover-guide line { stroke: #91a6bd; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.sales-hover-point { fill: var(--surface); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.sales-hover-point.current { stroke: #22bce8; }
.sales-hover-point.target { stroke: #8b5cf6; }
.sales-hover-point.previous-month { stroke: #f59e0b; }
.sales-hover-point.previous-year { stroke: #7d91ad; }
.sales-chart-tooltip { position: absolute; z-index: 8; width: min(280px, calc(100% - 16px)); padding: 11px 12px; border: 1px solid #31465f; border-radius: 10px; color: #eef7ff; background: rgba(7, 20, 38, .97); box-shadow: 0 14px 34px rgba(2, 8, 23, .32); pointer-events: none; }
.sales-chart-tooltip > strong { display: block; margin-bottom: 7px; color: #fff; font-size: 11px; text-align: center; }
.sales-tooltip-row { --series-color: #22bce8; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 4px 0; }
.sales-tooltip-row.target { --series-color: #8b5cf6; }
.sales-tooltip-row.previous-month { --series-color: #f59e0b; }
.sales-tooltip-row.previous-year { --series-color: #9cb0ca; }
.sales-tooltip-row span { min-width: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--series-color); font-size: 9px; }
.sales-tooltip-row span i { width: 7px; height: 7px; flex: 0 0 auto; border: 2px solid var(--series-color); border-radius: 50%; background: transparent; }
.sales-tooltip-row b { color: var(--series-color); font-size: 9px; font-variant-numeric: tabular-nums; }
.sales-tooltip-row small { grid-column: 1 / -1; color: #aebed0; font-size: 7px; line-height: 1.35; }
.sales-performance-note { margin: 0; padding: 9px 18px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; line-height: 1.45; }
.table-panel { overflow: hidden; }
.table-heading { min-height: 66px; margin: 0; padding: 15px 16px 12px; align-items: center; }
.table-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.milestone-button { color: #155f98; border-color: #a9d7f3; background: #eff9ff; }
.milestone-button:hover { color: #0d4e80; border-color: #78bfe9; background: #e2f4ff; }
.table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.report-table { width: 100%; min-width: 1040px; border-collapse: collapse; }
.report-table[data-layout="inventory"] { min-width: 1560px; }
.report-table[data-layout="noSales"] { min-width: 1740px; }
.report-table[data-layout="sales"] { min-width: 1900px; }
.report-table[data-layout="alerts"] { min-width: 1400px; }
.report-table[data-layout="purchase-planning"] { width: 1420px; min-width: 1420px; max-width: 1420px; table-layout: fixed; }
.report-table[data-layout="purchase-planning"] th, .report-table[data-layout="purchase-planning"] td { font-size: 11.5px; }
.report-table[data-layout="purchase-planning"] th { white-space: normal; vertical-align: middle; }
.report-table[data-layout="purchase-planning"] .sort-header { min-width: 0; gap: 4px; white-space: normal; }
.report-table[data-layout="purchase-planning"] .sort-title { min-width: 0; line-height: 1.15; overflow-wrap: anywhere; }
.report-table[data-layout="purchase-planning"] .purchase-planning-row td { padding: 6px 7px; }
.report-table[data-layout="purchase-planning"] th[data-column="selecionar"], .report-table[data-layout="purchase-planning"] td[data-column="selecionar"] { width: 120px; min-width: 120px; }
.report-table[data-layout="purchase-planning"] th[data-column="produto"], .report-table[data-layout="purchase-planning"] td[data-column="produto"] { width: 190px; min-width: 190px; }
.report-table[data-layout="purchase-planning"] th[data-column="sku"], .report-table[data-layout="purchase-planning"] td[data-column="sku"] { width: 64px; min-width: 64px; }
.report-table[data-layout="purchase-planning"] th[data-column="ean"], .report-table[data-layout="purchase-planning"] td[data-column="ean"] { width: 102px; min-width: 102px; }
.report-table[data-layout="purchase-planning"] th[data-column="departamento"], .report-table[data-layout="purchase-planning"] td[data-column="departamento"] { width: 86px; min-width: 86px; }
.report-table[data-layout="purchase-planning"] th[data-column="categoria-grupo"], .report-table[data-layout="purchase-planning"] td[data-column="categoria-grupo"] { width: 108px; min-width: 108px; }
.report-table[data-layout="purchase-planning"] th[data-column="loja"], .report-table[data-layout="purchase-planning"] td[data-column="loja"] { width: 60px; min-width: 60px; }
.report-table[data-layout="purchase-planning"] th[data-column="abastecimento"], .report-table[data-layout="purchase-planning"] td[data-column="abastecimento"] { width: 145px; min-width: 145px; }
.report-table[data-layout="purchase-planning"] th[data-column="estoque-cob"], .report-table[data-layout="purchase-planning"] td[data-column="estoque-cob"],
.report-table[data-layout="purchase-planning"] th[data-column="venda-vmd"], .report-table[data-layout="purchase-planning"] td[data-column="venda-vmd"] { width: 95px; min-width: 95px; }
.report-table[data-layout="purchase-planning"] th[data-column="pedido-a-chegar"], .report-table[data-layout="purchase-planning"] td[data-column="pedido-a-chegar"] { width: 120px; min-width: 120px; }
.report-table[data-layout="purchase-planning"] th[data-column="comprar"], .report-table[data-layout="purchase-planning"] td[data-column="comprar"] { width: 135px; min-width: 135px; }
.report-table[data-layout="purchase-planning"] th[data-column="situacao"], .report-table[data-layout="purchase-planning"] td[data-column="situacao"] { width: 90px; min-width: 90px; }
.report-table[data-layout="transfer-suggestions"] { width: 1180px; min-width: 1180px; max-width: 1180px; table-layout: fixed; }
.report-table[data-layout="transfer-pending"] { width: 1210px; min-width: 1210px; max-width: 1210px; table-layout: fixed; }
.report-table[data-layout^="transfer-"] th, .report-table[data-layout^="transfer-"] td { font-size: 11.5px; }
.report-table[data-layout^="transfer-"] tbody > tr:not(.transfer-detail-row) > td { padding: 6px 7px; }
.report-table[data-layout="transfer-suggestions"] th[data-column="produto"], .report-table[data-layout="transfer-suggestions"] td[data-column="produto"] { width: 220px; min-width: 220px; }
.report-table[data-layout="transfer-suggestions"] th[data-column="rota"], .report-table[data-layout="transfer-suggestions"] td[data-column="rota"] { width: 155px; min-width: 155px; }
.report-table[data-layout="transfer-suggestions"] th[data-column="transferir"], .report-table[data-layout="transfer-suggestions"] td[data-column="transferir"] { width: 135px; min-width: 135px; }
.report-table[data-layout="transfer-suggestions"] th[data-column="destino-apos"], .report-table[data-layout="transfer-suggestions"] td[data-column="destino-apos"] { width: 115px; min-width: 115px; }
.report-table[data-layout="transfer-suggestions"] th[data-column="abastecimento"], .report-table[data-layout="transfer-suggestions"] td[data-column="abastecimento"] { width: 150px; min-width: 150px; }
.report-table[data-layout="transfer-suggestions"] th[data-column="valor-sugerido"], .report-table[data-layout="transfer-suggestions"] td[data-column="valor-sugerido"] { width: 105px; min-width: 105px; }
.report-table[data-layout="transfer-suggestions"] th[data-column="situacao"], .report-table[data-layout="transfer-suggestions"] td[data-column="situacao"] { width: 225px; min-width: 225px; }
.report-table[data-layout="transfer-suggestions"] th[data-column="acao"], .report-table[data-layout="transfer-suggestions"] td[data-column="acao"] { width: 75px; min-width: 75px; }
.report-table[data-layout="transfer-pending"] th[data-column="produto"], .report-table[data-layout="transfer-pending"] td[data-column="produto"] { width: 230px; min-width: 230px; }
.report-table[data-layout="transfer-pending"] th[data-column="rota"], .report-table[data-layout="transfer-pending"] td[data-column="rota"] { width: 180px; min-width: 180px; }
.report-table[data-layout="transfer-pending"] th[data-column="operacao"], .report-table[data-layout="transfer-pending"] td[data-column="operacao"] { width: 90px; min-width: 90px; }
.report-table[data-layout="transfer-pending"] th[data-column="quantidades"], .report-table[data-layout="transfer-pending"] td[data-column="quantidades"] { width: 170px; min-width: 170px; }
.report-table[data-layout="transfer-pending"] th[data-column="valor-pendente"], .report-table[data-layout="transfer-pending"] td[data-column="valor-pendente"] { width: 110px; min-width: 110px; }
.report-table[data-layout="transfer-pending"] th[data-column="pedido"], .report-table[data-layout="transfer-pending"] td[data-column="pedido"] { width: 140px; min-width: 140px; }
.report-table[data-layout="transfer-pending"] th[data-column="etapa"], .report-table[data-layout="transfer-pending"] td[data-column="etapa"] { width: 150px; min-width: 150px; }
.report-table[data-layout="transfer-pending"] th[data-column="recebimento"], .report-table[data-layout="transfer-pending"] td[data-column="recebimento"] { width: 140px; min-width: 140px; }
.report-table th { padding: 8px 9px; border-bottom: 1px solid var(--line); color: #6f7b8b; background: var(--surface-muted); text-align: left; font-size: 9px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
.sort-header { width: 100%; min-height: 22px; display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; color: inherit; white-space: nowrap; }
.sort-title { color: inherit; }
.sort-control { padding: 0; border: 0; display: inline-flex; flex: 0 0 auto; color: inherit; background: transparent; }
.sort-control:hover, .sort-control:focus-visible, .sort-control.active { color: #174e80; }
.sort-control:focus-visible { outline: 2px solid #8bc5ef; outline-offset: 2px; border-radius: 7px; }
.sort-balloon { width: 15px; height: 20px; padding: 2px 3px; border: 1px solid #ccd7e3; border-radius: 7px; display: inline-flex; flex: 0 0 auto; flex-direction: column; align-items: center; justify-content: center; gap: 0; color: #a4b0bd; background: #fff; box-shadow: 0 1px 2px rgba(23, 50, 79, .08); }
.sort-arrow { height: 7px; display: block; font-size: 6px; font-style: normal; line-height: 7px; transition: color .15s ease, transform .15s ease; }
.sort-control:hover .sort-arrow { color: #6184a5; }
.sort-arrow.selected { color: #1769aa; transform: scale(1.2); }
.report-table td { max-width: 250px; padding: 7px 9px; border-bottom: 1px solid #edf0f3; color: #4a5666; font-size: 10px; line-height: 1.25; vertical-align: middle; }
.report-table .weekly-performance-table tbody th,
.report-table .weekly-performance-table tbody td { font-size: 11px; }
.report-table tbody tr:last-child td { border-bottom: 0; }
.report-table tbody tr:hover { background: #fbfcfe; }
.report-table th[data-column="produto"], .report-table td[data-column="produto"] { min-width: 180px; max-width: 220px; }
.report-table th[data-column="sku"], .report-table td[data-column="sku"] { min-width: 76px; max-width: 105px; }
.report-table th[data-column="ean"], .report-table td[data-column="ean"] { min-width: 112px; max-width: 132px; }
.report-table th[data-column="departamento"], .report-table td[data-column="departamento"] { min-width: 105px; max-width: 145px; }
.report-table th[data-column="categoria-grupo"], .report-table td[data-column="categoria-grupo"] { min-width: 118px; max-width: 165px; }
.report-table th[data-column="natureza"], .report-table td[data-column="natureza"] { min-width: 104px; max-width: 126px; }
.report-table th[data-column="conformidade"], .report-table td[data-column="conformidade"] { min-width: 230px; max-width: 260px; }
.report-table th[data-column="codigo"], .report-table td[data-column="codigo"] { min-width: 118px; max-width: 145px; }
.report-table th[data-column="valor-associado"], .report-table td[data-column="valor-associado"] { min-width: 125px; max-width: 160px; }
.report-table th[data-column="evidencia-erp"], .report-table td[data-column="evidencia-erp"] { min-width: 220px; max-width: 260px; }
.report-table th[data-column="criterio"], .report-table td[data-column="criterio"],
.report-table th[data-column="logistica"], .report-table td[data-column="logistica"] { min-width: 150px; max-width: 190px; }
.report-table th[data-column="motivo-da-sugestao"], .report-table td[data-column="motivo-da-sugestao"],
.report-table th[data-column="por-que-apareceu"], .report-table td[data-column="por-que-apareceu"],
.report-table th[data-column="observacao"], .report-table td[data-column="observacao"],
.report-table th[data-column="motivo"], .report-table td[data-column="motivo"] { min-width: 190px; max-width: 240px; }
.compact-product-cell { min-width: 0; max-width: 220px; }
.compact-product-cell strong, .compact-product-cell small,
.report-code, .report-taxonomy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-product-cell strong, .compact-product-cell small, .report-code, .report-taxonomy { display: block; }
.report-code { color: var(--ink); font-variant-numeric: tabular-nums; }
.report-taxonomy { color: #5f6c7d; }
.compact-report-note { max-width: 240px; display: block; overflow: hidden; color: var(--ink); text-decoration: underline dotted #91a1b5; text-underline-offset: 3px; text-overflow: ellipsis; white-space: nowrap; cursor: help; }
.compact-report-note:focus-visible { border-radius: 4px; outline: 2px solid #60a5fa; outline-offset: 2px; }
.compact-transfer-criterion, .compact-transfer-logistics { max-width: 190px; }
.compact-transfer-reason, .compact-purchase-reason { max-width: 240px; }
.compact-supplier { max-width: 180px; font-weight: 700; }
.sale-compliance-cell { min-width: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.sale-compliance-cell .badge { flex: 0 0 auto; }
.compact-compliance-reason { max-width: 112px; color: #87323a; font-size: 9px; }
.compact-erp-evidence { max-width: 240px; }
.compact-history-note { max-width: 190px; color: #7b5a18; }
.alert-impact-cell strong, .alert-impact-cell small { display: block; white-space: nowrap; }
.alert-impact-cell strong { color: var(--ink); }
.alert-impact-cell small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.compact-order-cell { min-width: 145px; }
.compact-order-cell strong, .compact-order-cell .compact-order-detail { display: block; white-space: nowrap; }
.compact-order-cell .compact-order-detail { max-width: 180px; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.report-inline-detail { display: inline-flex; align-items: baseline; color: var(--ink); white-space: nowrap; }
.report-inline-detail small { color: var(--muted); font-size: 9px; }
.report-cell-tooltip { width: max-content; max-width: min(430px, calc(100vw - 20px)); padding: 9px 11px; border: 1px solid #b9c8da; border-radius: 8px; position: fixed; z-index: 180; color: #f7fbff; background: #17324f; box-shadow: 0 12px 30px rgba(15,39,68,.25); font-size: 11px; line-height: 1.45; pointer-events: none; }
.report-cell-tooltip[hidden] { display: none; }
.purchase-invoice-row { cursor: pointer; }
.purchase-invoice-row:focus-visible { outline: 2px solid #60a5fa; outline-offset: -2px; }
.purchase-invoice-row.expanded { background: var(--blue-soft); }
.purchase-expand-button { width: 25px; height: 25px; padding: 0; border: 1px solid var(--line); border-radius: 50%; display: inline-grid; place-items: center; color: var(--blue); background: var(--surface); cursor: pointer; }
.purchase-expand-button span { display: block; font-size: 20px; line-height: 1; transform: rotate(0deg); transition: transform .18s ease; }
.purchase-expand-button[aria-expanded="true"] span { transform: rotate(90deg); }
.invoice-identity strong, .invoice-identity small, .invoice-value strong, .invoice-value small { display: block; }
.invoice-identity strong, .invoice-value strong { color: var(--ink); }
.invoice-identity small, .invoice-value small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.invoice-value small { color: #95610b; }
.purchase-detail-row > td { max-width: none; padding: 0; background: var(--surface-muted); }
.purchase-detail-panel { padding: 12px 16px 16px 46px; border-bottom: 1px solid var(--line); }
.purchase-detail-heading { margin-bottom: 9px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.purchase-detail-heading strong, .purchase-detail-heading small { display: block; }
.purchase-detail-heading strong { color: var(--ink); font-size: 10px; }
.purchase-detail-heading small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.purchase-filtered-note { max-width: 460px; margin: 0; padding: 6px 8px; border-radius: 6px; color: #865706; background: var(--amber-soft); font-size: 8px; line-height: 1.4; }
.purchase-detail-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.purchase-detail-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.purchase-detail-table th, .purchase-detail-table td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; }
.purchase-detail-table th { color: var(--muted); background: var(--surface-muted); font-weight: 800; text-transform: uppercase; }
.purchase-detail-table td { max-width: 240px; color: var(--ink); }
.purchase-detail-table tfoot td { border-top: 2px solid var(--line-strong); border-bottom: 0; background: var(--surface-muted); }
.transfer-reason { min-width: 180px; display: block; color: var(--ink); line-height: 1.45; }
.report-table tfoot td { padding: 11px 10px; border-top: 2px solid #b9c8da; color: #17324f; background: #eaf1f8; font-size: 9px; font-weight: 850; vertical-align: middle; }
.cell-product strong, .cell-product small, .cell-period strong, .cell-period small { display: block; }
.cell-product strong, .cell-period strong { color: var(--ink); font-size: 9px; }
.cell-product small, .cell-period small { margin-top: 3px; color: #818b99; font-size: 8px; }
.number { white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { min-width: 54px; padding: 4px 6px; border-radius: 999px; display: inline-flex; justify-content: center; color: #506072; background: #eef2f6; font-size: 8px; font-weight: 800; white-space: nowrap; }
.badge.expired, .badge.critical, .badge.high { color: #a92b32; background: var(--red-soft); }
.badge.warning, .badge.medium { color: #93600d; background: var(--amber-soft); }
.badge.low, .badge.success { color: #116947; background: var(--green-soft); }
.shelf-life { min-width: 58px; padding: 4px 7px; border: 1px solid transparent; border-radius: 999px; display: inline-flex; justify-content: center; font-size: 8px; font-weight: 850; white-space: nowrap; }
.shelf-life.critical { border-color: #efb4b7; color: #a5272f; background: #fdebed; }
.shelf-life.high { border-color: #f0c08d; color: #a25008; background: #fff0df; }
.shelf-life.medium { border-color: #e9d486; color: #80610b; background: #fff8d9; }
.shelf-life.low { border-color: #aad9c4; color: #126b49; background: #e9f7f1; }
.inline-action { min-height: 28px; padding: 0 9px; border: 1px solid #b9cdf1; border-radius: 6px; color: var(--blue); background: #f5f8ff; font-size: 8px; font-weight: 800; }
.badge.severe { color: #8b1722; background: #ffd9dd; border-color: #f4aeb5; }
.badge.attention, .badge.low-turnover { color: #8a5700; background: #fff1cd; border-color: #e9c873; }
.badge.healthy { color: #116947; background: var(--green-soft); }
.negative-balance { color: var(--red); }
.health-score { min-width: 30px; min-height: 30px; padding: 5px; border: 1px solid var(--line); border-radius: 50%; display: inline-grid; place-items: center; font-weight: 850; }
.pagination-bar { min-height: 50px; padding: 9px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; }
.pagination-controls { display: flex; align-items: center; gap: 8px; }
.pagination-controls label { display: flex; align-items: center; gap: 5px; }
.pagination-controls select { height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 9px; }
.page-button { width: 29px; height: 29px; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; font-size: 18px; line-height: 1; }
.report-insight { margin-top: 12px; padding: 12px 15px; border: 1px solid #cbdcf9; border-left: 4px solid var(--blue); border-radius: 9px; color: #405473; background: var(--blue-soft); font-size: 10px; line-height: 1.5; }
.report-insight strong { color: #28466f; }

.settings-layout { display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(360px, .9fr); gap: 12px; }
.settings-panel, .ai-settings-panel { padding: 17px; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-form label { display: grid; gap: 6px; color: #566273; font-size: 10px; font-weight: 700; }
.settings-form input { height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font-size: 11px; }
.settings-form .button { align-self: end; }
.settings-wide { grid-column: 1 / -1; }
.check-field { min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; display: flex !important; align-items: center; gap: 8px !important; background: var(--surface-muted); }
.check-field input { width: 16px !important; height: 16px !important; padding: 0 !important; }
.inventory-health-settings-panel { grid-column: 1 / -1; padding: 17px; }
.health-settings-tabs { margin: 4px 0 16px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.health-settings-tabs button { min-width: max-content; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 800; }
.health-settings-tabs button.active { color: var(--blue); border-color: #9dbaf4; background: var(--blue-soft); }
.transfer-tabs { display: flex; gap: 7px; padding: 0 0 12px; overflow-x: auto; }
.transfer-tabs.hidden { display: none; }
.transfer-tabs button { min-height: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.transfer-tabs button.active { color: var(--blue); border-color: #9dbaf4; background: var(--blue-soft); box-shadow: inset 0 -2px 0 var(--blue); }
.purchase-tabs { padding-top: 2px; }
.package-reference { display: inline-flex; padding: 4px 7px; border-radius: 999px; color: #145b45; background: #e9f7f1; font-weight: 800; white-space: nowrap; }
.transfer-action-button { min-width: 54px; padding: 6px 9px; border: 1px solid #9dbaf4; border-radius: 7px; color: var(--blue); background: var(--blue-soft); font-size: 8px; font-weight: 850; cursor: pointer; }
.transfer-action-dialog { width: min(680px, calc(100vw - 24px)); }
.transfer-action-dialog form { display: grid; gap: 13px; }
.transfer-action-step { display: grid; gap: 13px; }
.transfer-action-step[hidden] { display: none; }
.transfer-action-dialog label { display: grid; gap: 6px; color: var(--ink); font-size: 10px; font-weight: 800; }
.transfer-action-dialog input, .transfer-action-dialog select, .transfer-action-dialog textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font: inherit; font-weight: 600; }
.transfer-action-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.transfer-action-summary div { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.transfer-action-summary span, .transfer-action-summary strong, .transfer-action-summary small { display: block; }
.transfer-action-summary span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.transfer-action-summary strong { margin-top: 3px; color: var(--ink); font-size: 10px; }
.transfer-action-summary small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.transfer-action-confirmation-summary .transfer-action-confirmation-note { grid-column: 1 / -1; }
.transfer-action-confirmation-note strong { line-height: 1.45; }
.transfer-action-confirmation-notice { margin: 0; padding: 11px 12px; border: 1px solid #9dbaf4; border-radius: 9px; display: grid; gap: 3px; color: var(--blue-dark); background: var(--blue-soft); font-size: 10px; line-height: 1.45; }
.transfer-action-confirmation-notice strong { font-size: 11px; }
.transfer-action-confirmation-notice span { color: var(--muted); }
.transfer-action-dialog.is-sending .transfer-action-confirm-step { opacity: .76; }
.transfer-action-dialog .dialog-actions .button { min-height: 40px; }
.transfer-action-field { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); }
.transfer-action-field[hidden] { display: none; }
.planning-status-select { min-width: 115px; min-height: 40px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); font-size: 10px; font-weight: 750; }
.health-settings-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.health-settings-fields > label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 750; }
.health-settings-fields input:not([type="checkbox"]), .inventory-ai-form input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); }
.settings-origin { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); background: var(--surface-muted); font-size: 9px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-outline { color: var(--red) !important; border-color: #efb7ba !important; }
.health-settings-panel-body { padding-top: 2px; }
.settings-data-list { margin-top: 12px; display: grid; gap: 7px; }
.settings-data-row { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-muted); }
.settings-data-row strong, .settings-data-row small { display: block; }
.settings-data-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.event-map-control { display: flex; align-items: center; gap: 7px; }
.event-map-control select { min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); }
.settings-empty { padding: 22px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); text-align: center; }
.inventory-health-dialog { width: min(780px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 14px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px rgba(7,21,38,.32); }
.inventory-health-dialog::backdrop { background: rgba(6,18,32,.64); }
.inventory-health-dialog form { padding: 20px; display: grid; gap: 14px; }
.health-explanation-text { margin: 0; padding: 13px; border-left: 3px solid var(--blue); color: var(--ink); background: var(--blue-soft); line-height: 1.55; }
.health-evidence { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.health-evidence div { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.health-evidence span, .health-evidence strong { display: block; overflow-wrap: anywhere; }
.health-evidence span { color: var(--muted); font-size: 8px; }
.health-evidence strong { margin-top: 4px; font-size: 11px; }
.health-action-panel { padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.health-action-panel h3 { margin: 0 0 11px; }
.health-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.health-action-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 750; }
.field-hint { color: var(--muted); font-size: 8px; font-weight: 600; line-height: 1.2; }
.health-action-grid input, .health-action-grid select, .health-action-grid textarea { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); }
.health-action-wide { grid-column: 1 / -1; }
.ai-settings-status { margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: #4c5869; background: var(--surface-muted); font-size: 10px; line-height: 1.45; }
.ai-settings-status strong { display: block; margin-bottom: 3px; color: var(--ink); }
.config-list { display: grid; gap: 8px; }
.config-list div { padding: 9px 10px; border: 1px solid #e7ebf0; display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; }
.config-list code { color: #284f89; font-size: 9px; font-weight: 800; }
.config-list span { color: var(--muted); font-size: 9px; }
.security-note { margin: 14px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.audit-dialog { width: min(510px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 13px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 65px rgba(7,21,38,.28); }
.audit-dialog::backdrop { background: rgba(6, 18, 32, .58); }
.audit-dialog form { padding: 19px; }
.purchase-order-detail-dialog { width: min(780px, calc(100vw - 28px)); }
.purchase-order-detail-dialog form { max-height: min(88vh, 780px); overflow: auto; }
.purchase-order-detail-dialog .dialog-head { margin-bottom: 9px; }
.purchase-order-detail-dialog .dialog-head small { margin-top: 3px; display: block; color: var(--muted); font-size: 10px; }
.purchase-order-detail-lead { margin-bottom: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; gap: 8px; background: var(--surface-muted); }
.purchase-order-detail-lead p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.purchase-order-detail-section { margin-top: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.purchase-order-detail-section h3 { margin: 0 0 7px; color: var(--ink); font-size: 11px; }
.purchase-order-detail-grid { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.purchase-order-detail-grid > div { min-width: 0; padding: 7px 8px; border-radius: 6px; background: var(--surface-muted); }
.purchase-order-detail-grid dt, .purchase-order-detail-grid dd { margin: 0; }
.purchase-order-detail-grid dt { color: var(--muted); font-size: 9px; font-weight: 700; }
.purchase-order-detail-grid dd { margin-top: 3px; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.erp-identifier { color: inherit; background: transparent; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; font-variant-numeric: tabular-nums; }
.purchase-order-observation p { margin: 0; max-height: 72px; overflow: auto; color: var(--muted); font-size: 10px; line-height: 1.45; white-space: pre-wrap; }
.dialog-head { margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dialog-head p { margin: 0 0 4px; color: var(--blue); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.dialog-head h2 { margin: 0; font-size: 17px; }
.dialog-close { width: 30px; height: 30px; border: 0; border-radius: 6px; color: var(--muted); background: var(--surface-muted); font-size: 21px; }
.audit-summary { margin-bottom: 13px; border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; }
.audit-summary div { padding: 9px; border-right: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.audit-summary div:last-child { border-right: 0; }
.audit-summary strong { display: block; margin-top: 3px; color: var(--ink); font-size: 9px; }
.audit-dialog form > label:not(.checkbox) { margin-top: 10px; display: grid; gap: 5px; color: #586475; font-size: 10px; font-weight: 700; }
.audit-dialog input:not([type="checkbox"]), .audit-dialog textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font-size: 11px; }
.checkbox { margin-top: 12px; display: flex; align-items: center; gap: 7px; color: #586475; font-size: 10px; }
.dialog-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 8px; }
.milestone-dialog { width: min(1240px, calc(100% - 28px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 15px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px rgba(7,21,38,.32); }
.milestone-dialog::backdrop { background: rgba(6, 18, 32, .64); }
.milestone-dialog-shell { padding: 20px; }
.milestone-dialog-head { position: sticky; top: -20px; z-index: 3; margin: -20px -20px 14px; padding: 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(8px); }
.milestone-dialog-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.milestone-dialog-actions { display: flex; align-items: center; gap: 7px; }
.milestone-dialog-actions .button { min-width: 64px; }
.milestone-dialog-actions .dialog-close { margin-left: 3px; }
.milestone-overview { margin-bottom: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.milestone-overview div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); }
.milestone-overview span, .milestone-overview strong { display: block; }
.milestone-overview span { color: var(--muted); font-size: 9px; font-weight: 750; }
.milestone-overview strong { margin-top: 4px; color: var(--ink); font-size: 15px; }
.milestone-report-content { display: grid; gap: 16px; }
.milestone-group { --group-strong: #dff2ff; --group-soft: #f2faff; border: 1px solid #b8d8ed; border-radius: 11px; overflow: hidden; }
.milestone-group[data-days="10"] { --group-strong: #ffe2e5; --group-soft: #fff3f4; border-color: #efb8bd; }
.milestone-group[data-days="20"] { --group-strong: #ffedc8; --group-soft: #fff8e8; border-color: #e9cb91; }
.milestone-group[data-days="30"] { --group-strong: #ddecff; --group-soft: #f0f6ff; border-color: #b6ceed; }
.milestone-group-header { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; background: var(--group-strong); }
.milestone-group-header h3 { margin: 0; color: #17324f; font-size: 14px; }
.milestone-group-header p { margin: 3px 0 0; color: #52657a; font-size: 9px; }
.milestone-group-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; color: #384d63; font-size: 9px; font-weight: 750; }
.calendar-alert { padding: 5px 8px; border: 1px solid #dc8a21; border-radius: 999px; color: #834b04; background: #fff6df; font-size: 8px; font-weight: 850; }
.milestone-table-wrap { overflow-x: auto; }
.milestone-table { width: 100%; min-width: 970px; border-collapse: collapse; }
.milestone-table th { padding: 9px 10px; border-bottom: 1px solid rgba(23,50,79,.12); color: #536477; background: #f7f9fb; text-align: left; font-size: 8px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.milestone-table .sort-header { font-size: 8px; font-weight: 850; }
.milestone-table td { padding: 10px; border-bottom: 1px solid rgba(23,50,79,.08); color: #3f5267; font-size: 9px; vertical-align: middle; }
.milestone-table tbody tr:nth-child(odd) { background: var(--group-strong); }
.milestone-table tbody tr:nth-child(even) { background: var(--group-soft); }
.milestone-table tbody tr:last-child td { border-bottom: 0; }
.milestone-empty { padding: 20px; color: var(--muted); background: var(--group-soft); text-align: center; font-size: 10px; }
.expiry-risk-dialog { width: min(1720px, calc(100% - 28px)); }
#expiryRiskSummary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#expiryRiskSummary small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
@media (max-width: 1000px) { #expiryRiskSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { #expiryRiskSummary { grid-template-columns: 1fr; } }
.expiry-risk-dialog .milestone-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.expiry-risk-table { min-width: 1480px; }
.expiry-risk-table .risk-quantity, .expiry-risk-table .risk-value { font-weight: 700; }
.expiry-risk-table .risk-average small, .expiry-risk-table .risk-quantity small, .expiry-risk-table .risk-value small { font-size: 9px; font-weight: 400; }
.expiry-risk-table .risk-product { min-width: 170px; max-width: 260px; }
.expiry-risk-table tbody tr { background: var(--risk-row, #fff); }
.expiry-risk-table tbody tr:nth-child(odd), .expiry-risk-table tbody tr:nth-child(even) { background: var(--risk-row, #fff); }
.risk-product strong, .risk-product small { display: block; }
.risk-product small { margin-top: 3px; color: #6e7c8e; }
.risk-turnover { min-width: 63px; font-weight: 850; }
.risk-classification { display: inline-flex; padding: 4px 7px; border: 1px solid rgba(35,55,78,.16); border-radius: 999px; color: #243c55; background: rgba(255,255,255,.58); font-size: 8px; font-weight: 850; white-space: nowrap; }
.manual-line { min-width: 92px; height: 19px; border-bottom: 1px solid #48586b; }
.risk-technical-note { margin: 0 0 14px; padding: 9px 11px; border: 1px solid #d9e0e9; border-radius: 8px; color: #5b6878; background: #f8fafc; font-size: 9px; line-height: 1.45; }
.expiry-risk-settings-dialog { width: min(680px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 14px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px rgba(7,21,38,.32); }
.expiry-risk-settings-dialog::backdrop { background: rgba(6,18,32,.64); }
.expiry-risk-settings-dialog form { padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.expiry-risk-settings-dialog .dialog-head, .expiry-risk-settings-dialog .settings-isolation-note, .expiry-risk-settings-dialog .risk-settings-group.exclusion, .expiry-risk-settings-dialog .risk-settings-error, .expiry-risk-settings-dialog .dialog-actions { grid-column: 1 / -1; }
.settings-isolation-note { margin: 0; padding: 10px 12px; border: 1px solid #bdd8cb; border-radius: 8px; color: #275943; background: #f1faf5; font-size: 9px; line-height: 1.45; }
.risk-settings-group { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.risk-settings-group label:last-child { grid-column: 1 / -1; }
.risk-settings-group.exclusion { grid-template-columns: 1fr; }
.risk-settings-group legend { padding: 0 5px; color: #42536a; font-size: 10px; font-weight: 800; }
.risk-settings-group label { min-width: 0; display: grid; gap: 5px; color: #5d6979; font-size: 9px; font-weight: 750; }
.risk-settings-group input { width: 100%; min-width: 0; height: 35px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; }
.risk-settings-group input[type="color"] { padding: 3px; }
.risk-settings-error { margin-top: 11px; padding: 9px 11px; border: 1px solid #efc2c5; border-radius: 8px; color: #93252b; background: var(--red-soft); font-size: 10px; }
.no-sales-risk-settings-dialog .no-sales-risk-example,
.no-sales-risk-settings-dialog #noSalesRiskSettingsError { grid-column: 1 / -1; }
.no-sales-risk-example { margin: 0; padding: 10px 12px; border: 1px solid #c9d8ee; border-radius: 8px; color: #496078; background: #f5f8fd; font-size: 9px; line-height: 1.45; }
.drilldown-popover { position: fixed; z-index: 60; max-height: min(610px, calc(100vh - 24px)); border: 1px solid #cbd8eb; border-radius: 13px; display: grid; grid-template-rows: auto auto auto minmax(80px, 1fr) auto; overflow: hidden; color: var(--ink); background: var(--surface); box-shadow: 0 22px 70px rgba(9, 31, 58, .24); }
.drilldown-popover[hidden] { display: none; }
.drilldown-head { padding: 15px 16px 9px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.drilldown-head span { display: block; margin-bottom: 3px; color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.drilldown-head h2 { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.25; letter-spacing: -.25px; }
.drilldown-close { width: 29px; height: 29px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 7px; display: grid; place-items: center; color: var(--muted); background: var(--surface-muted); font-size: 20px; line-height: 1; }
.drilldown-description { margin: 0; padding: 0 16px 10px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.drilldown-meta { min-height: 32px; padding: 7px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); background: var(--surface-muted); font-size: 9px; }
.drilldown-meta strong { color: var(--ink); }
.drilldown-content { min-height: 0; overflow: auto; }
.drilldown-loading, .drilldown-empty { min-height: 120px; padding: 24px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 10px; text-align: center; }
.drilldown-loading[hidden] { display: none; }
.drilldown-loading .spinner { flex: 0 0 auto; }
.drilldown-table-wrap { min-width: 760px; }
.drilldown-table { width: 100%; border-collapse: collapse; }
.drilldown-table th { position: sticky; top: 0; z-index: 1; padding: 8px 9px; border-bottom: 1px solid var(--line); color: #6f7b8b; background: #f5f7fa; text-align: left; font-size: 7px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.drilldown-table td { max-width: 180px; padding: 8px 9px; border-bottom: 1px solid #edf0f3; color: #4c5868; font-size: 8px; line-height: 1.35; vertical-align: middle; }
.drilldown-table td strong, .drilldown-table td small { display: block; }
.drilldown-table td strong { color: var(--ink); font-size: 8px; }
.drilldown-table td small { margin-top: 2px; color: #818b99; font-size: 7px; }
.drilldown-table td:nth-child(4), .drilldown-table td:nth-child(5), .drilldown-table td:nth-child(7) { white-space: nowrap; }
.drilldown-actions { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface); }
.drilldown-actions .button { min-height: 34px; font-size: 10px; }
.dashboard-analysis-dialog { width: calc(100vw - 16px); max-width: none; height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); padding: 0; border: 0; border-radius: 15px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px rgba(7,21,38,.34); }
.dashboard-analysis-dialog::backdrop { background: rgba(6,18,32,.68); }
.dashboard-analysis-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0,1fr); }
.dashboard-analysis-head { margin: 0; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.dashboard-analysis-head p { margin: 0 0 4px; color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.dashboard-analysis-head h2 { margin: 0; font-size: 20px; }
.dashboard-analysis-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.dashboard-analysis-head-actions { display: flex; align-items: center; gap: 8px; }
.dashboard-analysis-head-actions .button { min-width: 70px; min-height: 36px; }
.dashboard-analysis-tabs { padding: 9px 20px 0; border-bottom: 1px solid var(--line); display: flex; gap: 5px; background: var(--surface-muted); }
.dashboard-analysis-tabs button { min-height: 35px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.dashboard-analysis-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.dashboard-analysis-tabs button[hidden] { display: none; }
.dashboard-analysis-panel { min-height: 0; height: 100%; overflow: auto; }
.dashboard-analysis-panel[hidden] { display: none; }
.dashboard-analysis-chart { width: 100%; height: 100%; min-height: 0; padding: clamp(18px, 2vw, 32px); display: grid; align-items: stretch; overflow: auto; }
.dashboard-analysis-chart .horizontal-chart { align-self: start; gap: 11px; }
.dashboard-analysis-chart .horizontal-row { grid-template-columns: minmax(180px,.7fr) minmax(320px,2fr) minmax(90px,auto); }
.dashboard-analysis-chart .horizontal-label, .dashboard-analysis-chart .horizontal-value { font-size: 11px; }
.dashboard-analysis-chart .horizontal-track { height: 10px; }
.dashboard-analysis-chart .line-chart { width: 100%; height: 100%; min-height: min(620px, calc(100dvh - 190px)); max-height: none; }
.dashboard-analysis-chart .donut-layout { width: min(760px,100%); margin: auto; grid-template-columns: 220px minmax(280px,1fr); }
.dashboard-analysis-chart .donut { width: 210px; height: 210px; }
.dashboard-analysis-chart .donut-center { width: 132px; height: 132px; }
.dashboard-analysis-chart .legend-row { font-size: 11px; }
.dashboard-analysis-chart .criticality-matrix { width: max-content; min-width: 100%; grid-template-columns: 90px repeat(var(--matrix-columns),72px); gap: 5px; }
.dashboard-analysis-chart .criticality-matrix strong, .dashboard-analysis-chart .criticality-matrix b { font-size: 9px; }
.dashboard-analysis-chart .matrix-cell { height: 32px; }
.dashboard-analysis-meta { min-height: 40px; padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); background: var(--surface-muted); font-size: 9px; }
.dashboard-analysis-meta strong { color: var(--ink); }
.dashboard-analysis-table-wrap { max-height: calc(100vh - 260px); overflow: auto; }
.dashboard-analysis-table { min-width: 1450px; width: 100%; border-collapse: collapse; }
.dashboard-analysis-table th { position: sticky; top: 0; z-index: 2; padding: 9px; border-bottom: 1px solid var(--line); color: #6f7b8b; background: #f5f7fa; text-align: left; font-size: 7px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.dashboard-analysis-table td { max-width: 230px; padding: 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; line-height: 1.4; vertical-align: middle; }
.dashboard-analysis-table tfoot td { position: sticky; bottom: 0; z-index: 3; padding: 10px 9px; border-top: 2px solid var(--line); color: var(--ink); background: var(--surface); box-shadow: 0 -4px 10px rgba(7,21,38,.05); font-size: 9px; white-space: nowrap; }
.dashboard-analysis-table tbody tr:nth-child(even) { background: var(--surface-muted); }
.dashboard-analysis-table td strong, .dashboard-analysis-table td small { display: block; }
.dashboard-analysis-table td strong { color: var(--ink); font-size: 9px; }
.dashboard-analysis-table td small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.dashboard-analysis-table .number { white-space: nowrap; }
.dashboard-analysis-table .calculation-cell { min-width: 230px; color: var(--ink); }
.dashboard-analysis-empty { height: 180px; text-align: center; }
.dashboard-analysis-pagination { position: sticky; bottom: 0; background: var(--surface); }
.dashboard-status { color: var(--ink); background: var(--surface-muted); white-space: nowrap; }
.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; max-width: 360px; padding: 11px 14px; border-radius: 8px; color: #fff; background: var(--navy); box-shadow: 0 12px 35px rgba(8,24,42,.24); font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.1fr); background: #f4f7fb; }
.login-brand-panel { min-height: 100vh; padding: clamp(48px, 7vw, 96px); display: flex; flex-direction: column; justify-content: center; color: #fff; background: radial-gradient(circle at 20% 15%, rgba(48,118,226,.35), transparent 32%), linear-gradient(145deg, #07182c, #0d2f52); }
.login-brand-panel img { width: 74px; height: 74px; margin-bottom: 26px; border-radius: 18px; object-fit: cover; box-shadow: 0 18px 45px rgba(0,0,0,.25); }
.login-brand-panel p { margin: 0 0 18px; color: #85afff; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-brand-panel h1 { max-width: 580px; margin: 0; font-size: clamp(34px, 4.4vw, 62px); line-height: 1.05; letter-spacing: -.045em; }
.login-brand-panel > span { max-width: 510px; margin-top: 24px; color: #c4d5ea; font-size: 16px; line-height: 1.65; }
.login-form-panel { position: relative; padding: 72px 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.auth-card { width: min(430px, 100%); padding: 38px; display: grid; gap: 20px; border: 1px solid #dce4ef; border-radius: 22px; background: #fff; box-shadow: 0 28px 70px rgba(15,39,68,.12); }
.auth-mark { display: flex; align-items: center; gap: 10px; }.auth-mark img { width: 38px; height: 38px; border-radius: 10px; }.auth-mark span { display: flex; flex-direction: column; color: var(--ink); line-height: 1; }.auth-mark strong { font-size: 17px; }.auth-mark small { margin-top: 4px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.auth-card > div:nth-child(2) p { margin: 0 0 6px; color: var(--blue); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }.auth-card h2 { margin: 0 0 8px; font-size: 27px; letter-spacing: -.025em; }.auth-card > div:nth-child(2) span { color: var(--muted); font-size: 12px; }
.auth-card label, .registration-form > label, .auth-dialog label { display: grid; gap: 7px; color: #596579; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; }
.auth-card input, .registration-form input, .registration-form select, .registration-form textarea, .auth-dialog input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfd8e5; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.auth-card input:focus, .registration-form input:focus, .registration-form select:focus, .registration-form textarea:focus, .auth-dialog input:focus { outline: 3px solid rgba(37,99,235,.14); border-color: #7ba4f4; }
.password-field { position: relative; display: block; }.password-field input { padding-right: 72px; }.password-toggle { position: absolute; right: 8px; top: 50%; border: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 800; transform: translateY(-50%); cursor: pointer; }
.password-toggle.icon-only { width: 34px; height: 34px; right: 5px; padding: 0; display: grid; place-items: center; border-radius: 7px; color: #62758f; }
.password-toggle.icon-only:hover, .password-toggle.icon-only:focus-visible { color: var(--blue); background: var(--blue-soft); outline: none; }
.password-toggle.icon-only svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle.icon-only .eye-closed, .password-toggle.icon-only.is-visible .eye-open { display: none; }
.password-toggle.icon-only.is-visible .eye-closed { display: block; }
.registration-form .password-field input { padding-right: 46px; }
.auth-submit, .full-button { width: 100%; justify-content: center; }.auth-link { border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }.form-error { padding: 9px 11px; border: 1px solid #f5b9bd; border-radius: 8px; color: #a9212a; background: #fff3f4; font-size: 10px; line-height: 1.45; }
.auth-dialog { width: min(480px, calc(100vw - 32px)); }.dialog-copy { color: var(--muted); font-size: 11px; line-height: 1.6; }.auth-dialog form { display: grid; gap: 16px; }.auth-dialog #resetRequestStep, .auth-dialog #resetConfirmStep { display: grid; gap: 14px; }.auth-dialog #resetConfirmStep[hidden] { display: none; }
.login-footer { position: absolute; right: 32px; bottom: 24px; left: 32px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #78869a; font-size: 10px; text-align: center; }
.login-footer a { width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid #d4ddea; border-radius: 8px; display: grid; place-items: center; color: #4f6f9b; background: #fff; text-decoration: none; transition: color .16s, border-color .16s, transform .16s; }
.login-footer a:hover { color: #d62976; border-color: #e8a9c8; transform: translateY(-1px); }
.login-footer svg { width: 16px; height: 16px; }
.ranking-settings-dialog select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); }
.ranking-settings-dialog form > div:not(.dialog-head):not(.dialog-actions):not(.error-state) { display: grid; gap: 12px; }
.ranking-settings-dialog form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 750; }
.ranking-report-dialog { width: min(1450px, calc(100% - 24px)); }
.ranking-report-table { min-width: 1160px; }
.ranking-report-table tfoot td { padding: 10px; border-top: 2px solid #b9c8da; color: #17324f; background: #eaf1f8; font-weight: 850; }
.ranking-report-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nav-group { width: 100%; }.nav-parent small { margin-left: auto; color: #a8bed5; font-size: 18px; transition: transform .18s; }.nav-group.open .nav-parent small { transform: rotate(90deg); }.nav-submenu { margin: 2px 0 4px 43px; display: grid; gap: 2px; }.nav-submenu button { min-height: 31px; padding: 6px 10px; border: 0; border-left: 1px solid rgba(154,184,216,.3); color: #b8c9dd; background: transparent; text-align: left; font-size: 10px; cursor: pointer; }.nav-submenu button.active, .nav-submenu button:hover { color: #fff; border-left-color: #6da0ff; background: rgba(80,135,201,.12); }
.tenant-card { padding: 9px; display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: center; border: 1px solid rgba(151,180,212,.14); border-radius: 9px; background: rgba(255,255,255,.04); }.tenant-card #tenantLogo { width: 48px; height: 38px; padding: 2px; border-radius: 7px; object-fit: contain; object-position: center; background: #fff; }.tenant-card > span { width: 38px; height: 38px; justify-self: center; border-radius: 7px; display: grid; place-items: center; color: #dbe8f6; background: rgba(81,139,207,.25); font-size: 9px; font-weight: 900; }.tenant-card div { min-width: 0; display: grid; gap: 2px; }.tenant-card small { color: #8299b2; font-size: 7px; text-transform: uppercase; letter-spacing: .08em; }.tenant-card strong { overflow: hidden; color: #eef5fb; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.operator-card { grid-template-columns: auto 1fr auto; }.operator-card button { border: 0; color: #9fb5cc; background: transparent; font-size: 8px; font-weight: 800; cursor: pointer; }
.registration-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }.users-layout { display: grid; grid-template-columns: minmax(360px, .75fr) minmax(520px, 1.25fr); gap: 16px; }.registration-panel, .user-form-panel, .users-list-panel, .company-usage-panel { padding: 16px; }.registration-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }.registration-wide { grid-column: 1 / -1; }.registration-form textarea { resize: vertical; }.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.company-usage-panel h3 { margin: 4px 0 15px; font-size: 14px; }.company-usage-panel ul { margin: 0; padding-left: 18px; color: #596579; font-size: 10px; line-height: 1.8; }.company-usage-panel p { margin: 18px 0 0; padding: 12px; border-radius: 8px; color: #40618c; background: var(--blue-soft); font-size: 9px; line-height: 1.55; }
.logo-upload { padding: 12px; display: grid; grid-template-columns: 100px 1fr; gap: 9px 12px; align-items: center; border: 1px dashed #b8c6d8; border-radius: 9px; background: #f8fafc; }.company-logo-preview { width: 100px; height: 58px; grid-row: span 2; display: grid; place-items: center; overflow: hidden; border-radius: 7px; color: #8190a4; background: #edf2f7; font-size: 9px; text-transform: none; }.company-logo-preview img { width: 100%; height: 100%; object-fit: contain; }.logo-upload input { min-height: auto; padding: 0; border: 0; background: transparent; }.logo-upload small { color: #8792a2; font-size: 8px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.permission-fieldset { margin: 0; padding: 12px; border: 1px solid #dde4ed; border-radius: 9px; }.permission-fieldset legend { padding: 0 6px; color: #596579; font-size: 9px; font-weight: 850; text-transform: uppercase; }.permission-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }.permission-grid label, .user-active { min-height: 34px; padding: 7px 9px; display: flex; align-items: center; gap: 7px; border: 1px solid #e0e6ee; border-radius: 7px; color: #4e5b6d; background: #fafbfd; font-size: 9px; text-transform: none; letter-spacing: 0; }.permission-grid input, .user-active input { width: 14px; min-height: 14px; padding: 0; }.compact-form { gap: 11px; }
.users-table-wrap { overflow-x: auto; }.users-table { width: 100%; border-collapse: collapse; }.users-table th { padding: 9px; border-bottom: 1px solid var(--line); color: #798392; text-align: left; font-size: 8px; text-transform: uppercase; }.users-table td { padding: 10px 9px; border-bottom: 1px solid #edf0f3; color: #536071; font-size: 9px; vertical-align: middle; }.users-table td strong, .users-table td small { display: block; }.users-table td strong { color: var(--ink); }.users-table td small { margin-top: 3px; color: #8792a2; }.user-actions { display: flex; justify-content: flex-end; gap: 5px; }.user-actions button { padding: 5px 7px; border: 1px solid #d7e0eb; border-radius: 6px; color: var(--blue); background: #fff; font-size: 8px; font-weight: 800; cursor: pointer; }.status-pill { display: inline-flex; padding: 4px 7px; border-radius: 999px; color: #137554; background: #e8f7f1; font-size: 8px; font-weight: 800; }.status-pill.inactive { color: #9b2630; background: #fcebed; }
.insight[data-insight-detail] { width: 100%; border-top: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; }.insight[data-insight-detail]::after { content: 'Ver cálculo'; display: block; margin-top: 5px; color: var(--blue); font-size: 8px; font-weight: 800; }.insight-evidence { padding: 12px; border-radius: 8px; color: #3f5877; background: var(--blue-soft); font-size: 10px; line-height: 1.55; }

html[data-theme="dark"] .button.secondary { color: var(--ink); }
html[data-theme="dark"] .button.export.csv { color: #68d9ae; border-color: #285d4d; background: #102f28; }
html[data-theme="dark"] .button.export.csv:hover { background: #153d33; }
html[data-theme="dark"] .button.export.pdf { color: #ff949c; border-color: #6b3540; background: #351c24; }
html[data-theme="dark"] .button.export.pdf:hover { background: #46242e; }
html[data-theme="dark"] .period-filter label,
html[data-theme="dark"] .select-field,
html[data-theme="dark"] .multi-select-field,
html[data-theme="dark"] .settings-form label,
html[data-theme="dark"] .audit-dialog form > label:not(.checkbox),
html[data-theme="dark"] .checkbox,
html[data-theme="dark"] .auth-card label,
html[data-theme="dark"] .registration-form > label,
html[data-theme="dark"] .auth-dialog label { color: var(--muted); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .settings-form input,
html[data-theme="dark"] .audit-dialog input:not([type="checkbox"]),
html[data-theme="dark"] .audit-dialog textarea,
html[data-theme="dark"] .risk-settings-group input,
html[data-theme="dark"] .auth-card input,
html[data-theme="dark"] .registration-form input,
html[data-theme="dark"] .registration-form select,
html[data-theme="dark"] .registration-form textarea,
html[data-theme="dark"] .auth-dialog input,
html[data-theme="dark"] .pagination-controls select { color: var(--ink); border-color: var(--line); background: var(--surface-muted); }
html[data-theme="dark"] .multi-select-trigger:hover { border-color: var(--line-strong); background: var(--surface-muted); }
html[data-theme="dark"] .multi-select-menu { border-color: var(--line); box-shadow: 0 18px 45px rgba(0,0,0,.42); }
html[data-theme="dark"] .multi-select-option { color: #d7e1ec; }
html[data-theme="dark"] .multi-select-option:hover,
html[data-theme="dark"] .multi-select-option:focus-visible { background: #1a304b; }
html[data-theme="dark"] .multi-select-option[aria-selected="true"] { color: #b8d0ff; background: #1a365f; }
html[data-theme="dark"] .multi-check { border-color: #60758d; background: var(--surface); }
html[data-theme="dark"] .filter-apply-status.pending { color: #ffd27a; background: #3d2d12; }
html[data-theme="dark"] .filterbar.has-pending-filters { border-color: #8f6b2c; box-shadow: 0 0 0 2px rgba(255, 198, 80, .08), var(--shadow); }
html[data-theme="dark"] .loading { color: #b8d0ff; border-color: #34547d; }
html[data-theme="dark"] .error-state,
html[data-theme="dark"] .risk-settings-error { color: #ffadb3; border-color: #743741; }
html[data-theme="dark"] .legend-row,
html[data-theme="dark"] .horizontal-label,
html[data-theme="dark"] .insight-columns h3,
html[data-theme="dark"] .priority-table td,
html[data-theme="dark"] .report-table td,
html[data-theme="dark"] .users-table td,
html[data-theme="dark"] .drilldown-table td,
html[data-theme="dark"] .ai-settings-status,
html[data-theme="dark"] .company-usage-panel ul,
html[data-theme="dark"] .risk-settings-group legend,
html[data-theme="dark"] .risk-settings-group label { color: var(--muted); }
html[data-theme="dark"] .horizontal-track { background: #25364a; }
html[data-theme="dark"] .ranking-track { background: #25364a; }
html[data-theme="dark"] .login-footer { color: var(--muted); }
html[data-theme="dark"] .login-footer a { color: #a8c4ef; border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] .insight { background: #14283c; }
html[data-theme="dark"] .insight.critical { background: #351e27; }
html[data-theme="dark"] .insight.warning { background: #392d19; }
html[data-theme="dark"] .insight.success { background: #15342c; }
html[data-theme="dark"] .insight strong { color: #f1f6fc; }
html[data-theme="dark"] .insight p { color: #c6d2df; }
html[data-theme="dark"] .insight small { color: #a5b5c7; }
html[data-theme="dark"] .insight[data-insight-detail]::after { color: #8db5ff; }
html[data-theme="dark"] .priority-table td,
html[data-theme="dark"] .report-table td,
html[data-theme="dark"] .users-table td,
html[data-theme="dark"] .drilldown-table td { border-bottom-color: var(--line); }
html[data-theme="dark"] .report-table tbody tr:hover { background: #142438; }
html[data-theme="dark"] .report-table tfoot td { color: var(--ink); border-top-color: #49617c; background: #1b3047; }
html[data-theme="dark"] .report-cell-tooltip { color: #f7fbff; border-color: #58708a; background: #071624; }
html[data-theme="dark"] .package-reference { color: #8ce0bd; background: #183d35; }
html[data-theme="dark"] .sort-balloon,
html[data-theme="dark"] .page-button,
html[data-theme="dark"] .user-actions button { color: var(--muted); border-color: var(--line); background: var(--surface-muted); }
html[data-theme="dark"] .sort-control:hover .sort-arrow { color: var(--blue); }
html[data-theme="dark"] .report-table th,
html[data-theme="dark"] .priority-table th,
html[data-theme="dark"] .users-table th { color: var(--muted); }
html[data-theme="dark"] .badge { color: #c3d0de; background: #25364a; }
html[data-theme="dark"] .inline-action { border-color: #3d5c86; background: #182e4a; }
html[data-theme="dark"] .health-explanation-text { color: #dbeafe; background: #132d4d; }
html[data-theme="dark"] .badge.severe { color: #ffb3ba; background: #481b23; border-color: #75303a; }
html[data-theme="dark"] .badge.attention, html[data-theme="dark"] .badge.low-turnover { color: #ffd37a; background: #443316; border-color: #755821; }
html[data-theme="dark"] .milestone-button { color: #b8d8f5; border-color: #386383; background: #17334a; }
html[data-theme="dark"] .milestone-button:hover { color: #d7eaff; border-color: #4c83aa; background: #1c405d; }
html[data-theme="dark"] .report-insight,
html[data-theme="dark"] .company-usage-panel p,
html[data-theme="dark"] .insight-evidence { color: #bfd0e6; border-color: #34547d; }
html[data-theme="dark"] .config-list div,
html[data-theme="dark"] .permission-fieldset,
html[data-theme="dark"] .permission-grid label,
html[data-theme="dark"] .user-active { border-color: var(--line); }
html[data-theme="dark"] .permission-fieldset legend,
html[data-theme="dark"] .permission-grid label,
html[data-theme="dark"] .user-active { color: var(--muted); }
html[data-theme="dark"] .permission-grid label,
html[data-theme="dark"] .user-active { background: var(--surface-muted); }
html[data-theme="dark"] .logo-upload,
html[data-theme="dark"] .company-logo-preview { border-color: var(--line-strong); background: var(--surface-muted); }
html[data-theme="dark"] .milestone-dialog-head { background: rgba(16,29,44,.96); }
html[data-theme="dark"] .milestone-group { --group-strong: #153249; --group-soft: #11283a; border-color: #315a78; }
html[data-theme="dark"] .milestone-group[data-days="10"] { --group-strong: #46242e; --group-soft: #351c24; border-color: #713b47; }
html[data-theme="dark"] .milestone-group[data-days="20"] { --group-strong: #46361b; --group-soft: #352a18; border-color: #765d2d; }
html[data-theme="dark"] .milestone-group[data-days="30"] { --group-strong: #1b3558; --group-soft: #162b47; border-color: #385e8e; }
html[data-theme="dark"] .milestone-group-header h3,
html[data-theme="dark"] .milestone-group-header p,
html[data-theme="dark"] .milestone-group-stats,
html[data-theme="dark"] .milestone-table td { color: var(--ink); }
html[data-theme="dark"] .milestone-table th,
html[data-theme="dark"] .drilldown-table th { color: var(--muted); background: #142235; }
html[data-theme="dark"] .calendar-alert { color: #ffd18d; border-color: #9a6727; background: #402e15; }
html[data-theme="dark"] .expiry-risk-table tbody tr,
html[data-theme="dark"] .expiry-risk-table tbody tr:nth-child(odd),
html[data-theme="dark"] .expiry-risk-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--risk-row, #ffffff) 20%, var(--surface)); }
html[data-theme="dark"] .expiry-risk-table td { color: var(--ink); }
html[data-theme="dark"] .risk-product small { color: #b1bfd0; }
html[data-theme="dark"] .risk-classification { color: var(--ink); border-color: #63768c; background: rgba(8,18,31,.6); }
html[data-theme="dark"] .risk-technical-note { color: var(--muted); border-color: var(--line); background: var(--surface-muted); }
html[data-theme="dark"] .settings-isolation-note { color: #8fe0bd; border-color: #306751; background: #123329; }
html[data-theme="dark"] .no-sales-risk-example { color: #b8c9de; border-color: #314a68; background: #13243a; }
html[data-theme="dark"] .drilldown-popover { border-color: var(--line-strong); box-shadow: 0 22px 70px rgba(0,0,0,.45); }
html[data-theme="dark"] .dashboard-analysis-table th { color: var(--muted); background: #13263a; }
html[data-theme="dark"] .dashboard-analysis-tabs { background: #102033; }
html[data-theme="dark"] .login-view { background: var(--canvas); }
html[data-theme="dark"] .login-form-panel { background: radial-gradient(circle at 75% 18%, rgba(46,101,180,.13), transparent 35%), var(--canvas); }
html[data-theme="dark"] .auth-card { border-color: var(--line); background: var(--surface); box-shadow: 0 28px 70px rgba(0,0,0,.35); }
html[data-theme="dark"] .form-error { color: #ffadb3; border-color: #743741; background: var(--red-soft); }

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

.kai-assistant { position: fixed; right: 22px; bottom: 20px; z-index: 70; }
.kai-launcher {
  min-width: 148px;
  height: 62px;
  padding: 6px 13px 6px 6px;
  border: 1px solid rgba(78, 179, 255, .5);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  background: linear-gradient(145deg, #0c2541, #071426);
  box-shadow: 0 15px 40px rgba(5, 20, 38, .28), 0 0 0 4px rgba(34, 188, 232, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kai-launcher:hover { transform: translateY(-2px); border-color: #22bce8; box-shadow: 0 18px 46px rgba(5, 20, 38, .34), 0 0 0 5px rgba(34, 188, 232, .11); }
.kai-launcher[aria-expanded="true"] { border-color: #22bce8; box-shadow: 0 13px 34px rgba(5, 20, 38, .3), 0 0 0 5px rgba(34, 188, 232, .13); }
.kai-launcher-avatar { position: relative; width: 48px; height: 48px; flex: 0 0 auto; border: 2px solid rgba(101, 211, 255, .72); border-radius: 50%; overflow: visible; background: #071426; box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); }
.kai-launcher-avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.kai-launcher-avatar i { position: absolute; right: 0; bottom: 1px; width: 10px; height: 10px; border: 2px solid #071426; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 8px rgba(61,220,151,.8); }
.kai-launcher-copy { display: grid; gap: 2px; text-align: left; }
.kai-launcher-copy strong { font-size: 13px; line-height: 1; }
.kai-launcher-copy small { color: #b9cde1; font-size: 9px; white-space: nowrap; }
.kai-launcher > svg { width: 18px; height: 18px; margin-left: 1px; color: #57d6fb; }

.kai-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: min(400px, calc(100vw - 28px));
  height: min(680px, calc(100dvh - 116px));
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(7,20,38,.3);
  display: grid;
  grid-template-rows: auto auto minmax(150px, 1fr) auto auto auto;
  transform-origin: right bottom;
  animation: kai-panel-in .2s ease-out;
}
@keyframes kai-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.kai-header {
  min-height: 76px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  color: #fff;
  background: radial-gradient(circle at 18% 0, rgba(34,188,232,.2), transparent 34%), linear-gradient(135deg, #0c2948, #071426);
}
.kai-header > img { width: 52px; height: 52px; border: 2px solid rgba(101,211,255,.65); border-radius: 50%; object-fit: cover; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.kai-eyebrow { display: block; margin-bottom: 2px; color: #83dcf5; font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.kai-header h2 { margin: 0; font-size: 18px; line-height: 1.05; }
.kai-header small { margin-top: 5px; display: flex; align-items: center; gap: 5px; color: #b7cadc; font-size: 10px; }
.kai-header small i { width: 7px; height: 7px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 7px rgba(61,220,151,.75); }
.kai-icon-button { width: 34px; height: 34px; padding: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; display: grid; place-items: center; color: #d9e9f7; background: rgba(255,255,255,.06); font-size: 22px; line-height: 1; }
.kai-icon-button:hover { color: #fff; background: rgba(255,255,255,.12); }
.kai-privacy-note { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 7px; color: var(--muted); background: var(--surface-muted); font-size: 10px; line-height: 1.4; }
.kai-privacy-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--green); }
.kai-messages {
  min-height: 0;
  padding: 15px 13px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.kai-message { max-width: 88%; display: grid; gap: 5px; }
.kai-message.user { margin-left: auto; justify-items: end; }
.kai-message.assistant { margin-right: auto; }
.kai-message-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kai-message-bubble { padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px 13px 13px; color: var(--ink); background: var(--surface-muted); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.kai-message.user .kai-message-bubble { border-color: #2b68d7; border-radius: 13px 4px 13px 13px; color: #fff; background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.kai-message.error .kai-message-bubble { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); background: var(--red-soft); }
.kai-message.loading .kai-message-bubble { display: inline-flex; align-items: center; gap: 4px; }
.kai-message.loading .kai-message-bubble i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); animation: kai-dot 1s infinite ease-in-out; }
.kai-message.loading .kai-message-bubble i:nth-child(2) { animation-delay: .14s; }
.kai-message.loading .kai-message-bubble i:nth-child(3) { animation-delay: .28s; }
@keyframes kai-dot { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
.kai-facts { width: 100%; margin: 2px 0 0; padding: 0; display: grid; gap: 5px; list-style: none; }
.kai-facts li { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; display: grid; gap: 2px; background: var(--surface); }
.kai-facts strong { color: var(--ink); font-size: 10px; line-height: 1.35; }
.kai-facts span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.kai-source { color: var(--muted); font-size: 9px; }
.kai-suggestions { padding: 2px 12px 8px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.kai-suggestions::-webkit-scrollbar { display: none; }
.kai-suggestion { min-height: 36px; flex: 0 0 auto; max-width: 240px; padding: 7px 10px; border: 1px solid #b9cef1; border-radius: 999px; color: var(--blue-dark); background: var(--blue-soft); font-size: 10px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kai-suggestion:hover { border-color: var(--blue); }
.kai-form { margin: 0 12px; padding: 6px 6px 6px 11px; border: 1px solid var(--line-strong); border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: end; gap: 6px; background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease; }
.kai-form:focus-within { border-color: #73a2ff; box-shadow: 0 0 0 3px rgba(37,99,235,.11); }
.kai-form textarea { width: 100%; max-height: 92px; min-height: 36px; padding: 8px 0 4px; border: 0; outline: 0; resize: none; color: var(--ink); background: transparent; font-size: 12px; line-height: 1.4; }
.kai-form textarea::placeholder { color: var(--muted); }
.kai-form button { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--blue); }
.kai-form button:hover { background: var(--blue-dark); }
.kai-form button svg { width: 18px; height: 18px; }
.kai-footer { padding: 8px 13px 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.kai-footer button { min-height: 32px; padding: 0; border: 0; color: var(--blue-dark); background: transparent; font-size: 10px; }
.kai-footer button:hover { text-decoration: underline; }

@media (max-width: 1320px) {
  .charts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts-grid > .chart-panel, .charts-grid > .ranking-panel { grid-column: auto; }
  .operations-grid { grid-template-columns: 1fr; }
  .kpi-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .kpi:nth-child(6) { border-right: 0; }
}

@media (max-width: 1040px) {
  .report-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-rail.kpi-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-view { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 300px; padding: 44px 32px; }
  .login-brand-panel h1 { font-size: 36px; }
  .login-form-panel { padding: 28px 18px; }
  .registration-layout, .users-layout { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 206px minmax(0, 1fr); }
  .main { padding-inline: 18px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; }
  .search-box { width: 250px; }
  .settings-layout { grid-template-columns: 1fr; }
  .health-settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-evidence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-planning-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-planning-charts > :last-child { grid-column: 1 / -1; }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 780px) {
  .kai-assistant { right: 10px; bottom: 10px; left: 10px; }
  .kai-launcher { min-width: 58px; height: 58px; margin-left: auto; padding: 5px; }
  .kai-launcher[aria-expanded="true"] { opacity: 0; pointer-events: none; }
  .kai-launcher-avatar { width: 46px; height: 46px; }
  .kai-launcher-copy, .kai-launcher > svg { display: none; }
  .kai-panel { position: fixed; inset: 8px; width: auto; height: auto; max-height: none; border-radius: 17px; }
  .kai-message { max-width: 92%; }
  .analysis-state .quality-alerts { display: block; }
  .analysis-state .quality-alerts span { display: block; margin-top: 4px; }
  .report-catalog { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; }
  .auth-card { padding: 26px 22px; }
  .registration-form { grid-template-columns: 1fr; }
  .registration-wide { grid-column: auto; }
  .permission-grid { grid-template-columns: 1fr 1fr; }
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; padding: 12px; }
  .sidebar-toggle { display: none; }
  .brand { min-height: 42px; padding: 0 90px 8px 5px; }
  .brand-mark { width: 34px; height: 34px; }
  .mobile-logout-button {
    position: absolute;
    top: 13px;
    right: 13px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(183,197,212,.32);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #dbe8f4;
    background: rgba(255,255,255,.07);
    font-size: 12px;
    font-weight: 700;
  }
  .mobile-logout-button:hover { color: #fff; border-color: rgba(255,255,255,.48); background: rgba(255,255,255,.12); }
  .mobile-logout-button:focus-visible { outline: 2px solid #6da0ff; outline-offset: 2px; }
  .mobile-logout-button svg { width: 17px; height: 17px; }
  .mobile-nav-toggle {
    width: 100%;
    min-height: 46px;
    padding: 8px 11px;
    border: 1px solid rgba(183,197,212,.26);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #dbe8f4;
    background: rgba(255,255,255,.06);
    text-align: left;
  }
  .mobile-nav-toggle span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; }
  .mobile-nav-toggle svg { width: 18px; height: 18px; }
  .mobile-nav-toggle strong { min-width: 0; overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav-toggle[aria-expanded="true"] { border-color: rgba(109,160,255,.68); background: rgba(109,160,255,.14); }
  .nav { display: none; }
  .sidebar.mobile-nav-open .nav {
    min-height: auto;
    max-height: min(62vh, 540px);
    margin-top: 8px;
    padding: 4px 2px 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .sidebar.mobile-nav-open .nav-item { width: 100%; min-width: 0; min-height: 44px; padding: 8px 9px; border-left: 3px solid transparent; border-bottom: 0; white-space: normal; }
  .sidebar.mobile-nav-open .nav-item.active { border-left-color: #6da0ff; border-bottom-color: transparent; }
  .sidebar.mobile-nav-open .nav-group { grid-column: 1 / -1; }
  .sidebar.mobile-nav-open .nav-submenu { margin: 3px 0 4px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar.mobile-nav-open .nav-submenu button { min-height: 44px; padding: 8px 12px; }
  .sidebar-footer { display: none; }
  .main { padding: 17px 12px 96px; }
  .topbar { display: grid; gap: 12px; }
  .topbar-actions { width: 100%; display: grid; grid-template-columns: 1fr auto auto; justify-content: stretch; }
  .search-box { width: 100%; grid-column: 1 / -1; }
  .export-actions { grid-column: 1 / -1; }
  .button.export { flex: 1; }
  .mobile-filters-toggle {
    width: 100%;
    min-height: 46px;
    margin-bottom: 10px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .mobile-filters-toggle span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; }
  .mobile-filters-toggle svg { width: 18px; height: 18px; color: var(--blue); }
  .mobile-filters-toggle small { color: var(--blue-dark); font-size: 11px; font-weight: 800; }
  .filterbar.mobile-collapsed { display: none; }
  .filterbar { align-items: stretch; }
  .filter-actions { width: 100%; margin-left: 0; padding-top: 9px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .filter-apply-status { grid-column: 1 / -1; justify-self: start; font-size: 10px; }
  .filter-apply-button, .filter-actions .text-button { min-height: 44px; }
  .filter-apply-button { width: 100%; }
  .period-filter { width: 100%; padding: 0 0 9px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-filter input { width: 100%; }
  .select-field, .multi-select-field { flex: 1 1 145px; max-width: none; }
  .sales-type-filters { width: 100%; min-width: 0; flex-wrap: wrap; }
  .sales-type-filters label { flex: 1 1 140px; justify-content: center; }
  .purchase-planning-controls { width: 100%; min-width: 0; align-items: stretch; }
  .purchase-planning-controls > label { flex: 1 1 150px; }
  .planning-analysis-heading { align-items: stretch; flex-direction: column; }
  .planning-analysis-heading p, .planning-chart-heading p, .planning-active-focus,
  .planning-status-button, .planning-status-button strong, .planning-bar-label,
  .planning-bar-row > strong, .planning-daily-sales-caption, .planning-daily-sales-tooltip,
  .purchase-planning-row td, .planning-product-cell .cell-product strong,
  .planning-product-cell .cell-product small, .purchase-planning-row .purchase-order-breakdown small,
  .purchase-planning-row .purchase-package strong, .purchase-planning-row .purchase-package small,
  .purchase-planning-row .purchase-planning-reason small, .planning-detail-panel .badge { font-size: 11px; }
  .planning-status-button, .planning-bar-row { min-height: 44px; }
  .planning-status-select { min-height: 44px; font-size: 11px; }
  .planning-calendar-note { font-size: 11px; }
  .planning-daily-sales-error .button { min-height: 44px; }
  .planning-daily-sales-loading, .planning-daily-sales-error,
  .planning-daily-sales-loading strong, .planning-daily-sales-error strong { font-size: 11px; }
  .purchase-planning-controls > label { font-size: 11px; }
  .purchase-period-note { max-width: none; grid-column: 1 / -1; font-size: 11px; }
  .planning-analysis-heading .button { align-self: flex-start; }
  .purchase-planning-charts { grid-template-columns: 1fr; }
  .purchase-planning-charts > :last-child { grid-column: auto; }
  .planning-orders-detail { grid-column: auto; }
  .planning-detail-panel { padding-inline: 10px; }
  .planning-daily-sales-heading { align-items: stretch; flex-direction: column; gap: 5px; }
  .planning-daily-sales-chart { min-height: 225px; }
  .planning-daily-sales-chart svg { height: 225px; }
  .planning-number-input { justify-content: space-between; }
  .select-field select { width: 100%; min-width: 0; }
  .expiry-risk-actions { width: 100%; }
  .expiry-risk-actions .button:first-child { flex: 1; }
  .temporal-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .temporal-item span { white-space: normal; }
  .kpi-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(odd) { border-right: 1px solid var(--line); }
  .kpi:nth-child(even) { border-right: 0; }
  .kpi:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .kpi:nth-child(5), .kpi:nth-child(6) { border-bottom: 0; }
  .charts-grid { grid-template-columns: 1fr; }
  .ranking-row { grid-template-columns: 22px minmax(110px, 1fr) auto; }
  .ranking-track { display: none; }
  .ranking-actions { align-items: flex-end; flex-direction: column-reverse; }
  .login-footer { right: 16px; bottom: 16px; left: 16px; }
  .insight-columns { grid-template-columns: 1fr; }
  .insight-columns > div + div { padding: 13px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .report-summary { grid-template-columns: 1fr; }
  .overview-commercial-summary { grid-template-columns: 1fr; }
  .summary-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-item:last-child { border-bottom: 0; }
  .sales-performance-heading { align-items: stretch; flex-direction: column; }
  .sales-performance-legend { max-width: none; justify-content: flex-start; }
  .sales-legend-item { min-width: 138px; }
  .sales-performance-chart { min-height: 285px; padding-inline: 4px; overflow-x: auto; }
  .sales-performance-chart svg { min-width: 780px; height: 300px; }
  .pagination-bar { align-items: flex-start; flex-direction: column; }
  .pagination-controls { width: 100%; justify-content: space-between; }
  .settings-form { grid-template-columns: 1fr; }
  .settings-wide { grid-column: auto; }
  .health-settings-fields, .health-action-grid { grid-template-columns: 1fr; }
  .health-action-wide { grid-column: auto; }
  .settings-data-row, .settings-origin { align-items: stretch; flex-direction: column; }
  .event-map-control { align-items: stretch; flex-direction: column; }
  .health-settings-tabs { margin-inline: -4px; padding: 0 4px 5px; }
  .transfer-action-summary { grid-template-columns: 1fr; }
  .inventory-health-dialog form { padding: 14px; }
  .config-list div { grid-template-columns: 1fr; gap: 3px; }
  .audit-summary { grid-template-columns: 1fr; }
  .audit-summary div { border-right: 0; border-bottom: 1px solid var(--line); }
  .audit-summary div:last-child { border-bottom: 0; }
  .table-heading { align-items: flex-start; flex-direction: column; }
  .table-heading-actions { width: 100%; justify-content: space-between; }
  .table-wrap { isolation: isolate; scroll-padding-left: 150px; }
  .report-table th { font-size: 10px; }
  .report-table td { font-size: 11px; }
  .report-table thead > tr > th:first-child,
  .report-table tbody > tr:not(.purchase-detail-row) > td:first-child:not([colspan]) {
    position: sticky;
    left: 0;
    z-index: 2;
    max-width: clamp(150px, 42vw, 190px);
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
  }
  .report-table thead > tr > th:first-child { z-index: 3; background: var(--surface-muted); }
  .report-table tbody > tr:not(.purchase-detail-row):hover > td:first-child:not([colspan]) { background: var(--surface-muted); }
  .report-table .inline-action,
  .report-table button,
  .report-table select { min-height: 40px; }
  .report-table [data-report-tooltip] { min-height: 40px; display: flex; align-items: center; }
  .milestone-overview { grid-template-columns: 1fr; }
  .milestone-dialog-shell { padding: 14px; }
  .milestone-dialog-head { top: -14px; margin: -14px -14px 12px; padding: 14px; }
  .milestone-dialog-head { align-items: flex-start; }
  .milestone-dialog-actions { flex-wrap: wrap; justify-content: flex-end; }
  .expiry-risk-settings-dialog form { grid-template-columns: 1fr; }
  .expiry-risk-settings-dialog .dialog-head, .expiry-risk-settings-dialog .settings-isolation-note, .expiry-risk-settings-dialog .risk-settings-group, .expiry-risk-settings-dialog .dialog-actions { grid-column: auto; }
  .drilldown-popover { inset: auto 8px 8px !important; width: auto !important; max-height: min(78vh, 620px); border-radius: 14px; }
}

@media (max-width: 420px) {
  .kai-header { min-height: 70px; padding: 10px 12px; grid-template-columns: 46px minmax(0, 1fr) auto; }
  .kai-header > img { width: 46px; height: 46px; }
  .kai-privacy-note { padding-inline: 10px; }
  .kai-messages { padding-inline: 10px; }
  .kai-form { margin-inline: 9px; }
  .kai-footer { padding-inline: 10px; }
  .permission-grid { grid-template-columns: 1fr; }
  .topbar-actions { grid-template-columns: 1fr auto; }
  .topbar-actions > .button { width: 100%; }
  .search-box, .export-actions { grid-column: 1 / -1; }
  .multi-select-field { flex-basis: 100%; }
  .planning-bar-row { grid-template-columns: minmax(80px, 1fr) minmax(70px, .9fr) auto; }
  .multi-select-menu, #departmentFilter .multi-select-menu, #categoryFilter .multi-select-menu { width: 100%; max-width: none; right: auto; left: 0; }
  .export-actions { grid-column: 1 / -1; }
  .export-actions .button { min-width: 0; flex: 1 1 30%; padding-inline: 8px; }
  .period-filter { grid-template-columns: 1fr; }
  .table-heading-actions { align-items: stretch; flex-direction: column; }
  .milestone-button { width: 100%; }
  .kpi-rail { grid-template-columns: 1fr; }
  .kpi, .kpi:nth-child(odd), .kpi:nth-child(even) { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi:last-child { border-bottom: 0; }
  .donut-layout { grid-template-columns: 100px minmax(0, 1fr); gap: 10px; }
  .donut { width: 98px; height: 98px; }
  .health-evidence { grid-template-columns: 1fr; }
}

@media (max-width: 1580px) {
  .executive-dashboard .executive-kpis { grid-template-columns: repeat(5, minmax(120px, 1fr)); }
  .executive-charts-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .executive-dashboard .executive-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .executive-layout { grid-template-columns: 1fr; }
  .executive-insight-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); position: static; }
  .executive-bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .executive-dashboard .executive-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .executive-charts-secondary { grid-template-columns: 1fr; }
  .kpi-explanations { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  .dashboard-layout-active .topbar .search-box { display: none; }
  .dashboard-product-filter { min-width: 100%; max-width: none; }
  .executive-charts-primary, .executive-insight-rail { grid-template-columns: 1fr; }
  .executive-dashboard .executive-kpis .kpi { min-height: 104px; }
  .executive-chart-panel { min-height: 235px; }
  .dashboard-analysis-dialog { width: calc(100% - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); }
  .dashboard-analysis-shell { height: 100%; min-height: 0; }
  .dashboard-analysis-head { padding: 14px; }
  .dashboard-analysis-head h2 { font-size: 17px; }
  .dashboard-analysis-head { align-items: flex-start; gap: 10px; }
  .dashboard-analysis-head-actions { flex-wrap: wrap; justify-content: flex-end; }
  .dashboard-analysis-head-actions .button { min-width: 58px; padding-inline: 10px; }
  .dashboard-analysis-tabs { padding-inline: 10px; }
  .dashboard-analysis-tabs button { flex: 1; padding-inline: 8px; }
  .dashboard-analysis-chart { min-height: 0; padding: 14px; align-items: stretch; }
  .dashboard-analysis-chart .horizontal-row { grid-template-columns: minmax(110px,.8fr) minmax(120px,1fr) auto; }
  .dashboard-analysis-chart .donut-layout { grid-template-columns: 130px minmax(180px,1fr); }
  .dashboard-analysis-chart .donut { width: 125px; height: 125px; }
  .dashboard-analysis-chart .donut-center { width: 78px; height: 78px; }
  .dashboard-analysis-table-wrap { max-height: calc(100vh - 300px); }
}

@media (max-width: 470px) {
  .executive-dashboard .executive-kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .executive-dashboard .executive-kpis .kpi { min-width: 150px; scroll-snap-align: start; }
  .overview-commercial-summary { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .overview-commercial-summary .summary-item { min-width: min(82vw, 290px); border-right: 1px solid var(--line); border-bottom: 0; scroll-snap-align: start; }
  .overview-commercial-summary .summary-item:last-child { border-right: 0; }
  .kpi-explanations { grid-template-columns: 1fr; }
}

@media (min-width: 781px) {
  .kai-assistant { right: 8px; bottom: 12px; }
  .kai-launcher { width: 52px; min-width: 52px; height: 52px; padding: 4px; }
  .kai-launcher-avatar { width: 42px; height: 42px; }
  .kai-launcher-copy, .kai-launcher > svg { display: none; }
  .app-shell.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .app-shell.sidebar-collapsed .sidebar { padding-inline: 10px; }
  .app-shell.sidebar-collapsed .brand { justify-content: center; padding-inline: 0; }
  .app-shell.sidebar-collapsed .brand > span:last-child,
  .app-shell.sidebar-collapsed .nav-item > span,
  .app-shell.sidebar-collapsed .nav-parent > small,
  .app-shell.sidebar-collapsed .nav-submenu,
  .app-shell.sidebar-collapsed .sidebar-footer { display: none !important; }
  .app-shell.sidebar-collapsed .nav { padding-right: 0; }
  .app-shell.sidebar-collapsed .nav-item { justify-content: center; gap: 0; padding-inline: 0; border-left-width: 0; }
  .app-shell.sidebar-collapsed .nav-item svg { width: 21px; height: 21px; }
  .app-shell.sidebar-collapsed .nav-item.active { box-shadow: inset 3px 0 0 #6da0ff; }
  .app-shell.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
}

@media (max-width: 1040px) {
  .transfer-evidence-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}

@media (max-width: 1180px) {
  .planning-detail-layout { grid-template-columns: minmax(0, 790px); }
  .planning-detail-sidebar { width: min(100%, 790px); }
  .transfer-detail-layout { grid-template-columns: minmax(0, 930px); }
  .transfer-detail-sidebar { width: min(100%, 930px); }
  .transfer-evidence-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}

@media (max-width: 780px) {
  .purchase-order-detail-dialog { width: calc(100vw - 12px); }
  .purchase-order-detail-dialog form { padding: 12px; }
  .purchase-order-detail-lead { align-items: flex-start; flex-direction: column; }
  .purchase-order-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transfer-detail-panel { padding: 12px; }
  .planning-detail-panel { padding: 8px; }
  .transfer-evidence-grid { grid-template-columns: 1fr; }
  .planning-compact-summary { font-size: 10px; }
  .planning-detail-layout,
  .planning-detail-primary,
  .planning-detail-sidebar {
    width: min(100%, calc(100vw - 52px));
    max-width: calc(100vw - 52px);
  }
  .planning-detail-layout { display: block; }
  .planning-detail-sidebar { margin-top: 6px; }
  .transfer-detail-layout,
  .transfer-detail-primary,
  .transfer-detail-sidebar {
    width: min(100%, calc(100vw - 52px));
    max-width: calc(100vw - 52px);
  }
  .transfer-detail-layout { display: block; }
  .transfer-detail-sidebar { margin-top: 6px; }
  .planning-pending-strip { gap: 2px; }
  .weekly-performance-panel { width: 100%; max-width: 100%; margin-inline: -2px; padding: 6px; }
  .weekly-performance-heading { align-items: flex-start; flex-direction: column; gap: 1px; }
  .weekly-performance-heading p { white-space: normal; }
  .weekly-performance-scope { padding: 5px; }
  .weekly-performance-raw-material-alert { align-items: flex-start; flex-direction: column; gap: 1px; }
  .weekly-performance-table-wrap { width: 100%; max-width: calc(100vw - 58px); scroll-padding-left: 150px; }
  .weekly-performance-table th, .weekly-performance-table td { font-size: 11px; }
}

@media (max-width: 430px) {
  .purchase-order-detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .weekly-performance-state .spinner { animation: none !important; }
}

/* Compras: seleção, pedidos preparados e agenda em uma área compacta. */
.purchase-workspace {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.purchase-workspace-head,
.prepared-order-card > header,
.supply-calendar-card > header,
.prepared-order-card > footer,
.supply-calendar-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.purchase-workspace-head { align-items: flex-end; }
.purchase-workspace-head h2,
.prepared-order-card h3,
.supply-calendar-card h3 { margin: 0; }
.workspace-eyebrow {
  margin: 0 0 2px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.purchase-workspace-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 7px;
  align-items: end;
}
.purchase-workspace-filters label,
.agenda-form-grid label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.purchase-workspace-filters input,
.purchase-workspace-filters select,
.agenda-form-grid input,
.agenda-form-grid select,
.agenda-form-grid textarea {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}
.purchase-workspace-summary,
.purchase-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.purchase-workspace-summary span {
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px;
}
.purchase-workspace-summary strong { color: var(--ink); }
.purchase-order-list,
.supply-calendar-list { display: grid; gap: 7px; }
.prepared-order-card,
.supply-calendar-card {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.prepared-order-card header small,
.supply-calendar-card header small,
.prepared-order-notice { color: var(--muted); }
.prepared-order-card > footer,
.supply-calendar-card > footer {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 7px;
}
.prepared-order-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}
.prepared-order-metrics > span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--surface-muted);
}
.prepared-order-metrics small { color: var(--muted); font-size: 11px; }
.prepared-order-notice { margin: 6px 0 0; font-size: 12px; }
.prepared-status {
  padding: 4px 7px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 800;
}
.status-aprovado_para_digitacao,
.status-digitado_no_erp { color: var(--green); background: var(--green-soft); }
.status-cancelado { color: var(--red); background: var(--red-soft); }
.status-em_aprovacao { color: var(--amber); background: var(--amber-soft); }
.purchase-select-cell {
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr);
  gap: 5px;
  align-items: center;
}
.purchase-select-cell input[type="number"] {
  width: 82px;
  min-height: 29px;
  padding: 4px 6px;
}
.purchase-selection-bar {
  position: sticky;
  bottom: 8px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(20, 36, 58, .14);
}
.purchase-selection-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.purchase-selection-copy span { color: var(--muted); font-size: 12px; }
.purchase-selection-copy .purchase-reconciliation-status {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  white-space: normal;
  font-weight: 700;
}
.purchase-reconciliation-status[data-tone="success"] { color: var(--green); background: var(--green-soft); }
.purchase-reconciliation-status[data-tone="warning"] { color: var(--amber); background: var(--amber-soft); }
.purchase-reconciliation-status[data-tone="error"] { color: var(--red); background: var(--red-soft); }
.purchase-reconciled {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.purchase-reconciled.official { color: var(--blue); background: var(--blue-soft); }
.purchase-workspace-empty {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 86px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
}
.prepared-review-table {
  max-height: 44vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.prepared-review-table table { width: 100%; border-collapse: collapse; }
.prepared-review-table th,
.prepared-review-table td {
  padding: 6px 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.prepared-review-group {
  margin: 7px 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.prepared-review-group h3 { margin: 0 0 4px; }
.purchase-consolidation-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.purchase-consolidation-group > header h3 { margin: 0; }
.purchase-consolidation-meta { margin: 4px 0 7px; color: var(--muted); font-size: 12px; }
.minimum-ready,
.minimum-blocked { padding: 3px 6px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.minimum-ready { color: var(--green); background: var(--green-soft); }
.minimum-blocked,
.manual-reference-warning { color: var(--red); background: var(--red-soft); }
.manual-reference-warning { padding: 6px 7px; border-radius: 7px; }
.prepared-review-group ul { margin: 0; padding-left: 18px; }
.purchase-justification-field { display: grid; gap: 4px; margin-top: 9px; }
.purchase-flow-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 9px; }
.purchase-confirm-summary,
.prepared-erp-details,
.purchase-erp-warning,
.prepared-order-notes {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}
.purchase-erp-warning { display: grid; gap: 2px; }
.prepared-history { display: grid; gap: 4px; }
.prepared-history li { display: grid; gap: 2px; }
.agenda-form-grid,
.erp-registration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.agenda-form-grid .wide { grid-column: 1 / -1; }
.agenda-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 7px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.agenda-weekdays[hidden] { display: none; }
.agenda-weekdays legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.agenda-form-grid .agenda-weekdays label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-muted);
  cursor: pointer;
}
.agenda-form-grid .agenda-weekdays input {
  width: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
}
.agenda-form-grid .agenda-weekdays label:has(input:checked) {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}
.agenda-applied-scope {
  margin: 0 0 9px;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px;
}

.purchase-quotation-panel {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.purchase-quotation-head,
.purchase-quotation-card > header,
.purchase-quotation-card > footer,
.quotation-offers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.purchase-quotation-head { align-items: flex-end; }
.purchase-quotation-head h3,
.purchase-quotation-card h4 { margin: 0; }
.purchase-quotation-head > div:first-child,
.purchase-quotation-card header > div { min-width: 0; }
.purchase-quotation-head span,
.purchase-quotation-card header span,
.quotation-offers-head span {
  color: var(--muted);
  font-size: 12px;
}
.purchase-quotation-filters { grid-template-columns: repeat(4, minmax(120px, 1fr)) auto; }
.purchase-quotation-list { display: grid; gap: 7px; }
.purchase-quotation-card {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.purchase-quotation-card header small,
.quotation-item-summary small,
.quotation-item-summary em,
.quotation-offer-chip small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}
.quotation-status,
.quotation-offer-chip em {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}
.quotation-status.status-responses_received,
.quotation-offer-chip em { color: var(--green); background: var(--green-soft); }
.quotation-status.status-issued { color: var(--blue); background: var(--blue-soft); }
.quotation-status.status-closed { color: var(--ink); background: var(--surface-muted); }
.quotation-status.status-canceled { color: var(--red); background: var(--red-soft); }
.quotation-item-summary {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(105px, 1fr));
  gap: 5px;
}
.quotation-item-summary > span,
.quotation-offer-chip {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--surface-muted);
}
.quotation-item-summary strong,
.quotation-item-summary em,
.quotation-offer-chip strong,
.quotation-offer-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quotation-offer-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 5px;
}
.quotation-offer-chip.is-winner { outline: 1px solid var(--green); background: var(--green-soft); }
.purchase-quotation-card > footer { justify-content: flex-end; }
.quotation-edit-notice {
  margin: 0;
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 12px;
}
.purchase-quotation-dialog { width: min(1040px, calc(100vw - 28px)); }
.quotation-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.quotation-form-grid label,
.quotation-supplier-row label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.quotation-form-grid input,
.quotation-form-grid select,
.quotation-supplier-row input,
.quotation-supplier-row select,
.purchase-quotation-dialog textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}
.quotation-title-field,
.quotation-description-field { grid-column: span 2; }
.quotation-offers-head { margin-top: 9px; }
.quotation-offers-head > div { display: grid; gap: 1px; }
.quotation-supplier-list { display: grid; gap: 6px; margin: 6px 0 9px; }
.quotation-supplier-row {
  display: grid;
  grid-template-columns: 1fr 1.7fr 1fr .9fr .8fr 1fr 1.4fr auto auto;
  gap: 6px;
  align-items: end;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-muted);
}
.quotation-payment-field span { font-size: 10px; font-weight: 500; }
.quotation-winner-field {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 5px !important;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink) !important;
  background: var(--surface);
  white-space: nowrap;
}
.quotation-winner-field input { width: 15px; min-height: 15px; margin: 0; padding: 0; }
.quotation-source-warning { margin: 8px 0 0; }

@media (max-width: 900px) {
  .purchase-workspace-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prepared-order-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotation-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotation-supplier-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotation-remove-supplier { justify-self: start; }
  .purchase-selection-bar,
  .purchase-workspace-head,
  .purchase-quotation-head { align-items: stretch; flex-direction: column; }
}

@media (max-width: 560px) {
  .purchase-workspace-filters,
  .agenda-form-grid,
  .erp-registration-grid { grid-template-columns: 1fr; }
  .agenda-form-grid .wide { grid-column: auto; }
}

#planningFilters { padding: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
#planningFilters.hidden { display: none; }
#planningFilters > p, #planningActionFocus { flex-basis: 100%; }
#planningFilters label, .planning-edit-form label { display: grid; gap: 6px; }
.planning-edit-form { display: grid; gap: 12px; padding: 24px; min-width: min(440px, 75vw); }
#planningEditHistory { white-space: pre-wrap; font: inherit; max-height: 180px; overflow: auto; }
#planningEditError { color: #b42318; }
.selected-action { background: var(--blue-soft); }

.execution-preview{width:min(1280px,96vw);max-width:96vw;height:90vh;max-height:94vh;padding:16px;border:1px solid #dfe5ec;border-radius:12px}.execution-preview header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.execution-preview h2{margin:0;font-size:20px}.execution-preview p{font-size:12px;color:#687386;margin:5px 0}.execution-preview iframe{display:block;width:100%;height:calc(100% - 84px);border:1px solid #dfe5ec;background:white}.execution-preview::backdrop{background:#10243a88}

#recoveryControls{padding:16px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}#recoveryControls.hidden,#recoveryAnalysis.hidden{display:none}#recoveryScopeNote{flex-basis:100%;font-size:12px;color:var(--text-muted,#687386);margin:0}.recovery-tabs,.recovery-periods{display:flex;gap:6px;flex-wrap:wrap;align-items:center}.recovery-tabs button,.recovery-periods button{border:1px solid #ccd6e4;border-radius:8px;padding:9px 13px;background:var(--surface,#fff);color:inherit;cursor:pointer}.recovery-tabs button.active{background:#2563eb;color:white;border-color:#2563eb}.recovery-periods{margin-left:auto;font-size:12px}.recovery-value-note,.recovery-daily,.recovery-method{padding:14px 18px;background:var(--surface,#fff);border:1px solid #dfe5ec;border-radius:10px;margin:12px 0}.recovery-value-note span{display:block;font-size:11px;color:#687386;margin-top:6px}.recovery-value-note p{font-size:12px;margin:7px 0 0}.recovery-charts,.recovery-insights{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.recovery-chart,.recovery-insights article{padding:15px;border:1px solid #dfe5ec;background:var(--surface,#fff);border-radius:10px;min-width:0}.recovery-chart h3{font-size:14px;margin:0 0 14px}.recovery-bar{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(40px,1fr) auto;gap:8px;align-items:center;margin:10px 0;font-size:11px}.recovery-bar span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recovery-bar>div{height:7px;background:#e7edf6;border-radius:8px}.recovery-bar i{display:block;height:100%;background:#2563eb;border-radius:8px}.recovery-bar strong{font-size:11px}.recovery-insights article{font-size:12px;line-height:1.5}.recovery-insights p{margin:5px 0 0;color:#687386}.recovery-method{font-size:12px}.recovery-daily summary,.recovery-method summary{cursor:pointer}.recovery-active #reportBody td small{display:block}@media(max-width:1000px){.recovery-charts{grid-template-columns:1fr}.recovery-insights{grid-template-columns:1fr}.recovery-periods{margin-left:0}}
/* Trocas e Perdas: drilldown e resumo executivo */
.recovery-chart header{display:flex;align-items:start;justify-content:space-between;gap:8px}.recovery-chart header h3{margin:0}.recovery-chart-all{border:0;background:none;color:var(--primary,#2563eb);font-size:11px;white-space:nowrap;cursor:pointer;padding:0}.recovery-chart-basis{font-size:11px;color:var(--text-muted,#687386);margin:8px 0 14px}.recovery-bar{border:0;background:transparent;color:inherit;width:100%;padding:6px 2px;text-align:left;cursor:pointer;border-radius:5px}.recovery-bar:hover{background:#eff5ff}.recovery-bar:focus-visible,.recovery-chart-all:focus-visible{outline:2px solid #2563eb;outline-offset:3px}.recovery-kind{font-size:12px;display:flex;align-items:center;gap:8px}.recovery-kind[hidden]{display:none}.recovery-kind select{padding:8px;border:1px solid #ccd6e4;border-radius:8px;background:var(--surface,#fff);color:inherit;max-width:100%}
.recovery-drilldown{width:min(1450px,96vw);max-width:96vw;max-height:92vh;padding:20px;border:1px solid #dfe5ec;border-radius:14px;background:var(--surface,#fff);color:var(--text,#17243a);overflow:auto}.recovery-drilldown::backdrop{background:#10264088}.recovery-drilldown>header{display:flex;justify-content:space-between;gap:16px}.recovery-drilldown h2{margin:6px 0;font-size:21px}.recovery-drilldown header small{color:#2563eb;font-weight:700}.recovery-drilldown p{font-size:12px;line-height:1.5}.recovery-drill-actions,.recovery-drilldown nav{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.recovery-drilldown button{cursor:pointer;background:var(--surface,#fff);color:inherit;border:1px solid #ccd6e4;padding:8px 12px;border-radius:7px}.recovery-drilldown button:disabled{opacity:.5;cursor:default}.recovery-drilldown nav button.active{color:#fff;background:#2563eb;border-color:#2563eb}.recovery-drill-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}.recovery-drill-summary>div{padding:12px;border:1px solid #dfe5ec;border-radius:8px;min-width:0}.recovery-drill-summary span,.recovery-drill-summary strong{display:block}.recovery-drill-summary span{font-size:11px;margin-bottom:6px}.recovery-drill-summary strong{font-size:16px}.recovery-drill-search{display:flex;gap:8px;align-items:center;font-size:12px;margin:12px 0}.recovery-drill-search input{min-width:0;max-width:420px;flex:1;border:1px solid #ccd6e4;border-radius:8px;padding:10px;color:inherit;background:var(--surface,#fff)}.recovery-drill-table{overflow:auto;max-height:48vh}.recovery-drill-table table{min-width:1080px;width:100%;border-collapse:collapse}.recovery-drill-table th{position:sticky;top:0;background:var(--surface,#fff);z-index:1}.recovery-drill-table th button{border:0;padding:7px 0;font-size:11px}.recovery-drill-table td,.recovery-drill-table th{padding:8px;text-align:left;border-bottom:1px solid #e4eaf1;font-size:12px}.recovery-drill-table td small{display:block;font-size:10px;margin-top:4px;color:var(--text-muted,#687386)}.recovery-drilldown footer{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:12px;font-size:12px}.recovery-drilldown [data-status]{font-size:12px;color:var(--text-muted,#687386)}
.recovery-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0}.recovery-overview:empty{display:none}.recovery-overview-card{background:var(--surface,#fff);border:1px solid #dfe5ec;border-radius:12px;padding:18px;min-width:0}.recovery-overview-card header{display:flex;align-items:center;justify-content:space-between;gap:8px}.recovery-overview-card h3{margin:0;font-size:17px}.recovery-overview-card button{border:0;background:transparent;color:inherit;text-align:left;cursor:pointer;padding:0}.recovery-overview-card header button{color:#2563eb;font-size:12px}.recovery-overview-card button:hover strong{text-decoration:underline}.recovery-overview-card button:focus-visible{outline:2px solid #2563eb;outline-offset:4px}.recovery-overview-period,.recovery-overview-foot{font-size:11px;color:var(--text-muted,#687386);line-height:1.5}.recovery-overview-main{padding:10px 0 16px}.recovery-overview-main strong{font-size:25px}.recovery-overview-card button span,.recovery-overview-card button strong,.recovery-overview-card button small{display:block}.recovery-overview-card button span{font-size:12px;margin-bottom:6px}.recovery-overview-card button small{font-size:10px;color:var(--text-muted,#687386);margin-top:5px}.recovery-overview-split{display:grid;grid-template-columns:1fr 1fr;gap:14px;border-top:1px solid #e4eaf1;padding:12px 0}.recovery-overview-split strong{font-size:17px}.recovery-overview-warning{font-size:11px;color:#986100}
@media(max-width:700px){.recovery-overview{grid-template-columns:1fr}.recovery-drilldown>header{flex-direction:column}.recovery-drill-summary{grid-template-columns:1fr 1fr}.recovery-drill-search{align-items:stretch;flex-direction:column}.recovery-drilldown{padding:12px}.recovery-drill-actions{justify-content:flex-start}.recovery-drilldown footer{flex-wrap:wrap}.recovery-kind{align-items:flex-start;flex-direction:column}.recovery-overview-card{padding:14px}}
/* Motivos: leitura financeira e operacional, sem somar bases diferentes. */
.reason-dashboard{margin:16px 0;padding:18px;background:var(--surface,#fff);border:1px solid #dce4f0;border-radius:12px;min-width:0}.reason-dashboard>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.reason-dashboard header h2{font-size:20px;margin:5px 0}.reason-dashboard header small{color:#2563eb;font-size:10px;font-weight:700;letter-spacing:.07em}.reason-dashboard header p,.reason-basis,.reason-method,.reason-chart-note{font-size:11px;line-height:1.55;color:var(--text-muted,#687386)}.reason-basis{padding:10px 12px;background:#f2f6fc;border-radius:7px}.reason-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}.reason-kpi{padding:13px;border:1px solid #dce4f0;border-radius:9px;text-align:left;background:var(--surface,#fff);color:inherit;cursor:pointer;min-width:0}.reason-kpi span,.reason-kpi strong,.reason-kpi small{display:block}.reason-kpi span{font-size:11px}.reason-kpi strong{font-size:22px;margin:8px 0}.reason-kpi small{font-size:10px;line-height:1.5;color:var(--text-muted,#687386)}.reason-chart-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:12px}.reason-chart{border:1px solid #dce4f0;border-radius:9px;padding:14px;margin-bottom:12px;min-width:0}.reason-chart h3{font-size:14px;margin:0 0 8px}.reason-pareto{max-height:340px;overflow:auto;padding-right:4px}.reason-pareto-row{display:grid;grid-template-columns:minmax(110px,1.5fr) minmax(20px,.65fr) auto 62px;gap:8px;align-items:center;text-align:left;width:100%;padding:9px 0;border:0;border-bottom:1px solid #e6ebf2;background:transparent;color:inherit;cursor:pointer;font-size:11px}.reason-pareto-row:hover,.reason-frequency-row:hover{background:#edf4ff}.reason-name{line-height:1.4}.reason-pareto-row small{display:block;font-size:9px;color:var(--text-muted,#687386);margin-top:4px;font-weight:400}.reason-track{height:7px;border-radius:5px;background:#e5edf8;display:block}.reason-track i{display:block;background:#2563eb;height:100%;border-radius:5px}.reason-cumulative{text-align:right;font-weight:700;color:#087a69}.reason-trend{height:280px;display:flex;gap:5px;align-items:stretch;overflow:auto;padding:12px 0 0}.reason-trend button{flex:1;min-width:29px;max-width:110px;display:flex;flex-direction:column;align-items:stretch;background:transparent;border:0;color:inherit;cursor:pointer;padding:0}.reason-trend button strong{font-size:10px;white-space:nowrap}.reason-trend button small{font-size:9px;margin-top:9px;white-space:nowrap}.reason-day-track{height:200px;display:flex;align-items:flex-end;background:linear-gradient(to top,#eaf0f8 1px,transparent 1px);background-size:100% 25%;padding:0 12%}.reason-day-track i{display:block;width:100%;border-radius:4px 4px 0 0;background:#36a595}.reason-trend button:disabled{opacity:.5;cursor:default}.reason-matrix-wrap{overflow:auto}.reason-matrix{width:100%;border-collapse:separate;border-spacing:4px;min-width:600px}.reason-matrix th{text-align:left;font-size:10px;font-weight:600;max-width:170px;line-height:1.5}.reason-matrix td{text-align:center;min-width:90px}.reason-matrix button{border:0;border-radius:6px;background:rgba(37,99,235,var(--reason-intensity));color:inherit;padding:10px 6px;width:100%;cursor:pointer;font-size:11px;font-weight:700}.reason-matrix small{display:block;font-size:9px;margin-top:5px;font-weight:400}.reason-frequency{border:1px solid #dce4f0;border-radius:8px;padding:12px;margin-bottom:12px;font-size:12px}.reason-frequency summary{cursor:pointer;font-weight:600}.reason-frequency-row{display:grid;grid-template-columns:minmax(130px,1.4fr) minmax(40px,1fr) 65px;gap:10px;align-items:center;width:100%;padding:9px 0;border:0;border-bottom:1px solid #e6ebf2;background:transparent;text-align:left;color:inherit;cursor:pointer;font-size:11px}.reason-priorities{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.reason-priorities article{border-left:3px solid #36a595;padding:8px 12px;background:#f5f9fc;font-size:11px;line-height:1.5}.reason-priorities p{margin:6px 0}.reason-priorities small{display:block;color:var(--text-muted,#687386)}.reason-priorities button{border:0;color:#2563eb;background:transparent;font-size:11px;padding:8px 0;cursor:pointer}.reason-method{margin-bottom:0}.reason-empty{font-size:12px;padding:15px;text-align:center}.reason-warning{font-size:12px;color:#966000}.reason-dashboard button:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.recovery-invoice-detail td{white-space:normal}.recovery-invoice-detail td small{display:block}.recovery-invoice-detail .purchase-detail-table{min-width:900px}.recovery-kind select#recoveryReason{max-width:350px}
@media(max-width:1100px){.reason-chart-grid{grid-template-columns:1fr}.reason-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.reason-priorities{grid-template-columns:1fr}}@media(max-width:600px){.reason-dashboard{padding:12px}.reason-dashboard>header{flex-direction:column;align-items:stretch}.reason-pareto-row{grid-template-columns:minmax(100px,1fr) 25px auto 48px;gap:5px;font-size:10px}.reason-kpi{padding:10px}.reason-kpi strong{font-size:19px}.reason-chart{padding:10px}.reason-trend{height:230px}.reason-day-track{height:155px}.reason-pareto{max-height:390px}.recovery-kind select#recoveryReason{max-width:100%;width:100%}}
[data-theme="dark"] .reason-basis,[data-theme="dark"] .reason-priorities article{background:#172b40}
.reason-trend{gap:2px}.reason-trend button{min-width:8px}.reason-trend button small{overflow:visible}.report-table[data-recovery-layout="invoices"]>thead>tr>th:first-child,.report-table[data-recovery-layout="invoices"]>tbody>tr:not(.purchase-detail-row)>td:first-child,.report-table[data-recovery-layout="invoices"]>tfoot>tr>td:first-child{width:40px;min-width:40px;max-width:40px;padding-left:8px;padding-right:8px}.recovery-invoice-detail .purchase-detail-heading{flex-wrap:wrap}.recovery-invoice-detail .purchase-filtered-note{white-space:normal;max-width:480px}
.recovery-multi{position:relative;min-width:220px;max-width:360px;flex:1 1 240px;color:var(--ink);font-size:12px}.recovery-multi[hidden]{display:none}.recovery-multi-label{display:block;font-weight:650;margin-bottom:5px}.recovery-multi-trigger{width:100%;min-height:38px;border:1px solid var(--line,#ccd6e4);border-radius:8px;background:var(--surface,#fff);color:inherit;padding:8px 11px;display:flex;gap:8px;align-items:center;justify-content:space-between;text-align:left;cursor:pointer}.recovery-multi-trigger span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.recovery-multi-menu{position:absolute;right:0;top:100%;margin-top:6px;width:390px;max-width:calc(100vw - 48px);padding:12px;border:1px solid var(--line,#ccd6e4);border-radius:10px;box-shadow:0 12px 35px #0c27442b;background:var(--surface,#fff);z-index:85}.recovery-multi-menu[hidden]{display:none}.recovery-multi-search{display:grid;gap:5px;font-size:11px;font-weight:600}.recovery-multi-search input{width:100%;min-width:0;border:1px solid var(--line,#ccd6e4);border-radius:6px;padding:9px;background:var(--surface,#fff);color:inherit}.recovery-multi-all,.recovery-multi-options label{display:flex;align-items:flex-start;gap:9px;padding:9px 5px;cursor:pointer;line-height:1.45}.recovery-multi-all{font-weight:700;border-bottom:1px solid var(--line,#ccd6e4);margin:5px 0}.recovery-multi-options{max-height:260px;overflow:auto;overscroll-behavior:contain}.recovery-multi-options label:has(input:checked){background:#2563eb0d}.recovery-multi input[type=checkbox]{accent-color:#2563eb;width:16px;height:16px;flex:0 0 auto;margin:1px 0 0}.recovery-multi-options small{font-size:10px;color:var(--muted,#687386)}.recovery-multi-empty{font-size:11px;color:var(--muted,#687386);padding:9px 0}.recovery-multi footer{display:flex;justify-content:flex-end;gap:8px;border-top:1px solid var(--line,#ccd6e4);padding-top:10px}.recovery-multi footer button{border:1px solid var(--line,#ccd6e4);border-radius:6px;padding:8px 12px;background:var(--surface,#fff);color:inherit;cursor:pointer}.recovery-multi footer [data-apply]{background:#2563eb;color:white;border-color:#2563eb}.recovery-multi button:focus-visible,.recovery-multi input:focus-visible{outline:2px solid #2563eb;outline-offset:2px}@media(max-width:600px){.recovery-multi{max-width:100%;min-width:0;flex-basis:100%}.recovery-multi-menu{width:100%;max-width:100%}}
