/* ============================================================
   DOCUMENTOS INSTITUCIONALES / DE GESTIÓN
   Fiel al prototipo de EPS Marañón S.A.
   ============================================================ */

.epsm-documentos-wrapper {
    width: 100%;
    margin: 0 auto;
}

/* ------------------------------------------------------------
   1. BARRA SUPERIOR DE FILTROS (Fiel a .docs-filter-bar del prototipo)
   ------------------------------------------------------------ */
.docs-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.docs-search-wrapper {
    flex-grow: 1;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: box-shadow var(--transition, 0.25s ease), border-color var(--transition, 0.25s ease);
}

.docs-search-wrapper:focus-within {
    box-shadow: 0 0 0 2px rgba(0, 119, 200, 0.12);
}

.search-icon {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin-right: 8px;
}

.docs-search-wrapper .docs-filter-input,
input[type="text"].docs-filter-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 16px 0;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    box-shadow: none;
    border-radius: 0;
    min-width: 250px;
    font-family: inherit;
    line-height: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.docs-filter-input::placeholder {
    color: var(--text-soft);
}

.epsm-documentos-wrapper .docs-filter-select,
select.docs-filter-select {
    padding: 16px 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
    min-width: 120px;
    font-family: inherit;
    transition: box-shadow var(--transition, 0.25s ease), border-color var(--transition, 0.25s ease);
}


.epsm-documentos-wrapper .docs-page-size-select {
    padding: 8px 16px;
    min-width: auto;
}

.epsm-documentos-wrapper .docs-filter-select:focus,
select.docs-filter-select:focus {
    box-shadow: 0 0 0 2px rgba(0, 119, 200, 0.12);
}





/* ------------------------------------------------------------
   2. ESTADO VACÍO
   ------------------------------------------------------------ */
.docs-empty-state {
    padding: 48px 24px;
    text-align: center;
    background: var(--white);
    border-radius: 16px;
    border: 1px dashed var(--border);
    margin-bottom: 32px;
}

.docs-empty-state .epsm-empty-notice {
    color: var(--text-soft, #334155);
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

/* ------------------------------------------------------------
   3. GRILLA DE DOCUMENTOS (Fiel a .docs-grid y .doc-grid-card)
   ------------------------------------------------------------ */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.doc-grid-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    overflow: hidden;
    border: 1px solid transparent;
}

.doc-grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.doc-grid-card-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ------------------------------------------------------------
   4. PLACEHOLDER / BADGES DE FORMATO POR EXTENSIÓN (Fiel al prototipo)
   ------------------------------------------------------------ */
.doc-format-placeholder {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

/* PDF */
.doc-format-pdf {
    background: #f0f4f8;
    color: var(--blue-deep);
}

/* Word */
.doc-format-word {
    background: #e6f7ff;
    color: var(--blue);
}

/* Excel */
.doc-format-excel {
    background: #e0f7fa;
    color: var(--cyan);
}

/* ZIP / RAR */
.doc-format-zip {
    background: #f1f3f4;
    color: var(--text-dark);
}

.doc-format-pdf i,
.doc-format-word i,
.doc-format-excel i,
.doc-format-zip i {
    opacity: 0.9;
}

/* ------------------------------------------------------------
   5. CONTENIDO DE LA TARJETA (Fiel a .doc-grid-content)
   ------------------------------------------------------------ */
.doc-grid-content {
    padding: 24px;
    flex-grow: 1;
}

.doc-grid-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 12px;
}

.doc-grid-title {
    font-size: 1rem;
    font-weight: bold;
    color: var(--blue-deep);
    line-height: 1.4 !important;
    margin-bottom: 8px;
    transition: color 0.2s ease;
    word-break: break-word;
}

.doc-grid-card:hover .doc-grid-title {
    color: var(--blue);
}

.doc-desc {
    color: var(--text) !important;
    margin-bottom: 0;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
    word-break: break-word;
}

/* ------------------------------------------------------------
   6. PAGINACIÓN INTERACTIVA (Fiel a .docs-pagination-wrapper del prototipo)
   ------------------------------------------------------------ */
.docs-pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    flex-wrap: wrap;
    gap: 24px;
}

.docs-page-info {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.docs-pagination-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.docs-pagination-numbers {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.docs-page {
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--white);
    color: var(--blue-deep);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all var(--transition, 0.25s ease);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0;
}

.docs-page:hover:not([disabled]) {
    background: var(--blue-light);
}

.docs-page.active,
.docs-page.active:hover {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

.docs-page:disabled,
.docs-page[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--white);
    border-color: var(--border);
}

.docs-page-ellipsis {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-weight: 600;
}

.docs-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-page-size label {
    font-size: 0.9rem;
    color: var(--text-soft);
}

.docs-page-size select {
    min-width: auto;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 12px;
}

/* ------------------------------------------------------------
   7. RESPONSIVE DESIGN (Fiel a @media (max-width: 960px) del prototipo)
   ------------------------------------------------------------ */
@media (max-width: 1200px) {
    .docs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 960px) {
    .docs-pagination-wrapper {
        flex-direction: column;
        justify-content: center;
        gap: 16px;
    }

    .docs-filter-bar {
        flex-direction: column;
        border-radius: 16px;
        padding: 0;
        gap: 16px;
    }

    .docs-filter-input,
    .docs-filter-select {
        width: 100%;
        text-align: left;
    }

    .docs-search-wrapper {
        width: 100%;
    }

    .docs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .docs-grid {
        grid-template-columns: 1fr;
    }

    .docs-filter-input,
    .docs-filter-select {
        text-align: center;
    }

    .docs-page-info {
        order: 1;
        text-align: center;
    }

    .docs-pagination-nav {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .docs-page-size {
        order: 3;
        justify-content: center;
    }
}

@media (max-width: 480px) {

    .docs-pagination-nav,
    .docs-pagination-numbers {
        gap: 4px;
    }

    .docs-page {
        width: 32px;
        min-width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .docs-page-ellipsis {
        width: 20px;
        height: 32px;
        font-size: 0.85rem;
    }
}