/* Presentación moderna del reporte de ventas. */
:root {
  --rv-primary: var(--idee-primary, #0cafea);
  --rv-primary-dark: #087da9;
  --rv-ink: var(--idee-text-primary, #111827);
  --rv-muted: var(--idee-text-muted, #64748b);
  --rv-border: var(--idee-border-color, #dbe4f0);
  --rv-shadow: 0 6px 20px rgba(15, 23, 42, .055);
}

body {
  color: var(--rv-ink) !important;
  background: radial-gradient(circle at 8% 0, color-mix(in srgb, var(--rv-primary) 10%, transparent), transparent 26rem), linear-gradient(180deg, #f8fbfd, #f3f6fa) !important;
}

body::before { display: none; }
.reporte-page { width: min(100%, 1500px); max-width: 1500px; padding: 20px 22px 36px; }

.reporte-hero {
  margin-bottom: 14px;
  padding: 19px 21px !important;
  color: var(--rv-ink) !important;
  border: 1px solid color-mix(in srgb, var(--rv-primary) 24%, var(--rv-border));
  border-radius: 18px;
  background: linear-gradient(135deg, #fff 0%, #f3fbff 72%, #e8f7fd 100%) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
  backdrop-filter: none;
}

.reporte-hero::before { display: none; }
.section-kicker { margin-bottom: 3px; color: var(--rv-primary-dark); font-size: .67rem; letter-spacing: .09em; }
.ventas-header h2 { color: var(--rv-ink); font-size: clamp(1.3rem, 2vw, 1.72rem); font-weight: 800; }
.hero-subtitle { margin-top: 4px; color: var(--rv-muted); font-size: .82rem; }

.reporte-actions { gap: 7px; }
.reporte-actions .btn {
  min-height: 35px;
  padding: 6px 11px;
  color: #087da9;
  border: 1px solid #a9dcec;
  border-radius: 10px !important;
  background: #f1fbfe;
  box-shadow: none;
  font-size: .76rem;
}

.filter-panel {
  margin-top: 12px !important;
  padding: 9px 11px;
  gap: 8px;
  border-color: #dce6ed;
  border-radius: 11px;
  background: rgba(255,255,255,.72);
}

.filter-label { color: #526174; font-size: .65rem; }
.filter-panel input[type="date"] {
  min-width: 145px;
  min-height: 35px;
  color: var(--rv-ink);
  border-color: var(--rv-border);
  border-radius: 9px;
  background: #fff;
  font-size: .75rem;
}
.filter-panel input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }

.ventas-resumen { padding: 0 0 2px !important; }
.ventas-resumen .row { --bs-gutter-x: .75rem; }
.ventas-resumen .mb-3 { margin-bottom: 12px !important; }
.summary-card {
  min-height: 78px;
  border: 1px solid var(--rv-border) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: var(--rv-shadow) !important;
}
.summary-card::before { inset: 10px auto 10px 0; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
.summary-card:hover { transform: translateY(-1px); }
.summary-card .card-body { min-height: 78px; padding: 12px 15px; }
.summary-card .card-title { color: var(--rv-muted); font-size: .69rem; }
#totalVentas, #numVentas { margin-top: 2px; font-size: 1.3rem !important; }

.table-card {
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--rv-border);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--rv-shadow);
}
.table-card-header { padding: 12px 15px; border-bottom: 1px solid #e7edf3; background: #fff; }
.table-card-header h3 { font-size: .94rem; font-weight: 800; }
.table-badge { padding: 4px 9px; color: #0e7490; border: 1px solid #bce6f2; background: #ecfafd; font-size: .66rem; }
.table-responsive { min-height: 210px; background: #fff; }
.reporte-table { min-width: 850px; margin: 0; font-size: .76rem; }
.reporte-table thead th { padding: 8px 9px; color: #526174; border-bottom: 1px solid #dce5ed; background: #f4f7fa; font-size: .63rem; }
.reporte-table tbody td { padding: 8px 9px; color: #334155; border-color: #edf1f5; background: #fff; }
.reporte-table tbody tr:hover td { background: #f5fbfe; }
.reporte-table .btn-sm { min-height: 29px; padding: 4px 8px; border-radius: 8px; color: #087da9; border-color: #a9dcec; background: #f1fbfe; font-size: .67rem; }

.reporte-modal .modal-content { border: 1px solid var(--rv-border); border-radius: 17px; background: #fff; box-shadow: 0 22px 60px rgba(15,23,42,.2); }
.reporte-modal .modal-header { padding: 13px 16px; border-bottom: 1px solid #deebf1; background: linear-gradient(135deg, #fff, #eefafe); }
.reporte-modal .modal-title { color: var(--rv-ink); font-size: .95rem; font-weight: 800; }
.reporte-modal .modal-body { color: #334155; background: #fff; }
.reporte-modal .modal-footer { padding: 10px 15px; border-top: 1px solid #e7edf3; background: #f7f9fb; }
.reporte-modal .btn-secondary { min-height: 34px; padding: 6px 11px; color: #475569; border: 1px solid var(--rv-border); border-radius: 9px; background: #fff; font-size: .75rem; }

/* Respaldo del modal: evita que su contenido aparezca al final de la página
   si los estilos de Bootstrap no cargan en el servidor. */
#modalDetallesVenta:not(.show) {
  display: none !important;
}

#modalDetallesVenta.show {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: block !important;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(15, 23, 42, .55);
}

#modalDetallesVenta.show .modal-dialog {
  width: min(500px, calc(100% - 2rem));
  margin: 1.75rem auto;
}

@media (max-width: 767.98px) {
  .reporte-page { padding: 12px 10px 24px; }
  .reporte-hero { padding: 16px !important; border-radius: 15px; }
  .reporte-actions { width: 100%; margin-top: 12px; }
  .reporte-actions .btn { flex: 1; }
  .filter-panel { align-items: stretch; flex-direction: column; }
  .filter-panel input[type="date"] { width: 100% !important; }
  .summary-card .card-body { min-height: 70px; }
}

@media (prefers-reduced-motion: reduce) { .summary-card, .btn { transition: none !important; } }

@media (min-width: 1200px) {
  .reporte-page { width: calc(100% - 48px); max-width: 1760px; padding: 28px 0 48px; }
  .reporte-hero { padding: 24px 28px !important; }
  .hero-subtitle { font-size: .92rem; }
  .reporte-actions .btn { min-height: 40px; padding: 8px 14px; font-size: .82rem; }
  .filter-panel { padding: 12px 14px; }
  .filter-panel input[type="date"] { min-width: 170px; min-height: 40px; font-size: .82rem; }
  .summary-card, .summary-card .card-body { min-height: 96px; }
  .summary-card .card-body { padding: 16px 20px; }
  .summary-card .card-title { font-size: .76rem; }
  #totalVentas, #numVentas { font-size: 1.65rem !important; }
  .table-card-header { padding: 16px 20px; }
  .table-card-header h3 { font-size: 1.05rem; }
  .reporte-table { font-size: .84rem; }
  .reporte-table thead th { padding: 11px 13px; font-size: .69rem; }
  .reporte-table tbody td { padding: 11px 13px; }
  .reporte-table .btn-sm { min-height: 33px; padding: 5px 10px; font-size: .72rem; }
}
