/* ============================================
   RESET GLOBAL
============================================ */
html, body {
    overscroll-behavior: contain;
    -webkit-overscroll-behavior: contain;
}
/* ============================================
   IA TASK GENERATOR - MODAL MEJORADO
============================================ */
.modal-ia-task {
    max-width: 780px;
    border-radius: 20px;
    overflow: hidden;
}
.ia-modal-hero {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    padding: 28px 28px 20px;
    margin: -24px -24px 24px;
    color: #fff;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.ia-modal-hero-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}
.ia-modal-hero-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
}
.ia-modal-hero-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #fff;
}
.ia-modal-hero-text p {
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.5;
    color: rgba(255,255,255,0.9);
}
.ia-helper-text {
    color: var(--text-sub);
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 13.5px;
}
.ia-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ia-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.ia-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}
.ia-form-grid label,
.ia-upload-block label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ia-upload-block {
    margin-bottom: 18px;
    padding: 18px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-body);
    transition: var(--transition);
    text-align: center;
}
.ia-upload-block:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.ia-upload-block label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}
.ia-upload-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}
.ia-upload-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}
.ia-field-help {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 11.5px;
    line-height: 1.4;
}
.ia-count-selector {
    display: flex;
    gap: 8px;
}
.ia-count-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}
.ia-count-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.ia-count-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
/* IA Results modal */
.modal-ia-results #ia-results-container .ia-result-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    background: var(--bg-card);
    transition: var(--transition);
    position: relative;
}
.modal-ia-results #ia-results-container .ia-result-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(26,115,232,0.1);
}
.ia-result-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.ia-result-card-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.modal-ia-results #ia-results-container .card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--bg-card);
}
.modal-ia-results #ia-results-container .card > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
/* ============================================
   SISTEMA DE DISEÑO PROFESIONAL - VARIABLES
============================================ */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --secondary: #9333ea;
    --secondary-dark: #7e22ce;
    --secondary-light: #f3e8ff;
    --success: #34a853;
    --success-light: #dcfce7;
    --warning: #f9ab00;
    --warning-light: #fff3cd;
    --error: #d93025;
    --error-light: #fee2e2;
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #202124;
    --text-sub: #5f6368;
    --text-light: #9aa0a6;
    --border: #dadce0;
    --border-light: #e8eaed;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-dropdown: 0 8px 24px rgba(0,0,0,0.2);
    --transition: all 0.2s ease-in-out;
    --radius: 12px;
    --radius-sm: 8px;
}
/* Tema oscuro */
body.dark-mode {
    --primary: #8ab4f8;
    --primary-dark: #aecbfa;
    --primary-light: #1e3a5f;
    --secondary: #c58af9;
    --secondary-dark: #b17be6;
    --secondary-light: #3b1e4a;
    --success: #81c995;
    --warning: #fde293;
    --error: #f28b82;
    --bg-body: #1e1e1e;
    --bg-card: #2d2d2d;
    --bg-sidebar: #2d2d2d;
    --text-main: #e8eaed;
    --text-sub: #9aa0a6;
    --border: #3c4043;
    --border-light: #5f6368;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    transition: var(--transition);
}
/* ============================================
   SCROLL PERSONALIZADO
============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-sub);
}
/* ============================================
   LOGIN SCREEN
============================================ */
#login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-body) 100%);
}
.login-card {
    background: var(--bg-card);
    padding: 48px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: slideUp 0.5s ease-out;
}
.login-card h2 {
    margin-bottom: 24px;
    color: var(--primary);
    font-size: 28px;
    font-weight: 700;
}
.doc-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.doc-input-wrap input {
    flex: 1;
    padding-right: 44px !important;
}
.doc-input-wrap button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    font-size: 16px;
    color: var(--text-sub);
    line-height: 1;
}
.doc-input-wrap button:hover {
    color: var(--text-main);
}
.doc-error {
    background: var(--error-light);
    color: var(--error);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-top: 16px;
}
.login-role-selector {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    overflow: hidden;
}
.login-role-selector .btn {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 12px;
}
.login-role-selector .btn:not(.active) {
    background: var(--bg-card);
    color: var(--text-sub);
}
.login-role-selector .btn.active {
    background: var(--primary-light);
    color: var(--primary);
}
.view-subtitle {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 16px;
}
.login-card.shake {
    animation: shake 0.5s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}
.hidden {
    display: none !important;
}
.spinner-cell {
    text-align: center;
    padding: 40px;
}
/* ============================================
   TABS DOCENTE
============================================ */
#tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}
#tabs button {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}
#tabs button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
#tabs button:hover:not(.active) {
    color: var(--text-main);
    background: var(--bg-body);
}
/* ============================================
   PASSWORD STRENGTH & REQUIREMENTS
============================================ */
#password-strength-reg {
    margin: 8px 0;
}
.strength-fill {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: all 0.3s;
    width: 0%;
}
.strength-fill.weak { background: var(--error); width: 25%; }
.strength-fill.medium { background: var(--warning); width: 50%; }
.strength-fill.strong { background: var(--success); width: 100%; }
.strength-text {
    font-size: 12px;
    display: block;
    margin-top: 4px;
}
.strength-text.weak { color: var(--error); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }
#password-requirements {
    list-style: none;
    padding: 0;
    margin: 8px 0;
    font-size: 12px;
}
#password-requirements li {
    padding: 2px 0;
    color: var(--text-sub);
}
#password-requirements li.valid { color: var(--success); }
#password-requirements li.invalid { color: var(--error); }
.password-match {
    font-size: 12px;
    margin: 4px 0 8px;
}
.password-match.match { color: var(--success); }
.password-match.no-match { color: var(--error); }
/* ============================================
   FIELD VALIDATION
============================================ */
.field-validation {
    font-size: 12px;
    margin: 2px 0 8px;
}
.field-validation.valid { color: var(--success); }
.field-validation.invalid { color: var(--error); }
input.valid { border-color: var(--success) !important; }
input.invalid { border-color: var(--error) !important; }
/* ============================================
   FORGOT PASSWORD & REMEMBER ME
============================================ */
#forgot-password-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    margin: 8px 0;
}
#forgot-password-link:hover {
    text-decoration: underline;
}
#view-login label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-sub);
    margin: 8px 0;
    cursor: pointer;
}
#view-login label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
/* ============================================
   DARK MODE TOGGLE
============================================ */
#dark-mode-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    color: var(--text-main);
}
#dark-mode-toggle:hover {
    box-shadow: var(--shadow-hover);
    transform: scale(1.05);
}
#dark-mode-toggle svg {
    width: 20px;
    height: 20px;
}
/* ============================================
   LAYOUT PRINCIPAL — SHARED (Docente + Alumno)
   ============================================ */
#main-app {
    display: none;
    height: 100vh;
    flex-direction: column;
}
/* Header Superior */
header {
    height: 64px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 20px;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    gap: 12px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
/* Botones de ícono en el header */
.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: var(--transition);
    flex-shrink: 0;
}
.header-icon-btn:hover {
    background: var(--bg-body);
    color: var(--text-main);
}
.header-icon-btn svg {
    width: 20px;
    height: 20px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}
.logo i {
    color: var(--primary);
    width: 24px;
    height: 24px;
}
.logo span {
    color: var(--secondary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
#back-to-dashboard {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-sub);
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#back-to-dashboard:hover {
    background: var(--bg-body);
    color: var(--primary);
}
/* ---- Menú Apps tipo Google Classroom ---- */
.header-apps-menu {
    position: relative;
}
.apps-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    width: 280px;
    padding: 16px;
    z-index: 1000;
    animation: fadeIn 0.15s ease-out;
}
.header-apps-menu.open .apps-dropdown {
    display: block;
}
.apps-dropdown-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 12px;
    padding: 0 4px;
}
.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-main);
    border: 1.5px solid transparent;
}
.app-item:hover {
    background: var(--bg-body);
    border-color: var(--border);
}
.app-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-item-icon svg {
    width: 22px;
    height: 22px;
}
.app-item span {
    font-size: 11.5px;
    font-weight: 500;
    text-align: center;
    color: var(--text-sub);
    line-height: 1.2;
}
/* ---- Avatar y dropdown de usuario ---- */
.user-profile-menu {
    position: relative;
    cursor: pointer;
    /* reset <button> user-agent */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: var(--transition);
    border: 2px solid transparent;
}
.user-profile-menu:hover .user-avatar,
.user-profile-menu.active .user-avatar {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    min-width: 260px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}
.user-profile-menu.active .dropdown-menu {
    display: block;
    animation: fadeIn 0.15s ease-out;
}
/* Info del usuario dentro del dropdown */
.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-body);
}
.dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}
.dropdown-user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}
.dropdown-user-email {
    font-size: 12px;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
    margin-top: 2px;
}
.dropdown-item {
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text-main);
}
.dropdown-item:hover {
    background: var(--bg-body);
}
.dropdown-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-sub);
}
.dropdown-item-danger {
    color: var(--error);
}
.dropdown-item-danger svg {
    color: var(--error);
}
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
/* ─── SHARED: Layout de dos columnas (sidebar + contenido) ─── */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}
/* ─── DOCENTE: Sidebar de clases (ocultable) ─── */
.classes-sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
}
.classes-sidebar.collapsed {
    width: 80px;
}
.classes-sidebar.collapsed .class-name,
.classes-sidebar.collapsed .class-badge,
.classes-sidebar.collapsed h3 {
    display: none;
}
.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
}
.toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-sub);
    padding: 4px;
    border-radius: 50%;
}
.toggle-btn:hover {
    background: var(--bg-body);
}
.classes-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.class-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 4px;
    transition: var(--transition);
    position: relative;
}
.class-item:hover {
    background: var(--bg-body);
}
.class-item.active {
    background: var(--primary-light);
}
.class-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.class-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.class-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}
.content-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}
.content-section.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Footer de actividad en vivo */
.live-activity-footer {
    height: 60px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-size: 13px;
}
.online-indicators {
    display: flex;
    align-items: center;
    gap: 8px;
}
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.online-avatars {
    display: flex;
    align-items: center;
    gap: 4px;
}
.avatar-online {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid var(--success);
    cursor: pointer;
    transition: var(--transition);
}
.avatar-online:hover {
    transform: scale(1.1);
}
.avatar-online-more {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-body);
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}
.recent-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-sub);
}
/* ============================================
   COMPONENTES COMUNES
============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-hover);
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-size: 14px;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}
.btn-secondary {
    background: var(--secondary);
    color: white;
}
.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-dark);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-sub);
}
.btn-outline:hover:not(:disabled) {
    background: var(--bg-body);
}
.btn-icon {
    padding: 8px;
    border-radius: 50%;
}
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-main);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success {
    background: var(--success-light);
    color: var(--success);
}
.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}
.badge-error {
    background: var(--error-light);
    color: var(--error);
}
/* ============================================
   CLASES GRID
============================================ */
.class-card {
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}
.class-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.class-card-header {
    height: 100px;
    padding: 20px;
    color: white;
    position: relative;
}
.class-card-header[data-color="primary"] { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.class-card-header[data-color="secondary"] { background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); }
.class-card-header[data-color="success"] { background: linear-gradient(135deg, var(--success), #2d8a4b); }
.class-card-header[data-color="warning"] { background: linear-gradient(135deg, var(--warning), #e68a00); }
.class-card-header[data-color="error"] { background: linear-gradient(135deg, var(--error), #b71c1c); }
.class-card-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}
.class-card-body {
    padding: 20px;
}
/* ============================================
   TABLA DE CALIFICACIONES MATRIZ
============================================ */
.grades-matrix-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    margin-bottom: 24px;
}
.grades-matrix {
    min-width: 800px;
    border-collapse: collapse;
    width: 100%;
}
.grades-matrix th {
    background: var(--bg-body);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-sub);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.grades-matrix td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}
.grades-matrix .student-row:hover {
    background: var(--bg-body);
}
.student-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    left: 0;
    background: inherit;
}
.student-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}
.grade-cell {
    text-align: center;
}
.grade-input {
    width: 60px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    background: var(--bg-card);
}
.grade-cell.grade-high {
    background: var(--success-light);
    color: var(--success);
}
.grade-cell.grade-medium {
    background: var(--warning-light);
    color: var(--warning);
}
.grade-cell.grade-low {
    background: var(--error-light);
    color: var(--error);
}
/* ============================================
   NAV DE CLASE
============================================ */
.class-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--text-sub);
    font-weight: 600;
    transition: var(--transition);
}
.nav-item:hover {
    color: var(--text-main);
}
.nav-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
/* ============================================
   SECCIÓN ALUMNOS
============================================ */
.students-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.student-search {
    flex: 1;
    min-width: 250px;
}
.filter-buttons {
    display: flex;
    gap: 8px;
}
.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.student-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}
.student-card:hover {
    box-shadow: var(--shadow-hover);
}
.student-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}
.student-info {
    flex: 1;
}
.student-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}
.student-email {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 4px;
}
.student-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-body);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.3s;
}
.student-status {
    display: flex;
    align-items: center;
    gap: 12px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 2px var(--success-light);
}
.status-dot.offline {
    background: var(--text-light);
}
.task-description {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
}
.task-description.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toggle-description {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}
/* ============================================
   MODAL DE ENTREGA DE TAREAS
============================================ */
.submission-options {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.submission-tab {
    padding: 12px 20px;
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-sub);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.submission-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.submission-panel {
    display: none;
}
.submission-panel.active {
    display: block;
    animation: fadeIn 0.3s;
}
.submission-panel label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}
/* ============================================
   MODALES
============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}
.modal {
    background: var(--bg-card);
    width: 90%;
    max-width: 700px;
    border-radius: var(--radius);
    padding: 32px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}
.modal-lg {
    max-width: 900px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-sub);
    padding: 4px;
    border-radius: 50%;
}
.modal-close:hover {
    background: var(--bg-body);
}
/* ============================================
   TUTOR CHAT
============================================ */
#tutor-container {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 1000;
}
#tutor-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hover);
    transition: var(--transition);
}
#tutor-toggle:hover {
    transform: scale(1.1);
}
#tutor-chat {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    height: 450px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    border: 1px solid var(--border);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.chat-header {
    padding: 16px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-body);
}
.message {
    max-width: 80%;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}
.message-ai {
    background: var(--secondary-light);
    color: var(--secondary-dark);
    align-self: flex-start;
}
.message-user {
    background: var(--primary-light);
    color: var(--primary-dark);
    align-self: flex-end;
}
.chat-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    background: var(--bg-card);
}
/* ============================================
   LOADING Y NOTIFICACIONES
============================================ */
#global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.loading-content {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius);
    text-align: center;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner-sm {
    display: inline-block;
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin-sm .65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
}
@keyframes spin-sm { to { transform: rotate(360deg); } }
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
}
.toast {
    background: var(--bg-card);
    border-left: 4px solid;
    border-radius: var(--radius-sm);
    padding: 16px 24px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-dropdown);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--primary); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.hidden {
    display: none !important;
}
/* ============================================
   QUIZ BUILDER
============================================ */
.quiz-builder-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg-body);
    padding: 16px;
    border-radius: var(--radius);
    min-height: 200px;
}
.quiz-question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    animation: fadeIn 0.3s;
}
.quiz-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.attendance-header .header-actions {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}
.quiz-question-header input {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    border: none;
    padding: 4px 0;
    background: transparent;
}
.quiz-question-header input:focus {
    outline: none;
    box-shadow: none;
    border-bottom: 1px solid var(--primary);
}
.quiz-question-card .question-config {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.quiz-question-card .points-input {
    width: 80px;
    text-align: center;
}
.quiz-question-options .option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.quiz-question-options .option-item input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}
.quiz-question-options .option-item input[type="text"] {
    flex: 1;
}
.open-ended-answer-container textarea {
    margin-top: 8px;
    font-style: italic;
    background-color: var(--bg-body);
}
/* Toggle Switch Component */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary);
}
input:checked + .slider:before {
    transform: translateX(22px);
}
/* ============================================
   RUBRIC BUILDER
============================================ */
.rubric-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.rubric-table th, .rubric-table td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
    font-size: 13px;
}
.rubric-table th {
    background: var(--bg-body);
    font-weight: 600;
}
.rubric-table td:first-child {
    font-weight: 500;
}
/* ============================================
   GRADING CATEGORIES
============================================ */
.category-item {
    display: grid;
    grid-template-columns: 1fr 80px auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}
.category-item .category-weight {
    text-align: center;
}
.category-item .btn-icon {
    color: var(--error);
}
/* ============================================
   TASK DETAIL VIEW
============================================ */
.task-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.task-detail-header h2 {
    margin-bottom: 4px;
}
.task-detail-header p {
    color: var(--text-sub);
    font-weight: 600;
}
.task-detail-actions {
    display: flex;
    gap: 12px;
}
.student-submission-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.student-submission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
}
.student-submission-item .student-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}
/* ============================================
   ASISTENCIA
============================================ */
.attendance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.attendance-header .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.attendance-table-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
}
.attendance-student-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
}
.attendance-num {
    flex-shrink: 0;
    width: 28px;
}
.name-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 360px;
    margin-right: 8px;
}
.attendance-student-row:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}
.attendance-student-row .name-wrap .student-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    flex-shrink: 0;
}
.name-wrap .name-dots {
    flex: 1;
    border-bottom: 1px dotted var(--border);
    margin: 0 8px;
    align-self: flex-end;
}
.status-button-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    padding-right: 4px;
}
.status-btn {
    padding: 4px 10px;
    border-radius: 16px;
    border: 1.5px solid var(--border);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    font-size: 12px;
    background: transparent;
    color: var(--text-sub);
    white-space: nowrap;
}
.status-btn:hover {
    background: var(--bg-body);
    border-color: var(--text-sub);
    color: var(--text-main);
}
/* Colores para el estado ACTIVO del botón */
.status-btn.active[data-status="presente"] {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}
.status-btn.active[data-status="ausente"] {
    background-color: var(--error);
    color: white;
    border-color: var(--error);
}
.status-btn.active[data-status="retardo"] {
    background-color: #f57c00; /* Naranja */
    color: white;
    border-color: #f57c00;
}
.status-btn.active[data-status="justificado"] {
    background-color: #1976d2; /* Azul */
    color: white;
    border-color: #1976d2;
}
/* Estilo para el botón de Guardar con cambios pendientes */
[data-action="saveAttendance"].unsaved-changes {
    animation: pulse-orange 1.5s infinite;
}
@keyframes pulse-orange {
    0% { box-shadow: 0 0 0 0 rgba(245, 124, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(245, 124, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 124, 0, 0); }
}
/* ============================================
   ESTILOS ADICIONALES PARA TOASTS
============================================ */
.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toast-message {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 500;
}
.toast-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toast-close:hover {
    color: var(--text-main);
    background: var(--bg-body);
}
@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
.toast.exit {
    animation: slideOut 0.4s ease-in forwards;
}
/* ============================================
   SKELETON LOADER
============================================ */
.skeleton {
    background-color: var(--border-light);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}
.skeleton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    height: 100%;
    width: 150%;
    background: linear-gradient(to right, transparent 0%, var(--bg-card) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}
.skeleton-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
/* ============================================
   DASHBOARD WIDGETS
============================================ */
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.summary-item:last-child {
    border-bottom: none;
}
.summary-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}
.summary-item-subtitle {
    font-size: 12px;
    color: var(--text-sub);
}
.summary-item-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    margin-left: 16px;
}
/* ============================================
   CLASS HEADER BANNER
============================================ */
.class-header-banner {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    margin: -32px -32px 32px -32px;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.class-banner-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text-main);
}
.class-banner-info p {
    font-size: 14px;
    color: var(--text-sub);
    font-weight: 500;
}
/* Código de la clase */
.class-banner-code {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    border-radius: 12px;
    padding: 10px 16px;
    flex-shrink: 0;
}
.class-banner-code-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    opacity: 0.7;
}
.class-banner-code-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.12em;
    font-family: 'Courier New', monospace;
}
.class-banner-code-copy {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.class-banner-code-copy:hover {
    background: var(--primary-dark);
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.section-header h2 {
    font-size: 24px;
    font-weight: 700;
}
.section-header .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
/* ============================================
   HEADER SUMMARY WIDGETS
============================================ */
#header-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-left: 24px;
}
.header-summary-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-body);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.header-summary-widget h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
}
.header-summary-widget .summary-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 20px;
}
/* ============================================
   WIDGETS COLAPSABLES (NUEVO)
============================================ */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.toggle-btn-widget {
    background: transparent;
    border: none;
    padding: 4px;
    border-radius: 50%;
    color: var(--text-sub);
}
.widget-content {
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out, padding 0.3s ease-out;
    max-height: 2000px; /* Arbitrary large value */
    overflow: hidden;
    opacity: 1;
}
.collapsible-widget.collapsed .widget-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
#clases-dashboard .collapsible-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
#clases-dashboard .widget-header {
     padding: 16px 24px;
     border-bottom: 1px solid var(--border-light);
}
#clases-dashboard .collapsible-widget.collapsed .widget-header {
    border-bottom-color: transparent;
}
#clases-dashboard .widget-content {
    padding: 24px;
}
#clases-dashboard .widget-header h3 {
    margin: 0;
}
#header-summary .collapsible-widget {
    position: relative;
}
#header-summary .widget-header {
    gap: 12px;
    background: var(--bg-body);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
#header-summary .widget-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    margin: 0;
}
#header-summary .widget-content {
    padding-top: 16px;
}
#header-summary .collapsible-widget.collapsed .widget-content {
    padding-top: 0;
}
#header-summary .header-summary-widget-wrapper {
    display: flex;
    gap: 16px;
}
/* ─── DOCENTE: Tareas — layout grid lista/detalle ─── */
.tasks-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    height: calc(100vh - 200px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 16px;
}
.tasks-list-pane {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    border-radius: 0;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tasks-list-pane-header {
    padding: 4px 8px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tasks-list-pane-header span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-sub);
}
.tasks-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--text-light);
    text-align: center;
    flex: 1;
}
.tasks-list-empty svg {
    width: 40px;
    height: 40px;
    opacity: 0.35;
}
.tasks-list-empty p {
    font-size: 13px;
}
.task-list-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.task-list-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.task-list-item-icon svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}
.task-list-item-body {
    flex: 1;
    min-width: 0;
}
.task-list-item-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.task-list-item-meta {
    font-size: 11.5px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}
.task-list-item:hover {
    background: var(--bg-body);
    border-color: var(--border-light);
}
.task-list-item.selected {
    background: var(--primary-light);
    border-color: var(--primary);
}
.task-list-item.selected .task-list-item-title {
    color: var(--primary);
}
.task-list-item.selected .task-list-item-icon {
    background: var(--primary);
}
.task-list-item.selected .task-list-item-icon svg {
    color: #fff;
}

/* Teacher task list v2 (tl-) */
.tl-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; cursor: pointer; border: 1.5px solid transparent; transition: all 0.15s; margin-bottom: 2px; }
.tl-item:hover { background: var(--bg-body); border-color: var(--border); }
.tl-item.selected { background: var(--primary-light); border-color: var(--primary); }
.tl-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tl-icon svg { width: 17px; height: 17px; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-meta { display: flex; align-items: center; gap: 10px; margin-top: 2px; font-size: 11px; color: var(--text-sub); }
.tl-type { font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; }
.tl-empty { text-align: center; padding: 60px 20px; }
.tl-empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--bg); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.tl-empty-icon svg { width: 28px; height: 28px; color: var(--text-sub); opacity: 0.5; }
.tl-empty h4 { font-size: 16px; margin: 0 0 4px; }
.tl-empty p { font-size: 13px; color: var(--text-sub); margin: 0; }
.tl-detail { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tl-detail-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px; border-bottom: 1px solid var(--border); background: var(--bg-body); border-left: 4px solid transparent; }
.tl-detail-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tl-detail-icon svg { width: 22px; height: 22px; }
.tl-detail-info { flex: 1; min-width: 0; }
.tl-detail-info h3 { font-size: 17px; font-weight: 700; margin: 0; }
.tl-detail-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--text-sub); }
.tl-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }
.tl-detail-body { padding: 20px; }
.tl-detail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light); margin-bottom: 8px; }
.tl-detail-body p { font-size: 14px; line-height: 1.7; color: var(--text-sub); margin: 0; }
.tl-attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-attach { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; background: var(--bg); color: var(--primary); text-decoration: none; border: 1px solid var(--border); transition: all .15s; }
.tl-attach:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.tl-attach svg { width: 14px; height: 14px; }

.task-detail-view-pane {
    overflow-y: auto;
    border-radius: 0;
    background: var(--bg-body);
    padding: 20px;
}
/* ─── DOCENTE: Tareas — header mejorado ─── */
#profesor-tareas .section-header {
    margin-bottom: 20px;
}
#profesor-tareas .section-header h2 {
    font-size: 22px;
}
#profesor-tareas {
    max-width: none;
    margin: 0;
    padding: 0;
}
#profesor-tareas .section-header {
    padding: 24px 24px 0;
}
/* ============================================
   DOCENTE: TASK DETAIL PANE — DISEÑO MEJORADO
   ============================================ */
.task-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    gap: 12px;
    color: var(--text-light);
    text-align: center;
    padding: 40px;
}
.task-detail-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--bg-body);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.task-detail-empty-icon svg {
    width: 28px;
    height: 28px;
    opacity: 0.4;
}
.task-detail-empty h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-sub);
}
.task-detail-empty p {
    font-size: 13px;
    color: var(--text-light);
}
.task-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.task-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-body);
}
.task-detail-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.task-detail-header-icon svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}
.task-detail-header-info {
    flex: 1;
    min-width: 0;
}
.task-detail-header-info h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.3;
}
.task-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.task-detail-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}
.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}
.task-detail-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.task-detail-body {
    padding: 20px;
}
.task-detail-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 8px;
}
.task-description {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-sub);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.task-detail-attachment {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}
.task-detail-attachment-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.task-detail-attachment-icon svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}
/* ============================================
   BIENESTAR DEL DOCENTE
============================================ */
/* --- Estimador de tiempo + Distribuidor de carga --- */
.teacher-wellbeing-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.wellbeing-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
}
.wellbeing-time {
    background: var(--primary-light);
    border-color: rgba(26,115,232,0.2);
}
.wellbeing-warning {
    background: var(--warning-light);
    border-color: rgba(249,171,0,0.3);
}
.wellbeing-block-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wellbeing-time .wellbeing-block-icon {
    background: var(--primary);
}
.wellbeing-time .wellbeing-block-icon svg {
    color: #fff;
    width: 16px;
    height: 16px;
}
.wellbeing-warning .wellbeing-block-icon {
    background: var(--warning);
}
.wellbeing-warning .wellbeing-block-icon svg {
    color: #fff;
    width: 16px;
    height: 16px;
}
.wellbeing-block-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-sub);
    margin-bottom: 2px;
}
.wellbeing-block-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.4;
}
/* --- Calificación Rápida --- */
.quick-grade-panel {
    flex-direction: column;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}
.quick-grade-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--secondary-light), var(--primary-light));
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.quick-grade-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.quick-grade-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.quick-grade-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
}
.quick-grade-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}
.quick-grade-subtitle {
    font-size: 12.5px;
    color: var(--text-sub);
    margin-top: 2px;
}
.quick-grade-list {
    max-height: 420px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.quick-grade-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-body);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-wrap: wrap;
}
.quick-grade-item.qg-confirmed {
    border-color: var(--success);
    background: var(--success-light);
    opacity: 0.7;
}
.quick-grade-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    flex-shrink: 0;
}
.quick-grade-item-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.quick-grade-item-name span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.quick-grade-item-content {
    flex-shrink: 0;
}
.quick-grade-ia-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-sub);
}
.quick-grade-ia-badge.ia-ready {
    background: var(--secondary-light);
    border-color: var(--secondary);
    color: var(--secondary);
}
.quick-grade-ia-badge.ia-error {
    background: var(--error-light);
    border-color: var(--error);
    color: var(--error);
}
.quick-grade-item-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.quick-grade-item-inputs input {
    width: 80px;
    text-align: center;
    padding: 6px 8px;
}
.quick-grade-input-max {
    font-size: 12px;
    color: var(--text-sub);
    white-space: nowrap;
}
.quick-grade-feedback {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 4px;
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    line-height: 1.4;
}
.quick-grade-feedback-error {
    color: var(--error);
    background: var(--error-light);
}
.quick-grade-model-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--secondary-light);
    color: var(--secondary);
    white-space: nowrap;
    cursor: help;
}
.quick-grade-model-error {
    background: var(--error-light);
    color: var(--error);
}
.quick-grade-pending {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-sub);
}
.quick-grade-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: qg-spin 0.6s linear infinite;
}
@keyframes qg-spin {
    to { transform: rotate(360deg); }
}
.quick-grade-confirm-check {
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    flex-shrink: 0;
}
.quick-grade-confirm-check:hover svg,
.quick-grade-confirm-check.checked svg {
    color: var(--success);
}
.quick-grade-confirm-check svg {
    width: 20px;
    height: 20px;
}
.quick-grade-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
}
.quick-grade-status {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 500;
}
/* ============================================
   IMPORTACIÓN DE CALIFICACIONES EXCEL
============================================ */
.modal-import-grades {
    max-width: 680px;
}
.import-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--primary-light);
    border: 1px solid rgba(26,115,232,0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-main);
}
.import-info-banner svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 1px;
}
.import-info-banner strong {
    display: block;
    font-weight: 600;
    margin-bottom: 3px;
}
.import-info-banner p {
    color: var(--text-sub);
    line-height: 1.5;
    margin: 0;
}
.import-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-body);
    margin-bottom: 12px;
}
.import-upload-zone:hover,
.import-upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}
.import-upload-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.import-upload-icon svg {
    width: 26px;
    height: 26px;
    color: var(--primary);
}
.import-upload-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}
.import-upload-hint {
    font-size: 12px;
    color: var(--text-light);
}
.import-file-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--success-light);
    border: 1.5px solid var(--success);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}
.import-file-selected svg {
    width: 18px;
    height: 18px;
    color: var(--success);
    flex-shrink: 0;
}
.import-file-selected span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.import-file-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-sub);
    padding: 2px;
    display: flex;
    align-items: center;
}
.import-file-remove:hover { color: var(--error); }
.import-file-remove svg { width: 16px; height: 16px; }
/* Preview */
.import-preview-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.import-preview-stat {
    flex: 1;
    padding: 14px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 13px;
    color: var(--text-sub);
}
.import-preview-stat strong {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}
.import-warning-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--warning-light);
    border: 1px solid rgba(249,171,0,0.4);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 13px;
}
.import-warning-box svg {
    width: 18px;
    height: 18px;
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 1px;
}
.import-warning-box strong { display: block; font-weight: 600; margin-bottom: 2px; }
.import-warning-box p { color: var(--text-sub); margin: 0; }
.import-not-found-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.import-not-found-item {
    font-size: 12px;
    padding: 3px 10px;
    background: var(--error-light);
    color: var(--error);
    border-radius: 20px;
    border: 1px solid rgba(217,48,37,0.2);
}
.import-preview-table-wrapper {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.import-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.import-preview-table th {
    background: var(--bg-body);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-sub);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}
.import-preview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
}
.import-preview-table tr:last-child td { border-bottom: none; }
.import-preview-table tr:hover td { background: var(--bg-body); }
/* ============================================
   VISOR DE EXCEL
============================================ */
.excel-viewer-content {
    overflow: auto;
    background: #fff;
    height: 100%;
}
.excel-table {
    width: max-content;
    border-collapse: collapse;
    font-size: 12px;
    font-family: Calibri, 'Segoe UI', Arial, sans-serif;
    background: #fff;
}
/* Esquina y letras de columna */
.excel-corner {
    background: #217346 !important;
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 20;
    padding: 4px 6px;
    border: 1px solid #1a5c38;
    font-size: 11px;
    min-width: 32px;
    width: 32px;
}
.excel-col-letter {
    background: #217346 !important;
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 4px 4px;
    border: 1px solid #1a5c38;
    font-size: 11px;
    white-space: nowrap;
}
.excel-col-key {
    background: #1a5c38 !important;
    border-bottom: 2px solid #fff !important;
}
/* Número de fila */
.excel-row-num {
    background: #f2f2f2 !important;
    color: #666 !important;
    font-weight: 600;
    text-align: center;
    min-width: 32px !important;
    max-width: 32px !important;
    width: 32px;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid #ccc !important;
    font-size: 11px;
    padding: 3px 4px;
}
.excel-row-header {
    background: #e8e8e8 !important;
    color: #444 !important;
}
/* Celdas de encabezado (filas 1-7) */
.excel-table thead th,
.excel-table tbody th {
    background: #f0f0f0;
    font-weight: 600;
    color: #333;
    padding: 4px 6px;
    border: 1px solid #ccc;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    max-width: 150px;
    vertical-align: middle;
    font-size: 11px;
}
/* Celdas de datos */
.excel-table td {
    padding: 3px 6px;
    border: 1px solid #ddd;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    font-size: 12px;
    color: #222;
}
/* Hover en filas de datos */
.excel-table tbody tr:hover td:not(.excel-row-num) {
    filter: brightness(0.93);
}
/* Columnas clave resaltadas */
.excel-table td[style*="background:#FFF3CD"] { font-weight: 600; }
/* ============================================
   CLASSROOM-STYLE CREATE MENU
============================================ */
.classroom-create-menu {
    position: relative;
}
.btn-classroom-create {
    border-radius: 24px !important;
    padding: 10px 22px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(26,115,232,0.3);
}
.classroom-create-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    min-width: 240px;
    padding: 8px 0;
    z-index: 200;
    animation: fadeIn 0.15s ease-out;
    border: 1px solid var(--border);
}
.classroom-create-menu.open .classroom-create-dropdown {
    display: block;
}
.classroom-create-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}
.classroom-create-item:hover {
    background: var(--bg-body);
}
.classroom-create-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.classroom-create-icon svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}
.classroom-create-icon-ai {
    background: var(--secondary-light);
}
.classroom-create-icon-ai svg {
    color: var(--secondary);
}
.classroom-create-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}
/* ============================================
   MODAL FULLSCREEN TIPO CLASSROOM
============================================ */
.modal-overlay-fullscreen {
    align-items: stretch !important;
    padding: 0 !important;
}
.modal-classroom-task {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    margin: 0 !important;
    overflow: hidden;
}
/* Header del modal */
.classroom-modal-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 28px;
    height: 62px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}
.classroom-modal-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.classroom-modal-header-left h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}
.classroom-modal-header-center {
    display: flex;
    justify-content: center;
}
.classroom-modal-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.classroom-modal-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-sub);
    transition: background 0.15s;
}
.classroom-modal-close:hover { background: var(--bg-body); color: var(--text-main); }
.classroom-modal-close svg { width: 17px; height: 17px; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 7px 16px;
    border-radius: 20px;
    display: inline-flex; align-items: center; gap: 5px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: var(--bg-body); color: var(--text-main); border-color: var(--text-sub); }
.btn-publish {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600;
    padding: 8px 22px;
    border-radius: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
/* Layout dos columnas */
.classroom-modal-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    flex: 1;
    overflow: hidden;
    padding-right: 120px;
    transition: padding-right 0.2s;
}
.classroom-modal-left {
    padding: 32px 60px 32px 100px;
    overflow-y: auto;
}
.classroom-modal-right {
    padding: 4px 10px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
    justify-content: flex-start;
}
/* ── Campos de texto ── */
.ct-field { margin-bottom: 16px; }
.ct-field-title { margin-bottom: 20px; }
.ct-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: 0;
    padding: 8px 0;
    font-size: 14px;
    background: transparent;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.ct-input:focus { border-bottom-color: var(--primary); }
.ct-input-title {
    font-size: 24px;
    font-weight: 500;
    padding: 4px 0 12px;
    letter-spacing: -0.3px;
}
.ct-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.6;
}
/* ── Etiqueta de sección ── */
.ct-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-sub);
    margin-bottom: 10px;
    margin-top: 4px;
}
/* ── Tabs de tipo de entrega ── */
.ct-type-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}
.ct-type-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.15s;
}
.ct-type-tab svg { width: 14px; height: 14px; }
.ct-type-tab:hover { border-color: var(--primary); color: var(--primary); }
.ct-type-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
/* ── Panel de tipo ── */
.ct-panel { animation: ctFadeIn 0.15s ease; }
@keyframes ctFadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
/* ── Chips de adjunto ── */
.ct-attach-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.ct-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.15s;
}
.ct-attach-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.ct-attach-chip svg { width: 13px; height: 13px; }
.ct-input-row { margin-bottom: 8px; }
.ct-file-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-main);
    margin-top: 6px;
}
/* ── Google Forms status ── */
.ct-gform-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 8px;
}
.ct-gform-status.valid {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}
.ct-gform-status.invalid {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}
.ct-gform-status svg { width: 14px; height: 14px; flex-shrink: 0; }
/* Tabla de puntajes de Google Forms */
.ct-gform-scores-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.ct-gform-scores-table th {
    background: var(--bg-body);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-sub);
    border-bottom: 1px solid var(--border);
}
.ct-gform-scores-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}
.ct-gform-scores-table tr:last-child td { border-bottom: none; }
.ct-gform-scores-table tr:hover td { background: var(--bg-body); }
.ct-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.ct-score-high { background: #dcfce7; color: #166534; }
.ct-score-mid  { background: #fef9c3; color: #854d0e; }
.ct-score-low  { background: #fee2e2; color: #991b1b; }
/* ── Grid de material ── */
.ct-material-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.ct-material-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.15s;
}
.ct-material-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.ct-material-btn span { font-size: 13px; }
.ct-hint {
    display: block;
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 4px;
}
.ct-material-preview { margin-top: 8px; }
/* ── Columna derecha: config ── */
.ct-config-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px 0;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    width: 100%;
}
.ct-config-row:last-child { border-bottom: none; }
.ct-config-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    white-space: nowrap;
    user-select: none;
}
.ct-config-val {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-body);
    padding: 4px 12px;
    border-radius: 6px;
}
.ct-config-input {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    background: var(--bg-body);
    color: var(--text-main);
    width: 130px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.ct-config-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(66,133,244,0.15); }
.ct-config-input:hover { border-color: var(--text-sub); }
/* ── Alertas inline ── */
/* Toggle switch */
.ct-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}
.ct-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.ct-toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 20px;
    transition: 0.3s;
}
.ct-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.ct-toggle input:checked + .ct-toggle-slider {
    background: var(--primary);
}
.ct-toggle input:checked + .ct-toggle-slider::before {
    transform: translateX(16px);
}
.ct-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
}
.ct-alert-warning {
    background: #fff8e1;
    border: 1px solid #f59e0b;
    color: #92400e;
}
.ct-alert-info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
}
/* ── Compatibilidad con clases antiguas que aún se usan ── */
.classroom-section-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--text-sub);
    margin-bottom: 10px; margin-top: 4px;
}
.classroom-material-input { margin-bottom: 8px; }
.classroom-material-preview { margin-top: 8px; }
.classroom-material-grid {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
}
.classroom-material-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    border: 1.5px solid var(--border); background: var(--bg-card);
    font-size: 13px; color: var(--text-sub); cursor: pointer;
    transition: all 0.15s;
}
.classroom-material-btn:hover { border-color: var(--primary); color: var(--primary); }
.classroom-field { margin-bottom: 16px; }
.classroom-input {
    width: 100%; border: none; border-bottom: 2px solid var(--border);
    border-radius: 0; padding: 8px 0; font-size: 14px;
    background: transparent; color: var(--text-main); outline: none;
    transition: border-color 0.2s; font-family: inherit;
}
.classroom-input:focus { border-bottom-color: var(--primary); }
.classroom-input-title { font-size: 22px; font-weight: 500; padding: 4px 0 10px; }
.classroom-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.classroom-attachments-bar {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 0; border-top: 1px solid var(--border); margin-top: 8px;
}
.classroom-attach-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-sub); transition: var(--transition);
}
.classroom-attach-btn:hover { background: var(--bg-body); color: var(--primary); }
.classroom-attach-btn svg { width: 18px; height: 18px; }
.classroom-file-preview {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--bg-body);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-top: 8px; font-size: 13px; color: var(--text-main);
}
.classroom-config-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.classroom-config-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; gap: 12px;
}
.classroom-config-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: var(--text-sub); white-space: nowrap;
}
.classroom-config-label svg { width: 15px; height: 15px; }
.classroom-config-value { font-size: 13px; color: var(--text-main); text-align: right; }
.classroom-config-input {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 10px; font-size: 13px; background: var(--bg-body);
    color: var(--text-main); text-align: right; width: 130px;
    outline: none; transition: border-color 0.2s;
}
.classroom-config-input:focus { border-color: var(--primary); }
.classroom-config-divider { height: 1px; background: var(--border); }
/* ============================================
   QUIZ BUILDER
============================================ */
.quiz-questions-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}
.quiz-question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.quiz-question-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.quiz-question-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
}
.quiz-question-type-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 10px;
    border-radius: 20px;
}
.quiz-question-card-body {
    padding: 16px;
}
.quiz-question-title {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--border);
    padding: 6px 0;
    font-size: 15px;
    font-weight: 500;
    background: transparent;
    color: var(--text-main);
    outline: none;
    margin-bottom: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.quiz-question-title:focus {
    border-bottom-color: var(--primary);
}
.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.quiz-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.quiz-option-row input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}
.option-text {
    flex: 1;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 6px 0;
    font-size: 14px;
    background: transparent;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
.option-text:focus {
    border-bottom-color: var(--primary);
}
.quiz-question-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
}
.quiz-points-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-sub);
}
.question-points-input {
    width: 60px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 13px;
    text-align: center;
    background: var(--bg-card);
    color: var(--text-main);
    outline: none;
}
.question-points-input:focus {
    border-color: var(--primary);
}
.quiz-question-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.quiz-question-actions button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: var(--transition);
}
.quiz-question-actions button:hover {
    background: var(--bg-body);
    color: var(--error);
}
.quiz-question-actions button svg {
    width: 16px;
    height: 16px;
}
.ideal-answer-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
    background: var(--bg-body);
    color: var(--text-main);
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.ideal-answer-textarea:focus {
    border-color: var(--primary);
}
/* Barra agregar pregunta */
.quiz-add-question-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.quiz-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
    transition: var(--transition);
}
.quiz-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.quiz-add-btn svg {
    width: 16px;
    height: 16px;
}
.quiz-add-btn-ai {
    border-color: var(--secondary);
    color: var(--secondary);
    background: var(--secondary-light);
}
.quiz-add-btn-ai:hover {
    background: var(--secondary);
    color: #fff;
}
.question-required-toggle {
    accent-color: var(--primary);
}
/* Número de lista en asistencia */
.attendance-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}
#asistencia-section {
    max-width: none;
    margin: 0;
    padding: 0;
}
#asistencia-section .attendance-header {
    padding: 24px 16px 0;
}
#asistencia-section #attendance-table-container {
    padding: 16px;
}
/* ============================================
   MATERIAL DE APOYO EN TAREAS
============================================ */
.classroom-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-sub);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.classroom-material-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.classroom-material-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
    transition: var(--transition);
}
.classroom-material-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.classroom-material-btn svg { width: 16px; height: 16px; }
.classroom-material-input {
    margin-bottom: 8px;
}
.classroom-material-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.classroom-gform-block {
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-body);
    border: 1.5px solid #4285f4;
    border-radius: var(--radius-sm);
}
/* Vista alumno: materiales */
.task-materials-section {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.task-material-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-sub);
}
.task-material-item a {
    color: var(--primary);
    text-decoration: none;
}
.task-material-item a:hover { text-decoration: underline; }
.task-embed-block {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.task-embed-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    border-bottom: 1px solid var(--border);
}
.task-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.task-embed-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
/* ============================================
   NOTIFICACIONES
============================================ */
.header-notif-menu {
    position: relative;
}
.header-icon-btn {
    position: relative;
}
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
    border: 2px solid var(--bg-card);
}
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.15s ease-out;
}
.header-notif-menu.open .notif-dropdown {
    display: block;
}
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
}
.notif-mark-all {
    font-size: 12px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-list {
    max-height: 380px;
    overflow-y: auto;
}
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
    color: var(--text-light);
    font-size: 13px;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    border-bottom: 1px solid var(--border-light);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-body); }
.notif-unread { background: var(--primary-light); }
.notif-unread:hover { background: #dce8fd; }
.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notif-icon svg { width: 16px; height: 16px; }
.notif-content { flex: 1; min-width: 0; }
.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-msg {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.4;
}
.notif-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}
.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 4px;
}
/* ============================================
   COMENTARIOS EN ENTREGAS
============================================ */
.comment-thread-wrapper {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.comment-thread {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.comment-thread-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding-right: 4px;
}
.comment-empty {
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
    padding: 16px;
}
.comment-loading {
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
    padding: 12px;
}
.comment-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}
.comment-mine {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.comment-theirs {
    align-self: flex-start;
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}
.comment-author {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.75;
    margin-bottom: 2px;
}
.comment-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 3px;
    text-align: right;
}
.comment-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.comment-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    background: var(--bg-body);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}
.comment-input:focus { border-color: var(--primary); }
.comment-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}
.comment-send-btn:hover { background: var(--primary-dark); }
.comment-send-btn svg { width: 15px; height: 15px; }
.task-comments-container {
    margin-top: 12px;
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
}
/* ============================================
   CALENDARIO
============================================ */
#calendario-section {
    max-width: none;
    margin: 0;
    padding: 0;
}
.cal-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    padding: 24px;
    height: calc(100vh - 180px);
    overflow: hidden;
}
/* Header del calendario */
.cal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.cal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
    text-align: center;
}
.cal-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: var(--transition);
}
.cal-nav-btn:hover {
    background: var(--bg-body);
    border-color: var(--primary);
    color: var(--primary);
}
.cal-nav-btn svg { width: 18px; height: 18px; }
.cal-today-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    transition: var(--transition);
}
.cal-today-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
/* Grid del calendario */
.cal-main {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    flex: 1;
}
.cal-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 0;
}
.cal-cell {
    min-height: 72px;
    border-radius: var(--radius-sm);
    padding: 6px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1.5px solid transparent;
}
.cal-cell-empty {
    cursor: default;
    background: transparent !important;
}
.cal-cell:not(.cal-cell-empty):hover {
    background: var(--bg-body);
    border-color: var(--border);
}
.cal-today {
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
}
.cal-today .cal-day-num {
    color: var(--primary);
    font-weight: 700;
}
.cal-selected {
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary);
}
.cal-day-num {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1;
}
.cal-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
}
.cal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cal-dot-more {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-light);
}
/* Sidebar del calendario */
.cal-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cal-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.cal-task-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cal-empty-month {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-light);
    font-size: 13px;
}
.cal-task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    cursor: default;
}
.cal-task-item:hover { background: var(--bg-body); transform: translateX(2px); }
.cal-task-item[data-action] { cursor: pointer; }
.cal-task-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}
.cal-task-info { flex: 1; min-width: 0; }
.cal-task-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.cal-task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--text-sub);
}
.cal-task-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
/* Panel de detalle del día */
.cal-day-panel {
    margin: 0 24px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}
.cal-day-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    text-transform: capitalize;
}
.cal-day-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: var(--transition);
}
.cal-day-close:hover { background: var(--bg-body); }
.cal-day-close svg { width: 16px; height: 16px; }
.cal-day-tasks {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    flex-wrap: wrap;
}
.cal-day-task-card {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
    padding: 12px 14px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}
.cal-day-task-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}
.cal-day-task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-sub);
}
/* ============================================
   DASHBOARD DE ESTADÍSTICAS (BLOQUE 3)
============================================ */
#stats-section {
    max-width: none;
    margin: 0;
    padding: 24px;
}
/* KPIs */
.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.stats-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    transition: var(--transition);
}
.stats-kpi-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.stats-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stats-kpi-icon svg { width: 22px; height: 22px; }
.stats-kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}
.stats-kpi-label {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 500;
}
/* Filas de gráficas */
.stats-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.stats-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.stats-chart-wide {
    /* ocupa 1 columna en grid de 2 */
}
.stats-chart-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stats-chart-body {
    height: 200px;
    position: relative;
}
/* Alumnos sin actividad */
.stats-alert-card {
    background: var(--bg-card);
    border: 1px solid var(--error);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}
.stats-alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--error-light);
    font-size: 13px;
    font-weight: 600;
    color: var(--error);
    border-bottom: 1px solid var(--error);
}
.stats-alert-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0;
}
.stats-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    transition: background 0.15s;
}
.stats-alert-item:hover { background: var(--bg-body); }
.stats-alert-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--error-light);
    color: var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.stats-alert-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}
.stats-alert-meta {
    font-size: 11.5px;
    color: var(--text-sub);
}
/* ---- Feedback IA en lista de calificaciones ---- */
.ia-feedback-summary {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--secondary);
    line-height: 1.4;
    max-width: 100%;
}
.ia-feedback-summary svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--secondary);
}
.ia-feedback-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
/* ---- Auto-refresh indicator ---- */
.refresh-indicator {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: var(--success);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(52,168,83,0.4);
    transition: transform 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}
.refresh-indicator svg { width: 14px; height: 14px; }
.refresh-indicator.visible {
    transform: translateX(-50%) translateY(0);
}
/* ============================================
   ESTADOS DE ENTREGA DE TAREAS (ALUMNO)
============================================ */
/* Badge "Entregado" — verde azulado */
.badge-submitted {
    background: #e0f2fe;
    color: #0369a1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
/* Badge "Pendiente" */
.badge-pending {
    background: var(--bg-body);
    color: var(--text-sub);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-success {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
/* Bloque de estado con meta de entrega */
.task-status-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.task-submission-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-sub);
    white-space: nowrap;
}
/* Botón Anular entrega — rojo suave */
.btn-cancel-submission {
    background: transparent;
    border: 1px solid var(--error, #ef4444);
    color: var(--error, #ef4444);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s, color 0.15s;
}
.btn-cancel-submission:hover {
    background: var(--error-light, #fee2e2);
    color: var(--error, #ef4444);
}
/* Botón Volver a entregar — outline neutro */
.btn-resubmit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-sub);
    border-color: var(--border);
}
.btn-resubmit:hover {
    border-color: var(--primary);
    color: var(--primary);
}
/* Botón Entregar Tarea */
.btn-deliver {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
/* ============================================
   ENTREGA DE MÚLTIPLES ARCHIVOS
============================================ */
.multi-file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-body);
    user-select: none;
}
.multi-file-drop-zone:hover,
.multi-file-drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}
.multi-file-drop-zone.drag-over {
    border-style: solid;
}
.multi-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.mf-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    animation: ctFadeIn 0.15s ease;
}
.mf-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
}
.mf-size {
    font-size: 11px;
    color: var(--text-sub);
    white-space: nowrap;
}
.mf-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-sub);
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}
.mf-remove:hover {
    color: var(--error);
    background: var(--error-light);
}
/* ============================================
   MODAL SELECTOR DE TIPO DE FORMULARIO
============================================ */
.qsel-card {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    padding: 32px 28px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: ctFadeIn 0.2s ease;
}
.qsel-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border-radius: 50%; border: none;
    background: transparent; cursor: pointer;
    color: var(--text-sub);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.qsel-close:hover { background: var(--bg-body); }
.qsel-close svg { width: 16px; height: 16px; }
.qsel-header {
    text-align: center;
    margin-bottom: 28px;
}
.qsel-logo {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg,#667eea,#764ba2);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    color: white;
}
.qsel-logo svg { width: 26px; height: 26px; }
.qsel-header h2 { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.qsel-header p  { font-size: 13px; color: var(--text-sub); margin: 0; }
.qsel-options { display: flex; flex-direction: column; gap: 0; }
.qsel-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    margin-bottom: 2px;
    background: var(--bg-card);
}
.qsel-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 2px 12px rgba(26,115,232,0.1);
}
.qsel-option-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
}
.qsel-option-icon svg { width: 22px; height: 22px; }
.qsel-option-body { flex: 1; min-width: 0; }
.qsel-option-title {
    font-size: 15px; font-weight: 600; color: var(--text-main);
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.qsel-badge {
    background: var(--primary); color: #fff;
    font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
    padding: 2px 8px; border-radius: 10px; text-transform: uppercase;
}
.qsel-option-desc { font-size: 12px; color: var(--text-sub); line-height: 1.5; margin-bottom: 8px; }
.qsel-option-features {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.qsel-option-features span {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--success); font-weight: 500;
}
.qsel-divider {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-sub); font-size: 12px;
    margin: 10px 0;
}
.qsel-divider::before, .qsel-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
/* ============================================
   GOOGLE FORMS STYLE QUIZ BUILDER
============================================ */
.gf-modal { display: flex; flex-direction: column; background: #f0ebf8; }
/* Header */
.gf-header {
    background: #fff;
    border-bottom: 4px solid #673AB7;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.gf-header-left { display: flex; align-items: center; gap: 12px; }
.gf-header-brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 600; color: #673AB7;
}
.gf-header-center {
    flex: 1;
    display: flex; flex-direction: column; gap: 4px;
}
.gf-title-input {
    border: none; outline: none;
    font-size: 22px; font-weight: 600;
    color: var(--text-main);
    background: transparent;
    border-bottom: 2px solid transparent;
    padding: 4px 0;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s;
}
.gf-title-input:focus { border-bottom-color: #673AB7; }
.gf-title-input::placeholder { color: #aaa; font-weight: 400; }
.gf-desc-input {
    border: none; outline: none;
    font-size: 14px; color: var(--text-sub);
    background: transparent;
    border-bottom: 1px solid transparent;
    padding: 2px 0;
    font-family: inherit; width: 100%;
    transition: border-color 0.2s;
}
.gf-desc-input:focus { border-bottom-color: #673AB7; }
.gf-header-right { display: flex; align-items: center; gap: 8px; }
.gf-publish-btn { border-radius: 20px !important; padding: 8px 20px !important; }
/* Body */
.gf-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}
/* Panel preguntas */
.gf-questions-panel {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
}
/* Barra de tipo */
.gf-type-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 24px;
    padding: 6px 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}
.gf-type-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px; border: none;
    background: transparent; font-size: 13px; font-weight: 500;
    color: var(--text-sub); cursor: pointer; transition: all 0.15s;
}
.gf-type-btn:hover { background: #f0ebf8; color: #673AB7; }
.gf-type-btn.active { background: #673AB7; color: #fff; }
.gf-type-ai { color: #673AB7; background: #f0ebf8; margin-left: 4px; }
.gf-type-ai:hover { background: #673AB7; color: #fff; }
/* Contenedor preguntas */
.gf-questions-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
/* Tarjeta de pregunta estilo Google Forms */
.gf-question-card {
    background: #fff;
    border-radius: 8px;
    border-left: 6px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    padding: 24px 24px 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
    cursor: default;
}
.gf-question-card.focused {
    border-left-color: #673AB7;
    box-shadow: 0 3px 12px rgba(103,58,183,0.15);
}
.gf-question-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.gf-question-input {
    flex: 1;
    font-size: 15px;
    font-weight: 400;
    border: none;
    border-bottom: 1px solid #dadce0;
    padding: 8px 0;
    background: #f8f9fa;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
    border-radius: 4px 4px 0 0;
    padding: 8px 12px;
    width: 100%;
}
.gf-question-input:focus {
    border-bottom-color: #673AB7;
    background: #fff;
}
.gf-q-type-select {
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-main);
    background: #fff;
    outline: none;
    cursor: pointer;
    min-width: 160px;
    transition: border-color 0.2s;
}
.gf-q-type-select:focus { border-color: #673AB7; }
/* Opciones */
.gf-options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.gf-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    border-radius: 4px;
    transition: background 0.1s;
}
.gf-option-row:hover { background: #f8f9fa; }
.gf-option-radio {
    width: 18px; height: 18px;
    border: 2px solid #dadce0;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #673AB7;
}
.gf-option-radio.checkbox-style { border-radius: 3px; }
.gf-option-text-input {
    flex: 1; border: none;
    border-bottom: 1px solid transparent;
    padding: 6px 4px;
    font-size: 14px;
    color: var(--text-main);
    background: transparent;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
.gf-option-text-input:focus { border-bottom-color: #673AB7; }
.gf-option-remove {
    opacity: 0.35;
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1px solid #dadce0;
    background: #fff;
    cursor: pointer;
    color: var(--text-sub);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.gf-option-row:hover .gf-option-remove,
.gf-option-remove:focus { opacity: 1; }
.gf-option-remove:hover { background: #fee2e2; color: var(--error); border-color: var(--error); opacity: 1; }
.gf-correct-badge {
    font-size: 11px; font-weight: 600;
    color: #0f9d58; background: #e6f4ea;
    padding: 2px 8px; border-radius: 10px;
    display: none;
}
.gf-option-row.is-correct .gf-correct-badge { display: inline-flex; }
.gf-add-option-btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-sub);
    background: transparent; border: none;
    cursor: pointer; padding: 6px 4px;
    border-radius: 4px; transition: color 0.15s;
}
.gf-add-option-btn:hover { color: #673AB7; }
/* Respuesta abierta / corta */
.gf-open-preview {
    padding: 10px 0;
    border-bottom: 1px dashed #dadce0;
    color: #aaa;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 8px;
}
.gf-ideal-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: #673AB7; margin: 12px 0 6px;
}
.gf-ideal-input {
    width: 100%; border: 1px solid #dadce0;
    border-radius: 4px; padding: 8px 12px;
    font-size: 13px; background: #f8f9fa;
    color: var(--text-main); outline: none;
    font-family: inherit; resize: vertical;
    min-height: 64px; transition: border-color 0.2s;
}
.gf-ideal-input:focus { border-color: #673AB7; background: #fff; }
/* Footer de la tarjeta */
.gf-question-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid #e8eaed;
    margin-top: 12px;
}
.gf-q-action {
    width: 34px; height: 34px; border-radius: 8px;
    border: 1.5px solid #dadce0;
    background: #fff;
    cursor: pointer;
    color: #5f6368;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.gf-q-action:hover { background: #f0ebf8; color: #673AB7; border-color: #673AB7; }
.gf-q-action.danger { color: #5f6368; }
.gf-q-action.danger:hover { background: #fee2e2; color: #d93025; border-color: #d93025; }
.gf-q-action svg { width: 15px; height: 15px; stroke: currentColor; }
.gf-q-points {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-sub);
    margin-right: auto;
}
.gf-q-points-input {
    width: 56px; border: 1px solid #dadce0;
    border-radius: 4px; padding: 4px 8px;
    font-size: 13px; text-align: center;
    background: #fff; outline: none;
    transition: border-color 0.2s;
}
.gf-q-points-input:focus { border-color: #673AB7; }
.gf-q-required {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-sub);
}
/* Botón agregar */
.gf-add-question-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; width: 100%;
    padding: 14px;
    background: #fff; border: 2px dashed #dadce0;
    border-radius: 8px; cursor: pointer;
    font-size: 14px; font-weight: 500;
    color: #673AB7; transition: all 0.15s;
}
.gf-add-question-btn:hover {
    border-color: #673AB7;
    background: #f0ebf8;
}
/* Sidebar */
.gf-sidebar {
    width: 260px;
    min-width: 220px;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255,255,255,0.6);
    border-left: 1px solid rgba(103,58,183,0.15);
}
.gf-sidebar-section {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.gf-sidebar-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: #673AB7; margin-bottom: 12px;
}
.gf-sidebar-row {
    display: flex; align-items: center;
    gap: 8px; padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.gf-sidebar-row:last-child { border-bottom: none; }
.gf-sidebar-row-col { flex-direction: column; align-items: flex-start; }
.gf-sidebar-key {
    display: flex; align-items: center; gap: 6px;
    color: var(--text-sub); font-size: 12px; font-weight: 500;
}
.gf-sidebar-val { font-weight: 600; color: var(--text-main); margin-left: auto; }
@media (max-width: 700px) {
    .gf-sidebar { display: none; }
    .gf-header-center { display: none; }
    .gf-header-brand span { display: none; }
    .qsel-option-desc { display: none; }
}
/* ============================================
   BOTONES DE ACCIÓN EN DROP ZONE (ARCHIVO/CÁMARA)
============================================ */
.mf-action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}
.mf-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.mf-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.mf-action-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.mf-action-camera {
    border-color: #0ea5e9;
    color: #0ea5e9;
}
.mf-action-camera:hover {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}
.mf-action-video {
    border-color: #8b5cf6;
    color: #8b5cf6;
}
.mf-action-video:hover {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #7c3aed;
}
/* Preview de imagen en la lista de archivos */
.mf-item img {
    border: 1px solid var(--border);
}
/* Texto de respaldo en botones de acción del quiz builder
   Se oculta si Lucide cargó el SVG correctamente */
.gf-q-action .gf-btn-fallback {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: none;
}
/* Si NO hay SVG renderizado (Lucide falló), mostrar fallback */
.gf-q-action:not(:has(svg)) .gf-btn-fallback {
    display: inline;
}
/* Separador visual entre puntos/obligatoria y botones de acción */
.gf-q-action-sep {
    width: 1px;
    height: 20px;
    background: #e0e0e0;
    margin: 0 4px;
}
/* ============================================
   SECCIÓN CALIFICACIONES DEL ALUMNO
============================================ */
.alumno-notas-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}
.an-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}
.an-kpi-card:hover { box-shadow: var(--shadow-hover); }
.an-kpi-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
}
.an-kpi-icon svg { width: 20px; height: 20px; }
.an-kpi-val {
    font-size: 32px; font-weight: 800; line-height: 1;
    margin-bottom: 6px;
}
.an-kpi-label {
    font-size: 12px; color: var(--text-sub); font-weight: 500;
}
.an-tasks-table {
    display: flex; flex-direction: column; gap: 0;
}
.an-tasks-header {
    display: grid;
    grid-template-columns: 1fr 120px 130px 160px;
    gap: 16px;
    padding: 10px 16px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-sub);
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}
.an-task-row {
    display: grid;
    grid-template-columns: 1fr 120px 130px 160px;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    transition: background 0.1s;
}
.an-task-row:hover { background: var(--bg-body); }
.an-task-row:last-child { border-bottom: none; }
.an-feedback {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--text-sub);
    margin-top: 4px; font-style: italic;
}
.an-feedback svg { flex-shrink: 0; }
/* Ocultar texto fallback del botón de eliminar opción cuando SVG está presente */
.gf-option-remove:has(svg) span { display: none; }
.gf-option-remove:not(:has(svg)) i { display: none; }
/* ============================================
   BOTÓN INICIAR SESIÓN CON GOOGLE
============================================ */
.btn-google-signin {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 20px;
    border: 1.5px solid #dadce0;
    border-radius: 8px;
    background: #fff;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    margin-top: 4px;
}
.btn-google-signin:hover {
    background: #f8f9fa;
    border-color: #c6c6c6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.btn-google-signin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-google-signin svg { flex-shrink: 0; }
/* Separador "o" entre métodos de login */
.google-signin-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px;
    color: var(--text-sub);
    font-size: 13px;
}
.google-signin-divider::before,
.google-signin-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
/* Dark mode */
body.dark-mode .btn-google-signin {
    background: #2d2d2d;
    border-color: #3c4043;
    color: #e8eaed;
}
body.dark-mode .btn-google-signin:hover {
    background: #3c4043;
}
/* Versión alumno (fondo más claro) */
.alumno-page .btn-google-signin {
    background: #fff;
    border-radius: 12px;
    font-size: 14px;
}
/* ============================================
   MODAL CONFIGURACIÓN DE CLASE
============================================ */
.ec-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin: -8px -32px 20px;
    padding: 0 32px;
    overflow-x: auto;
}
.ec-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.ec-tab:hover { color: var(--text-main); }
.ec-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ec-tab-panel { display: none; }
.ec-tab-panel.active { display: block; animation: ctFadeIn 0.15s ease; }
/* Color picker */
.ec-color-picker {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.ec-color-swatch {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.ec-color-swatch:hover { transform: scale(1.15); }
.ec-color-swatch.active { border-color: #333; transform: scale(1.1); }
/* Temas */
.ec-tema-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.ec-tema-row .ec-tema-del {
    flex-shrink: 0;
    color: var(--text-sub);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.ec-tema-row .ec-tema-del:hover { color: var(--error); border-color: var(--error); background: var(--error-light); }
/* Colaboradores */
.ec-colab-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--bg-card);
}
.ec-colab-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
/* ── Botón Configurar clase en el banner ── */
.btn-class-settings {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1.5px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}
.btn-class-settings:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.7);
}
/* ============================================
   MEJORAS GENERALES v2.0
   Task cards, file viewer, submission preview
============================================ */
/* ── Submission preview — multiple files ── */
.submission-preview-container {
    width: 100%;
    overflow-y: auto;
    padding: 16px;
    max-height: 60vh;
}
.submission-preview-container img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.submission-preview-container video {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin-bottom: 16px;
}
.submission-file-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    padding: 6px 0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--border-light);
}
/* ── Task card student — better mobile ── */
.task-card-student {
    border-radius: 12px;
    transition: box-shadow 0.2s;
}
.task-card-student:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.badge-submitted {
    background: #e8f5e9;
    color: #2e7d32;
}
.badge-pending {
    background: #fff8e1;
    color: #f57f17;
}
.task-submission-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-sub);
    margin-left: 6px;
}
/* ── Material card — left accent border ── */
.task-card-student[style*="border-left"] {
    background: var(--bg-card);
}
/* ── Alumno notas — KPI cards ── */
.alumno-notas-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.an-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: box-shadow 0.2s;
}
.an-kpi-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.an-kpi-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.an-kpi-icon svg, .an-kpi-icon i { width: 22px; height: 22px; }
.an-kpi-val {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}
.an-kpi-label {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 500;
}
.an-tasks-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.an-tasks-header {
    display: grid;
    grid-template-columns: 1fr 100px 120px 140px;
    gap: 12px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border);
    margin-bottom: 4px;
}
.an-task-row {
    display: grid;
    grid-template-columns: 1fr 100px 120px 140px;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
}
.an-task-row:hover { background: var(--bg-body); border-radius: 8px; }
.an-feedback {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 4px;
    line-height: 1.4;
}
/* ── Login screen spinner ── */
#login-checking {
    padding: 48px 20px;
    text-align: center;
}
/* ── Grading interface improvements ── */
#grading-main-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: calc(100vh - 220px);
    overflow: hidden;
}
#grading-main-container:not(.hidden) {
    display: grid;
}
.grading-student-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.grading-submission-viewer {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#grading-student-list-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-y: auto;
}
#grading-main-container #grading-submission-viewer {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    overflow-y: auto;
}
/* ============================================
   AI PROVIDER BADGE
============================================ */
/* AI Provider Badge (duplicate removed — kept inline version below) */
.ai-badge-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(230,138,0,0.3);
    border-top-color: #e68a00;
    border-radius: 50%;
    animation: ai-spin 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(230,138,0,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(230,138,0,0); }
}
.student-submission-item {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}
.student-submission-item:hover {
    background: var(--bg-body);
}
.student-submission-item.active {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}
/* Asegurar que los SVGs de Lucide dentro de botones no bloqueen clics */
#grading-student-list-container button svg,
#grading-student-list-container button i,
.student-submission-item button svg,
.student-submission-item button i {
    pointer-events: none;
}
/* El botón ojo debe ser siempre clickeable */
[data-action="openSubmissionPreviewFromGrading"] {
    cursor: pointer;
    position: relative;
    z-index: 1;
}
/* ── Analytics Dashboard ── */
.analytics-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.analytics-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.analytics-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.analytics-card-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}
.analytics-card-icon.success {
    background: var(--success-light);
    color: var(--success);
}
.analytics-card-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}
.analytics-card-icon.error {
    background: var(--error-light);
    color: var(--error);
}
.analytics-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}
.analytics-card-label {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 500;
}
.analytics-risk-students {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}
.analytics-risk-students h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.analytics-risk-table {
    width: 100%;
    border-collapse: collapse;
}
.analytics-risk-table th {
    text-align: left;
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    border-bottom: 2px solid var(--border);
}
.analytics-risk-table td {
    padding: 12px 8px;
    font-size: 13px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-light);
}
.risk-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.risk-badge.alto {
    background: var(--error-light);
    color: var(--error);
}
.risk-badge.medio {
    background: var(--warning-light);
    color: var(--warning);
}
.risk-badge.bajo {
    background: var(--success-light);
    color: var(--success);
}
.analytics-class-comparison {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}
.analytics-class-comparison h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
}
.analytics-class-table {
    width: 100%;
    border-collapse: collapse;
}
.analytics-class-table th {
    text-align: left;
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    border-bottom: 2px solid var(--border);
}
.analytics-class-table td {
    padding: 12px 8px;
    font-size: 13px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-light);
}
.performance-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    width: 100px;
}
.performance-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}
.performance-bar-fill.high {
    background: var(--success);
}
.performance-bar-fill.medium {
    background: var(--warning);
}
.performance-bar-fill.low {
    background: var(--error);
}
.ia-feedback-summary {
    font-size: 11px;
    color: var(--text-sub);
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-top: 3px;
    line-height: 1.4;
    max-width: 300px;
}
/* ── Quick grade panel ── */
.quick-grade-ia-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-body);
    color: var(--text-sub);
}
.quick-grade-ia-badge.ia-ready {
    background: var(--success-light);
    color: var(--success);
}
.quick-grade-ia-badge.ia-error {
    background: var(--error-light);
    color: var(--error);
}
/* ── EC Tabs (class config modal) ── */
.ec-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    padding: 0 4px;
}
.ec-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-sub);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    border-radius: 6px 6px 0 0;
}
.ec-tab:hover { color: var(--primary); }
.ec-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.ec-tab-panel { display: none; padding-bottom: 4px; }
.ec-tab-panel.active { display: block; }
/* ── Collaborator rows ── */
.ec-colab-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--bg-body);
    margin-bottom: 8px;
}
.ec-colab-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
.ec-tema-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.ec-tema-row .form-control { flex: 1; }
.ec-color-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ec-color-swatch {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.ec-color-swatch:hover { transform: scale(1.15); }
.ec-color-swatch.active { border-color: var(--text-main); transform: scale(1.1); }
/* ── Notification improvements ── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-light);
}
.notif-item:hover { background: var(--bg-body); }
.notif-item.notif-unread { background: var(--primary-light); }
.notif-item.notif-read { opacity: 0.7; }
.notif-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 2px; }
.notif-msg { font-size: 12px; color: var(--text-sub); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-sub); margin-top: 4px; }
.notif-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 4px;
}
.notif-empty {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 32px;
    color: var(--text-sub); font-size: 13px;
}
/* ── Comment thread ── */
.comment-thread { padding: 16px 0; border-top: 1px solid var(--border-light); }
.comment-thread-header {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--text-sub);
    margin-bottom: 12px;
}
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment-item { display: flex; gap: 8px; align-items: flex-start; }
.comment-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author { font-size: 12px; font-weight: 600; }
.comment-text { font-size: 13px; line-height: 1.5; color: var(--text-main); }
.comment-time { font-size: 11px; color: var(--text-sub); }
.comment-input-row { display: flex; gap: 8px; }
.comment-input-row textarea {
    flex: 1; resize: none; min-height: 60px;
    font-size: 13px;
}
/* ── Refresh indicator ── */
#refresh-indicator {
    position: fixed;
    bottom: 20px; right: 20px;
    background: var(--text-main);
    color: var(--bg-card);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px; font-weight: 600;
    display: none;
    align-items: center; gap: 6px;
    z-index: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* ─── ALUMNO: Notas — mobile: simplificar grid de tareas ─── */
@media (max-width: 768px) {
    #alumno-tasks-container {
        padding-bottom: 80px;
    }
    .an-tasks-header,
    .an-task-row {
        grid-template-columns: 1fr 80px;
    }
    .an-task-row > :nth-child(3),
    .an-tasks-header > :nth-child(3),
    .an-task-row > :nth-child(4),
    .an-tasks-header > :nth-child(4) {
        display: none;
    }
}
/* ============================================
   D — UI/UX IMPROVEMENTS
   Better cards · Grade display · Dashboard
   Animations · Empty states · Accessibility
============================================ */
/* ── Class cards — hover lift ─────────────────────────────── */
.class-card {
    transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.18s ease;
}
.class-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.14);
}
.class-card:active { transform: translateY(-1px); }
/* ── Grade display — color-coded number ──────────────────── */
.grade-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 800;
    font-size: 18px;
    line-height: 1;
}
.grade-display.grade-excellent { color: #34a853; }
.grade-display.grade-good      { color: #1a73e8; }
.grade-display.grade-warning   { color: #f9ab00; }
.grade-display.grade-fail      { color: #d93025; }
/* ── Grade progress bar ──────────────────────────────────── */
.grade-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
    margin-top: 6px;
}
.grade-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.grade-progress-fill.excellent { background: linear-gradient(90deg, #34a853, #4caf50); }
.grade-progress-fill.good      { background: linear-gradient(90deg, #1a73e8, #4285f4); }
.grade-progress-fill.warning   { background: linear-gradient(90deg, #f9ab00, #ffc107); }
.grade-progress-fill.fail      { background: linear-gradient(90deg, #d93025, #ef5350); }
/* ── Empty state — placeholder con ilustración ───────────── */
.placeholder-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    color: var(--text-sub);
    text-align: center;
    gap: 12px;
}
.placeholder-pane i,
.placeholder-pane svg {
    width: 48px !important;
    height: 48px !important;
    opacity: 0.35;
    stroke-width: 1.5;
}
.placeholder-pane p {
    font-size: 15px;
    font-weight: 500;
    opacity: 0.7;
    margin: 0;
    max-width: 280px;
    line-height: 1.5;
}
.placeholder-pane .placeholder-action {
    margin-top: 4px;
}
/* ── Toast mejorado ──────────────────────────────────────── */
.toast {
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18) !important;
    backdrop-filter: blur(8px);
}
/* ── Skeleton loading ────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}
.skeleton {
    background: linear-gradient(
        90deg,
        var(--border) 25%,
        var(--bg-body) 50%,
        var(--border) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: 6px;
}
/* ── Feedback de nota en tarjeta de alumno ───────────────── */
.task-grade-feedback-block {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--bg-body);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.6;
}
.task-grade-feedback-block .feedback-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-sub);
    margin-bottom: 4px;
}
/* ── Animación de entrada para secciones ─────────────────── */
@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.content-section.active {
    animation: sectionFadeIn 0.25s ease-out;
}
/* ── Dashboard widget — título con línea lateral ─────────── */
.widget-title-accent {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
    margin-bottom: 16px;
}
/* ── Badge mejorados ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.badge-success  { background: var(--success-light, #dcfce7); color: var(--success, #16a34a); }
.badge-warning  { background: var(--warning-light, #fef9c3); color: var(--warning, #ca8a04); }
.badge-error    { background: var(--error-light, #fee2e2);   color: var(--error, #dc2626); }
.badge-primary  { background: var(--primary-light, #dbeafe); color: var(--primary, #1a73e8); }
.badge-pending  { background: #fff8e1; color: #f57f17; }
.badge-submitted{ background: #e8f5e9; color: #2e7d32; }
/* ── Botones — micro-interacciones ───────────────────────── */
.btn {
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn:active:not(:disabled) {
    transform: scale(0.97);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(26,115,232,0.3);
}
/* ── Header summary — animación cuando cambia ────────────── */
#header-summary {
    transition: opacity 0.2s;
}
/* ── Notif badge — pulse animation ──────────────────────── */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.25); }
}
.notif-badge[style*="display: block"],
.notif-badge:not([style*="none"]) {
    animation: badgePulse 2s ease-in-out 1;
}
/* ── Input focus — ring consistente ─────────────────────── */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
    outline: none;
}
/* ── Section header — sticky en desktop ─────────────────── */
@media (min-width: 769px) {
    .section-header {
        position: sticky;
        top: 0;
        background: var(--bg-body);
        z-index: 10;
        padding-top: 8px;
        padding-bottom: 8px;
        margin-bottom: 16px;
        border-bottom: 1px solid var(--border-light);
    }
}
/* ── Snackbar/Toast container ────────────────────────────── */
.toast-container {
    z-index: 9998 !important;
}
/* ── Accessibility — focus ring visible ─────────────────── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}
/* ── Dark mode refinements ───────────────────────────────── */
body.dark-mode .task-grade-feedback-block {
    background: rgba(255,255,255,0.05);
}
body.dark-mode .section-header {
    background: var(--bg-body);
}
body.dark-mode .placeholder-pane i,
body.dark-mode .placeholder-pane svg {
    opacity: 0.2;
}
body.dark-mode .post-card:hover { border-color: rgba(255,255,255,0.08); }
body.dark-mode .tablon-composer-input:focus { box-shadow: 0 0 0 3px rgba(26,115,232,0.2); }
body.dark-mode .post-action-btn:hover { background: rgba(255,255,255,0.05); }
body.dark-mode .tablon-empty svg { opacity: 0.15; }
@media (max-width: 768px) {
    /* ─── SHARED (Docente + Alumno) ─── Global layout mobile ─── */
    .main-content {
        padding: 4px 0;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    .content-section {
        margin: 0;
        padding: 0;
    }
    .section-header {
        flex-direction: column;
        align-items: stretch;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .section-header .header-actions {
        width: 100%;
    }
    /* ─── DOCENTE: Tareas - header y layout ─── */
    #profesor-tareas .section-header {
        padding: 8px 0 0 !important;
    }
    #profesor-tareas .section-header h2 {
        font-size: 18px;
    }
    /* ─── DOCENTE: Calificaciones - lista de alumnos ─── */
    #grading-main-container .grading-student-list {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    /* ─── DOCENTE: Tareas - grid layout → block en mobile ─── */
    .tasks-layout {
        display: block !important;
        height: auto !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }
    .tasks-list-pane {
        border-right: none;
        border-bottom: none;
        padding: 4px 0;
        overflow: visible;
        height: auto;
    }
    .task-list-item {
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 8px 0 !important;
        margin: 0 !important;
    }
    .task-list-item + .task-list-item {
        border-top: none !important;
    }
    /* ─── DOCENTE: Tareas - detalle de tarea en mobile ─── */
    .task-detail-view-pane {
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 4px 0 !important;
        overflow: visible !important;
        height: auto !important;
        position: relative !important;
        z-index: auto !important;
    }
    .task-detail-card {
        border: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        box-shadow: none !important;
        background: transparent !important;
        position: relative !important;
        z-index: auto !important;
    }
    .task-detail-header {
        border-bottom: 1px solid var(--border) !important;
        padding: 8px 4px !important;
        flex-wrap: wrap;
        gap: 8px;
        background: transparent !important;
        position: relative !important;
        z-index: auto !important;
    }
    .task-detail-header-info h3 {
        font-size: 15px !important;
        position: relative;
        z-index: auto;
    }
    .task-detail-body {
        padding: 8px 4px !important;
        position: relative !important;
        z-index: auto !important;
    }
    .task-detail-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .task-detail-section-label {
        margin-bottom: 4px;
    }
    .task-description {
        position: relative;
    }
    /* ─── DOCENTE: Asistencia - botones y contenedor ─── */
    .attendance-header .header-actions {
        flex-wrap: wrap;
        gap: 8px;
        padding: 0 !important;
    }
    .attendance-header .header-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 13px;
        padding: 8px 10px;
    }
    #attendance-table-container {
        overflow-x: auto;
    }
    .attendance-student-row {
        flex-wrap: wrap;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 4px 0 !important;
    }
    .name-wrap {
        flex: 1;
        min-width: 120px;
    }
    .name-wrap .name-dots {
        display: none;
    }
    .attendance-student-row .status-button-group {
        width: 100%;
        justify-content: center;
        padding-top: 4px;
    }
    /* ─── SHARED: Banner de clase ─── */
    .class-header-banner {
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 12px 4px !important;
        flex-wrap: wrap;
        gap: 8px;
        border-bottom: none !important;
    }
    .class-banner-code {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        gap: 4px !important;
    }
    .class-banner-code-label {
        display: none !important;
    }
    .class-banner-code-copy {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        font-size: 12px !important;
        color: rgba(255,255,255,0.8) !important;
    }
    .btn-class-settings {
        background: transparent !important;
        border: none !important;
    }
    .class-banner-info h2 {
        font-size: 18px !important;
    }
    /* ─── SHARED: Navegación de secciones (tabs: Tablón, Tareas, etc.) ─── */
    #class-content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }
    #sidebar-nav {
        gap: 0 !important;
        padding: 4px 0 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        background: transparent !important;
        margin: 0 !important;
    }
    #sidebar-nav .nav-item {
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }
    #sidebar-nav .nav-item.active {
        background: transparent !important;
        color: var(--primary) !important;
        box-shadow: none !important;
        border-bottom: 2px solid var(--primary) !important;
    }
    /* ─── DOCENTE: Menú crear clase ─── */
    .classroom-create-menu {
        width: 100% !important;
    }
    .btn-classroom-create {
        width: 100% !important;
        justify-content: center !important;
    }
    .classroom-create-dropdown {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
    /* ─── SHARED: Reset global mobile ─── */
    body {
        padding: 0 !important;
        margin: 0 !important;
    }
    #main-app {
        padding: 0 !important;
        margin: 0 !important;
    }
    main {
        padding: 0 !important;
        margin: 0 !important;
    }
    .app-body {
        padding: 0 !important;
        margin: 0 !important;
    }
    /* ─── DOCENTE: Sidebar de clases — overlay deslizante en mobile ─── */
    /* NOTA: Este sidebar es SOLO del docente. En alumno.html se usa alumno-mobile.css */
    .classes-sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        z-index: 200 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.25s ease !important;
    }
    .classes-sidebar:not(.collapsed) {
        transform: translateX(0) !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15) !important;
    }
    .classes-sidebar.collapsed {
        transform: translateX(-100%) !important;
        width: 280px !important;
        overflow: hidden !important;
        border-right: none !important;
    }
    .main-content {
        padding: 12px 16px !important;
        min-width: 0 !important;
        width: 100% !important;
    }
}
/* ── AI Provider Badge ─────────────────────────────────────────── */
.ai-provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-secondary, #f0f4ff);
    border: 1px solid var(--border, #d0d7e0);
    color: var(--text-sub, #555);
    white-space: nowrap;
    transition: all 0.2s;
    cursor: default;
    user-select: none;
    letter-spacing: 0.02em;
}
.ai-provider-badge.processing {
    background: var(--secondary-light, #e8f0fe);
    border-color: var(--secondary, #4a90d9);
    color: var(--secondary, #4a90d9);
}
.ai-badge-content {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ai-badge-icon {
    font-size: 13px;
    line-height: 1;
}
.ai-badge-text {
    line-height: 1;
    text-transform: capitalize;
}
.ai-badge-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--secondary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: ai-spin 0.6s linear infinite;
}
@keyframes ai-spin {
    to { transform: rotate(360deg); }
}
/* ============================================
   QUITAR CAJAS alrededor de datos en secciones
   (excepto dashboard) — docente y alumno
   La información debe quedar libre, sin bordes,
   fondos ni sombras en los contenedores.
   ============================================ */
#profesor-tareas .tasks-layout,
#profesor-tareas .task-detail-card,
#profesor-tareas .quick-grade-panel,
#alumno-tareas .tasks-layout,
#alumno-tareas .task-detail-card,
#alumno-tareas .quick-grade-panel,
#profesor-calificaciones .grades-matrix-container,
#profesor-calificaciones .quick-grade-panel,
#alumno-notas .grades-matrix-container,
#alumno-notas .an-kpi-card,
#asistencia-section .attendance-student-row,
#students-section .student-card,
#stats-section .stats-kpi-card,
#stats-section .stats-chart-card,
#stats-section .stats-alert-card,
#calendario-section .cal-main,
#calendario-section .cal-sidebar,
#calendario-section .cal-day-panel,
#calendario-section .cal-day-panel.is-selected {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
/* Mantener padding en algunos elementos para espaciado */
#profesor-tareas .task-detail-card,
#profesor-calificaciones .grades-matrix-container,
#alumno-notas .grades-matrix-container,
#alumno-tareas .task-detail-card {
    padding: 0 !important;
}
/* Asistencia: mantener filas con su padding pero sin caja */
#asistencia-section .attendance-student-row {
    padding: 8px 0 !important;
    margin-bottom: 4px !important;
}
/* Estadísticas: mantener padding interior */
#stats-section .stats-kpi-card {
    padding: 16px 0 !important;
}
#stats-section .stats-chart-card {
    padding: 16px 0 !important;
}
#stats-section .stats-alert-card {
    padding: 12px 16px !important;
}
/* Alumnos: mantener padding */
#students-section .student-card {
    padding: 12px 0 !important;
}
/* Calendario: mantener paddings */
#calendario-section .cal-main {
    padding: 16px !important;
}
#calendario-section .cal-day-panel {
    padding: 16px !important;
}
/* ============================================
   MÓVIL: eliminar cajas con altura fija
   que atrapan el scroll y dejan los botones
   de navegación (tablon, tareas, notas, etc.)
   estáticos en la parte inferior.
   ============================================ */
@media (max-width: 768px) {
    /* Eliminar altura fija y scroll interno en TODOS los contenedores de sección */
    .tasks-layout,
    .cal-wrapper,
    .analytics-content,
    .stats-content,
    .attendance-content,
    .students-content,
    .classroom-content {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }
    /* Celulares: apilar panel de alumnos y visor de entregas en vertical */
    #grading-main-container {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        gap: 12px !important;
    }
    /* El listado de alumnos arriba, visor debajo */
    .grading-student-list {
        border-right: none !important;
        border-bottom: 1px solid var(--border);
    }
    /* La tabla de notas (alumno, nota, estado) se vuelve scrollable horizontalmente */
    .student-list-header,
    .student-submission-item {
        grid-template-columns: 32px 1fr 60px 70px 1fr !important;
        gap: 4px !important;
        padding: 8px 6px !important;
        font-size: 12px !important;
    }
    .student-list-header span,
    .student-list-header input {
        font-size: 11px !important;
    }
    /* Input de nota más compacto */
    .grade-input-list {
        width: 40px !important;
        font-size: 11px !important;
        height: 24px !important;
    }
    /* Los paneles internos también deben fluir */
    .tasks-list-pane,
    .task-detail-card,
    .task-detail-view-pane,
    .task-detail-section,
    #profesor-task-detail-pane,
    .cal-day-panel,
    .cal-sidebar {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
    }
    /* El main-content y app-body no deben tener scroll oculto */
    .app-body,
    main,
    .main-content {
        overflow: visible !important;
        height: auto !important;
    }
    /* Las secciones activas deben fluir sin altura fija */
    .content-section.active {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    /* La navegación de clase debe ser scrollable horizontalmente */
    .class-nav {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
    }
}
/* ============================================
   VISOR FLOTANTE DE ENTREGAS
============================================ */
.floating-viewer-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
    animation: fvFadeIn 0.2s ease;
}
@keyframes fvFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.floating-viewer-panel {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    animation: fvSlideUp 0.25s ease;
}
@keyframes fvSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.floating-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    background: var(--bg-body, #f8f9fa);
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 2;
}
.floating-viewer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.floating-viewer-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-sub, #666);
    padding: 4px 8px;
    border-radius: 8px;
    line-height: 1;
}
.floating-viewer-close:hover {
    background: var(--border-light, #eee);
    color: var(--text, #000);
}
.floating-viewer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    background: var(--bg-body, #f8f9fa);
    gap: 12px;
    position: sticky;
    top: 57px;
    z-index: 1;
}
.floating-viewer-nav .nav-info {
    font-size: 12px;
    color: var(--text-sub, #666);
    font-weight: 500;
}
.floating-viewer-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}
.floating-viewer-body img {
    max-width: 100%;
    border-radius: 8px;
    cursor: zoom-in;
    border: 1px solid var(--border-light, #eee);
}
.floating-viewer-body video {
    max-width: 100%;
    border-radius: 8px;
}
.floating-viewer-body iframe {
    width: 100%;
    min-height: 500px;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
}
.floating-viewer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border, #e0e0e0);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--bg-body, #f8f9fa);
    border-radius: 0 0 16px 16px;
}
.floating-viewer-file-group {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-body, #f8f9fa);
    border-radius: 12px;
    border: 1px solid var(--border-light, #e8eaed);
}
.floating-viewer-file-group .file-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
@media (max-width: 768px) {
    .floating-viewer-overlay {
        padding: 10px;
        align-items: flex-start;
    }
    .floating-viewer-panel {
        max-height: 95vh;
        border-radius: 12px;
    }
    .floating-viewer-header {
        padding: 12px 16px;
    }
    .floating-viewer-body {
        padding: 16px;
    }
}

/* ============================================
   TABLON - Posts redesign
============================================ */
.tablon-composer {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.tablon-composer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.tablon-composer-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.tablon-composer-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
}
.tablon-composer-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}
.tablon-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}
.tablon-composer-hint {
    font-size: 12px;
    color: var(--text-sub);
}

/* Post cards */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.post-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.post-header-info {
    flex: 1;
    min-width: 0;
}
.post-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    line-height: 1.3;
}
.post-date {
    font-size: 12px;
    color: var(--text-sub);
    display: block;
    margin-top: 1px;
}
.post-content {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    word-break: break-word;
}
.post-content p {
    margin: 0;
    white-space: pre-wrap;
}
.post-edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    background: var(--bg);
    color: var(--text);
    margin-top: 4px;
}
.post-edit-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

/* Post action buttons */
.post-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}
.post-card:hover .post-actions {
    opacity: 1;
}
.post-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    color: var(--text-sub);
    transition: all 0.15s;
}
.post-action-btn:hover { background: var(--bg); }
.post-action-btn.edit:hover { color: var(--primary); background: rgba(26,115,232,0.08); }
.post-action-btn.delete:hover { color: var(--error); background: rgba(220,38,38,0.08); }
.post-action-btn.save {
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
    width: auto;
    padding: 0 12px;
    border: 1px solid var(--primary);
}
.post-action-btn.save:hover { background: var(--primary); color: #fff; }
.post-action-btn.cancel {
    color: var(--text-sub);
    font-weight: 600;
    font-size: 12px;
    width: auto;
    padding: 0 12px;
    border: 1px solid var(--border);
}
.post-action-btn.cancel:hover { background: var(--bg); }

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
}
.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

/* Empty state */
.tablon-empty {
    text-align: center;
    padding: 48px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.tablon-empty p {
    font-weight: 600;
    color: var(--text);
    margin: 12px 0 4px;
    font-size: 15px;
}
.tablon-empty span {
    font-size: 13px;
    color: var(--text-sub);
}

.status-btn.qr-btn{background:var(--primary-light);color:var(--primary);border-color:transparent;}.status-btn.qr-btn:hover{background:var(--primary);color:#fff;}
