/* Estilos Gerais & Reset - Baseado no Guia Visual */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Hanken Grotesk', sans-serif;
}

body {
    background-color: #ECECE4; /* Cinza claro suave com base no guide */
    color: #1C2957; /* Azul Marinho Principal */
    min-height: 100vh;
    padding: 32px 24px;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Header */
.header {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 24px rgba(28, 41, 87, 0.04);
    border: 1px solid rgba(119, 119, 107, 0.1);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-icon-container {
    background: #1C2957;
    color: #F6F6EB;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-icon {
    width: 28px;
    height: 28px;
}

.logo-text h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1C2957;
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 13px;
    color: #77776B; /* Cinza Neutro */
    font-weight: 500;
}

.header-controls {
    display: flex;
    gap: 20px;
}

.control-card {
    background: #F6F6EB; /* Creme Secundário */
    border-radius: 14px;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(119, 119, 107, 0.1);
}

.control-card .label {
    font-size: 10px;
    font-weight: 700;
    color: #77776B;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.control-card .value {
    font-size: 18px;
    font-weight: 700;
    color: #1C2957;
}

.control-card select {
    background: transparent;
    border: none;
    color: #1C2957;
    font-size: 18px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.kpi-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    box-shadow: 0 4px 24px rgba(28, 41, 87, 0.04);
    border: 1px solid rgba(119, 119, 107, 0.1);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(28, 41, 87, 0.08);
}

.kpi-icon-container {
    background: #F6F6EB;
    color: #1C2957;
    width: 68px;
    height: 68px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(119, 119, 107, 0.08);
}

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: #77776B;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #1C2957;
}

#kpi-atingimento {
    color: #1C2957;
}

.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(119, 119, 107, 0.15);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1C2957, #77776B);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gráficos */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 1100px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(28, 41, 87, 0.04);
    border: 1px solid rgba(119, 119, 107, 0.1);
}

.chart-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1C2957;
    margin-bottom: 24px;
    letter-spacing: -0.3px;
}

.chart-wrapper {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Tabelas e Cards de Tabelas */
.tables-section, .details-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.table-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(28, 41, 87, 0.04);
    border: 1px solid rgba(119, 119, 107, 0.1);
}

.table-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1C2957;
    margin-bottom: 24px;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

th {
    background-color: #1C2957;
    color: #F6F6EB;
    font-weight: 600;
    padding: 14px 18px;
    border: 1px solid rgba(28, 41, 87, 0.1);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 18px;
    border: 1px solid rgba(119, 119, 107, 0.15);
    color: #1C2957;
    font-weight: 500;
}

tr:nth-child(even) td {
    background-color: #F9F9F6; /* Alternancia em tom muito claro */
}

tr:hover td {
    background-color: #F6F6EB; /* Realce em tom creme */
    color: #1C2957;
}

/* Totais e Formatações de Células */
tfoot tr td {
    font-weight: 700;
    background-color: #F6F6EB !important;
    border-top: 2px solid #1C2957;
    color: #1C2957;
    font-size: 15px;
}

.positive {
    color: #0d9488 !important; /* Verde azulado para YoY positivo */
    font-weight: 700;
}

.negative {
    color: #b91c1c !important; /* Vermelho escuro para YoY negativo */
    font-weight: 700;
}

.highlight {
    font-weight: 700;
    color: #1C2957;
}

/* Estilo específico para células de meses nas tabelas detalhadas */
#table-pecas td:not(:first-child), #table-areas td:not(:first-child) {
    text-align: center;
}

#table-pecas th:not(:first-child), #table-areas th:not(:first-child) {
    text-align: center;
}

/* Responsividade de Tabelas Detalhadas */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .header-controls {
        width: 100%;
        flex-direction: column;
    }
}

/* Estilos para Destaques do Mês Selecionado */
.selected-row td {
    background-color: rgba(28, 41, 87, 0.08) !important;
    font-weight: 700;
    border-top: 2px solid #1C2957 !important;
    border-bottom: 2px solid #1C2957 !important;
}

.selected-column {
    background-color: rgba(28, 41, 87, 0.08) !important;
    font-weight: 700 !important;
    border-left: 2px solid #1C2957 !important;
    border-right: 2px solid #1C2957 !important;
}

th.selected-column {
    border-top: 3px solid #1C2957 !important;
}

/* Layout dos Gráficos Unificados e Lado a Lado */
.charts-section-single {
    width: 100%;
}

.charts-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.charts-grid-two .chart-wrapper {
    height: 450px;
}

.chart-wrapper-large {
    height: 520px;
}

.chart-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-card h2 {
    margin-bottom: 0;
}

.filter-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-pill {
    background: #1C2957;
    color: #F6F6EB;
    border: 1px solid #1C2957;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-pill.inactive {
    background: #F6F6EB;
    color: #77776B;
    border: 1px solid rgba(119, 119, 107, 0.2);
}

.filter-pill:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

@media (max-width: 1100px) {
    .charts-grid-two {
        grid-template-columns: 1fr;
    }
}


