:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --success-color: #06ffa5;
    --warning-color: #ffbe0b;
    --danger-color: #fb5607;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background-color: var(--white);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    /*padding: 20px 0;*/
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.collapsed {
    left: -260px;
}

.sidebar-logo {
    padding: 0 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #110b5c;
}

.sidebar-logo h3 {
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.sidebar-logo i {
    font-size: 24px;
    margin-right: 10px;
    color: var(--primary-color);
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu > li > a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}

.sidebar-menu > li > a:hover,
.sidebar-menu > li > a.active {
    color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.1);
}

.sidebar-menu > li > a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--primary-color);
}

.sidebar-menu i {
    width: 25px;
    font-size: 18px;
    margin-right: 15px;
    text-align: center;
}

.sidebar-menu .arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.sidebar-menu .arrow.rotate {
    transform: rotate(90deg);
}

/* Dropdown Menu Styles */
.sidebar-dropdown {
    position: relative;
}

.sidebar-dropdown-menu {
    list-style: none;
    padding-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background-color: rgba(248, 249, 250, 0.8);
}

.sidebar-dropdown-menu.show {
    max-height: 500px;
}

.sidebar-dropdown-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 25px 12px 65px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sidebar-dropdown-menu li a:hover {
    color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.05);
}

.sidebar-dropdown-menu li a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Sub-dropdown Menu Styles */
.sidebar-sub-dropdown {
    position: relative;
}

.sidebar-sub-dropdown-menu {
    list-style: none;
    padding-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background-color: rgba(248, 249, 250, 0.5);
}

.sidebar-sub-dropdown-menu.show {
    max-height: 300px;
}

.sidebar-sub-dropdown-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 25px 10px 85px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 13px;
}

.sidebar-sub-dropdown-menu li a:hover {
    color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.05);
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 70px;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    z-index: 999;
}

.header.expanded {
    left: 0;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.toggle-btn:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 10px 20px 10px 45px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
    background-color: var(--light-bg);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: var(--white);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    margin-top: 70px;
    padding: 30px;
    transition: all 0.3s ease;
    min-height: calc(100vh - 70px);
}

.main-content.expanded {
    margin-left: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-card.primary {
    border-left-color: var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.info {
    border-left-color: var(--accent-color);
}

.stat-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.stat-card.primary .stat-icon { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); }
.stat-card.success .stat-icon { background: linear-gradient(135deg, #06ffa5, #00d084); }
.stat-card.warning .stat-icon { background: linear-gradient(135deg, var(--warning-color), #ff9a00); }
.stat-card.info .stat-icon { background: linear-gradient(135deg, var(--accent-color), #00a8e8); }

/* Content Cards */
.content-card {
    background-color: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.content-card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.card-header-custom h5 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.card-header-custom h5 i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Charts */
.chart-container {
    height: 300px;
    background-color: var(--light-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05) 0%, rgba(76, 201, 240, 0.05) 100%);
    z-index: 0;
}

.chart-container i {
    font-size: 48px;
    color: var(--primary-color);
    opacity: 0.7;
    z-index: 1;
}

.chart-container p {
    margin: 0;
    padding-left: 15px;
    z-index: 1;
}

/* Activity Feed */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    border-left: 3px solid transparent;
}

.activity-item:hover {
    background-color: var(--light-bg);
}

.activity-item.primary {
    border-left-color: var(--primary-color);
}

.activity-item.success {
    border-left-color: var(--success-color);
}

.activity-item.warning {
    border-left-color: var(--warning-color);
}

.activity-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
    flex-shrink: 0;
}

.activity-icon.primary { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); }
.activity-icon.success { background: linear-gradient(135deg, #06ffa5, #00d084); }
.activity-icon.warning { background: linear-gradient(135deg, var(--warning-color), #ff9a00); }

.activity-content h6 {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.activity-content small {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Tables */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.custom-table thead th {
    background-color: var(--light-bg);
    color: var(--text-primary);
    font-weight: 600;
    padding: 15px;
    border: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-table tbody tr {
    background-color: var(--white);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.custom-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.custom-table tbody td {
    padding: 15px;
    border: none;
    vertical-align: middle;
}

.custom-table tbody tr td:first-child {
    border-radius: 10px 0 0 10px;
}

.custom-table tbody tr td:last-child {
    border-radius: 0 10px 10px 0;
}

.badge-custom {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active {
    background-color: rgba(6, 255, 165, 0.1);
    color: #00d084;
}

.badge-inactive {
    background-color: rgba(251, 86, 7, 0.1);
    color: var(--danger-color);
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    margin: 0 3px;
    background-color: transparent;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.btn-view {
    color: var(--accent-color);
}

.btn-view:hover {
    background-color: rgba(76, 201, 240, 0.1);
}

.btn-edit {
    color: var(--primary-color);
}

.btn-edit:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.btn-delete {
    color: var(--danger-color);
}

.btn-delete:hover {
    background-color: rgba(251, 86, 7, 0.1);
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 15px 15px 0 0;
    padding: 20px 25px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    background-color: var(--white);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: var(--white);
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
}

/* Footer */
.footer {
    background-color: var(--white);
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    margin-left: 260px;
    transition: all 0.3s ease;
}

.footer.expanded {
    margin-left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        left: -260px;
    }

    .sidebar.active {
        left: 0;
    }

    .header, .main-content, .footer {
        margin-left: 0;
        left: 0;
    }

    .search-bar {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        gap: 10px;
    }

    .user-profile span {
        display: none;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card, .content-card {
    animation: fadeInUp 0.5s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Button Group Styles */
.btn-group .btn {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-group .btn:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.btn-group .btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Pagination Styles */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

/* List Group */
.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.list-group-item:first-child {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.list-group-item:last-child {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    border-bottom: none;
}

.list-group-item-action:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

/* Deadline List */
.deadline-list .bg-danger {
    background-color: var(--danger-color) !important;
}

.deadline-list .bg-warning {
    background-color: var(--warning-color) !important;
}

.deadline-list .bg-info {
    background-color: var(--accent-color) !important;
}