@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --topbar-height: 60px;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-50: #eff6ff;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0891b2;
    --info-light: #cffafe;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --orange: #ea580c;
    --orange-light: #ffedd5;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* LAYOUT */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--sidebar-active), #7c3aed);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    font-family: 'Poppins', sans-serif;
}

.sidebar-brand .brand-text small {
    display: block;
    font-size: .65rem;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: .5px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-label {
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    padding: 16px 12px 6px;
    opacity: .6;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all .2s;
    font-size: .875rem;
    font-weight: 500;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,.4);
}

.sidebar-user {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sidebar-active);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-info .name {
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info .role {
    color: var(--text-light);
    font-size: .7rem;
    text-transform: capitalize;
}

.sidebar-user .logout-link {
    color: var(--text-light);
    font-size: 1.1rem;
    transition: color .2s;
}

.sidebar-user .logout-link:hover {
    color: var(--danger);
}

/* TOPBAR */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1030;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background .2s;
}

.topbar-toggle:hover {
    background: var(--bg);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    padding: 4px 12px 4px 4px;
    border-radius: 50px;
    transition: background .2s;
    cursor: pointer;
}

.topbar-user:hover {
    background: var(--bg);
}

.topbar-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: .8rem;
}

.topbar-user .name {
    font-size: .85rem;
    font-weight: 500;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    padding: 16px 24px;
}

/* SIDEBAR OVERLAY (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1035;
}

/* CARDS */
.card {
    border: none;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    transition: box-shadow .2s, transform .2s;
}

.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-body {
    padding: 20px;
}

/* PAGE TITLES */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.card-header i {
    font-size: 1rem;
    margin-right: 6px;
}

/* OLD STAT CARDS (kept for non-dashboard pages) */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 12px;
}

.stat-card .stat-label {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-footer {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ============================
   DASHBOARD
   ============================ */

/* HERO BANNER */
.dash-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2563eb 100%);
    border-radius: var(--radius);
    padding: 36px 40px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.dash-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
    border-radius: 50%;
}

.dash-hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(124,58,237,.1) 0%, transparent 70%);
    border-radius: 50%;
}

.dash-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-hero-text h1 {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Poppins', sans-serif;
}

.dash-hero-date {
    color: rgba(255,255,255,.6);
    font-size: .875rem;
    margin-bottom: 8px;
}

.dash-hero-date i {
    margin-right: 4px;
}

.dash-hero-summary {
    color: rgba(255,255,255,.8);
    font-size: .9rem;
    margin: 0;
    max-width: 500px;
}

.dash-hero-badge {
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50px;
    padding: 10px 20px;
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dash-hero-badge i {
    font-size: 1.1rem;
}

/* DASHBOARD STAT CARDS */
.dash-stat-card {
    border-radius: 16px;
    padding: 28px 24px;
    transition: transform .25s, box-shadow .25s;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    min-height: 160px;
    border: none;
}

.dash-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0,0,0,.15);
    color: inherit;
}

/* Colored backgrounds — full card */
.dash-stat-card.bg-card-blue {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    color: #fff;
}

.dash-stat-card.bg-card-green {
    background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
    color: #fff;
}

.dash-stat-card.bg-card-orange {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
    color: #fff;
}

.dash-stat-card.bg-card-purple {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
    color: #fff;
}

.dash-stat-card.bg-card-amber {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    color: #fff;
}

/* Decorative circle on background */
.dash-stat-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
}

.dash-stat-card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: 40px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}

/* Card layout: info left, icon right */
.dash-stat-card .dash-stat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dash-stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-stat-label {
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: .9;
}

.dash-stat-value {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    font-family: 'Poppins', sans-serif;
}

.dash-stat-card .dash-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.dash-stat-footer {
    font-size: .8rem;
    opacity: .85;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.2);
}

.dash-stat-link {
    color: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dash-stat-link i {
    transition: transform .2s;
}

a.dash-stat-card:hover .dash-stat-link i {
    transform: translateX(4px);
}

/* DASHBOARD CONTENT CARDS */
.dash-content-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.dash-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.dash-content-header h5 {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-content-header h5 i {
    color: var(--primary);
    font-size: 1rem;
}

.dash-content-body {
    padding: 8px 0;
}

/* Task Items */
.dash-task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    transition: background .15s;
}

.dash-task-item:hover {
    background: var(--primary-50);
}

.dash-task-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-vencida  { background: var(--danger); box-shadow: 0 0 6px rgba(220,38,38,.4); }
.dot-urgente  { background: var(--warning); box-shadow: 0 0 6px rgba(217,119,6,.4); }
.dot-proximo  { background: var(--info); }
.dot-normal   { background: var(--success); }

.dash-task-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-task-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-task-meta {
    font-size: .75rem;
    color: var(--text-muted);
}

.dash-task-meta i {
    margin-right: 3px;
}

.dash-task-time {
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-vencida  { color: var(--danger); }
.time-urgente  { color: var(--warning); }
.time-proximo  { color: var(--info); }
.time-normal   { color: var(--success); }

/* Session Items */
.dash-session-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    transition: background .15s;
}

.dash-session-item:hover {
    background: var(--primary-50);
}

.dash-session-day {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-day-name {
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.dash-session-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-session-course {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-session-time {
    font-size: .75rem;
    color: var(--text-muted);
}

.dash-session-time i {
    margin-right: 3px;
}

.dash-session-join {
    white-space: nowrap;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 8px;
}

/* SESSIONS GROUPED BY DAY */
.dash-session-day-group {
    border-bottom: 1px solid var(--border);
}

.dash-session-day-group:last-child {
    border-bottom: none;
}

.dash-session-day-header {
    padding: 10px 24px 4px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-session-day-header i {
    font-size: .85rem;
}

.dash-sessions-grouped .dash-session-item {
    padding: 10px 24px 10px 36px;
}

.dash-sessions-grouped .dash-session-item:last-child {
    padding-bottom: 14px;
}

/* DASHBOARD PERIOD FILTERS */
.dash-filters {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 24px;
    box-shadow: var(--shadow);
}

.dash-filters-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dash-filters-label {
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-filters-label i {
    color: var(--primary);
}

.dash-filters-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-filter-btn {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    transition: all .2s;
    font-family: var(--font);
}

.dash-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), .05);
}

.dash-filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* QUICK ACTIONS */
.dash-quick-actions {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
}

.dash-quick-actions h5 {
    margin: 0 0 12px;
    font-size: .95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-quick-actions h5 i {
    color: var(--warning);
    font-size: 1rem;
}

.dash-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    text-decoration: none;
    transition: all .2s;
}

.dash-quick-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

.dash-quick-btn i {
    font-size: 1rem;
}

/* DASHBOARD RESPONSIVE */
@media (max-width: 992px) {
    .dash-hero {
        padding: 28px 24px;
    }

    .dash-hero-text h1 {
        font-size: 1.4rem;
    }

    .dash-hero-badge {
        display: none;
    }

    .dash-stat-value {
        font-size: 2.2rem;
    }
}

@media (max-width: 576px) {
    .dash-hero {
        padding: 20px 16px;
        border-radius: var(--radius-sm);
    }

    .dash-hero-text h1 {
        font-size: 1.2rem;
    }

    .dash-hero-summary {
        font-size: .8rem;
    }

    .dash-stat-card {
        padding: 20px 16px;
        min-height: 140px;
    }

    .dash-stat-value {
        font-size: 1.8rem;
    }

    .dash-stat-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.3rem !important;
    }

    .dash-content-header {
        padding: 14px 16px;
    }

    .dash-task-item,
    .dash-session-item {
        padding: 12px 16px;
    }

    .dash-quick-actions {
        padding: 16px;
    }
}

/* ============================
   COURSE CARDS (Mis Cursos)
   ============================ */
.course-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 220px;
    transition: transform .25s, box-shadow .25s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

/* Colored top strip */
.course-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    color: #fff;
}

.course-card-blue .course-card-top   { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.course-card-green .course-card-top  { background: linear-gradient(135deg, #059669, #047857); }
.course-card-purple .course-card-top { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.course-card-orange .course-card-top { background: linear-gradient(135deg, #ea580c, #c2410c); }
.course-card-amber .course-card-top  { background: linear-gradient(135deg, #d97706, #b45309); }

.course-card-code {
    background: rgba(255,255,255,.25);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .3px;
}

.course-card-top i {
    font-size: 1.2rem;
    opacity: .8;
}

/* Content area */
.course-card-body {
    padding: 0 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.course-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--text);
}

.course-card-desc {
    font-size: .82rem;
    color: var(--text-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.course-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.course-card-meta i {
    margin-right: 3px;
    width: 13px;
    text-align: center;
    color: var(--primary);
}

.course-card-footer {
    padding: 12px 22px;
    border-top: 1px solid var(--border);
}

.course-card-link {
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.course-card-link i {
    transition: transform .2s;
}

.course-card:hover .course-card-link i {
    transform: translateX(4px);
}

@media (max-width: 576px) {
    .course-card-name {
        font-size: .95rem;
    }
}

/* old bg-gradient colors for stat icons */
.stat-icon.bg-blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.stat-icon.bg-green {
    background: linear-gradient(135deg, #059669, #047857);
}
.stat-icon.bg-orange {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}
.stat-icon.bg-purple {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}
.bg-amber {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
}
.stat-icon.bg-teal {
    background: linear-gradient(135deg, #0d9488, #0f766e);
}
.stat-icon.bg-red {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* TABLES */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
    background: var(--bg);
    font-family: 'Poppins', sans-serif;
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
}

.table-hover tbody tr:hover {
    background: var(--primary-50);
}

.table-responsive {
    border-radius: 0 0 var(--radius) var(--radius);
}

/* BADGES */
.badge {
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: .72rem;
    font-family: 'Poppins', sans-serif;
}

.badge.bg-primary { background: var(--primary) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-warning { background: var(--warning) !important; }
.badge.bg-danger { background: var(--danger) !important; }
.badge.bg-info { background: var(--info) !important; }
.badge.bg-secondary { background: var(--text-muted) !important; }
.badge.bg-purple { background: var(--purple) !important; }

/* BUTTONS */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: .85rem;
    padding: 8px 16px;
    transition: all .2s;
    font-family: 'Poppins', sans-serif;
}

.btn-sm {
    padding: 4px 10px;
    font-size: .78rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

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

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-outline-warning:hover,
.btn-outline-danger:hover,
.btn-outline-success:hover,
.btn-outline-info:hover {
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220,38,38,.3);
}

/* FORMS */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    padding: 10px 14px;
    font-size: .875rem;
    transition: border-color .2s, box-shadow .2s;
    font-family: 'Poppins', sans-serif;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-label {
    font-weight: 600;
    font-size: .82rem;
    color: var(--text);
    margin-bottom: 4px;
}

/* NAV TABS */
.nav-tabs {
    border-bottom: 2px solid var(--border);
    gap: 4px;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: .85rem;
    padding: 10px 18px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all .2s;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--text);
    background: var(--bg);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    border-bottom: 2px solid var(--primary);
    font-weight: 600;
}

/* DROPDOWN */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
    padding: 6px;
}

.dropdown-item {
    border-radius: 6px;
    padding: 8px 14px;
    font-size: .85rem;
    transition: background .15s;
}

.dropdown-item:hover {
    background: var(--bg);
}

.dropdown-item.text-danger:hover {
    background: var(--danger-light);
}

/* ALERTS */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    font-size: .875rem;
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
}

/* SECTION TITLES */
h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

h5 i {
    font-size: 1rem;
    color: var(--primary);
}

/* AUTH PAGES */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2563eb 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,.03) 0%, transparent 70%);
    animation: authGlow 10s ease-in-out infinite alternate;
}

@keyframes authGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, -5%) rotate(5deg); }
}

.auth-card {
    background: rgba(255,255,255,.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,.25);
    overflow: hidden;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.auth-card-header {
    padding: 32px 32px 0;
    text-align: center;
}

.auth-card-header .auth-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(37,99,235,.3);
}

.auth-card-header h3 {
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 4px;
    font-family: 'Poppins', sans-serif;
}

.auth-card-header p {
    color: var(--text-muted);
    font-size: .875rem;
}

.auth-card-body {
    padding: 24px 32px 32px;
}

.auth-card-body .btn-primary {
    padding: 12px;
    font-weight: 600;
}

.auth-footer-link {
    text-align: center;
    margin-top: 16px;
}

.auth-footer-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* PROFILE PAGE */
.profile-header {
    background: linear-gradient(135deg, var(--sidebar-bg), #1e3a5f);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    color: #fff;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 16px;
    border: 4px solid rgba(255,255,255,.2);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.profile-header h4 {
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-header .badge {
    font-size: .8rem;
    padding: 6px 16px;
}

/* LANDING PAGE */
.landing-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2563eb 100%);
    position: relative;
    overflow: hidden;
}

.landing-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,.1) 0%, transparent 70%);
    top: -200px;
    right: -200px;
}

.landing-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124,58,237,.08) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
}

.landing-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
}

.landing-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    margin: 0 auto 24px;
    box-shadow: 0 12px 32px rgba(37,99,235,.35);
}

.landing-content h1 {
    color: #fff;
    font-weight: 800;
    font-size: 2.8rem;
    margin-bottom: 12px;
    font-family: 'Poppins', sans-serif;
}

.landing-content .lead {
    color: rgba(255,255,255,.7);
    font-size: 1.1rem;
    max-width: 480px;
    margin: 0 auto 32px;
}

.landing-content .btn-lg {
    padding: 14px 32px;
    font-weight: 600;
    border-radius: 12px;
    font-size: 1rem;
}

.landing-content .btn-primary {
    background: #fff;
    color: var(--primary);
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.landing-content .btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.landing-content .btn-outline-light:hover {
    transform: translateY(-2px);
}

/* PROGRESS */
.progress {
    height: 8px;
    border-radius: 50px;
    background: var(--border);
}

.progress-bar {
    border-radius: 50px;
}

/* LIST GROUP */
.list-group-item {
    border-color: var(--border);
    padding: 12px 16px;
    font-size: .875rem;
}

.list-group-item:first-child {
    border-top-left-radius: var(--radius-sm);
    border-top-right-radius: var(--radius-sm);
}

.list-group-item:last-child {
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn .5s ease forwards;
}

.fade-in-delay-1 { animation-delay: .1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: .2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: .3s; opacity: 0; }
.fade-in-delay-4 { animation-delay: .4s; opacity: 0; }

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-toggle {
        display: block;
    }

    .page-content {
        padding: 16px;
    }

    .topbar-user .name {
        display: none;
    }

    .landing-content h1 {
        font-size: 2rem;
    }

    .profile-header {
        padding: 24px;
    }

    .auth-card {
        margin: 16px;
    }

    .auth-card-body {
        padding: 20px 24px 24px;
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 12px;
    }

    .card-header {
        padding: 12px 16px;
    }

    .card-body {
        padding: 16px;
    }

    .auth-card-header {
        padding: 24px 20px 0;
    }

    .landing-content h1 {
        font-size: 1.6rem;
    }
}

/* ===== Chat Panel ===== */
.topbar-msg-btn {
    position: relative;
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.topbar-msg-btn:hover {
    background: #f1f5f9;
    color: #3b82f6;
}
.chat-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

.chat-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1040;
}
.chat-overlay.show {
    display: block;
}

.chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-panel.open {
    transform: translateX(0);
}

.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.chat-panel-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: #1e293b;
}
.chat-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.chat-close-btn:hover {
    background: #f1f5f9;
    color: #ef4444;
}

/* Contactos */
.chat-contacts {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 16px 8px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 10px;
}
.chat-search-box i {
    color: #94a3b8;
    font-size: 0.85rem;
}
.chat-search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.85rem;
    width: 100%;
    color: #1e293b;
}
.chat-contacts-list {
    flex: 1;
    overflow-y: auto;
}
.chat-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}
.chat-contact-item:hover {
    background: #f8fafc;
}
.chat-contact-item.active {
    background: #eff6ff;
}
.chat-contact-info {
    flex: 1;
    min-width: 0;
}
.chat-contact-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-contact-preview {
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.chat-contact-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.chat-contact-time {
    font-size: 0.7rem;
    color: #94a3b8;
}
.chat-contact-badge {
    background: #3b82f6;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 5px;
}

.chat-empty {
    text-align: center;
    color: #94a3b8;
    padding: 60px 20px;
    font-size: .85rem;
}

.chat-empty i {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: block;
}

.chat-empty strong {
    display: block;
    color: #64748b;
    font-size: .95rem;
    margin-bottom: 4px;
}

.chat-loading {
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
    font-size: .85rem;
}

/* Conversación */
.chat-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-conv-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.chat-back-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 1.1rem;
    padding: 4px;
    cursor: pointer;
}
.chat-conv-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-conv-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
}
.chat-conv-role {
    font-size: 0.75rem;
    color: #94a3b8;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}
.chat-message.sent {
    align-self: flex-end;
    align-items: flex-end;
}
.chat-message.received {
    align-self: flex-start;
    align-items: flex-start;
}
.chat-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
}
.chat-message.sent .chat-bubble {
    background: #e2e8f0;
    color: #1e293b;
    border-bottom-right-radius: 4px;
}
.chat-message.received .chat-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}
.chat-msg-time {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 3px;
    padding: 0 4px;
}

.chat-input-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.chat-input-box input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input-box input:focus {
    border-color: #3b82f6;
}
.chat-send-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.chat-send-btn:hover {
    background: #2563eb;
}

/* Chat attachment */
.chat-attach-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    padding: 6px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}
.chat-attach-btn:hover {
    color: #3b82f6;
    background: #f1f5f9;
}
.chat-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.chat-file-preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #475569;
    overflow: hidden;
}
.chat-file-preview-info i {
    font-size: 1rem;
    color: #3b82f6;
}
.chat-file-preview-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-file-remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}
.chat-file-remove:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Chat images and file links in bubbles */
.chat-img {
    max-width: 240px;
    max-height: 240px;
    border-radius: 12px;
    cursor: pointer;
    display: block;
    margin-bottom: 4px;
    object-fit: cover;
    border: none;
    outline: none;
}
.chat-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    font-size: 0.82rem;
    margin-bottom: 4px;
    word-break: break-all;
}
.chat-message.received .chat-file-link {
    background: rgba(0,0,0,0.05);
    color: #1e293b;
}
.chat-message.sent .chat-file-link {
    color: #1e293b;
    background: rgba(0,0,0,0.06);
}
.chat-file-link:hover {
    text-decoration: underline;
}
.chat-file-link i {
    font-size: 1.1rem;
}

/* Chat Lightbox */
.chat-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.chat-lightbox.show {
    display: flex;
}
.chat-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
}
.chat-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.chat-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Avatar-sm para contactos y conversación */
.avatar.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ============================
   TASK REVIEW / GRADING
   ============================ */

/* Two-column layout */
.task-review-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    min-height: 70vh;
}

/* LEFT PANEL — Student list */
.task-students-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.task-students-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.task-students-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: .9rem;
    color: var(--text);
}

.task-students-stats {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.task-stat-mini {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.task-stat-num {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.task-stat-text {
    display: block;
    font-size: .65rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
}

.stat-delivered .task-stat-num { color: var(--warning); }
.stat-graded .task-stat-num   { color: var(--success); }
.stat-pending .task-stat-num  { color: var(--text-muted); }

.task-students-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 12px 0;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.task-students-search i {
    color: var(--text-light);
    font-size: .85rem;
}

.task-students-search input {
    border: none;
    background: none;
    outline: none;
    font-size: .85rem;
    width: 100%;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
}

.task-students-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.task-student-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text);
    transition: background .15s;
    border-bottom: 1px solid transparent;
}

.task-student-item:hover {
    background: var(--primary-50);
    color: var(--text);
}

.task-student-item.active {
    background: var(--primary-light);
    color: var(--text);
}

.task-student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.task-student-avatar.avatar-calificado { background: var(--success); }
.task-student-avatar.avatar-entregado  { background: var(--warning); }
.task-student-avatar.avatar-pendiente  { background: var(--text-light); }

.task-student-info {
    flex: 1;
    min-width: 0;
}

.task-student-name {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-student-status {
    display: block;
    font-size: .7rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-calificado { color: var(--success); }
.status-entregado  { color: var(--warning); }
.status-pendiente  { color: var(--text-light); }

.task-student-grade {
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

/* RIGHT PANEL — Student detail */
.task-detail-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.task-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-light);
    padding: 60px 20px;
    text-align: center;
}

.task-detail-empty i {
    font-size: 3rem;
    margin-bottom: 12px;
    color: var(--border);
}

.task-detail-empty h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.task-detail-empty p {
    font-size: .85rem;
    color: var(--text-light);
    margin: 0;
}

.task-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.task-detail-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.task-detail-user {
    flex: 1;
}

.task-detail-user h5 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: block;
}

.task-detail-email {
    font-size: .8rem;
    color: var(--text-muted);
}

.task-detail-badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: capitalize;
    flex-shrink: 0;
}

.task-detail-badge.badge-calificado { background: var(--success-light); color: var(--success); }
.task-detail-badge.badge-entregado  { background: var(--warning-light); color: var(--warning); }
.task-detail-badge.badge-pendiente  { background: var(--bg); color: var(--text-muted); }

/* Sections */
.task-detail-section {
    padding: 0 24px;
}

.task-detail-section + .task-detail-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.task-detail-section:last-child {
    padding-bottom: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.task-detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: background .15s;
}

.task-detail-section-header:hover {
    background: var(--primary-light);
}

.task-detail-section-header span {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-detail-section-header i:first-child {
    color: var(--primary);
}

.task-detail-section-body {
    margin-top: 12px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.task-detail-section-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.task-detail-section-title i {
    color: var(--primary);
}

/* Task info grid */
.task-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: .85rem;
}

.task-info-grid strong {
    color: var(--text-muted);
    font-weight: 500;
}

.task-info-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}

.task-info-link:hover {
    background: var(--primary);
    color: #fff;
}

/* No submission */
.task-no-submission {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.task-no-submission i {
    font-size: 2.5rem;
    color: var(--border);
    margin-bottom: 8px;
    display: block;
}

.task-no-submission p {
    margin: 0;
    font-size: .875rem;
}

/* Detail files */
.task-detail-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-detail-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: background .15s;
}

.task-detail-file:hover {
    background: var(--primary-light);
}

.task-detail-file-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.task-detail-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-detail-file-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.task-detail-file-info {
    flex: 1;
    min-width: 0;
}

.task-detail-file-name {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-detail-file-info small {
    font-size: .72rem;
    color: var(--text-muted);
}

.task-detail-file-download {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: all .2s;
}

.task-detail-file-download:hover {
    background: var(--primary);
    color: #fff;
}

/* Comment */
.task-detail-comment {
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    line-height: 1.5;
    color: var(--text);
}

/* Grade display */
.task-grade-box {
    margin-bottom: 16px;
}

.task-grade-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.task-grade-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.task-grade-big {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.task-grade-max {
    font-size: .9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.task-grade-pct {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    color: var(--text);
    position: relative;
}

.task-grade-pct::before {
    content: '';
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    border-radius: 50%;
    position: absolute;
}

.task-grade-pct span {
    position: relative;
    z-index: 1;
}

.task-grade-feedback {
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
}

.task-grade-feedback strong {
    font-size: .78rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.task-grade-feedback p {
    margin: 0;
}

/* Grade form */
.task-grade-form h6 {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

/* ============================
   ENTREGAR (Student Submission)
   ============================ */
.task-submit-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: flex-start;
}

.task-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--bg);
}

.task-dropzone:hover,
.task-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.task-dropzone i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}

.task-dropzone h6 {
    margin: 0 0 4px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    display: block;
}

.task-dropzone p {
    margin: 0;
    font-size: .8rem;
    color: var(--text-muted);
}

.task-dropzone small {
    font-size: .72rem;
    color: var(--text-light);
    display: block;
    margin-top: 8px;
}

.task-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
}

.task-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.task-file-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.task-file-item-info {
    flex: 1;
    min-width: 0;
}

.task-file-item-name {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-file-item-size {
    font-size: .72rem;
    color: var(--text-muted);
}

.task-file-item-remove {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: .9rem;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}

.task-file-item-remove:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* Task info sidebar (entregar) */
.task-info-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: sticky;
    top: 80px;
}

.task-info-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-info-card-header i {
    color: var(--primary);
}

.task-info-card-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.task-info-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-info-field-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
}

.task-info-field-value {
    font-size: .85rem;
    color: var(--text);
}

.task-info-field-value.text-danger {
    color: var(--danger) !important;
}

.task-info-field-value.text-success {
    color: var(--success) !important;
}

.task-info-desc {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.task-info-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: background .2s;
}

.task-info-attachment:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Status boxes (entregar) */
.task-status-box {
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.task-status-box.status-calificado-box {
    background: var(--success-light);
}

.task-status-box.status-pendiente-box {
    background: var(--warning-light);
}

.task-status-box.status-sin-entregar-box {
    background: var(--bg);
    border: 1px solid var(--border);
}

.task-status-box .task-status-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.task-status-box .task-status-label {
    font-size: .85rem;
    font-weight: 600;
}

.status-calificado-box .task-status-icon,
.status-calificado-box .task-status-label { color: var(--success); }

.status-pendiente-box .task-status-icon,
.status-pendiente-box .task-status-label { color: var(--warning); }

.status-sin-entregar-box .task-status-icon,
.status-sin-entregar-box .task-status-label { color: var(--text-muted); }

.task-status-grade {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--success);
    margin-top: 4px;
}

/* Submitted files list */
.task-submitted-files {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.task-submitted-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: background .15s;
}

.task-submitted-file:hover {
    background: var(--primary-light);
    color: var(--text);
}

.task-submitted-file i {
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.task-submitted-file span {
    flex: 1;
    font-size: .82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-submitted-file small {
    font-size: .72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .task-review-layout {
        grid-template-columns: 1fr;
    }

    .task-students-panel {
        max-height: 300px;
    }

    .task-submit-layout {
        grid-template-columns: 1fr;
    }

    .task-info-card {
        position: static;
    }
}

@media (max-width: 576px) {
    .task-students-stats {
        flex-direction: column;
        gap: 4px;
    }

    .task-detail-header {
        padding: 16px;
        flex-wrap: wrap;
    }

    .task-detail-section {
        padding: 0 16px;
    }

    .task-detail-section:last-child {
        padding-bottom: 16px;
    }

    .task-info-card-body {
        padding: 14px 16px;
    }

    .task-grade-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .chat-panel {
        width: 100%;
    }
}

/* INSCRIBIR ALUMNOS */
.insc-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.insc-search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
}

.insc-search-input {
    width: 100%;
    padding: 12px 44px 12px 42px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: .9rem;
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text);
    transition: border-color .2s;
}

.insc-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1);
}

.insc-search-spinner {
    position: absolute;
    right: 14px;
}

.insc-results {
    max-height: 320px;
    overflow-y: auto;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.insc-results:empty {
    display: none;
}

.insc-results-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: .875rem;
}

.insc-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.insc-result-item:last-child {
    border-bottom: none;
}

.insc-result-item:hover {
    background: var(--primary-50);
}

.insc-result-item.selected {
    background: rgba(var(--primary-rgb), .08);
}

.insc-result-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.insc-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.insc-result-name {
    font-weight: 600;
    font-size: .875rem;
    color: var(--text);
}

.insc-result-email {
    font-size: .78rem;
    color: var(--text-muted);
}

.insc-result-btn {
    flex-shrink: 0;
    border-radius: 8px;
}

.insc-selected-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.insc-selected-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: .875rem;
    color: var(--text);
}

.insc-selected-header i {
    color: var(--primary);
    margin-right: 4px;
}

.insc-selected-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}

.insc-selected-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(var(--primary-rgb), .06);
    border: 1px solid rgba(var(--primary-rgb), .15);
    border-radius: 10px;
    transition: background .15s;
}

.insc-selected-chip:hover {
    background: rgba(var(--primary-rgb), .1);
}

.insc-selected-chip-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem;
    flex-shrink: 0;
}

.insc-selected-chip-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.insc-selected-chip-name {
    font-weight: 600;
    font-size: .82rem;
    color: var(--text);
}

.insc-selected-chip-email {
    font-size: .72rem;
    color: var(--text-muted);
}

.insc-enrolled-list {
    max-height: 480px;
    overflow-y: auto;
}

.insc-enrolled-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.insc-enrolled-item:last-child {
    border-bottom: none;
}

.insc-enrolled-item:hover {
    background: var(--bg-secondary);
}

.insc-enrolled-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .82rem;
    flex-shrink: 0;
}

.insc-enrolled-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.insc-enrolled-name {
    font-weight: 600;
    font-size: .85rem;
    color: var(--text);
}

.insc-enrolled-email {
    font-size: .75rem;
    color: var(--text-muted);
}

.insc-enrolled-date {
    font-size: .75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* MATERIALES - BULK UPLOAD */
.mat-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--bg-primary);
}

.mat-dropzone:hover, .mat-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), .04);
}

.mat-dropzone i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 8px;
    display: block;
}

.mat-dropzone p {
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.mat-dropzone small {
    color: var(--text-muted);
}

.mat-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.mat-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.mat-file-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}

.mat-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mat-file-name {
    font-weight: 600;
    font-size: .82rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mat-file-size {
    font-size: .72rem;
    color: var(--text-muted);
}

.mat-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    font-size: .82rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.mat-tip:last-child {
    border-bottom: none;
}

.mat-tip i {
    color: var(--accent-green);
    margin-top: 2px;
    flex-shrink: 0;
}

.mat-tip kbd {
    font-size: .7rem;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* MATERIALES - LIST & INLINE EDIT */
.mat-unit-title {
    font-size: .9rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.mat-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    transition: background .15s;
    border: 1px solid transparent;
}

.mat-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
}

.mat-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.mat-item-body {
    flex: 1;
    min-width: 0;
}

.mat-item-title {
    font-weight: 600;
    font-size: .875rem;
    color: var(--text);
    line-height: 1.3;
}

.mat-item-desc {
    font-size: .78rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 2px;
}

.mat-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
}

.mat-item:hover .mat-item-actions {
    opacity: 1;
}

.mat-edit-input {
    font-size: .85rem;
    font-family: var(--font);
}

.btn-sm-custom {
    padding: 2px 10px;
    font-size: .78rem;
}
