
:root {
    --primary-color: #9E2140;         /* Base Maroon */
    --primary-dark: #7F1A34;          /* Approx. darker maroon */
    --primary-light: #B6526B;         /* Lighter maroon */
    --primary-lighter: #CE7A8A;       /* Even lighter */
    --primary-lightest: #E4B2BA;      /* Very light */
    
    --secondary-color: #CE7A8A;       /* Secondary from lighter maroon */
    --success-color: #2e7d32;
    --warning-color: #ed6c02;
    --error-color: #d32f2f;
    --info-color: #0288d1;

    --background-color: #f9f6f7;      /* Soft background tint */
    --surface-color: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;

    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
    
    /* Brand colors for consistency */
    --brand-primary: #9E2140;
    --brand-secondary: #CE7A8A;
    --brand-accent: #E4B2BA;
    --brand-text: #2C3E50;
    --brand-light: #F8F9FA;



    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
}


* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color) !important;
    box-shadow: var(--shadow);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    color: white !important;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-1px);
}

.navbar-brand img {
    max-height: 40px;
    width: auto;
    transition: all 0.3s ease;
    margin-right: 0.75rem;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

/* Logo loading and error states */
.logo-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.logo-error {
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
}

/* Sidebar */
.sidebar {
    background-color: var(--surface-color);
    box-shadow: var(--shadow);
    min-height: calc(100vh - 76px);
    padding: 1.5rem 0;
}

.sidebar .nav-link {
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    margin: 0.25rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
}

/* Main content */
.main-content {
    background-color: var(--background-color);
    min-height: calc(100vh - 76px);
    padding: 2rem;
}

/* Cards */
.card {
    border: none;
    box-shadow: var(--shadow);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Tables */
.table {
    background-color: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead th {
    background-color: var(--background-color);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: rgba(25, 118, 210, 0.04);
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    border-radius: 6px;
    font-weight: 500;
}

/* Status badges */
.badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.badge-in-progress {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-completed {
    background-color: #d4edda;
    color: #155724;
}

.badge-delayed {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Priority badges */
.badge-low {
    background-color: #e3f2fd;
    color: #1565c0;
}

.badge-medium {
    background-color: #fff3e0;
    color: #ef6c00;
}

.badge-high {
    background-color: #fff8e1;
    color: #f57f17;
}

.badge-critical {
    background-color: #ffebee;
    color: #c62828;
}

/* Organization-specific styling */
.org-badge {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.org-highlight {
    background: var(--brand-accent);
    color: var(--brand-primary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
}

/* Stats cards */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Filters */
.filter-section {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* Footer */
.footer {
    background-color: var(--surface-color);
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer a {
    color: var(--primary-color);
    transition: color 0.3s ease;
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        border-radius: 8px;
    }

    .navbar-brand img {
        max-height: 32px;
    }

    .footer {
        padding: 1rem 0;
    }

    .footer .row > div {
        text-align: center !important;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    .navbar-brand img {
        max-height: 28px;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom utilities */
.text-truncate-2 {
    display: -webkit-box;
    --webkit-line-clamp: 2;
    --webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm-custom {
    box-shadow: var(--shadow);
}

.border-radius-custom {
    border-radius: 12px;
}

/* Action buttons */
.action-buttons .btn {
    margin: 0 0.125rem;
    padding: 0.375rem 0.75rem;
}

/* Search and filter bar */
.search-filter-bar {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* Logout confirmation modal */
.logout-modal .modal-content {
    border-radius: 12px;
    border: none;
}

.logout-modal .modal-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px 12px 0 0;
}

.logout-modal .btn-danger {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.logout-modal .btn-danger:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}



.wrapper {
            display: flex;
            width: 100%;
            align-items: stretch;
            min-height: 100vh;
        }

        /* Sidebar Styles */
        #sidebar {
            min-width: var(--sidebar-width);
            max-width: var(--sidebar-width);
            background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
            color: #fff;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            min-height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 999;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        }

        #sidebar.collapsed {
            min-width: var(--sidebar-collapsed-width);
            max-width: var(--sidebar-collapsed-width);
        }

        #sidebar .sidebar-header {
            padding: 20px;
            background: rgba(0, 0, 0, 0.1);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            min-height: 70px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #sidebar .sidebar-header h3 {
            margin: 0;
            font-size: 1.25rem;
            font-weight: 600;
            letter-spacing: 0.5px;
            color: white;
        }

        #sidebar .sidebar-header .logo-short {
            display: none;
            font-size: 1.5rem;
            font-weight: bold;
            text-align: center;
            background: white;
            color: var(--primary-color);
            width: 45px;
            height: 45px;
            border-radius: 8px;
            display: none;
            align-items: center;
            justify-content: center;
        }

        #sidebar.collapsed .sidebar-header h3 {
            display: none;
        }

        #sidebar.collapsed .sidebar-header .logo-short {
            display: flex;
        }

        #sidebar ul.components {
            padding: 20px 0;
            list-style: none;
            margin: 0;
        }

        #sidebar ul li {
            position: relative;
        }

        #sidebar ul li a {
            padding: 12px 20px;
            font-size: 0.95rem;
            display: flex;
            align-items: center;
            color: rgba(255, 255, 255, 0.9);
            text-decoration: none;
            transition: all 0.3s ease;
            margin: 0 10px;
            border-radius: 8px;
        }

        #sidebar ul li a:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            transform: translateX(3px);
        }

        #sidebar ul li.active > a {
            background: rgba(255, 255, 255, 0.2);
            color: #fff;
            font-weight: 600;
        }

        #sidebar ul li.active > a::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            height: 30px;
            width: 4px;
            background: white;
            border-radius: 0 4px 4px 0;
        }

        #sidebar ul li a i {
            margin-right: 12px;
            font-size: 1.1rem;
            width: 20px;
            text-align: center;
            flex-shrink: 0;
        }

        #sidebar ul li a span {
            white-space: nowrap;
        }

        #sidebar.collapsed ul li a {
            justify-content: center;
            padding: 15px 10px;
        }

        #sidebar.collapsed ul li a i {
            margin-right: 0;
            font-size: 1.25rem;
        }

        #sidebar.collapsed ul li a span {
            display: none;
        }

        #sidebar.collapsed ul li.active > a::before {
            display: none;
        }

        /* Tooltip for collapsed sidebar */
        #sidebar.collapsed ul li {
            position: relative;
        }

        #sidebar.collapsed ul li:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            margin-left: 10px;
            background: var(--primary-dark);
            color: white;
            padding: 5px 10px;
            border-radius: 4px;
            white-space: nowrap;
            font-size: 0.875rem;
            z-index: 1000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        /* User Section */
        .sidebar-user {
            position: absolute;
            bottom: 0;
            width: 100%;
            background: rgba(0, 0, 0, 0.2);
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .sidebar-user .user-info {
            padding: 15px 20px;
        }

        .sidebar-user .user-avatar {
            width: 35px;
            height: 35px;
            background: white;
            color: var(--primary-color);
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            font-weight: 600;
            font-size: 0.875rem;
        }

        #sidebar.collapsed .sidebar-user .user-name {
            display: none;
        }

        #sidebar.collapsed .sidebar-user .user-info {
            padding: 15px 10px;
            display: flex;
            justify-content: center;
        }

        #sidebar.collapsed .sidebar-user .user-avatar {
            margin-right: 0;
        }

        /* Content Area */
        #content {
            width: 100%;
            padding: 0;
            min-height: 100vh;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            margin-left: var(--sidebar-width);
            background-color: var(--background-color);
        }

        #content.expanded {
            margin-left: var(--sidebar-collapsed-width);
        }

        /* Top Bar */
        .top-bar {
            background: white;
            padding: 15px 25px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .toggle-btn {
            background: none;
            border: none;
            font-size: 1.25rem;
            color: var(--primary-color);
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
            transition: all 0.3s ease;
        }

        .toggle-btn:hover {
            background: var(--primary-lightest);
        }

        .main-content-area {
            padding: 25px;
        }

        /* Dropdown customization */
        .dropdown-menu-dark {
            background: var(--primary-dark);
        }

        .dropdown-menu-dark .dropdown-item {
            color: rgba(255, 255, 255, 0.9);
        }

        .dropdown-menu-dark .dropdown-item:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        /* Responsive */
        @media (max-width: 768px) {
            #sidebar {
                margin-left: -var(--sidebar-width);
            }
            
            #sidebar.active {
                margin-left: 0;
            }
            
            #content {
                margin-left: 0;
            }
            
            .overlay {
                display: none;
                position: fixed;
                width: 100vw;
                height: 100vh;
                background: rgba(0, 0, 0, 0.7);
                z-index: 998;
                opacity: 0;
                transition: all 0.5s ease-in-out;
            }
            
            .overlay.active {
                display: block;
                opacity: 1;
            }

            .top-bar {
                padding: 15px;
            }

            .main-content-area {
                padding: 15px;
            }
        }

        /* Animations */
        @keyframes slideInFromLeft {
            from {
                transform: translateX(-100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        #sidebar {
            animation: slideInFromLeft 0.3s ease-out;
        }

        /* Custom scrollbar for sidebar */
        #sidebar::-webkit-scrollbar {
            width: 4px;
        }

        #sidebar::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.1);
        }

        #sidebar::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.3);
            border-radius: 2px;
        }

        #sidebar::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.5);
        }