:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #ec4899;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #4361ee;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background-color: #f1f5f9;
    color: var(--dark-color);
    overflow-x: hidden;
}

/* Wrapper */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
#sidebar-wrapper {
    min-width: 260px;
    max-width: 260px;
    background: var(--sidebar-bg);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

#sidebar-wrapper.toggled {
    margin-left: -260px;
}

.sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.list-group-item {
    padding: 1rem 1.5rem;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.list-group-item:hover {
    color: white;
    background-color: var(--sidebar-hover);
    border-left-color: var(--primary-color);
    padding-left: 1.75rem;
}

.list-group-item.active {
    color: white;
    background-color: var(--sidebar-hover);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.list-group-item i {
    width: 20px;
    margin-right: 10px;
}

/* Submenu */
.list-group-item.dropdown-toggle::after {
    float: right;
    margin-top: 5px;
}

.collapse .list-group-item {
    padding-left: 3rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.collapse .list-group-item:hover {
    color: white;
    padding-left: 3.25rem;
}

/* Page Content */
#page-content-wrapper {
    width: 100%;
    margin-left: 260px;
    transition: all 0.3s ease;
}

#sidebar-wrapper.toggled~#page-content-wrapper {
    margin-left: 0;
}

/* Navbar */
.navbar {
    background: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 1rem 1.5rem;
}

.navbar .btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
}

.navbar .btn-primary:hover {
    background: var(--secondary-color);
}

.nav-link {
    color: var(--dark-color) !important;
    font-weight: 500;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

/* Gradient Cards */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.stat-card-icon {
    opacity: 0.3;
}

/* Tables */
.table {
    color: var(--dark-color);
}

.table thead th {
    border-top: none;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #64748b;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid #e2e8f0;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-circle {
    width: 35px;
    height: 35px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: -260px;
    }

    #sidebar-wrapper.toggled {
        margin-left: 0;
    }

    #page-content-wrapper {
        margin-left: 0;
        width: 100%;
    }

    #sidebar-wrapper.toggled~#page-content-wrapper {
        margin-left: 0;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .stat-card-icon {
        display: none;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .sidebar-heading {
        font-size: 1.1rem;
        padding: 1rem;
    }

    .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    h1.h2 {
        font-size: 1.5rem;
    }

    .card .h2 {
        font-size: 1.5rem;
    }
}

/* Scrollbar */
#sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

#sidebar-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Logout button */
.list-group-item.text-danger {
    color: #ef4444 !important;
    margin-top: auto;
}

.list-group-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
}