/* ==========================================================================
   tabla_tfg.css · Tema de Tabulator para la aplicación (scripts/tabla_tfg.js)

   - Cabecera y pie fijos: la tabla tiene alto fijo (calculado por el JS) y
     solo se desplaza el cuerpo.
   - Colores a partir de --tfg-* (tema del usuario).
   - Densidad: .tt--compacta / .tt--normal / .tt--amplia.
   ========================================================================== */

.tt {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

/* ========================================================================== */
/* BARRA DE HERRAMIENTAS                                                      */
/* ========================================================================== */
.tt-barra {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 6px 8px;
    border: 1px solid var(--tfg-border);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: #ffffff;
}

.tt-barra__info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--tfg-text-muted);
}

.tt-recuento {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tt-recuento--filtrado {
    color: var(--tfg-accent);
}

.tt-sel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 4px 1px 10px;
    border-radius: 999px;
    background: var(--tfg-accent);
    color: var(--tfg-on-accent);
    font-size: 11.5px;
    font-weight: 700;
}

.tt-sel[hidden] {
    display: none;
}

.tt-sel .tt-boton--mini {
    min-height: 20px;
    width: 20px;
    padding: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.tt-barra__propias {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tt-barra__herramientas {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.tt-boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 10px;
    border: 1px solid var(--tfg-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--tfg-text-strong);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.tt-boton[hidden] {
    display: none;
}

.tt-boton:hover {
    border-color: var(--tfg-accent);
    background: var(--tfg-header-hover);
    color: var(--tfg-accent-dark);
}

.tt-boton:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tt-boton--peligro {
    color: #c8102e;
}

.tt-boton--peligro:hover:not(:disabled) {
    border-color: #c8102e;
    background: #fde8ea;
    color: #c8102e;
}

.tt-boton--principal {
    border-color: transparent;
    background: var(--tfg-accent);
    color: var(--tfg-on-accent);
}

.tt-boton--principal:hover:not(:disabled) {
    background: var(--tfg-accent-dark);
    color: var(--tfg-on-accent);
}

/* Botón de alternar pulsado (p. ej. «Ver línea a línea» en la vista agrupada) */
.tt-boton--activo {
    border-color: var(--tfg-accent);
    background: color-mix(in srgb, var(--tfg-accent) 12%, #fff);
    color: var(--tfg-accent-darker, var(--tfg-accent));
    font-weight: 700;
}

.tt-boton--excel .fas {
    color: #1d6f42;
}

.tt-boton--marcado {
    border-color: #1d6f42;
    background: #e8f4ec;
}

.tt-densidad {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 4px 0 10px;
    border: 1px solid var(--tfg-border);
    border-radius: 999px;
    color: var(--tfg-text-strong);
    font-size: 11.5px;
}

.tt-densidad select {
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

/* Menú de columnas */
.tt-menu {
    position: relative;
}

.tt-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    min-width: 220px;
    max-height: 60vh;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--tfg-border);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 30, 50, 0.16);
}

.tt-menu__panel[hidden] {
    display: none;
}

.tt-menu__opcion {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12.5px;
    cursor: pointer;
}

.tt-menu__opcion:hover {
    background: var(--tfg-header-hover);
}

/* ========================================================================== */
/* TABLA                                                                      */
/* ========================================================================== */
.tt-tabla {
    flex: 1 1 auto;
    min-height: 0;
}

.tt .tabulator {
    border: 1px solid var(--tfg-border);
    border-radius: 0 0 12px 12px;
    background: #ffffff;
    font-family: inherit;
    font-size: 12px;
    color: var(--tfg-text);
}

/* --- Cabecera fija ------------------------------------------------------- */
.tt .tabulator .tabulator-header {
    border-bottom: 2px solid var(--tfg-border);
    background: var(--tfg-header-bg);
    color: var(--tfg-text-strong);
    font-weight: 700;
}

.tt .tabulator .tabulator-header .tabulator-col {
    border-right: 1px solid var(--tfg-border);
    background: var(--tfg-header-bg);
}

.tt .tabulator .tabulator-header .tabulator-col:hover {
    background: var(--tfg-header-hover);
}

.tt .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 6px 8px;
}

.tt .tabulator .tabulator-header .tabulator-col .tabulator-col-title {
    font-size: 9px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: normal;
    line-height: 1.2;
}

.tt .tabulator .tabulator-header .tabulator-col[aria-sort="ascending"],
.tt .tabulator .tabulator-header .tabulator-col[aria-sort="descending"],
.tt .tabulator .tabulator-header .tabulator-col[aria-sort="asc"],
.tt .tabulator .tabulator-header .tabulator-col[aria-sort="desc"] {
    color: var(--tfg-accent);
}

/* Filtros de cabecera */
.tt .tabulator .tabulator-header-filter {
    margin-top: 5px;
}

.tt .tabulator .tabulator-header-filter input,
.tt .tabulator .tabulator-header-filter select {
    width: 100%;
    height: 24px;
    padding: 2px 6px;
    border: 1px solid var(--tfg-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--tfg-text);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.tt .tabulator .tabulator-header-filter input:focus {
    outline: 2px solid var(--tfg-accent);   /* Foco visible (WCAG 2.4.7) */
    outline-offset: 0;
    border-color: var(--tfg-accent);
    box-shadow: none;
}

.tt-rango {
    display: flex;
    gap: 3px;
}

.tt-rango input {
    min-width: 0;
    flex: 1 1 0;
    padding: 2px 3px !important;
}

/* --- Filas ---------------------------------------------------------------- */
.tt .tabulator .tabulator-tableholder {
    background: #ffffff;
}

.tt .tabulator .tabulator-row {
    border-bottom: 1px solid var(--tfg-border);
    background: #ffffff;
}

.tt .tabulator .tabulator-row.tabulator-row-even {
    background: var(--tfg-row-alt);
}

.tt .tabulator .tabulator-row.tabulator-selectable:hover {
    background: var(--tfg-row-hover);
}

.tt .tabulator .tabulator-row.tabulator-selected,
.tt .tabulator .tabulator-row.tabulator-selected:hover {
    background: var(--tfg-header-hover);
    box-shadow: inset 3px 0 0 var(--tfg-accent);
}

.tt .tabulator .tabulator-row .tabulator-cell {
    border-right: 1px solid transparent;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

/* Densidad */
.tt--compacta .tabulator .tabulator-row .tabulator-cell {
    padding: 2px 6px;
    font-size: 11.5px;
}

.tt--normal .tabulator .tabulator-row .tabulator-cell {
    padding: 5px 8px;
}

.tt--amplia .tabulator .tabulator-row .tabulator-cell {
    padding: 10px 10px;
    font-size: 12.5px;
}

/* Columnas congeladas (selección a la izquierda, acciones a la derecha) */
.tt .tabulator .tabulator-row .tabulator-cell.tabulator-frozen,
.tt .tabulator .tabulator-header .tabulator-col.tabulator-frozen {
    background: inherit;
}

.tt .tabulator .tabulator-row .tabulator-cell.tt-col-acciones,
.tt .tabulator .tabulator-header .tabulator-col.tt-col-acciones {
    background: var(--tfg-row-alt);
    box-shadow: -4px 0 8px rgba(15, 30, 50, 0.06);
}

.tt .tabulator .tabulator-row.tabulator-selected .tabulator-cell.tt-col-acciones {
    background: var(--tfg-header-hover);
}

.tt .tabulator .tabulator-header .tabulator-col.tt-col-acciones {
    background: var(--tfg-header-bg);
}

.tt .tabulator .tt-col-sel input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--tfg-accent);
    cursor: pointer;
}

/* Mensaje sin datos */
.tt .tabulator .tabulator-placeholder .tabulator-placeholder-contents {
    color: var(--tfg-text-muted);
    font-size: 13px;
    font-weight: 600;
}

/* --- Pie fijo (paginación) --------------------------------------------- */
.tt .tabulator .tabulator-footer {
    border-top: 1px solid var(--tfg-border);
    border-radius: 0 0 12px 12px;
    background: var(--tfg-row-alt);
    color: var(--tfg-text-muted);
    font-weight: 600;
}

.tt .tabulator .tabulator-footer .tabulator-paginator {
    font-size: 11.5px;
}

.tt .tabulator .tabulator-footer .tabulator-page {
    min-width: 28px;
    margin: 0 1px;
    padding: 2px 7px;
    border: 1px solid var(--tfg-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--tfg-text-strong);
}

.tt .tabulator .tabulator-footer .tabulator-page:not(:disabled):hover {
    border-color: var(--tfg-accent);
    background: var(--tfg-header-hover);
    color: var(--tfg-accent-dark);
}

.tt .tabulator .tabulator-footer .tabulator-page.active {
    border-color: var(--tfg-accent);
    background: var(--tfg-accent);
    color: var(--tfg-on-accent);
}

.tt .tabulator .tabulator-footer .tabulator-page-size {
    padding: 2px 6px;
    border: 1px solid var(--tfg-border);
    border-radius: 6px;
    background: #ffffff;
    font-family: inherit;
}

.tt .tabulator .tabulator-footer .tabulator-page-counter {
    font-variant-numeric: tabular-nums;
}

/* --- Insignias usadas por los formateadores ------------------------------- */
.tt-insignia {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.tt-insignia--si {
    background: #e7f5ec;
    color: #1b7a43;
}

.tt-insignia--no {
    background: #fff4d6;
    color: #8a6100;
}

.tt-insignia--neutra {
    background: var(--tfg-header-bg);
    color: var(--tfg-text-strong);
}

.tt-insignia--alta {
    background: #fde8ea;
    color: #b0122b;
}

/* --- Animaciones de filas actualizadas / eliminadas ---------------------- */
@keyframes tt-destello {
    0% { box-shadow: inset 0 0 0 999px rgba(46, 160, 67, 0.28); }
    100% { box-shadow: inset 0 0 0 999px rgba(46, 160, 67, 0); }
}

.tt .tabulator .tabulator-row.tt-fila-ok {
    animation: tt-destello 1.6s ease-out;
}

.tt .tabulator .tabulator-row.tt-fila-fuera {
    opacity: 0.25;
    transition: opacity 0.25s ease;
}

@media (max-width: 760px) {
    .tt-boton span {
        display: none;
    }

    .tt-barra__herramientas {
        margin-left: 0;
    }
}

/* Grupo de iconos de acción de una fila (no se parte en varias líneas) */
.tt-acciones {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

/* Iconos de acción de las tablas: dibujo más grande (20 px) y menos margen alrededor */
.tt .tabulator .int-icono-accion {
    width: 30px;
    height: 30px;
    margin: 0;
    border-radius: 6px;
}

.tt .tabulator .int-icono-accion i {
    font-size: 19px;            /* iconos Font Awesome */
    line-height: 1;
}

:root .tt .tabulator .int-icono-accion i::before {
    width: 23px;                /* juegos de iconos SVG (minimalist, Windows11...) */
    height: 23px;
    vertical-align: middle;
}

/* La columna de acciones (ancho automático) con poco relleno lateral */
.tt .tabulator .tabulator-row .tabulator-cell.tt-col-acciones {
    padding-left: 3px;
    padding-right: 3px;
}

/* ========================================================================== */
/* EDICIÓN DE VARIAS FILAS                                                    */
/* ========================================================================== */

/* Celda que se puede editar: relleno suave del color del tema, subrayado
   discontinuo y lápiz al pasar (el usuario ve de un vistazo qué puede cambiar) */
.tt .tabulator .tabulator-cell.tt-celda-editable {
    position: relative;
    cursor: text;
    background-color: #e3f6e8;                 /* verde pastel: aquí se puede editar */
    box-shadow: inset 0 0 0 1px #b9e4c6;
    background-image: linear-gradient(90deg, #8fd0a4 50%, transparent 50%);
    background-size: 6px 1px;
    background-repeat: repeat-x;
    background-position: 0 calc(100% - 3px);
}

.tt .tabulator .tabulator-row:hover .tabulator-cell.tt-celda-editable {
    background-color: #d4f0dc;
}

.tt .tabulator .tabulator-cell.tt-celda-editable:hover::after {
    content: "\f303";            /* fa-pencil-alt */
    position: absolute;
    top: 4px;
    right: 5px;
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
    color: var(--tfg-accent);
    opacity: 0.7;
}

/* Celda modificada y aún no guardada */
.tt .tabulator .tabulator-cell.tt-celda-cambiada {
    background-color: #fff3cd !important;
    box-shadow: inset 0 -2px 0 #f0a020;
    color: #6b4500;
    font-weight: 600;
}

/* Fila con cambios pendientes: marca ámbar a la izquierda */
.tt .tabulator .tabulator-row.tt-fila-cambiada {
    box-shadow: inset 4px 0 0 #f0a020;
}

/* Contador del botón "Guardar cambios" */
.tt-contador {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}

.tt-boton--guardar:disabled .tt-contador {
    background: var(--tfg-header-bg);
    color: var(--tfg-text-muted);
}

/* Latido suave mientras haya cambios sin guardar */
@keyframes tt-latido {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 160, 32, 0.55); }
    50% { box-shadow: 0 0 0 5px rgba(240, 160, 32, 0); }
}

.tt-boton--latido {
    animation: tt-latido 1.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .tt-boton--latido {
        animation: none;
    }
}

/* Editores de Tabulator con el tema de la aplicación */
.tt .tabulator .tabulator-cell.tabulator-editing {
    border: 1px solid var(--tfg-accent) !important;
    background: #ffffff;
    padding: 0 !important;
}

.tt .tabulator .tabulator-cell.tabulator-editing textarea,
.tt .tabulator .tabulator-cell.tabulator-editing input,
.tt .tabulator .tabulator-cell.tabulator-editing select {
    padding: 6px 8px !important;
    font-family: inherit;
    font-size: 12.5px;
}

/* ========================================================================== */
/* CARGA: rueda breve y fundido al mostrar la tabla                           */
/* ========================================================================== */
.tt {
    position: relative;
}

.tt-cargador {
    position: absolute;
    inset: 46px 0 0;
    display: none;
    place-items: center;
    z-index: 30;
    pointer-events: none;
}

.tt--cargando .tt-cargador {
    display: grid;
}

.tt--cargando .tt-tabla {
    opacity: 0;
}

.tt--lista .tt-tabla {
    animation: tt-fundido 0.45s ease-out;
}

.tt-cargador__rueda {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 4px solid color-mix(in srgb, var(--tfg-accent) 15%, transparent);
    border-top-color: var(--tfg-accent);
    border-right-color: var(--tfg-accent-soft);
    animation: tt-giro 0.75s linear infinite;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--tfg-accent) 6%, transparent);
}

@keyframes tt-giro {
    to { transform: rotate(360deg); }
}

@keyframes tt-fundido {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .tt--lista .tt-tabla, .tt-cargador__rueda { animation-duration: 0.01s; }
}

/* Tabla sin datos (o sin coincidencias con los filtros) */
.tt .tabulator .tabulator-placeholder .tabulator-placeholder-contents {
    padding: 28px 12px;
}

.tt-vacio {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 420px;
    white-space: normal;
}

.tt-vacio__icono {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tfg-accent) 10%, #fff);
    color: var(--tfg-accent);
    font-size: 28px;
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--tfg-accent) 5%, transparent);
}

.tt-vacio__texto {
    color: var(--tfg-text-strong);
    font-size: 14px;
}

.tt-vacio__filtros {
    display: none;
    color: var(--tfg-text-muted);
    font-size: 13px;
    font-weight: 600;
}

.tt .tabulator.tt-sin-coincidencias .tt-vacio__texto {
    display: none;
}

.tt .tabulator.tt-sin-coincidencias .tt-vacio__filtros {
    display: block;
}

/* ========================================================================== */
/* FILTRO DE LISTA (casillas que se aplican al momento)                       */
/* ========================================================================== */
.tt-lista-filtro {
    width: 100%;
    min-height: 24px;
    padding: 2px 18px 2px 6px;
    overflow: hidden;
    border: 1px solid var(--tfg-border);
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23667085'/%3E%3C/svg%3E") no-repeat right 6px center;
    color: var(--tfg-text-muted);
    font-size: 11px;
    font-weight: 400;
    text-align: left;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
}

.tt-lista-filtro:focus-visible {
    outline: 2px solid var(--tfg-accent);
    outline-offset: 1px;
}

.tt-lista-filtro--activo {
    border-color: var(--tfg-accent);
    background-color: color-mix(in srgb, var(--tfg-accent) 10%, #fff);
    color: var(--tfg-accent-dark);
    font-weight: 700;
}

.tt-lista-panel {
    position: fixed;
    z-index: 2000;
    max-width: 360px;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    padding: 6px;
    border: 1px solid var(--tfg-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    font-size: 12px;
    animation: tt-fundido 0.15s ease-out;
}

.tt-lista-panel__buscar {
    margin-bottom: 6px;
    padding: 4px 8px;
    border: 1px solid var(--tfg-border);
    border-radius: 5px;
    font-size: 12px;
}

.tt-lista-panel__opciones {
    overflow-y: auto;
}

.tt-lista-panel__opcion {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 6px;
    border-radius: 4px;
    color: var(--tfg-text);
    cursor: pointer;
}

.tt-lista-panel__opcion:hover {
    background: var(--tfg-row-hover);
}

.tt-lista-panel__opcion input {
    accent-color: var(--tfg-accent);
}

.tt-lista-panel__limpiar {
    margin-top: 6px;
    padding: 4px 8px;
    border: 0;
    border-top: 1px solid var(--tfg-border);
    background: none;
    color: var(--tfg-accent-dark);
    font-size: 11.5px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

/* ========================================================================== */
/* TEXTOS RECORTADOS (línea de TFG...)                                        */
/* ========================================================================== */
.tt-recorte {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    cursor: help;
}

/* Una sola línea: si no cabe, "…" (la fila no crece) */
.tt-recorte__txt,
.tt-linea {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-linea {
    display: block;
    max-width: 100%;
}

/* Varias piezas apiladas en una celda (nombre + correo + departamento...):
   la celda de Tabulator es "inline-flex" en fila y las ponía una al lado de otra */
.tt-bloque {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

.tt-bloque--centro {
    align-items: center;
}

.tt-bloque > small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Texto normal de celda: como mucho dos líneas (filas de alto uniforme) */
.tt-texto {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.tt-texto[data-tt-completo] {
    cursor: help;
}

.tt-recorte__info {
    flex: 0 0 auto;
    margin-left: 4px;
    color: var(--tfg-accent);
    font-size: 0.85em;
    opacity: 0.8;
}

.tt-recorte:hover .tt-recorte__info {
    opacity: 1;
}
.tt-bocadillo {
    position: fixed;
    z-index: 2100;
    max-width: min(460px, 90vw);
    padding: 8px 11px;
    border-radius: 8px;
    background: var(--tfg-accent-darker, #1f2937);
    color: #fff;
    font-size: 12px;
    line-height: 1.45;
    white-space: normal;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
    pointer-events: none;
    animation: tt-fundido 0.12s ease-out;
}

/* Tabla con muchas columnas estrechadas para caber sin barra horizontal:
   el título de la columna puede ocupar dos líneas. */
.tabulator.tt--compacta .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {
    white-space: normal;
    line-height: 1.15;
    overflow-wrap: normal;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* ========================================================================== */
/* ALTO UNIFORME DE LAS FILAS                                                 */
/* Cada dato de las celdas de personas (nombre, correo, DNI · titulación,     */
/* departamento...) ocupa UNA línea y se corta con "…" (el texto completo se  */
/* ve al pasar el ratón). Así todas las filas tienen el alto de la celda de   */
/* tutor/a, sin filas más altas según el ancho de las columnas.               */
/* ========================================================================== */
.tt .tabulator-row .tabulator-cell .est-persona,
.tt .tabulator-row .tabulator-cell .est-tutores,
.tt .tabulator-row .tabulator-cell .est-codigo,
.tt .tabulator-row .tabulator-cell .est-estado-doble {
    min-width: 0;
    max-width: 100%;
}

.tt .tabulator-row .tabulator-cell .est-persona > strong,
.tt .tabulator-row .tabulator-cell .est-persona > small,
.tt .tabulator-row .tabulator-cell .est-persona > a,
.tt .tabulator-row .tabulator-cell .est-vacio,
.tt .tabulator-row .tabulator-cell .est-estado-doble > small,
.tt .tabulator-row .tabulator-cell .doc-dpto,
.tt .tabulator-row .tabulator-cell .doc-lugar {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt .tabulator-row .tabulator-cell .est-vacio {
    display: inline-block;
}

/* Tutor/a y cotutor/a: la etiqueta y la persona siempre en la misma línea */
.tt .tabulator-row .tabulator-cell .est-tutores {
    width: 100%;
    gap: 3px;
}

.tt .tabulator-row .tabulator-cell .est-tutores > div {
    flex-wrap: nowrap;
}

.tt .tabulator-row .tabulator-cell .est-tutores > div > .est-persona,
.tt .tabulator-row .tabulator-cell .est-tutores > div > .est-vacio {
    flex: 1 1 0;
}

.tt .tabulator-row .tabulator-cell .est-rol {
    flex: 0 0 auto;
}

/* Código y línea del TFG: la línea en una sola fila con "…" */
.tt .tabulator-row .tabulator-cell .est-codigo > .est-codigo__linea {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Textos largos (título, observaciones...): como mucho dos líneas */
.tt .tabulator-row .tabulator-cell .est-texto {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* ========================================================================== */
/* SELECCIÓN «SUAVE» (body.tt-sel-suave)                                      */
/* Histórico y certificados: todas las filas vienen seleccionadas (son las    */
/* que entran en el certificado). Las seleccionadas conservan el fondo        */
/* alterno y el resaltado al pasar el ratón, con una marca a la izquierda;    */
/* las que se quitan de la selección se ven atenuadas.                        */
/* ========================================================================== */
.tt-sel-suave .tt .tabulator .tabulator-row.tabulator-selected {
    background: #ffffff;
    box-shadow: inset 3px 0 0 var(--tfg-accent);
}

.tt-sel-suave .tt .tabulator .tabulator-row.tabulator-selected.tabulator-row-even {
    background: var(--tfg-row-alt);
}

.tt-sel-suave .tt .tabulator .tabulator-row.tabulator-selected:hover,
.tt-sel-suave .tt .tabulator .tabulator-row.tabulator-selectable:hover {
    background: var(--tfg-row-hover);
}

.tt-sel-suave .tt .tabulator .tabulator-row.tabulator-selected .tabulator-cell.tt-col-acciones {
    background: var(--tfg-row-alt);
}

.tt-sel-suave .tt .tabulator .tabulator-row:not(.tabulator-selected) .tabulator-cell:not(.tt-col-sel) {
    opacity: 0.55;
}

.tt-sel-suave .tt .tabulator .tabulator-row:not(.tabulator-selected):hover .tabulator-cell {
    opacity: 0.85;
}

/* ========================================================================== */
/* FOCO DEL TECLADO (WCAG 2.4.7): zona de filas desplazable, editores y celdas */
/* ========================================================================== */
.tt .tabulator-tableholder:focus-visible,
.tt .tabulator .tabulator-cell:focus-visible,
.tt .tabulator .tabulator-cell input:focus,
.tt .tabulator .tabulator-cell select:focus,
.tt .tabulator .tabulator-cell textarea:focus {
    outline: 2px solid var(--tfg-accent);
    outline-offset: -2px;
}

.tt-rango input:focus {
    outline: 2px solid var(--tfg-accent);
    outline-offset: 0;
    border-color: var(--tfg-accent);
}

/* Nombre y correo en una sola línea cada uno (filas del mismo alto);
   el nombre completo se ve en el title */
.tt-bloque--linea > strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
