:root{
  --navy:#071d3a;
  --navy-2:#09264d;
  --blue:#1f6edb;
  --blue-2:#1259c8;
  --text:#05204a;
  --muted:#5d6d85;
  --bg:#f3f6fb;
  --card:#ffffff;
  --line:#dfe7f4;
  --shadow:0 10px 28px rgba(7,29,58,.08);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}
.sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:270px;
  background:linear-gradient(180deg,#061a35,#062145 55%,#06172f);
  color:#fff;
  padding:28px 18px;
  z-index:5;
}
.brand{display:flex;gap:14px;align-items:center;margin-bottom:34px}
.crest{
  font-size:42px;
}
.brand h1{font-size:22px;line-height:1.05;margin:0;font-weight:400;letter-spacing:.3px}
.brand h1 span{color:#47b9ff}
.brand p{font-size:12px;margin:10px 0 0;color:#fff}
.nav{display:flex;flex-direction:column;gap:8px}
.nav-item{
  display:flex;align-items:center;gap:12px;
  border:0;border-radius:9px;
  padding:14px 16px;
  background:transparent;color:#fff;
  cursor:pointer;font-size:15px;font-weight:400;
  text-align:left;
}
.nav-item.active{
  background:linear-gradient(135deg,#2376e5,#1458c8);
  box-shadow:0 8px 18px rgba(18,89,200,.32);
}
.nav-icon{font-size:18px;line-height:1}
.source-box{
  position:absolute;left:18px;right:18px;bottom:24px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:10px;
  padding:14px;
  background:rgba(255,255,255,.035);
}
.source-box h3{font-size:12px;margin:0 0 8px;color:#fff}
.source-box p{font-size:11px;margin:5px 0;color:#fff}
.source-box hr{border:0;border-top:1px solid rgba(255,255,255,.15);margin:14px 0}
.updated{line-height:1.35}
.refresh{
  position:absolute;right:12px;bottom:12px;
  background:transparent;color:#fff;border:0;font-size:25px;cursor:pointer
}
.page{margin-left:270px;min-height:100vh}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:22px;
  background:#fff;
  padding:16px 28px 15px;
  border-bottom:1px solid var(--line);
  box-shadow:0 2px 8px rgba(7,29,58,.04);
}
.topbar h2{font-size:29px;letter-spacing:.2px;margin:0 0 4px;color:#061f46}
.topbar p{margin:0;color:#526480}
.filters{display:flex;align-items:end;gap:14px}
.filters label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:#001e4b}
select,input,button{
  font-family:inherit;
}
.filters select,.filters button,.table-actions select,.table-actions input{
  height:42px;border:1px solid #b7cef5;border-radius:7px;
  background:#fff;color:#05204a;font-weight:700;padding:0 15px;
}
.filters select{min-width:126px}
.filters button{min-width:152px;color:#0b56c6;cursor:pointer}
#exportBtn{min-width:185px;border-color:#6fa3ff}
.kpis{
  display:grid;
  grid-template-columns:repeat(6,minmax(145px,1fr));
  gap:10px;
  padding:18px 18px 10px;
}
.kpi{
  background:#fff;border:1px solid #e3eaf6;border-radius:13px;
  padding:16px 15px;
  box-shadow:var(--shadow);
  display:flex;gap:14px;align-items:flex-start;min-height:112px;
}
.kpi .icon{
  width:48px;height:48px;border-radius:12px;display:grid;place-items:center;
  font-size:23px;color:#fff;flex:0 0 auto;
}
.kpi:nth-child(1) .icon{background:linear-gradient(135deg,#1266dd,#69a7ff)}
.kpi:nth-child(2) .icon{background:linear-gradient(135deg,#16803a,#7bd15e)}
.kpi:nth-child(3) .icon{background:linear-gradient(135deg,#6a49d9,#9a7cf2)}
.kpi:nth-child(4) .icon{background:linear-gradient(135deg,#ff7b1d,#ffaf58)}
.kpi:nth-child(5) .icon{background:linear-gradient(135deg,#15979b,#42c7c8)}
.kpi:nth-child(6) .icon{background:linear-gradient(135deg,#f23e5d,#ff7e94)}
.kpi h4{margin:0 0 8px;font-size:11px;text-transform:uppercase;color:#06265a}
.kpi strong{display:block;font-size:23px;margin-bottom:6px;color:#061f46}
.kpi small{display:block;color:#536780}
.kpi .up{margin-top:8px;color:#078136;font-weight:400}
.grid{display:grid;gap:10px;padding:10px 18px}
.grid-3{grid-template-columns:1.06fr 1.15fr 1.15fr}
.grid-main{grid-template-columns:minmax(680px,1fr) 320px}
.grid-5{grid-template-columns:repeat(5,1fr);padding-bottom:12px}
.card{
  background:#fff;border:1px solid #dfe7f4;border-radius:12px;
  box-shadow:var(--shadow);padding:14px;
}
.card h3,.card-head h3{
  margin:0 0 11px;font-size:14px;text-transform:uppercase;color:#06265a;
}
.chart-wrap{height:230px;position:relative}
.chart-wrap.small{height:220px}
.source{font-size:11px;color:#65758d;margin:8px 0 0}
.table-actions{display:flex;gap:10px;margin:8px 0 10px}
.table-actions input{flex:1;font-weight:400}
.table-actions select{width:185px}
.table-scroll{max-height:300px;overflow:auto;border:1px solid #dfe7f4;border-radius:8px}
table{width:100%;border-collapse:collapse;font-size:12px}
thead{position:sticky;top:0;background:#f0f4fb;z-index:1}
th,td{padding:10px;border-bottom:1px solid #e3eaf6;text-align:left;white-space:nowrap}
th{font-size:11px;text-transform:uppercase;color:#00265e}
td:first-child{font-weight:400;color:#082653}
.table-footer{display:flex;align-items:center;justify-content:space-between;margin-top:10px;font-size:12px;color:#5e708b}
.pager{display:flex;align-items:center;gap:8px}
.pager button{
  border:1px solid #c9d9f5;background:#fff;color:#0b56c6;border-radius:6px;
  width:32px;height:28px;cursor:pointer;font-weight:400;
}
.notice{
  margin:0 18px 18px;
  border:1px solid #b7cef5;border-radius:9px;background:#fff;
  padding:12px 14px;display:flex;align-items:center;gap:9px;color:#415a7b;
  font-size:12px;
}
.notice p{margin:0;flex:1}
.notice span{color:#1f6edb;font-weight:400}
@media(max-width:1200px){
  .kpis{grid-template-columns:repeat(3,1fr)}
  .grid-3,.grid-main,.grid-5{grid-template-columns:1fr}
  .sidebar{position:relative;width:auto}
  .page{margin-left:0}
  .source-box{position:relative;left:auto;right:auto;bottom:auto;margin-top:20px}
}


/* ===== Correções de estabilidade e layout ===== */
.page{
  overflow-x:hidden;
}
.card{
  min-width:0;
  overflow:hidden;
}
.table-card{
  min-height:auto;
 /* align-self:start;*/
}
.table-scroll{
  /* height:330px; */
  max-height:530px;
  overflow:auto;
}
.table-scroll table{
  min-width:1080px;
}
.table-footer{
  min-height:34px;
  padding:4px 0;
}
.side-panels{
  display:grid;
  gap:10px;
  align-self:start;
}
.grid-5{
  align-items:stretch;
}
.grid-5 .card{
  min-height:245px;
  height:245px;
  display:flex;
  flex-direction:column;
}
.grid-5 .card canvas{
  width:100% !important;
  height:160px !important;
  max-height:160px !important;
  flex:1;
}
.grid-5 .card .source{
  margin-top:auto;
}
canvas{
  max-width:100%;
}
.loading-error{
  margin:18px;
  padding:18px;
  border:1px solid #f3b6b6;
  background:#fff5f5;
  color:#7a1515;
  border-radius:10px;
  font-weight:400;
}
button:disabled{
  opacity:.45;
  cursor:not-allowed;
}
@media(max-width:1500px){
  .grid-5{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:1050px){
  .grid-5{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:760px){
  .grid-5{grid-template-columns:1fr}
  .topbar{flex-direction:column;align-items:flex-start}
  .filters{flex-wrap:wrap}
}

/* ===== Aba Criança Alfabetizada integrada ao dashboard existente ===== */
.view{display:none}
.view.active{display:block}
.nav-item:not(.active):hover{background:rgba(255,255,255,.08)}
.cnca-hero{
  margin:18px 18px 0;
  border-radius:14px;
  padding:22px 24px;
  color:#fff;
  background:linear-gradient(135deg,#111a58 0%,#16256b 58%,#0b1f3a 100%);
  box-shadow:var(--shadow);
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:center;
}
.cnca-kicker{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:#d7e4ff}
.cnca-hero h2{margin:2px 0 4px;font-size:31px;line-height:1;color:#fff}
.cnca-hero p{margin:0;color:#e4ecff}
.cnca-filters{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:9px;min-width:560px}
.cnca-filters label{border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.08);border-radius:8px;padding:9px 12px;font-size:11px;text-transform:uppercase;color:#dbe7ff}
.cnca-filters strong{display:block;margin-top:5px;font-size:13px;text-transform:none;color:#fff;white-space:nowrap}
.cnca-kpis .kpi:nth-child(1) .icon{background:linear-gradient(135deg,#2563eb,#60a5fa)}
.cnca-kpis .kpi:nth-child(2) .icon{background:linear-gradient(135deg,#16a34a,#86efac)}
.cnca-kpis .kpi:nth-child(3) .icon{background:linear-gradient(135deg,#dc2626,#fb7185)}
.cnca-kpis .kpi:nth-child(4) .icon{background:linear-gradient(135deg,#ea580c,#fdba74)}
.cnca-kpis .kpi:nth-child(5) .icon{background:linear-gradient(135deg,#7c3aed,#c4b5fd)}
.cnca-kpis .kpi:nth-child(6) .icon{background:linear-gradient(135deg,#0891b2,#67e8f9)}
.cnca-grid{grid-template-columns:repeat(3,1fr)}
.cnca-wide-grid{grid-template-columns:1fr;padding-top:0}
.cnca-table-card .card-head h3{text-align:center;font-size:18px;letter-spacing:.2px}
.cnca-table-scroll{max-height:420px}
.cnca-table-scroll table{min-width:1180px;font-size:12px}
.cnca-table-scroll thead{background:#111a58;color:#fff}
.cnca-table-scroll th{color:#fff;border-bottom:0;font-size:12px;text-transform:none;padding:8px 10px}
.cnca-table-scroll td{padding:8px 10px}
.cnca-table-scroll tbody tr:nth-child(even){background:#f2f2f2}
.cnca-table-scroll tbody tr:hover{background:#eaf2ff}
.risk-badge{display:inline-flex;align-items:center;justify-content:center;min-width:82px;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:700}
.risk-badge-1{background:#e8f8ef;color:#166534}
.risk-badge-2{background:#eef9d8;color:#3f6212}
.risk-badge-3{background:#fff7d6;color:#854d0e}
.risk-badge-4{background:#ffedd5;color:#9a3412}
.risk-badge-5{background:#fee2e2;color:#991b1b}
.risk-bars{display:inline-flex;align-items:end;gap:2px;height:18px;width:24px}
.risk-bars i{display:block;width:3px;border:1px solid #6b7280;background:#fff;border-radius:1px}
.risk-bars i:nth-child(1){height:6px}.risk-bars i:nth-child(2){height:9px}.risk-bars i:nth-child(3){height:12px}.risk-bars i:nth-child(4){height:15px}.risk-bars i:nth-child(5){height:18px}
.risk-1 i:nth-child(-n+1),.risk-2 i:nth-child(-n+2),.risk-3 i:nth-child(-n+3),.risk-4 i:nth-child(-n+4),.risk-5 i:nth-child(-n+5){background:#2b9bd7;border-color:#1b638d}
.cnca-note{margin-top:0}
@media(max-width:1300px){
  .cnca-hero{align-items:flex-start;flex-direction:column}
  .cnca-filters{min-width:0;width:100%;grid-template-columns:repeat(2,1fr)}
  .cnca-grid{grid-template-columns:1fr}
}
@media(max-width:760px){
  .cnca-filters{grid-template-columns:1fr}
}


/* ===== Ajuste 1366px - Criança Alfabetizada =====
   O objetivo é impedir corte dos nomes no ranking lateral.
   Em telas médias, o card do ranking recebe mais largura, enquanto os dois gráficos da esquerda ficam mais compactos. */
.cnca-card-ranking .chart-wrap{height:250px}
.cnca-card-ranking{overflow:visible}

@media (min-width:1201px) and (max-width:1420px){
  .page{margin-left:250px}
  .sidebar{width:250px;padding-left:14px;padding-right:14px}
  .grid{padding-left:14px;padding-right:14px;gap:8px}
  .kpis{padding-left:14px;padding-right:14px;gap:8px}
  .cnca-hero{margin-left:14px;margin-right:14px;padding:18px 20px}
  .cnca-hero h2{font-size:28px}
  .cnca-hero p{font-size:13px}
  .cnca-filters{min-width:500px;gap:8px}
  .cnca-filters label{padding:8px 10px}
  .cnca-kpis{grid-template-columns:repeat(6,minmax(130px,1fr))}
  .cnca-kpis .kpi{padding:14px 12px;gap:10px;min-height:104px}
  .cnca-kpis .kpi .icon{width:42px;height:42px;font-size:20px}
  .cnca-kpis .kpi h4{font-size:10px}
  .cnca-kpis .kpi strong{font-size:21px}

  .cnca-grid{
    grid-template-columns:minmax(0,.78fr) minmax(0,.82fr) minmax(440px,1.42fr);
    align-items:stretch;
  }
  .cnca-grid .card{padding:12px;min-width:0}
  .cnca-grid .card h3{font-size:12px;margin-bottom:8px}
  .cnca-card-classificacao .chart-wrap,
  .cnca-card-matriculas .chart-wrap{height:220px}
  .cnca-card-ranking .chart-wrap{height:230px}
  .cnca-card-ranking .source{font-size:10px}
}

/* Para telas ainda mais estreitas, joga o ranking para linha inteira para preservar legibilidade. */
@media (min-width:901px) and (max-width:1240px){
  .cnca-grid{grid-template-columns:1fr 1fr}
  .cnca-card-ranking{grid-column:1 / -1}
  .cnca-card-ranking .chart-wrap{height:280px}
}

/* Auditoria 30/06/2026: tabela ampliada para Código INEP, tipo da unidade e endereço. */
.table-scroll table{
  min-width:1450px;
}
.table-actions select#typeFilter{
  width:240px;
}

/* ===== Auditoria de dados oficiais ===== */
.audit-note{
  border:1px solid #f1c66b;
  background:#fff8e6;
  color:#624307;
  border-radius:8px;
  padding:10px 12px;
  margin:8px 0 10px;
  font-size:12px;
  line-height:1.35;
}
.audit-pending{
  display:inline-block;
  padding:2px 7px;
  border-radius:999px;
  background:#fff8e6;
  color:#624307;
  border:1px solid #f1c66b;
  font-size:11px;
}

/* ===== Progressão Pedagógica — Protocolo de Leitura e Escrita ===== */
.progress-hero{
  margin:18px 18px 0;
  border-radius:14px;
  padding:22px 24px;
  color:#fff;
  background:linear-gradient(135deg,#0b1f3a 0%,#123d70 60%,#1d5da1 100%);
  box-shadow:var(--shadow);
  display:flex;
  justify-content:space-between;
  gap:22px;
  align-items:center;
}
.progress-kicker{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#d8e9ff}
.progress-hero h2{margin:3px 0 6px;font-size:30px;line-height:1;color:#fff;font-weight:500}
.progress-hero p{margin:0;color:#e3eefc;max-width:690px;font-size:13px;line-height:1.45}
.progress-filters{display:flex;gap:9px;align-items:end;flex-wrap:wrap;justify-content:flex-end}
.progress-filters label{display:flex;flex-direction:column;gap:5px;font-size:10px;text-transform:uppercase;color:#d7e6fa}
.progress-filters select{
  min-width:155px;height:38px;border:1px solid rgba(255,255,255,.45);border-radius:8px;
  background:#fff;color:#173b66;padding:0 10px;font-weight:500;
}
.progress-filters label:nth-child(2) select{min-width:285px;max-width:360px}
.progress-filters button{
  height:38px;border:1px solid rgba(255,255,255,.5);border-radius:8px;padding:0 14px;
  background:rgba(255,255,255,.12);color:#fff;cursor:pointer;font-weight:500;
}
.progress-filters button:hover{background:rgba(255,255,255,.2)}
.progress-series-note{
  margin:10px 18px 0;padding:10px 13px;border:1px solid #c9dbf2;border-radius:9px;
  background:#f7fbff;color:#46617f;display:flex;align-items:center;gap:9px;font-size:11px;
}
.progress-series-note p{margin:0}.progress-series-note span{color:#1e65ac}
.progress-kpis{grid-template-columns:repeat(6,minmax(0,1fr))}
.progress-kpis .kpi{min-height:104px;padding:14px 12px;gap:10px}
.progress-kpis .kpi .icon{width:42px;height:42px;font-size:19px}
.progress-kpis .kpi h4{font-size:10px}
.progress-kpis .kpi strong{font-size:21px;font-weight:500}
.progress-kpis .kpi:nth-child(1) .icon{background:linear-gradient(135deg,#265fb7,#6ca4ef)}
.progress-kpis .kpi:nth-child(2) .icon{background:linear-gradient(135deg,#7158b8,#9b87db)}
.progress-kpis .kpi:nth-child(3) .icon{background:linear-gradient(135deg,#1e8c75,#59bea8)}
.progress-kpis .kpi:nth-child(4) .icon{background:linear-gradient(135deg,#d58a1e,#efb755)}
.progress-kpis .kpi:nth-child(5) .icon{background:linear-gradient(135deg,#2c72b5,#6ba9df)}
.progress-kpis .kpi:nth-child(6) .icon{background:linear-gradient(135deg,#248457,#5dbb87)}
.progress-grid-full{grid-template-columns:1fr;padding-top:0}
.progress-grid-two{grid-template-columns:repeat(2,minmax(0,1fr));padding-top:0}
.progress-card-wide{padding:14px 16px}
.progress-card-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}
.progress-card-head h3{margin-bottom:4px}
.progress-card-head p{margin:0 0 8px;font-size:11px;color:#6a7d96;line-height:1.35}
.progress-chart-tall{height:500px;position:relative}
.progress-chart-medium{height:470px;position:relative}
.progress-chart-history{height:260px;position:relative}
.progress-history-card{padding-bottom:12px}
.progress-table-title{display:flex;align-items:center;justify-content:space-between;gap:12px}
.progress-table-title p{margin:3px 0 0;color:#6a7d96;font-size:11px}
.progress-table-title input{width:280px;max-width:42%;height:36px;border:1px solid #cad7e8;border-radius:8px;padding:0 11px;font-weight:400}
.progress-table-scroll{max-height:520px}
.progress-table-scroll table{min-width:1940px;font-size:11px}
.progress-table-scroll th{font-size:10px;padding:8px 9px;background:#0b1f3a;color:#fff}
.progress-table-scroll td{padding:8px 9px}
.progress-table-scroll tbody tr:nth-child(even){background:#f7f9fc}
.progress-table-scroll tbody tr:hover{background:#eef5ff}
.progress-good{color:#14734c;font-weight:500}
@media (min-width:1201px) and (max-width:1420px){
  .progress-hero{margin-left:14px;margin-right:14px;padding:18px 20px}
  .progress-hero h2{font-size:27px}
  .progress-filters label:nth-child(2) select{min-width:240px;max-width:280px}
  .progress-kpis{grid-template-columns:repeat(6,minmax(120px,1fr));padding-left:14px;padding-right:14px}
  .progress-chart-tall{height:470px}
  .progress-chart-medium{height:440px}
}
@media(max-width:1100px){
  .progress-hero{align-items:flex-start;flex-direction:column}
  .progress-filters{width:100%;justify-content:flex-start}
  .progress-kpis{grid-template-columns:repeat(3,1fr)}
  .progress-grid-two{grid-template-columns:1fr}
}
@media(max-width:760px){
  .progress-kpis{grid-template-columns:1fr}
  .progress-filters{display:grid;grid-template-columns:1fr;width:100%}
  .progress-filters select,.progress-filters label:nth-child(2) select,.progress-filters button{width:100%;max-width:none;min-width:0}
  .progress-chart-tall,.progress-chart-medium{height:560px}
  .progress-table-title{align-items:flex-start;flex-direction:column}
  .progress-table-title input{width:100%;max-width:none}
}
.progress-data-note{
  margin:8px 0 10px;padding:9px 11px;border:1px solid #d6e3f3;border-radius:8px;
  background:#f8fbff;color:#526984;font-size:11px;line-height:1.35;
}

.progress-inline-filter{display:flex;flex-direction:column;gap:5px;font-size:10px;text-transform:uppercase;color:#5f7490}
.progress-profile-grid .card{padding-bottom:12px}
.progress-profile-table-scroll table{min-width:1180px;font-size:11px}
.progress-profile-table-scroll th{font-size:10px;padding:8px 9px;background:#0b1f3a;color:#fff}
.progress-profile-table-scroll td{padding:8px 9px}
.progress-profile-table-scroll tbody tr:nth-child(even){background:#f7f9fc}
.progress-profile-table-scroll tbody tr:hover{background:#eef5ff}

/* Progressão pedagógica: painéis arejados e barras legíveis em telas menores. */
#view-progressao .progress-grid-two{grid-template-columns:1fr}
#view-progressao .progress-card-wide,#view-progressao .progress-grid-two>.card{border:1px solid #e5ecf4;border-radius:16px;box-shadow:0 12px 30px rgba(16,43,73,.055);padding:22px 24px}
#view-progressao .progress-chart-tall{height:660px}
#view-progressao .progress-chart-medium{height:620px}
#view-progressao .progress-profile-grid .progress-chart-medium{height:340px}
#view-progressao [hidden]{display:none!important}
@media(max-width:700px){
  #view-progressao .progress-card-wide,#view-progressao .progress-grid-two>.card{padding:16px 12px}
  #view-progressao .progress-chart-tall{height:690px}
  #view-progressao .progress-chart-medium{height:650px}
  #view-progressao .progress-profile-grid .progress-chart-medium{height:350px}
}

.progress-heatmap-scroll{overflow-x:auto;padding:7px 2px 10px}
.progress-heatmap{min-width:730px;display:grid;gap:5px}
.heatmap-heading,.heatmap-row{display:grid;grid-template-columns:minmax(235px,1.65fr) repeat(4,minmax(90px,1fr));gap:7px;align-items:center}
.heatmap-heading{position:sticky;top:0;z-index:1;padding:0 0 10px;color:#526982;font-size:11px;font-weight:500;text-align:center;background:#fff}
.heatmap-heading span:first-child{text-align:left}
.heatmap-row{border-bottom:1px solid #eef2f7;padding:3px 0}
.heatmap-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:#2b415c}
.heatmap-cell{border-radius:9px;text-align:center;padding:10px 4px;font-size:12px;font-weight:500;min-height:38px}
#view-progressao .progress-profile-grid .progress-chart-medium{height:390px}
@media(max-width:700px){.progress-heatmap{min-width:700px}.heatmap-row{padding:2px 0}}
