/* ==============================
   DASHBOARDS PAGE - HERO SECTION
   ============================== */

/* Hero Section - Visão Geral do IPEA */
.ipea-hero {
    background: #7A34F3;
    padding: 2rem 0;
    min-height: 15vh;
    margin-top: 60px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}


.ipea-hero-title {
    font-family: 'Inter', sans-serif;
    font-size: 3.75rem;
    font-weight: 300;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    text-align: left;
}

/* Tooltip externo do Chart.js para rosca */
.chartjs-external-tooltip {
    z-index: 9999;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ipea-hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 992px) {
    .ipea-hero {
        padding: 1.5rem 0;
        min-height: 12vh;
    }
    
    .ipea-hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .ipea-hero {
        padding: 1rem 0;
        min-height: 10vh;
    }
    
    .ipea-hero-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .ipea-hero-content {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .ipea-hero {
        padding: 1rem 0;
        min-height: 8vh;
    }
    
    .ipea-hero-title {
        font-size: 1.8rem;
    }
}

/* ==============================
   BUDGET SECTION - ORÇAMENTO
   ============================== */

.budget-section {
    background: #ffffff;
    padding: 4rem 0;
    min-height: 60vh;
}

.budget-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 2.25rem;
    font-weight: 600;
    color: #202020;
    margin-bottom: 1rem;
    text-align: left;
}

.budget-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 88px;
    width: 100%;
}

.budget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #7A34F3;
}

.budget-card-header {
    margin-bottom: 0.5rem;
}

/* Budget Card Sizes - Proporções adequadas para 8 colunas */
.budget-card-small {
    min-width: 140px;
}

.budget-card-medium {
    min-width: 180px;
}

.budget-card-large {
    min-width: 220px;
}

.budget-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #7A34F3;
    margin: 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.budget-card-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
}

.budget-value {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #202020;
    margin: 0;
    line-height: 1;
}

/* Responsive Design */
@media (max-width: 992px) {
    .budget-section {
        padding: 3rem 0;
    }
    
    .budget-section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .budget-value {
        font-size: 1.8rem;
    }
}

/* Media query para tablets (768px a 992px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .budget-card {
        padding: 1rem 0.8rem;
        min-height: 110px;
    }
    
    .budget-card-title {
        font-size: 0.75rem;
        line-height: 1.2;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .budget-value {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .budget-section {
        padding: 2rem 0;
    }
    
    .budget-section-title {
        font-size: 1.8rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .budget-card {
        padding: 1rem 1.2rem;
        margin-bottom: 0;
        min-height: 100px;
        width: 100%;
    }
    
    .budget-card-small,
    .budget-card-medium,
    .budget-card-large {
        min-width: auto;
        width: 100%;
    }
    
    .budget-value {
        font-size: 1.6rem;
    }
    
    /* Melhorias gerais para mobile */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .row {
        margin-left: -15px;
        margin-right: -15px;
    }
}

@media (max-width: 576px) {
    .budget-section {
        padding: 1.5rem 0;
    }
    
    .budget-section-title {
        font-size: 1.5rem;
    }
    
    .budget-card {
        padding: 0.8rem 1rem;
        min-height: 90px;
        width: 100%;
    }
    
    .budget-card-small,
    .budget-card-medium,
    .budget-card-large {
        min-width: auto;
        width: 100%;
    }
    
    .budget-value {
        font-size: 1.4rem;
    }
}

/* ==============================
   CHART SECTION - GRÁFICO DE ROSCA
   ============================== */
   .chart-section-title {
       font-family: 'Inter', sans-serif;
       font-size: 1.5rem;
       font-weight: 600;
       color: #202020;
       margin: 2rem 0 1rem 0;
       text-align: left;
   }

.chart-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    min-height: 400px;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #7A34F3;
}


.chart-title {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #7A34F3;
    line-height: 1;
    margin-bottom: 1rem;
}

.chart-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 350px;
    position: relative;
}

.chart-wrapper {
    position: relative;
    display: inline-block;
}

.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

.chart-total-number {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: #202020;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.chart-total-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #202020;
    line-height: 1;
}

.chart-legend {
    padding: 1rem;
    height: auto;
    overflow-y: visible;
    margin-left: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.2rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.legend-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    line-height: 1.4;
}

/* Tooltip customizado para legenda (aparece imediatamente ao hover) */
.legend-text.has-tooltip {
    position: relative;
}
.legend-text.has-tooltip::after {
    content: attr(data-full);
    position: absolute;
    left: 0;
    top: 100%;
    transform: translateY(6px);
    white-space: normal;
    max-width: 420px;
    background: #111827; /* cinza bem escuro */
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.3;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.08s ease-in;
    z-index: 20;
}
.legend-text.has-tooltip:hover::after {
    opacity: 1;
}

.legend-number {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: #202020;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 992px) {
    .chart-card {
        padding: 2rem;
        min-height: 350px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .chart-legend {
        height: 300px;
    }
    
    .chart-total-number {
        font-size: 2rem;
    }
    
    .chart-total-label {
        font-size: 0.9rem;
    }
}

/* Media query para telas médias (768px para cima) - manter gráfico grande */
@media (min-width: 768px) {    
    .chart-wrapper {
        width: 280px !important;
        height: 280px !important;
    }
    
    .chart-wrapper canvas {
        width: 280px !important;
        height: 280px !important;
    }
    
    .chart-total-number {
        font-size: 2.2rem;
    }
    
    .chart-total-label {
        font-size: 0.9rem;
    }
}

/* Media query para evitar overlap em telas médias */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .chart-card .row {
        align-items: flex-start;
    }
    
    .chart-container {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .chart-legend {
        padding-left: 1rem;
    }
}

@media (max-width: 768px) {
    .chart-card {
        padding: 1rem;
        min-height: 300px;
    }
    
    .chart-container {
        height: 150px;
        margin-bottom: 1rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .chart-wrapper {
        width: 150px !important;
        height: 150px !important;
    }
    
    .chart-wrapper canvas {
        width: 150px !important;
        height: 150px !important;
    }
    
    .chart-legend {
        height: auto;
        margin-left: 0;
        padding: 0;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .chart-total-number {
        font-size: 1.2rem;
    }
    
    .chart-total-label {
        font-size: 0.65rem;
    }
    
    .legend-text {
        font-size: 0.7rem;
        line-height: 1.2;
        word-wrap: break-word;
    }
    
    .legend-number {
        font-size: 0.7rem;
        font-weight: 600;
    }
    
    .legend-item {
        margin-bottom: 0.4rem;
        padding: 0.2rem 0;
    }
    
    .legend-color {
        width: 8px;
        height: 8px;
        margin-right: 0.5rem;
    }
}

@media (max-width: 576px) {
    .chart-card {
        padding: 0.8rem;
        min-height: 250px;
    }
    
    .chart-container {
        height: 120px;
        margin-bottom: 0.8rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .chart-wrapper {
        width: 120px !important;
        height: 120px !important;
    }
    
    .chart-wrapper canvas {
        width: 120px !important;
        height: 120px !important;
    }
    
    .chart-legend {
        max-height: 250px;
        overflow-y: auto;
        padding: 0;
    }
    
    .chart-total-number {
        font-size: 1rem;
    }
    
    .chart-total-label {
        font-size: 0.6rem;
    }
    
    .legend-item {
        margin-bottom: 0.3rem;
        padding: 0.1rem 0;
    }
    
    .legend-text {
        font-size: 0.65rem;
        line-height: 1.1;
    }
    
    .legend-number {
        font-size: 0.65rem;
        font-weight: 600;
    }
    
    .legend-color {
        width: 6px;
        height: 6px;
        margin-right: 0.4rem;
    }
}

/* ==============================
   CONTRACTS SECTION - CONTRATOS
   ============================== */

.contracts-section {
    background: #ffffff;
    padding: 5rem 0; /* mais espaço no topo e base */
}

.contracts-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 2.25rem;
    font-weight: 600;
    color: #202020;
    margin-bottom: 1rem;
}

@media (max-width: 992px) {
    .contracts-section {
        padding: 3.5rem 0;
    }
}

@media (max-width: 768px) {
    .contracts-section {
        padding: 3rem 0;
    }
}

/* Escopo específico para o card/elementos da seção de contratos */
.contracts-section .chart-card {
    min-height: 340px;
}

.contracts-section .chart-container {
    height: 260px;
}

.contracts-section .chart-legend {
    height: auto;
    overflow: visible;
    padding: 0;
    margin-left: 0;
}

/* ==============================
   TEDS SECTION
   ============================== */

.teds-section {
    background: #ffffff;
    padding: 4rem 0;
}

.teds-title {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: #202020;
    margin-bottom: 1rem;
}

.teds-kpis .budget-card {
    height: auto;
}

.teds-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #202020;
    margin: 1rem 0;
}

.teds-table-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    margin-bottom: 0 !important;
}

.teds-table {
    width: 100%;
    margin: 0;
    table-layout: fixed;
}

.teds-table thead th {
    background: #7A34F3;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border: none;
}

.teds-table thead th:not(:first-child) {
    padding-left: 1.5rem;
}

.teds-table thead th:nth-child(1) {
    width: 40%;
}

.teds-table thead th:nth-child(2) {
    width: 22%;
}

.teds-table thead th:nth-child(3) {
    width: 18%;
}

.teds-table thead th:nth-child(4) {
    width: 20%;
}

.teds-table tbody td {
    color: #202020;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    padding: 0.9rem 1rem;
    vertical-align: middle;
}

.teds-table tbody td:not(:first-child) {
    padding-left: 1.5rem;
}

.teds-table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

.teds-table tbody tr:nth-child(even) td {
    background: #F7F7F7;
}

.teds-table tbody tr + tr td {
    border-top: 1px solid #eef2f7;
}

.teds-program {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
    max-width: 100%;
    word-wrap: break-word;
}

.teds-program-code {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #202020;
    line-height: 1.2;
}

.teds-program-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #202020;
    line-height: 1.3;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.teds-progress {
    width: 100%;
    height: 8px;
    background: #EEE9FF;
    border-radius: 9999px;
    overflow: visible;
    position: relative;
}

.teds-progress-bar {
    height: 100%;
    background: #7A34F3;
    border-radius: 9999px;
    position: relative;
    overflow: visible;
}

.teds-progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #F19F42;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.teds-progress-handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.teds-legend {
    margin-bottom: 1rem;
}

.teds-table-wrapper { 
    margin-top: 0.25rem; 
}

@media (max-width: 768px) {
    .teds-title { text-align: center; }
    .teds-subheader { row-gap: 0.5rem; }
    .bar-chart-legend { justify-content: center; }
    
    .teds-table {
        table-layout: auto;
    }
    
    .teds-table thead th:nth-child(1) {
        width: 45%;
    }
    
    .teds-table thead th:nth-child(2) {
        width: 25%;
    }
    
    .teds-table thead th:nth-child(3) {
        width: 15%;
    }
    
    .teds-table thead th:nth-child(4) {
        width: 15%;
    }
    
    .teds-table thead th {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    .teds-table tbody td {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    .teds-program-code {
        font-size: 12px;
    }
    
    .teds-program-text {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .teds-section {
        padding: 2rem 0;
    }
    
    .teds-title {
        font-size: 1.3rem;
    }
    
    .teds-table-wrapper {
        margin-top: 0.5rem;
        overflow-x: auto;
    }
    
    .teds-table {
        min-width: 600px;
    }
    
    .teds-table thead th:nth-child(1) {
        width: 55%;
    }
    
    .teds-table thead th:nth-child(2) {
        width: 20%;
    }
    
    .teds-table thead th:nth-child(3) {
        width: 15%;
    }
    
    .teds-table thead th:nth-child(4) {
        width: 10%;
    }
    
    .teds-program-text {
        font-size: 11px;
        line-height: 1.2;
    }
}

/* ==============================
   TEDS SENT SECTION
   ============================== */

.teds-sent-section {
    background: #F7F7F7;
    padding: 4rem 0;
}

.teds-sent-title {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: #202020;
    margin-bottom: 1rem;
}

.teds-sent-kpis .budget-card {
    height: auto;
}

.teds-sent-table-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
}

.teds-sent-table {
    width: 100%;
    margin: 0;
    table-layout: fixed;
}

.teds-sent-table thead th {
    background: #7A34F3;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.teds-sent-table thead th:not(:first-child) {
    padding-left: 1.5rem;
}

.teds-sent-table thead th:nth-child(1) {
    width: 40%;
}

.teds-sent-table thead th:nth-child(2) {
    width: 22%;
}

.teds-sent-table thead th:nth-child(3) {
    width: 18%;
}

.teds-sent-table thead th:nth-child(4) {
    width: 20%;
}

.teds-sent-table thead th i {
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

.teds-sent-table tbody td {
    color: #202020;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    padding: 0.9rem 1rem;
    vertical-align: middle;
}

.teds-sent-table tbody td:not(:first-child) {
    padding-left: 1.5rem;
}

.teds-sent-table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

.teds-sent-table tbody tr:nth-child(even) td {
    background: #F7F7F7;
}

.teds-sent-table tbody tr + tr td {
    border-top: 1px solid #eef2f7;
}

.teds-sent-program {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
    max-width: 100%;
    word-wrap: break-word;
}

.teds-sent-program-code {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #202020;
    line-height: 1.2;
}

.teds-sent-program-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #202020;
    line-height: 1.3;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.teds-sent-progress {
    width: 100%;
    height: 8px;
    background: #EEE9FF;
    border-radius: 9999px;
    overflow: visible;
    position: relative;
}

.teds-sent-progress-bar {
    height: 100%;
    background: #7A34F3;
    border-radius: 9999px;
    position: relative;
    overflow: visible;
    transition: width 0.3s ease;
}

/* Responsive Design para TEDs Sent */
@media (max-width: 768px) {
    .teds-sent-title { 
        text-align: center; 
        font-size: 1.5rem;
    }
    
    .teds-sent-kpis .budget-card {
        margin-bottom: 1rem;
    }
    
    .teds-sent-table {
        table-layout: auto;
    }
    
    .teds-sent-table thead th:nth-child(1) {
        width: 45%;
    }
    
    .teds-sent-table thead th:nth-child(2) {
        width: 25%;
    }
    
    .teds-sent-table thead th:nth-child(3) {
        width: 15%;
    }
    
    .teds-sent-table thead th:nth-child(4) {
        width: 15%;
    }
    
    .teds-sent-table thead th {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    .teds-sent-table tbody td {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    .teds-sent-program-code {
        font-size: 12px;
    }
    
    .teds-sent-program-text {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .teds-sent-section {
        padding: 2rem 0;
    }
    
    .teds-sent-title {
        font-size: 1.3rem;
    }
    
    .teds-sent-table-wrapper {
        margin-top: 0.5rem;
        overflow-x: auto;
    }
    
    .teds-sent-table {
        min-width: 600px;
    }
    
    .teds-sent-table thead th:nth-child(1) {
        width: 55%;
    }
    
    .teds-sent-table thead th:nth-child(2) {
        width: 20%;
    }
    
    .teds-sent-table thead th:nth-child(3) {
        width: 15%;
    }
    
    .teds-sent-table thead th:nth-child(4) {
        width: 10%;
    }
    
    .teds-sent-program-text {
        font-size: 11px;
        line-height: 1.2;
    }
}

/* ==============================
   EXPENSES SECTION - GASTOS
   ============================== */
    
    .expenses-section {
        background: #F7F7F7;
        padding: 4rem 0;
        min-height: 60vh;
    }
    
    .expenses-section-title {
        font-family: 'Inter', sans-serif;
        font-size: 2.25rem;
        font-weight: 600; 
        color: #202020;
        margin-bottom: 1rem;
        text-align: left;
    }
    
    /* Responsive Design */
    @media (max-width: 992px) {
        .expenses-section {
            padding: 3rem 0;
        }
        
        .expenses-section-title {
            font-size: 2rem;
            margin-bottom: 2rem;
        }
    }
    
    @media (max-width: 768px) {
        .expenses-section {
            padding: 2rem 0;
        }
        
        .expenses-section-title {
            font-size: 1.8rem;
            text-align: center;
            margin-bottom: 1.5rem;
        }
    }
    
    @media (max-width: 576px) {
        .expenses-section {
            padding: 1.5rem 0;
        }
        
     .expenses-section-title {
         font-size: 1.5rem;
     }
 }

/* ==============================
   EXPENSES SUBSECTION - DASHBOARDS
   ============================== */

.expenses-subsection-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #202020;
    margin: 2rem 0 0.5rem 0;
    text-align: left;
}

.expenses-subsection-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #202020;
    margin-bottom: 1.5rem;
    text-align: left;
}

.expenses-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.expenses-legend .legend-item {
    display: flex;
    align-items: center;
}

.expenses-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.expenses-legend .legend-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #202020;
    line-height: 1.4;
}

.dashboard-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    height: 100%;
    margin-bottom: 1.5rem;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.dashboard-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #7A34F3;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    text-align: left;
}

.dashboard-chart-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    margin: 0 auto;
}

.dashboard-chart-container canvas {
    max-width: 200px;
    max-height: 200px;
}

/* Espaçamento entre linhas de dashboard cards */
.row.g-4.mb-4 {
    margin-bottom: 2rem !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .expenses-legend {
        gap: 1rem;
        justify-content: center;
    }
    
    .expenses-subsection-title {
        text-align: center;
        font-size: 1.3rem;
    }
    
    .expenses-subsection-subtitle {
        text-align: center;
        font-size: 0.9rem;
    }
    
    .dashboard-card {
        margin-bottom: 1rem;
    }
    
    .row.g-4.mb-4 {
        margin-bottom: 1.5rem !important;
    }
}

/* ==============================
   BUDGET ALLOCATION SECTION
   ============================== */

.budget-allocation-section {
    background: #F7F7F7;
    padding: 4rem 0;
    min-height: 500px;
}

.budget-allocation-title {
    font-family: 'Inter', sans-serif;
    font-size: 2.25rem;
    font-weight: 600;
    color: #202020;
    margin-bottom: 2.5rem;
    text-align: left;
}

/* ==============================
   ALLOCATION CARDS
   ============================== */

.allocation-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.allocation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.allocation-card-purple .allocation-card-label {
    color: #7A34F3;
}

.allocation-card-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.allocation-card-value {
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #202020;
    margin: 0;
    line-height: 1.2;
}

/* ==============================
   BAR CHART CARD
   ============================== */

.bar-chart-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-height: 500px;
}

.bar-chart-title {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #7A34F3;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.bar-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #E5E5E5;
}

.bar-chart-legend .legend-item {
    display: flex;
    align-items: center;
}

.legend-row-break {
    flex-basis: 100%;
    height: 0;
    margin: 0;
}

.bar-chart-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bar-chart-legend .legend-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #202020;
    line-height: 1.4;
}

/* ==============================
   CONTRACTS BARS LIST (Custom Progress Bars)
   ============================== */

.contracts-bars-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contracts-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contracts-bar-header {
    display: flex;
    align-items: baseline;
}

.contracts-bar-value {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: #7A34F3;
    min-width: 60px;
}

.contracts-bar-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #374151;
    line-height: 1.4;
}

.contracts-bar-track {
    width: 100%;
    height: 12px;
    background-color: #E5E5E5;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.contracts-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* ==============================
   RESPONSIVE - BUDGET ALLOCATION
   ============================== */

@media (max-width: 992px) {
    .allocation-card {
        margin-bottom: 1rem;
    }
    
    .bar-chart-card {
        margin-top: 1rem;
    }
    
    .bar-chart-legend {
        gap: 1rem;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .budget-allocation-title {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .bar-chart-title {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .allocation-card-value {
        font-size: 1.5rem;
    }
    
    .contracts-bar-header {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .contracts-bar-value {
        font-size: 0.75rem;
    }
    
    .contracts-bar-label {
        font-size: 0.75rem;
    }
    
    .contracts-bars-list {
        gap: 1rem;
    }
}

/* ==============================
   EMPLOYEES SECTION
   ============================== */

.employees-section {
    padding: 3rem 0;
    background: #ffffff;
}

.employees-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: #202020;
    margin-bottom: 2rem;
    text-align: left;
}

.employee-cards-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.employee-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: auto;
    width: fit-content;
    min-width: 200px;
}

.employee-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.employee-card-header {
    margin-bottom: 0.75rem;
}

.employee-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #7A34F3;
    margin: 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
}

.employee-card-content {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
}

.employee-value {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    text-align: left;
}

/* Responsive Design for Employees Section */
@media (max-width: 768px) {
    .employees-section-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .employee-value {
        font-size: 2rem;
    }
    
    .employee-cards-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .employee-card {
        width: 100%;
        max-width: 300px;
    }
}

/* ==============================
   DISTRIBUTION CHARTS
   ============================== */

.distribution-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #202020;
    margin-bottom: 2rem;
    text-align: left;
}

.distribution-chart-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.distribution-chart-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #7A34F3;
    margin-bottom: 1.5rem;
    text-align: left;
}

.gender-chart-container {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.race-chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    min-height: 300px;
    overflow: hidden; /* Previne overflow do gráfico */
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Estilos gerais da legenda com scroll horizontal */
.race-chart-legend {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-top: 10px;
    font-family: Inter, sans-serif;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    box-sizing: border-box;
    padding-bottom: 8px;
    /* Estilizar a barra de rolagem */
    scrollbar-width: thin;
    scrollbar-color: #7A34F3 #f1f1f1;
}

.race-chart-legend::-webkit-scrollbar {
    height: 6px;
}

.race-chart-legend::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.race-chart-legend::-webkit-scrollbar-thumb {
    background: #7A34F3;
    border-radius: 3px;
}

.race-chart-legend::-webkit-scrollbar-thumb:hover {
    background: #6B2AE8;
}

.race-chart-legend > div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1f2937;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: fit-content;
    box-sizing: border-box;
}

/* Desktop - Garantir que a legenda seja sempre visível */
@media (min-width: 769px) {
    .distribution-chart-card .race-chart-legend {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .race-chart-container {
        height: 400px;
        overflow: visible;
    }
    
    .race-chart-container #raceChart {
        height: 400px !important;
    }
}

/* Responsive Design for Distribution Charts */
@media (max-width: 768px) {
    .distribution-section-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .distribution-chart-title {
        font-size: 1.125rem;
    }
    
    .gender-chart-container,
    .race-chart-container {
        height: 300px;
    }
    
    /* Ajustes específicos para o gráfico de raça/cor no mobile */
    .race-chart-container {
        overflow: hidden;
        padding: 0;
        margin: 0;
    }
    
    .race-chart-container #raceChart {
        width: 100% !important;
        height: 100% !important;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Ajustes da legenda no mobile */
    .distribution-chart-card .race-chart-legend {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow-x: auto !important;
        gap: 15px !important;
        margin-top: 8px !important;
    }
    
    .distribution-chart-card .race-chart-legend > div {
        flex-shrink: 0 !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }
}

/* Ajustes para telas muito pequenas (576px) */
@media (max-width: 576px) {
    .race-chart-container {
        height: 250px;
        overflow: hidden;
    }
    
    .race-chart-container #raceChart {
        width: 100% !important;
        height: 100% !important;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Ajustar padding do card no mobile muito pequeno */
    .distribution-chart-card {
        padding: 1rem;
    }
    
    /* Ajustes da legenda para telas muito pequenas */
    .distribution-chart-card .race-chart-legend {
        gap: 10px !important;
        margin-top: 6px !important;
        overflow-x: auto !important;
    }
    
    .distribution-chart-card .race-chart-legend > div {
        flex-shrink: 0 !important;
        font-size: 11px !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }
    
    .distribution-chart-card .race-chart-legend > div > div:first-child {
        width: 8px !important;
        height: 8px !important;
    }
}

/* ==============================
   APOSENTADORIAS SECTION
   ============================== */

.aposentadorias-section {
    background: #ffffff;
}

.aposentadorias-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: #202020;
    margin-bottom: 2rem;
    text-align: left;
}

/* Estilos específicos para aposentadorias */
.aposentadorias-chart-selector {
    margin-bottom: 0.75rem;
}

.aposentadorias-chart-selector .form-select {
    border: none;
    border-radius: 0;
    color: #9249CA;
    font-weight: 700;
    background-color: transparent;
    padding: 0;
    font-size: 1rem;
    text-transform: uppercase;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238b5cf6' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0 center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 1.5rem;
    cursor: pointer;
    width: auto;
    display: inline-block;
}

.aposentadorias-chart-selector .form-select:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

.aposentadorias-chart-container {
    position: relative;
    width: 100%;
    height: 350px;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

 .aposentadorias-chart-container canvas {
     width: 100% !important;
     height: 100% !important;
     display: block;
 }

 /* Tooltip customizado para o gráfico de aposentadorias */
 .aposentadorias-chart-container .chartjs-tooltip {
     background: #66308F !important;
     border: none !important;
     border-radius: 8px !important;
     padding: 8px 12px !important;
     font-family: 'Inter', sans-serif !important;
     font-size: 14px !important;
     font-weight: bold !important;
     color: #ffffff !important;
     box-shadow: 0 4px 12px rgba(102, 48, 143, 0.3) !important;
 }

 .aposentadorias-chart-container .chartjs-tooltip::before {
     content: '';
     position: absolute;
     bottom: -8px;
     left: 50%;
     transform: translateX(-50%);
     width: 0;
     height: 0;
     border-left: 8px solid transparent;
     border-right: 8px solid transparent;
     border-top: 8px solid #66308F;
 }

.aposentadorias-chart-legend {
    margin: 0;
    padding: 0;
}

/* Card do gráfico de aposentadorias */
.aposentadorias-graph-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.aposentadorias-graph-card .chart-title {
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Responsive Design for Aposentadorias Section */
@media (max-width: 768px) {
    .aposentadorias-section {
        padding: 2rem 0;
    }
    
    .aposentadorias-section-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .line-chart-container {
        height: 250px;
    }
}

/* ==============================
   BAR CHART STYLES
   ============================== */

.bar-chart {
    height: auto;
    width: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bars-container {
    height: auto;
    width: 100%;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    min-height: 30px;
    margin-bottom: 1rem;
}

.bar-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    min-width: 100px;
    width: 100px;
    flex-shrink: 0;
}

.bar-container {
    flex: 1;
    position: relative;
    height: 24px;
    background: #F3F4F6;
    border-radius: 4px;
    overflow: hidden;
    min-width: 100px;
    display: flex;
    align-items: center;
}

.bar-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #E5E7EB;
    z-index: 1;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    display: block;
    opacity: 1;
}

.bar-fill.feminino {
    background: #8B5CF6;
}

.bar-fill.masculino {
    background: #22D3EE;
}

.bar-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: #000000;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 2;
}

.legend-masculino {
    background-color: #22D3EE;
}

.legend-feminino {
    background-color: #8B5CF6;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 8px;
}

.legend-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
}

.distribution-chart-card .chart-legend {
    height: auto;
    padding: 0;
    margin-left: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}