/* ============================================================
   Portal Educação — cola da casca da Casa com a identidade
   própria do painel. Carregado depois de casa.css e styles.css.
   A casca (lateral, topbar, estados) é da Casa; paleta,
   ficha e mapa permanecem da Educação. Não altera regra de negócio.
   ============================================================ */

:root {
  --acento: #be185d;
  --acento-tinta: #9d174d;
  --acento-suave: #fdf2f8;
  --fundo: #f8f6f3;
}

body {
  background:
    radial-gradient(circle at 8% 10%, rgba(244, 114, 182, 0.10), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(45, 212, 191, 0.12), transparent 30%),
    var(--fundo);
}

#appSidebar.sidebar {
  background: var(--lateral-fundo);
  color: var(--tinta);
  border-right: 1px solid var(--lateral-borda);
  padding: 0;
  gap: 0;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--largura-lateral);
  height: 100vh;
  overflow: hidden;
}

#appSidebar .marca { background: var(--navy); border-bottom: 2px solid var(--acento); }
#appSidebar .nav-item.active { background: var(--acento-suave); color: var(--navy); border-left-color: var(--acento); }
#appSidebar .nav-item.active .ico { color: var(--acento-tinta); }

#appSidebar nav.sidebar-nav.nav,
body #appSidebar nav.sidebar-nav.nav,
body .nav.sidebar-nav {
  display: flex !important;
  flex-direction: column;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 12px 10px 4px;
  overflow-y: auto;
}

.global-filter-bar { display: none !important; }
.busca-cidadao-bar { display: none !important; }
header.header { display: none !important; }

#appSidebar .nav-item,
#appSidebar nav.sidebar-nav a.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  margin: 0;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--cinza);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  box-shadow: none;
}

#appSidebar nav.sidebar-nav a.nav-item:hover {
  background: rgba(27, 42, 74, .05);
  color: var(--tinta);
}

#appSidebar nav.sidebar-nav a.nav-item.active {
  background: var(--acento-suave);
  color: var(--navy);
  font-weight: 600;
  border-left-color: var(--acento);
}

#appSidebar .nav-item [data-lucide],
#appSidebar .nav-item svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
}

.main {
  margin-left: var(--largura-lateral);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}

.lente .busca-cidadao-box,
.lente .global-municipio-selector {
  position: relative;
  min-width: 220px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: var(--papel);
  border: 1px solid var(--borda-campo);
  border-radius: var(--raio);
}

.lente .busca-cidadao-box input,
.lente .global-municipio-input {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 34px;
  width: 100%;
  font-size: 13px;
}

.lente .busca-cidadao-box:focus-within,
.lente .global-municipio-selector:focus-within {
  border-color: var(--acento);
  box-shadow: 0 0 0 3px rgba(190, 24, 93, .12);
}

.lente .header-sync-sources {
  display: flex;
  align-items: center;
}

.lente .sync-chip {
  background: var(--papel);
  color: var(--cinza);
  border: 1px solid var(--linha);
  min-height: 36px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  background: var(--papel);
  border: 1px solid var(--borda-campo);
  color: var(--navy);
  border-radius: var(--raio);
}

.lente .campo-ficha-cidadao { display: none; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.kpi-card {
  position: relative;
  padding: 15px 19px 17px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  border: 1px solid var(--linha);
  border-top: 2px solid var(--acento);
  border-radius: 3px;
  box-shadow: var(--sombra);
}

.kpi-card.kpi-hero {
  background: linear-gradient(135deg, #be185d 0%, #0f766e 100%) !important;
  border-top-color: transparent;
  color: #fff;
}

.kpi-value {
  font-family: var(--serifa);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--navy);
}

.kpi-card.kpi-hero .kpi-value,
.kpi-card.kpi-hero .kpi-label { color: #fff; }

.card-section,
.table-container,
.chart-container {
  border: 1px solid var(--linha);
  border-radius: 3px;
  box-shadow: var(--sombra);
}

.card-section-title,
.table-title,
.chart-title {
  font-family: var(--serifa);
  color: var(--navy);
}

.boot-error,
.painel-loading {
  padding: 28px 22px;
  text-align: center;
  border: 1px dashed var(--linha);
  border-radius: var(--raio);
  background: var(--papel-suave);
  color: var(--cinza);
}

.boot-error h1 {
  font-family: var(--serifa);
  color: var(--navy);
  font-size: 22px;
  margin: 0 0 8px;
}

.audit-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--alerta-fundo);
  border: 1px solid #ead7a8;
  border-radius: var(--raio);
  font-size: 13px;
  color: var(--tinta);
  line-height: 1.55;
}

.audit-note svg { width: 16px; height: 16px; color: var(--alerta); flex: none; margin-top: 2px; }

.site-footer {
  margin-top: 8px;
  border-top: 1px solid var(--linha);
  background: transparent;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.sugestoes-municipio,
.busca-sugestoes {
  z-index: 40;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1080px) {
  .main { margin-left: 0; }
}

@media (max-width: 600px) {
  .lente { width: 100%; flex-wrap: wrap; }
  .lente .campo, .lente .busca-cidadao-box, .lente .global-municipio-selector { width: 100%; min-width: 0; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
}
