/**
 * 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: 95% !important;
    max-width: 95% !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 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;
    }
}
.gestdoc-scroll-documentos {
    max-height: 800px;
    overflow-y: auto;
    overflow-x: hidden;

    border: 1px solid #ddd;
    border-radius: 10px;
}
.gestdoc-docs-table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

@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;
}
/* ============================================= */
/* MODAL PARA VER PDF ONLINE - ÁREA CLIENTE      */
/* ============================================= */

.gestdoc-modal-pdf {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.gestdoc-modal-pdf-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.gestdoc-modal-pdf-header {
    padding: 15px 20px;
    background: #2271b1;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.gestdoc-modal-pdf-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.gestdoc-modal-pdf-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
}

.gestdoc-modal-pdf-close:hover {
    color: #ffc107;
}

.gestdoc-modal-pdf-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.gestdoc-modal-pdf-body iframe,
.gestdoc-modal-pdf-body embed {
    width: 100%;
    height: 100%;
    border: none;
}

.gestdoc-modal-pdf-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e2e4e7;
    text-align: center;
    font-size: 13px;
    color: #666;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .gestdoc-modal-pdf-content {
        width: 95%;
        height: 95%;
    }
    .gestdoc-modal-pdf-header h3 {
        font-size: 14px;
    }
    .gestdoc-btn-ver-pdf {
        margin-top: 8px;
        margin-left: 0;
    }
}
/* Botón Ver PDF en área cliente - Mismo estilo para ambos modos */
.gestdoc-btn-ver-pdf {
    all: unset;
}

/* Ajuste para móvil */
@media (max-width: 768px) {
    .gestdoc-btn-ver-pdf {
        margin-top: 8px;
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}
/* ============================================ */
/* CABECERA FIJA EN LISTADO DE DOCUMENTOS       */
/* ============================================ */

.gestdoc-scroll-documentos {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
}

/* La tabla dentro del contenedor scroll */
.gestdoc-scroll-documentos .gestdoc-docs-table {
    margin-top: 0;
    border: none;
    border-radius: 0;
}

/* Cabecera sticky */
.gestdoc-scroll-documentos .gestdoc-docs-table thead tr th {
    position: sticky;
    top: 0;
    background: #f8f9fa !important;
    z-index: 20;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    padding-left: 16px;
}

/* Asegurar fondo sólido */
.gestdoc-scroll-documentos .gestdoc-docs-table thead {
    background: #f8f9fa;
}
/* ============================================ */
/* MODAL CAMBIAR CONTRASEÑA                     */
/* ============================================ */

.gestdoc-modal-pass {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.gestdoc-modal-pass-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.gestdoc-modal-pass-header {
    padding: 15px 20px;
    background: #2271b1;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.gestdoc-modal-pass-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.gestdoc-modal-pass-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0 10px;
}

.gestdoc-modal-pass-body {
    padding: 20px;
}

.gestdoc-modal-pass-body .gestdoc-form-group {
    margin-bottom: 15px;
}

.gestdoc-modal-pass-body .gestdoc-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
}

.gestdoc-pass-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #c3c4c7;
    border-radius: 5px;
    font-size: 14px;
}

.gestdoc-modal-pass-footer {
    padding: 15px 20px;
    border-top: 1px solid #e2e4e7;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.gestdoc-pass-btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.gestdoc-pass-btn-save {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.gestdoc-pass-btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gestdoc-pass-mensaje-success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}

.gestdoc-pass-mensaje-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid #dc3545;
}

@media (max-width: 768px) {
    .gestdoc-modal-pass-content {
        width: 95%;
    }
    .gestdoc-modal-pass-footer {
        flex-direction: column;
    }
    .gestdoc-pass-btn-cancel,
    .gestdoc-pass-btn-save {
        width: 100%;
        text-align: center;
    }
}
.gestdoc-cambiar-pass {
    margin: 0 25px 20px 25px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e4e7;
}

.gestdoc-cambiar-pass .gestdoc-btn-cambiar {
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

.gestdoc-cambiar-pass .gestdoc-btn-cambiar:hover {
    background: #135e96;
}
.gestdoc-pass-container{
    display: flex;
    justify-content: flex-end;
    width: 100%;
    box-sizing: border-box;
}
.gestdoc-btn-cambiar-pass {
	margin-right: 0;
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 400;
    transition: background 0.2s;
}

.gestdoc-btn-cambiar-pass:hover {
    background: #135e96;
}
/* ============================================= */
/* AVISO MAGIC LINK - CUENTA ATRÁS              */
/* ============================================= */

.gestdoc-magic-aviso {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 0 25px 20px 25px;
    flex-wrap: wrap;
}

.gestdoc-magic-aviso-icono {
    font-size: 28px;
    flex-shrink: 0;
}

.gestdoc-magic-aviso-texto {
    flex: 1;
    font-size: 14px;
    color: #856404;
    line-height: 1.5;
}

.gestdoc-magic-aviso-texto strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

#gestdoc-magic-countdown {
    font-weight: 700;
    font-size: 16px;
    color: #856404;
    transition: color 0.3s;
}

.gestdoc-magic-aviso-btn {
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
}

.gestdoc-magic-aviso-btn:hover {
    background: #135e96;
}

@media (max-width: 768px) {
    .gestdoc-magic-aviso {
        margin: 0 15px 15px 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .gestdoc-magic-aviso-btn {
        width: 100%;
    }
}
/* ============================================= */
/* BOTONES ICONO CON TOOLTIP                     */
/* ============================================= */

.gestdoc-acciones-grupo {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.gestdoc-btn-icono {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: transparent;
    color: #444 !important;
    text-decoration: none !important;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    border: 1px solid #c3c4c7;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.gestdoc-btn-icono:hover {
    background: #2271b1;
    border-color: #2271b1;
    color: white !important;
    transform: scale(1.05);
}

/* Tooltip */
.gestdoc-btn-icono::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

/* Flecha del tooltip */
.gestdoc-btn-icono::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1d2327;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

.gestdoc-btn-icono:hover::after,
.gestdoc-btn-icono:hover::before {
    opacity: 1;
}

/* Móvil: mostrar texto en lugar de tooltip */
@media (max-width: 768px) {
    .gestdoc-btn-icono {
        width: auto;
        height: auto;
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 5px;
    }

    .gestdoc-btn-icono::after,
    .gestdoc-btn-icono::before {
        display: none;
    }

    .gestdoc-btn-icono::after {
        content: attr(data-tooltip);
        position: static;
        display: inline;
        background: none;
        color: white;
        padding: 0 0 0 5px;
        font-size: 13px;
        opacity: 1;
        pointer-events: auto;
    }
}
/* ============================================= */
/* OCULTAR HEADER FLATSOME EN ÁREA CLIENTE       */
/* ============================================= */

.gestdoc-area-page #header {
    display: none !important;
}

.gestdoc-area-page #main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ============================================= */
/* CABECERA CON LOGO DE LA ASESORÍA              */
/* ============================================= */

.gestdoc-area-header-logo {
    width: 100%;
    background: #ffffff;
    padding: 15px 30px;
    border-bottom: 1px solid #e2e4e7;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gestdoc-header-logo-plataforma {
    max-height: 70px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
}

.gestdoc-header-logo-separador {
    width: 1px;
    height: 50px;
    background: #e2e4e7;
    margin: 0 25px;
    flex-shrink: 0;
}

.gestdoc-header-logo-asesoria {
    max-height: 70px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
}

@media (max-width: 480px) {
    .gestdoc-header-logo-plataforma,
    .gestdoc-header-logo-asesoria {
        max-height: 35px;
        max-width: 130px;
    }

    .gestdoc-header-logo-separador {
        height: 35px;
        margin: 0 15px;
    }
}

@media (max-width: 768px) {
    .gestdoc-area-header-logo {
        padding: 12px 15px;
        justify-content: center;
    }

    .gestdoc-area-header-logo img {
        max-height: 45px;
    }
}