:root {
    /* Color Palette */
    --primary: #4e73df;
    --primary-dark: #224abe;
    --secondary: #858796;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --light: #f8f9fc;
    --dark: #5a5c69;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--light);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--primary) 10%, var(--primary-dark) 100%);
    color: white;
    min-height: 100vh;
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    font-size: 1.25rem;
    user-select: none;
}

.sidebar-menu {
    flex-grow: 1;
    padding: 1rem 0;
}

.sidebar-menu a {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.sidebar-menu i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-x: hidden;
    background-color: var(--light);
}

/* Top Navbar */
.top-navbar {
    background-color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem rgba(58, 59, 69, 0.15);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h1 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--dark);
    font-weight: 700;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    user-select: none;
}

/* Cards */
.card {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem rgba(58, 59, 69, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background-color: var(--light);
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem 1.5rem;
    font-weight: 700;
    color: var(--dark);
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    border-left: 0.25rem solid;
    padding: 1rem 1.25rem;
    border-radius: 0.25rem;
    background-color: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 0.1rem 0.5rem rgba(0,0,0,0.05);
}

.stat-card.primary { border-left-color: var(--primary); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger  { border-left-color: var(--danger); }

.stat-title {
    font-size: 0.75rem;
    color: var(--secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
    color: var(--dark);
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-top: 1px solid #e3e6f0;
}

.table th {
    background-color: var(--light);
    font-weight: 700;
    text-align: left;
}

.table tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.1);
}

/* Buttons */
.btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover {
    background-color: #17a673;
    border-color: #17a673;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background-color: #c9372c;
    border-color: #c9372c;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #6e707e;
    background-color: #fff;
    border: 1px solid #d1d3e2;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    outline-offset: 2px;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
    color: #6e707e;
    background-color: #fff;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        overflow: hidden;
    }
    
    .sidebar-header h3,
    .sidebar-menu span {
        display: none;
    }
    
    .sidebar-menu i {
        margin-right: 0;
        font-size: 1.3rem;
    }
    
    .sidebar-menu a {
        text-align: center;
        padding: 1rem 0;
        font-size: 1.1rem;
    }
    
    .main-content {
        padding: 1rem 1rem;
    }

    .page-title h1 {
        font-size: 1.25rem;
    }
}
