:root {
    --bg: #f0f0f0;
    --accent: #ffff00;
    --dark: #1a1a1a;
    --white: #ffffff;
    --border: 3px solid #1a1a1a;
    --shadow: 5px 5px 0px #1a1a1a;
}

body {
    font-family: 'Courier New', monospace;
    background: var(--bg);
    padding: 30px;
    color: var(--dark);
}

/* GENERALES */
h1 {
    text-align: center;
    font-size: 2.5rem;
    text-transform: uppercase;
    background: var(--accent);
    display: inline-block;
    padding: 5px 15px;
    border: var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.oculto {
    display: none !important;
}

/* AUTH */
.pantalla-auth {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    padding: 25px;
    border: var(--border);
    box-shadow: var(--shadow);
}

.auth-subtitulo {
    text-align: center;
    margin-bottom: 20px;
}

.tabs-auth {
    display: flex;
    margin-bottom: 15px;
}

.tabs-auth button {
    flex: 1;
    padding: 10px;
    border: var(--border);
    background: var(--white);
    cursor: pointer;
    font-weight: bold;
}

.tabs-auth button.activo {
    background: var(--accent);
    box-shadow: 3px 3px 0px var(--dark);
}

/* INPUTS */
input,
textarea {
    padding: 10px;
    border: var(--border);
    font-family: inherit;
}

input:focus,
textarea:focus {
    background: #fffde7;
    outline: none;
}

/* BOTONES */
button {
    padding: 10px;
    border: var(--border);
    background: var(--white);
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: var(--shadow);
}

button:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* MENSAJE */
.mensaje-auth {
    text-align: center;
    margin-top: 12px;
    color: red;
}

/* BARRA USUARIO */
.barra-usuario {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.perfil-menu {
    position: relative;
}

#toastNotificaciones {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-notificacion {
    min-width: 280px;
    max-width: 350px;
    background: #1e1e1e;
    color: white;
    border-left: 4px solid #ff3b3b;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
    animation: aparecerToast .25s ease;
    opacity: 1;
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: auto;
}

.toast-notificacion.ocultar {
    opacity: 0;
    transform: translateY(-10px);
}

.toast-titulo {
    font-weight: bold;
    margin-bottom: 4px;
}

.toast-mensaje {
    font-size: 14px;
    opacity: .9;
}

@keyframes aparecerToast {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tiene-notificacion{
    position: relative;
}

.tiene-notificacion::after{
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: red;
    border-radius: 50%;
    animation: pulsoNotificacion 1s infinite;
}

@keyframes pulsoNotificacion{
    0%{
        transform: scale(1);
        opacity: 1;
    }

    50%{
        transform: scale(1.25);
        opacity: .7;
    }

    100%{
        transform: scale(1);
        opacity: 1;
    }
}

.panel-notificaciones {
    position: fixed;
    top: 90px;
    right: 25px;
    width: 360px;
    max-width: calc(100vw - 30px);
    max-height: 70vh;
    overflow-y: auto;
    background: var(--white);
    border: var(--border);
    box-shadow: var(--shadow);
    padding: 18px;
    z-index: 200;
}

.panel-notificaciones h3 {
    margin: 0 0 15px;
    background: var(--accent);
    border: var(--border);
    padding: 6px 10px;
    display: inline-block;
}

.lista-notificaciones {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notificacion-item {
    border: 2px solid var(--dark);
    background: #fff;
    padding: 12px;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--dark);
}

.notificacion-item.no-leida {
    background: #fffde7;
}

.notificacion-item.leida {
    opacity: 0.85;
}

.notificacion-titulo {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.notificacion-titulo span {
    font-size: 0.75rem;
    color: #555;
    white-space: nowrap;
}

.notificacion-mensaje {
    margin-top: 10px;
    line-height: 1.4;
    color: #333;
}

@media (max-width: 700px) {
    .panel-notificaciones {
        top: 75px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .notificacion-titulo {
        flex-direction: column;
    }
}

.btn-menu-con-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.svg-menu-perfil {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.btn-perfil {
    width: 50px;
    height: 50px;
    padding: 0;
    border: var(--border);
    background: var(--white);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-perfil svg {
    width: 26px;
    height: 26px;
    display: block;
    pointer-events: none;
}

.menu-perfil {
    position: absolute;
    top: 65px;
    left: 0;
    right: auto;
    width: 240px;
    background: var(--white);
    border: var(--border);
    box-shadow: var(--shadow);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.menu-perfil.oculto {
    display: none !important;
}

.btn-menu-notificacion {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-bell-svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.svg-glosario {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

#btnCerrarSesion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.svg-cerrar-sesion {
    width: 28px;
    height: 28px;
    fill: currentColor;
    flex-shrink: 0;
}

.perilla-svg {
    fill: #ffffff;
}

.vista-perfil {
    min-height: 70vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    box-sizing: border-box;
}

.perfil-contenedor {
    width: 100%;
    max-width: 720px;
}

.perfil-encabezado {
    text-align: center;
    margin-bottom: 35px;
}

.perfil-svg {
    width: 180px;
    height: 180px;
    display: block;
    margin: 0 auto 18px;
}

.perfil-encabezado h2 {
    margin-top: 10px;
    color: #000000;
    font-size: 2rem;
}

.perfil-encabezado p {
    color: #555;
    margin-top: 10px;
    word-break: break-word;
}

.btn-eliminar-foto {
    margin-top: 12px;
    padding: 10px 14px;
    border: 2px solid #000;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 4px 4px 0 #000;
    transition: 0.15s;
}

.btn-eliminar-foto:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.perfil-seccion {
    background: #fff;
    border: 2px solid #222;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 6px 6px 0 #222;
}

.perfil-seccion h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #222;
}

.campo-con-boton {
    display: flex;
    gap: 14px;
    align-items: stretch;
    width: 100%;
}

@media (max-width: 700px) {
    .campo-con-boton {
        flex-direction: column;
    }

    .campo-con-boton button {
        width: 100%;
    }
}

.campo-con-boton input {
    flex: 1;
    min-width: 0;
}

.campo-con-boton button {
    padding: 10px 14px;
    border: 2px solid #000;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 4px 4px 0 #000;
}

.perfil-campo {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.perfil-campo label {
    font-weight: bold;
    color: #333;
}

.perfil-campo input {
    width: 100%;
    box-sizing: border-box;

    padding: 12px;
    border: 2px solid #222;
    background: #f5f5f5;
    font-size: 1rem;
    outline: none;
}

.campo-con-boton button {
    flex-shrink: 0;
    padding: 12px 18px;
}

@media (min-width: 701px) {
    .campo-con-boton button {
        width: 150px;
    }

    .perfil-campo>input {
        width: calc(100% - 164px);
    }
}

@media (min-width: 701px) {
    #perfilNombre {
        width: calc(100% - 164px);
        flex: none;
    }
}

@media (max-width: 700px) {
    #perfilNombre {
        width: 100%;
    }
}

@media (min-width: 701px) {
    #perfilCodigoOrganizacion {
        width: calc(100% - 164px);
        flex: none;
    }
}

@media (max-width: 700px) {
    #perfilCodigoOrganizacion {
        width: 100%;
    }
}

.controles-glosario {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 20px;
}

.controles-glosario #buscador {
    flex: 1;
    max-width: none;
    margin: 0;
}

#filtroTipo {
    width: 280px;
    max-width: 280px;
    min-width: 220px;
    padding: 10px;
    border: var(--border);
    background: var(--white);
    font-family: inherit;
    font-weight: bold;
    box-shadow: var(--shadow);
    text-transform: uppercase;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#modalEliminarAsignatura .alert-botones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#btnMantenerAsignatura {
    background: var(--white);
}

#btnBorrarAsignatura {
    background: #ff5555;
    color: white;
}

#btnCancelarEliminarAsignatura {
    background: #ddd;
}

@media (max-width: 700px) {
    .controles-glosario {
        flex-direction: column;
        align-items: stretch;
    }

    #filtroTipo,
    #btnNuevo {
        width: 100%;
    }
}

.acciones-superiores {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
}

.fila-seleccionable {
    cursor: pointer;
}

.fila-seleccionable:hover td {
    background: rgba(0, 120, 0, 0.08);
}

.fila-seleccionada td {
    border-top: 3px solid #0a7a28;
    border-bottom: 3px solid #0a7a28;
    background: rgba(0, 120, 0, 0.12) !important;
}

#btnEliminarAsignatura {
    background: #2a2a2a;
    color: white;
    border-color: #111;
    opacity: 0.92;
}

#btnEliminarAsignatura:hover {
    background: #b00020;
    color: white;
}

#usuarioActual {
    font-size: 14px;
    font-weight: bold;
    border-bottom: 2px solid var(--dark);
    padding-bottom: 8px;
}

#btnCerrarSesion {
    width: 100%;
    margin: 0;
}

/* BUSCADOR */
#buscador {
    width: 100%;
    max-width: 500px;
    margin: 10px auto;
    padding: 10px;
}

/* TABLA */
table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 20px;
    border: var(--border);
    box-shadow: 8px 8px 0 var(--dark);
}


th,
td {
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    vertical-align: top;
}

th:nth-child(1),
td:nth-child(1) {
    width: 55px;
    text-align: center;
}

th:nth-child(2),
td:nth-child(2) {
    width: 28%;
}

th:nth-child(3),
td:nth-child(3) {
    width: 47%;
}

th:nth-child(4),
td:nth-child(4) {
    width: 150px;
}

.tabla-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

th {
    background: var(--dark);
    color: var(--white);
    padding: 12px;
    text-transform: uppercase;
}

td {
    padding: 12px;
    border-bottom: 2px solid var(--dark);
}

tr:nth-child(even) td {
    background: #fafafa;
}

.separador-clase td {
    border-bottom: 3px solid #1a1a1a;
}

tr:not(.separador-clase) td {
    border-bottom: 1px solid #ccc;
}

/* BOTONES ACCIONES */
.acciones button {
    margin: 0 3px;
    padding: 5px 8px;
    font-size: 0.8rem;
}

.editar {
    background: #55ff55;
}

.eliminar {
    background: #ff5555;
    color: white;
}

/* CORREO */
.correo-creador {
    font-size: 11px;
    color: #555;
    margin-top: 3px;
    text-decoration: underline;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.modal-content {
    background: var(--white);
    padding: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    max-height: 90vh;
    overflow-y: auto;
    border: var(--border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contador-caracteres {
    font-size: 11px;
    text-align: right;
    font-weight: bold;
    color: #555;
    margin-top: -6px;
}

.contador-caracteres.limite {
    color: #b00020;
}

#definicion {
    width: 100%;
    min-height: 120px;
    max-height: 300px;
    resize: vertical;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ALERT */
.alert-content {
    background: var(--white);
    padding: 20px;
    width: 320px;
    border: var(--border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detalle-palabra {
    font-size: 11px;
    color: #444;
    margin-top: 3px;
    font-weight: bold;
}

/* ANIMACIÓN */
.fila-parpadeo td {
    animation: parpadearFila 0.6s infinite alternate;
}

@keyframes parpadearFila {
    0% {
        background: rgba(200, 0, 0, 0.12);
    }

    50% {
        background: rgba(200, 0, 0, 0.22);
    }

    100% {
        background: rgba(200, 0, 0, 0.12);
    }
}

/* LOADING */
.btn-cargando {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 4px solid #ffffff;
    border-top: 4px solid #1a1a1a;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

button .spinner {
    margin: 0 auto;
}

.btn-cargando {
    opacity: 1;
    cursor: not-allowed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
}

@keyframes girar {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loader-tabla {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.spinner-grande {
    width: 36px;
    height: 36px;
    border-width: 5px;
}

@media (max-width: 700px) {
    body {
        padding: 0px 0px;
    }

    .barra-usuario,
    .controles-glosario,
    h1 {
        margin-left: 6px;
        margin-right: 6px;
    }

    .tabla-scroll {
        width: 100%;
        margin-top: 20px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    table {
        width: 100%;
        min-width: 680px;
        table-layout: fixed;
        margin-left: 0;
        margin-right: 0;
    }

    th,
    td {
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
        vertical-align: top;
    }

    th:nth-child(1),
    td:nth-child(1) {
        width: 55px;
    }

    th:nth-child(2),
    td:nth-child(2) {
        width: 230px;
    }

    th:nth-child(3),
    td:nth-child(3) {
        width: 270px;
    }

    th:nth-child(4),
    td:nth-child(4) {
        width: 125px;
    }

    .acciones button {
        display: block;
        width: 100%;
        margin: 0 0 8px 0;
    }

}