/* === ESTRUTURA GERAL === */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f7fa;
}

/* === SIDEBAR FIXO === */
aside {
    width: 220px;
    background-color: #2b60d8;
    color: white;
    padding: 20px;
    height: 100vh;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    border-radius: 0 20px 20px 0;
    position: fixed;
    top: 0;
    left: 0;
}

/* === CONTEÚDO PRINCIPAL === */
main {
    margin-left: 240px; /* ligeiramente maior para espaçar bem */
    padding: 2rem;
    background-color: #eaf0f7;
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
    max-width: calc(100% - 240px); /* limita o espaço do conteúdo */
}

/* === TÍTULOS E METADADOS === */
main h1, main h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
}

main h2 {
    font-size: 1.4em;
    margin-top: 30px;
    margin-bottom: 20px;
}

/* === GRÁFICOS LADO A LADO === */
.graficos-duplos {
    display: flex;
    gap: 20px;
    width: 100%;
    flex-wrap: nowrap;
    box-sizing: border-box;
}

.graficos-duplos > div {
    flex: 1;
    min-width: 0;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.plotly-graph-div {
    width: 100% !important;
    height: auto !important;
}


.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.sidebar-logo img {
  max-width: 200px;      /* ajuste se quiser maior/menor */
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}

.sidebar-nav {
    margin-top: 10px;
}

.sidebar-nav label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.sidebar-nav select {
    width: 100%;
    padding: 5px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: none;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 12px;
}

.sidebar-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-nav a:hover {
    text-decoration: underline;
}






/* === TABELA === */
.tabela-sql {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.tabela-sql th, .tabela-sql td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.tabela-sql th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.tabela-sql tr:nth-child(even) {
    background-color: #f9f9f9;
}

.tabela-sql tr:hover {
    background-color: #e6f7ff;
}

/* GRID de KPIs */
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap:16px;
  margin: 8px 0 24px 0;
}

/* Cartão */
.kpi-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding: 18px 16px;
  min-height: 110px;                 /* garante altura confortável */
  display: flex;
  flex-direction: column;
  align-items: center;                /* centraliza horizontal */
  justify-content: center;            /* centraliza vertical */
  text-align: center;                 /* centraliza texto */
  gap: 6px;
}

/* Título, valor, delta e subtítulo */
.kpi-title {
  font-size: 0.9rem;
  color: #667085;
}

.kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.kpi-delta {
  font-size: 0.85rem;
  font-weight: 600;
}

.kpi-delta.up{
  color:#0a7a2d;
  background: #e6f7ed;
}

.kpi-delta.down{
  color:#b20f0f;
  background: #fde8e8;
}

.kpi-sub{
  margin-top:6px;
  font-size:.80rem;
  color:#718096;
}

/* Gráficos lado a lado (já usado) */
.graficos-duplos{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.filtro-distribuicao {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.filtro-form {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filtro-form label {
  font-size: 0.95rem;
  color: #334155;
}

.filtro-form select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d0d7e2;
  background: #f8fafc;
}

/* ===== Bloco de Seção / Distância abaixo dos gráficos ===== */
.section-block { width: 100%; }
.mt-lg { margin-top: 28px; }

/* Cabeçalho da seção com seletor alinhado à esquerda */
.section-header.left {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

/* Barra de filtro (label + select) */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-bar label {
  font-size: 0.95rem;
  color: #334155;
}
.filter-bar select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d0d7e2;
  background: #fff;
}

/* Grade com 3 colunas (responsivo) */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Cartão padrão dos gráficos */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(20, 60, 120, 0.08);
  padding: 16px;
  min-height: 360px;   /* dá “altura alvo” pra ficar uniforme */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Placeholder para espaços futuros */
.card-placeholder .placeholder {
  color: #6b7280;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* Responsivo: em telas menores, quebra em 1 ou 2 colunas */
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .grid-3 { grid-template-columns: 1fr; }
}
