/* ============================================================
   12-Week Risk Reduction Program — Admin Design System
   Shared CSS for all program admin pages
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
    --rr-blue: #0ea5e9;
    --rr-blue-hover: #0284c7;
    --rr-blue-light: #e0f2fe;
    --rr-blue-dark: #0369a1;
    --rr-green: #059669;
    --rr-green-light: #dcfce7;
    --rr-green-dark: #15803d;
    --rr-amber: #d97706;
    --rr-amber-light: #fef3c7;
    --rr-amber-dark: #b45309;
    --rr-red: #ef4444;
    --rr-red-light: #fee2e2;
    --rr-red-dark: #b91c1c;
    --rr-purple: #7e22ce;
    --rr-purple-light: #f3e8ff;
    --rr-indigo: #4338ca;
    --rr-indigo-light: #e0e7ff;
    --rr-teal: #0d9488;
    --rr-teal-light: #ccfbf1;
    --rr-rose: #be123c;
    --rr-rose-light: #ffe4e6;
    --rr-slate-50: #f8fafc;
    --rr-slate-100: #f1f5f9;
    --rr-slate-200: #e2e8f0;
    --rr-slate-300: #cbd5e1;
    --rr-slate-400: #94a3b8;
    --rr-slate-500: #64748b;
    --rr-slate-600: #475569;
    --rr-slate-700: #334155;
    --rr-slate-800: #1e293b;
    --rr-slate-900: #0f172a;
    --rr-card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --rr-card-shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    --rr-radius-sm: 8px;
    --rr-radius-md: 12px;
    --rr-radius-lg: 16px;
    --rr-radius-xl: 20px;
    --rr-transition: all 0.2s ease;
}

/* ── Animations ── */
@keyframes rr-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rr-slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rr-slideRight {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes rr-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes rr-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

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

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

.rr-animate-in {
    animation: rr-fadeIn 0.4s ease-out forwards;
    opacity: 0;
}

.rr-stagger-1 { animation-delay: 0.05s; }
.rr-stagger-2 { animation-delay: 0.1s; }
.rr-stagger-3 { animation-delay: 0.15s; }
.rr-stagger-4 { animation-delay: 0.2s; }
.rr-stagger-5 { animation-delay: 0.25s; }
.rr-stagger-6 { animation-delay: 0.3s; }

/* ── Page Header ── */
.rr-page-header {
    background: linear-gradient(135deg, var(--rr-slate-50) 0%, var(--rr-slate-100) 100%);
    padding: 24px 32px;
    border-radius: var(--rr-radius-lg);
    box-shadow: var(--rr-card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.rr-page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rr-blue), var(--rr-green));
}

.rr-page-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.rr-page-title {
    margin: 0 0 8px;
    font-size: 28px;
    color: var(--rr-slate-900);
    font-weight: 900;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rr-page-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--rr-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
}

.rr-page-icon-blue { background: var(--rr-blue); box-shadow: 0 8px 16px rgba(14, 165, 233, 0.25); }
.rr-page-icon-green { background: var(--rr-green); box-shadow: 0 8px 16px rgba(5, 150, 105, 0.25); }
.rr-page-icon-purple { background: var(--rr-purple); box-shadow: 0 8px 16px rgba(126, 34, 206, 0.25); }
.rr-page-icon-red { background: var(--rr-red); box-shadow: 0 8px 16px rgba(239, 68, 68, 0.25); }
.rr-page-icon-amber { background: var(--rr-amber); box-shadow: 0 8px 16px rgba(217, 119, 6, 0.25); }
.rr-page-icon-indigo { background: var(--rr-indigo); box-shadow: 0 8px 16px rgba(67, 56, 202, 0.25); }
.rr-page-icon-teal { background: var(--rr-teal); box-shadow: 0 8px 16px rgba(13, 148, 136, 0.25); }

.rr-page-subtitle {
    margin: 0;
    color: var(--rr-slate-600);
    font-size: 15px;
    max-width: 600px;
    line-height: 1.5;
}

.rr-page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── KPI Cards ── */
.rr-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.rr-kpi-card {
    background: #ffffff;
    border-radius: var(--rr-radius-md);
    padding: 20px 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--rr-slate-200);
    transition: var(--rr-transition);
    position: relative;
    overflow: hidden;
}

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



.rr-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rr-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.rr-kpi-icon-blue { background: var(--rr-blue-light); color: var(--rr-blue-dark); }
.rr-kpi-icon-green { background: var(--rr-green-light); color: var(--rr-green-dark); }
.rr-kpi-icon-amber { background: var(--rr-amber-light); color: var(--rr-amber-dark); }
.rr-kpi-icon-red { background: var(--rr-red-light); color: var(--rr-red-dark); }
.rr-kpi-icon-purple { background: var(--rr-purple-light); color: var(--rr-purple); }
.rr-kpi-icon-indigo { background: var(--rr-indigo-light); color: var(--rr-indigo); }
.rr-kpi-icon-teal { background: var(--rr-teal-light); color: var(--rr-teal); }
.rr-kpi-icon-rose { background: var(--rr-rose-light); color: var(--rr-rose); }

.rr-kpi-trend {
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
}

.rr-kpi-trend-up { background: var(--rr-green-light); color: var(--rr-green-dark); }
.rr-kpi-trend-down { background: var(--rr-red-light); color: var(--rr-red-dark); }
.rr-kpi-trend-flat { background: var(--rr-slate-100); color: var(--rr-slate-500); }

.rr-kpi-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--rr-slate-900);
    margin: 0;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    animation: rr-countUp 0.5s ease-out;
}

.rr-kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rr-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ── Cards ── */
.rr-card {
    background: #ffffff;
    border-radius: var(--rr-radius-lg);
    box-shadow: var(--rr-card-shadow);
    border: 1px solid var(--rr-slate-200);
    margin-bottom: 24px;
    overflow: hidden;
}

.rr-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--rr-slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.rr-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--rr-slate-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.rr-card-body {
    padding: 24px;
}

.rr-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--rr-slate-100);
    background: var(--rr-slate-50);
}

/* ── Data Tables ── */
.rr-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rr-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.rr-data-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--rr-slate-500);
    background: var(--rr-slate-50);
    border-bottom: 2px solid var(--rr-slate-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.rr-data-table th:first-child { border-top-left-radius: var(--rr-radius-md); }
.rr-data-table th:last-child { border-top-right-radius: var(--rr-radius-md); }

.rr-data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--rr-slate-100);
    vertical-align: middle;
    transition: background 0.15s;
    color: var(--rr-slate-700);
}

.rr-data-table tbody tr {
    animation: rr-fadeIn 0.4s ease-out forwards;
    opacity: 0;
}

.rr-data-table tbody tr:nth-child(1) { animation-delay: 0.02s; }
.rr-data-table tbody tr:nth-child(2) { animation-delay: 0.04s; }
.rr-data-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.rr-data-table tbody tr:nth-child(4) { animation-delay: 0.08s; }
.rr-data-table tbody tr:nth-child(5) { animation-delay: 0.1s; }
.rr-data-table tbody tr:nth-child(6) { animation-delay: 0.12s; }
.rr-data-table tbody tr:nth-child(7) { animation-delay: 0.14s; }
.rr-data-table tbody tr:nth-child(8) { animation-delay: 0.16s; }
.rr-data-table tbody tr:nth-child(9) { animation-delay: 0.18s; }
.rr-data-table tbody tr:nth-child(10) { animation-delay: 0.2s; }

.rr-data-table tbody tr:hover td {
    background: var(--rr-slate-50);
}

.rr-data-table .rr-row-clickable {
    cursor: pointer;
}

.rr-data-table .rr-row-clickable:hover td {
    background: #f0f9ff;
}

/* ── Badges ── */
.rr-badge {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.rr-badge-green { background: var(--rr-green-light); color: var(--rr-green-dark); }
.rr-badge-amber { background: var(--rr-amber-light); color: var(--rr-amber-dark); }
.rr-badge-red { background: var(--rr-red-light); color: var(--rr-red-dark); }
.rr-badge-blue { background: var(--rr-blue-light); color: var(--rr-blue-dark); }
.rr-badge-purple { background: var(--rr-purple-light); color: var(--rr-purple); }
.rr-badge-gray { background: var(--rr-slate-100); color: var(--rr-slate-600); }
.rr-badge-indigo { background: var(--rr-indigo-light); color: var(--rr-indigo); }
.rr-badge-teal { background: var(--rr-teal-light); color: var(--rr-teal); }
.rr-badge-rose { background: var(--rr-rose-light); color: var(--rr-rose); }

.rr-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.rr-badge-dot-green { background: var(--rr-green); }
.rr-badge-dot-amber { background: var(--rr-amber); }
.rr-badge-dot-red { background: var(--rr-red); }
.rr-badge-dot-blue { background: var(--rr-blue); }

/* ── Buttons ── */
.rr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--rr-radius-sm);
    text-decoration: none;
    transition: var(--rr-transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.rr-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rr-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.rr-btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.rr-btn-primary {
    background: var(--rr-blue);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.2);
}

.rr-btn-primary:hover {
    background: var(--rr-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 12px -2px rgba(14, 165, 233, 0.3);
}

.rr-btn-success {
    background: var(--rr-green);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2);
}

.rr-btn-success:hover {
    background: #047857;
    transform: translateY(-1px);
}

.rr-btn-danger {
    background: var(--rr-red-light);
    color: #dc2626;
    border: 1px solid #fecaca;
}

.rr-btn-danger:hover {
    background: var(--rr-red);
    color: white;
    border-color: var(--rr-red);
}

.rr-btn-outline {
    background: white;
    border: 1px solid var(--rr-slate-300);
    color: var(--rr-slate-700);
}

.rr-btn-outline:hover {
    background: var(--rr-slate-50);
    border-color: var(--rr-slate-400);
    transform: translateY(-1px);
}

.rr-btn-ghost {
    background: transparent;
    color: var(--rr-slate-600);
    padding: 8px 12px;
}

.rr-btn-ghost:hover {
    background: var(--rr-slate-100);
    color: var(--rr-slate-800);
}

/* ── Filter Bar ── */
.rr-filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 24px;
    background: var(--rr-slate-50);
    border-bottom: 1px solid var(--rr-slate-200);
}

.rr-filter-group {
    position: relative;
    display: flex;
    align-items: center;
}

.rr-filter-group > i {
    position: absolute;
    left: 12px;
    color: var(--rr-slate-400);
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
}

.rr-filter-input {
    padding: 8px 14px 8px 36px;
    border-radius: var(--rr-radius-sm);
    border: 1px solid var(--rr-slate-300);
    outline: none;
    font-size: 13px;
    font-family: inherit;
    background: white;
    transition: var(--rr-transition);
    min-width: 200px;
}

.rr-filter-input:focus {
    border-color: var(--rr-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.rr-filter-select {
    padding: 8px 32px 8px 14px;
    border-radius: var(--rr-radius-sm);
    border: 1px solid var(--rr-slate-300);
    outline: none;
    font-size: 13px;
    font-family: inherit;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: var(--rr-transition);
}

.rr-filter-select:focus {
    border-color: var(--rr-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.rr-filter-divider {
    width: 1px;
    height: 28px;
    background: var(--rr-slate-200);
    margin: 0 4px;
}

/* ── Tabs ── */
.rr-tab-nav {
    display: flex;
    border-bottom: 2px solid var(--rr-slate-100);
    gap: 4px;
    padding: 0 24px;
    background: var(--rr-slate-50);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rr-tab-link {
    padding: 16px 16px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    color: var(--rr-slate-500);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: var(--rr-transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.rr-tab-link:hover {
    color: var(--rr-blue);
    background: rgba(14, 165, 233, 0.04);
}

.rr-tab-link.active {
    color: var(--rr-blue);
    border-bottom-color: var(--rr-blue);
    background: white;
}

.rr-tab-badge {
    background: var(--rr-red);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
}

.rr-tab-content {
    display: none;
}

.rr-tab-content.active {
    display: block;
    animation: rr-fadeIn 0.3s ease-out;
}

/* ── Progress Bars ── */
.rr-progress-bar {
    background: var(--rr-slate-200);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.rr-progress-bar-sm { height: 4px; }
.rr-progress-bar-lg { height: 12px; }

.rr-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.rr-progress-fill-blue { background: linear-gradient(90deg, var(--rr-blue), #38bdf8); }
.rr-progress-fill-green { background: linear-gradient(90deg, var(--rr-green), #34d399); }
.rr-progress-fill-amber { background: linear-gradient(90deg, var(--rr-amber), #fbbf24); }
.rr-progress-fill-red { background: linear-gradient(90deg, var(--rr-red), #f87171); }
.rr-progress-fill-gradient { background: linear-gradient(90deg, var(--rr-blue), var(--rr-green)); }

/* ── Alert Banners ── */
.rr-alert-banner {
    padding: 16px 20px;
    border-radius: var(--rr-radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.rr-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--rr-green-dark);
}

.rr-alert-success i { color: #16a34a; font-size: 20px; }

.rr-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--rr-red-dark);
}

.rr-alert-error i { color: var(--rr-red); font-size: 20px; }

.rr-alert-warning {
    background: linear-gradient(to right, #fef2f2, #fff1f2);
    border-left: 4px solid var(--rr-red);
    color: #991b1b;
}

.rr-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--rr-blue-dark);
}

.rr-alert-info i { color: var(--rr-blue); font-size: 20px; }

.rr-alert-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: inherit;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.rr-alert-dismiss:hover { opacity: 1; }

/* ── Chart Cards ── */
.rr-chart-card {
    background: #ffffff;
    border-radius: var(--rr-radius-lg);
    padding: 24px;
    box-shadow: var(--rr-card-shadow);
    border: 1px solid var(--rr-slate-200);
    display: flex;
    flex-direction: column;
}

.rr-chart-title {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 800;
    color: var(--rr-slate-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.rr-chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 220px;
}

.rr-chart-footer {
    margin-top: 16px;
    font-size: 12px;
    color: var(--rr-slate-500);
    background: var(--rr-slate-50);
    padding: 12px;
    border-radius: var(--rr-radius-sm);
    border: 1px solid var(--rr-slate-200);
}

.rr-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.rr-chart-span-2 {
    grid-column: span 2;
}

/* ── Pipeline Flow ── */
.rr-pipeline {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    background: #ffffff;
    padding: 28px 24px;
    border-radius: var(--rr-radius-lg);
    box-shadow: var(--rr-card-shadow);
    border: 1px solid var(--rr-slate-200);
    flex-wrap: wrap;
}

.rr-pipeline-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 100px;
    padding-top: 12px;
}

.rr-pipeline-step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin: 0 auto 10px;
}

.rr-pipeline-step-label {
    margin: 0;
    font-size: 11px;
    color: var(--rr-slate-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.rr-pipeline-step-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--rr-slate-900);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.rr-pipeline-connector {
    flex-shrink: 0;
    color: var(--rr-slate-300);
    font-size: 16px;
}

/* ── Empty State ── */
.rr-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.rr-empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--rr-slate-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--rr-slate-400);
    margin-bottom: 20px;
}

.rr-empty-state-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--rr-slate-700);
    margin: 0 0 8px;
}

.rr-empty-state-text {
    font-size: 14px;
    color: var(--rr-slate-500);
    max-width: 400px;
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ── Timeline ── */
.rr-timeline {
    position: relative;
    padding-left: 32px;
}

.rr-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--rr-slate-200);
}

.rr-timeline-item {
    position: relative;
    padding-bottom: 24px;
    animation: rr-slideRight 0.4s ease-out forwards;
    opacity: 0;
}

.rr-timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--rr-blue);
    z-index: 1;
}

.rr-timeline-item-success::before { border-color: var(--rr-green); }
.rr-timeline-item-warning::before { border-color: var(--rr-amber); }
.rr-timeline-item-danger::before { border-color: var(--rr-red); }

.rr-timeline-date {
    font-size: 12px;
    color: var(--rr-slate-500);
    font-weight: 600;
    margin-bottom: 4px;
}

.rr-timeline-content {
    font-size: 14px;
    color: var(--rr-slate-700);
    line-height: 1.5;
}

/* ── Split Panel (Messaging Layout) ── */
.rr-split-panel {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 600px;
    border: 1px solid var(--rr-slate-200);
    border-radius: var(--rr-radius-lg);
    overflow: hidden;
}

.rr-split-left {
    background: var(--rr-slate-50);
    border-right: 1px solid var(--rr-slate-200);
    overflow-y: auto;
}

.rr-split-right {
    display: flex;
    flex-direction: column;
    background: white;
}

.rr-conversation-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--rr-slate-100);
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rr-conversation-item:hover { background: white; }
.rr-conversation-item.active { background: white; border-left: 3px solid var(--rr-blue); }

.rr-conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--rr-blue-light);
    color: var(--rr-blue-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.rr-conversation-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--rr-slate-800);
}

.rr-conversation-preview {
    font-size: 12px;
    color: var(--rr-slate-500);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.rr-conversation-time {
    font-size: 11px;
    color: var(--rr-slate-400);
    margin-left: auto;
    white-space: nowrap;
}

.rr-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rr-blue);
    flex-shrink: 0;
}

/* Chat Bubbles */
.rr-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rr-chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.rr-chat-bubble-sent {
    align-self: flex-end;
    background: var(--rr-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.rr-chat-bubble-received {
    align-self: flex-start;
    background: var(--rr-slate-100);
    color: var(--rr-slate-800);
    border-bottom-left-radius: 4px;
}

.rr-chat-time {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.7;
}

.rr-chat-input-bar {
    padding: 16px 24px;
    border-top: 1px solid var(--rr-slate-200);
    display: flex;
    gap: 12px;
    background: var(--rr-slate-50);
}

.rr-chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--rr-slate-300);
    border-radius: var(--rr-radius-sm);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--rr-transition);
}

.rr-chat-input:focus {
    border-color: var(--rr-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* ── Status Dot ── */
.rr-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.rr-status-dot-green { background: var(--rr-green); }
.rr-status-dot-amber { background: var(--rr-amber); }
.rr-status-dot-red { background: var(--rr-red); }
.rr-status-dot-blue { background: var(--rr-blue); }
.rr-status-dot-gray { background: var(--rr-slate-400); }

/* ── Checkmark / Status Grid ── */
.rr-check-grid {
    display: flex;
    gap: 8px;
}

.rr-check-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}

.rr-check-yes {
    color: var(--rr-green);
}

.rr-check-no {
    color: var(--rr-slate-400);
}

/* ── Onboarding Step Indicators ── */
.rr-onboard-steps {
    display: flex;
    gap: 6px;
}

.rr-onboard-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: var(--rr-transition);
}

.rr-onboard-step-done {
    background: var(--rr-green-light);
    color: var(--rr-green-dark);
}

.rr-onboard-step-pending {
    background: var(--rr-slate-100);
    color: var(--rr-slate-400);
}

/* ── Section Header (used within cards) ── */
.rr-section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--rr-slate-800);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rr-section-divider {
    height: 1px;
    background: var(--rr-slate-200);
    margin: 24px 0;
}

/* ── Info Tip (used in chart footers, etc.) ── */
.rr-info-tip {
    font-size: 12px;
    color: var(--rr-slate-500);
    background: var(--rr-slate-50);
    padding: 10px 14px;
    border-radius: var(--rr-radius-sm);
    border: 1px solid var(--rr-slate-200);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.rr-info-tip i {
    color: var(--rr-blue);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Pagination ── */
.rr-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.rr-pagination-info {
    font-size: 13px;
    color: var(--rr-slate-500);
}

.rr-pagination-pages {
    display: flex;
    gap: 4px;
}

.rr-pagination-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rr-radius-sm);
    border: 1px solid var(--rr-slate-200);
    background: white;
    color: var(--rr-slate-600);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--rr-transition);
    text-decoration: none;
    font-family: inherit;
}

.rr-pagination-btn:hover {
    background: var(--rr-slate-50);
    border-color: var(--rr-blue);
    color: var(--rr-blue);
}

.rr-pagination-btn.active {
    background: var(--rr-blue);
    color: white;
    border-color: var(--rr-blue);
}

/* ── Utility Classes ── */
.rr-text-muted { color: var(--rr-slate-500) !important; }
.rr-text-sm { font-size: 12px !important; }
.rr-text-xs { font-size: 11px !important; }
.rr-text-bold { font-weight: 700 !important; }
.rr-text-extrabold { font-weight: 800 !important; }
.rr-text-center { text-align: center !important; }
.rr-text-right { text-align: right !important; }
.rr-text-nowrap { white-space: nowrap !important; }
.rr-text-green { color: var(--rr-green) !important; }
.rr-text-red { color: var(--rr-red) !important; }
.rr-text-amber { color: var(--rr-amber) !important; }
.rr-text-blue { color: var(--rr-blue) !important; }

.rr-mt-0 { margin-top: 0 !important; }
.rr-mt-1 { margin-top: 8px !important; }
.rr-mt-2 { margin-top: 16px !important; }
.rr-mt-3 { margin-top: 24px !important; }
.rr-mt-4 { margin-top: 32px !important; }
.rr-mb-0 { margin-bottom: 0 !important; }
.rr-mb-1 { margin-bottom: 8px !important; }
.rr-mb-2 { margin-bottom: 16px !important; }
.rr-mb-3 { margin-bottom: 24px !important; }
.rr-mb-4 { margin-bottom: 32px !important; }
.rr-mr-1 { margin-right: 8px !important; }
.rr-ml-auto { margin-left: auto !important; }
.rr-p-0 { padding: 0 !important; }
.rr-p-3 { padding: 24px !important; }
.rr-p-4 { padding: 32px !important; }
.rr-gap-1 { gap: 8px !important; }
.rr-gap-2 { gap: 16px !important; }
.rr-gap-3 { gap: 24px !important; }

.rr-flex { display: flex !important; }
.rr-flex-col { flex-direction: column !important; }
.rr-flex-wrap { flex-wrap: wrap !important; }
.rr-items-center { align-items: center !important; }
.rr-justify-between { justify-content: space-between !important; }
.rr-justify-center { justify-content: center !important; }
.rr-hidden { display: none !important; }
.rr-w-full { width: 100% !important; }

/* ── Quick Nav Cards ── */
.rr-nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.rr-nav-card {
    background: white;
    border: 1px solid var(--rr-slate-200);
    border-radius: var(--rr-radius-md);
    padding: 20px;
    text-decoration: none;
    transition: var(--rr-transition);
    display: flex;
    align-items: center;
    gap: 16px;
}

.rr-nav-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--rr-card-shadow-hover);
    border-color: var(--rr-blue);
}

.rr-nav-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--rr-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.rr-nav-card-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--rr-slate-800);
    margin-bottom: 2px;
}

.rr-nav-card-desc {
    font-size: 12px;
    color: var(--rr-slate-500);
}

/* ── Gauge / Score Ring ── */
.rr-score-ring {
    position: relative;
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rr-score-ring svg {
    transform: rotate(-90deg);
}

.rr-score-ring-value {
    position: absolute;
    font-size: 14px;
    font-weight: 800;
    color: var(--rr-slate-800);
}

/* ── Modal / Overlay ── */
.rr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rr-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.rr-modal {
    background: white;
    border-radius: var(--rr-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
}

.rr-modal-overlay.active .rr-modal {
    transform: scale(1) translateY(0);
}

.rr-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--rr-slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rr-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--rr-slate-900);
    margin: 0;
}

.rr-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--rr-slate-100);
    color: var(--rr-slate-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--rr-transition);
}

.rr-modal-close:hover {
    background: var(--rr-slate-200);
}

.rr-modal-body {
    padding: 24px;
}

.rr-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--rr-slate-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ── Form Elements ── */
.rr-form-group {
    margin-bottom: 16px;
}

.rr-form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--rr-slate-700);
    margin-bottom: 6px;
}

.rr-form-input,
.rr-form-select,
.rr-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--rr-slate-300);
    border-radius: var(--rr-radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--rr-slate-800);
    transition: var(--rr-transition);
    outline: none;
    background: white;
    box-sizing: border-box;
}

.rr-form-input:focus,
.rr-form-select:focus,
.rr-form-textarea:focus {
    border-color: var(--rr-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.rr-form-textarea {
    resize: vertical;
    min-height: 100px;
}

.rr-form-hint {
    font-size: 12px;
    color: var(--rr-slate-500);
    margin-top: 4px;
}

/* ── Expandable Row ── */
.rr-expandable-row {
    cursor: pointer;
}

.rr-expandable-row .rr-expand-icon {
    transition: transform 0.2s;
}

.rr-expandable-row.expanded .rr-expand-icon {
    transform: rotate(90deg);
}

.rr-expanded-detail {
    display: none;
    animation: rr-slideUp 0.3s ease-out;
}

.rr-expanded-detail.active {
    display: table-row;
}

.rr-expanded-detail td {
    background: var(--rr-slate-50);
    padding: 20px 24px;
}

/* ── Metric Cards (for baseline / comparison) ── */
.rr-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.rr-metric-card {
    background: var(--rr-slate-50);
    border: 1px solid var(--rr-slate-200);
    border-radius: var(--rr-radius-sm);
    padding: 14px 16px;
    text-align: center;
}

.rr-metric-card-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--rr-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rr-metric-card-value {
    font-size: 24px;
    font-weight: 900;
    color: var(--rr-slate-900);
    margin-top: 4px;
}

.rr-metric-card-unit {
    font-size: 12px;
    color: var(--rr-slate-400);
    font-weight: 600;
}

/* ── Sidebar Submenu (for admin layout) ── */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-submenu.open {
    max-height: 600px;
}

.sidebar-submenu li {
    margin-bottom: 0;
}

.sidebar-submenu a {
    padding: 10px 20px 10px 52px !important;
    font-size: 13px !important;
    border-left: none !important;
    color: rgba(255, 255, 255, 0.65) !important;
    position: relative;
}

.sidebar-submenu a::before {
    content: '';
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.sidebar-submenu a:hover,
.sidebar-submenu a.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.sidebar-submenu a:hover::before,
.sidebar-submenu a.active::before {
    background: var(--primary-orange);
    width: 6px;
    height: 6px;
}

.submenu-toggle {
    position: relative;
}

.submenu-arrow {
    margin-left: auto !important;
    font-size: 11px !important;
    transition: transform 0.3s ease;
    width: auto !important;
    margin-right: 0 !important;
}

.submenu-arrow.open {
    transform: rotate(180deg);
}

/* ── Print Styles ── */
@media print {
    .rr-no-print { display: none !important; }
    .rr-page-header { box-shadow: none; border: 1px solid #ddd; }
    .rr-kpi-card { box-shadow: none; border: 1px solid #ddd; }
    .rr-card { box-shadow: none; border: 1px solid #ddd; }
    .rr-data-table tbody tr { animation: none; opacity: 1; }
    .rr-btn { display: none !important; }
    .admin-sidebar { display: none !important; }
    .admin-header { display: none !important; }
    .admin-main { margin-left: 0 !important; }
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .rr-charts-grid { grid-template-columns: 1fr; }
    .rr-chart-span-2 { grid-column: span 1; }
}

@media (max-width: 992px) {
    .rr-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .rr-split-panel { grid-template-columns: 1fr; height: auto; }
    .rr-split-left { max-height: 300px; border-right: none; border-bottom: 1px solid var(--rr-slate-200); }
    .rr-pipeline { gap: 8px; }
    .rr-pipeline-step { min-width: 80px; }
    .rr-pipeline-step-value { font-size: 22px; }
}

@media (max-width: 768px) {
    .rr-page-header { padding: 16px 20px; }
    .rr-page-title { font-size: 22px; }
    .rr-kpi-grid { grid-template-columns: 1fr; }
    .rr-filter-bar { flex-direction: column; align-items: stretch; }
    .rr-filter-input { min-width: 100%; }
    .rr-nav-cards { grid-template-columns: 1fr; }
    .rr-metric-grid { grid-template-columns: repeat(2, 1fr); }
    .rr-modal {
        max-height: calc(100vh - 200px);
        margin: auto;
    }
}
