.reports-view {
  display: grid;
  gap: var(--space-5);
}

.reports-hero,
.reports-nav,
.reports-toolbar,
.reports-drilldown {
  padding: var(--space-6);
  background: rgba(27, 34, 36, 0.48);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle), var(--shadow-inset);
  backdrop-filter: var(--glass-blur);
}

.reports-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.reports-hero h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.reports-hero p,
.report-chart p,
.reports-saved-card p {
  color: var(--color-text-secondary);
}

.reports-actions,
.reports-nav-list,
.reports-filter-actions,
.reports-kpi-grid,
.reports-chart-grid,
.reports-insights,
.reports-saved-grid {
  display: grid;
  gap: var(--space-3);
}

.reports-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reports-nav-list {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.report-nav-button {
  min-height: 78px;
  padding: var(--space-3);
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: left;
}

.report-nav-button.active {
  color: #fff;
  background: rgba(47, 140, 255, 0.32);
  border-color: rgba(134, 195, 255, 0.6);
}

.report-nav-button strong {
  display: block;
  color: var(--color-text-primary);
}

.reports-toolbar {
  display: grid;
  gap: var(--space-4);
}

.reports-search {
  display: flex;
  gap: var(--space-2);
}

.reports-search input {
  flex: 1;
  min-height: 42px;
  padding: 0 14px;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

.reports-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: var(--space-3);
}

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

.report-kpi {
  min-height: 138px;
  padding: var(--space-5);
  cursor: pointer;
  text-align: left;
}

.report-kpi span {
  color: var(--color-text-secondary);
  font-size: var(--font-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.report-kpi strong {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--font-2xl);
}

.report-kpi small {
  display: block;
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}

.report-trend.good { color: var(--color-success); }
.report-trend.bad { color: var(--color-danger); }

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

.report-chart {
  min-width: 0;
}

.report-bars {
  display: grid;
  gap: var(--space-3);
}

.report-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(120px, 1.6fr) auto;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-primary);
  background: transparent;
  border: 0;
  text-align: left;
}

.report-bar-track,
.report-funnel i {
  display: block;
  height: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.report-bar-track span,
.report-funnel i {
  background: linear-gradient(90deg, var(--color-secondary), var(--color-gold));
}

.report-line {
  width: 100%;
  min-height: 220px;
  color: var(--color-secondary-dark);
}

.report-line text {
  fill: rgba(241, 245, 249, 0.72);
  font-size: 11px;
}

.report-donut-wrap {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: var(--space-4);
}

.report-donut {
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--color-secondary) 0 68%, rgba(255,255,255,0.12) 68% 100%);
  box-shadow: var(--shadow-inset);
  font-size: var(--font-xl);
  font-weight: 900;
}

.report-legend,
.report-funnel,
.report-heatmap {
  display: grid;
  gap: var(--space-2);
}

.report-legend button,
.report-funnel button,
.report-heatmap button {
  display: grid;
  gap: 4px;
  padding: var(--space-3);
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-align: left;
}

.report-funnel button {
  grid-template-columns: minmax(130px, 0.8fr) minmax(120px, 1fr) auto;
  align-items: center;
}

.report-heatmap {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.report-heatmap .critical { border-color: rgba(255, 82, 79, 0.7); }
.report-heatmap .high { border-color: rgba(255, 209, 95, 0.7); }
.report-heatmap .medium { border-color: rgba(88, 166, 255, 0.6); }

.reports-insights {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.report-insight,
.reports-saved-card {
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.report-insight.success { border-color: rgba(53, 230, 106, 0.5); }
.report-insight.warning { border-color: rgba(255, 209, 95, 0.55); }
.report-insight.danger { border-color: rgba(255, 82, 79, 0.58); }
.report-insight.info { border-color: rgba(88, 166, 255, 0.54); }

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

.report-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.report-table th,
.report-table td {
  padding: 12px;
  text-align: left;
}

.report-table th {
  color: var(--color-text-secondary);
  font-size: var(--font-xs);
  text-transform: uppercase;
}

.report-table td {
  background: rgba(255, 255, 255, 0.08);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.report-table td:first-child {
  border-left: 1px solid var(--color-border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.report-table td:last-child {
  border-right: 1px solid var(--color-border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.reports-drilldown {
  display: grid;
  gap: var(--space-3);
}

@media print {
  .sidebar,
  .topbar,
  .reports-nav,
  .reports-actions,
  .reports-toolbar,
  .toast-region {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #111 !important;
  }

  .workspace,
  .main-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  .card,
  .reports-hero {
    break-inside: avoid;
    background: #fff !important;
    color: #111 !important;
    border-color: #ddd !important;
    box-shadow: none !important;
  }
}

@media (max-width: 1180px) {
  .reports-filter-grid,
  .reports-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .reports-hero,
  .report-donut-wrap {
    display: grid;
  }

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

  .reports-filter-grid,
  .reports-kpi-grid {
    grid-template-columns: 1fr;
  }

  .report-bar-row,
  .report-funnel button {
    grid-template-columns: 1fr;
  }
}

/* Ajustes de contraste y respiracion visual para Reportes */
.reports-nav,
.reports-toolbar,
.reports-drilldown,
.report-nav-button,
.report-kpi,
.report-chart,
.report-insight,
.reports-saved-card {
  color: var(--color-text-primary);
  background: #d8e1ea !important;
  border-color: rgba(126, 145, 165, 0.32) !important;
  box-shadow: var(--shadow-subtle) !important;
}

.report-nav-button {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.report-nav-button strong,
.report-kpi strong,
.report-chart h3,
.report-insight strong,
.reports-saved-card strong {
  color: var(--color-text-primary);
}

.report-nav-button p,
.report-nav-button span,
.report-kpi span,
.report-kpi small,
.report-chart p,
.report-insight p,
.reports-saved-card p {
  color: var(--color-text-secondary);
}

.report-nav-button.active {
  color: #ffffff;
  background: #5f89b3 !important;
  border-color: rgba(76, 112, 148, 0.44) !important;
}

.report-nav-button.active strong,
.report-nav-button.active p,
.report-nav-button.active span {
  color: #ffffff;
}

.reports-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
}

.reports-filter-grid label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--color-text-secondary);
  font-weight: 700;
}

.reports-filter-grid input,
.reports-filter-grid select,
.reports-toolbar input,
.reports-toolbar select {
  min-width: 0;
  width: 100%;
}

.reports-nav-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
