:root {
            --primary-color: #4a90e2;
            --secondary-color: #854DFC;
            --accent-color: #ff6b6b;
            --success-color: #2ecc71;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
            --light-color: #f8f9fa;
            --dark-color: #343a40;
            --bg-color: #f0f3f8;
            --text-color: #333;
            --card-bg: rgba(255, 255, 255, 0.9);
            --sidebar-width-lg: 240px; /* Sidebar width for large screens and up */
            --sidebar-width-sm: 260px; /* Sidebar width for mobile/tablet off-canvas */
            --header-height: 64px;
            --border-radius: 8px;
            --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            --transition-speed: 0.3s;
        }

        @font-face {
            font-family: 'Nasalization';
            src: url("/static/fonts/nasalization-rg.3e5a870c6d7a.otf") format("opentype");
            font-weight: normal;
            font-style: normal;
        }

        body {
            font-family: 'Roboto', sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            transition: all var(--transition-speed) ease;
            display: flex; /* Make body a flex container */
            flex-direction: column; /* Stack children vertically */
            min-height: 100vh; /* Ensure it takes full viewport height */
        }

        /* Navbar styles */
        .navbar {
            background-color: var(--secondary-color);
            padding: 10px 20px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            height: var(--header-height);
            z-index: 1030;
            position: sticky; /* Make navbar sticky */
            top: 0;
            width: 100%;
        }
        
        .navbar-brand {
            font-family: 'Nasalization', sans-serif;
            font-size: 1.6rem;
            padding-left: 20px;
            color: white;
            letter-spacing: 0.5px;
        }
        
        .navbar-brand:hover {
            color: rgba(255, 255, 255, 0.9);
        }

        /* Layout container for sidebar and main content */
        .app-container {
            display: flex;
            flex: 1; /* Allow this container to grow and fill available space */
            width: 100%;
        }

        /* Sidebar styles */
        .sidebar {
            background: linear-gradient(to bottom, var(--secondary-color), #6c3dd8);
            width: var(--sidebar-width-lg);
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
            transition: all var(--transition-speed) ease;
            flex-shrink: 0; /* Prevent sidebar from shrinking */
            position: sticky; /* Make sidebar sticky */
            top: var(--header-height); /* Stick below the header */
            height: calc(100vh - var(--header-height)); /* Full height minus header */
            overflow-y: auto; /* Enable scrolling for long content */
            z-index: 1020;
        }

        .sidebar .nav-link {
            color: rgba(255, 255, 255, 0.85);
            padding: 12px 20px;
            margin: 4px 10px;
            border-radius: var(--border-radius);
            transition: all var(--transition-speed) ease;
        }

        .sidebar .nav-link:hover {
            background-color: rgba(255, 255, 255, 0.15);
            color: white;
            transform: translateX(5px);
        }
        
        .sidebar .nav-link.active {
            background-color: rgba(255, 255, 255, 0.2);
            color: white;
            font-weight: 500;
        }

        .sidebar-header {
            padding: 20px;
            color: white;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            opacity: 0.7;
        }

        /* Main content area */
        .main-content-wrapper {
            flex-grow: 1; /* Allow main content to take remaining space */
            padding: 20px;
            transition: all var(--transition-speed) ease;
            width: calc(100% - var(--sidebar-width-lg)); /* Adjust width based on sidebar */
            overflow-x: hidden; /* Prevent horizontal scroll from content overflow */
        }
        
        /* Card styles */
        .card {
            border: none;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            transition: transform 0.2s ease;
            background-color: var(--card-bg);
        }
        
        .card:hover {
            transform: translateY(-5px);
        }

        .card-header {
            background-color: rgba(0, 0, 0, 0.03);
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        }

        /* Button styling */
        .btn {
            border-radius: var(--border-radius);
            padding: 8px 16px;
            transition: all 0.2s ease;
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }
        
        .btn-primary:hover {
            background-color: #3a80d2;
            border-color: #3a80d2;
        }
        
        .btn-secondary {
            background-color: var(--secondary-color);
            border-color: var(--secondary-color);
        }
        
        .btn-secondary:hover {
            background-color: #7540e8;
            border-color: #7540e8;
        }

        /* User menu */
        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            margin-right: 8px;
        }

        .user-menu .dropdown-menu {
            min-width: 220px;
            border-radius: var(--border-radius);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
            padding: 8px 0;
            margin-top: 10px;
        }
        
        .user-menu .dropdown-item {
            padding: 10px 16px;
            transition: all 0.2s ease;
        }
        
        .user-menu .dropdown-item:hover {
            background-color: rgba(74, 144, 226, 0.1);
        }
        
        .user-menu .dropdown-item i {
            width: 20px;
            text-align: center;
        }

        /* Notification badge */
        .notification-badge {
            position: relative;
        }
        
        .notification-badge .badge {
            position: absolute;
            top: 3px;
            right: 3px;
            font-size: 0.65rem;
            padding: 0.25em 0.5em;
        }

        /* Sidebar toggle button (for left sidebar) */
        .sidebar-toggle {
            background: none;
            border: none;
            color: white; /* Ensure it's white against the dark navbar */
            font-size: 1.25rem;
            padding: 5px 10px;
            margin-right: 10px;
            cursor: pointer;
            display: none; /* Hidden by default on larger screens */
        }

        /* Navbar toggler (for right-side menu) */
        .navbar-toggler {
            color: white; /* Ensure it's white against the dark navbar */
            border-color: rgba(255, 255, 255, 0.1); /* Optional: subtle border */
        }

        .navbar-toggler-icon {
            /* Create a hamburger icon using background image */
            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, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
        }


        /* Backdrop for mobile sidebar */
        .sidebar-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1010;
            display: none;
        }
        .sidebar-backdrop.show {
            display: block;
        }

        /* Responsive adjustments */
        /* For screens smaller than large (e.g., tablets and mobiles) */
        @media (max-width: 991.98px) { /* Bootstrap's 'lg' breakpoint is 992px */
            .sidebar-toggle {
                display: block; /* Show sidebar toggle button on tablets and mobiles */
            }

            .navbar-brand {
                padding-left: 0; /* Remove padding when toggle is present */
            }

            .sidebar {
                position: fixed;
                top: var(--header-height);
                left: calc(-1 * var(--sidebar-width-sm)); /* Off-canvas to the left */
                bottom: 0;
                width: var(--sidebar-width-sm);
                z-index: 1040; /* Above backdrop */
                height: calc(100vh - var(--header-height));
                box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
            }
            
            .sidebar.show {
                left: 0; /* Slide in */
            }
            
            .main-content-wrapper {
                width: 100%;
                margin-left: 0; /* No margin-left on mobile/tablet */
            }

            .navbar-collapse {
                position: fixed;
                top: var(--header-height);
                left: 0;
                width: 100%;
                background-color: var(--secondary-color);
                padding: 15px;
                box-shadow: 0 2px 10px rgba(0,0,0,0.1);
                transform: translateY(-100%);
                transition: transform var(--transition-speed) ease-in-out;
                z-index: 1000;
            }

            .navbar-collapse.show {
                transform: translateY(0);
            }

            .navbar-nav .nav-item {
                margin-right: 0 !important;
                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            }
            .navbar-nav .nav-item:last-child {
                border-bottom: none;
            }
            .navbar-nav .nav-link {
                padding: 10px 0;
                color: white;
            }
            .navbar-nav .dropdown-menu {
                position: static !important;
                transform: none !important;
                margin-top: 0 !important;
                background-color: rgba(255, 255, 255, 0.95);
                border: none;
                box-shadow: none;
            }
            .navbar-nav .dropdown-item {
                padding-left: 30px;
            }
            .user-avatar {
                margin-right: 0;
            }
            .user-menu .dropdown-item-text {
                padding: 10px 16px;
            }
        }

        /* For screens larger than or equal to large (desktop) */
        @media (min-width: 992px) { 
            .sidebar {
                position: sticky; /* Keep it sticky on desktop */
                top: var(--header-height);
            }
            .main-content-wrapper {
                width: calc(100% - var(--sidebar-width-lg));
            }
            .app-container {
                flex-direction: row; /* Sidebar and main content side-by-side */
            }
            .sidebar-toggle {
                display: none; /* Hide sidebar toggle button on desktop */
            }
            .navbar-toggler {
                display: none; /* Hide right-side menu toggler on desktop */
            }
        }
        
        /* Footer */
        .app-footer {
            padding: 15px;
            text-align: center;
            background-color: var(--light-color);
            border-top: 1px solid rgba(0, 0, 0, 0.05);
            font-size: 0.85rem;
            color: #6c757d;
            flex-shrink: 0; /* Prevent footer from shrinking */
        }
        
        /* Utilities */
        .text-primary { color: var(--primary-color) !important; }
        .text-secondary { color: var(--secondary-color) !important; }
        .text-accent { color: var(--accent-color) !important; }
        .text-success { color: var(--success-color) !important; }
        .text-warning { color: var(--warning-color) !important; }
        .text-danger { color: var(--danger-color) !important; }
        
        .bg-primary { background-color: var(--primary-color) !important; }
        .bg-secondary { background-color: var(--secondary-color) !important; }
        .bg-accent { background-color: var(--accent-color) !important; }
        .bg-success { background-color: var(--success-color) !important; }
        .bg-warning { background-color: var(--warning-color) !important; }
        .bg-danger { background-color: var(--danger-color) !important; }
        
        /* Custom scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        
        ::-webkit-scrollbar-track {
            background: #f1f1f1;
        }
        
        ::-webkit-scrollbar-thumb {
            background: #ccc;
            border-radius: 4px;
        }
        
        ::-webkit-scrollbar-thumb:hover {
            background: #aaa;
        }