/* ============================================================
   REPORTING ENHANCEMENTS
   Animations, visual polish, tooltips, and micro-interactions
   for all reporting center pages.
   ============================================================ */

/* --- Entrance Animations --- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}

@keyframes barGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes ringFill {
  from { stroke-dashoffset: var(--ring-circumference, 251); }
  to   { stroke-dashoffset: var(--ring-offset, 0); }
}

@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Staggered Card Entrance --- */
.reporting-stat-card,
.reporting-card,
.reporting-link-card {
  animation: fadeSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.reporting-stat-grid--cards .reporting-stat-card:nth-child(1) { animation-delay: 0ms; }
.reporting-stat-grid--cards .reporting-stat-card:nth-child(2) { animation-delay: 60ms; }
.reporting-stat-grid--cards .reporting-stat-card:nth-child(3) { animation-delay: 120ms; }
.reporting-stat-grid--cards .reporting-stat-card:nth-child(4) { animation-delay: 180ms; }
.reporting-stat-grid--cards .reporting-stat-card:nth-child(5) { animation-delay: 240ms; }
.reporting-stat-grid--cards .reporting-stat-card:nth-child(6) { animation-delay: 300ms; }

.reporting-content-grid .reporting-card:nth-child(1) { animation-delay: 80ms; }
.reporting-content-grid .reporting-card:nth-child(2) { animation-delay: 160ms; }
.reporting-content-grid .reporting-card:nth-child(3) { animation-delay: 240ms; }
.reporting-content-grid .reporting-card:nth-child(4) { animation-delay: 320ms; }

.reporting-link-grid .reporting-link-card:nth-child(1) { animation-delay: 40ms; }
.reporting-link-grid .reporting-link-card:nth-child(2) { animation-delay: 80ms; }
.reporting-link-grid .reporting-link-card:nth-child(3) { animation-delay: 120ms; }
.reporting-link-grid .reporting-link-card:nth-child(4) { animation-delay: 160ms; }
.reporting-link-grid .reporting-link-card:nth-child(5) { animation-delay: 200ms; }
.reporting-link-grid .reporting-link-card:nth-child(6) { animation-delay: 240ms; }

/* --- Enhanced Stat Card --- */
.reporting-stat-card {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease;
}

.reporting-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  border-color: rgba(var(--reporting-accent-rgb, 22, 163, 74), 0.3);
}

.reporting-stat-card-value {
  animation: countUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.15s backwards;
  font-feature-settings: 'tnum' 1;
}

/* Stat card accent glow on hover */
.reporting-stat-card:hover::before {
  box-shadow: 4px 0 12px -2px rgba(var(--reporting-accent-rgb, 22, 163, 74), 0.25);
}

/* --- Section Dividers --- */
.reporting-divider {
  position: relative;
  height: 1px;
  margin: 28px 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(226, 232, 240, 0.9) 15%,
    rgba(226, 232, 240, 0.9) 85%,
    transparent 100%
  );
}

.reporting-divider::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0 12px;
  background: var(--bg-primary, #f8fafc);
  color: var(--text-muted, #64748b);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.reporting-divider--accent::after {
  color: var(--reporting-accent, #16a34a);
}

/* --- Enhanced Table Rows --- */
.reporting-table tbody tr {
  transition: background 0.15s ease, transform 0.12s ease;
}

.reporting-table tbody tr:hover td {
  background: rgba(248, 250, 252, 0.95);
}

.reporting-table tbody tr.reporting-tr--highlight {
  animation: fadeSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.reporting-table tbody tr:nth-child(1) { animation-delay: 0ms; }
.reporting-table tbody tr:nth-child(2) { animation-delay: 30ms; }
.reporting-table tbody tr:nth-child(3) { animation-delay: 60ms; }
.reporting-table tbody tr:nth-child(4) { animation-delay: 90ms; }
.reporting-table tbody tr:nth-child(5) { animation-delay: 120ms; }
.reporting-table tbody tr:nth-child(6) { animation-delay: 150ms; }
.reporting-table tbody tr:nth-child(7) { animation-delay: 180ms; }
.reporting-table tbody tr:nth-child(8) { animation-delay: 210ms; }

/* --- Trend Bar Animations --- */
.trend-bar {
  transform-origin: left center;
  animation: barGrow 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.reporting-trend-row:nth-child(1) .trend-bar { animation-delay: 0ms; }
.reporting-trend-row:nth-child(2) .trend-bar { animation-delay: 60ms; }
.reporting-trend-row:nth-child(3) .trend-bar { animation-delay: 120ms; }
.reporting-trend-row:nth-child(4) .trend-bar { animation-delay: 180ms; }
.reporting-trend-row:nth-child(5) .trend-bar { animation-delay: 240ms; }
.reporting-trend-row:nth-child(6) .trend-bar { animation-delay: 300ms; }
.reporting-trend-row:nth-child(7) .trend-bar { animation-delay: 360ms; }
.reporting-trend-row:nth-child(8) .trend-bar { animation-delay: 420ms; }

/* --- Tooltip System --- */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 8px 12px;
  border-radius: 8px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  max-width: 240px;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}

[data-tooltip]::after {
  content: '';
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 5px solid transparent;
  border-top-color: #1e293b;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip positioning variants */
[data-tooltip-pos="right"]::before {
  bottom: auto;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
}

[data-tooltip-pos="right"]:hover::before {
  transform: translateY(-50%) translateX(0);
}

[data-tooltip-pos="right"]::after {
  bottom: auto;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  border: 5px solid transparent;
  border-right-color: #1e293b;
}

[data-tooltip-pos="right"]:hover::after {
  transform: translateY(-50%) translateX(0);
}

/* --- Live Indicator Pulse --- */
.reporting-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: pulseGlow 2s ease-in-out infinite;
  margin-right: 6px;
  vertical-align: middle;
}

.reporting-live-dot--warning {
  background: #f59e0b;
  animation-name: pulseGlow;
  --pulse-color: rgba(245, 158, 11, 0.3);
}

/* --- Progress Ring --- */
.reporting-progress-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.reporting-progress-ring svg {
  transform: rotate(-90deg);
}

.reporting-progress-ring circle.ring-bg {
  fill: none;
  stroke: rgba(226, 232, 240, 0.7);
}

.reporting-progress-ring circle.ring-fill {
  fill: none;
  stroke: var(--reporting-accent, #16a34a);
  stroke-linecap: round;
  animation: ringFill 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reporting-progress-ring .ring-label {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

/* --- Sparkline Inline --- */
.reporting-sparkline {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

.reporting-sparkline svg {
  overflow: visible;
}

.reporting-sparkline path {
  fill: none;
  stroke: var(--reporting-accent, #16a34a);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reporting-sparkline .sparkline-area {
  fill: rgba(var(--reporting-accent-rgb, 22, 163, 74), 0.08);
  stroke: none;
}

/* --- Enhanced Cards — Glass Effect --- */
.reporting-card--glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.reporting-card--elevated {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08),
              0 4px 12px rgba(15, 23, 42, 0.04);
  border-color: rgba(226, 232, 240, 0.5);
}

.reporting-card--elevated:hover {
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12),
              0 6px 16px rgba(15, 23, 42, 0.06);
  transform: translateY(-2px);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Gradient Header Bar --- */
.reporting-card--hero {
  position: relative;
  overflow: hidden;
}

.reporting-card--hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--reporting-accent, #16a34a),
    color-mix(in srgb, var(--reporting-accent, #16a34a) 60%, #2563eb)
  );
}

/* --- Metric Comparison Badge --- */
.reporting-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.reporting-delta--up {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.reporting-delta--down {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.reporting-delta--flat {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.reporting-delta__arrow {
  font-size: 0.65rem;
}

/* --- Metric Mini Card (inline stat with icon) --- */
.reporting-metric-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-card, #ffffff);
  border: 1px solid rgba(226, 232, 240, 0.7);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.reporting-metric-mini:hover {
  border-color: rgba(var(--reporting-accent-rgb, 22, 163, 74), 0.3);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.reporting-metric-mini__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--reporting-accent-light, rgba(22, 163, 74, 0.1));
  color: var(--reporting-accent, #16a34a);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.reporting-metric-mini__body {
  min-width: 0;
}

.reporting-metric-mini__value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  line-height: 1;
}

.reporting-metric-mini__label {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* --- Status Indicator Strip --- */
.reporting-status-strip {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0;
}

.reporting-status-strip__segment {
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Enhanced Skeleton Loading --- */
.reporting-skeleton {
  background: linear-gradient(
    90deg,
    rgba(226, 232, 240, 0.4) 25%,
    rgba(241, 245, 249, 0.8) 50%,
    rgba(226, 232, 240, 0.4) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.reporting-skeleton--short {
  height: 12px;
  width: 60%;
}

.reporting-skeleton--title {
  height: 28px;
  width: 40%;
  margin-top: 4px;
}

.reporting-skeleton--line {
  height: 14px;
  width: 100%;
  margin-bottom: 10px;
}

.reporting-skeleton--circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* --- Notification Badge / Counter --- */
.reporting-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--reporting-accent, #16a34a);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.reporting-badge-count--warning {
  background: #f59e0b;
}

.reporting-badge-count--danger {
  background: #dc2626;
}

/* --- Section Header with Counter and Decorative Line --- */
.reporting-section-header--decorated {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.reporting-section-header--decorated::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--reporting-accent, #16a34a);
}

/* --- Popup Detail Card (click-to-expand) --- */
.reporting-popup-trigger {
  cursor: pointer;
  position: relative;
}

.reporting-popup-card {
  position: absolute;
  z-index: 150;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px) scale(0.96);
  min-width: 260px;
  max-width: 360px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.14),
              0 6px 16px rgba(15, 23, 42, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.reporting-popup-card.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.reporting-popup-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.reporting-popup-card__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.reporting-popup-card__close {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  background: rgba(226, 232, 240, 0.6);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s ease;
}

.reporting-popup-card__close:hover {
  background: rgba(226, 232, 240, 1);
}

.reporting-popup-card__body {
  font-size: 0.82rem;
  color: var(--text-secondary, #475569);
  line-height: 1.55;
}

/* --- Quick Action Row (below stats) --- */
.reporting-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.reporting-quick-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: var(--bg-card, #ffffff);
  color: var(--text-secondary, #475569);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reporting-quick-action:hover {
  border-color: var(--reporting-accent, #16a34a);
  color: var(--reporting-accent, #16a34a);
  background: var(--reporting-accent-light, rgba(22, 163, 74, 0.06));
  transform: translateY(-1px);
}

.reporting-quick-action.is-active {
  border-color: var(--reporting-accent, #16a34a);
  background: var(--reporting-accent-light, rgba(22, 163, 74, 0.1));
  color: var(--reporting-accent, #16a34a);
}

/* --- Animated Number Display (for hero metrics) --- */
.reporting-hero-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

.reporting-hero-metric__value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1;
  animation: countUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards;
}

.reporting-hero-metric__label {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.reporting-hero-metric__context {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary, #475569);
}

/* --- Data Freshness Indicator --- */
.reporting-freshness {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(226, 232, 240, 0.5);
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.reporting-freshness--live {
  background: rgba(22, 163, 74, 0.08);
  color: #16a34a;
}

.reporting-freshness--stale {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
}

/* --- Filter Chip Tags --- */
.reporting-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--reporting-accent-light, rgba(22, 163, 74, 0.1));
  color: var(--reporting-accent, #16a34a);
  font-size: 0.72rem;
  font-weight: 700;
}

.reporting-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  font-size: 0.6rem;
  transition: background 0.15s;
}

.reporting-chip__remove:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* --- Card Hover Shine Effect --- */
.reporting-card--shine {
  position: relative;
  overflow: hidden;
}

.reporting-card--shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
  pointer-events: none;
}

.reporting-card--shine:hover::before {
  left: 130%;
}

/* --- Better Empty States --- */
.reporting-empty-enhanced {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 32px;
  animation: scaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.reporting-empty-enhanced__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.5), rgba(241, 245, 249, 0.9));
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.reporting-empty-enhanced__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0 0 6px;
}

.reporting-empty-enhanced__copy {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  max-width: 320px;
  line-height: 1.55;
}

/* --- Responsive Refinements --- */
@media (max-width: 640px) {
  .reporting-stat-card:hover {
    transform: none;
  }

  .reporting-hero-metric__value {
    font-size: 2.2rem;
  }

  .reporting-popup-card {
    position: fixed;
    top: auto;
    bottom: 16px;
    left: 16px;
    right: 16px;
    transform: translateY(8px);
    max-width: none;
  }

  .reporting-popup-card.is-visible {
    transform: translateY(0);
  }
}

/* --- Dark Mode Overrides --- */
[data-theme="dark"] .reporting-stat-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.96));
  border-color: rgba(51, 65, 85, 0.6);
}

[data-theme="dark"] .reporting-stat-card-value {
  color: #f1f5f9;
}

[data-theme="dark"] .reporting-stat-card-label {
  color: #94a3b8;
}

[data-theme="dark"] .reporting-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .reporting-card-title {
  color: #f1f5f9;
}

[data-theme="dark"] .reporting-card-subtitle,
[data-theme="dark"] .reporting-card-body--muted,
[data-theme="dark"] .reporting-empty-copy {
  color: #94a3b8;
}

[data-theme="dark"] .reporting-section-title {
  color: #f1f5f9;
}

[data-theme="dark"] .reporting-section-subtitle {
  color: #94a3b8;
}

[data-theme="dark"] .reporting-table th {
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  border-color: rgba(51, 65, 85, 0.6);
}

[data-theme="dark"] .reporting-table td {
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  border-color: rgba(51, 65, 85, 0.4);
}

[data-theme="dark"] .reporting-table tr:hover td {
  background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .reporting-table-wrap {
  border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .reporting-trend-track {
  background: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .reporting-trend-value {
  color: #e2e8f0;
}

[data-theme="dark"] .reporting-trend-label {
  color: #cbd5e1;
}

[data-theme="dark"] .reporting-filter-label {
  color: #94a3b8;
}

[data-theme="dark"] .reporting-filter-select {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(51, 65, 85, 0.6);
  color: #e2e8f0;
}

[data-theme="dark"] .reporting-link-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border-color: rgba(51, 65, 85, 0.6);
  color: #f1f5f9;
}

[data-theme="dark"] .reporting-link-card__copy {
  color: #94a3b8;
}

[data-theme="dark"] .reporting-link-card:hover {
  border-color: rgba(22, 163, 74, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .reporting-divider {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(51, 65, 85, 0.6) 15%,
    rgba(51, 65, 85, 0.6) 85%,
    transparent 100%
  );
}

[data-theme="dark"] .reporting-divider::after {
  background: var(--bg-card, #1e293b);
  color: #94a3b8;
}

[data-theme="dark"] .reporting-popup-card {
  background: #1e293b;
  border-color: rgba(51, 65, 85, 0.8);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .reporting-metric-mini {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .reporting-metric-mini__value {
  color: #f1f5f9;
}

[data-theme="dark"] .reporting-quick-action {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(51, 65, 85, 0.6);
  color: #cbd5e1;
}

[data-theme="dark"] [data-tooltip]::before {
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] [data-tooltip]::after {
  border-top-color: #0f172a;
}

[data-theme="dark"] .reporting-digest-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .reporting-state-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .reporting-inline-alert {
  background: rgba(180, 83, 9, 0.08);
  border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .reporting-skeleton {
  background: linear-gradient(
    90deg,
    rgba(51, 65, 85, 0.3) 25%,
    rgba(71, 85, 105, 0.5) 50%,
    rgba(51, 65, 85, 0.3) 75%
  );
  background-size: 200% 100%;
}

/* --- Accent RGB values for rgba() usage --- */
.reporting-stat-card--green { --reporting-accent-rgb: 22, 163, 74; }
.reporting-stat-card--red { --reporting-accent-rgb: 220, 38, 38; }
.reporting-stat-card--blue { --reporting-accent-rgb: 37, 99, 235; }
.reporting-stat-card--amber { --reporting-accent-rgb: 217, 119, 6; }
.reporting-stat-card--teal { --reporting-accent-rgb: 8, 145, 178; }
.reporting-stat-card--purple { --reporting-accent-rgb: 99, 102, 241; }

/* ============================================================
   DESIGN SYSTEM POLISH — Phase 2
   Unified interactive states, keyboard accessibility,
   animation refinements, and dark mode coverage for all
   reporting module families (.br-*, .ed-*, .fleet-*, .voc-*).
   ============================================================ */

/* --- Design Timing Tokens --- */
:root {
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-micro: 0.1s;
  --duration-fast: 0.2s;
  --duration-normal: 0.3s;
  --duration-slow: 0.5s;
  --duration-slower: 0.8s;
  --focus-ring: 0 0 0 3px rgba(22, 163, 74, 0.25);
  --focus-ring-blue: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* --- Universal Focus-Visible Ring (Keyboard Accessibility) --- */
.br-tech-card:focus-visible,
.br-company-perf-card:focus-visible,
.br-leader-item:focus-visible,
.ed-row:focus-visible,
.ed-action-btn:focus-visible,
.reporting-stat-card:focus-visible,
.reporting-card:focus-visible,
.reporting-link-card:focus-visible,
.reporting-quick-action:focus-visible,
.reporting-digest-card:focus-visible,
.voc-card:focus-visible,
.voc-csr-card:focus-visible,
.voc-range-btn:focus-visible,
.fleet-operations-tab:focus-visible,
.chatbot-confirm-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.br-search-input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-blue);
  border-color: var(--accent-blue, #2563eb);
}

/* --- Bag Rate Cards: Hover + Animation Polish --- */
.br-tech-card {
  transition: transform var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}

.br-tech-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  border-color: rgba(var(--reporting-accent-rgb, 22, 163, 74), 0.25);
}

.br-tech-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.br-company-perf-card {
  transition: transform var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}

.br-company-perf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

/* Bag rate card staggered entrance */
.br-tech-grid .br-tech-card {
  animation: fadeSlideUp 0.35s var(--ease-smooth) backwards;
}

.br-tech-grid .br-tech-card:nth-child(1) { animation-delay: 0ms; }
.br-tech-grid .br-tech-card:nth-child(2) { animation-delay: 40ms; }
.br-tech-grid .br-tech-card:nth-child(3) { animation-delay: 80ms; }
.br-tech-grid .br-tech-card:nth-child(4) { animation-delay: 120ms; }
.br-tech-grid .br-tech-card:nth-child(5) { animation-delay: 160ms; }
.br-tech-grid .br-tech-card:nth-child(6) { animation-delay: 200ms; }
.br-tech-grid .br-tech-card:nth-child(7) { animation-delay: 240ms; }
.br-tech-grid .br-tech-card:nth-child(8) { animation-delay: 280ms; }
.br-tech-grid .br-tech-card:nth-child(n+9) { animation-delay: 320ms; }

/* Leaderboard item interactive states */
.br-leader-item {
  transition: background var(--duration-micro) ease,
              transform var(--duration-fast) var(--ease-smooth);
  border-radius: var(--radius-md, 8px);
}

.br-leader-item:hover {
  background: rgba(248, 250, 252, 0.95);
  transform: translateX(2px);
}

.br-leader-item.attention:hover {
  background: rgba(254, 242, 242, 0.6);
}

/* Bag rate slider fill animation */
.br-slider-fill {
  transition: width var(--duration-slow) var(--ease-smooth);
}

.br-slider-optimal {
  transition: left var(--duration-slow) var(--ease-smooth),
              width var(--duration-slow) var(--ease-smooth);
}

/* Monthly bar grow animation */
.br-monthly-bar {
  transform-origin: bottom center;
  animation: barGrow 0.5s var(--ease-smooth) backwards;
}

/* --- Estimates Dashboard: Interactive Polish --- */
.ed-row {
  transition: background var(--duration-micro) ease,
              box-shadow var(--duration-fast) ease;
  border-radius: var(--radius-sm, 6px);
}

.ed-row:hover {
  background: rgba(248, 250, 252, 0.95);
  box-shadow: inset 3px 0 0 var(--accent-green, #16a34a);
}

.ed-action-btn {
  transition: background var(--duration-micro) ease,
              transform var(--duration-micro) var(--ease-smooth),
              box-shadow var(--duration-fast) ease;
}

.ed-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ed-action-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* KPI card entrance */
.ed-kpi-card {
  animation: fadeSlideUp 0.3s var(--ease-smooth) backwards;
}

.ed-kpi-card:nth-child(1) { animation-delay: 0ms; }
.ed-kpi-card:nth-child(2) { animation-delay: 60ms; }
.ed-kpi-card:nth-child(3) { animation-delay: 120ms; }
.ed-kpi-card:nth-child(4) { animation-delay: 180ms; }

/* Progress bar smooth fill */
.ed-progress-fill,
.ed-close-rate-fill {
  transition: width var(--duration-slower) var(--ease-smooth);
}

/* --- VOC Cards: Consistency Polish --- */
.voc-card {
  transition: transform var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}

.voc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.voc-csr-card {
  transition: transform var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) ease;
}

.voc-csr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

/* VOC score ring polish */
.voc-score-ring-label {
  font-feature-settings: 'tnum' 1;
}

/* VOC range button transitions */
.voc-range-btn {
  transition: background var(--duration-micro) ease,
              color var(--duration-micro) ease,
              border-color var(--duration-micro) ease;
}

/* --- Fleet Operations: Tab + Card Polish --- */
.fleet-operations-tab {
  transition: background var(--duration-micro) ease,
              color var(--duration-micro) ease,
              box-shadow var(--duration-fast) ease;
}

.fleet-operations-tab:hover:not(.active) {
  background: rgba(248, 250, 252, 0.8);
}

/* --- Chatbot: Animated Typing Indicator --- */
@keyframes chatbotDotPulse {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.chatbot-typing-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted, #64748b);
  animation: chatbotDotPulse 1.2s ease-in-out infinite;
}

.chatbot-typing-dot:nth-child(1) { animation-delay: 0ms; }
.chatbot-typing-dot:nth-child(2) { animation-delay: 150ms; }
.chatbot-typing-dot:nth-child(3) { animation-delay: 300ms; }

/* Chatbot message entrance */
.chatbot-msg {
  animation: fadeSlideUp 0.25s var(--ease-smooth);
}

/* Chatbot tool pill polish */
.chatbot-tool-pill {
  transition: background var(--duration-micro) ease,
              transform var(--duration-micro) var(--ease-smooth);
}

.chatbot-tool-pill:hover {
  background: rgba(22, 163, 74, 0.15);
  transform: scale(1.02);
}

/* --- Modal Backdrop Blur --- */
.reporting-digest-modal__overlay,
.modal-backdrop,
.chatbot-confirm-overlay {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Modal entrance animation */
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.reporting-digest-modal__content,
.modal-content {
  animation: modalSlideUp 0.3s var(--ease-smooth);
}

/* --- Button Active/Pressed State (Universal) --- */
button:active:not(:disabled),
[role="button"]:active:not(:disabled) {
  transform: scale(0.97);
}

/* --- Consistent Table Row Hover --- */
.br-detail-table tbody tr,
.ed-complaint-table tbody tr,
.wash-compliance-table tbody tr {
  transition: background var(--duration-micro) ease;
}

.br-detail-table tbody tr:hover,
.ed-complaint-table tbody tr:hover,
.wash-compliance-table tbody tr:hover {
  background: rgba(248, 250, 252, 0.95);
}

/* --- Comparison Bar Polish --- */
.br-comparison-bar-item .bar-fill {
  transition: width var(--duration-slow) var(--ease-smooth);
  border-radius: 4px;
}

.br-comparison-bar-item .bar-track {
  transition: background var(--duration-fast) ease;
  border-radius: 4px;
  overflow: hidden;
}

/* --- Scroll Snap for Tab Bars (mobile) --- */
@media (max-width: 640px) {
  .fleet-operations-tabs,
  .voc-range-bar {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .fleet-operations-tabs::-webkit-scrollbar,
  .voc-range-bar::-webkit-scrollbar {
    display: none;
  }

  .fleet-operations-tab,
  .voc-range-btn {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* --- Dark Mode: Bag Rate Module --- */
[data-theme="dark"] .br-tech-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(51, 65, 85, 0.6);
}

[data-theme="dark"] .br-tech-card:hover {
  border-color: rgba(22, 163, 74, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .br-tech-name,
[data-theme="dark"] .br-leader-name {
  color: #f1f5f9;
}

[data-theme="dark"] .br-tech-meta,
[data-theme="dark"] .br-chart-explain {
  color: #94a3b8;
}

[data-theme="dark"] .br-company-perf-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(51, 65, 85, 0.6);
}

[data-theme="dark"] .br-company-perf-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .br-slider-track {
  background: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .br-detail-panel {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(51, 65, 85, 0.6);
}

[data-theme="dark"] .br-detail-stat-value {
  color: #f1f5f9;
}

[data-theme="dark"] .br-detail-stat-label {
  color: #94a3b8;
}

[data-theme="dark"] .br-info-panel {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}

[data-theme="dark"] .br-leader-item:hover {
  background: rgba(30, 41, 59, 0.8);
}

[data-theme="dark"] .br-leader-item.attention:hover {
  background: rgba(127, 29, 29, 0.15);
}

[data-theme="dark"] .br-leader-rate {
  color: #f1f5f9;
}

[data-theme="dark"] .br-search-input {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(51, 65, 85, 0.6);
  color: #e2e8f0;
}

/* --- Dark Mode: Estimates Dashboard Module --- */
[data-theme="dark"] .ed-row:hover {
  background: rgba(30, 41, 59, 0.6);
}

[data-theme="dark"] .ed-kpi-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(51, 65, 85, 0.6);
}

[data-theme="dark"] .ed-action-btn {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}

[data-theme="dark"] .ed-complaint-row {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(51, 65, 85, 0.4);
}

/* --- Dark Mode: Chatbot --- */
[data-theme="dark"] .chatbot-confirm-card {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(51, 65, 85, 0.6);
  border-left-color: #d97706;
}

[data-theme="dark"] .chatbot-confirm-title {
  color: #fbbf24;
}

[data-theme="dark"] .chatbot-confirm-detail {
  color: #cbd5e1;
}

[data-theme="dark"] .chatbot-typing-dot {
  background: #94a3b8;
}

/* --- Dark Mode: VOC Module Extended --- */
[data-theme="dark"] .voc-csr-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .voc-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* --- Print Styles --- */
@media print {
  .reporting-stat-card,
  .reporting-card,
  .br-tech-card,
  .voc-card {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .reporting-quick-actions,
  .br-search-input,
  .voc-range-bar {
    display: none !important;
  }
}

/* ============================================================
   REPORTING CENTER V2 — Design System
   Merged from Claude Design: design-system.css + reporting-center.css
   ============================================================ */

/* ── RC Design Tokens (scoped to reporting surfaces) ──────── */
.reporting-surface {
  --rc-font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --rc-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --rc-radius-sm: 6px;
  --rc-radius: 10px;
  --rc-radius-lg: 14px;
  --rc-shadow-1: 0 1px 0 rgba(15,20,25,0.04), 0 1px 2px rgba(15,20,25,0.04);
  --rc-shadow-2: 0 8px 24px -8px rgba(15,20,25,0.10), 0 1px 0 rgba(15,20,25,0.04);
  --rc-ease: cubic-bezier(.2,.7,.3,1);
  --rc-pad: 20px;
  --rc-pad-sm: 12px;
  --rc-row-h: 44px;
}

/* ── Sub-nav: tabs within a reporting center ──────────────── */
.rc-subnav {
  display: flex; gap: 6px;
  padding: 0 32px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
  position: sticky; top: 64px; z-index: 4;
  margin-bottom: 24px;
}
.rc-subnav-item {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 120ms, border-color 120ms;
  background: none; border-top: 0; border-left: 0; border-right: 0;
  font-family: inherit;
}
.rc-subnav-item:hover { color: var(--text-primary); }
.rc-subnav-item[data-active="true"] {
  color: var(--accent-green-dark);
  border-bottom-color: var(--accent-green);
  font-weight: 600;
}
.rc-subnav-item .badge-mini {
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  background: var(--slate-100, #f1f5f9); color: var(--slate-600, #475569);
}

/* ── Filter bar ──────────────────────────────────────────── */
.rc-filterbar {
  display: flex; gap: 8px; align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  margin-bottom: 24px;
}
.rc-filterbar .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 600;
}
.rc-filterbar .seg {
  display: inline-flex; background: var(--bg-card-alt, #f8fafc); border-radius: 8px; padding: 2px;
}
.rc-filterbar .seg button {
  padding: 5px 10px; font-size: 12px; font-family: inherit;
  border: 0; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 6px;
}
.rc-filterbar .seg button[data-active="true"] {
  background: #fff; color: var(--text-primary); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.rc-filterbar .grow { flex: 1; }

/* ── Section header ──────────────────────────────────────── */
.rc-section { margin-bottom: 32px; }
.rc-section-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
}
.rc-section-head h2 {
  margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 8px;
}
.rc-section-head .accent {
  display: inline-block; width: 4px; height: 16px; border-radius: 2px;
  background: var(--accent-green);
}
.rc-section-head .sub {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.rc-section-head .right { display: flex; gap: 6px; align-items: center; font-size: 12px; }

/* ── KPI grid & tiles ────────────────────────────────────── */
.rc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.rc-kpi {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
}
.rc-kpi:hover { box-shadow: var(--shadow-md); border-color: var(--slate-300, #cbd5e1); transform: translateY(-1px); }
.rc-kpi-tone {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--accent-green);
}
.rc-kpi[data-tone="amber"] .rc-kpi-tone { background: var(--accent-amber); }
.rc-kpi[data-tone="red"] .rc-kpi-tone { background: var(--accent-red); }
.rc-kpi[data-tone="blue"] .rc-kpi-tone { background: var(--accent-blue); }
.rc-kpi[data-tone="purple"] .rc-kpi-tone { background: var(--accent-purple); }
.rc-kpi[data-tone="cyan"] .rc-kpi-tone { background: var(--accent-cyan, #0891b2); }
.rc-kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rc-kpi-label {
  font-size: 11.5px; color: var(--text-muted); font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.rc-kpi-value {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-primary);
  font-feature-settings: 'tnum';
  display: flex; align-items: baseline; gap: 4px;
}
.rc-kpi-unit { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.rc-kpi-delta {
  font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 4px; margin-top: 4px;
}
.rc-kpi-delta[data-tone="pos"] { background: var(--accent-green-light); color: var(--accent-green-dark); }
.rc-kpi-delta[data-tone="neg"] { background: var(--accent-red-light); color: var(--accent-red); }
.rc-kpi-delta[data-tone="neutral"] { background: var(--slate-100, #f1f5f9); color: var(--slate-500, #64748b); }
.rc-kpi-foot { margin-top: 8px; font-size: 11px; color: var(--text-muted); }

/* ── Card frame ──────────────────────────────────────────── */
.rc-card {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 18px;
}
.rc-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rc-card-head h3 {
  margin: 0; font-size: 13.5px; font-weight: 700;
  color: var(--text-primary); letter-spacing: -0.005em;
}
.rc-card-head .sub { font-size: 11.5px; color: var(--text-muted); }

/* ── Data row ────────────────────────────────────────────── */
.rc-row {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 120ms;
}
.rc-row:last-child { border-bottom: 0; }
.rc-row:hover { background: var(--bg-card-alt, #f8fafc); }
.rc-row .who { font-weight: 600; color: var(--text-primary); }
.rc-row .meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Severity dot ────────────────────────────────────────── */
.rc-sev { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--slate-300, #cbd5e1); flex-shrink: 0; }
.rc-sev[data-sev="critical"] { background: var(--accent-red); box-shadow: 0 0 0 2px var(--accent-red-light); }
.rc-sev[data-sev="watch"] { background: var(--accent-amber); }
.rc-sev[data-sev="ok"] { background: var(--accent-green); }
.rc-sev[data-sev="info"] { background: var(--accent-blue); }

/* ── Pill / badge ────────────────────────────────────────── */
.rc-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: var(--slate-100, #f1f5f9); color: var(--slate-600, #475569);
}
.rc-pill[data-tone="pos"] { background: var(--accent-green-light); color: var(--accent-green-dark); }
.rc-pill[data-tone="neg"] { background: var(--accent-red-light); color: var(--accent-red); }
.rc-pill[data-tone="amber"] { background: var(--accent-amber-light); color: var(--accent-amber); }
.rc-pill[data-tone="blue"] { background: var(--accent-blue-light); color: var(--accent-blue); }
.rc-pill[data-tone="purple"] { background: var(--accent-purple-light); color: var(--accent-purple); }

/* ── Layout helpers ──────────────────────────────────────── */
.rc-2col { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.rc-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ── CFI gauge ───────────────────────────────────────────── */
.rc-gauge { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.rc-gauge-svg { display: block; }
.rc-gauge-label {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.rc-gauge-value {
  font-size: 32px; font-weight: 800; letter-spacing: -0.02em;
  font-feature-settings: 'tnum'; margin: 4px 0;
}
.rc-gauge-zone {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 4px; text-transform: uppercase;
}
.rc-gauge-zone[data-zone="ok"] { background: var(--accent-green-light); color: var(--accent-green-dark); }
.rc-gauge-zone[data-zone="watch"] { background: var(--accent-amber-light); color: var(--accent-amber); }
.rc-gauge-zone[data-zone="risk"] { background: var(--accent-red-light); color: var(--accent-red); }
.rc-gauge-desc { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.45; }

/* ── CFI driver tiles ────────────────────────────────────── */
.rc-drivers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rc-driver {
  padding: 12px;
  background: var(--bg-card-alt, #f8fafc);
  border: 1px solid var(--border-light, #f1f5f9);
  border-radius: 10px;
}
.rc-driver-label {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin-bottom: 4px;
}
.rc-driver-value { font-size: 14px; font-weight: 700; }
.rc-driver-value[data-tone="pos"] { color: var(--accent-green-dark); }
.rc-driver-value[data-tone="warn"] { color: var(--accent-amber); }
.rc-driver-value[data-tone="neg"] { color: var(--accent-red); }
.rc-driver-detail { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

/* ── Radar chart ─────────────────────────────────────────── */
.rc-radar { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; }
.rc-radar-svg { display: block; }
.rc-radar-list { display: flex; flex-direction: column; gap: 6px; }
.rc-radar-list .row {
  display: grid; grid-template-columns: 90px 1fr 40px;
  gap: 8px; align-items: center; font-size: 12px;
}
.rc-radar-list .row .label { color: var(--text-secondary); }
.rc-radar-list .row .bar {
  height: 6px; border-radius: 3px;
  background: var(--slate-100, #f1f5f9); position: relative; overflow: hidden;
}
.rc-radar-list .row .bar::after {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--accent-blue);
  border-radius: 3px; width: var(--p, 50%);
}
.rc-radar-list .row .num { font-weight: 600; font-feature-settings: 'tnum'; color: var(--text-primary); text-align: right; }

/* ── Topic chip (Voice) ──────────────────────────────────── */
.rc-topic-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--bg-card-alt, #f8fafc);
  border: 1px solid var(--border-light, #f1f5f9);
  border-radius: 8px;
  font-size: 12px; color: var(--text-secondary);
  cursor: pointer;
}
.rc-topic-chip:hover { background: #fff; border-color: var(--slate-300, #cbd5e1); }

/* ── Empty / pending states ──────────────────────────────── */
.rc-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  background: var(--bg-card-alt, #f8fafc);
  border-radius: 10px;
  border: 1px dashed var(--border-default);
}
.rc-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 36px 28px; text-align: center;
  background: var(--bg-card-alt, #f8fafc); border-radius: 10px;
  border: 1px dashed var(--border-default); min-height: 180px;
}
.rc-state-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.rc-state-body { font-size: 12px; color: var(--text-secondary); max-width: 380px; line-height: 1.5; }

/* ── Drawer ──────────────────────────────────────────────── */
.rc-drawer-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms;
}
.rc-drawer-mask[data-open="true"] { opacity: 1; pointer-events: auto; }
.rc-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 560px; max-width: 92vw;
  background: #fff;
  z-index: 51;
  box-shadow: -10px 0 40px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.2, 0, 0, 1);
  display: flex; flex-direction: column;
}
.rc-drawer[data-open="true"] { transform: translateX(0); }
.rc-drawer-head {
  display: flex; gap: 12px; align-items: start;
  padding: 18px 22px; border-bottom: 1px solid var(--border-default);
  background: linear-gradient(180deg, #fff, var(--bg-card-alt, #f8fafc));
}
.rc-drawer-eye {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.rc-drawer-title {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text-primary); margin-top: 2px;
}
.rc-drawer-close {
  margin-left: auto;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border-default); background: #fff;
  display: grid; place-items: center;
  cursor: pointer; color: var(--text-muted);
}
.rc-drawer-close:hover { background: var(--bg-card-alt, #f8fafc); color: var(--text-primary); }
.rc-drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.rc-drawer-foot {
  display: flex; gap: 8px; justify-content: end;
  padding: 14px 22px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-card-alt, #f8fafc);
}

/* ── Bars (vertical, dual color) ─────────────────────────── */
.rc-bars { display: flex; align-items: end; gap: 3px; height: 80px; }
.rc-bar-v { flex: 1; background: var(--accent-green); border-radius: 2px 2px 0 0; min-height: 2px; transition: opacity 120ms; }
.rc-bar-v:hover { opacity: 0.8; }
.rc-bar-v[data-tone="amber"] { background: var(--accent-amber); }
.rc-bar-v[data-tone="red"] { background: var(--accent-red); }

/* ── AOI cards (Areas of Interest) ───────────────────────── */
.rc-aoi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}
.rc-aoi-card {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 16px;
  border-left: 4px solid var(--accent-amber);
  cursor: pointer;
  transition: all 120ms;
}
.rc-aoi-card:hover { border-color: var(--slate-300, #cbd5e1); box-shadow: var(--shadow-md); }
.rc-aoi-card[data-sev="critical"] { border-left-color: var(--accent-red); }
.rc-aoi-card[data-sev="watch"] { border-left-color: var(--accent-amber); }
.rc-aoi-card[data-sev="info"] { border-left-color: var(--accent-blue); }
.rc-aoi-head { display: flex; gap: 10px; align-items: start; margin-bottom: 8px; }
.rc-aoi-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 6px; border-radius: 4px;
  background: var(--accent-amber-light); color: var(--accent-amber);
}
.rc-aoi-card[data-sev="critical"] .rc-aoi-tag { background: var(--accent-red-light); color: var(--accent-red); }
.rc-aoi-card[data-sev="info"] .rc-aoi-tag { background: var(--accent-blue-light); color: var(--accent-blue); }
.rc-aoi-title { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--text-primary); }
.rc-aoi-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.rc-aoi-body { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; margin-top: 6px; }
.rc-aoi-body b { color: var(--text-primary); font-weight: 600; }
.rc-aoi-foot {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border-light, #f1f5f9);
}
.rc-aoi-act {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 6px;
  background: var(--bg-card-alt, #f8fafc); border: 1px solid var(--border-light, #f1f5f9);
  font-size: 11px; color: var(--text-secondary); font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.rc-aoi-act:hover { background: #fff; border-color: var(--slate-300, #cbd5e1); color: var(--text-primary); }
.rc-aoi-act[data-tone="primary"] {
  background: var(--accent-green-light); color: var(--accent-green-dark);
  border-color: transparent; font-weight: 600;
}

/* ── Hero pulse (Reporting Home) ─────────────────────────── */
.rch-hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px;
  margin-bottom: 22px;
}
.rch-hero-score {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff; border-radius: 14px; padding: 20px 22px;
  position: relative; overflow: hidden;
}
.rch-hero-score::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.25), transparent 70%);
  pointer-events: none;
}
.rch-hero-eye {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,.5); font-weight: 600; position: relative;
}
.rch-hero-systems .rch-hero-eye { color: var(--text-muted); }
.rch-hero-num {
  font-size: 44px; font-weight: 800; letter-spacing: -0.02em;
  margin: 4px 0 2px; position: relative;
  display: flex; align-items: baseline; gap: 8px;
}
.rch-hero-max { font-size: 14px; font-weight: 500; color: rgba(255,255,255,.5); }
.rch-hero-delta {
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
  margin-left: auto;
}
.rch-hero-delta[data-tone="up"] { background: rgba(34, 197, 94, .2); color: #4ade80; }
.rch-hero-delta[data-tone="down"] { background: rgba(239, 68, 68, .2); color: #f87171; }
.rch-hero-big {
  font-size: 56px; font-weight: 800; letter-spacing: -0.03em;
  margin: 6px 0 4px; position: relative; font-feature-settings: 'tnum';
}
.rch-hero-big[data-zone="ok"] { color: #4ade80; }
.rch-hero-big[data-zone="watch"] { color: #fbbf24; }
.rch-hero-big[data-zone="risk"] { color: #f87171; }
.rch-hero-label {
  font-size: 12px; color: rgba(255,255,255,.7); font-weight: 500;
  margin-bottom: 12px; position: relative;
}
.rch-hero-spark { position: relative; z-index: 1; }
.rch-hero-axis {
  display: flex; justify-content: space-between;
  font-size: 9.5px; color: rgba(255,255,255,.4); font-weight: 500;
  margin-top: 4px;
}
.rch-hero-systems {
  background: #fff; border: 1px solid var(--border-default); border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column;
}
.rch-hero-syslist { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.rch-sysrow {
  display: grid; grid-template-columns: 10px 56px 1fr 30px; gap: 10px; align-items: center;
  padding: 4px 6px; border-radius: 6px; cursor: pointer;
}
.rch-sysrow:hover { background: var(--bg-card-alt, #f8fafc); }
.rch-sysrow-status { width: 8px; height: 8px; border-radius: 50%; background: var(--slate-300, #cbd5e1); }
.rch-sysrow-status[data-status="ok"] { background: var(--accent-green); }
.rch-sysrow-status[data-status="watch"] { background: var(--accent-amber); }
.rch-sysrow-status[data-status="risk"] { background: var(--accent-red); }
.rch-sysrow-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.rch-sysrow-bar { height: 5px; background: var(--slate-100, #f1f5f9); border-radius: 3px; overflow: hidden; }
.rch-sysrow-bar span { display: block; height: 100%; border-radius: 3px; }
.rch-sysrow-num { font-size: 11.5px; font-weight: 700; font-feature-settings: 'tnum'; color: var(--text-primary); text-align: right; }
.rch-hero-foot {
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--border-light, #f1f5f9);
  font-size: 10.5px; color: var(--text-muted);
}

/* ── System tiles (Home) ─────────────────────────────────── */
.rch-tile {
  background: #fff; border: 1px solid var(--border-default);
  border-radius: 12px; padding: 16px 18px; cursor: pointer;
  transition: box-shadow 120ms, border-color 120ms;
  position: relative; overflow: hidden;
}
.rch-tile:hover { box-shadow: var(--shadow-md); }
.rch-tile::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
}
.rch-tile-blue::before { background: var(--accent-blue); }
.rch-tile-amber::before { background: var(--accent-amber); }
.rch-tile-purple::before { background: var(--accent-purple); }
.rch-tile-emerald::before { background: var(--accent-emerald, #10b981); }
.rch-tile-cyan::before { background: var(--accent-cyan, #0891b2); }
.rch-tile-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 14px; }
.rch-tile-eye { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.rch-tile-title { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.3; margin-top: 3px; max-width: 280px; }
.rch-tile-status {
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--slate-100, #f1f5f9); color: var(--slate-600, #475569); white-space: nowrap;
}
.rch-tile-status[data-tone="ok"] { background: var(--accent-green-light); color: var(--accent-green-dark); }
.rch-tile-status[data-tone="watch"] { background: var(--accent-amber-light); color: var(--accent-amber); }
.rch-tile-status[data-tone="risk"] { background: var(--accent-red-light); color: var(--accent-red); }
.rch-tile-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rch-tile-kpi { background: var(--bg-card-alt, #f8fafc); border-radius: 8px; padding: 9px 10px; }
.rch-tile-kpi-label { font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.rch-tile-kpi-val { font-size: 18px; font-weight: 700; color: var(--text-primary); font-feature-settings: 'tnum'; margin-top: 2px; display: flex; align-items: baseline; gap: 2px; }
.rch-tile-kpi-unit { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.rch-tile-kpi-delta {
  font-size: 10.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 5px; border-radius: 3px; margin-top: 2px;
}
.rch-tile-kpi-delta[data-tone="pos"] { background: var(--accent-green-light); color: var(--accent-green-dark); }
.rch-tile-kpi-delta[data-tone="neg"] { background: var(--accent-red-light); color: var(--accent-red); }
.rch-tile-foot {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border-light, #f1f5f9);
  font-size: 11px; color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
}
.rch-tile-arrow { color: var(--accent-green-dark); font-weight: 600; }

/* ── Home section grids ──────────────────────────────────── */
.rch-section { margin-bottom: 28px; }
.rch-section-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
}
.rch-section-head h2 {
  margin: 0; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.rch-section-head .accent { display: inline-block; width: 4px; height: 14px; border-radius: 2px; }
.rch-section-head .sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.rch-open {
  font-size: 12px; color: var(--accent-green-dark); font-weight: 600;
  cursor: pointer; text-decoration: none; background: none; border: 0;
}
.rch-open:hover { text-decoration: underline; }

/* Home system-specific grids */
.rch-voice-grid, .rch-fleet-grid, .rch-people-grid, .rch-sales-grid {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px;
}
.rch-ops-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; }

/* ── Mini cards (charts beside tiles) ────────────────────── */
.rch-mini-card {
  background: #fff; border: 1px solid var(--border-default);
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column;
}
.rch-mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rch-mini-head h3 { margin: 0; font-size: 12px; font-weight: 700; color: var(--text-primary); }
.rch-mini-sub { font-size: 10.5px; color: var(--text-muted); }
.rch-mini-foot { margin-top: 10px; font-size: 11px; color: var(--text-muted); line-height: 1.45; }
.rch-mini-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: 10px 0 0; margin-top: 10px;
  border-top: 1px solid var(--border-default);
}
.rch-mini-stats > div { display: flex; flex-direction: column; gap: 1px; }
.rch-mini-stats .lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.rch-mini-stats .val { font-size: 15px; font-weight: 700; color: var(--text-primary); font-feature-settings: "tnum"; line-height: 1.1; }
.rch-mini-stats .sub { font-size: 10px; color: var(--text-muted); }

/* ── Sync health banner ──────────────────────────────────── */
.rc-sync-banner {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 16px; margin-bottom: 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  font-size: 12.5px; color: var(--text-secondary);
}
.rc-sync-banner strong { color: var(--accent-amber); }

/* ── Sparkline (inline SVG) ──────────────────────────────── */
.rc-spark-inline { display: inline-block; vertical-align: middle; }

/* ── Print header (all centers) ──────────────────────────── */
.rc-print-header { display: none; }

@media print {
  .rc-print-header {
    display: block; margin-bottom: 24px; padding-bottom: 16px;
    border-bottom: 2px solid #000;
  }
  .rc-ph-title { font-size: 22px; font-weight: 700; }
  .rc-ph-meta {
    display: flex; gap: 16px; margin-top: 4px;
    font-size: 11px; color: #666;
  }
  .rc-drawer-mask, .rc-drawer,
  .rc-filterbar, .rc-subnav,
  .rc-aoi-act, .rch-open,
  .header-actions { display: none !important; }
  .rch-tile, .rc-kpi, .rc-card, .rch-mini-card, .rc-aoi-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ── Heatmap cells (TEOD compliance) ─────────────────────── */
.rc-heat-grid { display: grid; gap: 3px; }
.rc-heat-cell {
  height: 28px; border-radius: 4px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
}
.rc-heat-cell[data-v="ok"] { background: var(--accent-green-light); color: var(--accent-green-dark); }
.rc-heat-cell[data-v="miss"] { background: var(--accent-red-light); color: var(--accent-red); }
.rc-heat-cell[data-v="na"] { background: var(--slate-100, #f1f5f9); color: var(--slate-400, #94a3b8); }

/* ── Responsive adjustments ──────────────────────────────── */
@media (max-width: 1100px) {
  .rch-hero { grid-template-columns: 1fr; }
  .rch-voice-grid, .rch-fleet-grid, .rch-people-grid, .rch-sales-grid { grid-template-columns: 1fr; }
  .rc-2col { grid-template-columns: 1fr; }
  .rc-3col { grid-template-columns: 1fr 1fr; }
  .rc-radar { grid-template-columns: 1fr; }
  .rc-gauge { grid-template-columns: 1fr; }
  .rc-drivers { grid-template-columns: 1fr 1fr; }
}

/* ── Freshness stamp ───────────────────────────────────── */
.rc-freshness {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  text-align: right;
  padding: 4px 32px 0;
}

/* ── Export button ──────────────────────────────────────── */
.rc-export-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary, #64748b);
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: var(--rc-radius-sm, 6px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.rc-export-btn:hover {
  background: var(--bg-tertiary, #f1f5f9);
  color: var(--text-primary, #1e293b);
}
@media print { .rc-export-btn { display: none !important; } }

/* ── Chart entry animation ────────────────────────────────── */
@keyframes rc-chart-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rc-card svg,
.rc-card [data-chart] {
  animation: rc-chart-fade 0.4s var(--rc-ease, ease) both;
}

/* ── Print: Archive + Settings centers ────────────────────── */
@media print {
  #archiveDigestList,
  .rcs-toggle,
  [onclick*="_rcsSetTab"],
  [onclick*="_archiveSelectDigest"],
  [onclick*="_rcsEditRecipient"],
  [onclick*="_rcsAddRecipient"] { display: none !important; }
  #archivePulseTimeline svg { max-width: 100%; height: auto; }
  #archiveDigestReader { border: 1px solid #ccc !important; break-inside: avoid; }
}

/* --- Department page: TEOD compliance table --- */
.dept-teod-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dept-teod-table th {
  text-align: center; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); padding: 6px 8px;
  border-bottom: 1px solid var(--border-default);
}
.dept-teod-table th:first-child { text-align: left; }
.dept-teod-name { font-size: 12px; font-weight: 600; color: var(--text-primary); padding: 6px 8px; white-space: nowrap; }
.dept-teod-cell { text-align: center; padding: 4px 8px; font-weight: 700; font-size: 13px; }
.dept-teod-ok { color: var(--accent-green-dark, #16a34a); }
.dept-teod-late { color: var(--accent-amber, #d97706); }
.dept-teod-miss { color: var(--text-muted); font-weight: 400; }

/* --- Feedback filter pill buttons --- */
.rc-pill-btn {
  font-size: 11px; font-weight: 600; padding: 4px 12px;
  border-radius: 99px; border: 1px solid var(--border-default);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-secondary); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rc-pill-btn:hover { background: var(--bg-tertiary); }
.rc-pill-btn.rc-active {
  background: var(--accent-blue, #3b82f6); color: #fff;
  border-color: var(--accent-blue, #3b82f6);
}

/* ==========================================================
   Review Cycles (V2.1) — design ref:
   design-reference/portal-reporting-center/project/reporting-detail.jsx
   (PeopleDetail: Cycle countdown hero)
   ========================================================== */
.rcycle-shell {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.rcycle-loading,
.rcycle-error,
.rcycle-empty {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  padding: 12px 4px;
}
.rcycle-error { color: var(--accent-red, #ef4444); }

/* Hero — three-panel grid (active · countdown · cadence) */
.rcycle-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card, #fff);
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .rcycle-hero { grid-template-columns: 1fr; }
}
.rcycle-hero-panel {
  padding: 22px 24px;
  border-right: 1px solid var(--border-default, #e5e7eb);
  display: flex;
  flex-direction: column;
}
.rcycle-hero-panel:last-child { border-right: none; }
@media (max-width: 900px) {
  .rcycle-hero-panel { border-right: none; border-bottom: 1px solid var(--border-default); }
  .rcycle-hero-panel:last-child { border-bottom: none; }
}
.rcycle-hero-active {
  background: linear-gradient(135deg, rgba(168,85,247,.10), rgba(168,85,247,.02));
}
.rcycle-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
}
.rcycle-hero-eyebrow--purple { color: var(--accent-purple, #a855f7); }
.rcycle-hero-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 6px 0 4px;
  line-height: 1.25;
}
.rcycle-hero-title-sm {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  margin-top: 4px;
}
.rcycle-hero-sub {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  margin-bottom: 4px;
}
.rcycle-lockout-warn {
  font-size: 11px;
  color: var(--accent-amber, #f59e0b);
  background: var(--accent-amber-light, rgba(245,158,11,.12));
  padding: 4px 8px;
  border-radius: 4px;
  margin: 4px 0 8px;
}
.rcycle-progress-track {
  height: 8px;
  background: var(--bg-card-alt, #f3f4f6);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 6px;
}
.rcycle-progress-track--card { margin: 8px 0 0; height: 6px; }
.rcycle-progress-fill {
  height: 100%;
  background: var(--accent-purple, #a855f7);
  border-radius: 99px;
  transition: width .4s;
}
.rcycle-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  font-feature-settings: "tnum";
}
.rcycle-progress-meta b { color: var(--text-primary, #0f172a); }
.rcycle-progress-overdue { color: var(--accent-red, #ef4444); }
.rcycle-progress-overdue b { color: var(--accent-red, #ef4444); }
.rcycle-hero-empty {
  background: var(--bg-card-alt, #f9fafb);
  justify-content: center;
}
.rcycle-hero-countdown { justify-content: center; }
.rcycle-countdown-num {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  font-feature-settings: "tnum";
  line-height: 1;
  margin: 8px 0 4px;
}
.rcycle-countdown-unit {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  font-weight: 600;
  margin-left: 8px;
}
.rcycle-cadence-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--border-default, #e5e7eb);
}
.rcycle-cadence-row:last-child { border-bottom: none; }
.rcycle-cadence-label { font-weight: 600; color: var(--text-primary, #0f172a); }
.rcycle-cadence-trigger { color: var(--text-muted, #6b7280); }

/* Divider between hero and list */
.rcycle-divider { height: 1px; background: var(--border-default, #e5e7eb); margin: 6px 0 12px; }

/* List header */
.rcycle-list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 8px; flex-wrap: wrap;
}
.rcycle-list-title { font-size: 13px; font-weight: 700; color: var(--text-primary, #0f172a); }
.rcycle-list-sub { font-size: 11px; color: var(--text-muted, #6b7280); }

/* Card grid */
.rcycle-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.rcycle-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 8px;
  padding: 14px;
  transition: transform .15s ease, border-color .15s ease;
}
.rcycle-card:hover { transform: translateY(-1px); border-color: var(--accent-purple, #a855f7); }
.rcycle-card-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
  cursor: pointer;
}
.rcycle-card-title { font-weight: 700; font-size: 14px; color: var(--text-primary, #0f172a); }
.rcycle-card-meta { font-size: 11px; color: var(--text-muted, #6b7280); margin-top: 2px; }
.rcycle-card-overdue { color: var(--accent-red, #ef4444); font-weight: 600; }
.rcycle-card-arrow { color: var(--text-muted, #6b7280); font-size: 16px; flex: 0 0 auto; }

/* Drill-down */
.rcycle-drill-host { margin-top: 10px; }
.rcycle-drill-loading,
.rcycle-drill-empty { font-size: 12px; color: var(--text-muted); padding: 10px 4px; }
.rcycle-drill-error { font-size: 12px; color: var(--accent-red); padding: 10px 4px; }
.rcycle-drill-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-card-alt, #f9fafb);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  overflow: hidden;
}
.rcycle-drill-table th {
  text-align: left; padding: 8px 10px;
  font-size: 11px; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: .04em;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-default);
}
.rcycle-drill-table td { padding: 8px 10px; }
.rcycle-drill-meta { color: var(--text-secondary, #475569); font-size: 12px; }
.rcycle-drill-tnum { font-feature-settings: "tnum"; font-size: 12px; }
.rcycle-drill-open { font-size: 11px; padding: 3px 8px; }

/* V2.2: action buttons + schedule modal + open-cycle modal + timeline */
.rcycle-card-actions {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.rcycle-action-btn { font-size: 11px; padding: 4px 10px; }
.rcycle-schedule-btn { font-size: 12px; padding: 6px 12px; }

/* Timeline */
.rcycle-timeline {
  background: var(--bg-card-alt, #f9fafb);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.rcycle-timeline-head { margin-bottom: 12px; }
.rcycle-timeline-track {
  position: relative;
  display: grid;
  gap: 6px;
  padding-top: 14px;
}
.rcycle-timeline-track::before {
  content: '';
  position: absolute;
  top: 8px; left: 4%; right: 4%;
  height: 2px;
  background: var(--border-default);
}
.rcycle-timeline-item {
  text-align: center;
  font-size: 11px;
  position: relative;
  padding-top: 18px;
}
.rcycle-timeline-dot {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-card-alt, #f9fafb);
}
.rcycle-timeline-dot[data-tone="pos"] { background: var(--accent-green-dark, #059669); }
.rcycle-timeline-dot[data-tone="purple"] { background: var(--accent-purple, #a855f7); }
.rcycle-timeline-dot[data-tone="blue"] { background: var(--accent-blue, #3b82f6); }
.rcycle-timeline-label { font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.rcycle-timeline-date { color: var(--text-muted); margin-top: 2px; }
.rcycle-timeline-progress { color: var(--text-secondary); font-feature-settings: "tnum"; margin-top: 2px; }

/* Modal */
.rcycle-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.rcycle-modal {
  background: var(--bg-card);
  border-radius: 10px;
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  display: flex; flex-direction: column;
}
.rcycle-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-default);
}
.rcycle-modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.rcycle-modal-close {
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: var(--text-muted);
  line-height: 1;
}
.rcycle-modal-body { padding: 16px 20px; display: grid; gap: 12px; }
.rcycle-field { display: grid; gap: 4px; }
.rcycle-field > span { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.rcycle-field input,
.rcycle-field select,
.rcycle-field textarea {
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-card-alt, #f9fafb);
  font: inherit;
}
.rcycle-modal-preview {
  font-size: 12px; color: var(--text-muted);
  padding: 10px; background: var(--bg-card-alt, #f9fafb);
  border-radius: 6px;
}
.rcycle-modal-error {
  font-size: 12px; color: var(--accent-red);
  padding: 8px; background: var(--accent-red-light, rgba(239,68,68,.1));
  border-radius: 6px;
}
.rcycle-modal-warn {
  font-size: 12px;
  color: var(--accent-amber, #b45309);
  background: var(--accent-amber-light, rgba(245,158,11,.12));
  padding: 10px;
  border-radius: 6px;
}
.rcycle-modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border-default);
}

/* V2.3: Active Queue Snapshot card */
.rcycle-snapshot {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.rcycle-snapshot--empty {
  color: var(--text-muted);
  font-size: 13px;
}
.rcycle-snapshot-head { margin-bottom: 10px; }
.rcycle-snapshot-list { display: grid; gap: 6px; }
.rcycle-snapshot-row {
  display: grid;
  grid-template-columns: 1fr 160px auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.rcycle-snapshot-row:hover {
  background: var(--bg-card-alt, #f9fafb);
  border-color: var(--border-default);
}
.rcycle-snapshot-row-name { font-weight: 600; color: var(--text-primary); font-size: 13px; }
.rcycle-snapshot-row-meta { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.rcycle-snapshot-prep { display: flex; flex-direction: column; gap: 2px; }
.rcycle-snapshot-prep-bar {
  height: 4px;
  background: var(--bg-card-alt, #f3f4f6);
  border-radius: 99px;
  overflow: hidden;
}
.rcycle-snapshot-prep-fill {
  height: 100%;
  background: var(--accent-purple, #a855f7);
  border-radius: 99px;
  transition: width .3s;
}
.rcycle-snapshot-prep-label {
  font-size: 10px;
  color: var(--text-muted);
  font-feature-settings: "tnum";
  text-align: right;
}

/* V2.3: review modal prep section inputs */
.rcycle-reviewmodal-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-card-alt, #f9fafb);
  font: inherit;
  font-size: 13px;
}

/* V2.4: cycle settings — lockout toggle block */
.rcycle-set-lockout {
  background: var(--bg-card-alt, #f9fafb);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 12px;
}
.rcycle-set-lockout-head {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
}
.rcycle-set-lockout-title { font-size: 13px; font-weight: 600; color: var(--text-primary); text-transform: capitalize; }
.rcycle-set-lockout-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.rcycle-set-lockout-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
  user-select: none;
}
.rcycle-set-lockout-toggle input[type="checkbox"]:disabled + span {
  color: var(--text-muted);
  opacity: .7;
}

/* V2.5.2: auto-detected round-status row inside the lockout block */
.rcycle-set-roundstatus {
  display: flex; gap: 8px; align-items: baseline;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-default);
  font-size: 11px;
  color: var(--text-secondary, #475569);
  flex-wrap: wrap;
}
.rcycle-set-roundstatus-eyebrow {
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-size: 10px;
}
.rcycle-set-roundstatus-body { font-feature-settings: "tnum"; }
.rcycle-set-roundstatus-body b { color: var(--text-primary); }
.rcycle-set-roundstatus-hint {
  font-size: 11px;
  color: var(--accent-amber, #b45309);
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--accent-amber-light, rgba(245,158,11,.12));
  border-radius: 4px;
  width: 100%;
}

/* ── Filter bar v2 period segments ── */
.rc-period-seg[data-active="true"] {
  background: var(--bg-card-alt) !important;
  color: var(--text-primary) !important;
}
.rc-period-seg:hover { background: var(--bg-card-alt) !important; }

/* ════════════════════════════════════════════════════════════════════════
   CHART QUALITY UPLIFT 2026-06-03 — entrance animation + new primitives
   (bullet / strip / delta badge / callout / skeleton). All motion is gated by
   prefers-reduced-motion; `.rc-no-anim` (set by RC.mount on resize re-renders)
   suppresses replay so charts don't re-animate when the container resizes.
   ════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  /* OPT-IN: only charts RC.mount() renders get `.rc-anim-in` on their FIRST render.
     This deliberately does NOT animate bare `.rc-chart-wrap` — that would replay the
     entrance on every ResizeObserver re-render AND impose motion on the ~14 existing
     app charts (voice/people/fleet/team centers, waccu-pulse, etc.) that render via
     direct innerHTML. Scoped + once = no regression, no replay. */
  .rc-chart-wrap.rc-anim-in { animation: rcRise 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
  .rc-chart-wrap.rc-anim-in svg.rc-svg { animation: rcWipe 0.6s ease-out both; }
}
@keyframes rcRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rcWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* delta badge — directional change pill */
.rc-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap;
  padding: 2px 6px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.rc-delta-good { color: #166534; background: var(--rc-tint-pos, #E7F0E5); }
.rc-delta-bad  { color: #9B2C2C; background: var(--rc-tint-neg, #F8E4DC); }
.rc-delta-flat { color: var(--text-muted, #6b7280); background: rgba(107, 114, 128, 0.12); }

/* callout — plain-English exception/anomaly panel */
.rc-callout { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.rc-callout-head { font-size: 12px; font-weight: 700; color: var(--text-secondary, #4b5563); text-transform: uppercase; letter-spacing: 0.04em; }
.rc-callout-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.4;
  border: 1px solid transparent;
}
.rc-callout-icon { flex: none; font-size: 13px; line-height: 1.3; }
.rc-callout-body { color: var(--text-primary, #1f2937); }
.rc-callout-info     { background: rgba(59, 130, 246, 0.08);  border-color: rgba(59, 130, 246, 0.25); }
.rc-callout-warning  { background: var(--rc-tint-warn, #FBEEDE); border-color: rgba(224, 122, 60, 0.35); }
.rc-callout-critical { background: var(--rc-tint-neg, #F8E4DC);  border-color: rgba(184, 58, 43, 0.4); }

/* skeleton — shimmer loading placeholder */
.rc-skel {
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.12) 37%, rgba(0,0,0,0.06) 63%);
  background-size: 400% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .rc-skel { animation: rcShimmer 1.4s ease infinite; }
}
@keyframes rcShimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* bullet chart wrap — fixed slim height, no expand cursor. The 2-class selector
   beats the mobile `.rc-chart-wrap{min-height:120px}` rule (rc-reporting-center.css)
   that would otherwise stretch the preserveAspectRatio="none" bullet into a tall
   block on phones. */
.rc-chart-wrap.rc-bullet { min-height: 0; cursor: default; }
.rc-bullet svg { border-radius: 4px; overflow: hidden; }
