/* ============================================
   Richyy - Elegant Financial Management Platform
   Modern Design with Bootstrap 5.3 Light/Dark Mode
   ============================================ */

/* Import distinctive fonts - Outfit for headings, Plus Jakarta Sans for body */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ============================================
   CSS Custom Properties - Light Mode (Default)
   Sophisticated Warm Palette
   ============================================ */

:root,
[data-bs-theme="light"] {
    /* Primary - Deep Jade Teal */
    --richyy-primary: #0d9488;
    --richyy-primary-hover: #0f766e;
    --richyy-primary-light: #14b8a6;
    --richyy-primary-subtle: rgba(13, 148, 136, 0.08);
    --richyy-primary-glow: rgba(13, 148, 136, 0.15);
    
    /* Secondary - Warm Espresso */
    --richyy-secondary: #78716c;
    --richyy-secondary-hover: #57534e;
    
    /* Accent - Golden Amber */
    --richyy-accent: #d97706;
    --richyy-accent-light: #f59e0b;
    --richyy-accent-subtle: rgba(217, 119, 6, 0.1);
    
    /* Status Colors */
    --richyy-success: #059669;
    --richyy-success-light: #10b981;
    --richyy-success-subtle: rgba(5, 150, 105, 0.1);
    --richyy-danger: #dc2626;
    --richyy-danger-light: #ef4444;
    --richyy-danger-subtle: rgba(220, 38, 38, 0.08);
    --richyy-warning: #d97706;
    --richyy-warning-subtle: rgba(217, 119, 6, 0.1);
    --richyy-info: #0284c7;
    --richyy-info-subtle: rgba(2, 132, 199, 0.1);
    
    /* Neutral Palette - Warm Stone */
    --richyy-white: #ffffff;
    --richyy-gray-50: #fafaf9;
    --richyy-gray-100: #f5f5f4;
    --richyy-gray-200: #e7e5e4;
    --richyy-gray-300: #d6d3d1;
    --richyy-gray-400: #a8a29e;
    --richyy-gray-500: #78716c;
    --richyy-gray-600: #57534e;
    --richyy-gray-700: #44403c;
    --richyy-gray-800: #292524;
    --richyy-gray-900: #1c1917;
    
    /* Backgrounds & Surfaces */
    --richyy-bg-body: linear-gradient(135deg, #fafaf9 0%, #f5f5f4 50%, #fafaf9 100%);
    --richyy-bg-body-solid: #fafaf9;
    --richyy-bg-card: #ffffff;
    --richyy-bg-card-elevated: #ffffff;
    --richyy-bg-secondary: #f5f5f4;
    --richyy-bg-tertiary: #e7e5e4;
    --richyy-bg-navbar: rgba(255, 255, 255, 0.85);
    
    /* Text Colors */
    --richyy-text-primary: #1c1917;
    --richyy-text-secondary: #57534e;
    --richyy-text-muted: #78716c;
    --richyy-text-placeholder: #a8a29e;
    
    /* Borders */
    --richyy-border-color: #e7e5e4;
    --richyy-border-color-light: #f5f5f4;
    --richyy-border-color-focus: var(--richyy-primary);
    
    /* Shadows - Warm tinted */
    --richyy-shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.04);
    --richyy-shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --richyy-shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.07), 0 2px 4px -2px rgba(28, 25, 23, 0.05);
    --richyy-shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.05);
    --richyy-shadow-xl: 0 20px 25px -5px rgba(28, 25, 23, 0.1), 0 8px 10px -6px rgba(28, 25, 23, 0.06);
    --richyy-shadow-glow: 0 0 40px rgba(13, 148, 136, 0.12);
    
    /* Gradients */
    --richyy-gradient-primary: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    --richyy-gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --richyy-gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --richyy-gradient-warm: linear-gradient(135deg, #fafaf9 0%, #f5f5f4 100%);
    --richyy-gradient-card: linear-gradient(145deg, #ffffff 0%, #fafaf9 100%);
    
    /* Border Radius */
    --richyy-radius-sm: 6px;
    --richyy-radius-md: 8px;
    --richyy-radius-lg: 12px;
    --richyy-radius-xl: 16px;
    --richyy-radius-2xl: 20px;
    --richyy-radius-full: 9999px;
    
    /* Transitions */
    --richyy-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --richyy-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --richyy-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-Index Scale */
    --richyy-z-dropdown: 1000;
    --richyy-z-sticky: 1020;
    --richyy-z-fixed: 1030;
    --richyy-z-modal: 1050;
    --richyy-z-tooltip: 1080;
}

/* ============================================
   Dark Mode - Softer Slate Palette (Easy on Eyes)
   ============================================ */

[data-bs-theme="dark"] {
    /* Primary - Brighter Teal for dark contrast */
    --richyy-primary: #2dd4bf;
    --richyy-primary-hover: #5eead4;
    --richyy-primary-light: #14b8a6;
    --richyy-primary-subtle: rgba(45, 212, 191, 0.12);
    --richyy-primary-glow: rgba(45, 212, 191, 0.18);
    
    /* Secondary */
    --richyy-secondary: #94a3b8;
    --richyy-secondary-hover: #cbd5e1;
    
    /* Accent - Brighter Amber */
    --richyy-accent: #fbbf24;
    --richyy-accent-light: #fcd34d;
    --richyy-accent-subtle: rgba(251, 191, 36, 0.12);
    
    /* Status Colors - Adjusted for dark */
    --richyy-success: #34d399;
    --richyy-success-light: #6ee7b7;
    --richyy-success-subtle: rgba(52, 211, 153, 0.15);
    --richyy-danger: #f87171;
    --richyy-danger-light: #fca5a5;
    --richyy-danger-subtle: rgba(248, 113, 113, 0.12);
    --richyy-warning: #fbbf24;
    --richyy-warning-subtle: rgba(251, 191, 36, 0.12);
    --richyy-info: #38bdf8;
    --richyy-info-subtle: rgba(56, 189, 248, 0.12);
    
    /* Neutral Palette - Even Softer Slate */
    --richyy-gray-50: #1e293b;
    --richyy-gray-100: #334155;
    --richyy-gray-200: #475569;
    --richyy-gray-300: #64748b;
    --richyy-gray-400: #94a3b8;
    --richyy-gray-500: #cbd5e1;
    --richyy-gray-600: #e2e8f0;
    --richyy-gray-700: #f1f5f9;
    --richyy-gray-800: #f8fafc;
    --richyy-gray-900: #ffffff;
    
    /* Backgrounds & Surfaces - Lighter Slate (More Comfortable) */
    --richyy-bg-body: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
    --richyy-bg-body-solid: #1e293b;
    --richyy-bg-card: #334155;
    --richyy-bg-card-elevated: #475569;
    --richyy-bg-secondary: #475569;
    --richyy-bg-tertiary: #64748b;
    --richyy-bg-navbar: rgba(51, 65, 85, 0.95);
    
    /* Text Colors */
    --richyy-text-primary: #f1f5f9;
    --richyy-text-secondary: #cbd5e1;
    --richyy-text-muted: #94a3b8;
    --richyy-text-placeholder: #64748b;
    
    /* Borders - Softer */
    --richyy-border-color: #475569;
    --richyy-border-color-light: #334155;
    --richyy-border-color-focus: var(--richyy-primary);
    
    /* Shadows - Softer */
    --richyy-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.15);
    --richyy-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.12);
    --richyy-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.25), 0 2px 4px -2px rgba(0, 0, 0, 0.15);
    --richyy-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    --richyy-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
    --richyy-shadow-glow: 0 0 60px rgba(45, 212, 191, 0.12);
    
    /* Gradients - Softer Slate */
    --richyy-gradient-primary: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    --richyy-gradient-success: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --richyy-gradient-accent: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
    --richyy-gradient-warm: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --richyy-gradient-card: linear-gradient(145deg, #1e293b 0%, #334155 100%);
}

/* ============================================
   Base Styles
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--richyy-bg-body);
    background-attachment: fixed;
    color: var(--richyy-text-primary);
    line-height: 1.6;
    font-size: 15px;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color var(--richyy-transition-slow), color var(--richyy-transition);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--richyy-text-primary);
}

/* ============================================
   Navigation - Glassmorphism Style
   ============================================ */

.navbar {
    background: var(--richyy-bg-navbar) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--richyy-shadow-sm);
    padding: 0;
    border-bottom: 1px solid var(--richyy-border-color);
    position: sticky;
    top: 0;
    z-index: var(--richyy-z-fixed);
    transition: all var(--richyy-transition);
}

.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--richyy-primary) !important;
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    letter-spacing: -0.02em;
    transition: all var(--richyy-transition);
    text-decoration: none;
}

.navbar-brand:hover {
    transform: scale(1.02);
    color: var(--richyy-primary-hover) !important;
}

.navbar-logo {
    height: 100px;
    width: auto;
    margin-right: 0.5rem;
    transition: transform var(--richyy-transition);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05) rotate(-2deg);
}

@media (max-width: 768px) {
    .navbar-logo {
        height: 70px !important;
    }
}

.navbar-toggler {
    border: 2px solid var(--richyy-primary);
    padding: 0.625rem 0.875rem;
    border-radius: var(--richyy-radius-lg);
    background: var(--richyy-gradient-primary);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--richyy-transition);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.navbar-toggler:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px var(--richyy-primary-glow);
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 22px;
    height: 22px;
}

.navbar-collapse {
    padding: 0 1rem;
}

/* Mobile Menu */
@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 1rem;
        background: var(--richyy-bg-card);
        border-top: 1px solid var(--richyy-border-color);
        margin-top: 0.5rem;
        border-radius: 0 0 var(--richyy-radius-lg) var(--richyy-radius-lg);
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        padding: 0.75rem 1rem !important;
        border-radius: var(--richyy-radius-md);
    }
    
    .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0.25rem;
        margin-bottom: 0.5rem;
        border: none;
        box-shadow: none;
        background: var(--richyy-bg-secondary);
        border-radius: var(--richyy-radius-md);
        padding: 0.5rem;
    }
}

.navbar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.125rem;
    align-items: center;
}

.nav-link {
    color: var(--richyy-text-secondary) !important;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--richyy-radius-md);
    transition: all var(--richyy-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.nav-link i {
    font-size: 1rem;
    opacity: 0.8;
}

.nav-link:hover {
    color: var(--richyy-primary) !important;
    background: var(--richyy-primary-subtle);
}

.nav-link.active {
    color: var(--richyy-primary) !important;
    background: var(--richyy-primary-subtle);
    font-weight: 600;
}

.dropdown-menu {
    border: 1px solid var(--richyy-border-color);
    box-shadow: var(--richyy-shadow-lg);
    border-radius: var(--richyy-radius-xl);
    padding: 0.5rem;
    margin-top: 0.375rem;
    min-width: 220px;
    background: var(--richyy-bg-card);
    backdrop-filter: blur(20px);
    animation: dropdownFade 0.2s ease-out;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--richyy-radius-md);
    transition: all var(--richyy-transition-fast);
    color: var(--richyy-text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.dropdown-item i {
    font-size: 1rem;
    opacity: 0.7;
    width: 18px;
    text-align: center;
}

.dropdown-item:hover {
    background: var(--richyy-primary-subtle);
    color: var(--richyy-primary);
    transform: translateX(4px);
}

.dropdown-item:hover i {
    opacity: 1;
}

.dropdown-header {
    padding: 0.5rem 0.875rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--richyy-text-muted);
}

.dropdown-divider {
    margin: 0.375rem 0;
    border-top: 1px solid var(--richyy-border-color);
}

/* Currency Badge */
.currency-badge {
    background: var(--richyy-gradient-primary) !important;
    color: white !important;
    padding: 0.375rem 0.875rem !important;
    border-radius: var(--richyy-radius-full);
    font-weight: 600;
    font-size: 0.8125rem;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
    border: none;
    transition: all var(--richyy-transition);
}

.currency-badge:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
}

/* Theme Toggle Button */
.theme-toggle {
    cursor: pointer;
    padding: 0.5rem 0.875rem;
    border-radius: var(--richyy-radius-md);
    transition: all var(--richyy-transition);
    color: var(--richyy-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 1.125rem;
}

.theme-toggle:hover {
    background: var(--richyy-accent-subtle);
    color: var(--richyy-accent);
    transform: rotate(-12deg);
}

/* ============================================
   Container & Layout
   ============================================ */

.container-fluid {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 1.25rem 1rem;
    }
}

/* ============================================
   Cards - Elegant & Modern
   ============================================ */

.card {
    background: var(--richyy-bg-card);
    border: 1px solid var(--richyy-border-color);
    border-radius: var(--richyy-radius-xl);
    box-shadow: var(--richyy-shadow-sm);
    transition: all var(--richyy-transition);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--richyy-shadow-lg);
    transform: translateY(-2px);
    border-color: var(--richyy-primary-subtle);
}

.card-header {
    background: var(--richyy-bg-card);
    border-bottom: 1px solid var(--richyy-border-color);
    padding: 1.125rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--richyy-text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.card-header h5, .card-header h6 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    font-size: 1rem;
}

.card-header .btn {
    margin-left: auto;
    flex-shrink: 0;
}

.card-body {
    padding: 1.25rem;
}

/* Summary Cards */
.summary-card {
    background: var(--richyy-gradient-card);
    border: 1px solid var(--richyy-border-color);
    border-radius: var(--richyy-radius-xl);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all var(--richyy-transition);
    box-shadow: var(--richyy-shadow-sm);
    height: 100%;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--richyy-gradient-primary);
    opacity: 0;
    transition: opacity var(--richyy-transition);
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--richyy-shadow-xl), var(--richyy-shadow-glow);
    border-color: var(--richyy-primary);
}

.summary-card:hover::before {
    opacity: 1;
}

.summary-card .card-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--richyy-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.625rem;
}

.summary-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--richyy-text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    font-family: 'Outfit', sans-serif;
}

.summary-card .card-subtitle {
    font-size: 0.8125rem;
    color: var(--richyy-text-secondary);
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Card Color Variants */
.card-primary, .summary-card.card-primary {
    background: var(--richyy-gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.25);
}

.card-primary .card-title,
.card-primary .card-subtitle,
.card-primary h3 {
    color: white !important;
}

.card-success, .summary-card.card-success {
    background: var(--richyy-gradient-success);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.25);
}

.card-success .card-title,
.card-success .card-subtitle,
.card-success h3 {
    color: white !important;
}

.card-danger, .summary-card.card-danger {
    background: linear-gradient(135deg, var(--richyy-danger) 0%, #b91c1c 100%);
    color: white;
    border: none;
}

.card-danger .card-title,
.card-danger .card-subtitle,
.card-danger h3 {
    color: white !important;
}

.card-warning, .summary-card.card-warning {
    background: var(--richyy-gradient-accent);
    color: white;
    border: none;
}

.card-warning .card-title,
.card-warning .card-subtitle,
.card-warning h3 {
    color: white !important;
}

/* ============================================
   Buttons - Refined & Interactive
   ============================================ */

.btn {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--richyy-radius-md);
    transition: all var(--richyy-transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    line-height: 1.5;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.4s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:focus {
    box-shadow: 0 0 0 3px var(--richyy-primary-glow);
    outline: none;
}

.btn-primary {
    background: var(--richyy-gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
    color: white;
}

.btn-success {
    background: var(--richyy-gradient-success);
    color: white;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--richyy-danger) 0%, #b91c1c 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    color: white;
}

.btn-warning {
    background: var(--richyy-gradient-accent);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-1px);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--richyy-primary);
    color: var(--richyy-primary);
    background: transparent;
    padding: 0.4375rem 1rem;
}

.btn-outline-primary:hover {
    background: var(--richyy-gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-outline-secondary {
    border: 2px solid var(--richyy-border-color);
    color: var(--richyy-text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--richyy-bg-secondary);
    color: var(--richyy-text-primary);
    border-color: var(--richyy-text-muted);
}

.btn-light {
    background: var(--richyy-bg-card);
    color: var(--richyy-text-primary);
    border: 1px solid var(--richyy-border-color);
}

.btn-light:hover {
    background: var(--richyy-bg-secondary);
    color: var(--richyy-text-primary);
}

.btn-sm {
    padding: 0.3125rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--richyy-radius-sm);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--richyy-radius-lg);
}

.btn-group {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

/* ============================================
   Tables - Clean & Readable
   ============================================ */

.table-responsive {
    border-radius: var(--richyy-radius-xl);
    overflow: hidden;
    box-shadow: var(--richyy-shadow-sm);
}

.table {
    background: var(--richyy-bg-card);
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--richyy-text-primary);
}

.table thead {
    background: var(--richyy-bg-secondary);
}

.table thead th {
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    padding: 0.875rem 1rem;
    color: var(--richyy-text-muted);
}

.table tbody tr {
    transition: all var(--richyy-transition-fast);
    border-bottom: 1px solid var(--richyy-border-color);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--richyy-primary-subtle);
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    color: var(--richyy-text-primary);
    font-size: 0.9375rem;
}

/* List Groups */
.list-group-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--richyy-border-color);
    padding: 0.875rem 0;
    color: var(--richyy-text-primary);
    transition: all var(--richyy-transition-fast);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background: var(--richyy-primary-subtle);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--richyy-radius-md);
}

/* ============================================
   Forms - Modern Input Style
   ============================================ */

.form-control,
.form-select {
    border: 2px solid var(--richyy-border-color);
    border-radius: var(--richyy-radius-md);
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: all var(--richyy-transition);
    background: var(--richyy-bg-card);
    color: var(--richyy-text-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--richyy-primary);
    box-shadow: 0 0 0 4px var(--richyy-primary-glow);
    outline: none;
    background: var(--richyy-bg-card);
}

.form-control::placeholder {
    color: var(--richyy-text-placeholder);
}

.form-label {
    font-weight: 600;
    color: var(--richyy-text-primary);
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: 56px;
    padding: 1rem 0.875rem 0.5rem;
}

.form-floating > label {
    padding: 1rem 0.875rem;
    color: var(--richyy-text-muted);
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--richyy-border-color);
    border-radius: 4px;
    transition: all var(--richyy-transition-fast);
}

.form-check-input:checked {
    background-color: var(--richyy-primary);
    border-color: var(--richyy-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--richyy-primary-glow);
}

/* ============================================
   Alerts - Elegant Notifications
   ============================================ */

.alert {
    border-radius: var(--richyy-radius-lg);
    border: none;
    padding: 0.875rem 1rem;
    box-shadow: var(--richyy-shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: var(--richyy-success-subtle);
    color: var(--richyy-success);
    border-left-color: var(--richyy-success);
}

.alert-danger {
    background: var(--richyy-danger-subtle);
    color: var(--richyy-danger);
    border-left-color: var(--richyy-danger);
}

.alert-warning {
    background: var(--richyy-warning-subtle);
    color: var(--richyy-warning);
    border-left-color: var(--richyy-warning);
}

.alert-info {
    background: var(--richyy-info-subtle);
    color: var(--richyy-info);
    border-left-color: var(--richyy-info);
}

/* Dark mode alert adjustments */
[data-bs-theme="dark"] .alert-success {
    color: var(--richyy-success-light);
}

[data-bs-theme="dark"] .alert-danger {
    color: var(--richyy-danger-light);
}

[data-bs-theme="dark"] .alert-warning {
    color: var(--richyy-warning);
}

[data-bs-theme="dark"] .alert-info {
    color: var(--richyy-info);
}

/* ============================================
   Dark Mode Table Row Highlighting
   Disabled - using default table colors
   ============================================ */

/* Remove colored backgrounds from table rows - use default table styling */
[data-bs-theme="dark"] .table-success,
[data-bs-theme="dark"] .table-success > td,
[data-bs-theme="dark"] .table-success > th,
[data-bs-theme="dark"] .table-info,
[data-bs-theme="dark"] .table-info > td,
[data-bs-theme="dark"] .table-info > th,
[data-bs-theme="dark"] .table-warning,
[data-bs-theme="dark"] .table-warning > td,
[data-bs-theme="dark"] .table-warning > th,
[data-bs-theme="dark"] .table-danger,
[data-bs-theme="dark"] .table-danger > td,
[data-bs-theme="dark"] .table-danger > th,
[data-bs-theme="dark"] .table-primary,
[data-bs-theme="dark"] .table-primary > td,
[data-bs-theme="dark"] .table-primary > th {
    background-color: transparent !important;
    color: inherit !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: inherit !important;
    --bs-table-border-color: inherit !important;
}

/* Remove color overrides from child elements */
[data-bs-theme="dark"] .table-success td *,
[data-bs-theme="dark"] .table-success th *,
[data-bs-theme="dark"] .table-info td *,
[data-bs-theme="dark"] .table-info th *,
[data-bs-theme="dark"] .table-warning td *,
[data-bs-theme="dark"] .table-warning th *,
[data-bs-theme="dark"] .table-danger td *,
[data-bs-theme="dark"] .table-danger th *,
[data-bs-theme="dark"] .table-primary td *,
[data-bs-theme="dark"] .table-primary th * {
    color: inherit !important;
}

/* ============================================
   Badges - Status Indicators
   ============================================ */

.badge {
    padding: 0.3125rem 0.625rem;
    border-radius: var(--richyy-radius-full);
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-transform: uppercase;
}

.bg-primary {
    background: var(--richyy-gradient-primary) !important;
}

.bg-success {
    background: var(--richyy-gradient-success) !important;
}

.bg-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
}

.bg-warning {
    background: var(--richyy-gradient-accent) !important;
}

.bg-danger {
    background: linear-gradient(135deg, var(--richyy-danger) 0%, #b91c1c 100%) !important;
}

/* Subtle Backgrounds */
.bg-primary.bg-opacity-10 {
    background: var(--richyy-primary-subtle) !important;
}

.bg-success.bg-opacity-10 {
    background: var(--richyy-success-subtle) !important;
}

.bg-danger.bg-opacity-10 {
    background: var(--richyy-danger-subtle) !important;
}

.bg-warning.bg-opacity-10 {
    background: var(--richyy-warning-subtle) !important;
}

.bg-info.bg-opacity-10 {
    background: var(--richyy-info-subtle) !important;
}

/* ============================================
   Progress Bars
   ============================================ */

.progress {
    height: 6px;
    border-radius: var(--richyy-radius-full);
    background: var(--richyy-bg-secondary);
    overflow: hidden;
}

.progress-bar {
    border-radius: var(--richyy-radius-full);
    background: var(--richyy-gradient-primary);
    transition: width var(--richyy-transition-slow);
}

/* ============================================
   Modal Styling
   ============================================ */

.modal-content {
    background: var(--richyy-bg-card);
    border: 1px solid var(--richyy-border-color);
    border-radius: var(--richyy-radius-xl);
    box-shadow: var(--richyy-shadow-xl);
}

.modal-header {
    background: var(--richyy-bg-card);
    border-bottom: 1px solid var(--richyy-border-color);
    padding: 1rem 1.25rem;
    border-radius: var(--richyy-radius-xl) var(--richyy-radius-xl) 0 0;
}

.modal-header .modal-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--richyy-text-primary);
}

.modal-body {
    padding: 1.25rem;
    color: var(--richyy-text-primary);
}

.modal-footer {
    background: var(--richyy-bg-secondary);
    border-top: 1px solid var(--richyy-border-color);
    padding: 1rem 1.25rem;
    border-radius: 0 0 var(--richyy-radius-xl) var(--richyy-radius-xl);
}

.btn-close {
    filter: var(--richyy-text-primary);
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1);
}

/* ============================================
   Dashboard Header
   ============================================ */

.dashboard-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    position: relative;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--richyy-gradient-primary);
    border-radius: var(--richyy-radius-full);
}

.dashboard-header h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--richyy-text-primary);
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
}

.dashboard-header p {
    color: var(--richyy-text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--richyy-text-muted);
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h5 {
    color: var(--richyy-text-primary);
    font-weight: 600;
    margin-bottom: 0.375rem;
    font-size: 1rem;
}

.empty-state p {
    color: var(--richyy-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ============================================
   Text & Utility Classes
   ============================================ */

.text-primary {
    color: var(--richyy-primary) !important;
}

.text-success {
    color: var(--richyy-success) !important;
}

.text-danger {
    color: var(--richyy-danger) !important;
}

.text-warning {
    color: var(--richyy-warning) !important;
}

.text-muted {
    color: var(--richyy-text-muted) !important;
}

.text-secondary {
    color: var(--richyy-text-secondary) !important;
}

.bg-light {
    background-color: var(--richyy-bg-secondary) !important;
    color: var(--richyy-text-primary) !important;
}

.bg-white {
    background-color: var(--richyy-bg-card) !important;
    color: var(--richyy-text-primary) !important;
}

.border {
    border-color: var(--richyy-border-color) !important;
}

.border-bottom {
    border-bottom-color: var(--richyy-border-color) !important;
}

/* Gradient Text */
.text-gradient {
    background: var(--richyy-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ============================================
   Animations
   ============================================ */

.fade-in {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger children animations */
.stagger-in > * {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--richyy-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--richyy-gray-400);
    border-radius: var(--richyy-radius-full);
    border: 2px solid var(--richyy-bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--richyy-gray-500);
}

/* ============================================
   Calendar View Styles (Dashboard)
   ============================================ */

.calendar-view {
    max-height: 600px;
    overflow-y: auto;
}

.calendar-date-section {
    border-bottom: 1px solid var(--richyy-border-color);
    background: var(--richyy-bg-card);
    transition: all var(--richyy-transition);
}

.calendar-date-section.today {
    background: var(--richyy-primary-subtle);
    border-left: 4px solid var(--richyy-primary);
}

.calendar-date-section.overdue {
    background: var(--richyy-danger-subtle);
    border-left: 4px solid var(--richyy-danger);
}

.calendar-date-section.upcoming {
    background: var(--richyy-info-subtle);
    border-left: 4px solid var(--richyy-info);
}

.calendar-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid var(--richyy-border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .calendar-date-header {
    background: rgba(51, 65, 85, 0.8);
}

[data-bs-theme="dark"] .calendar-date-section {
    background: var(--richyy-bg-card);
    border-color: var(--richyy-border-color);
}

[data-bs-theme="dark"] .calendar-items {
    background: transparent;
}

/* Timeline Navigation Container */
.timeline-nav-container {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.timeline-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--richyy-text-primary, #334155);
    background: var(--richyy-bg-card, #fff) !important;
    border: 1px solid var(--richyy-border-color, #e2e8f0) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.timeline-nav-btn:hover:not(:disabled) {
    background: var(--richyy-primary-subtle, #f0fdfa) !important;
    color: var(--richyy-primary, #0d9488);
    border-color: var(--richyy-primary, #0d9488) !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.timeline-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.timeline-nav-btn-left {
    left: 8px;
}

.timeline-nav-btn-right {
    right: 8px;
}

/* Timeline Scroll Container */
.timeline-scroll-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Desktop: hide scrollbar, use arrow navigation */
@media (min-width: 769px) {
    .timeline-scroll-wrapper {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .timeline-scroll-wrapper::-webkit-scrollbar {
        display: none;
    }
}

/* Mobile: show thin scrollbar */
@media (max-width: 768px) {
    .timeline-scroll-wrapper {
        scrollbar-width: thin;
    }
    .timeline-scroll-wrapper::-webkit-scrollbar {
        height: 6px;
    }
}

.timeline-period-markers-row .timeline-period-marker {
    flex: 1;
    min-width: 100px;
}

@media (max-width: 768px) {
    .timeline-period-markers-row .timeline-period-marker {
        min-width: 50px;
    }
}

/* Timeline Period Markers */
.timeline-period-marker {
    flex: 1;
    min-width: 60px;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: var(--richyy-radius-md);
    transition: all var(--richyy-transition);
    background: transparent;
    border: 1px solid transparent;
}

.timeline-period-marker:hover {
    background: var(--richyy-primary-subtle);
    transform: translateY(-2px);
}

.timeline-period-marker.current {
    background: var(--richyy-primary-subtle);
    border-color: var(--richyy-primary);
}

.timeline-period-marker .period-name {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2px;
    color: var(--richyy-text-muted);
}

.timeline-period-marker.current .period-name {
    color: var(--richyy-primary);
}

.timeline-period-marker .period-balance {
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ApexCharts Theme Fixes */

/* Fix tooltip overflow - ensure tooltips are not clipped */
#timelineChart {
    overflow: visible !important;
}


#timelineChart .apexcharts-canvas {
    overflow: visible !important;
}

.apexcharts-tooltip {
    border-radius: var(--richyy-radius-lg) !important;
    box-shadow: var(--richyy-shadow-xl) !important;
    border: 1px solid var(--richyy-border-color) !important;
    z-index: 9999 !important;
    overflow: visible !important;
}

.apexcharts-tooltip.apexcharts-theme-dark {
    background: var(--richyy-bg-card-elevated) !important;
    border-color: var(--richyy-border-color) !important;
}

.apexcharts-tooltip.apexcharts-theme-light {
    background: var(--richyy-bg-card) !important;
}

.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
    border-radius: var(--richyy-radius-md) !important;
    z-index: 9999 !important;
}

/* Ensure chart card doesn't clip tooltips */
.card:has(#timelineChart) {
    overflow: visible !important;
}

.card:has(#timelineChart) .card-body {
    overflow: visible !important;
}

.card:has(#timelineChart) .collapse {
    overflow: visible !important;
}

/* Fallback for browsers without :has() support */
#timelineCollapse {
    overflow: visible !important;
}

#timelineCollapse .card-body {
    overflow: visible !important;
}

.calendar-day-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--richyy-primary);
    min-width: 50px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.calendar-day-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--richyy-text-primary);
}

.calendar-month-year {
    font-size: 0.8125rem;
    color: var(--richyy-text-muted);
}

.calendar-item {
    background: var(--richyy-bg-card);
    border-radius: var(--richyy-radius-lg);
    padding: 0.875rem;
    margin-bottom: 0.625rem;
    box-shadow: var(--richyy-shadow-xs);
    transition: all var(--richyy-transition-fast);
    border: 1px solid var(--richyy-border-color);
    color: var(--richyy-text-primary);
}

.calendar-item:hover {
    box-shadow: var(--richyy-shadow-md);
    transform: translateX(4px);
}

/* Fix calendar items text visibility in dark mode */
[data-bs-theme="dark"] .calendar-item {
    background: var(--richyy-bg-card-elevated);
    border-color: var(--richyy-border-color);
}

[data-bs-theme="dark"] .calendar-item * {
    color: inherit;
}

[data-bs-theme="dark"] .calendar-item .text-dark,
[data-bs-theme="dark"] .calendar-item h6,
[data-bs-theme="dark"] .calendar-item strong {
    color: var(--richyy-text-primary) !important;
}

[data-bs-theme="dark"] .calendar-item .text-muted {
    color: var(--richyy-text-muted) !important;
}

[data-bs-theme="dark"] .calendar-item .text-success {
    color: var(--richyy-success) !important;
}

[data-bs-theme="dark"] .calendar-item .text-danger {
    color: var(--richyy-danger) !important;
}

[data-bs-theme="dark"] .calendar-item .text-warning {
    color: var(--richyy-warning) !important;
}

/* ============================================
   Authentication Pages
   ============================================ */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--richyy-bg-body);
    background-attachment: fixed;
    padding: 2rem 1rem;
}

.login-container {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.login-left {
    flex: 1;
    background: var(--richyy-gradient-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    border-radius: 50%;
    top: -250px;
    right: -250px;
    animation: floatSlow 20s ease-in-out infinite;
}

.login-left::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    animation: floatSlow 15s ease-in-out infinite reverse;
}

@keyframes floatSlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.05); }
}

.login-brand {
    text-align: center;
    z-index: 1;
    margin-bottom: 2.5rem;
}

.login-logo {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.15));
    margin-bottom: 1rem;
}

.login-brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.login-brand-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    font-weight: 400;
}

.login-features {
    z-index: 1;
    width: 100%;
    max-width: 380px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border-radius: var(--richyy-radius-lg);
    margin-bottom: 0.75rem;
    color: white;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all var(--richyy-transition);
}

.feature-item:hover {
    background: rgba(255,255,255,0.18);
    transform: translateX(6px);
}

.feature-item i {
    font-size: 1.25rem;
    opacity: 0.9;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--richyy-bg-body-solid);
    padding: 2rem;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-form-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--richyy-text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
}

.login-form-subtitle {
    color: var(--richyy-text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.75rem;
}

.login-footer {
    text-align: center;
    color: var(--richyy-text-secondary);
}

.login-link {
    color: var(--richyy-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--richyy-transition);
}

.login-link:hover {
    color: var(--richyy-primary-hover);
    text-decoration: underline;
}

/* Mobile Login */
@media (max-width: 968px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-left {
        min-height: 35vh;
        padding: 2rem;
    }
    
    .login-brand-title {
        font-size: 2rem;
    }
    
    .login-logo {
        height: 70px;
    }
    
    .login-features {
        display: none;
    }
    
    .login-right {
        padding: 1.5rem;
    }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 992px) {
    .navbar {
        padding: 0.375rem 0;
    }
    
    .navbar-nav {
        padding: 0.75rem 0;
    }
    
    .summary-card h3 {
        font-size: 1.375rem;
    }
    
    .dashboard-header h2 {
        font-size: 1.375rem;
    }
    
    .table-responsive {
        border-radius: var(--richyy-radius-lg);
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 700px;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 1rem;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.875rem 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header .btn {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .dashboard-header {
        margin-bottom: 1.25rem;
        padding-bottom: 0.875rem;
    }
    
    .dashboard-header h2 {
        font-size: 1.375rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    /* Mobile navbar toggler */
    .navbar-toggler {
        min-width: 50px !important;
        min-height: 50px !important;
        margin-left: auto;
    }
    
    .navbar-brand {
        padding: 0.5rem 1rem !important;
    }
}

@media (max-width: 576px) {
    .btn {
        font-size: 0.8125rem;
        padding: 0.4375rem 0.875rem;
    }
    
    .summary-card h3 {
        font-size: 1.25rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .navbar,
    .btn,
    .dropdown,
    .theme-toggle {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ============================================
   Additional Bootstrap Dark Mode Overrides
   ============================================ */

[data-bs-theme="dark"] .navbar-brand small {
    color: var(--richyy-text-muted) !important;
}

[data-bs-theme="dark"] .dropdown-header {
    color: var(--richyy-text-muted);
}

[data-bs-theme="dark"] .card-header.bg-white {
    background-color: var(--richyy-bg-card) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--richyy-bg-secondary);
    border-color: var(--richyy-border-color);
    color: var(--richyy-text-primary);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--richyy-bg-secondary);
    border-color: var(--richyy-primary);
}

[data-bs-theme="dark"] .form-floating > label {
    color: var(--richyy-text-muted);
}

/* Fix timeline markers in dark mode */
[data-bs-theme="dark"] .timeline-period-marker {
    color: var(--richyy-text-primary);
}

/* Timeline nav buttons in dark mode */
[data-bs-theme="dark"] .timeline-nav-btn {
    background: var(--richyy-bg-card-elevated, #1e293b) !important;
    border-color: var(--richyy-border-color, #334155) !important;
    color: var(--richyy-text-primary);
}

[data-bs-theme="dark"] .timeline-nav-btn:hover:not(:disabled) {
    background: var(--richyy-primary-subtle, rgba(13, 148, 136, 0.2)) !important;
    color: var(--richyy-primary);
}

/* Override inline styles for dark mode */
[data-bs-theme="dark"] [style*="background-color: #e7f3ff"],
[data-bs-theme="dark"] [style*="background-color: #f8f9fa"],
[data-bs-theme="dark"] [style*="background: #f8f9fa"],
[data-bs-theme="dark"] [style*="background-color: white"],
[data-bs-theme="dark"] [style*="background-color: #fff"],
[data-bs-theme="dark"] [style*="background-color: #ffffff"],
[data-bs-theme="dark"] [style*="background: white"],
[data-bs-theme="dark"] [style*="background: #fff"],
[data-bs-theme="dark"] [style*="background: #ffffff"] {
    background-color: var(--richyy-bg-card) !important;
}

[data-bs-theme="dark"] [style*="color: #1e293b"],
[data-bs-theme="dark"] [style*="color: #0f172a"],
[data-bs-theme="dark"] [style*="color: black"],
[data-bs-theme="dark"] [style*="color: #000"] {
    color: var(--richyy-text-primary) !important;
}

/* Fix any white background elements in dark mode */
[data-bs-theme="dark"] .bg-white {
    background-color: var(--richyy-bg-card) !important;
}

[data-bs-theme="dark"] [class*="calendar"] .bg-white,
[data-bs-theme="dark"] [class*="calendar"] [style*="background: white"] {
    background-color: var(--richyy-bg-card-elevated) !important;
}

/* Footer styling */
footer {
    background: var(--richyy-bg-card) !important;
    border-top: 1px solid var(--richyy-border-color) !important;
}

footer p {
    color: var(--richyy-text-secondary) !important;
}

footer a {
    color: var(--richyy-primary) !important;
}

/* -------------------- Attachment / Receipt Gallery (same as Shopyy - preview + delete, no download) -------------------- */
.receipt-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.receipt-item {
    position: relative;
    border-radius: 0.375rem;
    overflow: hidden;
    background: var(--richyy-gray-100);
    border: 1px solid var(--richyy-border-color);
    transition: all 0.2s ease;
}

.receipt-item:hover {
    border-color: var(--richyy-primary);
    box-shadow: var(--richyy-shadow-md);
    transform: translateY(-2px);
}

.receipt-item-preview {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.receipt-item-placeholder {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--richyy-gray-100);
    color: var(--richyy-gray-500);
    font-size: 2rem;
    cursor: pointer;
}

.receipt-item-info {
    padding: 0.5rem;
    background: var(--richyy-bg-card);
}

.receipt-item-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--richyy-text-primary);
}

.receipt-item-meta {
    font-size: 0.65rem;
    color: var(--richyy-text-muted);
}

.receipt-item-actions {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.receipt-item:hover .receipt-item-actions {
    opacity: 1;
}

.receipt-item-actions .btn {
    padding: 4px 6px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 0.25rem;
    box-shadow: var(--richyy-shadow-sm);
}

.receipt-item-actions .btn:hover {
    background: var(--richyy-white);
}

.receipt-item-actions .btn-delete {
    color: var(--richyy-danger);
}

/* Lightbox for attachment preview (same as Shopyy) */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.lightbox.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--richyy-white);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10000;
    padding: 0.5rem;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0.375rem;
}

.lightbox-pdf {
    width: 90vw;
    height: 90vh;
    border: none;
    border-radius: 0.375rem;
    background: var(--richyy-bg-card);
}

@media (max-width: 576px) {
    .receipt-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .receipt-item-preview,
    .receipt-item-placeholder {
        height: 80px;
    }

    .receipt-item-actions {
        opacity: 1;
    }

    .receipt-item-actions .btn {
        padding: 3px 5px;
        font-size: 0.65rem;
    }
}
