:root {
    /* Core Palette - No Blue */
    --terracotta-primary: #C0392B;
    /* Deep Red */
    --terracotta-dark: #922B21;
    /* Darker Red */
    --terracotta-light: #E6B0AA;
    /* Light Red */
    --terracotta-sidebar-bg: #C0392B;
    /* Sidebar Background */
    --terracotta-text: #FFFFFF;
    /* White text */

    --gold-accent: #F1C40F;
    /* Gold for active states/info */
    --gold-dark: #D4AC0D;
    /* Dark Gold */

    --warm-gray: #F5F5F0;
    /* Warm off-white background */

    /* Override Default Bootstrap Variables Globally */
    --primary: #C0392B;
    --primary-rgb: 192, 57, 43;
    --info: #F1C40F;
    --info-rgb: 241, 196, 15;
    --bs-primary: #C0392B;
    --bs-info: #F1C40F;
    --bs-primary-rgb: 192, 57, 43;
    --bs-info-rgb: 241, 196, 15;
}

/* ------------------------------------------------------------------
   GLOBAL BOOTSTRAP OVERRIDES (FORCE RED)
   ------------------------------------------------------------------ */

/* Backgrounds */
body {
    background-color: var(--warm-gray) !important;
}

/* Buttons - Primary (Red) */
.btn-primary,
.btn-outline-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--terracotta-primary);
    --bs-btn-border-color: var(--terracotta-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--terracotta-dark);
    --bs-btn-hover-border-color: var(--terracotta-dark);
    --bs-btn-focus-shadow-rgb: 192, 57, 43;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--terracotta-dark);
    --bs-btn-active-border-color: var(--terracotta-dark);
    --bs-btn-disabled-bg: var(--terracotta-light);
    --bs-btn-disabled-border-color: var(--terracotta-light);
}

.btn-outline-primary {
    --bs-btn-color: var(--terracotta-primary);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--terracotta-primary);
    --bs-btn-hover-bg: var(--terracotta-primary);
}

/* Buttons - Info (Gold) */
.btn-info {
    --bs-btn-bg: var(--gold-accent);
    --bs-btn-border-color: var(--gold-accent);
    --bs-btn-hover-bg: var(--gold-dark);
    --bs-btn-hover-border-color: var(--gold-dark);
    color: #fff;
}

/* Text Colors */
.text-primary {
    color: var(--terracotta-primary) !important;
}

.text-info {
    color: var(--gold-dark) !important;
}

/* Background Utilities */
.bg-primary {
    background-color: var(--terracotta-primary) !important;
}

.bg-info {
    background-color: var(--gold-accent) !important;
}

/* Badges */
.badge.bg-primary {
    background-color: var(--terracotta-primary) !important;
}

.badge.bg-info {
    background-color: var(--gold-accent) !important;
    color: #333 !important;
}

/* Icons in circles (Client list) */
.bg-primary.bg-opacity-10 {
    background-color: rgba(192, 57, 43, 0.1) !important;
}

.text-primary {
    color: var(--terracotta-primary) !important;
}

/* ------------------------------------------------------------------
   SIDEBAR STYLING
   ------------------------------------------------------------------ */
#sidebarMenu {
    background-color: var(--terracotta-sidebar-bg);
    min-height: 100vh;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

#sidebarMenu .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 14px 24px;
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

#sidebarMenu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    padding-left: 28px;
    /* Slide effect */
}

#sidebarMenu .nav-link.active {
    background-color: var(--terracotta-dark);
    color: #fff;
    border-left: 4px solid var(--gold-accent);
    /* Gold accent */
}

#sidebarMenu .nav-link i {
    font-size: 1.15rem;
    opacity: 0.9;
}

#sidebarMenu .sidebar-heading {
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1.2px;
    padding: 24px 24px 12px;
    font-weight: 600;
}

/* User Info Box in Sidebar */
.user-info-box {
    background: rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin: 20px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
}

/* ------------------------------------------------------------------
   NAVBAR STYLING
   ------------------------------------------------------------------ */
.navbar {
    background: linear-gradient(135deg, var(--terracotta-primary) 0%, var(--terracotta-dark) 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    color: #fff !important;
    font-weight: 700;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

/* ------------------------------------------------------------------
   DASHBOARD CARDS (TerraCotta Theme)
   ------------------------------------------------------------------ */
.stat-card-terracotta {
    background: #fff;
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    height: 100%;
}

.stat-card-terracotta:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 18px;
    flex-shrink: 0;
}

.stat-icon-box i {
    font-size: 2rem;
    color: #fff;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: #2c3e50;
}

.stat-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.938rem;
    font-weight: 500;
}

/* Colors for Card Icons - REPLACED BLUE WITH GOLD/RED */
.bg-gradient-success {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
}

/* Green (Kept for "Active/Paid") */
.bg-gradient-primary {
    background: linear-gradient(45deg, var(--gold-dark), var(--gold-accent));
}

/* Gold (Replaces Blue) */
.bg-gradient-warning {
    background: linear-gradient(45deg, #e67e22, #f39c12);
}

/* Orange */
.bg-gradient-danger {
    background: linear-gradient(45deg, #c0392b, #e74c3c);
}

/* Red */

/* ------------------------------------------------------------------
   TABLES & MISC
   ------------------------------------------------------------------ */
/* Override table header backgrounds to be warmer */
.table thead th {
    background-color: #F8F9F9 !important;
    border-bottom: 2px solid #E5E7E9;
    color: #566573;
}

/* Collection Summary Card Override */
.collection-summary {
    background: linear-gradient(135deg, var(--terracotta-primary) 0%, var(--terracotta-dark) 100%) !important;
}

/* Pagination / Active states */
.page-item.active .page-link {
    background-color: var(--terracotta-primary) !important;
    border-color: var(--terracotta-primary) !important;
}

.page-link {
    color: var(--terracotta-primary);
}

/* Form focus states */
.form-control:focus,
.form-select:focus {
    border-color: var(--terracotta-primary) !important;
    box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.1) !important;
}

/* Progress Bars */
.progress-bar {
    background-color: var(--terracotta-primary);
}

.progress-bar.bg-info {
    background-color: var(--gold-accent) !important;
}

/* Alerts */
.alert-primary {
    background-color: rgba(192, 57, 43, 0.1);
    border-color: var(--terracotta-light);
    color: var(--terracotta-dark);
}

/* Links */
a {
    color: var(--terracotta-primary);
}

a:hover {
    color: var(--terracotta-dark);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .stat-card-terracotta {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .stat-icon-box {
        width: 48px;
        height: 48px;
        margin-right: 12px;
    }
    
    .stat-icon-box i {
        font-size: 1.5rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    .stat-content p {
        font-size: 0.85rem;
    }
    
    /* Mobile Bottom Navigation */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--terracotta-primary) 0%, var(--terracotta-dark) 100%);
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 8px 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: rgba(255,255,255,0.8);
        font-size: 0.75rem;
        font-weight: 500;
        padding: 8px 4px;
        border-radius: 8px;
        transition: all 0.2s ease;
        min-width: 60px;
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        color: #fff;
        background: rgba(255,255,255,0.15);
        transform: translateY(-2px);
    }
    
    .mobile-nav-item i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    
    .mobile-nav-item span {
        font-size: 0.7rem;
        line-height: 1;
    }
    
    /* Mobile Sidebar */
    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 320px;
        height: 100%;
        background: linear-gradient(135deg, var(--terracotta-primary) 0%, var(--terracotta-dark) 100%);
        z-index: 1050;
        transition: left 0.3s ease;
        display: flex;
        flex-direction: column;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .mobile-sidebar.show {
        left: 0;
    }
    
    .mobile-sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .mobile-sidebar-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px 0;
    }
    
    .mobile-sidebar-footer {
        padding: 20px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .mobile-sidebar .nav-link {
        color: rgba(255,255,255,0.9);
        font-weight: 500;
        padding: 12px 20px;
        border-radius: 0;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 2px 0;
    }
    
    .mobile-sidebar .nav-link:hover,
    .mobile-sidebar .nav-link.active {
        background: rgba(255,255,255,0.15);
        color: #fff;
        padding-left: 24px;
    }
    
    .mobile-sidebar .nav-link i {
        font-size: 1.1rem;
        opacity: 0.9;
        width: 20px;
    }
    
    .mobile-sidebar .sidebar-heading {
        color: rgba(255,255,255,0.6);
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 1px;
        padding: 20px 20px 8px;
        font-weight: 600;
        margin-top: 10px;
    }
    
    .mobile-sidebar .user-info-box {
        background: rgba(0,0,0,0.2);
        padding: 15px;
        border-radius: 8px;
        color: rgba(255,255,255,0.9);
        display: flex;
        align-items: center;
    }
    
    /* Adjust main content for mobile bottom nav */
    body {
        padding-bottom: 80px;
    }
    
    .footer {
        margin-bottom: 80px;
    }
}
}