/* ═══════════════════════════════════════════════════════════════════
   UBUNTU PERÚ — PLATAFORMA E-LEARNING
   STYLES.CSS — ESTILOS GLOBALES, LAYOUT Y COMPONENTES
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Variables de Diseño (Design Tokens) ── */
:root {
    --ubuntu-green: #2D7A4F;
    --ubuntu-green-light: #e6f4ec;
    --ubuntu-orange: #D4842A;
    --ubuntu-yellow: #E8A838;

    --siemens-teal: #009999;
    --siemens-teal-light: #e0f5f5;
    --siemens-slate: #1E2225;
    --siemens-slate-light: #2A3034;

    --bg-body: #F4F5F7;
    --bg-card: #ffffff;
    --bg-sidebar: #1E2225;
    --text-primary: #1a1a1a;
    --text-secondary: #5a6b7c;
    --text-muted: #95a5a6;
    --border-color: #e2e8f0;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 2px 4px rgba(30, 34, 37, 0.04);
    --shadow-md: 0 6px 16px rgba(30, 34, 37, 0.08);
    --shadow-lg: 0 12px 32px rgba(30, 34, 37, 0.12);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ── 2. Reset y Base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* ── 3. Barra Lateral (Sidebar) ── */
.sidebar {
    width: 270px;
    min-width: 270px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

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

.sidebar-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.brand-ubuntu {
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.brand-alliance {
    color: var(--siemens-teal);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 10px 14px 4px;
    margin-top: 6px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
    touch-action: manipulation;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-item:hover {
    background: var(--siemens-slate-light);
    color: rgba(255, 255, 255, 0.95);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--siemens-teal), #00b3b3);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 153, 153, 0.3);
    font-weight: 600;
}

.nav-item .live-dot-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    animation: pulse-red 2s infinite;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ubuntu-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-role {
    color: var(--siemens-teal);
    font-size: 0.72rem;
    font-weight: 600;
}

.btn-logout {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-logout:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ── 4. Estructura Principal y Topbar ── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.topbar {
    height: 64px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    z-index: 10;
}

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

.mobile-menu-btn {
    display: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.search-box {
    position: relative;
    max-width: 440px;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    font-size: 0.875rem;
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--siemens-teal);
    background: #fff;
    box-shadow: 0 0 0 3px var(--siemens-teal-light);
}

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

/* ── 5. Área de Contenido y Vistas ── */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

.view-section {
    display: none;
    animation: fadeIn 0.35s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── 6. Botones (UI Elements) ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    touch-action: manipulation;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.8rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--siemens-teal), #00b3b3);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 153, 153, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 153, 153, 0.35);
}

.btn-green {
    background: linear-gradient(135deg, var(--ubuntu-green), #379562);
    color: #fff;
    box-shadow: 0 4px 12px rgba(45, 122, 79, 0.25);
}

.btn-green:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45, 122, 79, 0.35);
}

.btn-orange {
    background: linear-gradient(135deg, var(--ubuntu-orange), var(--ubuntu-yellow));
    color: #fff;
    box-shadow: 0 4px 12px rgba(212, 132, 42, 0.25);
}

.btn-orange:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 132, 42, 0.35);
}

.btn-outline {
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    background: #fff;
}

.btn-outline:hover {
    border-color: var(--siemens-teal);
    color: var(--siemens-teal);
    background: var(--siemens-teal-light);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline-danger {
    border: 1.5px solid #fca5a5;
    color: #ef4444;
    background: #fff;
}

.btn-outline-danger:hover {
    border-color: #ef4444;
    background: #fee2e2;
    color: #dc2626;
}

.btn-jitsi-live {
    background: linear-gradient(135deg, var(--siemens-teal), #00b3b3);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 153, 153, 0.25);
    font-weight: 700;
}

.btn-jitsi-live:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 153, 153, 0.4);
}

/* ── 7. Banner de Bienvenida (Hero) ── */
.welcome-banner {
    background: linear-gradient(135deg, var(--siemens-slate) 0%, #2A3034 100%);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    gap: 24px;
    box-shadow: var(--shadow-md);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 153, 153, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-greeting {
    color: var(--siemens-teal);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    margin-bottom: 8px;
    min-height: 1.2rem;
    line-height: 1.2;
}

.welcome-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.25;
}

.welcome-subtitle {
    font-size: 0.95rem;
    color: #94a3b8;
    max-width: 520px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.welcome-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 40px;
}

/* ── 8. Cabeceras de Sección y Filtros ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--siemens-slate);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-chip {
    padding: 7px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    background: var(--bg-card);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
}

.filter-chip:hover {
    border-color: var(--siemens-teal);
    color: var(--siemens-teal);
}

.filter-chip.active {
    background: var(--siemens-teal);
    color: #fff;
    border-color: var(--siemens-teal);
    box-shadow: 0 2px 8px rgba(0, 153, 153, 0.25);
}

/* ── 9. Grid y Tarjetas de Cursos ── */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
    margin-bottom: 36px;
}

.course-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    position: relative;
    touch-action: manipulation;
    will-change: transform;
}

.course-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: rgba(0, 153, 153, 0.3);
}

.course-img-wrapper {
    height: 165px;
    position: relative;
    overflow: hidden;
    background: #2A3034;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-icon-bg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.85);
    background: linear-gradient(135deg, #1E2225, #2D7A4F);
}

.course-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--siemens-teal);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.course-level-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.course-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-category {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--siemens-teal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.course-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── 10. Clases y Sesiones en Vivo (Live) ── */
.live-badge-now {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.live-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.live-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.live-card.active-now {
    border: 1.5px solid rgba(0, 153, 153, 0.4);
    position: relative;
    box-shadow: 0 6px 20px rgba(0, 153, 153, 0.08);
}

.live-card.active-now::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--siemens-teal);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.live-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.live-topic {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 6px 0 8px;
}

.live-instructor {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.live-time-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    background: var(--bg-body);
    padding: 8px 12px;
    border-radius: var(--radius-md);
}

.live-viewers-count {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ── 11. Modales de Alto Rendimiento ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, visibility 0.12s ease;
    will-change: opacity;
    contain: strict;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-box {
    background: #fff;
    width: 100%;
    max-width: 580px;
    border-radius: var(--radius-xl);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: translateY(10px) scale(0.98);
    transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1);
    will-change: transform;
    contain: layout style;
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 18px 24px;
    background: var(--siemens-slate);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: #fff;
}

.modal-box form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: var(--bg-body);
}

.form-control:focus {
    border-color: var(--siemens-teal);
    background: #fff;
    box-shadow: 0 0 0 3px var(--siemens-teal-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #fafafa;
    flex-shrink: 0;
}

/* ── 13. Caja de Creación Instantánea Jitsi ── */
.instant-jitsi-box {
    background: var(--siemens-teal-light);
    border: 1.5px solid var(--siemens-teal);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
    text-align: left;
}

.jitsi-url-display {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.jitsi-url-display input {
    flex: 1;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--siemens-slate);
    font-weight: 600;
    background: #fff;
}

/* ── 14. Sala de Clase en Vivo (Live Room) ── */
.live-room-modal {
    max-width: 1050px;
    height: 90vh;
}

.live-room-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.live-stream-area {
    flex: 1;
    background: #0d1117;
    display: flex;
    flex-direction: column;
    position: relative;
}

.live-stream-player {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    background: #000;
    overflow: hidden;
}

#jitsi-iframe-container {
    width: 100%;
    height: 100%;
}

/* ── 15. Sala Flotante Minimizada (Picture-in-Picture) ── */
.modal-overlay.minimized {
    background: transparent !important;
    backdrop-filter: none !important;
    pointer-events: none !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    padding: 24px !important;
}

.modal-overlay.minimized .modal-box {
    width: 380px !important;
    max-width: 380px !important;
    height: 260px !important;
    max-height: 260px !important;
    pointer-events: auto !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5) !important;
    border: 2.5px solid var(--siemens-teal) !important;
    animation: none !important;
}

.modal-overlay.minimized .modal-header {
    padding: 8px 12px !important;
    font-size: 0.75rem !important;
}

.modal-overlay.minimized .modal-header h3 {
    font-size: 0.8rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.modal-overlay.minimized .btn-minimize-text {
    display: none !important;
}

.modal-overlay.minimized .btn-maximize {
    display: inline-flex !important;
}

.modal-overlay.minimized .btn-minimize {
    display: none !important;
}

.btn-maximize {
    display: none !important;
}

/* ── 16. Notificaciones Toast y Animaciones ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: #1E2225;
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 4px solid var(--siemens-teal);
    animation: slideInRight 0.3s ease;
}

.toast.success {
    border-left-color: var(--ubuntu-green);
}

.toast.error {
    border-left-color: #ef4444;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── 17. Control de Acceso por Roles (RBAC UI) ── */
.role-teacher-only {
    display: none !important;
}

body.is-teacher .role-teacher-only {
    display: inline-flex !important;
}

body.is-teacher div.role-teacher-only,
body.is-teacher .sidebar-nav .role-teacher-only {
    display: flex !important;
}

body.is-teacher .nav-section-title.role-teacher-only {
    display: block !important;
}

.role-student-only {
    display: flex !important;
}

body.is-teacher .role-student-only {
    display: none !important;
}

/* ── Panel y Roles Administrativos (Admin: Todas las vistas desbloqueadas) ── */
.role-admin-only {
    display: none !important;
}

body.is-admin .role-admin-only {
    display: inline-flex !important;
}

body.is-admin div.role-admin-only,
body.is-admin .sidebar-nav .role-admin-only {
    display: flex !important;
}

body.is-admin .nav-section-title.role-admin-only {
    display: block !important;
}

/* El administrador tiene TODAS las vistas desbloqueadas (profesor, estudiante y admin) */
body.is-admin .role-student-only,
body.is-admin.is-teacher .role-student-only {
    display: flex !important;
}

body.is-admin .role-teacher-only {
    display: inline-flex !important;
}

body.is-admin div.role-teacher-only,
body.is-admin .sidebar-nav .role-teacher-only {
    display: flex !important;
}

body.is-admin .nav-section-title.role-teacher-only {
    display: block !important;
}

/* ── 18. Diseño Responsive ── */
@media(max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

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

    .mobile-menu-btn {
        display: block;
    }

    .content-area {
        padding: 18px;
    }

    .welcome-banner {
        flex-direction: column;
        padding: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .live-room-layout {
        flex-direction: column;
    }
}

/* ── 19. Panel de Reportes Administrativos (Admin Only) ── */
.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.report-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.report-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.report-stat-content {
    flex: 1;
    min-width: 0;
}

.report-stat-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 3px;
}

.report-stat-lbl {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.report-controls-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.report-course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.report-course-card:hover {
    box-shadow: var(--shadow-md);
}

.report-course-header {
    padding: 16px 20px;
    background: #fafbfc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.report-course-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.report-badge-count {
    background: rgba(0, 153, 153, 0.1);
    color: var(--siemens-teal);
    border: 1px solid rgba(0, 153, 153, 0.3);
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.report-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    text-align: left;
}

.report-table th {
    background: #f4f6f8;
    color: var(--text-secondary);
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-color);
}

.report-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.report-table tbody tr:last-child td {
    border-bottom: none;
}

.report-table tbody tr:hover {
    background: rgba(0, 153, 153, 0.02);
}

.report-teacher-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.report-teacher-header {
    padding: 18px 22px;
    background: linear-gradient(135deg, #1E2225 0%, #2A3036 100%);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.report-teacher-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ubuntu-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.report-search-box {
    flex: 0 1 440px;
    max-width: 440px;
}
.report-search-box:hover .search-input {
    border-color: var(--siemens-teal);
    box-shadow: 0 0 0 2px var(--siemens-teal-light);
}

.report-search-box:hover .search-icon {
    color: var(--siemens-teal);
}

/* ================= MODAL GUÍA DE USUARIO ESTUDIANTE ================= */
.modal-guide-box {
    max-width: 1050px !important;
    width: 95vw !important;
    height: 90vh !important;
    max-height: 90vh !important;
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.modal-guide-box .modal-header {
    background: linear-gradient(135deg, var(--siemens-slate) 0%, #0d3838 100%);
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Barra de pestañas (PDF / Video) */
.guide-tabs-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0b1120;
    padding: 9px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.guide-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.guide-tab-btn.active {
    background: rgba(0, 153, 153, 0.2);
    border-color: var(--siemens-teal);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 153, 153, 0.25);
}

.guide-tab-tag {
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.guide-tab-btn.active .guide-tab-tag.tag-pdf {
    background: rgba(0, 153, 153, 0.35);
    color: #5eead4;
}

.guide-tab-btn.active .guide-tab-tag.tag-video {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.modal-guide-box .modal-body {
    padding: 0;
    position: relative;
    background: #0f172a;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.guide-tab-pane {
    display: none;
    width: 100%;
    height: 100%;
    flex: 1;
    position: relative;
}

.guide-tab-pane.active {
    display: flex;
    flex-direction: column;
}

.modal-guide-box .guide-iframe,
.guide-tab-pane .guide-iframe {
    width: 100%;
    height: 100%;
    flex: 1;
    border: none;
    background: #0f172a;
}

.modal-guide-box .modal-footer {
    padding: 12px 22px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

@media (max-width: 768px) {
    .modal-guide-box {
        width: 100vw !important;
        height: 95vh !important;
        max-height: 95vh !important;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    }
    .modal-guide-box .modal-header {
        padding: 12px 16px;
    }
    .guide-tabs-bar {
        padding: 8px 12px;
        gap: 6px;
    }
    .guide-tab-btn {
        flex: 1;
        justify-content: center;
        padding: 6px 10px;
        font-size: 0.76rem;
    }
    .modal-guide-box .modal-footer {
        padding: 10px 14px;
        flex-direction: column;
        align-items: stretch;
    }
}
