/* Premium RPN Audit Bar Chart */

.rpn-audit-bar-premium {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 6px 16px rgba(0, 0, 0, 0.06);
  padding: 1.5rem 1.5rem 1.25rem;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, border-color 0.2s ease;
}

.rpn-audit-bar-premium:hover {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: rgba(203, 213, 225, 0.9);
}

.rpn-audit-bar-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.rpn-audit-bar-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.rpn-audit-bar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  color: #f1f5f9;
  flex-shrink: 0;
}

.rpn-audit-bar-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary, #0f172a);
  line-height: 1.3;
}

.rpn-audit-bar-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.45;
  padding-left: 52px;
}

/* Night mode: white text for title, subtitle, and chart axes */
.night-mode .rpn-audit-bar-premium {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.night-mode .rpn-audit-bar-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.night-mode .rpn-audit-bar-title {
  color: rgba(255, 255, 255, 0.98);
}

.night-mode .rpn-audit-bar-subtitle {
  color: rgba(255, 255, 255, 0.8);
}

/* .night-mode .rpn-audit-bar-icon {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  color: rgba(255, 255, 255, 0.95);
} */

.night-mode .rpn-audit-bar-container .recharts-text,
.night-mode .rpn-audit-bar-container .recharts-cartesian-axis-tick-value {
  fill: rgba(255, 255, 255, 0.9) !important;
}

.night-mode .rpn-audit-bar-container .recharts-xAxis .recharts-line,
.night-mode .rpn-audit-bar-container .recharts-yAxis .recharts-line {
  stroke: rgba(255, 255, 255, 0.35) !important;
}

.night-mode .rpn-audit-bar-container .recharts-cartesian-grid line {
  stroke: rgba(255, 255, 255, 0.15) !important;
}

@media (max-width: 640px) {
  .rpn-audit-bar-subtitle {
    padding-left: 0;
  }
}

.rpn-audit-bar-chart-wrap {
  flex: 1;
  min-height: 280px;
}

/* Premium tooltip */
.rpn-audit-tooltip {
  background: #ffffff;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 10px 20px -4px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(226, 232, 240, 0.9);
  min-width: 140px;
}

.rpn-audit-tooltip-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.rpn-audit-tooltip-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.rpn-audit-tooltip-hint {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

/* Bar hover feedback */
.rpn-audit-bar-cell:hover {
  filter: brightness(1.08);
}

.rpn-audit-bar-container .recharts-bar-rectangle {
  transition: filter 0.2s ease;
}

@media (max-width: 768px) {
  .rpn-audit-bar-premium {
    padding: 1.25rem 1rem 1rem;
    min-height: 340px;
  }

  .rpn-audit-bar-title {
    font-size: 1.1rem;
  }

  .rpn-audit-bar-icon {
    width: 36px;
    height: 36px;
  }

  .rpn-audit-bar-icon svg {
    width: 20px;
    height: 20px;
  }
}
