/* =============================================================
   Smart Shiksha — Report Center
   -------------------------------------------------------------
   Shared styles for reports/dashboard, search, categories,
   favorites, history, recent, settings and the route wrapper.
   Uses the ERP design tokens (--erp-*) with local fallbacks and
   dark-mode awareness via body.dark-mode / [data-theme="dark"].
   ============================================================= */

.report-center {
  --rc-bg: #f1f5f9;
  --rc-surface: #ffffff;
  --rc-border: #e2e8f0;
  --rc-text: #0f172a;
  --rc-muted: #64748b;
  --rc-primary: #2563eb;
  --rc-primary-soft: #dbeafe;
  --rc-radius: 16px;
  --rc-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --rc-shadow-hover: 0 12px 28px rgba(37, 99, 235, 0.14);
}

body.dark-mode .report-center,
[data-theme="dark"] .report-center {
  --rc-bg: #0f172a;
  --rc-surface: #1e293b;
  --rc-border: #334155;
  --rc-text: #e2e8f0;
  --rc-muted: #94a3b8;
  --rc-primary-soft: rgba(37, 99, 235, 0.18);
  --rc-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --rc-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.5);
}

/* ---------- Layout ---------- */
.report-center {
  font-family: inherit;
  color: var(--rc-text);
  min-height: 60vh;
}

.report-center .rc-section { margin-bottom: 2rem; }

.rc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.rc-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--rc-text);
}

.rc-section-title i { color: var(--rc-primary); }

.rc-section-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rc-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.rc-section-link:hover { text-decoration: underline; }

.rc-count-badge {
  background: var(--rc-primary-soft);
  color: var(--rc-primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.25rem;
}

/* ---------- Hero ---------- */
.rc-hero {
  position: relative;
  border-radius: var(--rc-radius);
  overflow: hidden;
  padding: 2.25rem 2rem 1.75rem;
  margin-bottom: 1.5rem;
  color: #fff;
  background: linear-gradient(120deg, #1e3a8a 0%, #2563eb 55%, #7c3aed 100%);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.28);
}

.rc-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,0.18) 0, transparent 32%),
    radial-gradient(circle at 12% 110%, rgba(255,255,255,0.10) 0, transparent 40%);
  pointer-events: none;
}

.rc-hero-inner { position: relative; z-index: 1; }

.rc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.16);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.rc-hero-title {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
}

.rc-hero-sub { font-size: 0.92rem; opacity: 0.9; margin: 0 0 1.25rem; max-width: 620px; }

/* ---------- Search ---------- */
.rc-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 640px;
}

.rc-search-icon {
  position: absolute;
  left: 1rem;
  color: var(--rc-muted);
  font-size: 1rem;
  pointer-events: none;
}

.rc-search-input {
  width: 100%;
  border: 1px solid var(--rc-border);
  background: var(--rc-surface);
  color: var(--rc-text);
  border-radius: 12px;
  padding: 0.72rem 3rem 0.72rem 2.6rem;
  font-size: 0.95rem;
  box-shadow: var(--rc-shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.rc-search-input:focus {
  outline: none;
  border-color: var(--rc-primary);
  box-shadow: 0 0 0 4px var(--rc-primary-soft);
}

.rc-search-clear {
  position: absolute;
  right: 0.6rem;
  border: 0;
  background: transparent;
  color: var(--rc-muted);
  padding: 0.3rem;
  border-radius: 50%;
  line-height: 1;
  display: none;
}

.rc-search-clear:hover { color: var(--rc-danger, #ef4444); }

.rc-search-wrap.has-text .rc-search-clear { display: block; }

.rc-hero .rc-search-wrap { max-width: 560px; }
.rc-hero .rc-search-input { border: 0; }

/* ---------- Stats ---------- */
.rc-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.rc-stat-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--rc-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}

.rc-stat-card:hover { transform: translateY(-3px); box-shadow: var(--rc-shadow-hover); }

.rc-stat-icon {
  --rc-accent: #2563eb;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.25rem;
  color: var(--rc-accent);
  background: color-mix(in srgb, var(--rc-accent) 12%, transparent);
}

.rc-stat-value { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.rc-stat-label { font-size: 0.78rem; color: var(--rc-muted); }

/* ---------- Category cards ---------- */
.rc-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.rc-cat-card {
  --rc-cat-color: #2563eb;
  display: flex;
  gap: 0.85rem;
  padding: 1.15rem;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  text-decoration: none;
  color: var(--rc-text);
  box-shadow: var(--rc-shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.rc-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--rc-shadow-hover);
  border-color: color-mix(in srgb, var(--rc-cat-color) 45%, var(--rc-border));
}

.rc-cat-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.2rem;
  color: var(--rc-cat-color);
  background: color-mix(in srgb, var(--rc-cat-color) 12%, transparent);
}

.rc-cat-body { display: flex; flex-direction: column; min-width: 0; }

.rc-cat-name { font-weight: 700; font-size: 0.92rem; }

.rc-cat-desc {
  font-size: 0.75rem;
  color: var(--rc-muted);
  margin: 0.15rem 0 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rc-cat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--rc-cat-color);
  font-weight: 600;
}

/* ---------- Report cards ---------- */
.rc-report-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.rc-card {
  display: flex;
  flex-direction: column;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 1.1rem;
  box-shadow: var(--rc-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  animation: rcFadeUp .25s ease both;
}

.rc-card:hover { transform: translateY(-3px); box-shadow: var(--rc-shadow-hover); }

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

.rc-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.rc-card-icon {
  --rc-cat-color: #2563eb;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.15rem;
  color: var(--rc-cat-color);
  background: color-mix(in srgb, var(--rc-cat-color) 12%, transparent);
}

.rc-fav-btn {
  border: 1px solid var(--rc-border);
  background: transparent;
  color: var(--rc-muted);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}

.rc-fav-btn:hover { color: #f59e0b; border-color: #f59e0b; transform: scale(1.06); }

.rc-fav-btn.active { color: #f59e0b; background: #fef3c7; border-color: #f59e0b; }

body.dark-mode .rc-fav-btn.active { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }

.rc-card-cat {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rc-cat-color, #2563eb);
  background: color-mix(in srgb, var(--rc-cat-color, #2563eb) 10%, transparent);
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
}

.rc-card-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.3rem; line-height: 1.35; }

.rc-card-desc {
  font-size: 0.78rem;
  color: var(--rc-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.rc-card-foot {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.9rem;
}

.rc-open-btn { flex: 1; }

.rc-pdf-btn { flex: 0 0 auto; }

/* ---------- Recent / history lists ---------- */
.rc-recent-list { display: flex; flex-direction: column; gap: 0.7rem; }

.rc-recent-item,
.rc-history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: var(--rc-shadow);
  transition: box-shadow .15s ease, transform .15s ease;
}

.rc-recent-item:hover,
.rc-history-item:hover { box-shadow: var(--rc-shadow-hover); transform: translateY(-1px); }

.rc-recent-icon,
.rc-history-icon {
  --rc-cat-color: #2563eb;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.1rem;
  color: var(--rc-cat-color);
  background: color-mix(in srgb, var(--rc-cat-color) 12%, transparent);
}

.rc-recent-body,
.rc-history-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.rc-recent-name,
.rc-history-name { font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rc-recent-meta,
.rc-history-meta { font-size: 0.75rem; color: var(--rc-muted); }

.rc-recent-actions,
.rc-history-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* ---------- History page ---------- */
.rc-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.rc-search-sm { max-width: 340px; }
.rc-search-lg { max-width: 720px; margin-bottom: 1.25rem; }

.rc-filter-select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.rc-filter-select i {
  position: absolute;
  left: 0.65rem;
  color: var(--rc-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

.rc-filter-select .form-select {
  padding-left: 1.9rem;
  border-radius: 10px;
  border-color: var(--rc-border);
  font-size: 0.85rem;
  background-color: var(--rc-surface);
  color: var(--rc-text);
}

.rc-result-count { font-size: 0.82rem; color: var(--rc-muted); }

/* ---------- Category pills ---------- */
.rc-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.rc-cat-pill {
  --rc-cat-color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  color: var(--rc-text);
  text-decoration: none;
  transition: all .15s ease;
}

.rc-cat-pill:hover { border-color: var(--rc-cat-color); color: var(--rc-cat-color); }

.rc-cat-pill.active {
  background: var(--rc-cat-color);
  border-color: var(--rc-cat-color);
  color: #fff;
}

.rc-cat-pill span {
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.72rem;
}

body.dark-mode .rc-cat-pill span { background: rgba(255,255,255,0.16); }

.rc-cat-pill.active span { background: rgba(255,255,255,0.25); }

/* ---------- Most used chips ---------- */
.rc-used-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.rc-used-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rc-text);
  text-decoration: none;
  transition: all .15s ease;
}

.rc-used-chip:hover { border-color: var(--rc-primary); color: var(--rc-primary); transform: translateY(-1px); }

.rc-used-chip i { color: var(--rc-primary); }

.rc-used-chip em { font-style: normal; font-size: 0.72rem; color: var(--rc-muted); }

/* ---------- Page head ---------- */
.rc-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.rc-page-head h1 { font-size: 1.4rem; font-weight: 800; margin: 0 0 0.2rem; display: flex; align-items: center; gap: 0.5rem; }
.rc-page-head h1 i { color: var(--rc-primary); }
.rc-page-head p { margin: 0; color: var(--rc-muted); font-size: 0.88rem; }

/* ---------- Route wrapper (report-center.php) ---------- */
.rc-route-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--rc-shadow);
  margin-bottom: 1.25rem;
}

.rc-route-title { display: flex; align-items: center; gap: 0.85rem; flex: 1; min-width: 200px; }

.rc-route-icon {
  --rc-cat-color: #2563eb;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.2rem;
  color: var(--rc-cat-color);
  background: color-mix(in srgb, var(--rc-cat-color) 12%, transparent);
}

.rc-route-title h1 { font-size: 1.05rem; font-weight: 800; margin: 0; }

.rc-route-title p { font-size: 0.78rem; color: var(--rc-muted); margin: 0; }

.rc-back-btn { border-radius: 10px; font-weight: 600; }

.rc-route-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.rc-route-actions .btn-sm { border-radius: 10px; font-weight: 600; }
.rc-route-actions .rc-fav-btn { flex-shrink: 0; }

/* ---------- Page head actions (analytics export) ---------- */
.rc-page-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rc-page-head-actions .btn-sm { border-radius: 10px; font-weight: 600; }
.rc-page-head-actions .dropdown-menu .dropdown-item { font-size: 0.85rem; }
.rc-page-head-actions .dropdown-menu .dropdown-item i { color: var(--rc-primary); }

/* ---------- Empty / state pages ---------- */
.rc-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--rc-surface);
  border: 1px dashed var(--rc-border);
  border-radius: var(--rc-radius);
}

.rc-empty i { font-size: 3rem; color: var(--rc-muted); opacity: 0.45; display: block; margin-bottom: 0.8rem; }

.rc-empty h4 { font-weight: 700; margin-bottom: 0.3rem; }

.rc-empty p { color: var(--rc-muted); font-size: 0.88rem; max-width: 420px; margin: 0 auto 1rem; }

.rc-route-state { text-align: center; padding: 4rem 1.5rem; }

.rc-route-state-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 24px;
  font-size: 2.4rem;
  background: #fee2e2;
  color: #ef4444;
}

.rc-route-state-icon.denied { background: #ede9fe; color: #8b5cf6; }

.rc-route-state h2 { font-weight: 800; margin-bottom: 0.4rem; }
.rc-route-state p { color: var(--rc-muted); margin-bottom: 1.2rem; }

/* ---------- Settings panels ---------- */
.rc-panel {
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  box-shadow: var(--rc-shadow);
  overflow: hidden;
  height: 100%;
}

.rc-panel-head {
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--rc-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rc-panel-head i { color: var(--rc-primary); }

.rc-panel-body { padding: 0.9rem 1.15rem; }

.rc-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--rc-border);
  font-size: 0.85rem;
}

.rc-info-row:last-child { border-bottom: 0; }

.rc-info-row strong { font-weight: 600; }

/* ---------- Table ---------- */
.rc-table { font-size: 0.82rem; }
.rc-table th { color: var(--rc-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.7rem; }
.rc-table code { font-size: 0.75rem; }

/* ---------- Analytics dashboard ---------- */
.rc-stats-row-6 { grid-template-columns: repeat(6, 1fr); }

.rc-an-filter {
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  box-shadow: var(--rc-shadow);
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
}

.rc-an-filter-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr) auto;
  gap: 0.85rem;
  align-items: end;
}

.rc-an-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }

.rc-an-field label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rc-muted);
}

.rc-an-field .form-control,
.rc-an-field .form-select {
  border-color: var(--rc-border);
  border-radius: 10px;
  font-size: 0.85rem;
  background-color: var(--rc-surface);
  color: var(--rc-text);
}

.rc-an-field .form-control:focus,
.rc-an-field .form-select:focus {
  border-color: var(--rc-primary);
  box-shadow: 0 0 0 3px var(--rc-primary-soft);
}

.rc-an-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.rc-an-actions .btn { border-radius: 10px; font-weight: 600; white-space: nowrap; }

.rc-an-extra {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--rc-border);
}

.rc-an-quick-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rc-muted);
}

.rc-an-quick { border-radius: 999px; font-size: 0.78rem; font-weight: 600; }

.rc-an-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.rc-an-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.rc-panel-sub {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--rc-muted);
  margin-left: 0.35rem;
}

.rc-an-chart { min-height: 300px; }
.rc-an-chart-donut { min-height: 290px; }

.rc-panel-body-flush { padding: 0.5rem 0.75rem; }

.rc-an-empty {
  text-align: center;
  padding: 2.2rem 1rem;
  color: var(--rc-muted);
}

.rc-an-empty i { font-size: 2rem; opacity: 0.4; display: block; margin-bottom: 0.5rem; }
.rc-an-empty p { font-size: 0.82rem; margin: 0; }

/* Ranked list rows (most used / most exported) */
.rc-rank-item,
.rc-slow-item,
.rc-user-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid var(--rc-border);
}

.rc-rank-item:last-child,
.rc-slow-item:last-child,
.rc-user-item:last-child { border-bottom: 0; }

.rc-rank-no {
  flex: 0 0 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--rc-primary-soft);
  color: var(--rc-primary);
}

.rc-rank-icon {
  --rc-cat-color: #2563eb;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 1rem;
  color: var(--rc-cat-color);
  background: color-mix(in srgb, var(--rc-cat-color) 12%, transparent);
}

.rc-rank-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }

.rc-rank-name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-rank-meta { font-size: 0.72rem; color: var(--rc-muted); }

.rc-rank-bar {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rc-primary) 10%, transparent);
  overflow: hidden;
  margin-top: 0.2rem;
}

.rc-rank-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rc-primary), #8b5cf6);
}

.rc-rank-count {
  font-size: 1rem;
  font-weight: 800;
  color: var(--rc-text);
  flex-shrink: 0;
}

.rc-rank-count em { font-style: normal; font-size: 0.68rem; color: var(--rc-muted); margin-left: 0.15rem; }

/* Slow report rows */
.rc-slow-item .rc-reco { font-style: italic; }

.rc-slow-badge {
  flex-shrink: 0;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.rc-slow-badge.warn { background: #fef1d6; color: #b45309; }
.rc-slow-badge.ok { background: #d6f7ea; color: #047857; }

body.dark-mode .rc-slow-badge.warn { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
body.dark-mode .rc-slow-badge.ok { background: rgba(16, 185, 129, 0.18); color: #34d399; }

/* User activity rows */
.rc-user-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
}

.rc-user-last {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--rc-muted);
  text-align: right;
}

/* ---------- Entries Analytics ---------- */
.rc-ea-filter-row { grid-template-columns: repeat(5, 1fr) auto; }

.rc-an-wide { grid-column: 1 / -1; }

.rc-last-refresh {
  font-size: 0.75rem;
  color: var(--rc-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.rc-an-table-wrap { overflow-x: auto; }

.rc-an-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: collapse;
}

.rc-an-table th {
  text-align: left;
  color: var(--rc-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--rc-border);
  white-space: nowrap;
}

.rc-an-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--rc-border);
  vertical-align: middle;
}

.rc-an-table tbody tr { transition: background .12s ease; }
.rc-an-table tbody tr:hover { background: color-mix(in srgb, var(--rc-primary) 5%, transparent); }
.rc-an-table tbody tr:last-child td { border-bottom: 0; }

/* Entry-type pills (Added / Edited / Deleted) */
.rc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.rc-status-pill.create { background: #d6f7ea; color: #047857; }
.rc-status-pill.update { background: #dbeafe; color: #1d4ed8; }
.rc-status-pill.delete { background: #fee2e2; color: #b91c1c; }

body.dark-mode .rc-status-pill.create { background: rgba(16, 185, 129, 0.16); color: #34d399; }
body.dark-mode .rc-status-pill.update { background: rgba(37, 99, 235, 0.16); color: #60a5fa; }
body.dark-mode .rc-status-pill.delete { background: rgba(239, 68, 68, 0.16); color: #f87171; }

/* Module pill (recent activity table) */
.rc-module-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rc-mod-color);
  white-space: nowrap;
}

.rc-module-pill i { font-size: 0.85rem; }

/* Activity trend table */
.rc-trend-window { padding: 0.65rem 0.8rem 0.2rem; }

.rc-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.rc-trend-badge.up { background: #d6f7ea; color: #047857; }
.rc-trend-badge.down { background: #fee2e2; color: #b91c1c; }
.rc-trend-badge.flat { background: var(--rc-primary-soft); color: var(--rc-muted); }
.rc-trend-badge.new { background: #ede9fe; color: #7c3aed; }

body.dark-mode .rc-trend-badge.up { background: rgba(16, 185, 129, 0.16); color: #34d399; }
body.dark-mode .rc-trend-badge.down { background: rgba(239, 68, 68, 0.16); color: #f87171; }
body.dark-mode .rc-trend-badge.flat { background: rgba(148, 163, 184, 0.16); color: #94a3b8; }
body.dark-mode .rc-trend-badge.new { background: rgba(139, 92, 246, 0.18); color: #a78bfa; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .rc-cat-grid, .rc-report-grid { grid-template-columns: repeat(3, 1fr); }
  .rc-stats-row-6 { grid-template-columns: repeat(3, 1fr); }
  .rc-an-filter-row, .rc-ea-filter-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991.98px) {
  .rc-cat-grid, .rc-report-grid { grid-template-columns: repeat(2, 1fr); }
  .rc-stats-row { grid-template-columns: repeat(2, 1fr); }
  .rc-an-chart-grid, .rc-an-grid { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
  .rc-cat-grid, .rc-report-grid, .rc-stats-row, .rc-stats-row-6 { grid-template-columns: 1fr; }
  .rc-an-filter-row, .rc-ea-filter-row { grid-template-columns: 1fr 1fr; }
  .rc-hero { padding: 1.5rem 1.1rem; }
  .rc-recent-item, .rc-history-item { flex-wrap: wrap; }
  .rc-recent-actions, .rc-history-actions { width: 100%; justify-content: flex-end; }
  .rc-user-last { display: none; }
}
