:root {
    /* 
       =========================================
       🎨 THEME SYSTEM: CSS Custom Properties
       =========================================
    */

    /* Default Theme: Professional Classic (Corporate) */
    --sigma-bg: #EAEAEA;
    /* Gray-50 */
    --sigma-card-bg: #FFFFFF;
    /* White */
    --sigma-text: #111827;
    /* Gray-900 */
    --sigma-text-muted: #6B7280;
    /* Gray-500 */
    --sigma-border: #b8b8b8;
    /* Gray-200 */

    --app-main-color: #42A677;
    /* Blue-900 (Deep Blue) */
    --app-accent-color: #23573f;
    /* Blue-500 */
    --app-sidebar-bg: #42A677;
    /* Match main color or dark slate */
    --app-sidebar-text: #FFFFFF;
    --app-status-success: #10B981;
    /* Emerald-500 */
}

/* 
   -----------------------------------------
   1️⃣ Professional Classic (Default)
   -----------------------------------------
   Already defined in :root as default
*/
[data-theme="type-classic"] {
    --sigma-bg: #F9FAFB;
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #111827;
    --sigma-text-muted: #6B7280;
    --sigma-border: #E5E7EB;
    --app-main-color: #1E3A8A;
    --app-accent-color: #3B82F6;
    --app-sidebar-bg: #1E3A8A;
    --app-sidebar-text: #FFFFFF;
}

/* 
   -----------------------------------------
   2️⃣ Creative Pastel (Mercería/Tienda) 
   -----------------------------------------
*/
[data-theme="type-pastel"] {
    --sigma-bg: #FFF7ED;
    /* Orange-50 (Warm Cream) */
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #4B5563;
    /* Gray-600 */
    --sigma-text-muted: #9CA3AF;
    --sigma-border: #F3E8FF;
    /* Light Purple Tint */

    --app-main-color: #C084FC;
    /* Purple-400 (Soft Lilac) */
    --app-accent-color: #FBCFE8;
    /* Pink-200 (Pastel Pink) */
    --app-sidebar-bg: #C084FC;
    --app-sidebar-text: #FFFFFF;
}

/* 
   -----------------------------------------
   3️⃣ Minimal Green (Gastronomy/Eco) 
   -----------------------------------------
*/
[data-theme="type-minimal"] {
    --sigma-bg: #F0FDF4;
    /* Green-50 */
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #111827;
    --sigma-text-muted: #6B7280;
    --sigma-border: #D1FAE5;
    /* Green-100 */

    --app-main-color: #065F46;
    /* Emerald-800 */
    --app-accent-color: #10B981;
    /* Emerald-500 */
    --app-sidebar-bg: #065F46;
    --app-sidebar-text: #FFFFFF;
}

/* 
   -----------------------------------------
   4️⃣ Dark Premium (Tech/SaaS) 
   -----------------------------------------
*/
[data-theme="type-dark"] {
    --sigma-bg: #0F172A;
    /* Slate-900 */
    --sigma-card-bg: #1E293B;
    /* Slate-800 */
    --sigma-text: #F8FAFC;
    /* Slate-50 */
    --sigma-text-muted: #94A3B8;
    /* Slate-400 */
    --sigma-border: #334155;
    /* Slate-700 */

    --app-main-color: #3B82F6;
    /* Blue-500 */
    --app-accent-color: #2563EB;
    /* Blue-600 */
    --app-sidebar-bg: #0F172A;
    /* Matches bg */
    --app-sidebar-text: #F8FAFC;
}

/* 
   -----------------------------------------
   5️⃣ Warm Sunset (Creative/Marketing)
   -----------------------------------------
*/
[data-theme="type-sunset"] {
    --sigma-bg: #FFF7ED;
    /* Orange-50 (Warm) */
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #1C1917;
    /* Stone-900 */
    --sigma-text-muted: #78716C;
    /* Stone-500 */
    --sigma-border: #FED7AA;
    /* Orange-200 */

    --app-main-color: #EA580C;
    /* Orange-600 */
    --app-accent-color: #F59E0B;
    /* Amber-500 */
    --app-sidebar-bg: #EA580C;
    --app-sidebar-text: #FFFFFF;
}

/* 
   -----------------------------------------
   6️⃣ Ocean Breeze (Medical/Health)
   -----------------------------------------
*/
[data-theme="type-ocean"] {
    --sigma-bg: #F0F9FF;
    /* Sky-50 */
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #0C4A6E;
    /* Sky-900 */
    --sigma-text-muted: #64748B;
    /* Slate-500 */
    --sigma-border: #BAE6FD;
    /* Sky-200 */

    --app-main-color: #0284C7;
    /* Sky-600 */
    --app-accent-color: #06B6D4;
    /* Cyan-500 */
    --app-sidebar-bg: #0284C7;
    --app-sidebar-text: #FFFFFF;
}

/* 
   -----------------------------------------
   7️⃣ Vintage Terracota (Bakery/Artisan)
   -----------------------------------------
*/
[data-theme="type-vintage"] {
    --sigma-bg: #FEF3C7;
    /* Amber-100 */
    --sigma-card-bg: #FFFBEB;
    /* Amber-50 */
    --sigma-text: #44403C;
    /* Stone-700 */
    --sigma-text-muted: #78716C;
    /* Stone-500 */
    --sigma-border: #D6D3D1;
    /* Stone-300 */

    --app-main-color: #92400E;
    /* Amber-800 */
    --app-accent-color: #B45309;
    /* Amber-700 */
    --app-sidebar-bg: #78350F;
    /* Amber-900 */
    --app-sidebar-text: #FEF3C7;
}

/* 
   -----------------------------------------
   8️⃣ Modern Slate (Architecture/Design)
   -----------------------------------------
*/
[data-theme="type-slate"] {
    --sigma-bg: #F8FAFC;
    /* Slate-50 */
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #0F172A;
    /* Slate-900 */
    --sigma-text-muted: #64748B;
    /* Slate-500 */
    --sigma-border: #E2E8F0;
    /* Slate-200 */

    --app-main-color: #475569;
    /* Slate-600 */
    --app-accent-color: #64748B;
    /* Slate-500 */
    --app-sidebar-bg: #1E293B;
    /* Slate-800 */
    --app-sidebar-text: #F8FAFC;
}

/* 
   -----------------------------------------
   9️⃣ Energy Red (Restaurant/Food)
   -----------------------------------------
*/
[data-theme="type-energy"] {
    --sigma-bg: #FEF2F2;
    /* Red-50 */
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #1F2937;
    /* Gray-800 */
    --sigma-text-muted: #6B7280;
    /* Gray-500 */
    --sigma-border: #FECACA;
    /* Red-200 */

    --app-main-color: #DC2626;
    /* Red-600 */
    --app-accent-color: #EF4444;
    /* Red-500 */
    --app-sidebar-bg: #991B1B;
    /* Red-800 */
    --app-sidebar-text: #FFFFFF;
}

/* 
   -----------------------------------------
   🔟 Royal Indigo (Finance/Legal)
   -----------------------------------------
*/
[data-theme="type-royal"] {
    --sigma-bg: #EEF2FF;
    /* Indigo-50 */
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #1E1B4B;
    /* Indigo-950 */
    --sigma-text-muted: #6366F1;
    /* Indigo-500 */
    --sigma-border: #C7D2FE;
    /* Indigo-200 */

    --app-main-color: #4F46E5;
    /* Indigo-600 */
    --app-accent-color: #6366F1;
    /* Indigo-500 */
    --app-sidebar-bg: #3730A3;
    /* Indigo-800 */
    --app-sidebar-text: #E0E7FF;
}

/* 
   -----------------------------------------
   1️⃣1️⃣ Construction (Industrial)
   -----------------------------------------
*/
[data-theme="type-construct"] {
    --sigma-bg: #FAFAFA;
    /* Zinc-50 */
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #18181B;
    /* Zinc-900 */
    --sigma-text-muted: #71717A;
    /* Zinc-500 */
    --sigma-border: #E4E4E7;
    /* Zinc-200 */

    --app-main-color: #EAB308;
    /* Yellow-500 */
    --app-accent-color: #18181B;
    /* Zinc-900 */
    --app-sidebar-bg: #18181B;
    /* Zinc-900 */
    --app-sidebar-text: #FAFAFA;
}

/* 
   -----------------------------------------
   1️⃣2️⃣ Vibrant Violet (Tech/Creative)
   -----------------------------------------
*/
[data-theme="type-violet"] {
    --sigma-bg: #F5F3FF;
    /* Violet-50 */
    --sigma-card-bg: #FFFFFF;
    --sigma-text: #2E1065;
    /* Violet-950 */
    --sigma-text-muted: #8B5CF6;
    /* Violet-500 */
    --sigma-border: #DDD6FE;
    /* Violet-200 */

    --app-main-color: #7C3AED;
    /* Violet-600 */
    --app-accent-color: #D946EF;
    /* Fuchsia-500 */
    --app-sidebar-bg: #4C1D95;
    /* Violet-900 */
    --app-sidebar-text: #F5F3FF;
}

/* Global Reset & Typography */
html,
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    /* Modern stack */
    background-color: var(--sigma-bg);
    color: var(--sigma-text);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Modern Card Style */
.white-card,
.glass-card {
    background: var(--sigma-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Very subtle border */
    border-radius: 20px;
    /* Modern premium radius */
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 10px 20px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(0, 0, 0, 0.01);
    /* Layered shadow for depth */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem;
}

.white-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    border-color: var(--app-accent-color);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--sigma-text);
}

/* 
   -----------------------------------------
   🎯 THEME-AWARE BOOTSTRAP OVERRIDES
   -----------------------------------------
   Override Bootstrap hardcoded colors to adapt to themes
*/

/* Text Colors - Adapt to theme */
.glass-card .text-white,
.white-card .text-white {
    color: var(--sigma-text) !important;
}

.glass-card .text-white-50,
.white-card .text-white-50 {
    color: var(--sigma-text-muted) !important;
}

/* Form Inputs - Adapt to theme */
.glass-card .form-control.bg-dark.text-white,
.glass-card .form-select.bg-dark.text-white,
.white-card .form-control.bg-dark.text-white,
.white-card .form-select.bg-dark.text-white {
    background-color: var(--sigma-card-bg) !important;
    border-color: var(--sigma-border) !important;
    color: var(--sigma-text) !important;
}

.glass-card .form-control::placeholder,
.white-card .form-control::placeholder {
    color: var(--sigma-text-muted) !important;
    opacity: 0.7;
}

/* Buttons - Outline Light adapts to theme */
.glass-card .btn-outline-light,
.white-card .btn-outline-light {
    border-color: var(--sigma-border) !important;
    color: var(--sigma-text) !important;
}

.glass-card .btn-outline-light:hover,
.white-card .btn-outline-light:hover {
    background-color: var(--app-main-color) !important;
    border-color: var(--app-main-color) !important;
    color: var(--app-sidebar-text) !important;
}

/* Primary Button */
.btn-sigma-primary {
    background-color: var(--app-main-color);
    border: 1px solid transparent;
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-sigma-primary:hover {
    background-color: var(--app-accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    color: white;
}

.btn-sigma-primary:active {
    transform: translateY(0);
}

/* Sidebar Overrides */
.sidebar {
    background-color: var(--app-sidebar-bg) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: 280px;
    /* Fixed width for sidebar */
    min-height: 100vh;
    /* Full height */
    transition: transform 0.3s ease-in-out;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1040;
        transform: translateX(-100%);
        /* Hide by default on mobile */
        height: 100vh;
    }

    .sidebar.active {
        transform: translateX(0);
        /* Show when active */
    }
}

.sidebar .avatar {
    max-height: 48px;
    /* Limit logo height */
    max-width: 48px;
    object-fit: contain;
    border-radius: 8px;
    /* Optional: softer look */
}

.nav-link {
    color: var(--app-sidebar-text) !important;
    opacity: 0.75;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 0 0.5rem;
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(3px);
}

/* Pagination */
.pagination {
    margin-top: 2rem;
    justify-content: center;
    gap: 0.25rem;
}

.pagination .page-item .page-link {
    border: 1px solid var(--sigma-border);
    color: var(--sigma-text);
    background-color: var(--sigma-card-bg);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.pagination .page-item.active .page-link {
    background-color: var(--app-main-color);
    border-color: var(--app-main-color);
    color: white;
    font-weight: 600;
}

/* Mobile Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1040;
    height: 70px;
    background-color: var(--sigma-card-bg);
    border-top: 1px solid var(--sigma-border);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom);
    /* iOS safe area */
}

.bottom-nav .nav-item {
    color: var(--sigma-text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    /* Distribute space evenly */
}

.bottom-nav .nav-item i {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.bottom-nav .nav-item.active,
.bottom-nav .nav-item:hover {
    color: var(--app-main-color);
    transform: scale(1.05);
    font-weight: 600;
}

/* Adjust Floating Button and Content for Mobile */
@media (max-width: 991.98px) {
    .btn-flotante {
        bottom: 90px !important;
        /* Raise above bottom nav */
    }

    .content-wrapper {
        padding-bottom: 80px;
        /* Prevent content from being hidden */
    }
}

/* Navbar Override */
.sigma-navbar {
    background-color: var(--app-sidebar-bg) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

/* Login Page specific */
/* .login-left {
    background-color: var(--app-main-color);
    background-image: linear-gradient(135deg, var(--app-main-color), var(--app-accent-color));
} */

/* Utility to force text colors if needed */
.text-main {
    color: var(--app-main-color);
}

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

.bg-card {
    background-color: var(--sigma-card-bg);
}

/* 
   -----------------------------------------
   🗔 PREMIUM WINDOWS (MODALS)
   -----------------------------------------
*/

.modal-content {
    border-radius: 20px !important;
    border: none !important;
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden;
    background-color: var(--sigma-card-bg) !important;
}

.modal-header {
    border-bottom: 1px solid var(--sigma-border);
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--sigma-border);
    background-color: rgba(0, 0, 0, 0.02);
    padding: 1rem 1.5rem;
}

.modal-backdrop.show {
    opacity: 0.4;
    backdrop-filter: blur(8px);
    /* Premium Glassmorphism effect */
    -webkit-backdrop-filter: blur(8px);
}

/* 
   -----------------------------------------
   🎨 THEME SELECTOR STYLES
   -----------------------------------------
*/
.theme-card {
    background-color: var(--sigma-card-bg);
    border: 2px solid var(--sigma-border);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-card:hover {
    transform: translateY(-2px);
    border-color: var(--app-main-color) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.theme-card.selected {
    background-color: rgba(var(--app-main-color-rgb), 0.05);
    border-color: var(--app-main-color) !important;
    box-shadow: 0 0 0 1px var(--app-main-color);
}

.theme-icon-minimal {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background-color: var(--sigma-bg);
    color: var(--app-main-color);
}