/* ========================= */
/* RESET GLOBAL */
/* ========================= */

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;           /* quem vai rolar é só .main-content */
    background-color: #0b2b57;  /* mesma cor da barra, esconde qualquer 1px de gap */
}

/* conteúdo principal do Dash */
#_dash-app-content {
    height: 100%;
    overflow: hidden;
}

/* ========================= */
/* VARIÁVEIS GERAIS */
/* ========================= */

:root {
    --sidebar-width: 280px; /* largura da barra azul */
}

/* ========================= */
/* LAYOUT PRINCIPAL */
/* ========================= */

.app-root {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh; /* menu + conteúdo ocupam a viewport inteira */
    overflow: hidden; /* impede rolagem no container geral */
}

/* ========================= */
/* SIDEBAR */
/* ========================= */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;        /* ocupa sempre toda a altura da tela */
    padding: 24px 20px;
    background-color: #0b2b57;
    color: white;
    overflow: hidden;     /* sem rolagem no menu */
    box-sizing: border-box;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.sidebar-logo {
    width: 100%;
    max-width: 250px;
    height: auto;
    margin-bottom: 12px;
}

.sidebar-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 5px 0;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-button {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
}

.sidebar-button:hover {
    background: #ffffff;
    color: #0b2b57;
    border-color: #ffffff;
    transform: translateY(-1px);
}

.sidebar-button-active {
    background: #ffffff;
    color: #0b2b57 !important;
    border-color: #ffffff;
    font-weight: 600;
}

/* ========================= */
/* CONTEÚDO PRINCIPAL */
/* ========================= */

.main-content {
    flex: 1;
    height: 100%;
    padding: 0;                /* nenhum espaço entre barra azul e imagem */
    background-color: #ffffff;
    overflow-y: auto;          /* rolagem só aqui (segunda coluna) */
    overflow-x: hidden;        /* evita rolagem horizontal */
    box-sizing: border-box;
}

/* Wrapper interno do Dash Pages */
.page-wrapper {
    min-height: 100%;
}

/* ========================= */
/* BARRA DE FILTROS STICKY */
/* ========================= */

.filtros-sticky {
    position: sticky; /* fixa dentro da área branca */
    top: 0;
    z-index: 10;
    background-color: #ffffff;
    padding: 4px 0 8px 0; /* sem padding lateral, ocupa toda largura da main-content */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================= */
/* HOME */
/* ========================= */

/* HOME – imagem ocupando somente a área ao lado da sidebar */
.home-container {
    background-image: url("/assets/fundo dcf.png");
    background-repeat: no-repeat;
    background-position: left top;   /* começa colada na sidebar */
    background-size: cover;          /* cobre toda a área disponível */

    width: calc(100vw - var(--sidebar-width));  /* largura total menos a barra azul */
    height: 100vh;                               /* altura da viewport */

    margin: 0;
    padding: 0;

    position: relative;
    overflow: hidden;
}

/* sobreposição azul leve */
.home-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 43, 87, 0.027);
}

/* ========================= */
/* COMPONENTES PADRÃO */
/* ========================= */

.cards-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.card {
    background-color: white;
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    flex: 1;
}

.card-title {
    font-size: 14px;
    color: #555;
    text-align: center;
}

.card-value {
    font-size: 22px;
    font-weight: bold;
    color: #b30000;
    text-align: center;
}

.charts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

/* ========================= */
/* LIMPEZA FINAL DE OVERFLOW */
/* ========================= */

.dash-table-container {
    overflow: visible !important;
}

.js-plotly-plot {
    overflow: visible !important;
}

/* ========================= */
/* MOBILE */
/* ========================= */

@media (max-width: 768px) {

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 0 0 10px 0;
        /* continua com overflow-y: auto; herdado */
    }

    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sidebar-button {
        font-size: 13px;
        padding: 10px;
    }

    .cards-container {
        flex-direction: column;
    }

    .charts-row {
        flex-direction: column;
    }

    .charts-row > div {
        width: 100% !important;
    }

    .filtros-sticky {
        position: static;
        box-shadow: none;
        padding: 6px 0 8px 0;
    }

    .card-value {
        font-size: 18px;
    }

    .card-title {
        font-size: 13px;
    }
}

