:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --sidebar-bg: #991b1b;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --card-hover-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --border-radius: 1rem;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--light-bg);
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar Navigation Layout - Modern Red Theme */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
    position: relative;
}

#sidebar-wrapper {
    min-width: 260px;
    max-width: 260px;
    background: linear-gradient(180deg, #991b1b 0%, #7f1d1d 100%);
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1050;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
}

#sidebar-wrapper .sidebar-brand {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
}

#sidebar-wrapper .user-profile-badge {
    margin: 0 1rem 1rem 1rem;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#sidebar-wrapper .sidebar-nav {
    padding: 0.5rem 0.75rem;
    list-style: none;
    margin: 0;
}

#sidebar-wrapper .sidebar-nav .nav-item {
    margin-bottom: 0.3rem;
}

#sidebar-wrapper .sidebar-nav .nav-link {
    color: #fecdd3 !important;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

#sidebar-wrapper .sidebar-nav .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.15);
}

#sidebar-wrapper .sidebar-nav .nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.22);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #ffffff;
}

#sidebar-wrapper .sidebar-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

#sidebar-wrapper .sidebar-footer .btn-outline-danger {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.1);
}

#sidebar-wrapper .sidebar-footer .btn-outline-danger:hover {
    background: #ffffff;
    color: #991b1b;
    border-color: #ffffff;
}

#page-content-wrapper {
    width: 100%;
    flex-grow: 1;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.top-navbar-mobile {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Mobile Sidebar Overlay & Responsiveness */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 991.98px) {
    #sidebar-wrapper {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -270px;
        height: 100vh;
    }
    #wrapper.toggled #sidebar-wrapper {
        left: 0;
    }
    #wrapper.toggled .sidebar-overlay {
        display: block;
        opacity: 1;
    }
}

/* Touch-friendly inputs & buttons */
.form-control, .form-select {
    min-height: 44px;
    font-size: 0.95rem;
}

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Filter Buttons Scrollable Container */
.day-filter-container {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}
.day-filter-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Card & UI Polish */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.badge {
    padding: 0.45em 0.85em;
    border-radius: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.table > :not(caption) > * > * {
    padding: 0.85rem 1rem;
}

/* Mobile Adjustments */
@media (max-width: 575.98px) {
    .p-3.p-md-4 {
        padding: 1rem !important;
    }
    .modal-dialog {
        margin: 0.75rem;
    }
    .table > :not(caption) > * > * {
        padding: 0.65rem 0.75rem;
        font-size: 0.875rem;
    }
    h4 {
        font-size: 1.25rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
