/* ═══════════════════════════════════════════════════════════════════════════
   Transparencia · Información de la entidad (misión, directorios, entes de control)
   Prefijo td-. Usa los tokens GOV.CO definidos en global.css.
   ═══════════════════════════════════════════════════════════════════════════ */

.td-page { padding: 1rem 0 2.5rem; max-width: 1100px; }

/* ── Encabezado ── */
.td-header { margin-bottom: 1.75rem; }
.td-eyebrow {
    display: inline-block; margin-bottom: .4rem;
    font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--govco-primary-color);
}
.td-title {
    margin: 0 0 .7rem; line-height: 1.2;
    font-family: var(--govco-font-primary); font-size: 1.9rem; font-weight: 800;
    color: var(--govco-secondary-color);
}
.td-divider { width: 48px; height: 4px; border-radius: 2px; background: var(--govco-primary-color); }
.td-lead { margin: 1rem 0 0; max-width: 70ch; color: var(--govco-matterhorn); line-height: 1.65; }

/* ── Barra de búsqueda ── */
.td-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: .75rem; }
.td-search {
    flex: 1 1 320px; display: flex; max-width: 520px;
    border: 1.5px solid rgba(9, 67, 133, .3); border-radius: 8px; overflow: hidden; background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.td-search:focus-within { border-color: var(--govco-primary-color); box-shadow: 0 0 0 3px rgba(51, 102, 204, .18); }
.td-search input {
    flex: 1; min-width: 0; height: 44px; padding: 0 1rem; border: 0; outline: 0;
    font-family: var(--govco-font-primary); font-size: .92rem; color: #222; background: transparent;
}
.td-search button {
    display: flex; align-items: center; justify-content: center; width: 48px; height: 44px;
    border: 0; cursor: pointer; color: #fff; background: var(--govco-secondary-color); transition: background .15s;
}
.td-search button:hover { background: var(--govco-primary-color); }
.td-perpage { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--govco-matterhorn); }
.td-perpage select {
    height: 44px; padding: 0 .6rem; border: 1.5px solid rgba(9, 67, 133, .3); border-radius: 8px;
    background: #fff; font-size: .9rem; color: #222;
}
.td-clear { font-size: .85rem; color: var(--govco-primary-color); text-decoration: underline; }
.td-count { min-height: 1.3rem; margin: 0 0 1rem; font-size: .85rem; color: var(--govco-matterhorn); }

/* ── Tabla ── */
.td-tablewrap {
    overflow-x: auto; background: #fff; border: 1.5px solid var(--govco-solitude); border-radius: 12px;
}
.td-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.td-table thead th {
    padding: .85rem 1rem; text-align: left; white-space: nowrap;
    font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--govco-secondary-color); background: #eef3fa; border-bottom: 2px solid var(--govco-tropical-blue);
}
.td-table tbody td {
    padding: .85rem 1rem; vertical-align: top; color: var(--govco-matterhorn); line-height: 1.5;
    border-bottom: 1px solid var(--govco-solitude);
}
.td-table tbody tr:last-child td { border-bottom: 0; }
.td-table tbody tr:hover td { background: #f7faff; }
.td-table .td-strong { font-weight: 700; color: var(--govco-secondary-color); }
.td-table .td-muted { color: #767676; }
.td-table a:not(.td-btn) { color: var(--govco-primary-color); word-break: break-word; }
.td-nowrap { white-space: nowrap; }

/* ── Botón de enlace / etiquetas ── */
.td-btn {
    display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; border-radius: 8px;
    font-size: .82rem; font-weight: 700; text-decoration: none; white-space: nowrap;
    color: var(--govco-secondary-color); background: #fff; border: 1.5px solid var(--govco-secondary-color);
    transition: background .15s, color .15s;
}
.td-btn:hover { background: var(--govco-secondary-color); color: #fff; }
.td-badge {
    display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
    color: var(--govco-secondary-color); background: var(--govco-tropical-blue);
}

/* ── Estado vacío ── */
.td-empty {
    padding: 2.5rem 1rem; text-align: center; color: var(--govco-matterhorn);
    background: #fff; border: 1.5px dashed var(--govco-tropical-blue); border-radius: 12px;
}
.td-empty strong { display: block; margin-bottom: .25rem; font-size: 1rem; color: var(--govco-secondary-color); }

/* ── Tarjetas (entes de control, misión) ── */
.td-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.td-card {
    display: flex; flex-direction: column; gap: .6rem; padding: 1.25rem 1.35rem;
    background: #fff; border: 1.5px solid var(--govco-solitude); border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}
.td-card:hover { border-color: var(--govco-tropical-blue); box-shadow: 0 4px 14px rgba(9, 67, 133, .08); }
.td-card h2, .td-card h3 { margin: 0; font-family: var(--govco-font-primary); font-size: 1.05rem; font-weight: 800; color: var(--govco-secondary-color); }
.td-card p { margin: 0; color: var(--govco-matterhorn); line-height: 1.6; font-size: .93rem; }
.td-card__meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .86rem; }
.td-card__meta a { color: var(--govco-primary-color); word-break: break-all; }
.td-card__actions { margin-top: auto; padding-top: .4rem; }

/* Misión: bloques con icono */
.td-block { display: flex; gap: 1.1rem; padding: 1.5rem; margin-bottom: 1rem; background: #fff; border: 1.5px solid var(--govco-solitude); border-radius: 12px; }
.td-block__icon {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: var(--govco-secondary-color); background: #eef3fa;
}
.td-block h2 { margin: 0 0 .4rem; font-family: var(--govco-font-primary); font-size: 1.25rem; font-weight: 800; color: var(--govco-secondary-color); }
.td-block p { margin: 0; color: var(--govco-matterhorn); line-height: 1.75; text-align: justify; }

/* ── Pestañas ── */
.td-tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.25rem; padding: 0; list-style: none; border-bottom: 2px solid var(--govco-solitude); }
.td-tabs button {
    margin-bottom: -2px; padding: .7rem 1.1rem; border: 0; border-bottom: 3px solid transparent; background: transparent;
    font-family: var(--govco-font-primary); font-size: .92rem; font-weight: 700; color: var(--govco-matterhorn); cursor: pointer;
}
.td-tabs button:hover { color: var(--govco-secondary-color); }
.td-tabs button.active { color: var(--govco-secondary-color); border-bottom-color: var(--govco-primary-color); }
.td-info { padding: 1.4rem 1.5rem; line-height: 1.75; color: var(--govco-matterhorn); background: #f7faff; border: 1.5px solid var(--govco-tropical-blue); border-radius: 12px; }
.td-info p { margin: 0 0 .8rem; text-align: justify; }
.td-info p:last-child { margin-bottom: 0; }

/* ── Paginación ── */
.td-pager { display: flex; justify-content: center; margin-top: 1.5rem; }
.td-page .pagination { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.td-page .pagination .page-link {
    display: flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 .7rem;
    font-size: .88rem; font-weight: 600; color: var(--govco-secondary-color); background: #fff;
    border: 1.5px solid var(--govco-solitude); border-radius: 8px; text-decoration: none;
}
.td-page .pagination .page-link:hover { background: #eef3fa; }
.td-page .pagination .active .page-link { color: #fff; background: var(--govco-secondary-color); border-color: var(--govco-secondary-color); }
.td-page .pagination .disabled .page-link { color: #a0a0a0; background: #f5f5f5; }

/* ── Móvil: las filas de la tabla se apilan como tarjetas ── */
@media (max-width: 767.98px) {
    .td-title { font-size: 1.5rem; }
    .td-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .td-table, .td-table tbody, .td-table tr, .td-table td { display: block; width: 100%; }
    .td-table tbody tr { padding: .6rem 0; border-bottom: 1px solid var(--govco-tropical-blue); }
    .td-table tbody tr:last-child { border-bottom: 0; }
    .td-table tbody td { display: flex; gap: .75rem; padding: .35rem 1rem; border: 0; }
    .td-table tbody td::before {
        content: attr(data-label); flex: 0 0 38%; max-width: 38%;
        font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--govco-secondary-color);
    }
    .td-table tbody tr:hover td { background: transparent; }
    .td-block { flex-direction: column; }
    .td-search { max-width: none; }
}

/* ── Alto contraste ── */
body.high-contrast .td-title, body.high-contrast .td-table .td-strong,
body.high-contrast .td-card h2, body.high-contrast .td-card h3, body.high-contrast .td-block h2 { color: #fff !important; }
body.high-contrast .td-eyebrow { color: #FEDF13 !important; }
body.high-contrast .td-divider { background: #FEDF13 !important; }
body.high-contrast .td-tablewrap, body.high-contrast .td-card, body.high-contrast .td-block,
body.high-contrast .td-empty, body.high-contrast .td-info, body.high-contrast .td-search { background: #000 !important; border-color: #fff !important; }
body.high-contrast .td-table thead th { background: #000 !important; color: #FEDF13 !important; border-color: #fff !important; }
body.high-contrast .td-table tbody td, body.high-contrast .td-lead, body.high-contrast .td-block p,
body.high-contrast .td-card p, body.high-contrast .td-info { color: #fff !important; background: transparent !important; }
body.high-contrast .td-table a:not(.td-btn), body.high-contrast .td-card__meta a { color: #FEDF13 !important; }
body.high-contrast .td-btn { color: #FEDF13 !important; background: #000 !important; border-color: #FEDF13 !important; }
