*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, sans-serif;
}

body{
    min-height:100vh;
    background:#f4f7ff;
    color:#111827;
}

.btn-perfil-est{
    position:fixed;
    top:20px;
    right:22px;
    z-index:1000;
}

.btn-perfil-est img{
    width:54px;
    height:54px;
    border-radius:50%;
    object-fit:cover;
    cursor:pointer;
    border:3px solid #fff;
    box-shadow:0 8px 22px rgba(0,0,0,.15);
}

.estatisticas-page{
    margin-left:100px;
    padding:42px 55px 70px;
}

.estatisticas-hero{
    background:white;
    border-radius:28px;
    padding:38px;
    box-shadow:0 10px 28px rgba(0,0,0,.07);
    margin-bottom:26px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:22px;
}

.badge-est{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:#edf2ff;
    color:#5277e8;
    padding:9px 16px;
    border-radius:999px;
    font-weight:800;
    margin-bottom:16px;
}

.estatisticas-hero h1{
    font-size:44px;
    margin-bottom:10px;
}

.estatisticas-hero p{
    color:#4b5563;
    font-size:18px;
    line-height:1.55;
    max-width:760px;
}

#btnAtualizarEstatisticas{
    border:none;
    background:#7494ec;
    color:white;
    padding:13px 20px;
    border-radius:18px;
    font-weight:800;
    cursor:pointer;
    white-space:nowrap;
}

#btnAtualizarEstatisticas:hover{
    background:#5277e8;
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
    gap:20px;
    margin-bottom:26px;
}

.stat-card{
    background:white;
    border-radius:22px;
    padding:24px;
    box-shadow:0 8px 24px rgba(0,0,0,.07);
    display:flex;
    align-items:center;
    gap:16px;
}

.stat-icon{
    width:58px;
    height:58px;
    border-radius:18px;
    background:#edf2ff;
    color:#5277e8;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:28px;
    flex:0 0 auto;
}

.stat-info strong{
    display:block;
    font-size:32px;
    line-height:1;
    margin-bottom:7px;
}

.stat-info span{
    color:#6b7280;
    font-size:15px;
    font-weight:700;
}

.estatisticas-duas-colunas{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:22px;
}

.painel-est{
    background:white;
    border-radius:24px;
    padding:26px;
    box-shadow:0 8px 24px rgba(0,0,0,.07);
    min-height:340px;
}

.painel-est h2{
    font-size:23px;
    margin-bottom:20px;
    display:flex;
    align-items:center;
    gap:10px;
}

.top-material-item{
    display:flex;
    justify-content:space-between;
    gap:14px;
    padding:14px 0;
    border-bottom:1px solid #edf0f7;
}

.top-material-item:last-child{
    border-bottom:none;
}

.top-material-info{
    min-width:0;
}

.top-material-info strong{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    max-width:320px;
}

.top-material-info span{
    display:block;
    color:#6b7280;
    font-size:13px;
    margin-top:4px;
}

.top-material-metricas{
    display:flex;
    gap:8px;
    align-items:center;
    flex:0 0 auto;
}

.metrica-mini{
    background:#f3f4f6;
    color:#111827;
    padding:7px 10px;
    border-radius:14px;
    font-weight:800;
    font-size:13px;
}

.grafico-mensal{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.linha-mes{
    display:grid;
    grid-template-columns:82px 1fr 42px;
    gap:10px;
    align-items:center;
}

.nome-mes{
    font-weight:800;
    color:#374151;
}

.barra-wrap{
    background:#edf2ff;
    border-radius:999px;
    overflow:hidden;
    height:16px;
}

.barra-mes{
    height:100%;
    background:#7494ec;
    border-radius:999px;
    min-width:4px;
}

.valor-mes{
    text-align:right;
    color:#6b7280;
    font-weight:800;
}

.estado-vazio{
    grid-column:1 / -1;
    background:white;
    padding:28px;
    border-radius:22px;
    text-align:center;
    color:#6b7280;
}

body.dark-mode{
    background:#121212;
    color:#e0e0e0;
}

body.dark-mode .estatisticas-hero,
body.dark-mode .stat-card,
body.dark-mode .painel-est,
body.dark-mode .estado-vazio{
    background:#1f1f1f;
    color:#e0e0e0;
}

body.dark-mode .estatisticas-hero p,
body.dark-mode .stat-info span,
body.dark-mode .top-material-info span,
body.dark-mode .nome-mes,
body.dark-mode .valor-mes{
    color:#cbd5e1;
}

body.dark-mode .top-material-item{
    border-color:#333;
}

body.dark-mode .metrica-mini{
    background:#2a2a2a;
    color:#e0e0e0;
}

body.dark-mode .barra-wrap{
    background:#2a2a2a;
}

@media(max-width:950px){
    .estatisticas-page{
        margin-left:80px;
        padding:30px 18px 60px;
    }

    .estatisticas-hero{
        flex-direction:column;
        align-items:flex-start;
    }

    .estatisticas-duas-colunas{
        grid-template-columns:1fr;
    }

    .estatisticas-hero h1{
        font-size:34px;
    }
}
