/* ========================= */
/* TEACHER — ESTILOS         */
/* ========================= */

/* Overlay de contraseña */
.password-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15,27,51,0.85);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.password-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 48px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    animation: fadeInUp 0.4s ease-out;
}

.password-card h2 { font-size: 1.4rem; color: var(--navy); margin-bottom: 8px; }
.password-card p { color: var(--text-light); margin-bottom: 24px; }
.password-card input {
    width: 100%; padding: 14px 18px;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif; font-size: 1rem;
    text-align: center; margin-bottom: 16px; transition: var(--transition);
}
.password-card input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,191,166,0.15); }
.password-error { color: #F44336; font-size: 0.85rem; margin-bottom: 12px; display: none; }

/* ========================= */
/* GRÁFICA DE BARRAS CSS     */
/* ========================= */
.bar-chart { margin-bottom: 24px; }
.bar-chart-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-chart-label { min-width: 130px; font-size: 0.85rem; color: var(--text-light); }
.bar-chart-track { flex: 1; height: 28px; background: var(--border); border-radius: 6px; overflow: hidden; }
.bar-chart-fill { height: 100%; border-radius: 6px; transition: width 1.2s ease-out; display: flex; align-items: center; padding-left: 10px; font-size: 0.75rem; color: white; font-weight: 600; }
.bar-chart-value { min-width: 48px; text-align: right; font-weight: 700; font-size: 0.9rem; color: var(--navy); font-family: 'Plus Jakarta Sans', sans-serif; }

/* ========================= */
/* TABLA RESPONSIVA          */
/* ========================= */
.table-controls { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.table-controls select {
    padding: 10px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif; font-size: 0.9rem; background: var(--bg-card); color: var(--text); cursor: pointer;
}
.table-controls select:focus { outline: none; border-color: var(--teal); }

.responsive-table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 24px; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 700px; }
table.data-table th, table.data-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table.data-table th {
    background: var(--bg); font-weight: 600; color: var(--navy); cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif; user-select: none; white-space: nowrap;
}
table.data-table th:hover { color: var(--teal); }
table.data-table th i { margin-left: 6px; font-size: 0.75rem; color: var(--text-muted); }
table.data-table tbody tr:hover { background: rgba(0,191,166,0.03); }

.status-badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.status-badge.activo { background: #E8F5E9; color: #2E7D32; }
.status-badge.inactivo { background: var(--bg); color: var(--text-muted); }
.status-badge.completado { background: rgba(0,191,166,0.1); color: var(--teal); }
.status-badge.riesgo { background: #FCE4EC; color: #C62828; }

/* ========================= */
/* ESTUDIANTES EN RIESGO     */
/* ========================= */
.risk-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.risk-item {
    background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border);
    border-left: 4px solid #F44336; padding: 14px 18px; display: flex; align-items: center; gap: 14px;
}
.risk-item .risk-info { flex: 1; }
.risk-item .risk-info h4 { font-size: 0.95rem; color: var(--navy); }
.risk-item .risk-info p { font-size: 0.82rem; color: var(--text-muted); }
.risk-item .risk-score { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.3rem; color: #F44336; }

/* ========================= */
/* COMUNICACIÓN              */
/* ========================= */
.comm-card {
    background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
    padding: 24px; margin-bottom: 24px;
}
.comm-card h4 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.comm-card select, .comm-card textarea {
    width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem; margin-bottom: 12px; transition: var(--transition);
    background: var(--bg-card); color: var(--text);
}
.comm-card select:focus, .comm-card textarea:focus { outline: none; border-color: var(--teal); }
.comm-card textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.copy-success { color: #4CAF50; font-size: 0.85rem; margin-left: 12px; display: none; font-weight: 600; }

/* ========================= */
/* ACCESOS RÁPIDOS           */
/* ========================= */
.quick-access-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick-access-btn {
    background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
    padding: 24px 16px; text-align: center; cursor: pointer; transition: var(--transition);
    text-decoration: none; display: block;
}
.quick-access-btn:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover, 0 8px 32px rgba(27,42,74,0.14)); border-color: var(--teal); }
.quick-access-btn .qa-icon {
    width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center;
    justify-content: center; font-size: 22px; margin: 0 auto 12px;
}
.quick-access-btn h4 { font-size: 0.95rem; color: var(--navy); margin-bottom: 4px; }
.quick-access-btn p { font-size: 0.78rem; color: var(--text-muted); }

/* ========================= */
/* CERTIFICADO               */
/* ========================= */
.cert-form-card {
    background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
    padding: 32px; margin-bottom: 32px;
}
.cert-form-card h2 { font-size: 1.4rem; color: var(--navy); margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-group input, .form-group select {
    width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem; transition: var(--transition);
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--teal); }
.form-actions { display: flex; gap: 12px; margin-top: 20px; }

/* Vista previa del certificado */
#certificado {
    width: 100%; aspect-ratio: 1.414 / 1; background: white;
    border: 3px solid var(--navy); position: relative; padding: 48px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; border-radius: 4px; margin-bottom: 32px;
}
#certificado::before {
    content: ''; position: absolute; top: 12px; left: 12px; right: 12px; bottom: 12px;
    border: 2px solid var(--gold); border-radius: 2px; pointer-events: none;
}
.cert-logo { width: 60px; height: 60px; background: var(--teal); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: white; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; margin-bottom: 20px; }
.cert-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--navy); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 24px; }
.cert-to { font-size: 0.9rem; color: var(--text-light); margin-bottom: 8px; }
.cert-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 2rem; font-weight: 800; color: var(--teal); margin-bottom: 20px; }
.cert-course-label { font-size: 0.9rem; color: var(--text-light); margin-bottom: 6px; }
.cert-course { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.cert-score { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--gold); margin-bottom: 24px; }
.cert-footer { display: flex; justify-content: space-between; width: 80%; margin-top: auto; padding-top: 20px; }
.cert-footer-item { text-align: center; }
.cert-footer-item .line { width: 160px; height: 1px; background: var(--navy); margin-bottom: 6px; }
.cert-footer-item p { font-size: 0.8rem; color: var(--text-light); }
.cert-id { position: absolute; bottom: 20px; right: 24px; font-size: 0.7rem; color: var(--text-muted); font-family: monospace; }

/* ========================= */
/* IMPRESIÓN                 */
/* ========================= */
@media print {
    body * { visibility: hidden; }
    #certificado, #certificado * { visibility: visible; }
    #certificado {
        position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        border: 3px solid #1B2A4A; margin: 0; padding: 48px;
        aspect-ratio: auto;
    }
    @page { size: landscape; margin: 0; }
}

/* ========================= */
/* RESPONSIVE                */
/* ========================= */
@media (max-width: 1024px) { .quick-access-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
    .quick-access-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .quick-access-btn { padding: 16px 12px; }
    .quick-access-btn .qa-icon { width: 40px; height: 40px; font-size: 18px; }
    .bar-chart-label { min-width: 80px; font-size: 0.8rem; }
    .bar-chart-track { height: 22px; }
    #certificado { padding: 24px; }
    .cert-title { font-size: 1.1rem; letter-spacing: 1px; }
    .cert-name { font-size: 1.4rem; }
    .cert-footer { flex-direction: column; gap: 16px; align-items: center; }
    .cert-footer-item .line { width: 120px; }
    .table-controls { flex-direction: column; }
}
