/* dashboard.css - DataCenso Radiografia Territorial (Refinamento Palmares) */

:root {
    --bg-offwhite: #f8fafc;
    --bg-white: #ffffff;
    --border-light: #cbd5e1; /* Borda bem definida, cinza médio */
    --text-gray: #64748b;
    --text-dark: #0f172a;
    --accent-black: #000000;
    --brushed-silver: #94a3b8; /* Cor cinza para a barra das mulheres/homens */
}

body.dashboard-body {
    background-color: var(--bg-offwhite);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar .logo-container {
    margin-bottom: 3rem;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--bg-offwhite);
    color: var(--text-dark);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-gray);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 3rem;
    flex: 1;
}

.dash-header {
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Ajustado para alinhar ao topo */
    border-bottom: 1px solid var(--border-light); /* Borda fina para separar header */
    padding-bottom: 1.5rem;
}

.dash-title-container {
    display: flex;
    flex-direction: column;
}

.dash-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -1px;
    margin-bottom: 0.2rem;
}

.dash-subtitle {
    font-size: 1rem;
    color: var(--text-gray);
    margin-top: 0;
}

.city-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-offwhite);
    border: 1px solid var(--border-light);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-top: 1rem;
}

.city-info-badge i {
    color: var(--text-gray);
}

/* Dashboard Grid */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem; /* Mais respiro entre os grids */
}

.widget {
    background: var(--bg-white);
    border: 1px solid #94a3b8; /* Borda cinza escuro, impossível de não ver */
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Sombra um pouco mais forte */
}

.widget-header {
    border-bottom: 2px solid #e2e8f0; /* Linha divisória mais grossa dentro do widget */
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-gray);
    font-weight: 600;
    margin: 0;
}

/* Specific Widgets Spans */
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* Data Elements */
.kpi-value {
    font-size: 2.5rem; /* Levemente menor para caber melhor */
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 0.5rem;
    display: block;
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--accent-black);
    font-weight: 600;
    margin-top: 0.8rem;
    display: inline-block;
    background-color: var(--bg-offwhite);
    border: 1px solid var(--border-light); /* Borda no sub-badge também */
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

/* Mini Bar Chart */
.bar-chart-row {
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #cbd5e1; /* Linha sólida separando itens */
}
.bar-chart-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.bar-chart-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.bar-track {
    width: 100%;
    height: 8px; /* Levemente mais grossa */
    background-color: var(--bg-offwhite);
    border: 1px solid var(--border-light); /* Borda no track da barra */
    border-radius: 2px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background-color: var(--text-dark);
}

/* Pyramid */
.pyramid-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    padding-left: 70px;
    border-bottom: 1px solid var(--bg-offwhite);
    padding-bottom: 0.5rem;
}
.pyramid-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.8rem;
}
.pyramid-age {
    width: 60px;
    font-size: 0.8rem;
    color: var(--text-gray);
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.pyramid-bars {
    flex: 1;
    display: flex;
    gap: 4px; /* Gap um pouco maior */
}
.pyramid-male {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}
.pyramid-female {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}
/* Homens e Mulheres com cores claras e escuras (var definidas acima) */
.bar-m { height: 18px; background-color: var(--text-gray); border-radius: 2px 0 0 2px; }
.bar-f { height: 18px; background-color: var(--text-dark); border-radius: 0 2px 2px 0; }

.pyramid-label-m, .pyramid-label-f {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin: 0 8px;
    font-variant-numeric: tabular-nums;
    line-height: 18px;
    font-weight: 600;
}

/* Grid responsivo */
@media (max-width: 1200px) {
    .col-3 { grid-column: span 6; }
    .col-4 { grid-column: span 6; }
}
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1.5rem; }
    .col-6, .col-8, .col-4, .col-3 { grid-column: span 12; }
}
