:root {
    --primary-color: #6A5ACD; /* SlateBlue */
    --secondary-color: #9370DB; /* MediumPurple */
    --accent-color: #E6E6FA; /* Lavender */
    --dark-color: #4B0082; /* Indigo */
    --light-bg: #F8F9FD;
    --sidebar-width: 260px;
    --header-height: 70px;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    overflow-x: hidden;
}

/* Avatar Placeholder */
.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: bold;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, var(--dark-color) 0%, var(--primary-color) 100%);
    color: #fff;
    transition: var(--transition-speed);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}

.sidebar-menu {
    padding: 20px 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition-speed);
    font-weight: 500;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-left: 4px solid var(--accent-color);
}

.sidebar-menu i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    transition: var(--transition-speed);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    height: var(--header-height);
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.toggle-sidebar {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s;
    border: none;
    height: 100%;
    position: relative;
    overflow: hidden;
}

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

.stat-card .icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.stat-card.purple .icon-box { background: rgba(147, 112, 219, 0.1); color: var(--secondary-color); }
.stat-card.blue .icon-box { background: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.stat-card.green .icon-box { background: rgba(25, 135, 84, 0.1); color: #198754; }
.stat-card.orange .icon-box { background: rgba(253, 126, 20, 0.1); color: #fd7e14; }

.stat-card h3 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.stat-card p {
    color: #777;
    margin: 0;
    font-size: 0.9rem;
}

/* Enhanced Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(106, 90, 205, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 90, 205, 0.4);
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Enhanced Tabs */
.nav-tabs {
    border-bottom: 1px solid #dee2e6;
}
.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
    padding: 1rem 0.5rem;
    margin-right: 1.5rem;
}
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}
.tab-content {
    padding-top: 1.5rem;
}


/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    .sidebar.active {
        margin-left: 0;
    }
    .main-content {
        margin-left: 0;
    }
    .main-content.active {
        margin-left: var(--sidebar-width); /* Push content on mobile if desired, or overlay */
    }
}

/* Desktop Toggle Behavior */
@media (min-width: 769px) {
    .sidebar.active {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    .main-content.active {
        margin-left: 0;
    }
}
