/**
 * GestDoc - Estilos públicos (Área de cliente)
 * Versión: 1.0.0
 */


/* ============================================= */
/* ESTILOS GESTDOC - ÁREA DE CLIENTE            */
/* ============================================= */

/* Forzar tipografía moderna y box-sizing */
.gestdoc-area-cliente,
.gestdoc-area-cliente * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    box-sizing: border-box;
}

/* Contenedor principal */
.gestdoc-area-cliente {
    width: 90% !important;
    max-width: 80% !important;
    margin: 20px auto !important;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    overflow-x: hidden;
}

@media (min-width: 992px) {
    .gestdoc-area-cliente {
       
    }
}

/* CABECERA */
.gestdoc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px 25px;
    flex-wrap: wrap;
    gap: 15px;
    background: #ffffff;
}

.gestdoc-header h2 {
    margin: 0;
    padding: 0;
    border: none;
    color: #2271b1;
    font-size: 24px;
    font-weight: 600;
}

.gestdoc-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.gestdoc-user-name {
    color: #2271b1;
    font-weight: 500;
    font-size: 14px;
}

/* Botones de modo de vista */
.gestdoc-modo-vista {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0f0f1;
    border-radius: 30px;
    padding: 3px;
}

.gestdoc-modo-vista .modo-label {
    font-size: 12px;
    color: #666;
    margin-right: 5px;
    padding: 0 8px;
}

.gestdoc-modo-vista .modo-btn {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    text-decoration: none;
    border-radius: 20px;
    color: #333;
    transition: all 0.2s;
}

.gestdoc-modo-vista .modo-btn:hover {
    background: #e2e4e7;
}

.gestdoc-modo-vista .modo-btn.activo {
    background: #2271b1;
    color: white;
}

.gestdoc-btn-logout {
    background: #dc3545;
    color: white;
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.2s;
    font-size: 14px;
}

.gestdoc-btn-logout:hover {
    background: #c82333;
    color: white;
}

/* MODO TARJETAS - SOLO CATEGORÍAS (GRID) */
.gestdoc-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.gestdoc-cat-card {
    background: white;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.gestdoc-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #2271b1;
}

.gestdoc-cat-card-icono {
    font-size: 48px;
    margin-bottom: 15px;
}

.gestdoc-cat-card-icono img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.gestdoc-cat-card-nombre {
    font-size: 18px;
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 8px;
}

.gestdoc-cat-card-descripcion {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.gestdoc-cat-card-docs {
    font-size: 12px;
    color: #999;
    background: #f8f9fa;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
}

/* MODO PESTAÑAS */
.gestdoc-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 15px 25px 0 25px;
    margin-top: 0;
    border-bottom: 1px solid #e2e4e7;
    background: #ffffff;
}

.gestdoc-cat-tab {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: #50575e;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s ease;
}

.gestdoc-cat-tab:hover {
    background: #ffffff;
    color: #2271b1;
}

.gestdoc-cat-tab-activo {
    background: #ffffff;
    color: #2271b1;
    border-bottom-color: #ffffff;
    margin-bottom: -1px;
    font-weight: 600;
}

.gestdoc-cat-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Contenido común */
.gestdoc-contenido {
    padding: 25px;
    background: #f8f9fa;
    min-height: 400px;
}

/* Tabla de documentos (común para ambos modos) */
.gestdoc-docs-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.gestdoc-docs-table th,
.gestdoc-docs-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e4e7;
}

.gestdoc-docs-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1d2327;
}

.gestdoc-docs-table tr:hover {
    background: #f8f9fa;
}

.gestdoc-btn-descargar {
    display: inline-block;
    background: #2271b1;
    color: white;
    padding: 6px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.gestdoc-btn-descargar:hover {
    background: #135e96;
    color: white;
}

/* Mensajes */
.gestdoc-sin-documentos {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e4e7;
}

.gestdoc-sin-documentos h3 {
    color: #2271b1;
    margin-bottom: 15px;
    font-size: 24px;
}

.gestdoc-suplantacion-bar {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 20px;
    margin: 0 25px 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-radius: 5px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .gestdoc-header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .gestdoc-header h2 {
        font-size: 20px;
    }
    
    .gestdoc-user-info {
        justify-content: center;
        flex-direction: column;
    }
    
    .gestdoc-modo-vista {
        order: 1;
    }
    
    .gestdoc-cat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }
    
/* Pestañas públicas en móvil - Distribución fluida sin scroll ni lista vertical */
    .gestdoc-cat-nav {
        display: flex !important;
        flex-wrap: wrap !important;   /* Permite saltar de línea si no caben */
        gap: 6px 4px !important;      /* Separación perfecta entre filas y columnas */
        padding: 15px !important;
        border-bottom: 1px solid #e2e4e7 !important; /* Mantiene la línea divisoria */
    }
    
    .gestdoc-cat-tab {
        flex: 1 1 auto !important;    /* Se estiran para rellenar los huecos de la fila */
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 10px 12px !important;
        font-size: 13px !important;
        border-radius: 4px !important; /* Bordes redondeados individuales tipo botón */
        border: 1px solid #c3c4c7 !important;
        margin: 0 !important;
    }
    
    .gestdoc-cat-tab-activo {
        background: #ffffff !important;
        color: #2271b1 !important;
        border-color: #2271b1 !important;
    }

    
    .gestdoc-contenido {
        padding: 15px;
    }
    
    .gestdoc-docs-table,
    .gestdoc-docs-table thead,
    .gestdoc-docs-table tbody,
    .gestdoc-docs-table th,
    .gestdoc-docs-table td,
    .gestdoc-docs-table tr {
        display: block;
    }
    
    .gestdoc-docs-table thead {
        display: none;
    }
    
    .gestdoc-docs-table tr {
        border: 1px solid #e2e4e7;
        border-radius: 8px;
        margin-bottom: 15px;
        background: #ffffff;
        padding: 12px;
    }
    
    .gestdoc-docs-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        border-bottom: 1px solid #f0f0f0;
        text-align: right;
    }
    
    .gestdoc-docs-table td:last-child {
        border-bottom: none;
    }
    
    .gestdoc-docs-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #2271b1;
        text-align: left;
        flex: 1;
    }
    
    .gestdoc-suplantacion-bar {
        margin: 0 15px 15px 15px;
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .gestdoc-header h2 {
        font-size: 18px;
    }
    
    .gestdoc-docs-table td {
        padding: 8px;
        font-size: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .gestdoc-docs-table td::before {
        margin-bottom: 5px;
    }
}
.gestdoc-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
}
/* Tarjeta seleccionada en modo tarjetas */
.gestdoc-cat-card.activo,
.gestdoc-cat-card[data-selected="true"],
.gestdoc-cat-card-selected {
    background: #f0f6ff !important;
    border: 2px solid #2271b1 !important;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15) !important;
    position: relative;
}

/* Opcional: un pequeño indicador visual */
.gestdoc-cat-card.activo::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 12px;
    background: #2271b1;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* La tarjeta activa cambia el color del título */
.gestdoc-cat-card.activo .gestdoc-cat-card-nombre {
    color: #135e96 !important;
}
/* Forzar padding correcto en tablas */
.gestdoc-area-cliente .gestdoc-docs-table th,
.gestdoc-area-cliente .gestdoc-docs-table td {
    padding: 6px 12px !important;
}
