/* Relatórios / Insights — cockpit operacional premium (escopo ao painel) */

.admin-insights-panel {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.admin-insights-panel .analytics-content.ra-insights-cockpit {
  padding: 28px 32px 48px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 48%, #eef2ff 100%);
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  max-width: 1680px;
  margin: 0 auto;
}

.admin-insights-panel .analytics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}

.admin-insights-panel .analytics-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.admin-insights-panel .analytics-header p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.admin-insights-panel .analytics-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-insights-panel .date-filter,
.admin-insights-panel .secondary-btn,
.admin-insights-panel .primary-btn {
  height: 42px;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-insights-panel .date-filter:hover,
.admin-insights-panel .secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.admin-insights-panel .date-filter,
.admin-insights-panel .secondary-btn {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.95);
  color: #0f172a;
  backdrop-filter: blur(8px);
}

.admin-insights-panel .primary-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.admin-insights-panel .insights-filter-panel {
  margin-bottom: 20px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
}

.admin-insights-panel .insights-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.admin-insights-panel .insights-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.admin-insights-panel .insights-filter-field input,
.admin-insights-panel .insights-filter-field select {
  min-height: 40px;
  min-width: 150px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

.admin-insights-panel .insights-filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.admin-insights-panel .insights-compare-hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: #64748b;
}

.admin-insights-panel .insights-banner {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.admin-insights-panel .insights-banner[data-tone="bad"] {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.admin-insights-panel .insights-banner[data-tone="warn"] {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.admin-insights-panel .ra-loading-overlay {
  position: relative;
}

.admin-insights-panel .ra-loading-overlay.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.55);
  backdrop-filter: blur(2px);
  border-radius: 16px;
  z-index: 2;
  pointer-events: none;
}

/* Hero */
.admin-insights-panel .ra-hero-row {
  display: grid;
  grid-template-columns: 1.45fr minmax(300px, 0.85fr);
  gap: 18px;
  margin-bottom: 20px;
}

.admin-insights-panel .ra-hero-ai {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 42%, #ffffff 100%);
  border: 1px solid rgba(251, 146, 60, 0.22);
  border-radius: 22px;
  padding: 22px 24px;
  box-shadow: 0 12px 40px rgba(249, 115, 22, 0.08);
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: 20px;
  align-items: center;
}

.admin-insights-panel .ra-hero-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c2410c;
  background: rgba(251, 146, 60, 0.15);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.admin-insights-panel .ra-hero-ai h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.admin-insights-panel .ra-hero-ai p {
  margin: 0 0 14px;
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
  max-width: 52ch;
}

.admin-insights-panel .ra-hero-ai-metric {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ea580c;
  margin-bottom: 14px;
}

.admin-insights-panel .ra-hero-ai-cta {
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #fdba74;
  background: #fff;
  color: #c2410c;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}

.admin-insights-panel .ra-hero-ai-chart {
  height: 120px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(254, 215, 170, 0.5);
  overflow: hidden;
}

.admin-insights-panel .ra-hero-ai-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.admin-insights-panel .ra-hero-score {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

.admin-insights-panel .ra-hero-score h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.admin-insights-panel .ra-hero-score > span {
  font-size: 12px;
  color: #64748b;
}

.admin-insights-panel .ra-score-ring-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
}

.admin-insights-panel .ra-score-ring {
  position: relative;
  width: 108px;
  height: 108px;
  flex-shrink: 0;
}

.admin-insights-panel .ra-score-ring svg {
  width: 100%;
  height: 100%;
}

.admin-insights-panel .ra-score-ring-value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
}

.admin-insights-panel .ra-score-ring-value small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
}

.admin-insights-panel .ra-score-status {
  font-size: 15px;
  font-weight: 700;
  color: #16a34a;
}

.admin-insights-panel .ra-score-status.is-warn { color: #d97706; }
.admin-insights-panel .ra-score-status.is-bad { color: #dc2626; }

.admin-insights-panel .ra-score-pillars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.admin-insights-panel .ra-score-pillars li {
  font-size: 12px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-insights-panel .ra-score-pillars .ok { color: #16a34a; }
.admin-insights-panel .ra-score-pillars .warn { color: #d97706; }

/* KPI strip */
.admin-insights-panel .ra-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.admin-insights-panel .ra-kpi-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  position: relative;
  overflow: hidden;
  grid-template-columns: unset;
  grid-template-rows: unset;
  align-items: stretch;
}

.admin-insights-panel .ra-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: var(--ra-kpi-accent, #2563eb);
  opacity: 0.85;
}

.admin-insights-panel .ra-kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.admin-insights-panel .ra-kpi-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.admin-insights-panel .ra-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--ra-kpi-bg, #eff6ff);
  color: var(--ra-kpi-accent, #2563eb);
}

.admin-insights-panel .ra-kpi-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.admin-insights-panel .ra-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.25;
}

.admin-insights-panel .ra-kpi-value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.admin-insights-panel .ra-kpi-trend {
  margin: 0;
  margin-top: auto;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.admin-insights-panel .ra-kpi-trend.is-good { color: #16a34a; }
.admin-insights-panel .ra-kpi-trend.is-bad { color: #ef4444; }
.admin-insights-panel .ra-kpi-trend.is-neutral { color: #64748b; }

.admin-insights-panel .ra-kpi-spark {
  width: 72px;
  height: 32px;
  flex-shrink: 0;
  opacity: 0.92;
}

.admin-insights-panel .ra-kpi-spark svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Intel grid */
.admin-insights-panel .ra-intel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.admin-insights-panel .ra-glass-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.admin-insights-panel .ra-card-head {
  margin-bottom: 14px;
}

.admin-insights-panel .ra-card-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.admin-insights-panel .ra-card-head span {
  font-size: 12px;
  color: #64748b;
}

.admin-insights-panel .ra-ai-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.admin-insights-panel .ra-ai-insight-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.admin-insights-panel .ra-ai-insight-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.admin-insights-panel .ra-ai-insight-item strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 2px;
  line-height: 1.3;
}

.admin-insights-panel .ra-ai-insight-item p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.admin-insights-panel .ra-link-btn {
  margin-top: auto;
  align-self: flex-start;
  border: none;
  background: transparent;
  color: #2563eb;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0 0;
  font: inherit;
}

/* Heatmap */
.admin-insights-panel .ra-heatmap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-insights-panel .ra-heatmap-labels {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  gap: 4px;
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
}

.admin-insights-panel .ra-heatmap-row {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  gap: 4px;
  align-items: center;
}

.admin-insights-panel .ra-heatmap-row > span {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.admin-insights-panel .ra-heatmap-cell {
  aspect-ratio: 1.15;
  border-radius: 6px;
  min-height: 22px;
  transition: transform 0.12s ease;
}

.admin-insights-panel .ra-heatmap-cell:hover {
  transform: scale(1.06);
  z-index: 1;
}

.admin-insights-panel .ra-heatmap-note {
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
}

/* Forecast */
.admin-insights-panel .ra-forecast-metrics {
  display: grid;
  gap: 12px;
  flex: 1;
}

.admin-insights-panel .ra-forecast-row {
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border: 1px solid #dbeafe;
}

.admin-insights-panel .ra-forecast-row small {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.admin-insights-panel .ra-forecast-row strong {
  font-size: 20px;
  color: #0f172a;
}

.admin-insights-panel .ra-progress {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.admin-insights-panel .ra-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 999px;
}

/* Compare */
.admin-insights-panel .ra-compare-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.admin-insights-panel .ra-compare-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
  color: #334155;
}

.admin-insights-panel .ra-compare-list .ra-cmp-val {
  font-weight: 700;
  white-space: nowrap;
}

.admin-insights-panel .ra-compare-list .ra-cmp-val.is-good { color: #16a34a; }
.admin-insights-panel .ra-compare-list .ra-cmp-val.is-bad { color: #ef4444; }
.admin-insights-panel .ra-compare-list .ra-cmp-val.is-muted { color: #94a3b8; }

/* Bottom analytics */
.admin-insights-panel .ra-bottom-analytics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.admin-insights-panel .ra-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-insights-panel .ra-rank-table th {
  text-align: left;
  padding: 0 0 10px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-insights-panel .ra-rank-table td {
  padding: 12px 0;
  border-top: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-insights-panel .ra-pro-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-insights-panel .ra-pro-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.admin-insights-panel .ra-pro-avatar.has-photo {
  background: #e2e8f0;
  padding: 0;
}

.admin-insights-panel .ra-pro-avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-insights-panel .ra-medal {
  font-size: 14px;
  margin-right: 2px;
}

.admin-insights-panel .ra-score-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
}

.admin-insights-panel .ra-svc-diff {
  font-weight: 700;
  font-size: 12px;
}

.admin-insights-panel .ra-svc-diff.is-over { color: #dc2626; }
.admin-insights-panel .ra-svc-diff.is-under { color: #16a34a; }

.admin-insights-panel .ra-top-services {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.admin-insights-panel .ra-top-svc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
}

.admin-insights-panel .ra-top-svc-row strong {
  font-size: 13px;
  color: #0f172a;
}

.admin-insights-panel .ra-top-svc-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.admin-insights-panel .ra-top-svc-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #818cf8);
  border-radius: 999px;
}

.admin-insights-panel .ra-top-svc-meta {
  font-size: 12px;
  color: #64748b;
  text-align: right;
}

.admin-insights-panel .ra-noshow-chart {
  height: 140px;
  margin: 8px 0;
}

.admin-insights-panel .ra-noshow-chart svg {
  width: 100%;
  height: 100%;
}

.admin-insights-panel .ra-noshow-status {
  font-size: 13px;
  color: #16a34a;
  font-weight: 600;
  margin: 0;
}

.admin-insights-panel .ra-table-empty {
  text-align: center;
  color: #94a3b8;
  padding: 20px;
  font-size: 13px;
}

/* Info bar */
.admin-insights-panel .ra-info-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.admin-insights-panel .ra-info-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  backdrop-filter: blur(8px);
}

.admin-insights-panel .ra-info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.admin-insights-panel .ra-info-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: #eff6ff;
}

.admin-insights-panel .ra-info-card strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
  margin-bottom: 2px;
}

.admin-insights-panel .ra-info-card span {
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 1400px) {
  .admin-insights-panel .ra-kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .admin-insights-panel .ra-intel-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-insights-panel .ra-bottom-analytics { grid-template-columns: repeat(2, 1fr); }
  .admin-insights-panel .ra-hero-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .admin-insights-panel .analytics-content.ra-insights-cockpit { padding: 18px 14px 32px; }
  .admin-insights-panel .ra-kpi-strip,
  .admin-insights-panel .ra-intel-grid,
  .admin-insights-panel .ra-bottom-analytics,
  .admin-insights-panel .ra-info-bar {
    grid-template-columns: 1fr;
  }
  .admin-insights-panel .ra-hero-ai { grid-template-columns: 1fr; }
  .admin-insights-panel .analytics-header { flex-direction: column; }
}
