:root {
  --reporte-panel: var(--idee-header);
  --reporte-surface: var(--idee-bg-elevated);
  --reporte-border: var(--idee-border-inverse);
  --reporte-border-light: var(--idee-border-color);
  --reporte-text: var(--idee-text-inverse);
  --reporte-muted: var(--idee-text-muted);
  --reporte-ink: var(--idee-text-primary);
  --reporte-primary: var(--idee-primary);
  --reporte-primary-strong: var(--idee-info);
  --reporte-accent: var(--idee-accent);
  --reporte-success: var(--idee-success);
  --reporte-shadow: var(--idee-shadow-lg);
  --reporte-shadow-soft: var(--idee-shadow-md);
  --reporte-radius: var(--idee-radius-xl);
  --reporte-radius-sm: var(--idee-radius-md);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--idee-text-primary);
  font-family: var(--idee-font-family);
  background:
    radial-gradient(circle at 20% 5%, color-mix(in srgb, var(--idee-primary) 18%, transparent), transparent 31rem),
    radial-gradient(circle at 86% 18%, color-mix(in srgb, var(--idee-accent) 13%, transparent), transparent 26rem),
    var(--idee-bg-page);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(color-mix(in srgb, var(--idee-divider-color) 34%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--idee-divider-color) 34%, transparent) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, color-mix(in srgb, var(--idee-bg-page) 90%, transparent), transparent 82%);
}

.reporte-page {
  max-width: 1240px;
  padding: 28px 16px 40px;
}

#ventas {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

.reporte-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 28px !important;
  color: var(--idee-text);
  border: 1px solid var(--idee-border);
  border-radius: 26px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--idee-bg-elevated) 9%, transparent), color-mix(in srgb, var(--idee-bg-elevated) 4%, transparent)),
    var(--idee-header);
  box-shadow: var(--idee-shadow);
  backdrop-filter: blur(18px);
}

.reporte-hero::before,
.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--idee-primary), var(--idee-accent));
}

.section-kicker {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--idee-primary-strong);
  font-size: .73rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ventas-header h2 {
  margin: 0;
  color: var(--idee-text);
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  font-weight: 900;
  line-height: 1.1;
}

.hero-subtitle {
  max-width: 620px;
  margin-top: 8px;
  color: var(--idee-text-muted);
  font-size: .95rem;
  line-height: 1.45;
}

.reporte-actions {
  gap: 10px;
  justify-content: flex-end;
}

.btn-group.reporte-actions > .btn {
  border-radius: 13px !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 15px;
  font-weight: 900;
  border-radius: 13px;
  transition: transform var(--idee-transition), box-shadow var(--idee-transition), border-color var(--idee-transition), background var(--idee-transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--idee-text);
  border-color: color-mix(in srgb, var(--idee-border-inverse) 80%, transparent);
  background: color-mix(in srgb, var(--idee-bg-elevated) 7%, transparent);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: var(--idee-button-primary-text);
  border-color: color-mix(in srgb, var(--idee-primary) 62%, transparent);
  background: linear-gradient(135deg, var(--idee-primary), var(--idee-accent));
  box-shadow: 0 14px 32px color-mix(in srgb, var(--idee-primary) 18%, transparent);
}

.btn-secondary {
  color: var(--idee-text);
  border: 0;
  background: var(--idee-bg-surface-secondary);
}

.filter-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px !important;
  padding: 14px;
  border: 1px solid var(--idee-border);
  border-radius: var(--idee-radius-md);
  background: color-mix(in srgb, var(--idee-bg-elevated) 6%, transparent);
}

.filter-label {
  color: var(--idee-text-muted);
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-control,
input,
select {
  min-height: 46px;
  color: var(--idee-text-primary);
  border: 1px solid var(--idee-border-color);
  border-radius: 13px;
  background-color: var(--idee-bg-input);
  box-shadow: none;
}

.form-control:focus,
input:focus,
select:focus {
  border-color: var(--idee-focus-border);
  box-shadow: var(--idee-shadow-focus);
}

.filter-panel input[type="date"] {
  width: auto !important;
  min-width: 172px;
  color: var(--idee-text);
  border-color: color-mix(in srgb, var(--idee-border-inverse) 72%, transparent);
  background: color-mix(in srgb, var(--idee-bg-elevated) 8%, transparent);
}

.filter-panel input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.ventas-resumen {
  padding-top: 0 !important;
  padding-bottom: 6px !important;
}

.summary-card {
  position: relative;
  min-height: 130px;
  overflow: hidden;
  border: 1px solid var(--idee-border-color) !important;
  border-radius: var(--idee-radius-xl) !important;
  background: var(--idee-surface) !important;
  box-shadow: var(--idee-shadow-md) !important;
  transition: transform var(--idee-transition), box-shadow var(--idee-transition);
}

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--idee-shadow-md) !important;
}

.summary-card .card-body {
  display: flex;
  min-height: 130px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-align: left !important;
}

.summary-card .card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--idee-text-secondary);
  font-size: .86rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

#totalVentas,
#numVentas {
  margin: 6px 0 0;
  color: var(--idee-text-primary) !important;
  font-size: 2rem !important;
  font-weight: 900 !important;
}

#numVentas {
  color: var(--idee-success) !important;
}

.table-card {
  margin-top: 12px;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--idee-border-color);
  border-radius: var(--idee-radius-xl);
  background: var(--idee-surface);
  box-shadow: var(--idee-shadow-md);
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--idee-divider-color);
  background: var(--idee-bg-surface-secondary);
}

.table-card-header h3 {
  margin: 0;
  color: var(--idee-text-primary);
  font-size: 1.15rem;
  font-weight: 900;
}

.table-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  color: var(--idee-text-primary);
  border: 1px solid var(--idee-border-color);
  border-radius: 999px;
  background: var(--idee-bg-surface-secondary);
  font-size: .8rem;
  font-weight: 900;
}

.table-responsive {
  background: var(--idee-bg-elevated);
}

.reporte-table {
  margin: 0;
  color: var(--idee-text-primary);
  border-collapse: collapse;
  border-spacing: 0;
  font-size: .92rem;
}

.reporte-table thead th {
  padding: 15px 14px;
  color: var(--idee-table-header-text) !important;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .045em;
  white-space: nowrap;
  border: 0;
  background: var(--idee-table-header-bg) !important;
}

.reporte-table tbody td {
  padding: 13px 14px;
  vertical-align: middle;
  border-color: var(--idee-table-border);
}

.reporte-table tbody tr {
  background: var(--idee-bg-elevated);
  transition: background var(--idee-transition);
}

.reporte-table tbody tr:hover {
  background: var(--idee-table-row-hover);
}

.reporte-table tbody td:nth-child(4) {
  color: var(--idee-success);
  font-weight: 900;
}

.reporte-table .btn-sm,
.table .btn-sm {
  min-height: 34px;
  padding: 7px 11px;
  color: var(--idee-button-primary-text) !important;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--idee-primary), var(--idee-accent));
  font-size: .78rem;
  font-weight: 900;
}

.modal-content {
  overflow: hidden;
  border: 1px solid var(--idee-border-color);
  border-radius: 24px;
  background: var(--idee-modal-bg);
  color: var(--idee-text-primary);
  box-shadow: var(--idee-shadow-lg);
}

.modal-header {
  color: var(--idee-text);
  border: 0;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--idee-bg-elevated) 9%, transparent), color-mix(in srgb, var(--idee-bg-elevated) 4%, transparent)),
    var(--idee-header);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: .86;
}

.modal-body {
  max-height: min(68vh, 620px);
  overflow-y: auto;
  padding: 22px;
  color: var(--idee-text-primary);
  background: var(--idee-modal-bg);
}

#detalleVenta {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#detalleVenta li {
  padding: 12px 14px;
  border: 1px solid var(--idee-border-color);
  border-left: 4px solid var(--idee-primary);
  border-radius: 14px;
  background: var(--idee-bg-surface-secondary);
  color: var(--idee-text-secondary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 16px 22px;
  border: 0;
  background: var(--idee-bg-surface-secondary);
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: var(--idee-text);
  font-size: 18px;
  font-weight: 800;
  background: var(--idee-overlay-bg);
  backdrop-filter: blur(4px);
}

.loading.oculto {
  display: none !important;
}

.spinner {
  width: 46px;
  height: 46px;
  border: 4px solid color-mix(in srgb, var(--idee-text-inverse) 18%, transparent);
  border-top-color: var(--idee-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading p {
  margin: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 992px) {
  .reporte-actions {
    width: 100%;
    margin-top: 16px;
    justify-content: flex-start;
  }

  .reporte-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 768px) {
  .reporte-page {
    padding: 18px 14px 30px;
  }

  .reporte-hero {
    padding: 22px !important;
    border-radius: 20px;
  }

  .filter-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-panel input[type="date"],
  .reporte-actions .btn {
    width: 100% !important;
  }

  .summary-card .card-body {
    min-height: 106px;
  }

  .table-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-dialog {
    margin: .75rem;
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .ventas-header h2 {
    font-size: 1.45rem;
  }

  #totalVentas,
  #numVentas {
    font-size: 1.55rem !important;
  }

  .summary-card .card-body {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Unificación visual claro/oscuro */
body{
  background:
    radial-gradient(circle at 20% 5%, color-mix(in srgb, var(--idee-primary) 18%, transparent), transparent 31rem),
    radial-gradient(circle at 86% 18%, color-mix(in srgb, var(--idee-accent) 13%, transparent), transparent 26rem),
    var(--idee-bg-page);
  color:var(--idee-text-primary);
}

.summary-card,
.table-card,
.filter-panel,
.modal-content{
  color:var(--idee-text-primary) !important;
  border-color:var(--idee-border-color) !important;
  background:var(--idee-bg-elevated) !important;
}

.table-card-header,
.modal-footer{
  color:var(--idee-text-primary);
  border-color:var(--idee-divider-color);
  background:var(--idee-bg-surface-secondary);
}

.summary-card .card-title,
.filter-label,
.table-badge{
  color:var(--idee-text-secondary) !important;
}

.form-control,
.form-select,
input,
select{
  color:var(--idee-text-primary) !important;
  border-color:var(--idee-border-strong) !important;
  background:var(--idee-bg-input) !important;
}

.table-responsive,
.reporte-table,
.reporte-table tbody tr{
  color:var(--idee-text-primary);
  background:var(--idee-bg-elevated);
}

.reporte-table{
  --bs-table-color:var(--idee-text-primary);
  --bs-table-bg:var(--idee-bg-elevated);
  --bs-table-striped-color:var(--idee-text-primary);
  --bs-table-striped-bg:var(--idee-bg-surface-secondary);
  --bs-table-hover-color:var(--idee-text-primary);
  --bs-table-hover-bg:var(--idee-table-row-hover);
  --bs-table-active-color:var(--idee-text-primary);
  --bs-table-active-bg:var(--idee-bg-selected);
}

.reporte-table tbody tr,
.reporte-table tbody tr:hover,
.reporte-table tbody tr.table-active,
.reporte-table tbody tr.active,
.reporte-table tbody tr.selected{
  color:var(--idee-text-primary) !important;
}

.reporte-table tbody td,
.reporte-table tbody tr:hover td,
.reporte-table tbody tr.table-active td,
.reporte-table tbody tr.active td,
.reporte-table tbody tr.selected td{
  color:var(--idee-text-primary) !important;
  background-color:transparent;
}

.reporte-table tbody td:nth-child(4),
.reporte-table tbody tr:hover td:nth-child(4),
.reporte-table tbody tr.table-active td:nth-child(4),
.reporte-table tbody tr.active td:nth-child(4),
.reporte-table tbody tr.selected td:nth-child(4){
  color:var(--idee-success) !important;
}

.reporte-table tbody td{
  border-color:var(--idee-table-border);
}

.reporte-table tbody tr:hover{
  background:var(--idee-table-row-hover);
}

/* Homologacion visual final del reporte: solo presentacion claro/oscuro. */
:root {
  --reporte-total-color: color-mix(in srgb, var(--idee-success) 82%, var(--idee-text-primary));
  --reporte-count-color: color-mix(in srgb, var(--idee-info) 82%, var(--idee-primary-dark));
  --reporte-soft-strength: 12%;
  --reporte-border-strength: 42%;
  --reporte-solid-text: var(--idee-text-inverse);
}

[data-mode="oscuro"] {
  --reporte-solid-text: var(--idee-bg-page);
}

body {
  color: var(--idee-text-primary);
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--idee-primary) 18%, transparent), transparent 28%),
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--idee-accent) 14%, transparent), transparent 30%),
    var(--idee-bg-page) !important;
}

body::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--idee-divider-color) 62%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--idee-divider-color) 62%, transparent) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, color-mix(in srgb, var(--idee-bg-page) 90%, transparent), transparent 82%);
  opacity: .34;
}

.reporte-page {
  max-width: 1240px;
}

.reporte-hero {
  border-color: color-mix(in srgb, var(--idee-primary) 32%, var(--idee-border-inverse)) !important;
  border-radius: 24px;
  color: var(--idee-text-inverse);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--idee-primary-dark) 72%, var(--idee-bg-page)), color-mix(in srgb, var(--idee-primary) 64%, var(--idee-bg-page))) !important;
  box-shadow: var(--idee-shadow-lg) !important;
  backdrop-filter: none;
}

.reporte-hero::before {
  height: 5px;
  background: linear-gradient(90deg, var(--idee-primary-light), var(--idee-info), var(--idee-success));
}

.reporte-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -110px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--idee-bg-elevated) 10%, transparent);
  pointer-events: none;
}

.reporte-hero > * {
  position: relative;
  z-index: 1;
}

.reporte-hero .section-kicker,
.reporte-hero .idee-page-title,
.reporte-hero .idee-page-subtitle,
.ventas-header h2,
.hero-subtitle {
  color: var(--idee-text-inverse) !important;
}

.reporte-hero .section-kicker {
  align-items: center;
  gap: 8px;
}

.reporte-hero .section-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--idee-primary);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--idee-primary) 18%, transparent);
}

.hero-subtitle {
  opacity: .78;
}

.reporte-actions .btn,
.btn-outline-primary {
  color: var(--idee-text-inverse) !important;
  border-color: color-mix(in srgb, var(--idee-text-inverse) 34%, transparent) !important;
  background: color-mix(in srgb, var(--idee-bg-elevated) 10%, transparent) !important;
  box-shadow: var(--idee-shadow-sm);
}

.reporte-actions .btn:hover,
.reporte-actions .btn:focus,
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: var(--idee-button-primary-text) !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--idee-primary), color-mix(in srgb, var(--idee-primary-dark) 84%, var(--idee-info))) !important;
  box-shadow: var(--idee-shadow-brand);
}

.filter-panel {
  border-color: color-mix(in srgb, var(--idee-border-inverse) 82%, transparent) !important;
  background: color-mix(in srgb, var(--idee-bg-elevated) 10%, transparent) !important;
}

.filter-label {
  color: color-mix(in srgb, var(--idee-text-inverse) 74%, transparent) !important;
}

.filter-panel input[type="date"],
.form-control,
.form-select,
input,
select {
  color: var(--idee-text-primary) !important;
  border-color: var(--idee-border-strong) !important;
  background: var(--idee-bg-input) !important;
}

.filter-panel input[type="date"]::placeholder,
.form-control::placeholder {
  color: var(--idee-input-placeholder);
  opacity: 1;
}

.filter-panel input[type="date"]:focus,
.form-control:focus,
.form-select:focus,
input:focus,
select:focus {
  border-color: var(--idee-focus-border) !important;
  box-shadow: var(--idee-shadow-focus) !important;
}

[data-mode="oscuro"] .filter-panel input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) grayscale(100%) brightness(180%);
}

.summary-card {
  min-height: 128px;
  color: var(--idee-text-primary) !important;
  border-color: color-mix(in srgb, var(--idee-border-color) 78%, var(--idee-text-primary)) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--summary-accent, var(--reporte-total-color)) 7%, transparent), transparent 66%),
    var(--idee-bg-elevated) !important;
  box-shadow: var(--idee-shadow-md) !important;
}

.summary-card-total {
  --summary-accent: var(--reporte-total-color);
}

.summary-card-count {
  --summary-accent: var(--reporte-count-color);
}

.summary-card::before {
  height: 4px;
  background: var(--summary-accent, var(--reporte-total-color));
}

.summary-card .card-title {
  color: var(--idee-text-secondary) !important;
}

#totalVentas,
#numVentas,
.summary-card .text-primary,
.summary-card .text-success {
  color: var(--summary-accent, var(--idee-text-primary)) !important;
}

.table-card {
  color: var(--idee-text-primary) !important;
  border-color: color-mix(in srgb, var(--idee-border-color) 78%, var(--idee-text-primary)) !important;
  border-radius: 22px;
  background: var(--idee-bg-elevated) !important;
  box-shadow: var(--idee-shadow-md) !important;
}

.table-card-header {
  color: var(--idee-text-primary);
  border-color: var(--idee-divider-color) !important;
  background: color-mix(in srgb, var(--idee-bg-surface-secondary) 82%, var(--idee-bg-elevated)) !important;
}

.table-card-header h3 {
  color: var(--idee-text-primary) !important;
}

.table-badge {
  color: color-mix(in srgb, var(--idee-primary) 78%, var(--idee-text-primary)) !important;
  border-color: color-mix(in srgb, var(--idee-primary) 32%, var(--idee-border-color)) !important;
  background: color-mix(in srgb, var(--idee-primary) 9%, var(--idee-bg-elevated)) !important;
}

.table-responsive {
  background: var(--idee-bg-elevated) !important;
}

.reporte-table {
  min-width: 760px;
  color: var(--idee-text-primary) !important;
  --bs-table-color: var(--idee-text-primary);
  --bs-table-bg: var(--idee-bg-elevated);
  --bs-table-striped-color: var(--idee-text-primary);
  --bs-table-striped-bg: color-mix(in srgb, var(--idee-bg-surface-secondary) 62%, var(--idee-bg-elevated));
  --bs-table-hover-color: var(--idee-text-primary);
  --bs-table-hover-bg: color-mix(in srgb, var(--idee-table-row-hover) 82%, var(--idee-bg-elevated));
  --bs-table-border-color: var(--idee-table-border);
}

.reporte-table thead th {
  color: var(--idee-table-header-text) !important;
  border: 0 !important;
  background: var(--idee-table-header-bg) !important;
}

.reporte-table tbody tr,
.reporte-table tbody td {
  color: var(--idee-text-primary) !important;
  border-color: var(--idee-table-border) !important;
  background-color: transparent !important;
}

.reporte-table tbody tr:hover,
.reporte-table tbody tr:hover td {
  color: var(--idee-text-primary) !important;
  background-color: color-mix(in srgb, var(--idee-table-row-hover) 82%, var(--idee-bg-elevated)) !important;
}

.reporte-table tbody tr:hover td:first-child {
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--idee-primary) 70%, var(--idee-border-color));
}

.reporte-table tbody td:nth-child(4),
.reporte-table tbody tr:hover td:nth-child(4) {
  color: var(--reporte-total-color) !important;
  font-weight: 900;
}

.reporte-table .btn-sm,
.table .btn-sm {
  color: var(--idee-button-primary-text) !important;
  border: 1px solid color-mix(in srgb, var(--idee-primary-light) 36%, transparent) !important;
  background: linear-gradient(135deg, var(--idee-primary), color-mix(in srgb, var(--idee-primary-dark) 84%, var(--idee-info))) !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--idee-primary) 18%, transparent);
}

.reporte-table .btn-sm:hover,
.table .btn-sm:hover,
.reporte-table .btn-sm:focus,
.table .btn-sm:focus {
  color: var(--idee-button-primary-text) !important;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--idee-primary) 24%, transparent);
}

.reporte-modal .modal-content {
  color: var(--idee-text-primary) !important;
  border: 1px solid var(--idee-border-color) !important;
  border-radius: 24px;
  background: var(--idee-modal-bg) !important;
  box-shadow: var(--idee-shadow-lg) !important;
}

.reporte-modal .modal-header {
  color: var(--idee-text-inverse) !important;
  background: var(--idee-gradient-header) !important;
}

.reporte-modal .modal-title {
  color: var(--idee-text-inverse) !important;
}

.reporte-modal .modal-body {
  color: var(--idee-text-primary) !important;
  background: var(--idee-modal-bg) !important;
}

.reporte-modal .modal-footer {
  border-top: 1px solid var(--idee-divider-color) !important;
  background: var(--idee-bg-surface-secondary) !important;
}

.reporte-modal .btn-close {
  filter: var(--idee-btn-close-filter, invert(1) grayscale(100%) brightness(180%));
}

#detalleVenta li {
  color: var(--idee-text-primary) !important;
  border-color: var(--idee-border-color) !important;
  border-left-color: var(--idee-primary) !important;
  background: color-mix(in srgb, var(--idee-bg-surface-secondary) 82%, var(--idee-bg-elevated)) !important;
}

.btn-secondary {
  color: var(--idee-text-secondary) !important;
  border: 1px solid var(--idee-border-color) !important;
  background: var(--idee-bg-surface-secondary) !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
  color: var(--idee-text-primary) !important;
  border-color: var(--idee-focus-border) !important;
  background: var(--idee-bg-hover) !important;
}

.loading {
  color: var(--idee-text-inverse) !important;
  background: var(--idee-overlay-bg) !important;
}

.spinner {
  border-color: color-mix(in srgb, var(--idee-text-inverse) 24%, transparent);
  border-top-color: var(--idee-primary);
}

@media (max-width: 991.98px) {
  .reporte-hero .row {
    row-gap: 14px;
  }

  .reporte-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  .reporte-page {
    padding: 18px 14px 30px;
  }

  .reporte-hero {
    padding: 20px !important;
    border-radius: 20px;
  }

  .summary-card {
    min-height: 112px;
  }

  .summary-card .card-body {
    min-height: 112px;
  }

  .table-card-header {
    padding: 16px;
  }
}

/* Reparacion de contraste: evita texto claro sobre superficies claras. */
html[data-mode="claro"] .reporte-hero,
html:not([data-mode="oscuro"]) .reporte-hero {
  color: var(--idee-text-inverse) !important;
  border-color: color-mix(in srgb, var(--idee-primary) 36%, var(--idee-border-inverse)) !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--idee-primary-dark) 82%, var(--idee-bg-page)), color-mix(in srgb, var(--idee-primary) 72%, var(--idee-primary-dark))) !important;
}

html[data-mode="claro"] .reporte-hero .section-kicker,
html[data-mode="claro"] .reporte-hero .idee-page-title,
html[data-mode="claro"] .reporte-hero .idee-page-subtitle,
html[data-mode="claro"] .ventas-header h2,
html[data-mode="claro"] .hero-subtitle,
html:not([data-mode="oscuro"]) .reporte-hero .section-kicker,
html:not([data-mode="oscuro"]) .reporte-hero .idee-page-title,
html:not([data-mode="oscuro"]) .reporte-hero .idee-page-subtitle,
html:not([data-mode="oscuro"]) .ventas-header h2,
html:not([data-mode="oscuro"]) .hero-subtitle {
  color: var(--idee-text-inverse) !important;
  opacity: 1;
}

html[data-mode="claro"] .hero-subtitle,
html:not([data-mode="oscuro"]) .hero-subtitle {
  color: color-mix(in srgb, var(--idee-text-inverse) 82%, transparent) !important;
}

html[data-mode="claro"] .filter-panel,
html:not([data-mode="oscuro"]) .filter-panel {
  border-color: color-mix(in srgb, var(--idee-text-inverse) 22%, transparent) !important;
  background: color-mix(in srgb, var(--idee-bg-elevated) 12%, transparent) !important;
}

html[data-mode="claro"] .filter-label,
html:not([data-mode="oscuro"]) .filter-label {
  color: color-mix(in srgb, var(--idee-text-inverse) 88%, transparent) !important;
}

html[data-mode="claro"] .reporte-actions .btn,
html[data-mode="claro"] .reporte-hero .btn-outline-primary,
html:not([data-mode="oscuro"]) .reporte-actions .btn,
html:not([data-mode="oscuro"]) .reporte-hero .btn-outline-primary {
  color: var(--idee-text-inverse) !important;
  border-color: color-mix(in srgb, var(--idee-text-inverse) 36%, transparent) !important;
  background: color-mix(in srgb, var(--idee-bg-elevated) 14%, transparent) !important;
}

html[data-mode="claro"] .reporte-actions .btn i,
html[data-mode="claro"] .reporte-hero .btn-outline-primary i,
html:not([data-mode="oscuro"]) .reporte-actions .btn i,
html:not([data-mode="oscuro"]) .reporte-hero .btn-outline-primary i {
  color: currentColor !important;
}

html[data-mode="claro"] .filter-panel input[type="date"],
html:not([data-mode="oscuro"]) .filter-panel input[type="date"] {
  color: var(--idee-text-primary) !important;
  border-color: var(--idee-border-strong) !important;
  background: var(--idee-bg-input) !important;
}

html[data-mode="claro"] .filter-panel input[type="date"]::-webkit-calendar-picker-indicator,
html:not([data-mode="oscuro"]) .filter-panel input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
}

html[data-mode="oscuro"] .reporte-hero {
  color: var(--idee-text-inverse) !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--idee-primary-dark) 58%, var(--idee-bg-page)), color-mix(in srgb, var(--idee-primary) 42%, var(--idee-bg-page))) !important;
}

html[data-mode="oscuro"] .filter-panel {
  border-color: color-mix(in srgb, var(--idee-border-inverse) 78%, transparent) !important;
  background: color-mix(in srgb, var(--idee-bg-elevated) 16%, transparent) !important;
}

html[data-mode="oscuro"] .filter-label {
  color: color-mix(in srgb, var(--idee-text-inverse) 84%, transparent) !important;
}
