:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --dark: #2b2d42;
    --light: #f8f9fa;
    --gray: #8d99ae;
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-radius: 12px;
    --transition: 0.3s ease;
    
    font-family: 'Outfit', 'Abhaya Libre', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--dark);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, var(--dark), #1a1b26);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.logo-container {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-icon {
    color: var(--success);
    margin-bottom: 10px;
}

.logo-container h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    font-family: 'Abhaya Libre', serif;
}

.logo-container small {
    color: var(--gray);
    font-size: 0.8rem;
}

.nav-links {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.nav-item i {
    width: 25px;
    font-size: 1.1rem;
    margin-right: 15px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--success);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Topbar */
.topbar {
    height: 70px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 5;
}

.top-search {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    padding: 10px 20px;
    border-radius: 30px;
    width: 300px;
}

.top-search i {
    color: var(--gray);
    margin-right: 10px;
}

.top-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: 'Outfit';
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Pages Container */
.pages-container {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 25px;
    font-weight: 600;
}

/* Cards & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-right: 20px;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-info h2 {
    font-size: 1.8rem;
    color: var(--dark);
}

.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 20px;
}

.modern-input {
    padding: 12px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
    width: 100%;
}

.modern-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #d90429;
    transform: translateY(-2px);
}

.warning-card {
    border-left: 5px solid var(--danger);
}


@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-y: auto;
    }
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 0;
    }
    .logo-container {
        width: 100%;
        padding: 10px;
        border-bottom: none;
    }
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        overflow: visible;
        padding: 5px 0;
    }
    .nav-item {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    .main-content {
        overflow-y: visible;
    }
    .topbar {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }
    .top-search {
        width: 100%;
    }
    .pages-container {
        padding: 15px;
        overflow-y: visible;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .table-responsive {
        overflow-x: auto;
        display: block;
    }
    table {
        min-width: 800px;
    }
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group .modern-input, .filter-group .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .card { padding: 15px; }
    .btn { width: 100%; justify-content: center; margin-bottom: 5px; }
    .topbar { padding: 10px; }
    .user-profile { justify-content: space-between; width: 100%; }
    .header-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch !important;
    }
    .header-controls .btn { width: 100%; }
}
