
:root {
  --azul: #0b5aa6;
  --azul-escuro: #08457f;
  --cinza: #f5f7fb;
  --borda: #d9e1ea;
  --texto: #1f2937;
  --erro: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 24px;
  font-family: Arial, sans-serif;
  color: var(--texto);
  background: #ffffff;
}
h1, h2, h3, p { margin-top: 0; }
.subtitulo { color: #5b6470; margin-bottom: 0; }
.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.status-login {
  font-size: 0.9rem;
  color: #4b5563;
}
.card {
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--cinza);
  margin-bottom: 16px;
}
.card-info {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  font-size: 0.92rem;
}
input, select, button {
  font: inherit;
}
input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--borda);
  border-radius: 10px;
  background: white;
}
button {
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primario {
  background: var(--azul);
  color: white;
  border-color: var(--azul);
}
.btn-primario:hover { background: var(--azul-escuro); }
.btn-secundario {
  background: white;
  border-color: var(--borda);
  color: var(--texto);
}
.btn-secundario:hover { background: #f3f4f6; }
.linha-controles {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--borda);
  border-radius: 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}
th, td {
  border-bottom: 1px solid #e9eef5;
  padding: 10px 8px;
  font-size: 0.88rem;
  vertical-align: top;
}
thead th {
  background: #f7f9fc;
}
tbody tr:nth-child(odd) {
  background: #fcfdff;
}
tfoot td {
  font-weight: bold;
  background: #f7f9fc;
}
.right { text-align: right; }
.center { text-align: center; }
.msg-erro {
  color: var(--erro);
  margin-bottom: 10px;
  min-height: 20px;
}
.hidden { display: none !important; }
.vazio { text-align: center; }
.small { font-size: 0.88rem; color: #4b5563; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 90px;
  z-index: 1000;
}
.modal-content {
  background: white;
  width: 420px;
  max-width: calc(100vw - 24px);
  border-radius: 16px;
  border: 1px solid var(--borda);
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.12);
}
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
@media (max-width: 780px) {
  body { padding: 16px; }
  .top-bar { flex-direction: column; }
  .top-bar-actions { justify-content: flex-start; }
}


.graficos {
  margin-top: 18px;
}
.graficos-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.graficos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}
.grafico-card {
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
.grafico-card h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.grafico-card canvas {
  width: 100% !important;
  height: 320px !important;
}


/* Ajuste: gráficos em coluna única (um abaixo do outro) */
.graficos-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Aumentar altura dos gráficos */
.grafico-card canvas {
  height: 420px !important;
}

/* Mantém oculto por padrão */
#secaoGraficos.hidden {
  display: none !important;
}
