:root {
  --color-primary: #0078d4;
  --color-primary-dark: #005a9e;
  --color-bg: #f7f9fc;
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --color-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Aptos, "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background:
    radial-gradient(circle at top left, rgba(0, 120, 212, 0.08), transparent 26%),
    radial-gradient(circle at right center, rgba(0, 120, 212, 0.06), transparent 24%),
    linear-gradient(180deg, #fbfcfe 0%, var(--color-bg) 100%);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
  background: none;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100vh - 48px);
  padding: 24px 18px;
  border: 1px solid rgba(229, 231, 235, 0.85);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--color-shadow);
  backdrop-filter: blur(24px);
}

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

.brand__mark {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 54px;
  height: 54px;
  padding: 9px;
  border-radius: 18px;
  background: linear-gradient(145deg, #e6f4ff, #fefeff);
  box-shadow: inset 0 0 0 1px rgba(0, 120, 212, 0.1);
}

.brand__mark span {
  border-radius: 4px;
  background: linear-gradient(180deg, #2da8ff, var(--color-primary));
}

.brand h1,
.hero h2,
.panel h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

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

.nav__item {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--color-text-muted);
  transition: 0.2s ease;
}

.nav__item:hover,
.nav__item--active {
  color: var(--color-surface);
  background: linear-gradient(135deg, var(--color-primary), #35a1f3);
  box-shadow: 0 12px 24px rgba(0, 120, 212, 0.22);
}

.nav__icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.nav__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.sidebar__footer {
  padding-top: 20px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: 18px;
  background: rgba(247, 249, 252, 0.72);
}

.user-card__avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--color-primary-dark);
  font-weight: 700;
  background: linear-gradient(145deg, #d8ecff, #ffffff);
}

.user-card strong,
.user-card span {
  display: block;
}

.user-card span {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.text-link--logout {
  margin-left: auto;
  white-space: nowrap;
}

.workspace {
  display: grid;
  gap: 24px;
  padding-bottom: 24px;
}

.hero,
.panel,
.stat-card {
  border: 1px solid rgba(229, 231, 235, 0.85);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--color-shadow-soft);
  backdrop-filter: blur(18px);
}

.hero {
  overflow: hidden;
}

.hero__toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 28px;
}

.hero h2 {
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.05;
}

.hero__subtitle {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 360px);
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(247, 249, 252, 0.9);
}

.search svg,
.icon-button svg {
  width: 20px;
  height: 20px;
}

.search input {
  width: 100%;
  height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
}

.button,
.text-button,
.icon-button {
  transition: 0.2s ease;
}

.button {
  padding: 0 18px;
  height: 48px;
  border-radius: 16px;
  font-weight: 600;
}

.button--primary {
  color: var(--color-surface);
  background: linear-gradient(135deg, var(--color-primary), #38a4f5);
  box-shadow: 0 14px 24px rgba(0, 120, 212, 0.22);
}

.button--ghost,
.button--secondary {
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.92);
}

.button:hover,
.text-button:hover,
.icon-button:hover,
.nav__item:hover {
  transform: translateY(-1px);
}

.hero__panel {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 18px;
  padding: 0 28px 28px;
}

.hero__panel::before {
  content: "";
  position: absolute;
  inset: auto -10% -50px auto;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 120, 212, 0.16), transparent 62%);
  pointer-events: none;
}

.hero__copy {
  position: relative;
  z-index: 1;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(240, 247, 255, 0.86)),
    linear-gradient(90deg, rgba(0, 120, 212, 0.06), transparent);
  min-height: 220px;
}

.hero__copy h3 {
  max-width: 12ch;
  margin: 18px 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.02;
}

.hero__copy p {
  max-width: 56ch;
  margin: 0;
  color: var(--color-text-muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--color-primary-dark);
  background: rgba(0, 120, 212, 0.1);
}

.status-pill__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.hero__highlights {
  display: grid;
  gap: 16px;
}

.spotlight-card {
  min-height: 102px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(160deg, #f9fbff, #edf5fe);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.spotlight-card--accent {
  color: #fff;
  background: linear-gradient(150deg, var(--color-primary-dark), #0f86e1 58%, #56baf7);
}

.hero--sales .hero__copy {
  min-height: 204px;
}

#incentivesPage .hero__copy h3 {
  max-width: 30ch;
  font-size: clamp(1.45rem, 1.8vw, 2rem);
  line-height: 1.12;
}

.hero--config {
  padding-bottom: 0;
}

.hero--compact .hero__toolbar {
  align-items: center;
  padding-top: 18px;
  padding-bottom: 18px;
  min-height: 0;
}

.hero--compact .hero__subtitle {
  max-width: 58ch;
  margin-top: 6px;
}

#homologadorPage .hero__subtitle {
  max-width: 50ch;
}

#homologadorPage .hero {
  align-self: start;
  min-height: 0;
  height: auto;
}

#homologadorPage .hero__toolbar {
  align-items: center;
  padding-top: 18px;
  padding-bottom: 18px;
}

#homologadorPage {
  align-content: start;
  grid-auto-rows: min-content;
}

.homologador-panel {
  min-height: 68vh;
  align-self: start;
}

.hero--compact .eyebrow {
  margin-bottom: 4px;
}

.hero--compact h2 {
  font-size: clamp(1.9rem, 3vw, 2.9rem);
}

.hero__panel--sales {
  grid-template-columns: 1.15fr 0.85fr;
}

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

.spotlight-card__label,
.stat-card__label,
.report-card p,
.compare-item span,
.alert-item p,
table {
  color: var(--color-text-muted);
}

.spotlight-card strong,
.stat-card strong,
.report-card strong,
.compare-item strong {
  display: block;
  margin-top: 8px;
}

.panel {
  padding: 24px;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.text-button {
  padding: 10px 0;
  color: var(--color-primary);
  font-weight: 600;
}

.filters-grid,
.stats-grid,
.reports-grid,
.insights-grid {
  display: grid;
  gap: 18px;
}

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

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

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

.field select {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  color: var(--color-text);
  background: #fff;
  outline: none;
}

.field--wide {
  grid-column: span 1;
}

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

.stats-grid--sales {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sales-table-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: clamp(360px, 58vh, 720px);
  min-height: 0;
  align-content: start;
  overflow: hidden;
}

.sales-table-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.search--sales {
  max-width: 420px;
}

.sales-table-wrap {
  min-height: 0;
  overflow: auto;
}

.sales-table {
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.sales-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.98);
}

.sales-table th,
.sales-table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.sales-table td {
  vertical-align: middle;
  line-height: 1.3;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(229, 231, 235, 0.9);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.sales-table td:first-child {
  border-left: 1px solid rgba(229, 231, 235, 0.9);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.sales-table td:last-child {
  border-right: 1px solid rgba(229, 231, 235, 0.9);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.sales-table__cell--numeric {
  width: 86px;
  min-width: 86px;
  text-align: right;
  font-variant-numeric: tabular-nums;
 }

.sales-table__cell--vigency {
  min-width: 132px;
  padding-left: 16px;
  padding-right: 16px;
}

.sales-table th:nth-child(1),
.sales-table td:nth-child(1) {
  width: 240px;
}

.sales-table th:nth-child(2),
.sales-table td:nth-child(2) {
  width: 160px;
}

.sales-table th:nth-child(3),
.sales-table td:nth-child(3) {
  width: 150px;
}

.sales-table th:nth-child(4),
.sales-table td:nth-child(4),
.sales-table th:nth-child(5),
.sales-table td:nth-child(5),
.sales-table th:nth-child(6),
.sales-table td:nth-child(6),
.sales-table th:nth-child(7),
.sales-table td:nth-child(7) {
  width: 120px;
}

.stat-card {
  padding: 22px;
}

.stat-card strong {
  font-size: 1.8rem;
  line-height: 1;
}

.stat-card p {
  margin: 10px 0 0;
}

.stat-card--delta {
  background: linear-gradient(160deg, #fdfefe, #eef7ff);
}

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

.report-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.95)),
    linear-gradient(140deg, rgba(0, 120, 212, 0.04), transparent);
}

.report-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.report-card__icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  font-size: 0.92rem;
  font-weight: 700;
}

.report-card__icon--blue {
  background: linear-gradient(145deg, #dcefff, #f4faff);
  color: var(--color-primary);
}

.report-card__icon--sky {
  background: linear-gradient(145deg, #d9f2ff, #effaff);
  color: #008acb;
}

.report-card__icon--indigo {
  background: linear-gradient(145deg, #e0e8ff, #f3f6ff);
  color: #4f46e5;
}

.report-card__icon--mint {
  background: linear-gradient(145deg, #ddfbf1, #effcf7);
  color: #0f9f75;
}

.report-card__icon--amber {
  background: linear-gradient(145deg, #fff0d6, #fff8ea);
  color: #b7791f;
}

.report-card__icon--rose {
  background: linear-gradient(145deg, #ffe3eb, #fff3f7);
  color: #d63384;
}

.report-card__icon--slate {
  background: linear-gradient(145deg, #e9eef7, #f8fbff);
  color: #475569;
}

.report-card h4 {
  margin: 0;
  font-size: 1.1rem;
}

.report-card p {
  margin: 0;
  min-height: 48px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--color-text-muted);
}

.icon-button--ghost {
  border: 1px solid rgba(229, 231, 235, 0.8);
}

.icon-button--mobile {
  display: none;
  border: 1px solid rgba(229, 231, 235, 0.8);
  background: rgba(255, 255, 255, 0.9);
}

.insights-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.insights-grid--sales {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.chart-panel {
  grid-row: span 2;
}

.sales-breakdown,
.sales-timeline {
  overflow: hidden;
}

.split-metric {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: center;
}

.split-metric__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--color-primary) 0 68%, #dceeff 68% 100%);
}

.split-metric__ring::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #fff;
}

.split-metric__core {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  text-align: center;
}

.split-metric__core strong {
  font-size: 2rem;
  line-height: 1;
}

.split-metric__core span,
.split-metric__legend span,
.timeline__item p {
  color: var(--color-text-muted);
}

.split-metric__legend {
  display: grid;
  gap: 14px;
}

.split-metric__legend div {
  padding: 16px;
  border-radius: 18px;
  background: #f9fbfe;
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 14px;
  padding: 0 0 0 4px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 28px;
  bottom: -18px;
  width: 2px;
  background: #d9e8f8;
}

.timeline__item:last-child::before {
  display: none;
}

.timeline__dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 8px rgba(0, 120, 212, 0.08);
}

.timeline__dot--muted {
  background: #78bff1;
}

.timeline__dot--warning {
  background: #f59e0b;
  box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.12);
}

.timeline__item p {
  margin: 6px 0 0;
}

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

.config-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.config-card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.85);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--color-shadow-soft);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.config-card__media {
  height: 220px;
}

.config-card__content {
  padding: 22px 24px 26px;
}

.config-card__tag {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
  background: rgba(255, 255, 255, 0.72);
}

.config-card h3 {
  margin: 0 0 10px;
  font-size: 1.55rem;
}

.config-card p {
  margin: 0;
  max-width: 42ch;
  color: var(--color-text-muted);
}

.config-card--link:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.1);
}

.config-card--blue .config-card__media {
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.45), transparent 18%),
    linear-gradient(120deg, #dff0ff 0%, #8cd0ff 38%, #187fd9 100%);
}

.config-card--sunset .config-card__media {
  background:
    radial-gradient(circle at 78% 30%, rgba(255, 255, 255, 0.38), transparent 16%),
    linear-gradient(120deg, #ffdce6 0%, #ff92a6 36%, #ff7b2f 100%);
}

.config-card--mint .config-card__media {
  background:
    radial-gradient(circle at 24% 30%, rgba(255, 255, 255, 0.42), transparent 18%),
    linear-gradient(120deg, #e2fff6 0%, #8fe8cb 38%, #2da88c 100%);
}

.config-card--violet .config-card__media {
  background:
    radial-gradient(circle at 70% 24%, rgba(255, 255, 255, 0.4), transparent 18%),
    linear-gradient(120deg, #efe6ff 0%, #c9b6ff 40%, #7b6cf2 100%);
}

.catalog-panel__status,
.catalog-form__message {
  margin: 0;
  color: var(--color-text-muted);
}

#catalogPage {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 48px);
}

.catalog-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 80vh;
  align-content: start;
}

.catalog-panel__tools,
.catalog-panel__actions,
.button--icon {
  display: flex;
  align-items: center;
}

.catalog-panel__tools {
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.catalog-panel__actions {
  gap: 12px;
  flex-wrap: wrap;
}

.button--icon {
  gap: 10px;
  justify-content: center;
  width: 48px;
  min-width: 48px;
  padding: 0;
}

.button--icon svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.catalog-panel__status.is-error,
.catalog-form__message.is-error {
  color: #b91c1c;
}

.catalog-panel__status.is-success,
.catalog-form__message.is-success {
  color: #15803d;
}

.catalog-panel__status.is-warning,
.catalog-form__message.is-warning {
  color: #a16207;
}

.catalog-toolbar {
  margin-bottom: 14px;
}

.search--catalog {
  max-width: 420px;
}

.catalog-table th:last-child,
.catalog-table td:last-child {
  text-align: right;
}

.catalog-col--marca {
  width: 20%;
}

.catalog-col--tipo {
  width: 12%;
}

.catalog-col--descripcion {
  width: 38%;
}

.catalog-col--modelo {
  width: 14%;
}

.catalog-col--acciones {
  width: 96px;
}

.catalog-table th,
.catalog-table td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.catalog-table th {
  font-size: 0.84rem;
}

.catalog-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--color-text);
}

.catalog-sort::after {
  content: "↕";
  font-size: 0.82rem;
  color: #94a3b8;
}

.catalog-sort.is-asc::after {
  content: "↑";
  color: var(--color-primary);
}

.catalog-sort.is-desc::after {
  content: "↓";
  color: var(--color-primary);
}

.catalog-table td {
  vertical-align: middle;
  line-height: 1.18;
}

.catalog-table th:nth-child(1),
.catalog-table td:nth-child(1),
.catalog-table th:nth-child(2),
.catalog-table td:nth-child(2),
.catalog-table th:nth-child(4),
.catalog-table td:nth-child(4) {
  white-space: nowrap;
}

.catalog-table th:nth-child(3),
.catalog-table td:nth-child(3) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-table th:nth-child(4),
.catalog-table td:nth-child(4) {
  white-space: nowrap;
}

.catalog-panel .table-wrap {
  height: auto;
  min-height: 0;
  align-self: start;
  overflow: auto;
}

.catalog-table__actions {
  display: inline-flex;
  gap: 10px;
  justify-content: flex-end;
}

.catalog-table__actions .button--icon {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 12px;
}

.catalog-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  background: #eaf4ff;
}

.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
}

.catalog-pagination__summary,
.catalog-pagination__page {
  margin: 0;
  color: var(--color-text-muted);
}

.catalog-pagination__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.homologador-source {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.95));
}

.homologador-source__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.homologador-source__name {
  margin: 0;
  font-size: 1.2rem;
}

.homologador-source__meta,
.homologador-source__description {
  margin: 0;
  color: var(--color-text-muted);
}

.homologador-source__actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.homologador-source__pill {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: #eaf4ff;
}

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

.month-card {
  display: grid;
  gap: 6px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 20px;
  text-align: left;
  color: var(--color-text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.95));
  box-shadow: var(--color-shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.month-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
}

.month-card__action {
  display: grid;
  gap: 6px;
  align-items: start;
  justify-items: start;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.month-card__action--incentivos {
  padding-top: 6px;
  border-top: 1px solid rgba(229, 231, 235, 0.9);
}

.month-card__action--incentivos .upventas-year-chip {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: var(--color-surface);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.18);
}

.month-card__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--color-primary);
  background: #eaf4ff;
}

.month-card strong {
  font-size: 1rem;
}

.month-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.upventas-header-meta {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.upventas-years {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.upventas-year-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--color-text);
  background: #f8fbff;
}

.upventas-year-chip.is-active {
  color: var(--color-surface);
  background: linear-gradient(135deg, var(--color-primary), #35a1f3);
  box-shadow: 0 10px 20px rgba(0, 120, 212, 0.18);
}

.month-card.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.month-card.is-disabled:hover {
  transform: none;
  box-shadow: none;
}

.upventas-results {
  align-self: start;
}

.upventas-results-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  max-height: calc(100vh - 300px);
}

.upventas-panel-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upventas-table {
  min-width: max-content;
}

.upventas-table th,
.upventas-table td {
  padding-left: 16px;
  padding-right: 16px;
}

.upventas-table th:nth-child(1),
.upventas-table td:nth-child(1) {
  min-width: 110px;
}

.upventas-table th:nth-child(2),
.upventas-table td:nth-child(2) {
  min-width: 82px;
}

.upventas-table th:nth-child(3),
.upventas-table td:nth-child(3) {
  min-width: 340px;
}

.upventas-table th:nth-child(4),
.upventas-table td:nth-child(4) {
  min-width: 140px;
}

.upventas-table th:nth-child(5),
.upventas-table td:nth-child(5) {
  min-width: 280px;
}

.upventas-table th:nth-child(n + 6),
.upventas-table td:nth-child(n + 6) {
  min-width: 110px;
  text-align: center;
}

.upventas-table th:nth-child(1),
.upventas-table td:nth-child(1),
.upventas-table th:nth-child(2),
.upventas-table td:nth-child(2),
.upventas-table th:nth-child(4),
.upventas-table td:nth-child(4) {
  white-space: nowrap;
}

.upventas-table td {
  vertical-align: middle;
}

.upventas-results-panel .table-wrap {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  border-radius: 20px;
}

.upventas-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: inset 0 -1px 0 rgba(229, 231, 235, 0.9);
}

.upventas-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.upventas-status-pill--ok {
  color: #166534;
  background: #dcfce7;
}

.upventas-status-pill--missing {
  color: #b91c1c;
  background: #fee2e2;
}

.upventas-table__empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--color-text-muted);
}

#incentivosPage .upventas-table {
  font-size: 0.82rem;
}

#incentivosPage .upventas-table th,
#incentivosPage .upventas-table td {
  padding-left: 12px;
  padding-right: 12px;
  white-space: normal;
  vertical-align: top;
}

#incentivosPage .upventas-table th:nth-child(1),
#incentivosPage .upventas-table td:nth-child(1) {
  min-width: 190px;
}

#incentivosPage .upventas-table th:nth-child(2),
#incentivosPage .upventas-table td:nth-child(2) {
  min-width: 96px;
  white-space: nowrap;
}

#incentivosPage .upventas-table th:nth-child(n + 3),
#incentivosPage .upventas-table td:nth-child(n + 3) {
  min-width: 128px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(6px);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 32px));
  margin: 6vh auto 0;
  padding: 24px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--color-shadow);
}

.modal__dialog--small {
  width: min(460px, calc(100vw - 32px));
}

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

.modal__header h3 {
  margin: 0;
}

.catalog-form {
  display: grid;
  gap: 16px;
}

.catalog-delete__text {
  margin: 0 0 22px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.catalog-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

body.modal-open {
  overflow: hidden;
}

.chart-legend {
  display: flex;
  gap: 16px;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

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

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--color-primary);
}

.legend-swatch--light {
  background: #9fd3ff;
}

.chart {
  height: 100%;
  min-height: 320px;
  padding: 12px 8px 4px;
}

.chart__bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 18px;
  height: 100%;
  padding: 24px 6px 6px;
  border-radius: 24px;
  background:
    linear-gradient(to top, rgba(229, 231, 235, 0.7) 1px, transparent 1px) 0 100% / 100% 25%,
    linear-gradient(180deg, #fbfdff, #f4f8fc);
}

.bar-group {
  display: grid;
  justify-items: center;
  align-items: end;
  grid-template-columns: repeat(2, 18px);
  gap: 6px;
  height: 100%;
}

.bar {
  align-self: end;
  width: 18px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #32a4f8, var(--color-primary));
}

.bar--target {
  background: linear-gradient(180deg, #dceeff, #9fd3ff);
}

.bar-group span {
  grid-column: 1 / -1;
  margin-top: 10px;
  color: var(--color-text-muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 0;
  text-align: left;
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

th {
  color: var(--color-text);
  font-size: 0.88rem;
}

.compare-list,
.alerts-list {
  display: grid;
  gap: 14px;
}

.compare-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: #f9fbfe;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eef8;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary-dark), #3db0ff);
}

.alert-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 18px;
  background: #f9fbfe;
}

.alert-item__tone {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border-radius: 50%;
}

.alert-item__tone--warning {
  background: #f59e0b;
}

.alert-item__tone--info {
  background: #0ea5e9;
}

.alert-item__tone--success {
  background: #22c55e;
}

.alert-item p {
  margin: 6px 0 0;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: 0.2s ease;
}

body.sidebar-open .backdrop {
  opacity: 1;
  visibility: visible;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
  gap: 28px;
  width: min(1200px, 100%);
  min-height: calc(100vh - 48px);
}

.auth-showcase,
.auth-card {
  border: 1px solid rgba(229, 231, 235, 0.85);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--color-shadow);
  backdrop-filter: blur(20px);
}

.auth-showcase {
  position: relative;
  overflow: hidden;
  padding: 32px;
  display: grid;
  align-items: center;
  background:
    radial-gradient(circle at top left, rgba(0, 120, 212, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.9));
}

.auth-showcase__panel {
  position: relative;
  z-index: 1;
  max-width: 580px;
  width: 100%;
  min-height: 100%;
  padding-top: clamp(240px, 34vw, 360px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-showcase__logo {
  position: absolute;
  top: clamp(4px, 1vw, 12px);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(300px, 42vw, 460px);
  height: auto;
  object-fit: contain;
  object-position: center top;
}

.auth-showcase h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 4.6rem);
  line-height: 0.98;
}

.auth-showcase p {
  max-width: 52ch;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.auth-highlights {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

.auth-highlight {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.auth-highlight strong,
.auth-highlight span {
  display: block;
}

.auth-highlight span {
  margin-top: 6px;
  color: var(--color-text-muted);
}

.auth-card-wrap {
  display: grid;
  align-items: center;
}

.auth-card {
  padding: 32px;
}

.auth-brand {
  margin-bottom: 16px;
}

.auth-brand__logo {
  width: 110px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.auth-card h2 {
  margin: 0;
  font-size: 2rem;
}

.auth-card__subtitle {
  margin: 0 0 24px;
  color: var(--color-text-muted);
}

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

.auth-form__message {
  min-height: 1.2rem;
  margin: -4px 0 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.auth-form__message.is-error {
  color: #b91c1c;
}

.auth-form__message.is-success {
  color: #15803d;
}

.text-input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.96);
  color: var(--color-text);
}

.auth-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-muted);
}

.text-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-form__submit {
  width: 100%;
}

@media (max-width: 1280px) {
  .filters-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .hero__toolbar,
  .hero__panel,
  .insights-grid {
    grid-template-columns: 1fr;
  }

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

  .split-metric {
    grid-template-columns: 1fr;
  }

  .hero__actions {
    justify-content: flex-start;
  }
}

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

  .auth-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    min-height: calc(100vh - 32px);
    align-items: stretch;
  }

  .auth-card-wrap {
    align-items: stretch;
  }

  .auth-card {
    height: 100%;
  }

  .auth-showcase__panel {
    padding-top: 132px;
  }

  .auth-showcase__logo {
    top: 20px;
    width: 260px;
  }

  .sidebar {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 20;
    width: min(320px, calc(100vw - 32px));
    height: calc(100vh - 32px);
    transform: translateX(-115%);
    transition: transform 0.24s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .icon-button--mobile {
    display: inline-grid;
  }

  .hero__toolbar {
    grid-template-columns: auto 1fr;
  }

  .hero__actions {
    grid-column: 1 / -1;
  }

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

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

  .workspace {
    gap: 18px;
  }

  .hero__toolbar,
  .hero__panel,
  .panel {
    padding: 20px;
  }

  .filters-grid,
  .stats-grid,
  .reports-grid,
  .insights-grid,
  .month-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid--sales {
    grid-template-columns: 1fr;
  }

  .split-metric__ring {
    width: 180px;
    height: 180px;
  }

  .search {
    min-width: 100%;
  }

  .button,
  .search input {
    height: 46px;
  }

  .catalog-form__actions {
    flex-direction: column-reverse;
  }

  .catalog-panel__tools {
    width: 100%;
    justify-content: flex-start;
  }

  .catalog-panel__actions {
    width: 100%;
  }

  .catalog-pagination {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .modal__dialog {
    margin-top: 16px;
    padding: 20px;
  }

  .auth-page {
    padding: 16px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    justify-items: center;
  }

  .auth-showcase {
    display: none;
  }

  .auth-card-wrap {
    width: 100%;
    justify-items: center;
  }

  .auth-card {
    width: min(100%, 420px);
  }

  .auth-showcase,
  .auth-card {
    padding: 24px;
  }

  .auth-card h2 {
    font-size: 1.7rem;
    white-space: nowrap;
  }

  .auth-form__row {
    flex-direction: column;
    align-items: flex-start;
  }
}
