:root {
    --primary-color: #6C63FF;
    /* Modern Purple */
    --secondary-color: #ff6b00;
    /* Accent Orange */
    --bg-color: #F4F7FE;
    /* Light Dashboard BG */
    --text-color: #2B3674;
    --sidebar-width: 280px;
    --card-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    /* Main scroll is inside content-area */
}

/* DASHBOARD LAYOUT */
.dashboard-container {
    display: flex;
    height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.02);
    z-index: 10;
}

.brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
}

.menu {
    flex-grow: 1;
    overflow-y: auto;
}

.menu-label {
    font-size: 12px;
    color: #A3AED0;
    font-weight: 600;
    margin-bottom: 15px;
    padding-left: 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #A3AED0;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.3s;
    font-weight: 500;
    gap: 12px;
    cursor: pointer;
}

.menu-item:hover,
.menu-item.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 5px 10px rgba(108, 99, 255, 0.2);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

/* MAIN CONTENT */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.greeting h2 {
    font-size: 24px;
    margin: 0;
}

.greeting p {
    color: #A3AED0;
    margin: 5px 0 0;
}

#content-area {
    padding: 0 40px 40px;
    overflow-y: auto;
    flex-grow: 1;
}

/* CARDS */
.card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    border: none;
}

/* STATS CARDS */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Reduced gap to fit */
    position: relative;
    overflow: hidden;
    padding: 20px 15px;
    /* Reduced padding to fit */
}

/* Responsive adjustment for small desktops */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.stat-card.blue {
    background: linear-gradient(135deg, #868CFF 0%, #4318FF 100%);
    color: white;
}

.stat-card.green {
    background: linear-gradient(135deg, #6ad99b 0%, #3dbc74 100%);
    color: white;
}

.stat-card.orange {
    background: linear-gradient(135deg, #FF9B7B 0%, #FF6B00 100%);
    color: white;
}

.stat-card.cyan {
    background: linear-gradient(135deg, #2DCEE3 0%, #06a4b9 100%);
    color: white;
}

.stat-card.purple {
    background: linear-gradient(135deg, #b862ff 0%, #7d18ff 100%);
    color: white;
}

.stat-card .icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
}

.stat-card p {
    margin: 5px 0 0;
    font-size: 14px;
    font-weight: 300;
}

/* TABLES */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    font-weight: 600;
    color: #A3AED0;
    font-size: 12px;
    text-transform: uppercase;
}

td {
    font-size: 14px;
    color: var(--text-color);
}

.badge {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* BUTTONS */
.btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(90deg, #6C63FF 0%, #4834d4 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.6);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    box-shadow: none;
}

/* FORMS & FILTERS */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    align-items: center;
    /* Vertically align items */
}

.filters input,
.filters select {
    width: auto;
    /* Let content dictate width or flex grow */
    min-width: 150px;
    /* Minimum width for usability */
    padding: 10px 15px;
    border: 1px solid #E0E5F2;
    border-radius: 12px;
    background: #F8F9FA;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
    outline: none;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #E0E5F2;
    border-radius: 12px;
    background: #F8F9FA;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
    outline: none;
}

.form-control:focus,
.filters input:focus,
.filters select:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

textarea.form-control {
    resize: vertical;
}

/* LOGIN PAGE SPECIFIC */
.login-wrapper {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.6s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-header p {
    color: #A3AED0;
    font-size: 14px;
}

/* DASHBOARD PROFILE */
.user-profile {
    display: flex;
    align-items: center;
    background: white;
    padding: 8px 12px 8px 8px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    gap: 12px;
    transition: all 0.3s;
}

.user-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.profile-pic {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6C63FF 0%, #4834d4 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

#username-display {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* STATUS SELECT & FILTER BUTTON */
.status-select {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    text-align-last: center;
}

/* Use background color classes from badge */
.status-select.badge-success {
    background: #E6FBF2;
    color: #05CD99;
}

.status-select.badge-warning {
    background: #FFF8EA;
    color: #FFB547;
}

.status-select.badge-danger {
    background: #FEEEEE;
    color: #EE5D50;
}

.status-select.badge-info {
    background: #F0F4FF;
    color: #3B71CA;
}

.status-select.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* ANIMATION */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* MOBILE RESPONSIVE */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-size: 20px;
    color: var(--primary-color);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .dashboard-container {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        width: 260px;
        transition: 0.3s;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding-top: 90px;
    }

    .top-bar {
        padding: 0 20px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .user-profile {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 101;
        width: auto;
        padding: 5px 15px 5px 5px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        background: white;
    }

    /* Hide username on very small screens to keep it button-like */
    @media (max-width: 400px) {
        #username-display {
            display: none;
        }

        .user-profile {
            padding: 5px;
        }
    }

    #content-area {
        padding: 0 20px 40px;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        z-index: 9;
    }

    .overlay.active {
        display: block;
    }
}

/* READ MORE LINK */
.read-more {
    color: var(--primary-color);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    margin-left: 5px;
}

.read-more:hover {
    text-decoration: underline;
}

/* MODAL STYLES */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #A3AED0;
    transition: 0.2s;
}

.modal-close:hover {
    color: var(--text-color);
}

/* NOTIFICATION STYLES */
.notif-wrapper {
    position: relative;
    cursor: pointer;
    margin-right: 15px;
    display: none;
    /* Hidden by default, shown for admin */
}

.notif-icon {
    font-size: 20px;
    color: #A3AED0;
    transition: 0.3s;
}

.notif-wrapper:hover .notif-icon {
    color: var(--primary-color);
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff5630;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: 35px;
    right: -10px;
    width: 300px;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.notif-dropdown.active {
    display: block;
}

.notif-header {
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.notif-list {
    max-height: 350px;
    overflow-y: auto;
}

.notif-group-title {
    padding: 5px 15px;
    font-size: 11px;
    color: #999;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    font-weight: 600;
}

.notif-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notif-item:hover {
    background: #f0f7ff;
}

.notif-item.unread {
    background: #fff;
    /* Slightly different if needed, or stick to indicator */
}

.notif-item.unread .notif-text {
    font-weight: 600;
    color: #333;
}

.notif-item .notif-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-top: 5px;
    flex-shrink: 0;
}

.notif-item.read .notif-indicator {
    background: #e2e8f0;
}

.notif-item.read .notif-text {
    color: #666;
    font-weight: 400;
}

.notif-content {
    flex-grow: 1;
}

.notif-text {
    font-size: 13px;
    margin-bottom: 3px;
    line-height: 1.4;
}

.notif-time {
    font-size: 10px;
    color: #aaa;
}

.notif-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
    font-style: italic;
}