:root {
    --t-primary: #0b3d91;
    --t-primary-600: #0a3479;
    --t-primary-50: #eef3fc;
    --t-accent: #f2a900;
    --t-bg: #f4f6fa;
    --t-surface: #ffffff;
    --t-border: #e3e8f0;
    --t-text: #1f2937;
    --t-muted: #6b7280;
    --t-radius: 14px;
    --t-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
}

html { font-size: 15px; }

body.t-body {
    background: var(--t-bg);
    color: var(--t-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    margin-bottom: 0;
    min-height: 100vh;
}

/* ---------- Encabezado ---------- */
.t-header {
    background: var(--t-surface);
    border-bottom: 1px solid var(--t-border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.t-header .t-header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .65rem 1.5rem;
}
.t-header img { height: 42px; }
.t-header .t-header-title {
    border-left: 1px solid var(--t-border);
    padding-left: 1rem;
    line-height: 1.2;
}
.t-header .t-header-title strong { display: block; font-size: 1.05rem; color: var(--t-primary); }
.t-header .t-header-title span { font-size: .8rem; color: var(--t-muted); }

.t-hero {
    background: linear-gradient(135deg, var(--t-primary) 0%, #1559c7 100%);
    color: #fff;
    padding: 2.25rem 1.5rem 4.5rem;
}
.t-hero h1 { font-size: 1.75rem; font-weight: 700; margin: 0 0 .35rem; }
.t-hero p { margin: 0; opacity: .85; }
.t-hero .t-back {
    color: #fff;
    opacity: .85;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .75rem;
    text-decoration: none;
}
.t-hero .t-back:hover { opacity: 1; text-decoration: none; }

.t-container {
    max-width: 1400px;
    margin: -3rem auto 2rem;
    padding: 0 1.5rem;
}

/* ---------- Tarjetas genéricas ---------- */
.t-card {
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow);
}

/* ---------- Selección de programa ---------- */
.t-programas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.t-programa {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1.75rem;
    color: var(--t-text);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.t-programa:hover {
    transform: translateY(-3px);
    border-color: var(--t-primary);
    box-shadow: 0 10px 30px rgba(11, 61, 145, .15);
    text-decoration: none;
    color: var(--t-text);
}
.t-programa .t-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--t-primary-50);
    color: var(--t-primary);
}
.t-programa h3 { font-size: 1.15rem; font-weight: 600; margin: 0; }
.t-programa p { color: var(--t-muted); margin: 0; font-size: .92rem; }
.t-programa .t-go { margin-top: auto; color: var(--t-primary); font-weight: 600; font-size: .9rem; }

/* ---------- Layout del listado ---------- */
.t-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 991px) {
    .t-layout { grid-template-columns: 1fr; }
}

.t-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
}
@media (max-width: 991px) {
    .t-sidebar { position: static; max-height: 360px; }
}
.t-sidebar-head {
    padding: 1rem 1rem .75rem;
    border-bottom: 1px solid var(--t-border);
}
.t-sidebar-head h2 {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--t-muted);
    margin: 0 0 .6rem;
    font-weight: 600;
}
.t-carreras {
    list-style: none;
    margin: 0;
    padding: .5rem;
    overflow-y: auto;
}
.t-carrera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 10px;
    padding: .6rem .75rem;
    color: var(--t-text);
    font-size: .88rem;
    line-height: 1.3;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.t-carrera:hover { background: var(--t-primary-50); }
.t-carrera:focus { outline: 2px solid rgba(11, 61, 145, .35); outline-offset: 1px; }
.t-carrera.active { background: var(--t-primary); color: #fff; }
.t-carrera.t-general { font-weight: 600; }
.t-carrera .t-badge {
    flex-shrink: 0;
    min-width: 2.2rem;
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: #e8edf6;
    color: var(--t-primary);
}
.t-carrera.active .t-badge { background: rgba(255, 255, 255, .2); color: #fff; }
.t-sep { height: 1px; background: var(--t-border); margin: .4rem .5rem; }

/* ---------- Buscador ---------- */
.t-search {
    position: relative;
}
.t-search svg {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--t-muted);
    pointer-events: none;
}
.t-search input {
    width: 100%;
    border: 1px solid var(--t-border);
    border-radius: 10px;
    padding: .55rem .75rem .55rem 2.25rem;
    font-size: .9rem;
    background: #fbfcfe;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.t-search input:focus {
    outline: none;
    border-color: var(--t-primary);
    box-shadow: 0 0 0 3px rgba(11, 61, 145, .12);
    background: #fff;
}

/* ---------- Panel de resultados ---------- */
.t-panel { min-height: 420px; }
.t-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--t-border);
}
.t-panel-head h2 { font-size: 1.15rem; font-weight: 600; margin: 0; }
.t-panel-head .t-count { color: var(--t-muted); font-size: .85rem; }
.t-panel-head .t-search { width: 320px; max-width: 100%; }

.t-empty {
    padding: 4rem 1.5rem;
    text-align: center;
    color: var(--t-muted);
}
.t-empty svg { color: #c3cddd; margin-bottom: 1rem; }
.t-empty h3 { font-size: 1.05rem; color: var(--t-text); margin-bottom: .35rem; }

.t-loading { padding: 4rem; display: flex; justify-content: center; }
.t-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid var(--t-primary-50);
    border-top-color: var(--t-primary);
    animation: t-spin .8s linear infinite;
}
@keyframes t-spin { to { transform: rotate(360deg); } }

/* ---------- Tabla de tesis ---------- */
.t-table-wrap { overflow-x: auto; }
.t-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .9rem;
}
.t-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafd;
    color: var(--t-muted);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--t-border);
    white-space: nowrap;
}
.t-table tbody td {
    padding: .85rem 1rem;
    border-bottom: 1px solid #eef1f6;
    vertical-align: top;
}
.t-table tbody tr:hover td { background: #fafbff; }
.t-table tbody tr:last-child td { border-bottom: 0; }
.t-table .t-num { color: var(--t-muted); width: 1%; white-space: nowrap; }
.t-table .t-autor { font-weight: 600; white-space: nowrap; }
.t-table .t-titulo-tesis { color: var(--t-text); min-width: 280px; }
.t-table .t-grado { color: var(--t-muted); font-size: .82rem; min-width: 180px; }
.t-table .t-anio { color: var(--t-muted); white-space: nowrap; }

.t-btn-ver {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .8rem;
    border-radius: 8px;
    background: var(--t-primary-50);
    color: var(--t-primary);
    font-weight: 600;
    font-size: .8rem;
    white-space: nowrap;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
.t-btn-ver:hover { background: var(--t-primary); color: #fff; text-decoration: none; }

.t-footer {
    text-align: center;
    color: var(--t-muted);
    font-size: .8rem;
    padding: 1.5rem;
}
