/* —— Dashboard compacto: mes+hoy fusionados; gráficas visibles al entrar —— */
.dash-fit,
.dash-page {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: auto;
  max-height: none;
  overflow: visible;
  padding-bottom: 8px;
}

@media (min-width: 901px) {
  .dash-fit,
  .dash-page {
    min-height: calc(100dvh - var(--header-h) - 28px);
  }

  .dash-fit__charts,
  .dash-page__charts,
  .charts-grid.dash-fit__charts {
    flex: 1 1 auto;
    min-height: 260px;
  }

  .dash-fit__charts .chart-wrap,
  .dash-page__charts .chart-wrap,
  .charts-grid .chart-wrap {
    height: clamp(220px, 32vh, 320px);
    min-height: 220px;
    max-height: 320px;
  }

  .dash-fit__charts .chart-wrap--pie,
  .dash-page__charts .chart-wrap--pie,
  .charts-grid .chart-wrap--pie {
    height: clamp(200px, 30vh, 280px);
    min-height: 200px;
    max-height: 280px;
  }
}

.dash-fit .card:hover,
.dash-page .card:hover {
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 14%, var(--gray-200));
}

.dash-fit__head,
.dash-page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.dash-fit__sub,
.dash-page__sub {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--gray-600);
}

.dash-life {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid color-mix(in srgb, var(--gray-200) 90%, transparent);
  font-size: 0.72rem;
  color: var(--gray-600);
  box-shadow: none;
}

.dash-life__lab {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-400);
}

.dash-life b,
.dash-life span:not(.dash-life__lab) {
  font-weight: 700;
  color: var(--gray-800);
}

.kpi-grid--5 {
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  flex: 0 0 auto;
}

.dash-fit .kpi,
.dash-page .kpi,
.kpi--compact {
  padding: 8px 10px 7px;
  background: var(--surface-elevated);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--gray-200) 85%, transparent);
}

.kpi__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 1.1em;
}

.dash-fit .kpi__label,
.dash-page .kpi__label,
.kpi--compact .kpi__label {
  font-size: 0.62rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  margin: 0;
}

.dash-fit .kpi__value,
.dash-page .kpi__value,
.kpi--compact .kpi__value {
  font-size: 1.05rem;
  margin-top: 2px;
  line-height: 1.15;
}

.dash-fit .kpi__hint,
.dash-page .kpi__hint {
  display: none;
}

.dash-fit .kpi__delta,
.dash-page .kpi__delta,
.kpi--compact .kpi__delta {
  font-size: 0.62rem;
  margin-top: 0;
  line-height: 1.1;
  white-space: nowrap;
  flex-shrink: 0;
}

.kpi__main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  min-width: 0;
}

.kpi__main-left {
  min-width: 0;
  flex: 1 1 auto;
}

.kpi--split .kpi__value {
  margin-top: 0;
}

.kpi__sub {
  margin-top: 2px;
  font-size: 0.55rem;
  line-height: 1.2;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.kpi__break {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-top: 0;
  flex: 0 0 auto;
  max-width: 48%;
  text-align: right;
  font-size: 0.55rem;
  line-height: 1.25;
  color: var(--gray-400);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.kpi__break-row {
  white-space: nowrap;
}

.kpi__break-row em {
  font-style: normal;
  font-weight: 550;
  color: var(--gray-400);
}

.kpi__today {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--gray-100);
  font-size: 0.68rem;
  color: var(--gray-500);
}

.kpi__today span {
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.58rem;
}

.kpi__today strong {
  font-weight: 800;
  color: var(--gray-800);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.dash-fit .chart-toolbar,
.dash-page .chart-toolbar {
  margin: 0;
  gap: 6px 10px;
  padding: 8px 10px;
  flex: 0 0 auto;
}

.dash-fit .chart-card.card__pad,
.dash-page .chart-card.card__pad {
  padding: 10px 12px 12px;
}

.dash-fit .chart-card .card__head,
.dash-page .chart-card .card__head {
  margin-bottom: 4px;
}

.dash-fit .chart-card .card__title,
.dash-page .chart-card .card__title {
  font-size: 0.88rem;
}
/* Gráficas: altura fija explícita (evita solapes Chart.js) */
.dash-fit__charts,
.dash-page__charts,
.charts-grid.dash-fit__charts {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.9fr);
  gap: 10px;
  flex: 1 1 auto;
  min-height: 220px;
  align-items: stretch;
  width: 100%;
}

.dash-fit__charts .chart-card,
.dash-page__charts .chart-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.dash-fit__charts .chart-wrap,
.dash-page__charts .chart-wrap,
.charts-grid .chart-wrap {
  position: relative;
  flex: none;
  width: 100%;
  height: clamp(200px, 30vh, 300px);
  min-height: 200px;
  max-height: 300px;
  overflow: hidden;
}

.dash-fit__charts .chart-wrap--pie,
.dash-page__charts .chart-wrap--pie,
.charts-grid .chart-wrap--pie {
  height: clamp(190px, 28vh, 260px);
  min-height: 190px;
  max-height: 260px;
  max-width: 300px;
  margin: 0 auto;
}

.dash-fit__bottom,
.dash-page__bottom {
  margin-top: 0;
  gap: 14px;
}

.dash-fit__bottom .card,
.dash-page__bottom .card {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.dash-fit__bottom .card__pad,
.dash-page__bottom .card__pad {
  padding: 14px;
}

.dash-fit__bottom .card__title,
.dash-page__bottom .card__title {
  font-size: 0.92rem;
}

.dash-fit__bottom .list-row,
.dash-page__bottom .list-row {
  padding: 8px 0;
}

.dash-fit__bottom .list-row__title,
.dash-page__bottom .list-row__title {
  font-size: 0.86rem;
}

.dash-fit__bottom .list-row__sub,
.dash-page__bottom .list-row__sub {
  font-size: 0.76rem;
}

.dash-pending-count.is-hot {
  color: var(--red-600);
  font-weight: 800;
}

.dash-kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--gray-100);
}

.dash-kv:last-child {
  border-bottom: 0;
}

.dash-kv span {
  color: var(--gray-500);
  font-weight: 600;
}

.dash-kv strong {
  color: var(--gray-900);
  font-weight: 800;
  text-align: right;
}

.dash-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 0;
}

.dash-cols--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.dash-cols--4 {
  grid-template-columns: repeat(4, 1fr);
}

.dash-head {
  margin-bottom: 2px;
}

.dash-head h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.03em;
}

.dash-head__sub {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-top: 2px;
}

.dash-sec {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  margin: 12px 0 8px;
}

.dash-today {
  margin-top: 10px;
}

.dash-today__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dash-today__empty {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.dash-today__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.dash-today__grid--2 {
  grid-template-columns: 1fr 1fr;
}

.dash-lifetime {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--gray-700);
  padding: 8px 12px;
  background: var(--blue-50);
  border-radius: var(--radius-sm);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row__meta {
  min-width: 0;
}

.list-row__title {
  font-weight: 700;
  color: var(--gray-900);
}

.list-row__sub {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.linkish {
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.2;
  padding: 0;
  min-height: auto;
}

.linkish:hover {
  text-decoration: underline;
}

/* Modal de venta */
.sale-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 10px;
  align-items: stretch;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
}

.sale-products {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.sale-products .results-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.sale-cart-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-height: 100%;
  overflow: hidden;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 12px;
  padding: 10px;
}

.sale-cart-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.sale-cart-panel__head .card__title {
  margin: 0;
}

.sale-cart-panel__tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue-700);
  white-space: nowrap;
}

.sale-cart-list {
  flex: 1 1 auto;
  min-height: 72px;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  padding: 4px 8px;
  border: 1px solid var(--accent-soft);
}

.sale-cart-foot {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 52%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.sale-cart-panel .totals {
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--gray-200));
  position: sticky;
  bottom: 0;
  z-index: 1;
}

.sale-cart-panel .cart-item:last-child {
  border-bottom: 0;
}

.product-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: left;
  margin-bottom: 6px;
  min-height: 0;
}

.product-hit__info {
  flex: 1;
  min-width: 0;
}

.product-hit:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
}

.product-hit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.product-hit__name {
  font-weight: 700;
}

.product-hit__meta {
  font-size: 0.78rem;
  color: var(--gray-500);
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
}

.cart-item__name {
  font-weight: 700;
  font-size: 0.9rem;
}

.cart-remove {
  border: 0;
  background: none;
  color: var(--gray-400);
  font-size: 1.1rem;
  padding: 4px;
}

.totals {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
}

.totals__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.totals__row--strong {
  font-weight: 800;
  color: var(--gray-900);
  font-size: 1rem;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--gray-200);
}

.totals__row--green {
  color: var(--green-700);
  font-weight: 800;
}

.results-list {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.breakdown {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 10px;
}

.breakdown__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.breakdown__row--total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--gray-300);
  font-weight: 800;
  color: var(--green-700);
}

.config-block {
  margin-bottom: 18px;
}

.config-block h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 4px;
}

.theme-swatch {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.theme-swatch.is-active {
  border-color: var(--white);
  box-shadow: 0 0 0 2px var(--accent);
}

.theme-swatch--slate {
  background: linear-gradient(135deg, #0b1220 55%, #0d9488 55%);
}
.theme-swatch--ocean {
  background: #0c4a6e;
}
.theme-swatch--forest {
  background: #14532d;
}
.theme-swatch--wine {
  background: #4c0519;
}
.theme-swatch--indigo {
  background: #1e1b4b;
}
.theme-swatch--charcoal {
  background: #171717;
}
.theme-swatch--sunset {
  background: #7c2d12;
}
.theme-swatch--rose {
  background: #881337;
}
.theme-swatch--teal {
  background: #134e4a;
}
.theme-swatch--amber {
  background: #78350f;
}
.theme-swatch--plum {
  background: #581c87;
}
.theme-swatch--mocha {
  background: #292524;
}

.theme-custom {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

.theme-custom.is-active {
  border-top-color: var(--accent);
}

.theme-custom__title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-700);
}

.theme-custom__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.theme-color-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
}

.theme-color-input {
  width: 52px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
}

.theme-color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.theme-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 5px;
}

.config-danger {
  border-color: var(--red-100);
  background: linear-gradient(180deg, #fff 0%, var(--red-50) 100%);
}

.config-danger h3 {
  color: var(--red-700);
}

.agency-row,
.cat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
}

.agency-row:last-child,
.cat-row:last-child {
  border-bottom: 0;
}

.totals-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.pill {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 650;
}

.pill strong {
  color: var(--gray-900);
}

.gas-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.gas-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.section-head--gas {
  flex-wrap: wrap;
  align-items: flex-start;
}

.gas-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 0;
}

.gas-dates {
  margin: 0;
}

.totals-pills {
  align-items: center;
}

.gas-check-cell {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.gas-check {
  width: 16px;
  height: 16px;
  accent-color: var(--red-600);
  cursor: pointer;
}

.data-table tbody tr.is-selected {
  background: var(--red-50);
}

/* Pedidos — tarjetas compactas */
.ped-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ped-head__count {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--gray-500);
}

.ped-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.ped-periods {
  width: 100%;
}

.ped-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--gray-600);
  cursor: pointer;
}

.ped-select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.ped-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 10px;
}

.ped-bulk__lab {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-right: 4px;
}

.ped-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ped-card {
  background: var(--surface-elevated);
  border: 1px solid color-mix(in srgb, var(--gray-200) 90%, transparent);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), transform 0.15s var(--ease-out);
}

.ped-card:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--gray-200));
  box-shadow: var(--shadow-md);
}

.ped-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.ped-card__check {
  flex-shrink: 0;
  padding-top: 1px;
  cursor: pointer;
}

.ped-card__check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ped-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ped-card__top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}

.ped-card__id {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gray-400);
  letter-spacing: 0.02em;
}

.ped-card__total {
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.ped-card__items {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--gray-800);
  line-height: 1.3;
}

.ped-items {
  list-style: none;
  margin: 0;
  padding: 4px 0 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ped-items__row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 6px;
  align-items: baseline;
  font-size: 0.82rem;
  line-height: 1.25;
  min-width: 0;
}

.ped-items__qty {
  font-weight: 800;
  color: var(--accent);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ped-items__name {
  font-weight: 650;
  color: var(--gray-800);
  min-width: 0;
  overflow-wrap: anywhere;
}

.ped-items__price {
  font-weight: 700;
  color: var(--gray-500);
  font-size: 0.76rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ped-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 14px;
  padding: 6px 8px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-100);
}

.ped-meta__row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 0.78rem;
  line-height: 1.25;
  min-width: 0;
}

.ped-meta__row--full {
  grid-column: 1 / -1;
}

.ped-meta__lab {
  flex-shrink: 0;
  color: var(--gray-400);
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ped-meta__val {
  color: var(--gray-700);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ped-card__act {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.ped-card__act .btn {
  min-width: 0;
  padding: 5px 10px;
  font-size: 0.78rem;
  line-height: 1.2;
}

.ped-edit-items {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: var(--gray-50);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--gray-700);
  font-weight: 600;
}

@media (max-width: 600px) {
  .ped-meta {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ped-card__act {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .ped-card__act .btn {
    width: auto;
    min-width: 0;
  }

  .ped-card__act .btn--success {
    grid-column: 1 / -1;
  }
}

.inv-mode {
  margin-bottom: 10px;
}

.inv-report-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.inv-report-formula {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.inv-hl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.inv-hl__lab {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.inv-hl__name {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.inv-hl__val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--green-600);
  letter-spacing: -0.02em;
}

.inv-report-intro {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.35;
}

.inv-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

.inv-chart-wrap {
  position: relative;
  height: 210px;
  width: 100%;
}

.inv-chart-wrap--donut {
  height: 240px;
}

.inv-low-wrap {
  min-height: 210px;
  display: flex;
  align-items: stretch;
}

.inv-low-empty {
  margin: auto;
  text-align: center;
  padding: 24px 12px;
}

.inv-low-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-low-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
}

.inv-low-rank {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inv-low-product {
  flex: 1;
  min-width: 0;
}

.inv-low-qty {
  flex: 0 0 auto;
  font-size: 1.1rem;
  font-weight: 800;
  color: #b91c1c;
}

.inv-low-qty--zero {
  opacity: 0.55;
}

@media (max-width: 900px) {
  .inv-hl-grid {
    grid-template-columns: 1fr;
  }

  .inv-chart-grid {
    grid-template-columns: 1fr;
  }
}

.hint {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: -6px;
  margin-bottom: 10px;
}

.repartidor-card {
  background: var(--blue-50);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.gasto-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.gasto-type {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 8px 10px;
}

.gasto-type.is-zero {
  opacity: 0.55;
}

.gasto-type--total {
  background: var(--gray-900);
  color: var(--white);
  border-color: var(--gray-900);
}

.gasto-type__name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
}

.gasto-type--total .gasto-type__name {
  color: var(--gray-300);
}

.gasto-type__amt {
  font-weight: 800;
  margin-top: 2px;
  font-size: 0.88rem;
}

.chart-card .card__head {
  margin-bottom: 4px;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--surface-elevated);
  border: 1px solid color-mix(in srgb, var(--gray-200) 90%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--gray-700);
}

.chart-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 2px;
}

.chart-nav__btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gray-700);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chart-nav__btn:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--gray-900);
}

.chart-nav__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.chart-nav__label {
  min-width: 7.5rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-800);
  padding: 0 6px;
  white-space: nowrap;
}

.chart-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chart-dates__lab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--gray-500);
}

.chart-dates .input {
  width: auto;
  min-width: 9.5rem;
  padding: 4px 8px;
  min-height: 32px;
  font-size: 0.8rem;
}

.chart-toolbar__sum {
  margin: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-left: 0;
}

.chart-toolbar__sum .chart-sum__val {
  font-weight: 800;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}

.chart-toolbar__sum .chart-sum__val--loss {
  color: var(--red-600);
}

.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.9fr);
  gap: 10px;
  margin-top: 0;
  width: 100%;
}

.chart-wrap {
  position: relative;
  height: clamp(200px, 30vh, 300px);
  min-height: 200px;
  width: 100%;
  overflow: hidden;
}

.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
}

.chart-wrap--pie {
  height: clamp(190px, 28vh, 260px);
  min-height: 190px;
  max-width: 300px;
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .kpi-grid,
  .kpi-grid--4,
  .kpi-grid--5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-cols--3,
  .dash-cols--4 {
    grid-template-columns: 1fr 1fr;
  }

  .dash-today__strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .dash-fit__charts,
  .dash-page__charts,
  .charts-grid,
  .charts-grid.dash-fit__charts {
    grid-template-columns: 1fr;
  }

  .dash-fit__charts .chart-wrap,
  .dash-page__charts .chart-wrap,
  .charts-grid .chart-wrap {
    height: 260px;
    min-height: 260px;
    max-height: 260px;
  }

  .dash-fit__charts .chart-wrap--pie,
  .dash-page__charts .chart-wrap--pie,
  .charts-grid .chart-wrap--pie {
    height: 260px;
    min-height: 260px;
    max-height: 260px;
    max-width: 280px;
  }
}

@media (max-width: 900px) {
  .charts-grid,
  .dash-fit__charts,
  .dash-page__charts,
  .charts-grid.dash-fit__charts {
    grid-template-columns: 1fr;
  }

  .chart-wrap--pie,
  .dash-fit__charts .chart-wrap--pie,
  .charts-grid .chart-wrap--pie {
    max-width: 280px;
  }
}

@media (max-width: 900px) {
  .sale-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .sale-products {
    overflow: visible;
    max-height: none;
  }

  .sale-products .results-list {
    max-height: 200px;
  }

  .sale-cart-panel {
    overflow: visible;
    max-height: none;
    height: auto;
  }

  .sale-cart-list {
    max-height: 160px;
    flex: 0 1 auto;
  }

  .sale-cart-foot {
    max-height: none;
    overflow: visible;
  }

  .sale-cart-panel--delivery .sale-cart-list {
    max-height: 110px;
  }

  .sale-cart-panel .totals {
    position: static;
  }

  .modal--lg .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
  }

  .dash-cols,
  .dash-cols--3,
  .dash-cols--4 {
    grid-template-columns: 1fr;
  }

  .row-3 {
    grid-template-columns: 1fr 1fr;
  }

  .dash-fit,
  .dash-page {
    gap: 12px;
  }

  .dash-fit__charts,
  .dash-page__charts,
  .charts-grid.dash-fit__charts {
    gap: 12px;
  }

  .dash-fit__charts .chart-wrap,
  .dash-page__charts .chart-wrap,
  .charts-grid .chart-wrap,
  .dash-fit__charts .chart-card:first-child .chart-wrap {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
  }

  .dash-fit__charts .chart-wrap--pie,
  .dash-page__charts .chart-wrap--pie,
  .charts-grid .chart-wrap--pie {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    max-width: 260px;
  }

  .dash-today__strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-grid--5 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 52px;
    --bottom-nav-h: 58px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  .sidebar {
    display: none;
  }

  .main {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    height: 100dvh;
    max-height: 100dvh;
    /* Espacio para header fijo + menú inferior + isla / home indicator */
    padding-top: calc(var(--header-h) + var(--safe-top));
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
  }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: calc(var(--header-h) + var(--safe-top));
    padding: var(--safe-top) 10px 0;
    box-sizing: border-box;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    /* Evita que el header “salte” al hacer scroll */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
  }

  .topbar__brand {
    display: flex;
  }

  .topbar__page {
    display: none;
  }

  .topbar .btn--nueva {
    display: none;
  }

  .lang-code {
    display: none;
  }

  .lang-btn {
    padding: 5px 6px;
  }

  .content {
    padding: 8px 10px 20px;
  }

  .chart-toolbar__sum {
    margin-left: 0;
    width: 100%;
  }

  .chart-dates .input {
    min-width: 0;
    flex: 1;
  }

  .dash-today__grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi__value {
    font-size: 1.05rem;
  }

  .row-2,
  .row-3 {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding: 0 2px var(--safe-bottom);
    box-sizing: border-box;
    align-items: stretch;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    /* Menú estable (sin “bailar” al scroll / teclado) */
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    will-change: transform;
  }

  .bottom-nav .nav-item {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    height: var(--bottom-nav-h);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    color: var(--gray-500);
    font-size: 0.62rem;
    line-height: 1.1;
    padding: 6px 2px 4px;
    border-radius: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: color 0.18s var(--ease-out), background 0.18s;
  }

  .bottom-nav .nav-item svg {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    flex-shrink: 0;
    display: block;
    overflow: hidden;
    transition: transform 0.2s var(--ease-spring), color 0.18s;
  }

  .bottom-nav .nav-item.is-active svg {
    transform: translateY(-1px) scale(1.08);
  }

  .bottom-nav .nav-item > span:not(.nav-item__badge) {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    padding: 0 1px;
  }

  .bottom-nav .nav-item.is-active {
    background: transparent;
    color: var(--accent);
  }

  .bottom-nav .nav-item__badge {
    position: absolute;
    top: 4px;
    right: max(2px, calc(50% - 18px));
    min-width: 14px;
    height: 14px;
    font-size: 0.58rem;
    z-index: 1;
  }

  .fab {
    display: flex;
    position: fixed;
    right: 14px;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--accent), var(--accent-hover));
    color: var(--white);
    border: 0;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent);
    z-index: 45;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 400;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
  }

  .fab:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 32px color-mix(in srgb, var(--accent) 55%, transparent);
  }

  .fab:active {
    transform: scale(0.94);
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
    padding: 4px 2px;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--gray-100);
    padding: 6px 8px;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .cell-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .toasts {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 72px);
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    border-radius: 16px 16px 0 0;
  }

  .dash-fit__head {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .dash-life {
    justify-content: center;
    text-align: center;
  }

  .dash-fit .kpi-grid--5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-today__strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .chart-nav {
    justify-content: center;
    width: 100%;
  }

  .chart-nav__label {
    min-width: 0;
    flex: 1;
  }

  .chart-dates {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .chart-dates__lab {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 4px;
  }

  .chart-dates .input {
    width: 100%;
    min-width: 0;
    font-size: 16px;
    min-height: 44px;
  }

  .gas-toolbar,
  .gas-head-actions,
  .ped-head {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .gas-toolbar .btn,
  .gas-head-actions .btn,
  .ped-head .btn {
    width: 100%;
  }

  .theme-swatches {
    gap: 8px;
  }

  .theme-swatch {
    width: 40px;
    height: 40px;
  }

  .theme-custom__row {
    flex-direction: column;
    align-items: stretch;
  }

  .config-block .row-2,
  .config-block .row-3 {
    grid-template-columns: 1fr;
  }

  .content {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 20px;
  }

  .dash-fit__charts .chart-wrap,
  .dash-fit__charts .chart-card:first-child .chart-wrap,
  .charts-grid .chart-wrap {
    height: 220px;
    min-height: 220px;
    max-height: 220px;
  }

  .dash-fit__charts .chart-wrap--pie,
  .charts-grid .chart-wrap--pie {
    height: 230px;
    min-height: 230px;
    max-height: 230px;
  }
}

@media (max-width: 480px) {
  .kpi-grid,
  .kpi-grid--4,
  .kpi-grid--5,
  .dash-fit .kpi-grid--5 {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .dash-fit .kpi {
    padding: 6px 6px 5px;
  }

  .dash-fit .kpi__label {
    font-size: 0.55rem;
  }

  .dash-fit .kpi__value {
    font-size: 0.82rem;
  }

  .bottom-nav .nav-item {
    font-size: 0.56rem;
    padding: 5px 1px 3px;
    gap: 1px;
  }

  .bottom-nav .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .fab {
    width: 52px;
    height: 52px;
    right: 10px;
  }

  .chart-toolbar__sum {
    font-size: 0.75rem;
    line-height: 1.45;
  }

  .data-table td {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .data-table td::before {
    margin-bottom: 2px;
  }
}
