:root {
  --ovi-navy: #0f1324;
  --ovi-blue: #496aff;
  --ovi-purple: #cf7dea;
  --ovi-white: #ffffff;
  --bg: #f7f8fc;
  --paper: rgba(255, 255, 255, 0.94);
  --paper-strong: #ffffff;
  --paper-soft: #eef2ff;
  --paper-muted: #f6f7fd;
  --ink: #0f1324;
  --muted: rgba(15, 19, 36, 0.68);
  --line: rgba(15, 19, 36, 0.12);
  --accent: #496aff;
  --accent-soft: rgba(73, 106, 255, 0.12);
  --highlight: #cf7dea;
  --highlight-soft: rgba(207, 125, 234, 0.14);
  --shadow: 0 18px 48px rgba(15, 19, 36, 0.08);
  --shadow-strong: 0 20px 56px rgba(15, 19, 36, 0.14);
  --success-soft: rgba(73, 106, 255, 0.1);
  --surface-contrast: #dce4ff;
}

[data-theme="light"] {
  --bg: #f7f8fc;
  --paper: rgba(255, 255, 255, 0.94);
  --paper-strong: #ffffff;
  --paper-soft: #eef2ff;
  --paper-muted: #f6f7fd;
  --ink: #0f1324;
  --muted: rgba(15, 19, 36, 0.68);
  --line: rgba(15, 19, 36, 0.12);
  --accent: #496aff;
  --accent-soft: rgba(73, 106, 255, 0.12);
  --highlight: #cf7dea;
  --highlight-soft: rgba(207, 125, 234, 0.14);
  --shadow: 0 18px 48px rgba(15, 19, 36, 0.08);
  --shadow-strong: 0 20px 56px rgba(15, 19, 36, 0.14);
  --surface-contrast: #dce4ff;
}

[data-theme="dark"] {
  --bg: #0f1324;
  --paper: rgba(23, 27, 46, 0.9);
  --paper-strong: #171b2e;
  --paper-soft: #1e2340;
  --paper-muted: #202643;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #496aff;
  --accent-soft: rgba(73, 106, 255, 0.16);
  --highlight: #cf7dea;
  --highlight-soft: rgba(207, 125, 234, 0.18);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --shadow-strong: 0 20px 56px rgba(0, 0, 0, 0.42);
  --surface-contrast: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(73, 106, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(207, 125, 234, 0.16), transparent 24%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, #ffffff 8%) 0%, var(--bg) 100%);
  transition: background 180ms ease, color 180ms ease;
}

[hidden] {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(100%, 1080px);
  display: grid;
  gap: 22px;
  justify-items: center;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: var(--ovi-white);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 18px 40px rgba(73, 106, 255, 0.24);
}

.auth-card {
  width: min(100%, 460px);
  padding: 34px 32px 30px;
  border-radius: 30px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.auth-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.08;
  color: var(--ink);
}

.auth-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

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

.auth-field span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  background: color-mix(in srgb, var(--paper-strong) 96%, transparent);
  color: var(--ink);
  padding: 0 16px;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 88%, transparent);
}

.auth-field input:focus {
  border-color: color-mix(in srgb, var(--accent) 56%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.auth-submit {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: var(--ovi-white);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(73, 106, 255, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.auth-feedback {
  min-height: 20px;
  font-size: 0.88rem;
  font-weight: 600;
}

.auth-feedback[data-tone="error"] {
  color: #d64567;
}

.auth-feedback[data-tone="warning"] {
  color: #b06f11;
}

.app-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  width: min(1600px, calc(100% - 32px));
  margin: 16px auto 28px;
}

.sidebar,
.hero,
.filters-panel,
.summary-panel,
.tabs-panel {
  background: var(--paper);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  padding: 18px;
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  overflow: hidden;
}

.workspace {
  display: grid;
  gap: 20px;
  overflow: hidden;
  min-width: 0;
}

.sidebar-brand h1,
.hero h2,
.summary-header h2,
.filters-header h2,
.table-header h3 {
  margin: 0;
  font-family: 'Inter', sans-serif;
}

.sidebar-brand h1 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.sidebar-brand {
  display: grid;
  gap: 8px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
}

.logout-button {
  justify-self: start;
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--line));
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.logout-button:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
}

.sidebar-copy,
.hero-text,
.report-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.theme-switcher {
  margin-top: 4px;
  display: grid;
  gap: 8px;
}

.theme-switcher-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.theme-switcher-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  gap: 3px;
  border-radius: 12px;
  background: var(--paper-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
  max-width: 190px;
}

.theme-button {
  border: 0;
  border-radius: 10px;
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.theme-button:hover {
  color: var(--ink);
}

.theme-button .sales-icon-label {
  gap: 6px;
  color: inherit;
}

.theme-button .sales-icon-badge {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: transparent;
  border: 0;
}

.theme-button.active {
  background: color-mix(in srgb, var(--accent) 16%, var(--paper));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
}

.sidebar-section-header {
  display: grid;
  gap: 0;
  padding: 0 2px;
  margin-top: 2px;
  margin-bottom: 2px;
  line-height: 1.15;
}

.sidebar-section-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  line-height: 1.1;
}

.sidebar-section-header strong {
  color: var(--ink);
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.15;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  align-content: start;
  margin-top: 0;
}

.sidebar-button {
  width: 100%;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 10px 10px 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.sidebar-button::before {
  content: '';
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 160ms ease;
}

.sidebar-button:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--paper));
}

.sidebar-button-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-button-icon .sales-icon-badge {
  width: 18px;
  height: 18px;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
}

.sidebar-button-copy {
  min-width: 0;
}

.sidebar-button-state,
.sidebar-button-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.sidebar-button-state {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.sidebar-button-arrow {
  min-width: 20px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.sidebar-button-arrow .sales-icon-badge {
  width: 14px;
  height: 14px;
  background: transparent;
  border: 0;
  color: inherit;
}

.sidebar-button-copy strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 700;
}

.sidebar-button-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.sidebar-button.active {
  background: color-mix(in srgb, var(--accent) 9%, var(--paper));
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}

.sidebar-button.active::before {
  background: linear-gradient(180deg, var(--accent), var(--highlight));
}

.sidebar-button.active .sidebar-button-icon .sales-icon-badge {
  color: var(--accent);
}

.sidebar-button.active .sidebar-button-copy strong {
  color: var(--ink);
}

.sidebar-button.active .sidebar-button-copy span {
  color: var(--muted);
}

.sidebar-button.active .sidebar-button-arrow {
  color: var(--accent);
}

.hero,
.filters-panel,
.summary-panel,
.tabs-panel {
  padding: 28px;
  min-width: 0;
  overflow-x: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 18px;
  overflow: visible;
  position: relative;
  align-items: center;
  padding: 18px 22px;
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto -70px -110px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(73, 106, 255, 0.2), rgba(207, 125, 234, 0.22));
  filter: blur(8px);
}

.hero h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.1;
  max-width: 720px;
}

.hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: center;
  justify-content: flex-end;
}

.status-card,
.summary-card {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 20px;
}

.status-label,
.summary-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-card strong,
.summary-value {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.status-card {
  min-width: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-strong) 88%, var(--accent) 12%);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: none;
}

.status-label {
  font-size: 0.72rem;
  margin: 0;
  color: var(--muted);
}

.status-card strong {
  margin-top: 0;
  font-size: 0.9rem;
  white-space: nowrap;
}

.hero-copy .eyebrow {
  margin-bottom: 6px;
}

.hero-text {
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 720px;
}

.filters-header,
.summary-header,
.table-header,
.analysis-heading,
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filters-grid {
  display: grid;
  grid-template-columns: 140px minmax(230px, 280px) minmax(280px, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
  align-items: end;
}

.filters-panel {
  position: relative;
  overflow: visible;
  z-index: 12;
  padding: 16px 18px;
}

.field {
  display: grid;
  gap: 5px;
}

.field-wide {
  min-width: 0;
}

.field span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field-icon-label,
.summary-label-row,
.button-icon-label,
.report-meta-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.field-icon-label .sales-icon-badge,
.summary-label-row .sales-icon-badge,
.button-icon-label .sales-icon-badge,
.report-meta-title-row .sales-icon-badge {
  width: 26px;
  height: 26px;
  border-radius: 10px;
}

.button-icon-label {
  justify-content: center;
}

.button-icon-label span:last-child,
.summary-label-row span:last-child {
  min-width: 0;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--ink);
}

.filters-actions-panel {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  align-self: end;
}

.filters-feedback {
  grid-column: 1 / -1;
  min-height: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

.filters-feedback.warning {
  color: #8e4d2e;
}

.filters-feedback.loading {
  color: var(--accent);
}

.native-multiselect {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.multi-select {
  position: relative;
}

.multi-select-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: var(--paper-strong);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.multi-select-trigger strong {
  font-size: 0.78rem;
  color: var(--muted);
}

.multi-select-trigger.open {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.multi-select-trigger:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.multi-select-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  z-index: 9999;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-strong);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.multi-select-menu-large {
  width: min(620px, 100%);
  min-width: 100%;
}

.multi-select-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-action {
  border: 0;
  background: rgba(13, 124, 102, 0.08);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.multi-select-menu[hidden] {
  display: none;
}

.multi-select-search input {
  min-height: 44px;
}

.multi-select-options {
  display: grid;
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
  padding-right: 4px;
}

.multi-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fffdf9;
}

.multi-option:hover {
  border-color: rgba(13, 124, 102, 0.18);
  background: rgba(13, 124, 102, 0.04);
}

.multi-option input {
  width: auto;
  margin-top: 3px;
}

.multi-option-copy {
  display: grid;
  gap: 3px;
}

.multi-option-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.multi-option-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.empty-options {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.button-loading {
  opacity: 0.7;
  pointer-events: none;
}

.primary-button,
.secondary-button,
.sort-button {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: var(--ovi-white);
  box-shadow: 0 14px 30px rgba(73, 106, 255, 0.24);
}

.secondary-button {
  background: var(--paper-strong);
  color: var(--ink);
  border: 1px solid var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.sort-button:hover {
  transform: translateY(-1px);
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 156px;
  padding: 18px 18px 16px;
  display: grid;
  gap: 10px;
  align-content: start;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 96%, var(--accent) 4%), color-mix(in srgb, var(--paper-strong) 92%, var(--highlight) 8%));
  box-shadow: var(--shadow);
}

.summary-accent {
  width: 42px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  display: block;
}

.summary-value {
  font-size: clamp(1.4rem, 2vw, 2rem);
  font-family: 'Inter', sans-serif;
  line-height: 1;
}

.summary-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  max-width: 22ch;
}

.summary-label {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
}

.summary-label-row {
  letter-spacing: 0.08em;
}

.summary-card-docs .summary-accent { background: var(--accent); }
.summary-card-compras .summary-accent { background: var(--highlight); }
.summary-card-ventas .summary-accent { background: linear-gradient(90deg, var(--accent), var(--highlight)); }
.summary-card-retenciones .summary-accent { background: color-mix(in srgb, var(--highlight) 70%, var(--accent) 30%); }
.summary-card-anulados .summary-accent { background: color-mix(in srgb, var(--ink) 55%, var(--highlight) 45%); }
.summary-card-reembolsos .summary-accent { background: color-mix(in srgb, var(--accent) 72%, var(--highlight) 28%); }
.summary-card-establecimientos .summary-accent { background: color-mix(in srgb, var(--highlight) 58%, var(--accent) 42%); }
.summary-card-empresas .summary-accent { background: color-mix(in srgb, var(--ink) 50%, var(--accent) 50%); }

.report-meta {
  font-size: 0.92rem;
  line-height: 1.45;
  width: 100%;
}

.report-meta-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 94%, var(--accent) 6%), color-mix(in srgb, var(--paper-soft) 88%, var(--highlight) 12%));
}

.report-meta-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.report-meta-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.report-meta-updated {
  font-size: 0.8rem;
  color: var(--muted);
}

.context-summary {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 600;
  max-width: 90ch;
}

.context-secondary {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.context-details {
  position: relative;
  display: inline-block;
}

.context-details summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.context-details summary::-webkit-details-marker {
  display: none;
}

.context-details-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 15;
  min-width: 320px;
  max-width: 420px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  box-shadow: var(--shadow-strong);
}

.context-details-list span {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.tab-panel {
  display: grid;
  gap: 18px;
}

.table-section {
  display: grid;
  gap: 14px;
}

.pill {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-strong);
  max-width: 100%;
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

thead {
  background: color-mix(in srgb, var(--paper-soft) 82%, var(--accent) 18%);
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.empty-state,
.error-state,
.loading-state {
  border: 1px dashed var(--line);
  border-radius: 22px;
  padding: 34px;
  background: color-mix(in srgb, var(--paper-soft) 72%, transparent);
  color: var(--muted);
}

.error-state {
  border-color: color-mix(in srgb, var(--highlight) 24%, transparent);
  color: var(--ink);
  background: color-mix(in srgb, var(--highlight) 10%, transparent);
}

.compact {
  padding: 20px;
}

.inline-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: rgba(29, 27, 22, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

.purchase-analysis {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.analysis-hero,
.purchase-filters,
.analysis-block,
.chart-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 96%, var(--accent) 4%), color-mix(in srgb, var(--paper-soft) 92%, var(--highlight) 8%));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  min-width: 0;
  max-width: 100%;
}

.analysis-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.purchase-context {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.55;
}

.purchase-filters-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.purchase-filters-grid > * {
  min-width: 0;
}

.purchase-filters-grid .field,
.purchase-filters-grid .toggle-field,
.purchase-filter-actions {
  grid-column: span 4;
}

.purchase-top-field {
  grid-column: span 2;
}

.purchase-filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.purchase-filter-actions .secondary-button {
  width: 100%;
}

.sales-inline-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.field-inline {
  min-width: 180px;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-strong);
  align-self: end;
  min-height: 48px;
}

.toggle-field input {
  width: auto;
  margin: 0;
}

.purchase-kpi-groups {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.purchase-kpi-group {
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 96%, var(--accent) 4%), color-mix(in srgb, var(--paper-soft) 92%, var(--highlight) 8%));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.compact-heading {
  margin-bottom: 0;
}

.group-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.purchase-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.purchase-card {
  min-height: 108px;
  padding: 14px 16px 14px;
  gap: 8px;
}

.charts-grid,
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.chart-card {
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.chart-card-wide {
  min-height: 100%;
}

.purchase-spotlight-grid .chart-card:first-child,
.purchase-spotlight-grid .chart-card:last-child {
  min-height: 100%;
}

.purchase-spotlight-grid-single {
  grid-template-columns: 1fr;
}

.supplier-ranking-list {
  margin-top: 6px;
}

.supplier-ranking-scroll {
  max-height: 660px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.supplier-ranking-scroll::-webkit-scrollbar,
.detail-table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.supplier-ranking-scroll::-webkit-scrollbar-thumb,
.detail-table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 46%, var(--highlight) 54%);
  border-radius: 999px;
}

.detail-table-wrap {
  max-height: 470px;
  overflow: auto;
}

.detail-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--paper-soft) 78%, var(--accent) 22%);
}

.tax-composition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.tax-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper-strong) 88%, var(--accent) 12%);
  min-width: 0;
}

.tax-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.tax-card-header strong,
.tax-card-header span {
  min-width: 0;
  font-size: 0.9rem;
}

.tax-card-header span {
  color: var(--ink);
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tax-card-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper-soft) 80%, var(--accent) 20%);
}

.tax-card-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
}

.tax-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.overview-analytics {
  display: grid;
  gap: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 96%, var(--accent) 4%), color-mix(in srgb, var(--paper-soft) 92%, var(--highlight) 8%));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}

.overview-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 260px));
  gap: 14px;
}

.overview-chart {
  overflow: hidden;
}

.overview-chart-grid {
  position: relative;
  min-width: 0;
  height: 380px;
  padding: 28px 0 0 64px;
  display: grid;
  align-items: stretch;
}

.overview-guide {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed color-mix(in srgb, var(--line) 78%, transparent);
}

.overview-guide span {
  position: absolute;
  left: -64px;
  top: -10px;
  width: 56px;
  text-align: right;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.overview-guide:nth-child(1) { top: 0%; }
.overview-guide:nth-child(2) { top: 25%; }
.overview-guide:nth-child(3) { top: 50%; }
.overview-guide:nth-child(4) { top: 75%; }
.overview-guide:nth-child(5) { top: 100%; }

.overview-bars {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--overview-columns, 1), minmax(0, 1fr));
  align-items: end;
  gap: clamp(8px, 1vw, 16px);
  padding: 0 8px;
}

.overview-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
}

.overview-value {
  text-align: center;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 18px;
}

.overview-bar-track {
  height: 250px;
  width: min(100%, 42px);
  margin: 0 auto;
  background: color-mix(in srgb, var(--paper-soft) 78%, var(--accent) 22%);
  border-radius: 18px 18px 10px 10px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.overview-bar-fill {
  width: 100%;
  min-height: 8px;
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(180deg, var(--highlight), var(--accent));
}

.overview-label {
  text-align: center;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}

.company-comparison {
  display: grid;
  gap: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 96%, var(--accent) 4%), color-mix(in srgb, var(--paper-soft) 92%, var(--highlight) 8%));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}

.company-comparison-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
}

.company-chart-card,
.company-ranking-card,
.insight-card {
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.company-chart-card,
.company-ranking-card {
  min-width: 0;
  overflow: hidden;
}

.company-bars {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.company-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 220px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.company-bar-label,
.company-bar-value {
  font-size: 0.88rem;
  line-height: 1.3;
}

.company-bar-label {
  color: var(--ink);
  font-weight: 700;
}

.company-bar-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.company-bar-track {
  height: 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-soft) 76%, var(--accent) 24%);
  overflow: hidden;
}

.company-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
}

.company-ranking-list {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.company-ranking-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper-strong) 90%, var(--accent) 10%);
}

.company-ranking-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.company-ranking-position {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-soft) 72%, var(--highlight) 28%);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.company-ranking-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.company-ranking-name {
  min-width: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-ranking-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.company-ranking-value {
  min-width: 76px;
  text-align: right;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.insight-text {
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--ink);
}

.bar-chart,
.legend-list {
  display: grid;
  gap: 12px;
}

.timeline-chart {
  display: grid;
  gap: 14px;
}

.timeline-axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.timeline-scroll {
  overflow: hidden;
  padding-bottom: 8px;
}

.timeline-grid {
  position: relative;
  min-width: 0;
  height: 420px;
  padding: 30px 0 0 64px;
  display: grid;
  align-items: stretch;
}

.timeline-guide {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed color-mix(in srgb, var(--line) 78%, transparent);
}

.timeline-guide span {
  position: absolute;
  left: -64px;
  top: -10px;
  width: 56px;
  text-align: right;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.timeline-guide:nth-child(1) { top: 0%; }
.timeline-guide:nth-child(2) { top: 25%; }
.timeline-guide:nth-child(3) { top: 50%; }
.timeline-guide:nth-child(4) { top: 75%; }
.timeline-guide:nth-child(5) { top: 100%; }

.timeline-bars {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--timeline-columns, 1), minmax(0, 1fr));
  align-items: end;
  gap: clamp(4px, 0.7vw, 10px);
  padding: 0 4px;
}

.timeline-bar-wrap {
  display: grid;
  gap: 10px;
  align-items: end;
  height: 100%;
  justify-items: center;
}

.timeline-bar-track {
  height: 300px;
  width: min(100%, 32px);
  background: color-mix(in srgb, var(--paper-soft) 78%, var(--accent) 22%);
  border-radius: 18px 18px 10px 10px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.timeline-bar-fill {
  width: 100%;
  min-height: 6px;
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(180deg, var(--highlight), var(--accent));
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.timeline-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
}

.timeline-label,
.timeline-value {
  font-size: 0.84rem;
}

.timeline-label {
  color: var(--ink);
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  min-height: 38px;
  font-size: 0.76rem;
}

.timeline-value {
  text-align: center;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 700;
  min-height: 18px;
  white-space: nowrap;
}

.timeline-label-day,
.timeline-label-month {
  white-space: normal;
}

.timeline-label-day {
  min-height: 42px;
}

.timeline-label-month {
  min-height: 30px;
}

.compact-value-labels .timeline-value {
  font-size: 0.72rem;
}

.full-value-labels .timeline-value {
  font-size: 0.78rem;
}

.bar-row {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  min-width: 0;
  align-items: baseline;
}

.bar-meta strong,
.bar-meta span {
  min-width: 0;
}

.bar-meta strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-meta span {
  flex-shrink: 0;
}

.bar-meta span,
.legend-copy span {
  color: var(--muted);
}

.bar-track {
  height: 12px;
  background: color-mix(in srgb, var(--paper-soft) 78%, var(--accent) 22%);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
}

.bar-chart.secondary .bar-fill {
  background: linear-gradient(90deg, var(--highlight), color-mix(in srgb, var(--highlight) 40%, var(--ovi-white) 60%));
}

.bar-chart.tertiary .bar-fill {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 82%, var(--ink) 18%), color-mix(in srgb, var(--highlight) 25%, var(--accent) 75%));
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.tone-1 { background: var(--accent); }
.tone-2 { background: var(--highlight); }
.tone-3 { background: color-mix(in srgb, var(--accent) 75%, var(--ink) 25%); }
.tone-4 { background: color-mix(in srgb, var(--highlight) 55%, var(--accent) 45%); }

.legend-copy {
  display: grid;
  gap: 2px;
}

.sort-button {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
}

.sales-analysis {
  gap: 20px;
}

.sales-filters-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 95%, var(--highlight) 5%), color-mix(in srgb, var(--paper-soft) 90%, var(--accent) 10%));
}

.sales-title-row,
.sales-hero-title,
.sales-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sales-title-row,
.sales-hero-title {
  margin: 0;
}

.sales-icon-badge {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--paper-soft) 72%, var(--accent) 28%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
  flex: 0 0 auto;
}

.sales-hero-title .sales-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.sales-icon-wallet,
.sales-icon-receipt,
.sales-icon-target,
.sales-icon-filter,
.sales-icon-refresh,
.sales-icon-rotate {
  color: var(--highlight);
  background: color-mix(in srgb, var(--paper-soft) 68%, var(--highlight) 32%);
}

.sales-icon-tax,
.sales-icon-file,
.sales-icon-table,
.sales-icon-calendar,
.sales-icon-search,
.sales-icon-ban {
  color: color-mix(in srgb, var(--accent) 65%, var(--ink) 35%);
}

.sales-icon-building,
.sales-icon-layers {
  color: color-mix(in srgb, var(--highlight) 52%, var(--ink) 48%);
}

.sales-executive-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sales-executive-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%), color-mix(in srgb, var(--paper-soft) 84%, var(--highlight) 16%));
  box-shadow: var(--shadow);
}

.sales-executive-card-2 {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 90%, var(--highlight) 10%), color-mix(in srgb, var(--paper-soft) 82%, var(--accent) 18%));
}

.sales-executive-card-3 {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 90%, var(--accent) 10%), color-mix(in srgb, var(--paper-soft) 80%, var(--highlight) 20%));
}

.sales-executive-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.sales-executive-metrics {
  display: grid;
  gap: 10px;
}

.sales-executive-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.sales-executive-metric span {
  color: var(--muted);
  font-size: 0.84rem;
}

.sales-metric-label {
  min-width: 0;
}

.sales-metric-label span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sales-executive-metric strong {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.sales-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sales-insight-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
}

.sales-insight-card-2 {
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--highlight) 8%);
}

.sales-insight-card-3 {
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 90%, var(--accent) 10%), color-mix(in srgb, var(--paper-soft) 84%, var(--highlight) 16%));
}

.sales-insight-tag {
  color: var(--muted);
}

.sales-insight-tag .sales-icon-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sales-insight-tag .sales-icon-badge {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.sales-insight-card strong {
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.25;
}

.sales-insight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.88rem;
}

.sales-feature-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: start;
}

.sales-client-featured {
  padding: 24px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 94%, var(--highlight) 6%), color-mix(in srgb, var(--paper-soft) 88%, var(--accent) 12%));
}

.sales-client-featured .supplier-ranking-scroll {
  max-height: 760px;
}

.sales-client-featured .sales-pareto-list {
  gap: 16px;
}

.sales-client-featured .sales-pareto-item {
  padding: 18px 20px;
}

.sales-client-featured .sales-pareto-head {
  align-items: center;
}

.sales-client-featured .sales-pareto-title strong {
  font-size: 1rem;
}

.sales-client-featured .sales-pareto-value strong,
.sales-client-featured .sales-pareto-meta strong {
  font-size: 0.96rem;
}

.sales-client-featured .sales-pareto-bar {
  height: 12px;
}

.sales-line-chart {
  display: grid;
  gap: 16px;
}

.sales-line-shell {
  display: grid;
  gap: 14px;
}

.sales-line-guides {
  display: grid;
  gap: 10px;
}

.sales-line-guide {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.sales-line-stage {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px 18px 14px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--paper-soft) 82%, var(--accent) 18%);
  overflow: hidden;
}

.sales-line-svg {
  width: 100%;
  height: 280px;
  display: block;
}

.sales-line-grid {
  stroke: color-mix(in srgb, var(--line) 72%, transparent);
  stroke-dasharray: 4 6;
}

.sales-line-path {
  fill: none;
  stroke: url(#sales-line-stroke);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sales-line-point {
  fill: var(--paper-strong);
  stroke: var(--highlight);
  stroke-width: 3;
}

.sales-line-labels {
  display: grid;
  grid-template-columns: repeat(var(--sales-columns, 1), minmax(0, 1fr));
  gap: 10px;
}

.sales-line-label {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.sales-line-label strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.sales-line-label span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: normal;
  line-height: 1.25;
}

.sales-pareto-insight {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.5;
  font-weight: 600;
}

.sales-pareto-scroll {
  max-height: 640px;
}

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

.sales-pareto-item {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
}

.sales-pareto-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.sales-pareto-title {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
}

.sales-pareto-rank {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-soft) 70%, var(--highlight) 30%);
  color: var(--ink);
  font-weight: 800;
}

.sales-pareto-title strong,
.sales-retention-copy strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sales-pareto-title span,
.sales-pareto-value span,
.sales-pareto-meta span,
.sales-retention-copy span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.sales-pareto-value {
  text-align: right;
  min-width: 108px;
}

.sales-pareto-value strong,
.sales-pareto-meta strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sales-pareto-bars {
  display: grid;
  gap: 8px;
}

.sales-pareto-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper-soft) 78%, var(--accent) 22%);
}

.sales-pareto-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.sales-pareto-bar-share span {
  background: linear-gradient(90deg, var(--accent), var(--highlight));
}

.sales-pareto-bar-accumulated span {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 75%, var(--ink) 25%), var(--highlight));
}

.sales-pareto-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.sales-retention-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.sales-retention-summary {
  display: grid;
  gap: 12px;
}

.sales-retention-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--highlight) 18%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 91%, var(--highlight) 9%);
}

.sales-retention-badge {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: var(--ovi-white);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sales-retention-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.sales-retention-card em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.84rem;
}

.sales-retention-card strong {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sales-retention-ranking {
  display: grid;
  gap: 12px;
}

.sales-retention-composition,
.sales-retention-client-block {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
}

.sales-retention-composition-head,
.sales-retention-composition-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.sales-retention-composition-head strong,
.sales-retention-composition-meta strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sales-retention-composition-head span,
.sales-retention-composition-meta span {
  color: var(--muted);
  font-size: 0.82rem;
}

.sales-retention-composition-bars {
  display: grid;
  gap: 12px;
}

.sales-retention-composition-row {
  display: grid;
  gap: 8px;
}

.sales-retention-composition-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper-soft) 78%, var(--accent) 22%);
}

.sales-retention-composition-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.sales-retention-composition-track-iva span {
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, var(--highlight) 42%));
}

.sales-retention-composition-track-renta span {
  background: linear-gradient(90deg, var(--highlight), color-mix(in srgb, var(--highlight) 56%, var(--accent) 44%));
}

.sales-retention-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}

.sales-retention-rank {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-soft) 72%, var(--accent) 28%);
  color: var(--ink);
  font-weight: 800;
}

.sales-retention-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.sales-retention-primary,
.sales-retention-secondary {
  display: grid;
  gap: 16px;
}

.sales-retention-impact-card,
.sales-retention-comparison-card,
.sales-retention-client-panel,
.sales-retention-insight-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
}

.sales-retention-impact-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 90%, var(--accent) 10%), color-mix(in srgb, var(--paper-soft) 82%, var(--highlight) 18%));
}

.sales-retention-comparison-card {
  background: color-mix(in srgb, var(--paper-strong) 93%, var(--highlight) 7%);
}

.sales-retention-card-head,
.sales-retention-impact-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.sales-retention-card-head strong,
.sales-retention-impact-head strong {
  color: var(--ink);
  font-size: 1rem;
}

.sales-retention-section-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sales-retention-impact-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ovi-white);
}

.sales-retention-impact-bajo {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, var(--highlight) 38%));
}

.sales-retention-impact-medio {
  background: linear-gradient(135deg, var(--highlight), color-mix(in srgb, var(--highlight) 60%, var(--accent) 40%));
}

.sales-retention-impact-alto {
  background: linear-gradient(135deg, color-mix(in srgb, var(--ink) 52%, var(--accent) 48%), var(--highlight));
}

.sales-retention-impact-value {
  color: var(--ink);
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sales-retention-impact-copy,
.sales-retention-insight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
}

.sales-retention-impact-bars {
  display: grid;
  gap: 10px;
}

.sales-retention-impact-bar-shell {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper-soft) 76%, var(--accent) 24%);
}

.sales-retention-impact-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
}

.sales-retention-impact-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.sales-retention-comparison-stack {
  display: flex;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper-soft) 76%, var(--accent) 24%);
}

.sales-retention-comparison-segment {
  display: block;
  height: 100%;
}

.sales-retention-comparison-iva {
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, var(--highlight) 42%));
}

.sales-retention-comparison-renta {
  background: linear-gradient(90deg, var(--highlight), color-mix(in srgb, var(--highlight) 56%, var(--accent) 44%));
}

.sales-retention-comparison-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sales-retention-comparison-metric {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper-strong) 94%, var(--accent) 6%);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
}

.sales-retention-comparison-metric span,
.sales-retention-comparison-metric em,
.sales-retention-copy span {
  color: var(--muted);
}

.sales-retention-comparison-metric strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sales-retention-comparison-metric em {
  font-style: normal;
  font-size: 0.82rem;
}

.sales-retention-client-scroll {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.sales-retention-client-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}

.sales-retention-client-row em {
  font-style: normal;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.executive-summary-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 93%, var(--accent) 7%);
  box-shadow: var(--shadow);
}

.executive-summary-card-secondary {
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--highlight) 8%);
}

.executive-summary-card-tertiary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%), color-mix(in srgb, var(--paper-soft) 85%, var(--highlight) 15%));
}

.executive-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.executive-summary-label {
  min-width: 0;
}

.executive-summary-card strong {
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.executive-summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.executive-narrative-card {
  gap: 14px;
}

.executive-narrative-copy {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 600;
  max-width: 90ch;
}

.executive-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.executive-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.retention-analysis {
  gap: 20px;
}

.retention-hero,
.retention-filters-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 95%, var(--highlight) 5%), color-mix(in srgb, var(--paper-soft) 88%, var(--accent) 12%));
}

.retention-executive-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 92%, var(--highlight) 8%), color-mix(in srgb, var(--paper-soft) 84%, var(--accent) 16%));
}

.retention-executive-card-2 {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 90%, var(--accent) 10%), color-mix(in srgb, var(--paper-soft) 84%, var(--highlight) 16%));
}

.retention-executive-card-3 {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 90%, var(--highlight) 10%), color-mix(in srgb, var(--paper-soft) 82%, var(--accent) 18%));
}

.retention-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.retention-feature-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: start;
}

.retention-analysis-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.retention-composition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.retention-composition-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
}

.retention-composition-card strong,
.retention-timeline-head strong,
.retention-timeline-head span {
  color: var(--ink);
}

.retention-composition-card span,
.retention-composition-card em,
.retention-timeline-meta span {
  font-size: 0.84rem;
}

.retention-composition-card em,
.retention-timeline-meta span {
  color: var(--muted);
  font-style: normal;
}

.retention-timeline-card {
  display: grid;
  gap: 16px;
}

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

.retention-timeline-item {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
}

.retention-timeline-head,
.retention-timeline-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.retention-timeline-head strong,
.retention-timeline-head span {
  font-size: 0.92rem;
  font-weight: 800;
}

.retention-timeline-stack {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper-soft) 78%, var(--accent) 22%);
}

.retention-timeline-stack span {
  display: block;
  height: 100%;
}

.retention-stack-air {
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 62%, var(--highlight) 38%));
}

.retention-stack-iva-bienes {
  background: linear-gradient(90deg, var(--highlight), color-mix(in srgb, var(--highlight) 62%, var(--accent) 38%));
}

.retention-stack-iva-servicios {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, var(--ink) 45%), var(--highlight));
}

.retention-stack-otros {
  background: color-mix(in srgb, var(--ink) 60%, var(--highlight) 40%);
}

.retention-provider-scroll,
.retention-code-scroll {
  max-height: 640px;
}

.retention-main-visual,
.retention-provider-card,
.retention-support-card,
.retention-composition-card-shell,
.retention-narrative-card,
.reimbursement-narrative-card,
.voided-narrative-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 94%, var(--accent) 6%), color-mix(in srgb, var(--paper-soft) 88%, var(--highlight) 12%));
}

.retention-composition-main {
  gap: 16px;
}

.retention-main-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 78ch;
}

.retention-main-hero {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  background: color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%);
}

.retention-main-total {
  display: grid;
  gap: 6px;
}

.retention-main-total span,
.retention-main-total em {
  color: var(--muted);
}

.retention-main-total strong {
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.retention-main-total em {
  font-style: normal;
  font-size: 0.88rem;
}

.retention-main-stack {
  display: flex;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper-soft) 78%, var(--accent) 22%);
}

.retention-main-stack-segment {
  display: block;
  height: 100%;
}

.retention-main-stack-segment.tone-1 {
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 62%, var(--highlight) 38%));
}

.retention-main-stack-segment.tone-2 {
  background: linear-gradient(90deg, var(--highlight), color-mix(in srgb, var(--highlight) 62%, var(--accent) 38%));
}

.retention-main-stack-segment.tone-3 {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, var(--ink) 45%), var(--highlight));
}

.retention-main-stack-segment.tone-4 {
  background: color-mix(in srgb, var(--ink) 60%, var(--highlight) 40%);
}

.reimbursement-analysis,
.voided-analysis {
  gap: 20px;
}

.reimbursement-hero,
.reimbursement-filters-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 95%, var(--accent) 5%), color-mix(in srgb, var(--paper-soft) 88%, var(--highlight) 12%));
}

.voided-hero,
.voided-filters-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 95%, var(--ink) 5%), color-mix(in srgb, var(--paper-soft) 88%, var(--highlight) 12%));
}

.reimbursement-executive-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 92%, var(--accent) 8%), color-mix(in srgb, var(--paper-soft) 84%, var(--highlight) 16%));
}

.reimbursement-executive-card-2 {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 90%, var(--highlight) 10%), color-mix(in srgb, var(--paper-soft) 82%, var(--accent) 18%));
}

.reimbursement-executive-card-3,
.voided-executive-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 90%, var(--ink) 10%), color-mix(in srgb, var(--paper-soft) 84%, var(--highlight) 16%));
}

.voided-executive-card-2 {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-strong) 90%, var(--highlight) 10%), color-mix(in srgb, var(--paper-soft) 84%, var(--ink) 16%));
}

.reimbursement-insight-grid,
.voided-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.reimbursement-feature-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: start;
}

.voided-feature-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  align-items: start;
}

.reimbursement-analysis-grid,
.voided-analysis-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reimbursement-ranking-scroll,
.voided-ranking-scroll {
  max-height: 640px;
}

@media (max-width: 1220px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-status {
    justify-content: flex-start;
  }

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

  .field-wide,
  .filters-feedback,
  .filters-actions-panel {
    grid-column: 1 / -1;
  }

  .filters-actions-panel {
    justify-content: flex-start;
  }

  .summary-cards,
  .purchase-kpi-grid,
  .charts-grid,
  .analysis-grid,
  .purchase-filters-grid,
  .tax-composition-grid,
  .retention-composition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-executive-panel,
  .executive-summary-grid,
  .sales-insight-grid,
  .sales-feature-grid,
  .sales-retention-layout,
  .sales-retention-dashboard,
  .retention-insight-grid,
  .retention-feature-grid,
  .retention-analysis-grid,
  .reimbursement-insight-grid,
  .voided-insight-grid,
  .reimbursement-feature-grid,
  .voided-feature-grid,
  .reimbursement-analysis-grid,
  .voided-analysis-grid {
    grid-template-columns: 1fr;
  }

  .analysis-hero {
    grid-template-columns: 1fr;
  }

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

  .company-comparison-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .purchase-filters-grid .field,
  .purchase-filters-grid .toggle-field,
  .purchase-filter-actions {
    grid-column: span 6;
  }

  .purchase-top-field {
    grid-column: span 6;
  }

  .timeline-grid {
    height: 380px;
    padding-left: 58px;
    padding-top: 28px;
  }
}

@media (max-width: 720px) {
  .auth-screen {
    padding: 16px;
  }

  .auth-card {
    padding: 28px 22px 24px;
  }

  .auth-card h1 {
    font-size: 1.7rem;
  }

  .app-layout {
    width: min(100% - 16px, 1600px);
    margin: 8px auto 20px;
  }

  .sidebar,
  .hero,
  .filters-panel,
  .summary-panel,
  .tabs-panel {
    padding: 20px;
    border-radius: 22px;
  }

  .hero {
    padding: 16px 18px;
  }

  .status-card {
    width: 100%;
    justify-content: space-between;
    border-radius: 18px;
  }

  .summary-cards,
  .purchase-kpi-grid,
  .executive-summary-grid,
  .charts-grid,
  .analysis-grid,
  .purchase-filters-grid,
  .tax-composition-grid,
  .retention-composition-grid,
  .retention-insight-grid,
  .reimbursement-insight-grid,
  .voided-insight-grid,
  .overview-controls {
    grid-template-columns: 1fr;
  }

  .sales-line-labels {
    gap: 6px;
  }

  .sales-pareto-head,
  .sales-retention-layout,
  .sales-executive-head {
    grid-template-columns: 1fr;
  }

  .sales-pareto-head {
    display: grid;
  }

  .sales-retention-comparison-metrics {
    grid-template-columns: 1fr;
  }

  .sales-retention-client-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .sales-pareto-value {
    text-align: left;
  }

  .overview-chart-grid {
    height: 340px;
    padding-left: 50px;
  }

  .company-bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .company-bar-value {
    text-align: left;
  }

  .company-ranking-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .company-ranking-value {
    text-align: left;
    padding-left: 46px;
  }

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

  .field-wide,
  .filters-feedback,
  .filters-actions-panel {
    grid-column: auto;
  }

  .filters-actions-panel {
    flex-direction: column;
  }

  .filters-actions-panel .primary-button,
  .filters-actions-panel .secondary-button,
  .multi-select-menu-large {
    width: 100%;
  }

  .purchase-filters-grid .field,
  .purchase-filters-grid .toggle-field,
  .purchase-top-field,
  .purchase-filter-actions {
    grid-column: auto;
  }

  .timeline-axis {
    display: grid;
  }

  .timeline-grid {
    height: 340px;
    padding-left: 50px;
    padding-top: 24px;
  }

  table {
    min-width: 760px;
  }
}
