/* RESELL RIGHTS DESIGN SYSTEM - PREMIUM SAAS UI KIT */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */

:root, [data-theme="light"] {
    /* Colors - Background & Surface */
    --rr-bg: #FAF8F5;
    --rr-surface: #FFFFFF;
    --rr-surface-raised: #FFFFFF;
    --rr-surface-soft: #F3EFEA;

    /* Colors - Text */
    --rr-text-primary: #0F172A;
    --rr-text-secondary: #475569;
    --rr-text-muted: #94A3B8;
    --rr-text-disabled: #CBD5E1;

    /* Colors - Borders */
    --rr-border: #E5DFD5;
    --rr-border-strong: rgba(229, 223, 213, 0.6);

    /* Colors - Brand & Status */
    --rr-navy: #0B0F19;
    --rr-navy-dark: #151D2A;
    --rr-orange: #FF4801;
    --rr-orange-dark: #E63D00;
    --rr-orange-light: rgba(255, 72, 1, 0.1);
    
    --rr-success: #10B981;
    --rr-success-light: rgba(16, 185, 129, 0.1);
    --rr-danger: #E5484D;
    --rr-danger-light: rgba(229, 72, 77, 0.1);
    --rr-warning: #F4B740;
    --rr-warning-light: rgba(244, 183, 64, 0.15);
    --rr-info: #3B82F6;
    --rr-info-light: rgba(59, 130, 246, 0.1);

    /* Shadows (Crisp, Enterprise) */
    --rr-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --rr-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
    --rr-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
    --rr-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    --rr-shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.03);
    --rr-focus-ring: 0 0 0 3px rgba(255, 72, 1, 0.15);
}

[data-theme="dark"], body.theme-dark {
    /* Colors - Background & Surface */
    --rr-bg: #0B0F19;
    --rr-surface: #131A28;
    --rr-surface-raised: #1A2334;
    --rr-surface-soft: #1A2334;

    /* Colors - Text */
    --rr-text-primary: #F8FAFC;
    --rr-text-secondary: #CBD5E1;
    --rr-text-muted: #94A3B8;
    --rr-text-disabled: #475569;

    /* Colors - Borders */
    --rr-border: #263347;
    --rr-border-strong: rgba(38, 51, 71, 0.6);

    /* Colors - Brand & Status */
    --rr-navy: #0B0F19;
    --rr-navy-dark: #131A28;
    --rr-orange: #FF5A1F;
    --rr-orange-dark: #FF7038;
    --rr-orange-light: rgba(255, 90, 31, 0.15);

    --rr-success: #10B981;
    --rr-success-light: rgba(16, 185, 129, 0.15);
    --rr-danger: #E5484D;
    --rr-danger-light: rgba(229, 72, 77, 0.15);
    --rr-warning: #F4B740;
    --rr-warning-light: rgba(244, 183, 64, 0.15);
    --rr-info: #3B82F6;
    --rr-info-light: rgba(59, 130, 246, 0.15);

    /* Shadows */
    --rr-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --rr-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
    --rr-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --rr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --rr-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --rr-focus-ring: 0 0 0 3px rgba(255, 90, 31, 0.25);
}

:root {
    /* Typography */
    --rr-font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Spacing (4px scale) */
    --rr-space-1: 4px;
    --rr-space-2: 8px;
    --rr-space-3: 12px;
    --rr-space-4: 16px;
    --rr-space-5: 20px;
    --rr-space-6: 24px;
    --rr-space-8: 32px;
    --rr-space-10: 40px;
    --rr-space-12: 48px;
    --rr-space-16: 64px;
    --rr-space-20: 80px;

    /* Border Radius (Professional/Sharper) */
        /* Layout Tokens (Phase 12 Refinement) */
    --rr-sidebar-width: 240px;
    --rr-sidebar-collapsed-width: 72px;
    --rr-topbar-height: 60px;
    --rr-page-padding-x: 28px;
    --rr-page-padding-y: 24px;
    --rr-menu-item-height: 42px;
    --rr-submenu-item-height: 38px;

    --rr-radius-xs: 4px;
    --rr-radius-sm: 6px;
    --rr-radius-md: 8px;
    --rr-radius-lg: 12px;
    --rr-radius-xl: 16px;
    --rr-radius-full: 9999px;

    /* Transitions & Motion */
    --rr-transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
    --rr-transition-normal: 200ms cubic-bezier(0.16, 1, 0.3, 1);
    --rr-transition-slow: 300ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Z-Index */
    --rr-z-base: 1;
    --rr-z-sticky: 100;
    --rr-z-header: 200;
    --rr-z-dropdown: 300;
    --rr-z-popover: 400;
    --rr-z-overlay: 500;
    --rr-z-drawer: 600;
    --rr-z-modal: 700;
    --rr-z-toast: 800;
    --rr-z-max: 9999;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--rr-font-primary);
    background-color: var(--rr-bg);
    color: var(--rr-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--rr-transition-slow), color var(--rr-transition-slow);
    /* overflow-x: hidden removed */
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--rr-text-primary); letter-spacing: -0.02em; margin-bottom: var(--rr-space-2); }
h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.04em; font-weight: 800; line-height: 1.1; }
h2 { font-size: clamp(24px, 4vw, 36px); letter-spacing: -0.03em; font-weight: 700; line-height: 1.2; }
h3 { font-size: clamp(20px, 3vw, 24px); line-height: 1.3; }
h4 { font-size: 20px; line-height: 1.4; }
h5 { font-size: 16px; line-height: 1.5; }
h6 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; color: var(--rr-text-muted); }

p { color: var(--rr-text-secondary); margin-bottom: var(--rr-space-4); }

.rr-text-xs { font-size: 12px; }
.rr-text-sm { font-size: 14px; }
.rr-text-base { font-size: 16px; }
.rr-text-lg { font-size: 18px; }
.rr-text-xl { font-size: 20px; }
.rr-text-2xl { font-size: 24px; }

.rr-font-normal { font-weight: 400; }
.rr-font-medium { font-weight: 500; }
.rr-font-semibold { font-weight: 600; }
.rr-font-bold { font-weight: 700; }
.rr-font-extrabold { font-weight: 800; }

.rr-text-muted { color: var(--rr-text-muted); }
.rr-text-brand { color: var(--rr-orange); }

/* ==========================================================================
   LAYOUT & SHOWCASE STRUCTURE
   ========================================================================== */

.ds-layout { display: flex; min-height: 100vh; }

.ds-sidebar {
    width: 280px; background: var(--rr-surface); border-right: 1px solid var(--rr-border);
    height: 100vh; position: sticky; top: 0; overflow-y: auto; z-index: var(--rr-z-header); /* Changed to use proper Z variable */
    padding: var(--rr-space-6); display: flex; flex-direction: column; gap: var(--rr-space-6);
}

.ds-main { flex: 1; padding: var(--rr-space-10) var(--rr-space-8); overflow-x: hidden; }

.ds-nav-group { display: flex; flex-direction: column; gap: var(--rr-space-2); }
.ds-nav-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--rr-text-muted); margin-bottom: var(--rr-space-2); }
.ds-nav-link { 
    font-size: 14px; font-weight: 500; color: var(--rr-text-secondary); text-decoration: none; 
    padding: var(--rr-space-2) var(--rr-space-3); border-radius: var(--rr-radius-sm); transition: all var(--rr-transition-fast);
    display: flex; align-items: center; gap: var(--rr-space-2);
}
.ds-nav-link:hover, .ds-nav-link.active { background: var(--rr-surface-soft); color: var(--rr-text-primary); }

.ds-section { margin-bottom: var(--rr-space-16); scroll-margin-top: var(--rr-space-10); }
.ds-section-header { margin-bottom: var(--rr-space-6); padding-bottom: var(--rr-space-4); border-bottom: 1px solid var(--rr-border); }
.ds-section-title { font-size: 24px; margin-bottom: var(--rr-space-2); }
.ds-section-desc { font-size: 16px; color: var(--rr-text-muted); }

.ds-grid { display: grid; gap: var(--rr-space-6); }
.ds-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.ds-grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.ds-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.ds-preview-box {
    border: 1px solid var(--rr-border); border-radius: var(--rr-radius-lg); background: var(--rr-bg);
    padding: var(--rr-space-8); display: flex; flex-wrap: wrap; gap: var(--rr-space-4); align-items: center;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Buttons */
.rr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--rr-space-2);
    font-family: var(--rr-font-primary); font-size: 14px; font-weight: 500;
    border-radius: var(--rr-radius-md); border: 1px solid transparent;
    cursor: pointer; transition: all var(--rr-transition-normal); text-decoration: none;
    white-space: nowrap; user-select: none;
    padding: 0.6rem var(--rr-space-4); min-height: 42px; /* Default size = md with robust padding */
}
.rr-btn:focus-visible { outline: none; box-shadow: var(--rr-focus-ring); }
.rr-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.rr-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Button Sizes */
.rr-btn-xs { padding: 0 var(--rr-space-2); min-height: 28px; font-size: 12px; border-radius: var(--rr-radius-sm); }
.rr-btn-sm { padding: 0 var(--rr-space-3); min-height: 32px; font-size: 13px; }
.rr-btn-md { padding: 0 var(--rr-space-4); min-height: 40px; }
.rr-btn-lg { padding: 0 var(--rr-space-5); min-height: 48px; font-size: 15px; }
.rr-btn-xl { padding: 0 var(--rr-space-6); min-height: 56px; font-size: 16px; }
.rr-btn-icon { padding: 0; width: 40px; height: 40px; }

/* Button Variants */
.rr-btn-primary { background-color: var(--rr-orange); color: #FFF; border-color: var(--rr-orange); box-shadow: var(--rr-shadow-sm); }
.rr-btn-primary:hover { background-color: var(--rr-orange-dark); box-shadow: var(--rr-shadow-md); transform: translateY(-1px); }

.rr-btn-secondary { background-color: var(--rr-surface); color: var(--rr-text-primary); border-color: var(--rr-border-strong); box-shadow: var(--rr-shadow-xs); }
.rr-btn-secondary:hover { background-color: var(--rr-surface-soft); border-color: var(--rr-text-disabled); transform: translateY(-1px); }

.rr-btn-outline { background-color: transparent; color: var(--rr-text-primary); border-color: var(--rr-border-strong); }
.rr-btn-outline:hover { background-color: var(--rr-surface-soft); }

.rr-btn-ghost { background-color: transparent; color: var(--rr-text-secondary); }
.rr-btn-ghost:hover { background-color: var(--rr-surface-soft); color: var(--rr-text-primary); }

.rr-btn-danger { background-color: var(--rr-danger); color: #FFF; border-color: var(--rr-danger); }
.rr-btn-danger:hover { background-color: #C83237; }

/* Cards */
.rr-card {
    background-color: var(--rr-surface); border: 1px solid var(--rr-border);
    border-radius: var(--rr-radius-lg); box-shadow: var(--rr-shadow-xs);
    overflow: hidden; display: flex; flex-direction: column;
}
.rr-card-interactive { transition: all var(--rr-transition-normal); cursor: pointer; }
.rr-card-interactive:hover { box-shadow: var(--rr-shadow-md); transform: translateY(-2px); border-color: var(--rr-border-strong); }
.rr-card-header { padding: var(--rr-space-5) var(--rr-space-6); border-bottom: 1px solid var(--rr-border); display: flex; justify-content: space-between; align-items: center; }
.rr-card-title { font-size: 16px; font-weight: 600; color: var(--rr-text-primary); margin: 0; }
.rr-card-body { padding: var(--rr-space-6); flex: 1; }
.rr-card-footer { padding: var(--rr-space-4) var(--rr-space-6); border-top: 1px solid var(--rr-border); background-color: var(--rr-bg); display: flex; justify-content: flex-end; gap: var(--rr-space-3); }

/* Inputs & Forms */
.rr-form-group { margin-bottom: var(--rr-space-4); display: flex; flex-direction: column; gap: var(--rr-space-1); }
.rr-label { font-size: 14px; font-weight: 500; color: var(--rr-text-primary); }
.rr-label-required::after { content: '*'; color: var(--rr-danger); margin-left: 4px; }
.rr-input, .rr-select, .rr-textarea {
    width: 100%; padding: 0 var(--rr-space-3); min-height: 40px;
    font-family: var(--rr-font-primary); font-size: 14px;
    background-color: var(--rr-surface); color: var(--rr-text-primary);
    border: 1px solid var(--rr-border-strong); border-radius: var(--rr-radius-md);
    transition: all var(--rr-transition-fast); box-shadow: var(--rr-shadow-xs);
}
.rr-textarea { padding: var(--rr-space-3); min-height: 100px; resize: vertical; }
.rr-input:focus, .rr-select:focus, .rr-textarea:focus { outline: none; border-color: var(--rr-orange); box-shadow: var(--rr-focus-ring); }
.rr-input::placeholder, .rr-textarea::placeholder { color: var(--rr-text-muted); }
.rr-input:disabled { background-color: var(--rr-bg); cursor: not-allowed; opacity: 0.7; }
.rr-input-error { border-color: var(--rr-danger); }
.rr-input-error:focus { box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.15); }
.rr-helper-text { font-size: 12px; color: var(--rr-text-muted); }
.rr-error-text { font-size: 12px; color: var(--rr-danger); font-weight: 500; }

/* Input with Icon */
.rr-input-icon-wrapper { position: relative; display: flex; align-items: center; }
.rr-input-icon { position: absolute; left: var(--rr-space-3); color: var(--rr-text-muted); width: 18px; height: 18px; pointer-events: none; }
.rr-input-with-icon { padding-left: 40px; }

/* Badges */
.rr-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px;
    font-size: 12px; font-weight: 600; border-radius: var(--rr-radius-full);
    white-space: nowrap; line-height: 1.5;
}
.rr-badge-dot { width: 6px; height: 6px; border-radius: 50%; background-color: currentColor; }
.rr-badge-success { background-color: var(--rr-success-light); color: var(--rr-success); }
.rr-badge-warning { background-color: var(--rr-warning-light); color: var(--rr-warning); }
.rr-badge-danger { background-color: var(--rr-danger-light); color: var(--rr-danger); }
.rr-badge-info { background-color: var(--rr-info-light); color: var(--rr-info); }
.rr-badge-primary { background-color: var(--rr-orange-light); color: var(--rr-orange); }
.rr-badge-neutral { background-color: var(--rr-surface-soft); color: var(--rr-text-secondary); border: 1px solid var(--rr-border); }

/* Tables */
.rr-table-wrapper { width: 100%; overflow-x: auto; border: 1px solid var(--rr-border); border-radius: var(--rr-radius-lg); background: var(--rr-surface); }
.rr-table { width: 100%; border-collapse: collapse; text-align: left; }
.rr-table th, .rr-table td { padding: var(--rr-space-3) var(--rr-space-4); border-bottom: 1px solid var(--rr-border); font-size: 14px; }
.rr-table th { font-weight: 600; color: var(--rr-text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--rr-bg); }
.rr-table tr:last-child td { border-bottom: none; }
.rr-table tbody tr:hover { background-color: var(--rr-surface-soft); }

/* Modals & Overlays */
.rr-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 15, 25, 0.4); backdrop-filter: blur(4px);
    z-index: var(--rr-z-overlay); opacity: 0; pointer-events: none;
    transition: opacity var(--rr-transition-normal);
}
.rr-overlay.active { opacity: 1; pointer-events: auto; }
.rr-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%) scale(0.96);
    background: var(--rr-surface); border-radius: var(--rr-radius-xl);
    width: 90%; max-width: 500px; z-index: var(--rr-z-modal);
    box-shadow: var(--rr-shadow-xl); opacity: 0; pointer-events: none;
    transition: all var(--rr-transition-normal); display: flex; flex-direction: column;
}
.rr-modal.active { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

/* Drawers */
.rr-drawer {
    position: fixed; top: 0; bottom: 0; width: 100%; max-width: 400px;
    background: var(--rr-surface); z-index: var(--rr-z-drawer);
    box-shadow: var(--rr-shadow-xl); transition: transform var(--rr-transition-slow);
    display: flex; flex-direction: column;
}
.rr-drawer-right { right: 0; transform: translateX(100%); }
.rr-drawer-left { left: 0; transform: translateX(-100%); }
.rr-drawer-right.active, .rr-drawer-left.active { transform: translateX(0); }

/* Toasts */
.rr-toast-container { position: fixed; bottom: var(--rr-space-6); right: var(--rr-space-6); z-index: var(--rr-z-toast); display: flex; flex-direction: column; gap: var(--rr-space-3); }
.rr-toast {
    background: var(--rr-surface); border-radius: var(--rr-radius-lg); border: 1px solid var(--rr-border);
    box-shadow: var(--rr-shadow-lg); padding: var(--rr-space-4); display: flex; gap: var(--rr-space-3);
    min-width: 300px; max-width: 400px; transform: translateX(120%); transition: transform var(--rr-transition-normal);
}
.rr-toast.active { transform: translateX(0); }
.rr-toast-icon { flex-shrink: 0; }
.rr-toast-content { flex: 1; }
.rr-toast-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.rr-toast-msg { font-size: 13px; color: var(--rr-text-secondary); margin: 0; }

/* Dashboard Specific Layout */
.rr-dashboard-layout { display: flex; min-height: 100vh; background: var(--rr-bg); }
.rr-topbar { height: 64px; background: var(--rr-surface); border-bottom: 1px solid var(--rr-border); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--rr-space-6); position: sticky; top: 0; z-index: var(--rr-z-header); }
.rr-content { flex: 1; padding: var(--rr-space-6); overflow-y: auto; }
.rr-stat-card { display: flex; flex-direction: column; gap: var(--rr-space-2); }
.rr-stat-value { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; color: var(--rr-text-primary); }
.rr-stat-trend { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.rr-stat-trend.up { color: var(--rr-success); }
.rr-stat-trend.down { color: var(--rr-danger); }

/* Utility Classes */
.rr-flex { display: flex; }
.rr-items-center { align-items: center; }
.rr-justify-between { justify-content: space-between; }
.rr-gap-2 { gap: var(--rr-space-2); }
.rr-gap-4 { gap: var(--rr-space-4); }
.rr-mt-4 { margin-top: var(--rr-space-4); }
.rr-mb-4 { margin-bottom: var(--rr-space-4); }

/* Avatars */
.rr-avatar { border-radius: var(--rr-radius-full); background: var(--rr-surface-soft); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--rr-orange); border: 1px solid var(--rr-border); flex-shrink: 0; overflow: hidden; }
.rr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rr-avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.rr-avatar-md { width: 40px; height: 40px; font-size: 14px; }
.rr-avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* Tabs */
.rr-tabs { display: flex; border-bottom: 1px solid var(--rr-border); gap: var(--rr-space-6); }
.rr-tab { padding: var(--rr-space-3) 0; font-size: 14px; font-weight: 500; color: var(--rr-text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: all var(--rr-transition-fast); }
.rr-tab:hover { color: var(--rr-text-primary); }
.rr-tab.active { color: var(--rr-orange); border-bottom-color: var(--rr-orange); font-weight: 600; }

/* Theme Switcher specific for docs */
.theme-switcher-wrapper { position: fixed; bottom: 20px; right: 20px; z-index: var(--rr-z-max); }
.theme-switcher { background: var(--rr-surface); border: 1px solid var(--rr-border); border-radius: var(--rr-radius-full); display: flex; padding: 4px; box-shadow: var(--rr-shadow-lg); }
.theme-btn { background: transparent; border: none; padding: 8px; cursor: pointer; border-radius: var(--rr-radius-full); color: var(--rr-text-muted); transition: var(--rr-transition-fast); }
.theme-btn.active { background: var(--rr-surface-soft); color: var(--rr-orange); }


/* Alerts */
.rr-alert {
    padding: var(--rr-space-4); border-radius: var(--rr-radius-md); border: 1px solid transparent;
    display: flex; gap: var(--rr-space-3); font-size: 14px;
}
.rr-alert-icon { flex-shrink: 0; }
.rr-alert-content { flex: 1; }
.rr-alert-title { font-weight: 600; margin-bottom: 2px; }
.rr-alert-desc { color: var(--rr-text-secondary); }

.rr-alert-info { background: var(--rr-info-light); border-color: rgba(59, 130, 246, 0.2); color: var(--rr-info); }
.rr-alert-info .rr-alert-title, .rr-alert-info .rr-alert-icon { color: var(--rr-info); }

.rr-alert-success { background: var(--rr-success-light); border-color: rgba(16, 185, 129, 0.2); color: var(--rr-success); }
.rr-alert-success .rr-alert-title, .rr-alert-success .rr-alert-icon { color: var(--rr-success); }

.rr-alert-warning { background: var(--rr-warning-light); border-color: rgba(244, 183, 64, 0.2); color: var(--rr-warning); }
.rr-alert-warning .rr-alert-title, .rr-alert-warning .rr-alert-icon { color: var(--rr-warning); }

.rr-alert-danger { background: var(--rr-danger-light); border-color: rgba(229, 72, 77, 0.2); color: var(--rr-danger); }
.rr-alert-danger .rr-alert-title, .rr-alert-danger .rr-alert-icon { color: var(--rr-danger); }

/* Loaders */
.rr-spinner {
    border: 3px solid var(--rr-border); border-top-color: var(--rr-orange);
    border-radius: 50%; width: 24px; height: 24px; animation: rr-spin 1s linear infinite;
}
@keyframes rr-spin { to { transform: rotate(360deg); } }
.rr-spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.rr-spinner-lg { width: 32px; height: 32px; border-width: 3px; }

/* Pagination */
.rr-pagination { display: flex; align-items: center; gap: var(--rr-space-1); }
.rr-page-item {
    min-width: 36px; height: 36px; padding: 0 var(--rr-space-2);
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--rr-radius-sm); font-size: 14px; font-weight: 500;
    color: var(--rr-text-secondary); cursor: pointer; transition: all var(--rr-transition-fast);
}
.rr-page-item:hover { background: var(--rr-surface-soft); color: var(--rr-text-primary); }
.rr-page-item.active { background: var(--rr-orange); color: white; }
.rr-page-item.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Empty States */
.rr-empty-state {
    padding: var(--rr-space-10) var(--rr-space-6); text-align: center;
    border: 1px dashed var(--rr-border-strong); border-radius: var(--rr-radius-lg);
    background: var(--rr-surface-soft); display: flex; flex-direction: column; align-items: center;
}
.rr-empty-icon {
    width: 64px; height: 64px; border-radius: var(--rr-radius-full);
    background: var(--rr-surface); display: flex; align-items: center; justify-content: center;
    color: var(--rr-text-muted); margin-bottom: var(--rr-space-4); box-shadow: var(--rr-shadow-sm);
}
.rr-empty-title { font-size: 18px; font-weight: 600; color: var(--rr-text-primary); margin-bottom: var(--rr-space-2); }
.rr-empty-desc { font-size: 14px; color: var(--rr-text-secondary); max-width: 400px; margin-bottom: var(--rr-space-6); }

/* Dropdowns & Menus */
.rr-dropdown-wrapper { position: relative; display: inline-block; }
.rr-dropdown-menu {
    position: absolute; top: calc(100% + var(--rr-space-2)); right: 0;
    min-width: 200px; background: var(--rr-surface); border: 1px solid var(--rr-border);
    border-radius: var(--rr-radius-md); box-shadow: var(--rr-shadow-md);
    padding: var(--rr-space-2) 0; z-index: var(--rr-z-dropdown);
    opacity: 0; pointer-events: none; transform: translateY(-10px); transition: all var(--rr-transition-fast);
}
.rr-dropdown-wrapper:hover .rr-dropdown-menu,
.rr-dropdown-menu.active {
    opacity: 1; pointer-events: auto; transform: translateY(0);
}
.rr-dropdown-item {
    padding: var(--rr-space-2) var(--rr-space-4); font-size: 14px; color: var(--rr-text-primary);
    display: flex; align-items: center; gap: var(--rr-space-2); cursor: pointer; transition: background var(--rr-transition-fast);
}
.rr-dropdown-item:hover { background: var(--rr-surface-soft); }
.rr-dropdown-item.danger { color: var(--rr-danger); }
.rr-dropdown-divider { height: 1px; background: var(--rr-border); margin: var(--rr-space-1) 0; }
/* Responsive adjustments */
@media (max-width: 768px) {
    .ds-sidebar { display: none; }
    .ds-main { padding: var(--rr-space-6) var(--rr-space-4); }
    .ds-section-title { font-size: 20px; }
}

html {
    scroll-behavior: smooth;
}

/* Scroll Reveal Animations */
.rr-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.rr-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Native UI Kit Dashboard Layout System */
.rr-dashboard-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--rr-bg);
}
.rr-sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--rr-surface);
    border-right: 1px solid var(--rr-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}
.rr-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--rr-bg);
    width: 100%;
}
#content.rr-main {
    padding: 0 !important; /* Override layout.css */
}
.rr-topbar {
    height: 64px;
    min-height: 64px;
    background: var(--rr-surface);
    border-bottom: 1px solid var(--rr-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--rr-space-6);
    z-index: var(--rr-z-header);
}
.rr-content {
    flex: 1;
    padding: var(--rr-space-6);
    overflow-y: auto;
    /* overflow-x: hidden removed */
}



