/* === Admin Layout === */
.admin-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 70px;
}

/* === Sidebar === */
.admin-sidebar {
    width: 280px;
    background: var(--dark);
    color: var(--white);
    position: fixed;
    top: 70px;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    border-right: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.sidebar-link.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    border-right-color: var(--primary-light);
}

.sidebar-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .btn {
    width: 100%;
}

/* === Admin Main Content === */
.admin-main {
    flex: 1;
    margin-right: 280px;
    background: var(--bg);
}

.admin-header {
    background: var(--white);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 70px;
    z-index: 50;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-avatar {
    width: 45px;
    height: 45px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.admin-content {
    padding: 2rem;
}

.admin-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* === Admin Cards === */
.admin-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.admin-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* === Admin Toolbar === */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-toolbar .form-input {
    max-width: 300px;
}

/* === Admin Table === */
.admin-table-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem 1.5rem;
    text-align: right;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-table th {
    background: var(--bg);
    font-weight: 700;
    color: var(--dark);
}

.admin-table tr:hover {
    background: rgba(99, 102, 241, 0.02);
}

.admin-table .text-center {
    text-align: center;
}

/* === Courses Grid === */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.admin-course-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.admin-course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.course-thumb {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--primary);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem;
}

.course-info {
    padding: 1.5rem;
}

.course-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.course-info p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.course-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success {
    background: var(--success);
    color: var(--white);
}

.badge-warning {
    background: var(--accent);
    color: var(--white);
}

.badge-danger {
    background: var(--error);
    color: var(--white);
}

/* === Button Danger === */
.btn-danger {
    background: var(--error);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

/* === Recent List === */
.recent-list {
    margin-bottom: 1rem;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.recent-item:last-child {
    border-bottom: none;
}

/* === Modal Actions === */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* === Settings === */
.settings-form {
    max-width: 600px;
}

.settings-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    margin-bottom: 1.5rem;
    color: var(--dark);
}

/* === Coming Soon === */
.coming-soon {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.coming-soon .empty-state-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

/* === Dashboard Tabs === */
.dashboard-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* === Text Utilities === */
.text-muted {
    color: var(--text-light);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 80px;
    }

    .admin-sidebar .sidebar-header h2,
    .admin-sidebar .sidebar-link span:last-child,
    .admin-sidebar .sidebar-footer {
        display: none;
    }

    .admin-sidebar .sidebar-header {
        padding: 1rem;
    }

    .admin-sidebar .sidebar-link {
        padding: 1rem;
        justify-content: center;
    }

    .admin-main {
        margin-right: 80px;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        position: relative;
        width: 100%;
        top: 0;
        flex-direction: row;
        overflow-x: auto;
    }

    .admin-sidebar .sidebar-header {
        display: none;
    }

    .admin-sidebar .sidebar-nav {
        display: flex;
        padding: 0;
    }

    .admin-sidebar .sidebar-link {
        flex-direction: column;
        font-size: 0.75rem;
        padding: 0.75rem 1rem;
        gap: 0.25rem;
    }

    .admin-sidebar .sidebar-link span:last-child {
        display: block;
    }

    .admin-sidebar .sidebar-footer {
        display: none;
    }

    .admin-main {
        margin-right: 0;
    }

    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}