@import url("caed-theme.css");
@import url("fonts.css");

*, *::before, *::after {
  box-sizing: border-box;
  forced-color-adjust: none;
}

html {
  color-scheme: only light !important;
  background: var(--bg) !important;
  background-color: var(--bg) !important;
}

body,
body.theme-light {
  margin: 0;
  font-family: var(--font);
  color: var(--ink) !important;
  background: var(--bg) !important;
  background-color: var(--bg) !important;
  background-image: none !important;
  min-height: 100vh;
}

a { color: var(--accent-dark) !important; }
a:hover { color: var(--accent) !important; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .95rem 1.4rem;
  background: #ffffff !important;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  color: var(--ink) !important;
}

.brand {
  display: flex;
  gap: .85rem;
  align-items: center;
  text-decoration: none !important;
  color: inherit !important;
}
.brand:hover { opacity: .92; }
.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
}
.brand small { color: var(--muted) !important; font-size: .82rem; }
.brand-mark {
  background: var(--accent) !important;
  color: #ffffff !important;
  font-weight: 800;
  letter-spacing: .06em;
  padding: .65rem .72rem;
  border-radius: 12px;
  font-size: .78rem;
}

.container,
main.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.4rem auto 2.5rem;
  background: transparent !important;
  color: var(--ink) !important;
}

.flash-wrap { width: min(1180px, calc(100% - 2rem)); margin: 1rem auto 0; }
.flash { padding: .85rem 1rem; border-radius: 12px; margin-bottom: .5rem; font-weight: 500; }
.flash-ok { background: var(--accent-soft) !important; color: var(--accent-dark) !important; }
.flash-erro { background: #fdecea !important; color: var(--danger) !important; }

.page-hero {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.2rem;
  padding: 1.35rem 1.4rem;
  border-radius: 24px;
  background: #ffffff !important;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink) !important;
}
.page-hero h1 {
  margin: 0 0 .4rem;
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink) !important;
}
.page-hero p { margin: 0; color: var(--muted) !important; max-width: 48rem; }
.page-hero .meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  background: #ffffff !important;
  border: 1px solid var(--line);
  color: var(--muted) !important;
  font-size: .78rem;
  font-weight: 600;
}
.chip strong { color: var(--ink) !important; font-weight: 700; }
.hero-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .8rem;
  margin-bottom: 1.1rem;
}
.kpi {
  background: #ffffff !important;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  color: var(--ink) !important;
}
.kpi::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: #d5e3db;
}
.kpi-label {
  display: block;
  color: var(--muted) !important;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}
.kpi-value {
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  color: var(--ink) !important;
}
.kpi-warn::after { background: #e2a23a; }
.kpi-warn .kpi-value { color: var(--warn) !important; }
.kpi-ok::after { background: var(--accent); }
.kpi-ok .kpi-value { color: var(--accent) !important; }
.kpi-accent {
  background: var(--accent) !important;
  color: #ffffff !important;
  border: none;
}
.kpi-accent .kpi-label,
.kpi-accent .kpi-value { color: #ffffff !important; }
.kpi-accent::after { display: none; }

.panel {
  background: #ffffff !important;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.25rem 1.3rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
  color: var(--ink) !important;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
}
.panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
}
.panel-head .hint { color: var(--muted) !important; font-size: .86rem; }

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .9rem;
  border-radius: 16px;
  background: var(--surface-soft) !important;
  border: 1px solid #e1ebe5;
  color: var(--ink) !important;
  overflow: visible;
  position: relative;
  z-index: 8;
}
.filters .filter-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}
.filters .filter-field > label,
.filters .filter-label,
.filters label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted) !important;
  margin-bottom: .35rem;
}
.filters .filter-seg {
  display: flex;
  gap: .3rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .25rem;
  height: 42px;
  box-sizing: border-box;
  align-items: stretch;
}
.filters .filter-seg .seg {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none !important;
  color: #3d564c !important;
  padding: 0 .5rem;
}
.filters .filter-seg .seg:hover {
  background: #ffffff;
  color: var(--accent) !important;
}
.filters .filter-seg .seg.is-on {
  background: var(--accent) !important;
  color: #ffffff !important;
}
.filters select,
.filters input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .6rem .75rem;
  font: inherit;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink) !important;
  background: #ffffff !important;
  width: 100%;
  max-width: 100%;
  cursor: pointer;
  position: relative;
  z-index: 9;
}
.filters select:focus,
.filters input:focus {
  outline: 2px solid var(--accent-muted);
  border-color: var(--accent);
}
.filters .filter-field-disciplina select {
  font-weight: 700;
  border-color: var(--accent);
}
.filters .filter-field-acoes .btn {
  width: 100%;
  height: 42px;
}

.filters-rede {
  grid-template-columns: minmax(100px, .8fr) minmax(120px, 1fr) minmax(140px, 1.4fr) minmax(160px, 1.3fr) minmax(120px, .9fr);
  margin-bottom: 1.1rem;
  align-items: end;
}
.filters-questoes-hier {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}
@media (max-width: 900px) {
  .filters-rede { grid-template-columns: 1fr 1fr; }
  .filters-questoes-hier { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .filters-rede { grid-template-columns: 1fr; }
}
.row-link { cursor: pointer; }
.row-link:hover td { background: #eef7f3 !important; }

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
  padding: .18rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.badge.prio-alta { color: var(--danger); border-color: #e3b4b0; background: #fdf4f3; }
.badge.prio-media { color: var(--warn); border-color: #e4cf9a; background: #fff8ea; }
.badge.prio-baixa { color: var(--accent); border-color: #b7d7cc; background: #eef7f3; }

.sit {
  display: inline-block;
  min-width: 92px;
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.st-pend { color: var(--warn); background: #fff6e8; border-color: #efd7a4; }
.st-ok { color: var(--accent); background: #e8f5ef; border-color: #b7d7cc; }
.st-aus { color: #6b3a16; background: #f6eee8; border-color: #e0c8b6; }
.st-trf { color: #3d4a68; background: #eef1f6; border-color: #c5cedd; }
.st-out { color: var(--muted); }

.nest-bloco { margin: 0 0 1.15rem; }
.nest-bloco h3 {
  margin: 0 0 .35rem;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink) !important;
  display: flex;
  gap: .5rem;
  align-items: baseline;
}
.nest-bloco h3 em,
.nest-turma h4 em {
  font-style: normal;
  color: var(--muted) !important;
  font-size: .82rem;
  font-weight: 600;
}
.nest-turma { margin: .65rem 0 1rem .15rem; }
.nest-turma h4 {
  margin: 0 0 .4rem;
  font-size: .92rem;
  color: var(--ink) !important;
}

.dist-panel summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.dist-panel summary::-webkit-details-marker { display: none; }
.dist-panel summary h2 { margin: 0 0 .2rem; }
.dist-panel[open] summary { margin-bottom: 1rem; }
.dist-copy {
  margin: 0;
  align-self: center;
  color: var(--muted) !important;
  font-weight: 600;
}
.generator .filters-report {
  grid-template-columns: 1fr auto;
}
.filters-report .btn {
  height: 42px;
  margin-bottom: 1px;
}
.generator .muted {
  margin: .85rem 0 .2rem;
  color: var(--warn) !important;
  font-weight: 600;
}
.pack-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
.pack-preview article {
  background: var(--surface-soft) !important;
  border: 1px solid #e1ebe5;
  border-radius: 14px;
  padding: .85rem 1rem;
}
.pack-preview small {
  display: block;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.pack-preview strong {
  display: block;
  margin: .25rem 0 .2rem;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink) !important;
}
.pack-preview span {
  color: var(--muted) !important;
  font-size: .84rem;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.pack-card {
  background: #fff !important;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}
.pack-card small {
  display: block;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.pack-card h2 {
  margin: .35rem 0 .45rem;
  font-family: var(--display);
  font-size: 1.25rem;
}
.pack-card p { margin: 0 0 .6rem; color: var(--muted); font-size: .92rem; }
.pack-card ul {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--ink);
  font-size: .9rem;
}
.pack-card .btn { width: 100%; justify-content: center; }
.breadcrumb { margin: 0 0 .35rem; color: var(--muted); font-size: .88rem; }

@media (max-width: 1000px) {
  .pack-grid { grid-template-columns: 1fr; }
}

.progress-list { display: grid; gap: .85rem; }
.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .92rem;
  margin-bottom: .4rem;
  font-weight: 600;
  color: var(--ink) !important;
}
.progress-head span:last-child { color: var(--muted) !important; font-weight: 600; }
.bar {
  height: 11px;
  background: #e7eee9 !important;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent) !important;
  transition: width .35s ease;
}

.zip-progress {
  margin: .85rem 0 1rem;
  padding: .85rem 1rem;
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.zip-progress .progress-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
  margin-bottom: .45rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
}
.zip-progress [data-zip-det] {
  margin-right: .55rem;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.zip-progress .zip-erro {
  margin: .55rem 0 0;
  color: #b42318;
  font-size: .88rem;
  font-weight: 600;
}
.zip-progress .zip-dl {
  margin-top: .75rem;
  display: inline-flex;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff !important;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  background: #ffffff !important;
  color: var(--ink) !important;
}
th, td {
  padding: .72rem .55rem;
  border-bottom: 1px solid #e4ece7;
  text-align: left;
  vertical-align: middle;
  background: #ffffff !important;
  color: var(--ink) !important;
}
th {
  color: var(--muted) !important;
  font-weight: 700;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f7faf8 !important;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
td { white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f4faf7 !important; }

.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
  white-space: nowrap;
}
.metric-cell .pct {
  font-weight: 700;
  color: var(--ink) !important;
}
.metric-cell .qtd {
  font-size: .78rem;
  color: var(--muted) !important;
}

.mini-bar {
  display: inline-block;
  vertical-align: middle;
  width: 56px;
  height: 8px;
  background: #e7eee9 !important;
  border-radius: 999px;
  overflow: hidden;
  margin-right: .3rem;
}
.mini-bar span { display: block; height: 100%; background: var(--accent) !important; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: .62rem 1.05rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary {
  background: var(--accent) !important;
  color: #ffffff !important;
}
.btn-secondary {
  background: var(--ink) !important;
  color: #ffffff !important;
  align-self: end;
}
.btn-ghost {
  background: #ffffff !important;
  color: var(--ink) !important;
  border: 1px solid var(--line);
}
.btn-small {
  padding: .38rem .72rem;
  font-size: .76rem;
  white-space: nowrap;
}
.inline { display: inline; }
.muted { color: var(--muted) !important; }
.empty {
  padding: 3.5rem 1.2rem;
  text-align: center;
  background: #ffffff !important;
  border-radius: 22px;
  border: 1px solid var(--line);
  color: var(--ink) !important;
}
.link-drill {
  color: var(--accent) !important;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 181, 187, 0.45);
}
.breadcrumb { margin: 0 0 .45rem; color: var(--muted) !important; font-size: .88rem; }
.breadcrumb a { text-decoration: none; font-weight: 600; color: var(--accent) !important; }
.nome-escola {
  white-space: normal !important;
  min-width: 220px;
  max-width: 420px;
  font-weight: 600;
  color: var(--ink) !important;
}
.footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  color: var(--muted) !important;
  font-size: .84rem;
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: only light !important; }
  html, body, body.theme-light {
    background: var(--bg) !important;
    background-color: var(--bg) !important;
    color: var(--ink) !important;
  }
  .page-hero, .panel, .kpi, .topbar, .table-wrap, table, th, td, .filters, .chip, .empty {
    background: #ffffff !important;
    color: var(--ink) !important;
  }
  .kpi-accent {
    background: var(--accent) !important;
    color: #ffffff !important;
  }
}

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters-report { grid-template-columns: 1fr; }
  .pack-preview { grid-template-columns: 1fr; }
  .page-hero { grid-template-columns: 1fr; }
  .hero-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .cel-duo.is-duo { grid-template-columns: 1fr; }
}

/* —— Login —— */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(900px 420px at 12% -10%, var(--accent-soft) 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 10%, var(--accent-2-soft) 0%, transparent 50%),
    var(--bg) !important;
}

.login-shell {
  width: min(440px, 100%);
}

.login-panel {
  background: #ffffff !important;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.75rem 1.6rem 1.8rem;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: .85rem;
  align-items: center;
  margin-bottom: 1.35rem;
}

.login-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink) !important;
}

.login-brand small {
  color: var(--muted) !important;
  font-size: .8rem;
}

.login-panel h1 {
  margin: 0 0 .35rem;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--ink) !important;
}

.login-lead {
  margin: 0 0 1.2rem;
  color: var(--muted) !important;
  font-size: .92rem;
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: .9rem;
}

.login-form label {
  display: grid;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted) !important;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .72rem .85rem;
  font: inherit;
  color: var(--ink) !important;
  background: #f7faf8 !important;
}

.login-form input:focus {
  outline: 2px solid var(--accent)55;
  border-color: var(--accent);
  background: #ffffff !important;
}

.login-form .btn {
  width: 100%;
  margin-top: .25rem;
  justify-content: center;
}

.email-form { display: grid; gap: 1.1rem; }
.email-form label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted) !important;
}
.email-form input[type="email"],
.email-form input[type="tel"],
.email-form input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .6rem .75rem;
  font: inherit;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink) !important;
  background: #ffffff !important;
}
.email-form input[type="email"]:focus,
.email-form input[type="tel"]:focus,
.email-form input[type="text"]:focus {
  outline: 2px solid var(--accent-muted);
  border-color: var(--accent);
}
.contato-par {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1rem;
}
.contato-card {
  background: var(--surface-soft) !important;
  border: 1px solid #e1ebe5;
  border-radius: 14px;
  padding: .9rem 1rem;
  margin-bottom: .75rem;
}
.contato-card:last-child { margin-bottom: 0; }
.contato-card strong {
  display: block;
  margin-bottom: .7rem;
  font-family: var(--display);
  color: var(--ink) !important;
}
.email-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1rem;
}
.contato-status {
  margin: 0;
  font-weight: 600;
  font-size: .9rem;
}
.contato-status.contato-ok { color: var(--accent) !important; }
.contato-status.contato-erro { color: var(--danger) !important; }

.contatos-import {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem 1rem;
  align-items: flex-end;
}
.contatos-upload {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted) !important;
  flex: 1;
  min-width: 220px;
}
.contatos-upload input[type="file"] {
  font: inherit;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink) !important;
}
.contatos-help { margin-top: 1rem; }
.contatos-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent) !important;
  margin-bottom: .75rem;
}
.contatos-scroll { overflow-x: auto; }
.contatos-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.contatos-tabela th,
.contatos-tabela td {
  padding: .55rem .65rem;
  border-bottom: 1px solid #e1ebe5;
  text-align: left;
  vertical-align: top;
}
.contatos-tabela th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted) !important;
}
.contatos-tabela--help code {
  font-size: .82rem;
  white-space: nowrap;
}

.email-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .email-grid { grid-template-columns: 1fr; }
  .contato-par { grid-template-columns: 1fr; }
}

.qr-box {
  margin: 1rem 0;
  padding: 1rem;
  display: inline-block;
  background: #fff !important;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.qr-box img {
  display: block;
  width: min(280px, 100%);
  height: auto;
}

.btn-whatsapp {
  background: #1fa855 !important;
  color: #ffffff !important;
}
.btn-whatsapp:hover { filter: brightness(0.95); }

.user-chip {
  display: inline-flex;
  align-items: center;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  font-size: .8rem;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.color-ok { color: var(--ok) !important; }
.color-alerta { color: var(--danger) !important; }
.text-accent { color: var(--accent) !important; }
.text-accent-dark { color: var(--accent-dark) !important; }
.val-prof { font-weight: 800; color: var(--accent) !important; }
.val-prof-lg { font-size: 1.8rem; font-weight: 800; color: var(--accent) !important; line-height: 1.1; }
.val-prof-md { font-size: 1.6rem; font-weight: 800; color: var(--accent) !important; line-height: 1.1; }
.label-kpi { font-size: .65rem; color: var(--muted) !important; }
.label-kpi-md { font-size: .7rem; color: var(--muted) !important; }
.kpis-dois-ciclos {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: stretch;
  gap: .75rem 1rem;
  width: 100%;
  margin-top: .55rem;
}
.analise-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  margin-bottom: .8rem;
  width: 100%;
}
.kpis-ciclo-bloco {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .7rem .9rem;
  background: #fff;
  border: 1px solid #dce8e1;
  border-radius: 10px;
  min-width: 0;
  width: 100%;
}
.kpis-ciclo-lab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .02em;
}
.kpis-ciclo-vals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem .75rem;
  align-items: end;
  width: 100%;
}
.kpi-item { text-align: center; min-width: 0; }
.kpi-item .kpi-num {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text, #1e3338);
}
.kpi-item .faixa-chip {
  margin-top: .2rem;
  font-size: .62rem;
}
.kpi-variacao {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: .7rem .85rem;
  border: 1px dashed #c9d7cf;
  border-radius: 10px;
  background: #f7fbf8;
  min-width: 7.5rem;
}
.kpi-var {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}
@media (max-width: 720px) {
  .kpis-dois-ciclos {
    grid-template-columns: 1fr;
  }
  .kpi-variacao { min-width: 0; }
}
.summary-link { cursor: pointer; font-weight: 600; font-size: .82rem; color: var(--accent-dark) !important; }
.disc-muted { color: var(--muted) !important; margin-left: .5rem; }

/* ── Gráficos didáticos (Resultados) ── */
.chart-section {
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px dashed #c5d9ce;
}
.chart-section-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.chart-grid.chart-grid-duo {
  grid-template-columns: 1fr 1fr;
  width: 100%;
}
.chart-grid > .bloco-linha {
  grid-column: 1 / -1;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}
.chart-grid > .chart-card {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}
.chart-card-indicadores {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chart-card-padroes {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: none;
}
.chart-padroes-duo {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: .65rem;
  align-items: start;
  justify-items: center;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible;
}
.chart-padroes-duo .padroes-ciclo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  min-width: 0;
  width: 100%;
  max-width: 160px;
}
.chart-padroes-duo .padroes-ciclo-lab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 800;
  color: var(--muted, #5a6f66);
}
.chart-padroes-duo canvas {
  display: block !important;
  box-sizing: border-box;
  width: 128px !important;
  max-width: 128px !important;
  height: 128px !important;
  flex: 0 0 128px;
}
.padroes-legend-mini {
  margin: .2rem 0 0 !important;
  gap: .25rem .55rem !important;
  font-size: .68rem !important;
  justify-content: center;
}
@media (max-width: 800px) {
  .chart-grid,
  .chart-grid.chart-grid-duo { grid-template-columns: 1fr; }
}
.chart-card {
  margin: 0;
  padding: .85rem;
  background: #fff;
  border: 1px solid #dce8e1;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(11, 107, 79, .06);
}
.chart-card-wide {
  grid-column: 1 / -1;
}
.chart-card figcaption {
  margin-bottom: .6rem;
  font-size: .85rem;
  line-height: 1.35;
}
.chart-card figcaption strong {
  display: block;
  color: var(--ink);
}
.chart-hint {
  display: block;
  font-size: .72rem;
  color: #64748b;
  font-weight: 400;
  margin-top: .15rem;
}
.chart-canvas-wrap {
  position: relative;
  height: 220px;
}
.chart-canvas-wrap.chart-canvas-padroes:not(.chart-padroes-duo) {
  width: 220px;
  max-width: 100%;
  height: 220px;
  margin-left: auto;
  margin-right: auto;
}
.chart-canvas-wrap.chart-canvas-padroes:not(.chart-padroes-duo) canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.chart-canvas-wrap.chart-canvas-indicadores {
  width: 100%;
  flex: 1 1 auto;
  min-height: 260px;
  height: auto;
}
.chart-canvas-wrap.chart-canvas-indicadores canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.padroes-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem .75rem;
  list-style: none;
  margin: .65rem 0 0;
  padding: 0;
  font-size: .78rem;
  color: #475569;
  font-weight: 600;
}
.padroes-legend li {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}
.padroes-legend .swatch {
  width: .65rem;
  height: .65rem;
  border-radius: 2px;
  flex: 0 0 auto;
}
.swatch-ab { background: #e74c3c; }
.swatch-b { background: #f39c12; }
.swatch-def, .tri-def { background: var(--caed-tri-def); }
.swatch-int, .tri-int { background: var(--caed-tri-int); }
.swatch-ade, .tri-ade { background: var(--caed-tri-ade); }
.swatch-hab-1 { background: var(--caed-hab-1); }
.swatch-hab-2 { background: var(--caed-hab-2); }
.swatch-hab-3 { background: var(--caed-hab-3); }
.swatch-hab-4 { background: var(--caed-hab-4); }

.hab-faixa-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.1rem;
  margin: .55rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .72rem;
  color: var(--muted);
}
.hab-faixa-legend li {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.hab-faixa-legend .swatch {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-block;
}

.chart-ciclos-nota {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.chart-ciclos-nota span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.swatch-ciclo-1,
.swatch-ciclo-2 {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  flex: 0 0 auto;
  display: inline-block;
}
.swatch-ciclo-1 { background: var(--ciclo-1); }
.swatch-ciclo-2 { background: var(--ciclo-2); }

.padroes-bar-tri {
  display: flex;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  overflow: hidden;
}
.padroes-bar-tri > span,
.padroes-bar-tri > div {
  display: block;
  height: 100%;
}
.padroes-legend-tri {
  margin-top: 0.65rem;
}
.filters-questoes-hier .vista-dispersao {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}
.filters-questoes-hier .vista-dispersao .btn {
  min-width: 4.5rem;
}
.padroes-legenda-turma {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  margin: -0.35rem 0 0.85rem;
  padding: 0 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted, #5a6f66);
}
.padroes-legenda-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.padroes-legenda-item .swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  display: inline-block;
  flex: 0 0 auto;
}
.padroes-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 10.5rem;
}
.padroes-bar-turma {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  min-width: 100%;
  background: #e8eeea;
}
.padroes-bar-turma .tri-vazio {
  width: 100%;
  background: #e8eeea;
}
.padroes-pcts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.55rem;
}
.padroes-pct {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #334155;
  font-variant-numeric: tabular-nums;
}
.padroes-pct i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  display: inline-block;
}
.padroes-pct-def i { background: var(--caed-tri-def); }
.padroes-pct-int i { background: var(--caed-tri-int); }
.padroes-pct-ade i { background: var(--caed-tri-ade); }
.padroes-leg-mini {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted, #5a6f66);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.panel-niveis-tri .padroes-bar-tri {
  height: 22px;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}
.swatch-p { background: #27ae60; }
.swatch-a { background: #1a7a5a; }
.chart-canvas-tall {
  height: 260px;
}
.chart-canvas-hab {
  height: auto;
  min-height: 220px;
}
.chart-card-hab .chart-canvas-wrap {
  margin-bottom: 0.15rem;
}
.chart-card-hab .hab-faixa-legend {
  justify-content: center;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.chart-canvas-hab canvas {
  width: 100% !important;
  height: 100% !important;
}
#chart-ranking-wrap .chart-canvas-wrap {
  height: min(420px, 80px + var(--rank-count, 10) * 32px);
  min-height: 240px;
}

/* UI web: só Chart.js; fallbacks HTML ficam para PDF/impressão */
body:not(.report-body) .chart-css-print,
body:not(.report-body) .hab-bars-print,
body:not(.report-body) .ranking-bars-print {
  display: none !important;
}
.chart-empty-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}
.chart-empty {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
}
.chart-card-padroes .padroes-legend-tri {
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}
.rank-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr) auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 10px;
}
.rank-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-bar-val {
  font-weight: 700;
  min-width: 2rem;
  text-align: right;
}
.ranking-bars-print {
  margin-top: 6px;
}
.chart-ranking-print .chart-canvas-wrap {
  height: min(420px, 80px + var(--rank-count, 10) * 32px);
}

.faixa-chip {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: .12rem .4rem;
  border-radius: 4px;
  line-height: 1.2;
  vertical-align: middle;
}
.faixa-def { background: #fde8d0; color: #8a4b0a; }
.faixa-int { background: #fff4cc; color: #6b5300; }
.faixa-ade { background: #e8e9fc; color: #3d3f9a; }
.faixa-vazia { background: #eef2f3; color: #6a7c81; }

.chart-canvas-quadro { height: 260px; }
.chart-canvas-quadro-sm { height: 240px; }
.quadro-charts {
  margin-bottom: .85rem;
  grid-template-columns: 1fr;
}
.quadro-legenda {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  margin: 0 0 .85rem;
  font-size: .78rem;
  font-weight: 600;
}
.quadro-oficial { width: 100%; border-collapse: collapse; }
.quadro-oficial th {
  text-align: left;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--line);
}
.quadro-oficial td {
  padding: .65rem .7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  min-width: 16rem;
}
.quadro-etapa {
  font-weight: 700;
  white-space: nowrap;
  width: 8rem;
}
.cel-duo {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
}
.cel-duo.is-duo {
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.cel-oficial {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  padding: .55rem .6rem;
  border-radius: 8px;
  min-height: 100%;
}
.cel-ciclo {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: inherit;
  opacity: .75;
}
.cel-prof {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.cel-faixa { font-size: .75rem; font-weight: 700; }
.cel-meta { font-size: .72rem; color: inherit; opacity: .8; }
.cel-vazia { color: var(--muted); }
.quadro-fonte {
  margin: .55rem 0 0;
  font-size: .75rem;
  color: var(--muted);
}

.matriz-wrap { overflow-x: auto; }
.matriz-oficial { width: 100%; border-collapse: collapse; font-size: .78rem; }
.matriz-oficial th,
.matriz-oficial td {
  padding: .4rem .35rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}
.matriz-oficial th:first-child,
.matriz-oficial td.matriz-nome {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff !important;
  font-weight: 600;
  min-width: 9rem;
}
.matriz-cel { font-variant-numeric: tabular-nums; }
.matriz-cel strong { display: block; font-size: .9rem; }
.matriz-cel small { display: block; font-size: .65rem; font-weight: 700; opacity: .95; }
.matriz-oficial td.matriz-cel.faixa-def {
  background: #fde8d0 !important;
  color: #8a4b0a !important;
}
.matriz-oficial td.matriz-cel.faixa-int {
  background: #fff4cc !important;
  color: #6b5300 !important;
}
.matriz-oficial td.matriz-cel.faixa-ade {
  background: #e8e9fc !important;
  color: #3d3f9a !important;
}
.matriz-oficial td.matriz-cel.faixa-vazia {
  background: #fff !important;
}
.matriz-oficial tbody tr:hover td.matriz-cel.faixa-def,
.matriz-oficial tbody tr.row-link:hover td.matriz-cel.faixa-def { background: #f8d4b0 !important; }
.matriz-oficial tbody tr:hover td.matriz-cel.faixa-int,
.matriz-oficial tbody tr.row-link:hover td.matriz-cel.faixa-int { background: #f5e8a8 !important; }
.matriz-oficial tbody tr:hover td.matriz-cel.faixa-ade,
.matriz-oficial tbody tr.row-link:hover td.matriz-cel.faixa-ade { background: #d9daf8 !important; }

.matriz-cel .mtx-ciclo { display: none; padding: .2rem .15rem; border-radius: 4px; }
.matriz-cel .mtx-ciclo.faixa-def { background: #fde8d0; color: #8a4b0a; }
.matriz-cel .mtx-ciclo.faixa-int { background: #fff4cc; color: #6b5300; }
.matriz-cel .mtx-ciclo.faixa-ade { background: #e8e9fc; color: #3d3f9a; }
.matriz-tabs:has(input[value="1"]:checked) .mtx-c1 { display: block; }
.matriz-tabs:has(input[value="2"]:checked) .mtx-c2 { display: block; }
.matriz-tabs:not(:has(input:checked)) .mtx-c2 { display: block; }

.matriz-tabs { margin-top: .15rem; }
.matriz-tab-bar {
  display: flex;
  gap: .35rem;
  margin-bottom: .65rem;
}
.matriz-tab {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 800;
  padding: .4rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.matriz-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.matriz-tab:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.matriz-panel-c1 { display: block; }
.matriz-panel-c2 { display: none; }
.matriz-tabs:has(input[value="2"]:checked) .matriz-panel-c1 { display: none; }
.matriz-tabs:has(input[value="2"]:checked) .matriz-panel-c2 { display: block; }
.matriz-ciclo-print { display: none; }

.panel-leitura .leitura-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}
@media (max-width: 960px) {
  .panel-leitura .leitura-grid { grid-template-columns: 1fr; }
}
.leitura-card {
  background: var(--surface-2, #f7f8fc);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .85rem 1rem;
}
.leitura-card h3 {
  margin: 0 0 .4rem;
  font-size: .92rem;
}
.leitura-card p { margin: 0 0 .5rem; font-size: .82rem; line-height: 1.45; color: var(--text); }
.leitura-faixas { margin: 0 0 .5rem; padding: 0; list-style: none; }
.leitura-faixas li {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  margin: .28rem 0;
}
.leitura-fonte { font-size: .7rem !important; color: var(--muted) !important; margin: 0 !important; }
.hab-chip, .faixa-chip {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .03em;
  padding: .12rem .4rem;
  border-radius: 999px;
  white-space: nowrap;
}
.hab-baixo { background: #e67e51; color: #fff; }
.hab-medio-baixo { background: #f5b9a0; color: #5a2a18; }
.hab-medio-alto { background: #b0e6e9; color: #0a4a4d; }
.hab-alto { background: #00b5bb; color: #fff; }
.hab-prioridade {
  margin: .7rem 0 .2rem;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff8f4;
}
.hab-prioridade-title {
  margin: 0 0 .45rem;
  font-size: .78rem;
  font-weight: 700;
}
.hab-prioridade-ciclo-lab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0 0 .35rem;
  font-size: .72rem;
  font-weight: 800;
  color: var(--muted, #5a6f66);
}
.hab-prio-tab-bar {
  display: flex;
  gap: .35rem;
  margin: 0 0 .55rem;
  flex-wrap: wrap;
}
.hab-prio-tab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
  padding: .35rem .75rem;
  border-radius: 8px;
  border: 1px solid #ecd9cc;
  background: #fff;
  color: var(--muted, #5a6f66);
}
.hab-prio-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.hab-prio-tab:has(input:checked) {
  background: var(--accent, #0b6b4f);
  border-color: var(--accent, #0b6b4f);
  color: #fff;
}
.hab-prio-tab:has(input:checked) .swatch {
  box-shadow: 0 0 0 1px rgba(255,255,255,.55);
}
.hab-prioridade-tabs .hab-prio-panel-c1 { display: block; }
.hab-prioridade-tabs .hab-prio-panel-c2 { display: none; }
.hab-prioridade-tabs:has(input[value="2"]:checked) .hab-prio-panel-c1 { display: none; }
.hab-prioridade-tabs:has(input[value="2"]:checked) .hab-prio-panel-c2 { display: block; }
.hab-prioridade ul { margin: 0; padding: 0; list-style: none; }
.hab-prioridade li {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  align-items: baseline;
  font-size: .78rem;
  padding: .28rem 0;
  border-top: 1px solid #f0e4dc;
}
.hab-prioridade li:first-of-type { border-top: 0; }
.hab-matriz {
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  color: var(--muted);
}
.hab-prioridade em { font-style: normal; font-weight: 700; margin-left: auto; }
.hab-prioridade .print-only { display: none; }

/* Guia das Avaliações (dev) */
.hab-bar-track {
  height: 10px;
  background: #e7eee9;
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.hab-bar-fill {
  height: 100%;
  max-width: 100%;
  border-radius: 3px;
  background: var(--accent, #0b6b4f);
}
.hab-bar-fill.hab-bar-c1 { background: var(--ciclo-1, #0b8f8a); }
.hab-bar-fill.hab-bar-c2 { background: var(--ciclo-2, #6b5b95); }
.guia-hab-grid,
.guia-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .85rem;
}
.guia-card {
  background: var(--surface-2, #f7f8fc);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .85rem 1rem;
  border-left-width: 5px;
}
/* Faixas oficiais de acerto (portal): Baixo ≤40 · Médio Baixo 41–60 · Médio Alto 61–80 · Alto >80 */
.guia-card.guia-acerto-baixo {
  background: #fff4ef;
  border-color: #f0c4b0;
  border-left-color: #e67e51;
}
.guia-card.guia-acerto-medio-baixo {
  background: #fff8f4;
  border-color: #f5d0c0;
  border-left-color: #f5b9a0;
}
.guia-card.guia-acerto-medio-alto {
  background: #f3fbfc;
  border-color: #b8e4e7;
  border-left-color: #5eb8bd;
}
.guia-card.guia-acerto-alto {
  background: #eefafb;
  border-color: #9adcdf;
  border-left-color: #00b5bb;
}
.guia-card .guia-faixa-chip {
  margin-left: .25rem;
}
.guia-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .45rem;
}
.guia-card-head strong { font-size: .9rem; line-height: 1.3; }
.guia-meta-mini { font-size: .72rem; color: var(--muted); }
.guia-hab-txt {
  margin: 0 0 .55rem;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--text);
}
.guia-acerto-row,
.guia-alt {
  display: grid;
  grid-template-columns: 4.2rem 1fr 3.2rem;
  gap: .4rem;
  align-items: center;
  margin: .28rem 0;
}
.guia-lab,
.guia-alt-lab {
  font-size: .72rem;
  font-weight: 800;
  color: var(--muted);
}
.guia-val {
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 700;
}
.guia-abcd { margin-top: .35rem; }
.guia-alt.is-gabarito .guia-alt-lab { color: var(--accent-dark, #0a5c45); }
.guia-alt.is-gabarito .guia-val { color: var(--accent-dark, #0a5c45); }
.guia-fill-a { background: #5b8def; }
.guia-fill-b { background: #0b8f8a; }
.guia-fill-c { background: #c9a227; }
.guia-fill-d { background: #c45c4a; }
.chip-gabarito {
  background: #e8f6f2;
  color: #0a5c45;
  border: 1px solid #b7e0d4;
}
.chip-muted { opacity: .85; font-family: ui-monospace, monospace; font-size: .7rem; }
.guia-card.is-clickable {
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.guia-card.is-clickable:hover,
.guia-card.is-clickable:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 40, 30, .08);
  outline: 2px solid var(--accent, #0b6b4f);
  outline-offset: 2px;
}
.guia-dispersao-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: min(720px, 96vw);
  width: 100%;
  background: transparent;
}
.guia-dispersao-dialog::backdrop {
  background: rgba(12, 28, 22, .45);
}
.guia-dispersao-sheet {
  margin: 0;
  background: var(--surface, #fff);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 900px);
}
.guia-dispersao-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem .75rem;
  border-bottom: 1px solid var(--line);
}
.guia-dispersao-kicker {
  margin: 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.guia-dispersao-head h2 {
  margin: .15rem 0 0;
  font-size: 1.15rem;
  line-height: 1.25;
}
.guia-dispersao-sub {
  margin: .35rem 0 0;
  font-size: .8rem;
  color: var(--muted);
}
.guia-dispersao-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .65rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft, #f4f7f5);
}
.guia-dispersao-body {
  padding: .75rem 1.15rem 1.1rem;
  overflow: auto;
}
.guia-dispersao-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.guia-dispersao-row {
  display: grid;
  grid-template-columns: minmax(100px, 1.4fr) minmax(120px, 2.4fr) 3.2rem;
  gap: .55rem;
  align-items: center;
}
.guia-dispersao-nome {
  font-size: .78rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guia-dispersao-bar-wrap {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #e7eee9;
  overflow: visible;
}
.guia-dispersao-bar {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}
.guia-dispersao-media {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: #1a2e28;
  opacity: .55;
  pointer-events: none;
}
.guia-dispersao-val {
  font-size: .78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.guia-dispersao-row.is-atual .guia-dispersao-nome {
  font-weight: 800;
  color: var(--accent-dark, #0a5c45);
}
.guia-dispersao-row.is-atual .guia-dispersao-bar-wrap {
  outline: 2px solid var(--accent, #0b6b4f);
  outline-offset: 1px;
}
@media (max-width: 720px) {
  .guia-hab-grid,
  .guia-item-grid { grid-template-columns: 1fr; }
  .guia-dispersao-row {
    grid-template-columns: 1fr 3.2rem;
  }
  .guia-dispersao-bar-wrap { grid-column: 1 / -1; order: 3; }
}

.btn-link-aluno {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent-dark, #0a5c45);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.btn-link-aluno:hover {
  color: var(--accent, #0b6b4f);
}
td.aluno-nome-span {
  vertical-align: middle;
  border-right: 1px solid var(--line, #e2e8f0);
}
.mapa-disc-bloco + .mapa-disc-bloco {
  margin-top: 1.1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line, #e2e8f0);
}
.mapa-disc-titulo {
  margin: 0 0 .55rem;
  font-size: .92rem;
  font-weight: 800;
}
.mapa-aluno-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: min(780px, 96vw);
  width: 100%;
  background: transparent;
}
.mapa-aluno-dialog::backdrop {
  background: rgba(12, 28, 22, .45);
}
.mapa-aluno-sheet {
  margin: 0;
  background: var(--surface, #fff);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 920px);
}
.mapa-aluno-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .9rem .55rem;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.mapa-aluno-kicker {
  margin: 0;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.mapa-aluno-head h2 {
  margin: .1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.2;
}
.mapa-aluno-sub {
  margin: .15rem 0 0;
  font-size: .78rem;
  color: var(--muted);
}
.mapa-aluno-body {
  padding: .55rem .75rem .8rem;
  overflow: auto;
}
.mapa-resumo {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .4rem;
  margin-bottom: .5rem;
}
.mapa-resumo .chip {
  font-size: .72rem;
  padding: .15rem .5rem;
}
.mapa-resumo .chip-alerta {
  background: #fff1e8;
  color: #9a3b1a;
  border-color: #f0c4ae;
}
.mapa-hab-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.mapa-hab-card {
  border: 1px solid #dce8e1;
  border-radius: 8px;
  padding: .45rem .55rem .5rem;
  background: #fff;
}
.mapa-hab-card.is-prio {
  border-color: #f0c4ae;
  background: #fffaf7;
}
.mapa-hab-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .45rem .55rem;
  align-items: start;
  margin-bottom: .35rem;
}
.mapa-hab-cod {
  display: inline-flex;
  flex-direction: column;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.1;
  min-width: 3.2rem;
}
.mapa-hab-cod small {
  font-size: .62rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: .1rem;
}
.mapa-hab-txt {
  margin: 0;
  font-size: .78rem;
  line-height: 1.3;
  color: #1e3338;
}
.mapa-delta {
  font-size: .75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: .05rem;
}
.mapa-delta.is-up { color: var(--ok, #1a7a5a); }
.mapa-delta.is-down { color: var(--alerta, #b45309); }
.mapa-delta.is-neutro { color: var(--muted); }
.mapa-ciclos {
  display: flex;
  flex-direction: column;
  gap: .22rem;
}
.mapa-ciclo-line {
  display: grid;
  grid-template-columns: 3.4rem auto auto minmax(4rem, 1fr);
  gap: .35rem .45rem;
  align-items: center;
}
.mapa-ciclo-lab {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--muted);
}
.mapa-ciclo-line .hab-chip {
  font-size: .65rem;
  padding: .08rem .35rem;
  justify-self: start;
}
.mapa-ciclo-num {
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mapa-ciclo-num strong {
  font-size: .82rem;
}
.mapa-ciclo-track {
  height: 7px;
  min-width: 0;
}
@media (max-width: 560px) {
  .mapa-hab-main {
    grid-template-columns: auto 1fr;
  }
  .mapa-hab-main .mapa-delta {
    grid-column: 2;
    justify-self: end;
  }
  .mapa-ciclo-line {
    grid-template-columns: 3.2rem 1fr;
    grid-template-areas:
      "lab chip"
      "num bar";
  }
  .mapa-ciclo-lab { grid-area: lab; }
  .mapa-ciclo-line .hab-chip { grid-area: chip; justify-self: end; }
  .mapa-ciclo-num { grid-area: num; }
  .mapa-ciclo-track { grid-area: bar; }
}

