/* ============================================================
   UTTT · Presupuestos e Informes · 2026
   ============================================================ */

:root {
    --uttt-green: #0ca789;
    --uttt-green-dark: #0a8f75;
    --uttt-green-light: #7cbf3f;
    --uttt-navy: #1b1b4b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 16px;
    --shadow-sm: 0 1px 3px rgba(30, 41, 59, 0.05), 0 2px 6px rgba(30, 41, 59, 0.04);
    --shadow-md: 0 4px 14px rgba(30, 41, 59, 0.08);
    --shadow-green: 0 4px 14px rgba(12, 167, 137, 0.25);
    --font-sans: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'><path d='M28 0l28 16v32L28 64 0 48V16z' fill='none' stroke='%23e2e8f0' stroke-width='1.2'/><path d='M28 72l28 16v-32' fill='none' stroke='%23e2e8f0' stroke-width='1.2'/></svg>");
    background-size: 56px 100px;
    background-attachment: fixed;
    margin: 0;
}

/* CONTENEDOR ANCHO PARA APROVECHAR EL ESPACIO */
.container-uttt {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============ HERO ============ */
.hero-uttt {
    background: linear-gradient(135deg, var(--uttt-navy) 0%, #0d1b3e 55%, var(--uttt-green) 180%);
    color: #fff;
    padding: 3.5rem 1.25rem 4rem;
    text-align: center;
    border-bottom: 5px solid var(--uttt-green-light);
}

/* ============ LOGO EN EL HERO ============ */
.hero-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.hero-logo-img {
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.hero-badge-uttt {
    display: inline-block;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-uttt h1 {
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: 0.75rem;
}

.hero-uttt p.lead {
    font-size: 1.05rem;
    opacity: 0.92;
    max-width: 640px;
    margin: 0 auto;
}

/* ============ SECCIÓN ============ */
.section-uttt {
    padding: 3.5rem 0 4rem;
}

.section-title-uttt {
    text-align: center;
    margin-bottom: 2.5rem;
}

    .section-title-uttt h2 {
        font-family: var(--font-sans);
        font-weight: 800;
        color: var(--uttt-navy);
        font-size: 1.9rem;
        margin-bottom: 0.5rem;
    }

.divider-uttt {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--uttt-green), var(--uttt-green-light));
    border-radius: 999px;
    margin: 0 auto 1rem;
}

.section-title-uttt p {
    color: var(--text-muted);
    margin: 0;
}

/* ============ GRID ============ */
.pdf-grid-uttt {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columnas para el index */
    gap: 1.5rem;
}

/* SOLO PARA LAS PÁGINAS DE ARCHIVOS: 2 columnas anchas */
#pdf-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* ============ TARJETAS ============ */
.pdf-card-uttt {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* SOLO PARA PÁGINAS DE ARCHIVOS: Tarjeta en modo horizontal (acostada) */
#pdf-list .pdf-card-uttt {
    flex-direction: row;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1.5rem;
}

.pdf-card-uttt:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--uttt-green-light);
}

.pdf-card-header-uttt {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

/* SOLO PARA PÁGINAS DE ARCHIVOS */
#pdf-list .pdf-card-header-uttt {
    flex-grow: 1;
    margin-bottom: 0;
    align-items: center;
}

.pdf-icon-uttt {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #ecfdf5;
    color: var(--uttt-green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .pdf-icon-uttt svg {
        width: 20px;
        height: 20px;
    }

/* ============ ALINEACIÓN DE TEXTO EN UNA SOLA LÍNEA ============ */
.pdf-title-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pdf-number-uttt {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: #ecfdf5;
    color: var(--uttt-green-dark);
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
}

/* Tamaño de letra normal (para el index) */
.pdf-card-uttt h3 {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.3;
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

/* SOLO PARA PÁGINAS DE ARCHIVOS: Tamaño original para que no se vea con zoom */
#pdf-list .pdf-card-uttt h3 {
    font-size: 1.05rem;
    line-height: 1.4;
}

/* Botones */
.pdf-actions-uttt {
    margin-top: auto;
    width: 100%;
}

    .pdf-actions-uttt .btn-uttt {
        width: 100%;
    }

/* SOLO PARA PÁGINAS DE ARCHIVOS: Botón más pequeño y estético a la derecha */
#pdf-list .pdf-actions-uttt {
    margin-top: 0;
    width: auto;
    flex-shrink: 0;
}

    #pdf-list .pdf-actions-uttt .btn-uttt {
        width: auto;
        padding: 0.5rem 1.5rem;
        font-size: 0.85rem;
    }

/* ============ BOTÓN (BLINDADO) ============ */
.btn-uttt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--uttt-green);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.1s ease;
    cursor: pointer;
}

    .btn-uttt:hover {
        background: var(--uttt-green-dark);
        transform: translateY(-1px);
    }

    .btn-uttt svg {
        width: 16px;
        height: 16px;
    }

/* ============ FOOTER ============ */
.footer-uttt {
    background: var(--uttt-navy);
    color: rgba(255, 255, 255, 0.75);
    padding: 2rem 1.25rem;
    text-align: center;
    font-size: 0.88rem;
    border-top: 4px solid var(--uttt-green);
}

    .footer-uttt strong {
        color: #fff;
    }

    .footer-uttt a {
        color: var(--uttt-green-light);
        text-decoration: none;
    }

        .footer-uttt a:hover {
            color: #a3e635;
        }

/* ============ BUSCADOR ============ */
.search-wrap-uttt {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

    .search-wrap-uttt input {
        width: 100%;
        padding: 1rem 1rem 1rem 3.2rem;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--surface);
        font-family: var(--font-body);
        font-size: 1rem;
        color: var(--text);
        outline: none;
        box-shadow: var(--shadow-sm);
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

        .search-wrap-uttt input:focus {
            border-color: var(--uttt-green);
            box-shadow: 0 0 0 4px rgba(12, 167, 137, 0.15);
        }

    .search-wrap-uttt svg {
        position: absolute;
        left: 1.2rem;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
        color: var(--text-muted);
        pointer-events: none;
    }

.search-empty-uttt {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    display: none;
    font-family: var(--font-sans);
}

    .search-empty-uttt.is-visible {
        display: block;
    }

/* ============ MODAL PDF ============ */
.modal-overlay-uttt {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 62, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

    .modal-overlay-uttt.is-open {
        display: flex;
    }

.modal-uttt {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 1250px; /* Modal ampliado */
    height: 95vh; /* Altura ampliada */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header-uttt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.modal-title-uttt {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    color: var(--uttt-navy);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-close-uttt {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.3rem;
    border-radius: 6px;
    display: inline-flex;
    transition: all 0.2s ease;
}

    .modal-close-uttt:hover {
        background: #ecfdf5;
        color: var(--uttt-green);
    }

    .modal-close-uttt svg {
        width: 22px;
        height: 22px;
    }

.modal-body-uttt {
    flex: 1;
    overflow: hidden;
    background: #1e293b;
    position: relative; /* Importante para contener el iframe */
}

    .modal-body-uttt iframe {
        width: 100%;
        height: 100%;
        border: 0;
        display: block; /* Evita espacios fantasmas debajo del iframe */
    }

/* ============ PIE DEL MODAL (COPIAR RUTA) ============ */
.modal-footer-uttt {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    align-items: center;
    flex-shrink: 0; /* OBLIGA al pie a quedarse visible y no ser aplastado por el PDF */
    min-height: 70px; /* Le damos una altura mínima para que siempre se vea */
}

/* ============================================================
   MEDIA QUERIES (DISEÑO RESPONSIVO)
   ============================================================ */

/* Tablets y Celulares */
@media (max-width: 991px) {
    .pdf-grid-uttt {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Apilamos las tarjetas de archivos en vertical para que quepan */
    #pdf-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

        #pdf-list .pdf-card-uttt {
            flex-direction: column;
            align-items: stretch;
            padding: 1.25rem; /* Regresamos al padding normal */
            gap: 1rem;
            width: 100%;
        }

        #pdf-list .pdf-card-header-uttt {
            margin-bottom: 1rem;
            align-items: flex-start;
            width: 100%;
        }

        #pdf-list .pdf-title-wrap {
            width: 100%;
            flex-wrap: wrap;
        }

        #pdf-list .pdf-card-uttt h3 {
            font-size: 1.05rem;
            line-height: 1.4;
            word-wrap: break-word;
        }

        #pdf-list .pdf-actions-uttt {
            width: 100%;
        }

            #pdf-list .pdf-actions-uttt .btn-uttt {
                width: 100%;
                padding: 0.8rem 1rem;
                font-size: 0.9rem;
            }
}

/* Celulares pequeños */
@media (max-width: 575px) {
    .pdf-grid-uttt {
        grid-template-columns: 1fr;
    }

    /* Ajustes para el Hero en móvil */
    .hero-uttt {
        padding: 2.5rem 1rem 3rem;
    }

    .hero-logo-img {
        max-width: 150px;
        margin-bottom: 1rem;
    }

    .hero-uttt h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        word-wrap: break-word;
        padding: 0 0.5rem;
    }

    .hero-badge-uttt {
        font-size: 0.7rem;
        padding: 0.3rem 0.75rem;
        margin-bottom: 0.75rem;
    }

    .hero-uttt p.lead {
        font-size: 0.95rem;
        padding: 0 1rem;
        line-height: 1.4;
    }
}
/* ============ PIE DEL MODAL (COPIAR RUTA) ============ */
.modal-footer-uttt {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    align-items: center;
}

    .modal-footer-uttt input {
        flex-grow: 1;
        padding: 0.65rem 1rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        font-family: var(--font-body);
        font-size: 0.85rem;
        color: var(--text-muted);
        background: var(--surface);
        outline: none;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    }

        .modal-footer-uttt input:focus {
            border-color: var(--uttt-green);
        }

    .modal-footer-uttt .btn-copy {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.65rem 1.25rem;
        background: var(--uttt-green);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-family: var(--font-sans);
        font-size: 0.85rem;
        font-weight: 700;
        cursor: pointer;
        transition: background 0.2s ease;
        white-space: nowrap;
    }

        .modal-footer-uttt .btn-copy:hover {
            background: var(--uttt-green-dark);
        }

        .modal-footer-uttt .btn-copy svg {
            width: 16px;
            height: 16px;
        }

/* Ajuste para celulares */
@media (max-width: 575px) {
    .modal-footer-uttt {
        flex-direction: column;
        gap: 0.5rem;
    }

        .modal-footer-uttt input,
        .modal-footer-uttt .btn-copy {
            width: 100%;
        }
}