/* ─── EduNexus — Global Styles ─────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap");
@import "@fortawesome/fontawesome-free/css/all.min.css";
:root {
    --primary: #890c25;
    --primary-dark: #6b0a1e;
    --primary-light: #a01030;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --purple: #8b5cf6;
    --accent: #06b6d4;
    --bg: #f0f2f5;
    --sidebar-bg: #1a1d29;
    --sidebar-text: #a0aec0;
    --sidebar-active: #fff;
    --sidebar-hover: #2d3148;
    --card: #fff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.12);
    --sidebar-width: 260px;
}
[data-theme="dark"] {
    --bg: #0f1117;
    --card: #1a1d29;
    --border: #2d3148;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --sidebar-bg: #0d0f18;
    --sidebar-hover: #1a1d29;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: "Outfit", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
}
a {
    color: inherit;
    text-decoration: none;
}

/* ── Layout ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: 0.3s;
}
.main-wrap {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.topbar {
    height: 64px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}
.page-content {
    padding: 28px;
    flex: 1;
}

/* ── Sidebar ── */
.sidebar-logo {
    padding: 20px 20px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 16px;
}
.sidebar-logo .logo-text {
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    line-height: 1.1;
}
.sidebar-logo .logo-sub {
    color: var(--sidebar-text);
    font-size: 11px;
}
.sidebar-user {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}
.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.sidebar-user-name {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}
.sidebar-user-role {
    color: var(--sidebar-text);
    font-size: 11px;
    text-transform: capitalize;
}
.sidebar-section {
    padding: 16px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--sidebar-text);
    transition: 0.15s;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
}
.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
}
.sidebar-nav a .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 13px;
}
.sidebar-nav a .badge-count {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 700;
}
.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 8px 20px;
}
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: auto;
}
.role-badge.admin {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}
.role-badge.teacher {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.role-badge.student {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}
.role-badge.parent {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* ── Topbar ── */
.topbar-search {
    flex: 1;
    max-width: 340px;
}
.topbar-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    outline: none;
    font-family: inherit;
}
.topbar-search {
    position: relative;
}
.topbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.topbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    transition: 0.15s;
}
.topbar-btn:hover {
    background: var(--bg);
    color: var(--text);
}
.topbar-btn .dot {
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    position: absolute;
    top: 6px;
    right: 6px;
    border: 1.5px solid var(--card);
}
.topbar-page {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

/* ── Cards & Stats ── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.card-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.card-title {
    font-weight: 700;
    font-size: 15px;
}
.card-body {
    padding: 20px;
}
.grid {
    display: grid;
    gap: 20px;
}
.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-icon.red {
    background: rgba(137, 12, 37, 0.1);
    color: var(--primary);
}
.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}
.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}
.stat-icon.yellow {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}
.stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple);
}
.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
}
.stat-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}
.stat-change {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 600;
}
.stat-change.up {
    color: var(--success);
}
.stat-change.down {
    color: var(--danger);
}

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background: rgba(0, 0, 0, 0.015);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.badge.success,
.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}
.badge.danger,
.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.badge.warning,
.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}
.badge.primary,
.badge-primary {
    background: rgba(137, 12, 37, 0.1);
    color: var(--primary);
}
.badge.info,
.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}
.badge.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple);
}
.badge.gray {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
}
.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover {
    filter: brightness(0.9);
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    filter: brightness(0.9);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}
.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}
.btn-xs {
    padding: 3px 9px;
    font-size: 11px;
}
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: 0.15s;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(137, 12, 37, 0.08);
}
textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

/* ── Progress bars ── */
.progress {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.progress-bar.primary {
    background: var(--primary);
}
.progress-bar.success {
    background: var(--success);
}
.progress-bar.warning {
    background: var(--warning);
}
.progress-bar.info {
    background: var(--info);
}

/* ── LMS specific ── */
.course-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: 0.2s;
    box-shadow: var(--shadow);
}
.course-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.course-thumb {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
}
.course-thumb.math {
    background: linear-gradient(135deg, #890c25, #c01535);
}
.course-thumb.eng {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}
.course-thumb.sci {
    background: linear-gradient(135deg, #059669, #10b981);
}
.course-thumb.cs {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}
.course-thumb.default {
    background: linear-gradient(135deg, #475569, #64748b);
}
.course-meta {
    padding: 16px;
}
.course-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}
.course-desc {
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lesson-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    transition: 0.15s;
    cursor: pointer;
}
.lesson-item:last-child {
    border-bottom: none;
}
.lesson-item:hover {
    background: rgba(137, 12, 37, 0.03);
}
.lesson-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}
.lesson-num.done {
    background: var(--success);
    color: #fff;
}
.lesson-info {
    flex: 1;
}
.lesson-title {
    font-weight: 600;
    font-size: 13.5px;
}
.lesson-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.lesson-content {
    line-height: 1.7;
    font-size: 14.5px;
}
.lesson-content h1,
.lesson-content h2,
.lesson-content h3 {
    margin: 16px 0 8px;
    font-weight: 700;
}
.lesson-content p {
    margin-bottom: 12px;
}
.lesson-content ul,
.lesson-content ol {
    margin: 0 0 12px 20px;
}
.lesson-content li {
    margin-bottom: 4px;
}

/* ── Quiz ── */
.quiz-question {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}
.quiz-qnum {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.quiz-qtext {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
}
.quiz-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: 0.15s;
    font-size: 13.5px;
}
.quiz-options label:hover {
    border-color: var(--primary);
    background: rgba(137, 12, 37, 0.03);
}
.quiz-options input:checked + span {
    font-weight: 600;
    color: var(--primary);
}

/* ── Welcome banner ── */
.welcome-banner {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        #c01535 50%,
        #6b0a1e 100%
    );
    border-radius: var(--radius);
    padding: 28px 32px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}
.welcome-banner::before {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}
.welcome-banner::after {
    content: "";
    position: absolute;
    right: 80px;
    bottom: -60px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #065f46;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #991b1b;
}
.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #92400e;
}
.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #1e40af;
}

/* ── Timeline ── */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    margin-bottom: 16px;
}
.timeline-dot {
    position: absolute;
    left: -23px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--card);
}
.timeline-dot.success {
    background: var(--success);
}
.timeline-dot.primary {
    background: var(--primary);
}
.timeline-dot.warning {
    background: var(--warning);
}
.timeline-dot.purple {
    background: var(--purple);
}
.timeline-text {
    font-size: 13px;
    color: var(--text);
}
.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Misc ── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 44px;
    opacity: 0.25;
    margin-bottom: 14px;
    display: block;
}
.empty-state p {
    font-size: 14px;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 22px;
    font-weight: 800;
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}
.tab-bar {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    gap: 4px;
}
.tab-btn {
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: 0.15s;
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}
.text-muted {
    color: var(--text-muted);
}
.text-sm {
    font-size: 12.5px;
}
.fw-bold {
    font-weight: 700;
}
.mt-1 {
    margin-top: 4px;
}
.mt-2 {
    margin-top: 8px;
}
.mt-3 {
    margin-top: 12px;
}
.mt-4 {
    margin-top: 16px;
}
.mb-1 {
    margin-bottom: 4px;
}
.mb-2 {
    margin-bottom: 8px;
}
.mb-3 {
    margin-bottom: 12px;
}
.mb-4 {
    margin-bottom: 16px;
}
.flex {
    display: flex;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-2 {
    gap: 8px;
}
.gap-3 {
    gap: 12px;
}
.gap-4 {
    gap: 16px;
}
.flex-wrap {
    flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrap {
        margin-left: 0;
    }
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    .page-content {
        padding: 16px;
    }
}
