/**
 * src/index.css — Vanilla CSS entry point
 *
 * @import this file in any project to get all Roman's Pizza design tokens
 * and component classes in a single stylesheet.
 *
 * Usage:
 *   <link rel="stylesheet" href="https://design.romanspizza.co.za/rp-style.css">
 * or in CSS:
 *   @import "rp-design-system/dist/rp-style.css";
 */

/* ── Tokens ── */
/* ── Brand colours ────────────────────────────────────────── */
:root {
  --color-brand-blue:       #014085;
  --color-brand-blue-dark:  #012d5e;
  --color-brand-blue-light: #0260c9;
  --color-brand-blue-glow:  rgba(1, 64, 133, 0.25);
  --color-brand-red:        #ed1c24;
  --color-brand-red-dark:   #c41820;

  /* Gradient helpers */
  --gradient-brand-blue: linear-gradient(135deg, #014085, #0260c9);
  --gradient-sidebar:    linear-gradient(180deg, #012d5e 0%, #014085 50%, #01336e 100%);
}

/* ── MD3-style Surface System (Light) ──────────────────────── */
:root {
  --color-surface:                #ffffff;
  --color-surface-dim:            #f8f9fa;
  --color-surface-container:      #f3f4f6;
  --color-surface-container-high: #e5e7eb;
  --color-surface-variant:        #eef2f7;
  --color-on-surface:             #111827;
  --color-on-surface-muted:       #6b7280;
  --color-outline:                #d1d5db;
  --color-outline-variant:        #e5e7eb;
  /* Legacy Radix-compatible aliases used by the CMS sidebar */
  --color-background:             #f3f4f6;
}

/* ── Dark Mode Surface Overrides ─────────────────────────── */
[data-theme="dark"] {
  --color-surface:                #0f1117;
  --color-surface-dim:            #141720;
  --color-surface-container:      #1a1d2b;
  --color-surface-container-high: #222638;
  --color-surface-variant:        #1e2235;
  --color-on-surface:             #f1f5f9;
  --color-on-surface-muted:       #94a3b8;
  --color-outline:                #3f4f6a;
  --color-outline-variant:        #2a3348;
  --color-background:             #0f1117;
}

/* ── Semantic Status Colours ──────────────────────────────── */
:root {
  --color-success:       #22c55e;
  --color-success-light: #dcfce7;
  --color-warning:       #f59e0b;
  --color-warning-light: #fef3c7;
  --color-error:         #ef4444;
  --color-error-light:   #fee2e2;
  --color-info:          #3b82f6;
  --color-info-light:    #dbeafe;
}

[data-theme="dark"] {
  --color-success-light: rgba(34, 197, 94, 0.18);
  --color-warning-light: rgba(245, 158, 11, 0.18);
  --color-error-light:   rgba(239, 68, 68, 0.18);
  --color-info-light:    rgba(59, 130, 246, 0.18);
}

/* ── CSAT Rating Colour Scale ─────────────────────────────── */
/* 5 stars → green, 4 → lime, 3 → amber, 2 → orange, 1 → red */
:root {
  --color-rating-5: #22c55e;
  --color-rating-4: #84cc16;
  --color-rating-3: #eab308;
  --color-rating-2: #f97316;
  --color-rating-1: #ef4444;
}

/* ── Sentiment Colour Scale ───────────────────────────────── */
:root {
  /* Positive — emerald family */
  --color-sentiment-pos-start:  #10b981;
  --color-sentiment-pos-end:    #059669;
  --color-sentiment-pos-bg:     rgba(16, 185, 129, 0.12);
  --color-sentiment-pos-border: rgba(16, 185, 129, 0.3);
  --color-sentiment-pos-text:   #065f46;

  /* Negative — rose family */
  --color-sentiment-neg-start:  #f43f5e;
  --color-sentiment-neg-end:    #e11d48;
  --color-sentiment-neg-bg:     rgba(244, 63, 94, 0.12);
  --color-sentiment-neg-border: rgba(244, 63, 94, 0.3);
  --color-sentiment-neg-text:   #9f1239;
}

.dark {
  --color-sentiment-pos-bg:     rgba(16, 185, 129, 0.16);
  --color-sentiment-pos-border: rgba(16, 185, 129, 0.35);
  --color-sentiment-pos-text:   #6ee7b7;
  --color-sentiment-neg-bg:     rgba(244, 63, 94, 0.16);
  --color-sentiment-neg-border: rgba(244, 63, 94, 0.35);
  --color-sentiment-neg-text:   #fda4af;
}

/* ── Elevation Shadows ────────────────────────────────────── */
:root {
  --shadow-xs:         0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm:         0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:         0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg:         0 10px 15px rgba(0, 0, 0, 0.05), 0 4px 6px rgba(0, 0, 0, 0.03);
  --shadow-glow:       0 0 24px rgba(1, 64, 133, 0.15);

  /* Component-semantic aliases */
  --shadow-card:       0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-card-hover: 0 6px 20px rgba(1, 64, 133, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-section:    0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-pop:        0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --shadow-xs:         0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm:         0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md:         0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg:         0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-glow:       0 0 24px rgba(1, 64, 133, 0.25);
  --shadow-card:       0 1px 4px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.07);
  --shadow-section:    0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-pop:        0 12px 32px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ── Spacing Scale ────────────────────────────────────────── */
:root {
  --spacing-page:    2rem;     /* Outer page padding */
  --spacing-section: 2rem;     /* Gap between major page sections */
  --spacing-card:    1.375rem; /* Internal card padding */
}

/* ── Shape (MD3 Border-Radius Scale) ──────────────────────── */
:root {
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;
}

/* ── Motion Tokens ────────────────────────────────────────── */
:root {
  /* Duration */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Easing curves */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-settle: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Named animation durations */
  --duration-bar:     700ms; /* Bar chart fill animation */
  --duration-fade:    350ms; /* Section fade-up entrance */
  --duration-stagger: 60ms;  /* Per-item delay for sequential stagger */
}


/* ── Components ── */
/* ── CSS Reset (scoped to rp- components) ─────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* Better font rendering across platforms */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Shared Keyframes ─────────────────────────────────────── */

/* Fade up — used for stat card entrance with staggered --delay */
@keyframes rp-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Pop in — used for highlight cards */
@keyframes rp-pop-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* Bar grow — GPU-accelerated scaleX for bar charts */
@keyframes rp-bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(var(--bar-scale, 0)); }
}

/* Shimmer sweep — for progress bars and loading skeletons */
@keyframes rp-shimmer {
  0%   { left: -100%; }
  100% { left:  100%; }
}

/* Spin — loading spinners */
@keyframes rp-spin {
  to { transform: rotate(360deg); }
}

/* Slide up — modal entrance */
@keyframes rp-slide-up {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Donut segment draw-in */
@keyframes rp-donut-draw {
  from { stroke-dashoffset: var(--rp-donut-circ, 276.5); opacity: 0; }
  30%  { opacity: 1; }
  to   { stroke-dashoffset: 0; }
}

/* ── Layout helpers ───────────────────────────────────────── */

/* Page wrapper — centres content, adds lateral padding */
.rp-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-page, 2rem) 3rem;
}

/* Standard page header row: title-block on left, actions on right */
.rp-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-outline-variant);
  margin-bottom: 1.5rem;
}

/* H1 / H2 inside a page header */
.rp-page-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--color-on-surface);
  line-height: 1.2;
  margin: 0;
}

/* Muted subtitle / date-range beneath the page title */
.rp-page-subtitle {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-on-surface-muted);
  margin-top: 0.2rem;
}

/* Section wrapper — creates consistent vertical rhythm */
.rp-section { margin-bottom: var(--spacing-section, 2rem); }

/* Section heading: icon + label */
.rp-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-on-surface);
  margin-bottom: 0.875rem;
}

/* Responsive 4-column stat grid — collapses gracefully */
.rp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* ── Card Surface ─────────────────────────────────────────── */

.rp-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-outline-variant);
  background-color: var(--color-surface);
  padding: var(--spacing-card, 1.375rem);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Opt-in hover lift behaviour */
.rp-card[data-hoverable],
.rp-card--hoverable {
  cursor: pointer;
}
.rp-card[data-hoverable]:hover,
.rp-card--hoverable:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* ── Semantic tint variants ── */
.rp-card--success {
  border-color: color-mix(in srgb, var(--color-success) 35%, transparent);
  background-color: var(--color-success-light);
}
.rp-card--warning {
  border-color: color-mix(in srgb, var(--color-warning) 35%, transparent);
  background-color: var(--color-warning-light);
}
.rp-card--error {
  border-color: color-mix(in srgb, var(--color-error) 35%, transparent);
  background-color: var(--color-error-light);
}
.rp-card--info {
  border-color: color-mix(in srgb, var(--color-info) 35%, transparent);
  background-color: var(--color-info-light);
}

/* ── Accent left-border variants ── */
.rp-card--accent-left {
  border-left-width: 4px;
  padding-left: calc(var(--spacing-card, 1.375rem) - 3px);
}
.rp-card--accent-success { border-left-color: var(--color-success); }
.rp-card--accent-warning { border-left-color: var(--color-warning); }
.rp-card--accent-error   { border-left-color: var(--color-error); }
.rp-card--accent-info    { border-left-color: var(--color-info); }

/* ── Stat card variant ── */
.rp-stat-card {
  animation: rp-fade-up var(--duration-fade, 350ms) var(--ease-settle) both;
  animation-delay: var(--delay, 0ms);
}

.rp-card__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: var(--color-on-surface-muted);
}
.rp-card__value {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-on-surface);
  margin-top: 0.25rem;
}
.rp-card__sub {
  font-size: 0.75rem;
  color: var(--color-on-surface-muted);
  margin-top: 0.25rem;
}
.rp-card__heading {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-on-surface);
  margin-bottom: 0.875rem;
}

/* ── Status Badge ─────────────────────────────────────────── */

.rp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Status dot indicator */
.rp-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

/* No dot for plain badges */
.rp-badge--no-dot::before { display: none; }

/* ── Colour variants ── */
.rp-badge--success {
  background-color: var(--color-success-light);
  color: #15803d;
  border-color: color-mix(in srgb, var(--color-success) 30%, transparent);
}
.rp-badge--warning {
  background-color: var(--color-warning-light);
  color: #b45309;
  border-color: color-mix(in srgb, var(--color-warning) 30%, transparent);
}
.rp-badge--error {
  background-color: var(--color-error-light);
  color: #b91c1c;
  border-color: color-mix(in srgb, var(--color-error) 30%, transparent);
}
.rp-badge--info {
  background-color: var(--color-info-light);
  color: #1d4ed8;
  border-color: color-mix(in srgb, var(--color-info) 30%, transparent);
}
.rp-badge--neutral {
  background-color: var(--color-surface-container);
  color: var(--color-on-surface-muted);
  border-color: var(--color-outline-variant);
}
.rp-badge--brand {
  background-color: var(--color-brand-blue);
  color: #fff;
  border-color: transparent;
}

.dark .rp-badge--success { color: #86efac; }
.dark .rp-badge--warning { color: #fcd34d; }
.dark .rp-badge--error   { color: #fca5a5; }
.dark .rp-badge--info    { color: #93c5fd; }

/* ── Button ───────────────────────────────────────────────── */

.rp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.45rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease,
              box-shadow 0.15s ease, transform 0.15s ease;
  border: 1px solid transparent;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
}

.rp-btn:disabled          { opacity: 0.45; cursor: not-allowed; }
.rp-btn:not(:disabled):active { transform: translateY(0.5px); }

/* ── Primary ── */
.rp-btn--primary {
  background-color: var(--color-brand-blue);
  color: #fff;
}
.rp-btn--primary:hover:not(:disabled) {
  background-color: var(--color-brand-blue-dark);
  box-shadow: 0 2px 8px var(--color-brand-blue-glow);
}

/* ── Ghost / outline ── */
.rp-btn--ghost {
  background-color: transparent;
  color: var(--color-on-surface-muted);
  border-color: var(--color-outline-variant);
}
.rp-btn--ghost:hover:not(:disabled) {
  background-color: var(--color-surface-container);
  color: var(--color-on-surface);
}

/* ── Danger ── */
.rp-btn--danger {
  background-color: var(--color-error);
  color: #fff;
}
.rp-btn--danger:hover:not(:disabled) {
  background-color: #dc2626;
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}

/* ── Icon-only square button ── */
.rp-btn--icon {
  padding: 0.4rem;
  background-color: var(--color-surface-container);
  color: var(--color-on-surface-muted);
  border-color: var(--color-outline-variant);
}
.rp-btn--icon:hover:not(:disabled) {
  background-color: var(--color-surface);
  color: var(--color-on-surface);
}

/* ── Size modifiers ── */
.rp-btn--sm { padding: 0.28rem 0.625rem; font-size: 0.75rem; }
.rp-btn--lg { padding: 0.65rem 1.25rem;  font-size: 0.9375rem; }

/* ── Data Table ───────────────────────────────────────────── */

.rp-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-outline-variant);
  box-shadow: var(--shadow-card);
}

.rp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.rp-table thead {
  background-color: var(--color-surface-container);
  border-bottom: 1px solid var(--color-outline-variant);
  position: sticky;
  top: 0;
  z-index: 1;
}

.rp-table th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-on-surface-muted);
  white-space: nowrap;
}

.rp-table td {
  padding: 0.75rem 1rem;
  color: var(--color-on-surface);
  border-bottom: 1px solid var(--color-outline-variant);
  vertical-align: middle;
}

/* Last row — no bottom border */
.rp-table tbody tr:last-child td { border-bottom: none; }

/* Row hover */
.rp-table tbody tr {
  transition: background-color 0.12s ease;
}
.rp-table tbody tr:hover {
  background-color: var(--color-surface-container);
}

/* Muted cell variant */
.rp-table .rp-cell--muted { color: var(--color-on-surface-muted); }

/* Right-align numeric columns */
.rp-table .rp-cell--num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Sentiment Chip (tag pill) ────────────────────────────── */

.rp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  font-size: 0.75rem;
}

.rp-chip:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xs);
}

.rp-chip--positive {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: #065f46;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}
.dark .rp-chip--positive {
  background: linear-gradient(135deg, rgba(16,185,129,0.22) 0%, rgba(5,150,105,0.18) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.rp-chip--negative {
  background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
  border-color: rgba(244, 63, 94, 0.4);
  color: #9f1239;
  box-shadow: 0 1px 3px rgba(244, 63, 94, 0.15);
}
.dark .rp-chip--negative {
  background: linear-gradient(135deg, rgba(244,63,94,0.22) 0%, rgba(225,29,72,0.18) 100%);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.rp-chip--neutral {
  background: var(--color-surface-container);
  border-color: var(--color-outline-variant);
  color: var(--color-on-surface-muted);
}

/* Count badge inside chip */
.rp-chip__count {
  opacity: 0.65;
  font-weight: 500;
  font-size: 0.85em;
}

/* Clickable variant — resets button styles */
button.rp-chip {
  cursor: pointer;
  font-family: inherit;
  background: none; /* re-applied below by modifier */
}
button.rp-chip:focus-visible {
  outline: 2px solid var(--color-brand-blue);
  outline-offset: 2px;
}

/* ── Form Input ───────────────────────────────────────────── */

.rp-input {
  background-color: var(--color-surface-container);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  color: var(--color-on-surface);
  font-size: 0.8125rem;
  padding: 0.4rem 0.675rem;
  height: 36px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.rp-input:focus {
  border-color: var(--color-brand-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand-blue) 20%, transparent);
}

.rp-input::placeholder { color: var(--color-on-surface-muted); }

.rp-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Textarea variant — auto-size height */
textarea.rp-input {
  height: auto;
  min-height: 90px;
  resize: vertical;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

/* Select variant */
select.rp-input { cursor: pointer; }

/* Control label — icon + input inline */
.rp-control-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-on-surface-muted);
  flex-shrink: 0;
}

/* ── Bar Chart Components ─────────────────────────────────── */

/* Shared bar track (the background rail) */
.rp-bar-track {
  height: 16px;
  background-color: var(--color-surface-container);
  border-radius: var(--radius-full);
  overflow: hidden;
}

/* Bar fill — full-width scaled via CSS transform to avoid reflow */
.rp-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: var(--radius-full);
  transform-origin: left center;
  transform: scaleX(var(--bar-scale, 0));
  animation: rp-bar-grow var(--duration-bar, 700ms) var(--ease-settle) both;
  animation-delay: var(--delay, 0ms);
}

/* ── Rating fills (1–5 stars) ── */
.rp-bar-fill--rating-5 { background: linear-gradient(90deg, var(--color-rating-5), #16a34a); }
.rp-bar-fill--rating-4 { background: linear-gradient(90deg, var(--color-rating-4), #65a30d); }
.rp-bar-fill--rating-3 { background: linear-gradient(90deg, var(--color-rating-3), #d97706); }
.rp-bar-fill--rating-2 { background: linear-gradient(90deg, var(--color-rating-2), #ea580c); }
.rp-bar-fill--rating-1 { background: linear-gradient(90deg, var(--color-rating-1), #dc2626); }

/* ── Sentiment fills ── */
.rp-bar-fill--positive {
  background: linear-gradient(90deg, var(--color-sentiment-pos-start), var(--color-sentiment-pos-end));
}
.rp-bar-fill--negative {
  background: linear-gradient(90deg, var(--color-sentiment-neg-start), var(--color-sentiment-neg-end));
}

/* ── Brand fill ── */
.rp-bar-fill--brand { background: var(--gradient-brand-blue); }

/* ── Rating distribution row ── */
.rp-dist-row {
  display: grid;
  grid-template-columns: 28px 1fr 48px 44px;
  align-items: center;
  gap: 0.5rem;
}
.rp-dist-label { font-size: 0.8rem; font-weight: 700; color: var(--color-on-surface); text-align: right; }
.rp-dist-count { font-size: 0.8rem; font-weight: 600; color: var(--color-on-surface); text-align: right; }
.rp-dist-pct   { font-size: 0.7rem; color: var(--color-on-surface-muted); text-align: right; }

/* ── Modal Overlay + Card ─────────────────────────────────── */

.rp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  /* Backdrop fades in */
  animation: rp-fade-up 0.2s ease both;
}

.rp-modal-card {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-pop);
  padding: 2.5rem;
  width: 100%;
  max-width: 480px;
  position: relative;
  animation: rp-slide-up 0.25s var(--ease-spring) both;
}

/* Close button — absolute top-right */
.rp-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--color-surface-container);
  border: none;
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-on-surface-muted);
  transition: background 0.15s ease;
}
.rp-modal-close:hover { background: var(--color-surface-container-high); }

/* Modal title */
.rp-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-on-surface);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}

/* ── Empty & Loading States ───────────────────────────────── */

.rp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--color-on-surface-muted);
}

.rp-empty-state__icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.rp-empty-state__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-on-surface);
}

.rp-empty-state__body {
  font-size: 0.8125rem;
  max-width: 280px;
  line-height: 1.6;
}

/* Loading spinner */
.rp-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-outline-variant);
  border-top-color: var(--color-brand-blue);
  border-radius: 50%;
  animation: rp-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Skeleton placeholder */
.rp-skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-container) 25%,
    var(--color-surface-container-high) 50%,
    var(--color-surface-container) 75%
  );
  background-size: 200% 100%;
  animation: rp-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

