:root {
    --ink: #123845;
    --ink-2: #1c4f5e;
    --paper: #f4f8f7;
    --card: #ffffff;
    --gold: #2f9e8f;
    --gold-soft: #cdeae4;
    --muted: #5f7d82;
    --line: #dbe7e5;
    --danger: #8a2f2f;
    --danger-bg: #fbe9e9;

    --font-display: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* ---------- Barras de desplazamiento: siempre visibles, negro sólido ---------- */
/* Firefox */
html {
    scrollbar-width: auto;
    scrollbar-color: #000000 transparent;
}
/* Chrome, Edge, Android, y navegadores basados en WebKit que sí lo permiten
   (iOS Safari ignora estas reglas por restricción del sistema operativo:
   ahí siempre usa su barra flotante nativa, sin importar el CSS). */
*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background-color: #000000;
    border-radius: 8px;
    border: 3px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
    background-color: #000000;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Login ---------- */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 15%, rgba(184,145,47,0.10), transparent 45%),
        linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--card);
    border-radius: 4px;
    padding: 40px 36px 32px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.35);
    position: relative;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-soft));
    border-radius: 4px 4px 0 0;
}

.login-mark {
    font-family: var(--font-display);
    font-size: 30px;
    letter-spacing: 0.04em;
    color: var(--ink);
    margin-bottom: 2px;
}
.login-mark span { color: var(--gold); }

.login-tag {
    margin: 0 0 28px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.login-form { display: flex; flex-direction: column; gap: 6px; }

.login-form label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin-top: 14px;
}

.login-form input {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 3px;
    font-size: 15px;
    font-family: var(--font-body);
    background: #fcfbf8;
    color: var(--ink);
}
.login-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,145,47,0.18);
    background: #fff;
}

.btn-primary {
    margin-top: 24px;
    padding: 13px 16px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--ink-2); }

.login-foot {
    margin: 20px 0 0;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.login-credit {
    margin: 18px 0 0;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--muted);
    opacity: 0.7;
    text-align: center;
}
.login-credit__link {
    color: inherit;
    text-decoration: none;
    cursor: default;
}

/* ---------- Cuenta bloqueada ---------- */

.bloqueado-card { text-align: center; }
.bloqueado-card__icon { font-size: 40px; margin-bottom: 10px; }
.bloqueado-card__texto {
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.55;
    margin: 18px 0 14px;
}
.bloqueado-card__mail {
    display: block;
    text-decoration: none;
    margin-top: 4px;
    word-break: break-word;
}

/* ---------- Cuenta bloqueada: fondo y acentos de alerta ---------- */

.bloqueado-body {
    background:
        radial-gradient(circle at 85% 15%, rgba(209,73,63,0.18), transparent 45%),
        linear-gradient(180deg, #3a1414 0%, #1c0a0a 100%);
}
.bloqueado-card::before {
    background: linear-gradient(90deg, #d1493f, #f0928a) !important;
}
.bloqueado-card__icon {
    font-size: 46px;
    margin-bottom: 6px;
    animation: bloqueadoPulso 1.8s ease-in-out infinite;
}
@keyframes bloqueadoPulso {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}
.bloqueado-card__tag {
    color: #d1493f;
    font-weight: 700;
    letter-spacing: 0.1em;
}
.bloqueado-card__alert {
    background: #fbe9e9;
    color: #8a2f2f;
    border: 1px solid rgba(209,73,63,0.35);
    font-size: 13.5px;
    line-height: 1.55;
}
.bloqueado-card__mail.btn-primary {
    background: #8a2f2f;
}
.bloqueado-card__mail.btn-primary:hover { background: #6e2020; }

.alert {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(138,47,47,0.25);
    border-radius: 3px;
    padding: 11px 14px;
    font-size: 13.5px;
    margin-bottom: 6px;
}

/* ---------- Panel de notas ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: var(--ink);
    color: #fff;
}
.topbar__brand-block { display: flex; flex-direction: column; gap: 2px; }
.topbar__brand {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 0.03em;
}
.topbar__brand--link,
.report__brand--link,
.form-card__brand--link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.topbar__brand--link:hover,
.report__brand--link:hover,
.form-card__brand--link:hover {
    opacity: 0.8;
}
.topbar__lastaccess {
    font-size: 11.5px;
    color: var(--gold-soft);
    opacity: 0.75;
    letter-spacing: 0.01em;
}
.topbar__brand span {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--gold-soft);
    font-weight: 400;
    margin-left: 6px;
}
.topbar__user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

/* ---------- Menú hamburguesa ---------- */

.topbar { position: relative; z-index: 20; }

.menu-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    flex-shrink: 0;
}
.menu-toggle:hover { background: rgba(255,255,255,0.08); }
.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle--active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle--active span:nth-child(2) { opacity: 0; }
.menu-toggle--active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-toggle__dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1493f;
    box-shadow: 0 0 0 2px var(--ink);
}

/* ---------- Campanita de notificaciones ---------- */

.bell-wrap { position: relative; }
.bell-btn {
    position: relative;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.bell-btn:hover { background: rgba(255,255,255,0.08); }
.bell-btn__dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1493f;
    box-shadow: 0 0 0 2px var(--ink);
}

.bell-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    max-width: 85vw;
    max-height: 380px;
    overflow-y: auto;
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(18,56,69,0.28);
    padding: 8px;
    display: none;
    z-index: 25;
}
.bell-panel--open { display: block; }

.bell-panel__empty {
    padding: 20px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    margin: 0;
}

.bell-panel__item {
    display: block;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 6px;
    font-size: 13.5px;
    color: var(--ink);
    border-left: 3px solid transparent;
    margin-bottom: 2px;
}
.bell-panel__item:hover { background: var(--paper); border-left-color: var(--gold); }
.bell-panel__item-course {
    display: block;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18,56,69,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 15;
}
.menu-overlay--show { opacity: 1; pointer-events: auto; }

.menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    max-width: 82vw;
    background: var(--card);
    box-shadow: -8px 0 30px rgba(18,56,69,0.25);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 20;
}
.menu-panel--open { transform: translateX(0); }

.topbar__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.topbar__username {
    font-size: 13.5px;
    color: var(--gold-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.menu-panel__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    text-decoration: none;
    font-size: 14.5px;
    color: var(--ink-2);
    border-left: 3px solid transparent;
}
.menu-panel__link:hover { background: var(--paper); border-left-color: var(--gold); }
.menu-panel__link .badge-unread { margin-left: auto; }
.menu-panel__link--danger { color: #8a2f2f; margin-top: auto; border-top: 1px solid var(--line); }
.menu-panel__link--danger:hover { background: #fbe9e9; border-left-color: #8a2f2f; }
.btn-ghost {
    color: var(--gold-soft);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 13px;
    background: none;
    font-family: var(--font-body);
    cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }

.wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.course-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 22px 26px 8px;
    margin-bottom: 20px;
}
.course-card h2 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: normal;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gold-soft);
    color: var(--ink);
}

.grades {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}
.grades th {
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 8px 8px;
    border-bottom: 1px solid var(--line);
}
.grades td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 14.5px;
}
.grades tr:last-child td { border-bottom: none; }

.grade-value {
    font-family: var(--font-mono);
    font-weight: 600;
    text-align: right;
    color: var(--ink);
    background: #faf6ea;
    border-radius: 3px;
}

.muted { color: var(--muted); font-size: 13.5px; }

.empty {
    text-align: center;
    color: var(--muted);
    padding: 60px 20px;
    font-size: 15px;
}

/* ---------- Botón flotante: volver arriba ---------- */

.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(18,56,69,0.35);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
    z-index: 30;
}
.scroll-top--show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.scroll-top:hover { background: var(--gold); }

@media (max-width: 480px) {
    .scroll-top { bottom: 18px; right: 18px; width: 42px; height: 42px; }
}

/* ---------- Formulario de prórroga ---------- */

.wrap--form { max-width: 620px; margin: 24px auto 60px; }

.form-card {
    background: var(--card);
    border-radius: 4px;
    padding: 40px 42px;
    box-shadow: 0 8px 30px rgba(18,56,69,0.18);
    position: relative;
}
.form-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--gold), var(--gold-soft));
    border-radius: 4px 4px 0 0;
}

.form-card__brand {
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.form-card__brand span { color: var(--gold); }

.form-card__title {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 26px;
    color: var(--ink);
    margin: 0 0 10px;
}
.form-card__subtitle {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 26px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.prorroga-form { display: flex; flex-direction: column; }
.prorroga-form label:not(.prorroga-form__radio) {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin-top: 22px;
    margin-bottom: 8px;
}
.prorroga-form label:first-of-type { margin-top: 0; }
.prorroga-form__hint {
    font-size: 12px;
    color: var(--muted);
    margin: 6px 0 0;
}
.prorroga-form input[type="file"] {
    font-size: 13.5px;
    padding: 8px 0;
}

.prorroga-form select,
.prorroga-form input[type="text"],
.prorroga-form input[type="date"],
.prorroga-form textarea {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 14.5px;
    font-family: var(--font-body);
    background: #fcfbf8;
    color: var(--ink);
    width: 100%;
}
.prorroga-form select:focus,
.prorroga-form input:focus,
.prorroga-form textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(47,158,143,0.16);
    background: #fff;
}
.prorroga-form textarea { resize: vertical; line-height: 1.5; }

.prorroga-form__radios { display: flex; flex-direction: column; gap: 10px; }
.prorroga-form__radio {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--ink);
    cursor: pointer;
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.prorroga-form__radio:has(input:checked),
.prorroga-form__radio--checked {
    border-color: var(--gold);
    background: var(--gold-soft);
}
.prorroga-form__radio input {
    accent-color: var(--gold);
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}
.prorroga-form__radio-icon { font-size: 17px; }

.prorroga-form .btn-primary {
    margin-top: 30px;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 15px;
}

.pendiente-select { margin-bottom: 4px; }

#manualWrap {
    margin-top: 6px;
    padding: 14px 16px 4px;
    background: var(--paper);
    border-radius: 8px;
    border: 1px dashed var(--line);
}
#manualWrap label { margin-top: 14px !important; }
#manualWrap label:first-child { margin-top: 0 !important; }

@media (max-width: 640px) {
    .form-card { padding: 30px 24px; }
    .wrap--form { margin: 0; max-width: none; }
}

/* ---------- Actividades vencidas ---------- */

.vencidas__subtitle {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 16px;
    color: var(--ink);
    margin: 26px 0 12px;
}
.vencidas__subtitle:first-of-type { margin-top: 4px; }

.vencidas__list { list-style: none; margin: 0 0 8px; padding: 0; }

.vencidas__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid #f0d3d0;
    background: #fdf5f4;
    border-radius: 8px;
    margin-bottom: 8px;
}
.vencidas__info { flex: 1; min-width: 0; }
.vencidas__nombre { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.vencidas__curso { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.vencidas__fecha {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #8a2f2f;
    text-align: right;
    line-height: 1.4;
}

.vencidas__cta {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    margin-top: 24px;
}

/* ---------- Próximas entregas / exámenes ---------- */

.upcoming {
    background: var(--card);
    border: 2px solid #d1493f;
    border-radius: 4px;
    padding: 18px 22px 6px;
    margin-bottom: 26px;
    box-shadow: 0 2px 10px rgba(209,73,63,0.15);
}
.upcoming__title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: normal;
    margin: 0 0 12px;
    color: var(--ink);
}
.upcoming__list { list-style: none; margin: 0; padding: 0; }
.upcoming__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.upcoming__item:last-child { border-bottom: none; }

.upcoming__badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 999px;
    color: #fff;
}
.upcoming__badge--task { background: var(--ink-2); }
.upcoming__badge--exam { background: var(--gold); }

.upcoming__body { flex: 1; min-width: 0; }
.upcoming__name {
    font-size: 14.5px;
    color: var(--ink);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upcoming__meta { font-size: 12.5px; color: var(--muted); }

.upcoming__date {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-2);
    text-align: right;
}

@media (max-width: 480px) {
    .upcoming { padding: 14px 16px 4px; }
    .upcoming__name { white-space: normal; }
    .topbar__username { display: none; }
}

/* ---------- Mensajes ---------- */

.wrap--messages { max-width: 920px; }

.page-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.page-heading .btn-ghost--dark {
    color: var(--ink);
    background: none;
    border-color: var(--line);
}
.page-heading .btn-ghost--dark:hover { background: var(--paper); }
.page-heading__title {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 22px;
    color: var(--ink);
    margin: 0;
}

.alert--ok {
    background: var(--gold-soft, #cdeae4);
    color: var(--ink-2);
    border: 1px solid rgba(47,158,143,0.35);
}

.msg-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    align-items: start;
}

.msg-contacts {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(18,56,69,0.06);
}
.msg-contacts__title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: normal;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 10px;
}

.msg-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 10px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background 0.12s ease;
}
.msg-contact:hover { background: var(--paper); }
.msg-contact--active { background: var(--gold-soft); }
.msg-contact__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--ink-2);
}
.msg-contact__avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-display);
    font-size: 16px;
}
.msg-contact__info { min-width: 0; }
.msg-contact__name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-contact__course { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.msg-thread {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 20px 22px;
    height: 640px;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(18,56,69,0.06);
}
.msg-thread__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--gold-soft);
}
.msg-thread__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ink-2);
    flex-shrink: 0;
}
.msg-thread__avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-display);
    font-size: 18px;
}
.msg-thread__title {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: normal;
    color: var(--ink);
    margin: 0;
    flex: 1;
}
.msg-thread__delete-form { margin: 0; }
.btn-danger {
    background: none;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
    padding: 7px 12px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.btn-danger:hover {
    border-color: #8a2f2f;
    color: #8a2f2f;
    background: #fbe9e9;
}

/* ---------- Panel de administración: desbloqueo de cuentas ---------- */

.vencidas__item form { margin: 0; flex-shrink: 0; }
.admin-unlock-btn {
    margin-top: 0;
    padding: 9px 16px;
    font-size: 13px;
    white-space: nowrap;
}
.admin-unlock-all { margin-top: 22px; }

.msg-bubbles {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 16px;
    border-radius: 8px;
    background-color: #eef4f3;
    background-image:
        radial-gradient(circle, rgba(18,56,69,0.08) 1px, transparent 1px);
    background-size: 16px 16px;
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 4px rgba(18,56,69,0.06);
}

.bubble {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 1px 2px rgba(18,56,69,0.05);
}
.bubble--theirs {
    align-self: flex-start;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    border-bottom-left-radius: 3px;
}
.bubble--mine {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--ink), var(--ink-2));
    color: #fff;
    border-bottom-right-radius: 3px;
}
.bubble__text { white-space: pre-wrap; word-break: break-word; }
.bubble__time {
    font-size: 10.5px;
    opacity: 0.65;
    margin-top: 4px;
    text-align: right;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.bubble--new { animation: bubbleIn 0.22s ease-out; }

.msg-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}
.msg-form textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.4;
    background: #fcfbf8;
    color: var(--ink);
    overflow-y: auto;
}
.msg-form textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(47,158,143,0.18);
    background: #fff;
}
.msg-form .btn-primary {
    margin-top: 0;
    padding: 12px 22px;
    white-space: nowrap;
    border-radius: 20px;
}
.msg-form .btn-primary:disabled { opacity: 0.6; cursor: default; }

.msg-bubbles::-webkit-scrollbar { width: 12px; }
.msg-bubbles::-webkit-scrollbar-track { background: transparent; }
.msg-bubbles::-webkit-scrollbar-thumb {
    background-color: #000000;
    border-radius: 8px;
    border: 3px solid transparent;
    background-clip: content-box;
}
.msg-bubbles::-webkit-scrollbar-thumb:hover { background-color: #000000; }

@media (max-width: 640px) {
    .msg-layout { grid-template-columns: 1fr; }
    .msg-contacts {
        display: flex;
        flex-direction: column;
        max-height: 240px;
        overflow-y: auto;
        padding: 10px;
    }
    .msg-contact { flex-shrink: 0; margin-bottom: 4px; }
    .bubble { max-width: 88%; }
    .msg-thread { height: 60vh; padding: 16px; }
}

/* ---------- Reporte PDF ---------- */

.report-body { background: #d9dfde; }

.report-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: var(--ink);
}
.report-toolbar__brand {
    font-family: var(--font-display);
    font-size: 17px;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.report-toolbar__brand:hover { opacity: 0.85; }
.btn-ghost--dark {
    background: var(--ink-2);
    border-color: var(--ink-2);
    color: #fff;
}
.btn-ghost--dark:hover { background: #24647a; }
.btn-primary--inline { margin-top: 0; padding: 10px 18px; }

.report {
    max-width: 760px;
    margin: 24px auto 60px;
    background: #fff;
    padding: 48px 52px;
    box-shadow: 0 8px 30px rgba(18,56,69,0.18);
}

.report__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 3px solid var(--gold);
    padding-bottom: 18px;
    margin-bottom: 28px;
}
.report__brand {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--ink);
}
.report__brand span { color: var(--gold); }
.report__meta {
    text-align: right;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.7;
}
.report__meta strong { color: var(--ink-2); }

.report__course { margin-bottom: 26px; page-break-inside: avoid; }
.report__course h2 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: normal;
    color: var(--ink);
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.report__table { width: 100%; border-collapse: collapse; }
.report__table th {
    text-align: left;
    font-size: 10.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 8px 6px;
    border-bottom: 1px solid var(--line);
}
.report__table td { padding: 7px 8px; font-size: 13px; border-bottom: 1px solid #f0efe9; }
.report__grade { font-family: var(--font-mono); font-weight: 600; text-align: right; color: var(--ink); }
.report__row--final td { font-weight: 700; background: var(--paper); }

.report__footer {
    margin-top: 36px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 10.5px;
    color: var(--muted);
    text-align: center;
}

@media print {
    .no-print, .report-toolbar { display: none !important; }
    .report-body { background: #fff; }
    .report { box-shadow: none; margin: 0; padding: 0; max-width: none; }
    .report__course { page-break-inside: avoid; }
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 640px) {
    .report { padding: 28px 22px; margin: 12px auto 40px; }
    .report__header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .report__meta { text-align: left; }
}

/* ---------- Retroalimentación del profesor ---------- */

.feedback-icon {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 6px;
    color: #d1493f;
    opacity: 0.85;
}
.feedback-icon:hover { opacity: 1; }

.report--feedback { max-width: 620px; }

.feedback-block__course {
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 6px;
}
.feedback-block__title {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 24px;
    color: var(--ink);
    margin: 0 0 10px;
}
.feedback-block__grade {
    font-size: 14px;
    color: var(--ink-2);
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.feedback-block__grade strong { font-family: var(--font-mono); }

.feedback-block__subtitle {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 16px;
    color: var(--ink);
    margin: 0 0 14px;
}

.feedback-block__content {
    background: var(--paper);
    border-left: 3px solid var(--gold);
    border-radius: 4px;
    padding: 18px 22px;
    font-size: 14.5px;
    line-height: 1.65;
    color: #2a2a2a;
}
.feedback-block__content p:first-child { margin-top: 0; }
.feedback-block__content p:last-child { margin-bottom: 0; }
.feedback-block__content a { color: var(--ink-2); }

/* ---------- Aviso de cierre por inactividad ---------- */

.idle-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18,56,69,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.idle-modal-overlay--show { opacity: 1; pointer-events: auto; }

.idle-modal {
    background: #fff;
    border-radius: 8px;
    padding: 32px 30px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(18,56,69,0.35);
}
.idle-modal__icon { font-size: 32px; margin-bottom: 8px; }
.idle-modal h3 { margin: 0 0 10px; font-family: var(--font-display); font-weight: normal; font-size: 20px; color: var(--ink); }
.idle-modal p { margin: 0 0 20px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.idle-modal #idleCountdown { font-weight: 700; color: #d1493f; }
.idle-modal .btn-primary { margin-top: 0; width: 100%; }

/* ---------- Alertas de mensajes nuevos ---------- */

.btn-ghost--relative { position: relative; }
.badge-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 7px;
    border-radius: 999px;
    background: #d1493f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.dot-unread {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #d1493f;
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
    box-shadow: 0 0 0 2px #fff;
}

.msg-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 12px);
    background: var(--ink);
    color: #fff;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 13.5px;
    box-shadow: 0 8px 24px rgba(18,56,69,0.35);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 100;
    border-left: 3px solid var(--gold);
}
.msg-toast--show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Responsivo (celular) ---------- */

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px 26px;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .login-body { padding: 0; }

    .topbar {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .topbar__brand { font-size: 17px; }
    .topbar__user { font-size: 13px; gap: 10px; }

    .wrap { padding: 18px 12px 48px; }

    .course-card { padding: 16px 16px 4px; }
    .course-card h2 { font-size: 16.5px; }

    .grades { display: block; overflow-x: auto; white-space: nowrap; }
    .grades th, .grades td { padding: 9px 10px; font-size: 13.5px; }
}
