/* --- VARIAVEIS E RESET --- */
:root {
    --primary: #004a8f;
    --primary-dark: #003366;
    --secondary: #e67e22;
    --accent: #27ae60;
    --bg: #f0f2f5;
    --sidebar-bg: #1a252f;
    --text: #34495e;
    --border: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* --- UTILITÁRIOS DE ÍCONES (SVG) --- */
.icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    vertical-align: middle;
    margin-right: 8px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

.icon-xl {
    width: 48px;
    height: 48px;
    margin-right: 15px;
    fill: var(--primary);
}

/* --- LAYOUT PRINCIPAL --- */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- ESTRUTURA PRINCIPAL DA SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease;
    position: relative;
}

/* --- CABEÇALHO DA SIDEBAR (EXPANDIDO) --- */
.sidebar-header {
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px; /* Altura flexível para caber a logo e os textos empilhados */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    transition: min-height 0.3s ease, padding 0.3s ease;
}

.brand-group {
    display: flex;
    flex-direction: column; /* Empilha logo e texto na vertical */
    align-items: center;    /* Centraliza os itens */
    text-decoration: none;
    color: white;
    width: 100%;
}

.logo-sidebar {
    width: 80px; /* Aumentado de 65px para maior destaque */
    height: 80px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
    margin-right: 0;
    margin-bottom: 12px;
    flex-shrink: 0;
    padding: 2px;
    transition: all 0.3s ease;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centraliza o texto */
    text-align: center;
    width: 100%;
}

.header-text h2 {
    font-size: 1.1rem; /* Fonte maior para o título principal */
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    white-space: normal; /* Permite quebrar linha naturalmente e impede o corte */
}

.header-text span {
    font-size: 0.65rem; /* Fonte legível para o subtítulo */
    opacity: 0.85;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 5px;
    white-space: normal; 
}

/* Botão Flutuante (Seta de Recolhimento) */
.toggle-sidebar-btn {
    position: absolute;
    top: 60px; /* Ajustado para ficar centralizado com a nova altura da base */
    right: -15px; 
    width: 30px;
    height: 30px;
    background: var(--secondary);
    border: none;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.toggle-sidebar-btn:hover {
    background: #d68910;
}

/* --- ESTILIZAÇÃO DOS LINKS DO MENU --- */
.nav-links {
    list-style: none;
    padding: 1rem;
    margin: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    height: 48px; 
    /* Ancoragem matemática: 31px esquerda + 18px ícone + 31px direita = 80px */
    padding: 0 1rem 0 31px; 
    color: #bdc3c7;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
    box-sizing: border-box;
    white-space: nowrap; /* Impede quebra de texto na animação */
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-links a.active {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.nav-links a .icon {
    margin-right: 16px;
    flex-shrink: 0; /* Impede que o ícone seja esmagado */
}

/* --- ESTADO RECOLHIDO (COLLAPSED) --- */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-header {
    min-height: 80px; /* Encolhe a altura do topo */
    padding: 1rem;
}

.sidebar.collapsed .logo-sidebar {
    width: 52px; /* Ampliado para ocupar melhor os 80px disponíveis */
    height: 52px;
    margin-bottom: 0; 
}

/* Oculta completamente os textos e volta o botão pro meio */
.sidebar.collapsed .header-text,
.sidebar.collapsed .nav-links a span {
    display: none; 
}

.sidebar.collapsed .nav-links a {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .toggle-sidebar-btn {
    top: 25px; /* Sobe a seta de volta pro eixo correto */
    transform: rotate(180deg);
}

/* --- CONTEÚDO PRINCIPAL --- */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumbs {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.breadcrumbs strong {
    color: var(--primary);
}

.content-area {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Abas */
.tab-pane {
    display: none;
    animation: slideUp 0.4s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard */

/* Banner de Notícia (Retângulo Superior) */
.news-board {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 74, 143, 0.2);
}

.news-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.news-content h2 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.news-content p {
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.btn-news {
    background: white;
    color: var(--primary);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-news:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Painel Resumo 2025 (Retângulo Inferior) */
.summary-panel {
    background: white;
    border-radius: 12px;
    padding: 0;
    /* Padding interno controlado pelos filhos */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.summary-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.summary-header h3 {
    font-size: 1.2rem;
    color: var(--text);
    display: flex;
    align-items: center;
}

.summary-stats-grid {
    display: flex;
    padding: 2rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-box {
    flex: 1;
    min-width: 200px;
    padding-right: 2rem;
    border-right: 1px solid var(--border);
}

.stat-box:last-child {
    border-right: none;
}

.stat-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.stat-value.green {
    color: var(--accent);
}

.stat-desc {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

/* --- OUTROS ELEMENTOS --- */
h1 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

p.subtitle {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Tabela */
.year-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.year-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid #ddd;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.2s;
}

.year-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.year-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.table-wrapper {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.transparency-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* Força a estrutura rígida da tabela */
}

td {
    /*OLD: td { padding: 1rem; border-bottom: 1px solid #ecf0f1; font-size: 0.95rem; }*/
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.95rem;
    word-wrap: break-word;
    /* Força a quebra de linha se o texto for maior que a coluna */
    overflow-wrap: break-word;
}

th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 1rem;
    text-align: left;
}

tr:last-child td {
    border-bottom: none;
}

.money {
    color: var(--accent);
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* Downloads */
.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s;
}

.download-item:hover {
    transform: translateX(5px);
    border-color: var(--primary);
}

.btn-action {
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

/* Auth Steps */
.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 30px;
    height: 30px;
    background: #ddd;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.step.active .step-circle {
    background: var(--secondary);
}

.steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

.auth-box {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auth-box input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-full {
    width: 100%;
    background: var(--primary);
    border: none;
    padding: 0.8rem;
    color: #fff;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

/* --- ELEMENTOS DE TABELA (BADGES E BOTÕES) --- */
.badge-status {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap !important; /* Proíbe a quebra de linha rigorosamente */
    text-align: center;
}

.badge-aprovado { background: #e8f5e9; color: #27ae60; }
.badge-reprovado { background: #fdeaea; color: #e74c3c; }
.badge-analise { background: #fef5e7; color: #f39c12; }

.btn-table {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    color: white !important;
    display: inline-block;
    white-space: nowrap !important; /* Proíbe a quebra de linha rigorosamente */
    text-align: center;
    transition: opacity 0.2s ease;
}

.btn-table:hover { opacity: 0.85; }

.btn-avaliar { background: #f39c12; }
.btn-recusa { background: #e74c3c; }
.btn-veredito { background: #27ae60; }