/* ============================================
   ESTILOS EXISTENTES (VISTA TARJETAS)
============================================ */
/* Contenedor de la tabla */
.gd-tabla-documentos {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
}

.gd-tabla-documentos th {
    background-color: #f8f9fa;
    color: #333;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
    text-align: left;
}

.gd-tabla-documentos td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Estilo del título principal (el que tiene rowspan) */
.gd-titulo-documento-tabla {
    background-color: #fafafa;
    font-weight: 600;
    color: #2c3e50;
    width: 30%;
    border-right: 1px solid #eee;
}

/* Info del archivo */
.gd-info-archivo-tabla {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gd-textos-archivo {
    display: flex;
    flex-direction: column;
}

.gd-extension {
    font-size: 0.7rem;
    color: #888;
    font-weight: bold;
}

/* Botones de acción alineados */
.gd-acciones-fila {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
}

.gd-btn-action {
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.gd-ver {
    background: #e7f1ff;
    color: #007bff;
    border: 1px solid #007bff;
}

.gd-ver:hover {
    background: #007bff;
    color: #fff;
}

.gd-descargar {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ccc;
}

.gd-descargar:hover {
    background: #333;
    color: #fff;
}

/* Ajuste para el buscador */
.gd-buscador-tabla {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* BLOQUE DOCUMENTO */
.gd-documento-item{
    background:#fff;
    border:1px solid #e5e5e5;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 4px 12px rgba(0,0,0,.05);
}

/* TITULO DEL DOCUMENTO */
.gd-documento-titulo{
    font-size:34px;
    font-weight:700;
    padding:20px;
    margin:0;
    border-bottom:1px solid #eee;
    line-height:1.1;
}

/* WRAPPER DE ARCHIVOS */
.gd-lista-archivos-wrapper{
    padding:15px;
    display:flex;
    flex-direction:column;
    gap:15px;
}

/* ITEM ARCHIVO */
.gd-archivo-individual-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    padding:18px;
    border:1px solid #e8e8e8;
    border-radius:10px;
    background:#fff;
}

/* META ARCHIVO */
.gd-archivo-meta{
    display:flex;
    align-items:center;
    gap:20px;
    flex:1;
    min-width:0;
}

/* BADGE EXTENSION */
.gd-tipo-archivo{
    min-width:55px;
    text-align:center;
    padding:8px 10px;
    border-radius:6px;
    font-size:13px;
    font-weight:700;
    color:#fff;
    flex-shrink:0;
}

/* COLORES POR TIPO */
.gd-tipo-pdf{
    background:#d32f2f;
}

.gd-tipo-xls,
.gd-tipo-xlsx{
    background:#2e7d32;
}

.gd-tipo-doc,
.gd-tipo-docx{
    background:#1565c0;
}

/* TITULO ARCHIVO */
.gd-titulo-archivo-descarga{
    font-size:20px;
    color:#333;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

/* BOTÓN */
.gd-boton-descarga{
    background:#0077b6;
    color:#fff !important;
    padding:12px 20px;
    border-radius:8px;
    text-decoration:none;
    font-weight:600;
    white-space:nowrap;
    transition:.3s;
}

.gd-boton-descarga:hover{
    background:#005f8f;
}

/* SIN DOCUMENTOS */
.gd-sin-documentos{
    padding:20px;
    text-align:center;
}

/* ==========================================
   TABLA DOCUMENTOS (CORREGIDA)
========================================== */

.gd-tabla-documentos-container{
    width:100%;
    overflow-x:auto;
    background:#fff;
    border-radius:12px;
    box-shadow:0 4px 12px rgba(0,0,0,.05);
}

.gd-tabla-documentos{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
}

/* CABECERA */
.gd-tabla-documentos thead{
    background:#0d6efd;
}

.gd-tabla-documentos th{
    color:#fff;
    padding:18px;
    text-align:left;
    font-size:15px;
    font-weight:600;
}

/* CELDAS */
.gd-tabla-documentos td{
    padding:18px;
    border-bottom:1px solid #eee;
    vertical-align:middle;
}

/* ANCHOS */
.gd-tabla-documentos th:nth-child(1),
.gd-tabla-documentos td:nth-child(1){
    width:30%;
}

.gd-tabla-documentos th:nth-child(2),
.gd-tabla-documentos td:nth-child(2){
    width:45%;
}

.gd-tabla-documentos th:nth-child(3),
.gd-tabla-documentos td:nth-child(3){
    width:25%;
}

/* TITULO DOCUMENTO */
.gd-titulo-documento-tabla{
    font-weight:700;
    font-size:15px;
    color:#333;
    background:#fafafa;
    vertical-align:top;
    word-break:break-word;
}

/* ARCHIVO */
.gd-info-archivo-tabla{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:nowrap; /* IMPORTANTE */
}

/* ICONO */
.gd-icono-archivo{
    flex-shrink:0;
    font-size:20px;
}

/* TEXTO ARCHIVO */
.gd-nombre-archivo-tabla{
    flex:1;
    word-break:break-word;
    white-space:normal;
}

/* EXTENSION */
.gd-extension{
    flex-shrink:0;
    padding:4px 8px;
    border-radius:4px;
    background:#f1f1f1;
    font-size:11px;
    font-weight:700;
}

/* ACCIONES */
.gd-acciones-tabla{
    display:flex;
    gap:8px;
    justify-content:flex-start;
    align-items:center;
    flex-wrap:nowrap; /* IMPORTANTE */
}

/* BOTONES */
.gd-boton-tabla{
    padding:8px 14px;
    border-radius:6px;
    text-decoration:none;
    font-size:13px;
    font-weight:600;
    white-space:nowrap;
}

/* VER */
.gd-boton-ver{
    background:#28a745;
    color:#fff !important;
}

/* DESCARGAR */
.gd-boton-descargar-tabla{
    background:#0d6efd;
    color:#fff !important;
}

/* HOVER */
.gd-tabla-documentos tbody tr:hover{
    background:#f8f9fa;
}

/* ANCHOS */
.gd-tabla-documentos th:nth-child(1){
    width:25%;
}

.gd-tabla-documentos th:nth-child(2){
    width:50%;
}

.gd-tabla-documentos th:nth-child(3){
    width:25%;
}

/* TITULO DOCUMENTO */
.gd-titulo-documento-tabla{
    font-weight:700;
    color:#1a1e2b;
    font-size:15px;
    vertical-align:top;
    background:#fafbfc;
    word-break:break-word;
}

/* ARCHIVO */
.gd-info-archivo-tabla{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

/* ICONO */
 

/* NOMBRE ARCHIVO */
.gd-nombre-archivo-tabla{
    font-weight:500;
    color:#2c3e50;
    word-break:break-word;
}

/* EXTENSION */
.gd-extension-badge{
    display:inline-block;
    background:#eef2f6;
    padding:4px 8px;
    border-radius:4px;
    font-size:11px;
    font-weight:700;
    color:#5a6c7e;
}

/* ACCIONES */
 

/* BOTONES TABLA */
.gd-boton-tabla{
    display:inline-block;
    min-width:90px;
    text-align:center;
    padding:8px 12px;
    text-decoration:none;
    border-radius:6px;
    font-size:12px;
    font-weight:600;
    margin:3px;
    transition:all .2s ease;
}

/* BOTÓN VER */
.gd-boton-ver{
    background:#4caf50;
    color:white !important;
}

.gd-boton-ver:hover{
    background:#43a047;
}

/* BOTÓN DESCARGAR */
.gd-boton-descargar-tabla{
    background:#0d6efd;
    color:white !important;
}

.gd-boton-descargar-tabla:hover{
    background:#0b5ed7;
}

/* ============================================
   PAGINACIÓN
============================================ */

.gd-paginacion-container{
    margin-top:25px;
    text-align:center;
    display:flex;
    justify-content:center;
    gap:8px;
    flex-wrap:wrap;
}

.page-btn{
    padding:8px 14px;
    border:1px solid #dee2e6;
    border-radius:6px;
    cursor:pointer;
    background:white;
    color:#0d6efd;
    font-weight:500;
}

.page-btn:hover{
    background:#0d6efd;
    color:white;
}

.page-btn.active{
    background:#0d6efd;
    color:white;
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width:768px){

    /* TARJETAS */
    .gd-archivo-individual-item{
        flex-direction:column !important;
        align-items:stretch !important;
        gap:15px !important;
    }

    .gd-archivo-meta{
        flex-direction:column !important;
        align-items:flex-start !important;
        width:100% !important;
    }

    .gd-titulo-archivo-descarga{
        display:block !important;
        width:100% !important;
        white-space:normal !important;
        word-break:break-word !important;
        overflow:visible !important;
    }

    .gd-archivo-acciones{
        width:100% !important;
    }

    .gd-boton-descarga{
        display:block !important;
        width:100% !important;
        text-align:center !important;
    }

    /* TABLA */
   

    .gd-tabla-documentos,
    .gd-tabla-documentos tbody,
    .gd-tabla-documentos tr,
    .gd-tabla-documentos td{
        display:block;
        width:100%;
    }

    .gd-tabla-documentos tr{
        margin-bottom:20px;
        border:1px solid #e0e0e0;
        border-radius:12px;
        overflow:hidden;
    }

    .gd-tabla-documentos td{
        text-align:left;
        border-bottom:1px solid #f0f0f0;
    }

    .gd-info-archivo-tabla{
        display:block;
    }

    .gd-acciones-tabla{
        white-space:normal;
    }

    .gd-boton-tabla{
        width:100%;
        margin-bottom:8px;
    }
}
.gd-acciones-tabla{
    display:flex;
    justify-content:flex-start;
    align-items:center;
    gap:8px;
}

.gd-tabla-documentos td:last-child{
    width:220px;
}
/* =========================
TABLA GENERAL
========================= */

.gd-tabla-wrapper{
    width:100%;
    overflow-x:auto;
}

.gd-tabla-documentos{
    width:100%;
    border-collapse:collapse;
    background:#fff;
    border-radius:14px;
    overflow:hidden;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
}

/* =========================
HEADERS
========================= */

.gd-tabla-documentos thead{
    background:#0d6efd;
}

.gd-tabla-documentos th{
    color:#fff;
    padding:14px;
    text-align:center;
    font-size:15px;
}

/* =========================
COLUMNAS
========================= */

.gd-columna-titulo{
    vertical-align:middle;
    border-right:1px solid #eee;
    background:#fdffdf;
    font-weight:600;
    padding:14px;
    width:30%;
}

.gd-columna-archivo{
    padding:14px;
    vertical-align:middle;
    border-bottom:1px solid #eee;
}

.gd-columna-acciones{
    padding:14px;
    vertical-align:middle;
    text-align:center;
    border-bottom:1px solid #eee;
    width:190px;
}

/* =========================
BOTONES
========================= */

.gd-acciones-wrap{
    display:flex;
    gap:8px;
    justify-content:center;
    flex-wrap:wrap;
}

.gd-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    padding:8px 12px;
    border-radius:8px;
    text-decoration:none;
    color:#fff !important;
    font-size:13px;
    transition:.2s;
}

.gd-btn:hover{
    transform:translateY(-1px);
}

.gd-btn-ver{
    background:#28a745;
}

.gd-btn-download{
    background:#0d6efd;
}

/* =========================
BUSCADOR
========================= */

.gd-buscador-tabla{
    width:100%;
    margin-bottom:20px;
    padding:14px;
    border-radius:10px;
    border:1px solid #ddd;
    font-size:15px;
}

/* =========================
PAGINACIÓN
========================= */

.gd-paginacion-container{
    margin-top:20px;
    display:flex;
    justify-content:center;
    gap:8px;
    flex-wrap:wrap;
}

.page-btn{
    border:none;
    background:#eee;
    padding:8px 12px;
    border-radius:8px;
    cursor:pointer;
}

.page-btn.active{
    background:#0d6efd;
    color:#fff;
}

/* =========================
RESPONSIVE
========================= */

@media(max-width:768px){

    .gd-tabla-documentos th{
        font-size:13px;
        padding:10px;
    }

    .gd-tabla-documentos td{
        font-size:13px;
    }

    .gd-columna-titulo{
        width:auto;
        min-width:120px;
    }

    .gd-columna-acciones{
        width:auto;
    }

    .gd-btn{
        width:100%;
    }

    .gd-acciones-wrap{
        flex-direction:column;
    }

}
/* HEADER TABLA */
.gd-tabla-documentos thead th{
    background: #0d6efd;
    color: #ffffff !important;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    border: none;
}

/* TABLA GENERAL */
.gd-tabla-documentos{
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* CONTENEDOR RESPONSIVE */
.gd-tabla-documentos-container{
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
}

/* CELDAS */
.gd-tabla-documentos td{
    word-break: break-word;
}

/* MOBILE */
@media(max-width:768px){

    .gd-tabla-documentos thead th{
        font-size: 13px;
        padding: 10px;
    }

    .gd-tabla-documentos td{
        font-size: 13px;
        padding: 8px !important;
    }

}
/* =========================
   MOBILE RESPONSIVE TABLE
========================= */
@media(max-width:768px){

    .gd-tabla-documentos,
    .gd-tabla-documentos thead,
    .gd-tabla-documentos tbody,
    .gd-tabla-documentos th,
    .gd-tabla-documentos td,
    .gd-tabla-documentos tr{
        display:block;
        width:100%;
    }

    .gd-tabla-documentos thead{
        display:none;
    }

    .gd-tabla-documentos tr{
        background:#fff;
        margin-bottom:20px;
        border-radius:16px;
        overflow:hidden;
        box-shadow:0 4px 15px rgba(0,0,0,.08);
        border:1px solid #eee;
    }

    .gd-tabla-documentos td{
        border:none !important;
        width:100% !important;
        display:block;
        text-align:left !important;
        padding:14px !important;
    }

    .gd-tabla-documentos td:nth-child(1){
        background:#fdffdf;
        font-weight:bold;
        font-size:16px;
    }

    .gd-tabla-documentos td:nth-child(2){
        border-top:1px solid #eee !important;
    }

    .gd-tabla-documentos td:nth-child(3){
        border-top:1px solid #eee !important;
    }

    .gd-tabla-documentos td div{
        width:100%;
    }

    .gd-tabla-documentos a{
        width:100%;
        justify-content:center;
    }

    .gd-tabla-documentos td[style*="width: 180px"]{
        width:100% !important;
    }

}