:root {
    --sidebar-width: 280px;
    --sidebar-bg: #343a40;
    /* Dark sidebar */
    --sidebar-link-color: #adb5bd;
    --sidebar-link-hover-color: #ffffff;
    --sidebar-link-active-color: #ffffff;
    --sidebar-link-active-bg: #0d6efd;
    /* Primary blue for active */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    /* Prevent horizontal scrollbar from sidebar transitions */
}

#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-link-color);
    position: fixed;
    /* Fixed Sidebar */
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    /* Above navbar-sticky but below modals */
    padding-top: 1rem;
    transition: margin-left 0.3s ease-in-out;
    overflow-y: auto;
    /* Allow sidebar scroll if content overflows */
}

#sidebar .sidebar-header {
    padding: 1rem 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #495057;
}

#sidebar .sidebar-header a.navbar-brand {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
}

#sidebar .sidebar-header a.navbar-brand i {
    margin-right: 10px;
    color: #0d6efd;
}

#sidebar .nav-link {
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-link-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-left-color 0.2s ease;
}

#sidebar .nav-link i {
    margin-right: 12px;
    width: 20px;
    /* Fixed width for icons for alignment */
    text-align: center;
}

#sidebar .nav-link:hover {
    background-color: #495057;
    /* Slightly darker hover */
    color: var(--sidebar-link-hover-color);
    border-left-color: #6c757d;
}

#sidebar .nav-link.active {
    background-color: var(--sidebar-link-active-bg);
    color: var(--sidebar-link-active-color);
    font-weight: 600;
    border-left-color: #ffffff;
    /* White border for active link */
}

#sidebar .user-panel {
    padding: 1rem 1.5rem;
    border-top: 1px solid #495057;
    margin-top: auto;
    /* Pushes to the bottom if sidebar content is short */
}

#sidebar .user-panel button {
    width: 100%;
    margin-bottom: 0.5rem;
}


#page-content-wrapper {
    width: 100%;
    min-height: 100vh;
    padding-left: var(--sidebar-width);
    /* Space for the sidebar */
    display: flex;
    flex-direction: column;
    transition: padding-left 0.3s ease-in-out;
}

/* For mobile: sidebar initially hidden */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        /* Hide sidebar off-screen */
    }

    #sidebar.active {
        margin-left: 0;
    }

    #page-content-wrapper {
        padding-left: 0;
        /* Full width when sidebar is hidden */
    }

    #page-content-wrapper.sidebar-active {
        padding-left: var(--sidebar-width);
        /* Shift content when sidebar is active */
    }

    .sidebar-toggler {
        /* Hamburger menu button */
        display: block !important;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1031;
        /* Above sidebar */
        background-color: #fff;
        border: 1px solid #ddd;
        border-radius: 0.25rem;
        padding: 0.375rem 0.75rem;
    }
}

.sidebar-toggler {
    display: none;
}

/* Hidden on larger screens */


#main-content {
    flex-grow: 1;
    padding: 2rem;
}

.content-section {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, .07);
    margin-bottom: 2rem;
}

.content-section h2 {
    color: #343a40;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #0d6efd;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.footer {
    background-color: #343a40;
    color: #f8f9fa;
    padding: 2rem 0;
    /* margin-top: auto; Removed as page-content-wrapper handles flex */
}

.footer a {
    color: #adb5bd;
    text-decoration: none;
}

.footer a:hover {
    color: #ffffff;
}

.footer .social-icons a {
    font-size: 1.5rem;
    margin: 0 0.5rem;
}

.dashboard-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #fff;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, .15);
}

.dashboard-card .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-card .card-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.bg-primary-custom {
    background-color: #0d6efd;
}

.bg-success-custom {
    background-color: #198754;
}

.bg-warning-custom {
    background-color: #ffc107;
    color: #333 !important;
}

.bg-danger-custom {
    background-color: #dc3545;
}

.bg-info-custom {
    background-color: #0dcaf0;
    color: #333 !important;
}

.form-label {
    font-weight: 500;
}

.form-control,
.form-select {
    border-radius: 0.375rem;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.table thead th {
    background-color: #e9ecef;
    color: #343a40;
    font-weight: 600;
}

/* FAQ new layout */
.faq-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.faq-item .faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0d6efd;
    margin-bottom: 0.75rem;
}

.faq-item .faq-answer {
    color: #495057;
    line-height: 1.6;
}

.message-box {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
    min-width: 250px;
}

.message-box .toast {
    opacity: 1 !important;
}

/* Overlay for sidebar on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1029;
    /* Below sidebar, above content */
}

#sidebar.active+#page-content-wrapper+.sidebar-overlay {
    display: block;
    /* Show overlay when sidebar is active */
}