/* ==========================================
   PÁGINA DE TRANSPARÊNCIA — REDESIGN
   ========================================== */

/* ── Variáveis ── */
:root {
    --tp-primary: #0A3D62;
    --tp-teal:    #00768b;
    --tp-success: #16a34a;
    --tp-bg:      #f1f5f9;
    --tp-card:    #ffffff;
    --tp-dark:    #1e293b;
    --tp-muted:   #64748b;
}

/* ── Reset do body para esta página ── */
.transparencia-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--tp-bg);
    margin: 0;
    /* ← remove scroll "folga" no desktop */
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;           /* ← sobrescreve o height:100vh do style.css */
    min-height: 100vh;
    display: block;         /* ← sobrescreve o display:flex do style.css body */
}

/* ── HERO SECTION ── */
.transp-hero {
    background: linear-gradient(135deg, #050046 0%, #00768b 55%, #0A3D62 100%);
    padding: 52px 24px 44px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.transp-hero::before {
    /* padrão de pontos decorativo */
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.transp-hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 6px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
    backdrop-filter: blur(4px);
}

.transp-hero-title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
    line-height: 1.15;
    text-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

.transp-hero-sub {
    color: rgba(255,255,255,0.78);
    font-size: 1.05rem;
    font-weight: 400;
    margin: 0;
    max-width: 520px;
    margin-inline: auto;
    line-height: 1.6;
}

/* ── Container principal ── */
.transparencia-container {
    max-width: 1060px;
    margin: 36px auto 0;
    padding: 0 24px 56px;
}

/* ── Grid de Estatísticas ── */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--tp-card);
    padding: 32px 28px;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border-top: 4px solid var(--tp-primary);
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.stat-card.success {
    border-top-color: var(--tp-success);
}

.stat-card .label {
    display: block;
    font-size: 11px;
    color: var(--tp-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.stat-card h2 {
    font-size: 44px;
    font-weight: 800;
    color: var(--tp-dark);
    margin: 0;
    line-height: 1;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    font-size: 1rem;
    color: var(--tp-muted);
    animation: tpPulse 1.5s ease-in-out infinite;
}

@keyframes tpPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── Grid de Categorias ── */
.categories-section {
    margin-bottom: 28px;
}

.section-title {
    color: var(--tp-dark);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 16px 2px;
    text-align: left;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
}

.category-card {
    background: var(--tp-card);
    padding: 22px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-bottom: 3px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-bottom-color: var(--tp-teal);
}

.category-icon {
    font-size: 2rem;
    line-height: 1;
}

.category-label {
    font-size: 0.78rem;
    color: var(--tp-muted);
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.category-count {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--tp-primary);
    line-height: 1;
}

/* ── Rodapé / botão PDF ── */
.action-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 36px 0 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    text-align: center;
}

.last-update {
    margin: 0;
    color: var(--tp-muted);
    font-size: 0.82rem;
}

.last-update time {
    font-weight: 600;
    color: var(--tp-dark);
}

/* Botão PDF — destaque no centro do rodapé */
.btn-print {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: linear-gradient(135deg, #050046 0%, #00768b 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 18px rgba(5, 0, 70, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(5, 0, 70, 0.38);
    opacity: 0.95;
}

.btn-print:active {
    transform: translateY(0);
}

/* ── Responsividade ── */
@media (max-width: 768px) {
    .transp-hero {
        padding: 36px 20px 30px;
    }

    .transp-hero-title {
        font-size: 1.75rem;
    }

    .transp-hero-sub {
        font-size: 0.92rem;
    }

    .transparencia-container {
        margin-top: 24px;
        padding: 0 16px 40px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .stat-card {
        padding: 22px 20px;
    }

    .stat-card h2 {
        font-size: 36px;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .transp-hero-title {
        font-size: 1.45rem;
    }

    .btn-print {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
}

/* ── Impressão ── */
@media print {
    .main-header,
    .transp-hero,
    .btn-print {
        display: none;
    }

    .transparencia-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .stat-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
}