/* =========================================================
   ALTITUDE V34.4 — CABEÇALHO ÚNICO, AVALIAÇÃO OBRIGATÓRIA
   E CORREÇÕES DE LEGIBILIDADE
   ========================================================= */

:root{
  --alt-navy:#073a61;
  --alt-navy-deep:#052f50;
  --alt-cyan:#13a9bb;
  --alt-cyan-strong:#0e98ab;
  --alt-cyan-soft:#eaf8fb;
  --alt-line:#d5e4ec;
  --alt-text:#0b2f4d;
  --alt-muted:#60758a;
  --alt-danger:#c93645;
  --alt-success:#16875a;
}

/* =========================================================
   CABEÇALHO PÚBLICO ÚNICO
   ========================================================= */
.old-header,.new-header{display:none!important}
.alt-public-header{
  position:sticky;
  top:0;
  z-index:2000;
  width:100%;
  min-height:80px;
  background:#fff;
  border-bottom:1px solid #d8e5ed;
  box-shadow:0 4px 16px rgba(7,58,97,.055);
}
.alt-public-header *{box-sizing:border-box}
.alt-public-header__inner{
  width:min(1180px,calc(100% - 40px));
  min-height:80px;
  margin:0 auto;
  display:grid;
  grid-template-columns:170px minmax(0,1fr) auto;
  align-items:center;
  gap:26px;
}
.alt-public-header__brand{
  display:inline-flex;
  align-items:center;
  width:154px;
  min-width:154px;
  line-height:0;
}
.alt-public-header__brand img{
  display:block;
  width:154px;
  height:auto;
  max-width:none;
  object-fit:contain;
}
.alt-public-header__nav{
  display:flex;
  align-items:stretch;
  justify-content:center;
  align-self:stretch;
  min-width:0;
}
.alt-public-header__nav ul{
  display:flex;
  align-items:stretch;
  justify-content:center;
  gap:18px;
  margin:0;
  padding:0;
  list-style:none;
}
.alt-public-header__nav a{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:80px;
  padding:0 3px;
  color:#087f99;
  font-size:15px;
  font-weight:800;
  line-height:1;
  text-decoration:none;
  white-space:nowrap;
}
.alt-public-header__nav a::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:3px;
  border-radius:3px 3px 0 0;
  background:transparent;
}
.alt-public-header__nav a:hover,
.alt-public-header__nav a:focus-visible,
.alt-public-header__nav a.is-active{
  color:var(--alt-navy);
  outline:none;
}
.alt-public-header__nav a.is-active::after{background:var(--alt-cyan)}
.alt-public-header__actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  white-space:nowrap;
}
.alt-public-header__actions a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:0 18px;
  border:2px solid var(--alt-cyan);
  border-radius:10px;
  font-size:14px;
  font-weight:900;
  line-height:1;
  text-decoration:none;
  white-space:nowrap;
}
.alt-public-header__login{background:#fff;color:var(--alt-cyan-strong)}
.alt-public-header__signup{background:#36aec4;color:#fff;border-color:#36aec4!important}
.alt-public-header__actions a:hover,.alt-public-header__actions a:focus-visible{
  transform:translateY(-1px);
  box-shadow:0 7px 16px rgba(7,58,97,.12);
  outline:none;
}
.alt-public-header__toggle{
  display:none;
  width:42px;
  height:42px;
  padding:0;
  border:1px solid var(--alt-line);
  border-radius:10px;
  background:#fff;
  color:var(--alt-navy);
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.alt-public-header__toggle span,
.alt-public-header__toggle::before,
.alt-public-header__toggle::after{
  content:"";
  display:block;
  width:20px;
  height:2px;
  border-radius:2px;
  background:currentColor;
  transition:.2s ease;
}
.alt-public-header__toggle{gap:4px;flex-direction:column}
.alt-public-header__mobile{
  display:none;
  grid-column:1/-1;
  width:100%;
  padding:0 0 16px;
}
.alt-public-header__mobile[hidden]{display:none!important}
.alt-public-header__mobile nav{
  display:grid;
  gap:6px;
  padding:10px;
  border:1px solid var(--alt-line);
  border-radius:14px;
  background:#fff;
  box-shadow:0 18px 38px rgba(7,58,97,.15);
}
.alt-public-header__mobile a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:0 14px;
  border-radius:9px;
  color:var(--alt-navy);
  font-weight:800;
  text-decoration:none;
}
.alt-public-header__mobile a:hover,.alt-public-header__mobile a.is-active{background:var(--alt-cyan-soft)}

@media(max-width:980px){
  .alt-public-header__inner{grid-template-columns:154px minmax(0,1fr) auto;gap:16px}
  .alt-public-header__nav ul{gap:11px}
  .alt-public-header__nav a{font-size:13px}
  .alt-public-header__actions a{padding:0 13px;font-size:13px}
}
@media(max-width:820px){
  .alt-public-header{min-height:74px}
  .alt-public-header__inner{
    min-height:74px;
    grid-template-columns:minmax(112px,1fr) auto auto;
    gap:9px;
  }
  .alt-public-header__brand,.alt-public-header__brand img{width:145px;min-width:0}
  .alt-public-header__nav{display:none}
  .alt-public-header__toggle{display:flex}
  .alt-public-header__mobile.is-open{display:block}
  .alt-public-header__actions a{min-height:40px;padding:0 13px}
}
@media(max-width:520px){
  .alt-public-header__inner{
    width:calc(100% - 24px);
    grid-template-columns:minmax(105px,1fr) auto;
    gap:8px;
    padding:10px 0;
  }
  .alt-public-header__brand,.alt-public-header__brand img{width:132px}
  .alt-public-header__toggle{grid-column:2;grid-row:1}
  .alt-public-header__actions{
    grid-column:1/-1;
    grid-row:2;
    width:100%;
    justify-content:flex-end;
  }
  .alt-public-header__actions a{min-height:39px;padding:0 16px}
  .alt-public-header__mobile{grid-row:3}
}

/* =========================================================
   AVALIAÇÃO OBRIGATÓRIA APÓS A PROVA
   ========================================================= */
.review-modal[aria-hidden="true"]{display:none!important}
.review-modal[aria-hidden="false"]{
  position:fixed;
  inset:0;
  z-index:5000;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(3,29,48,.72);
  backdrop-filter:blur(5px);
}
.review-modal-card{
  width:min(430px,100%);
  padding:28px 26px 26px;
  border:1px solid var(--alt-line);
  border-radius:20px;
  background:#fff;
  box-shadow:0 28px 70px rgba(3,29,48,.28);
  text-align:center;
}
.review-modal-card .eyebrow{display:block;margin-bottom:8px;color:var(--alt-cyan-strong);font-size:11px;font-weight:900;letter-spacing:.08em;text-transform:none}
.review-modal-card h3{margin:0;color:var(--alt-navy);font-size:24px;line-height:1.25}
.review-modal-card p{margin:9px 0 20px;color:var(--alt-muted);font-size:14px}
.review-star-picker{display:flex;align-items:center;justify-content:center;gap:8px;min-height:62px}
.review-star-picker button{
  width:50px;
  height:50px;
  padding:0;
  border:1px solid #cbdde7;
  border-radius:12px;
  background:#f7fbfd;
  color:#adc1cb;
  font-size:31px;
  line-height:1;
  cursor:pointer;
  transition:.16s ease;
}
.review-star-picker button:hover,.review-star-picker button:focus-visible,.review-star-picker button.selected{
  border-color:#f2b827;
  background:#fff9e9;
  color:#e8aa0b;
  transform:translateY(-2px);
  outline:none;
}
.review-star-picker.is-saving{pointer-events:none;opacity:.62}
.review-success-message{margin-top:16px!important;color:var(--alt-success)!important;font-weight:900!important}
.review-error-message{margin-top:16px!important;color:var(--alt-danger)!important;font-weight:800!important}
@media(max-width:420px){
  .review-modal-card{padding:24px 16px}
  .review-star-picker{gap:5px}
  .review-star-picker button{width:44px;height:46px;font-size:27px}
}

/* =========================================================
   CORREÇÃO DE LEGIBILIDADE DAS TABELAS DA GESTÃO
   ========================================================= */
body:has(.gestor-topbar) table.tabela,
body:has(.gestor-topbar) table.tabela tbody,
body:has(.gestor-topbar) table.tabela thead{max-width:100%!important}
body:has(.gestor-topbar) table.tabela th,
body:has(.gestor-topbar) table.tabela td{
  word-break:normal!important;
  overflow-wrap:normal!important;
  hyphens:none!important;
  white-space:normal!important;
}
body:has(.gestor-topbar) table.tabela td{
  line-height:1.28!important;
}
body:has(.gestor-topbar) table.tabela td strong,
body:has(.gestor-topbar) table.tabela td b,
body:has(.gestor-topbar) table.tabela td span,
body:has(.gestor-topbar) table.tabela td small{
  word-break:normal!important;
  overflow-wrap:normal!important;
  hyphens:none!important;
}

/* Cursos: 3 x 2 com largura real para o texto. */
@media(min-width:801px){
  #tabCursos{table-layout:fixed!important}
  #tabCursos th:nth-child(1),#tabCursos td:nth-child(1){width:6%!important}
  #tabCursos th:nth-child(2),#tabCursos td:nth-child(2){width:27%!important}
  #tabCursos th:nth-child(3),#tabCursos td:nth-child(3){width:16%!important}
  #tabCursos th:nth-child(4),#tabCursos td:nth-child(4){width:7%!important}
  #tabCursos th:nth-child(5),#tabCursos td:nth-child(5){width:8%!important}
  #tabCursos th:nth-child(6),#tabCursos td:nth-child(6){width:36%!important}
  #tabCursos .course-action-cell,
  #tabCursos td:last-child>div{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(96px,1fr))!important;
    gap:7px!important;
    min-width:310px!important;
  }
  #tabCursos .course-action-cell button,
  #tabCursos td:last-child>div button{
    min-width:96px!important;
    min-height:38px!important;
    padding:7px 8px!important;
    font-size:11.5px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
  }
}

/* Alunos: ações empilhadas e nomes com espaço. */
@media(min-width:801px){
  #tabAlunos{table-layout:fixed!important}
  #tabAlunos th:nth-child(1),#tabAlunos td:nth-child(1){width:10%!important}
  #tabAlunos th:nth-child(2),#tabAlunos td:nth-child(2){width:24%!important}
  #tabAlunos th:nth-child(3),#tabAlunos td:nth-child(3){width:23%!important}
  #tabAlunos th:nth-child(4),#tabAlunos td:nth-child(4){width:16%!important}
  #tabAlunos th:nth-child(5),#tabAlunos td:nth-child(5){width:9%!important}
  #tabAlunos th:nth-child(6),#tabAlunos td:nth-child(6){width:18%!important}
  #tabAlunos td.student-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    min-width:150px!important;
    padding:10px 12px!important;
  }
  #tabAlunos td.student-actions button{
    width:100%!important;
    min-width:145px!important;
    min-height:38px!important;
    padding:8px 12px!important;
    font-size:12px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
  }
}

/* Certificados aguardando e processados sem barra horizontal. */
#tabCertificadosGestao,#tabCertificadosProcessados{
  width:100%!important;
  table-layout:fixed!important;
}
@media(min-width:901px){
  #tabCertificadosGestao th:nth-child(1),#tabCertificadosGestao td:nth-child(1),
  #tabCertificadosProcessados th:nth-child(1),#tabCertificadosProcessados td:nth-child(1){width:19%!important}
  #tabCertificadosGestao th:nth-child(2),#tabCertificadosGestao td:nth-child(2),
  #tabCertificadosProcessados th:nth-child(2),#tabCertificadosProcessados td:nth-child(2){width:20%!important}
  #tabCertificadosGestao th:nth-child(3),#tabCertificadosGestao td:nth-child(3),
  #tabCertificadosProcessados th:nth-child(3),#tabCertificadosProcessados td:nth-child(3){width:7%!important}
  #tabCertificadosGestao th:nth-child(4),#tabCertificadosGestao td:nth-child(4),
  #tabCertificadosProcessados th:nth-child(4),#tabCertificadosProcessados td:nth-child(4){width:11%!important}
  #tabCertificadosGestao th:nth-child(5),#tabCertificadosGestao td:nth-child(5),
  #tabCertificadosProcessados th:nth-child(5),#tabCertificadosProcessados td:nth-child(5){width:10%!important}
  #tabCertificadosGestao th:nth-child(6),#tabCertificadosGestao td:nth-child(6),
  #tabCertificadosProcessados th:nth-child(6),#tabCertificadosProcessados td:nth-child(6){width:12%!important}
  #tabCertificadosGestao th:nth-child(7),#tabCertificadosGestao td:nth-child(7),
  #tabCertificadosProcessados th:nth-child(7),#tabCertificadosProcessados td:nth-child(7){width:21%!important}
  .cert-admin-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
    min-width:138px!important;
  }
  .cert-admin-actions button,.cert-admin-actions a{
    width:100%!important;
    min-width:134px!important;
    min-height:35px!important;
    padding:7px 9px!important;
    font-size:11.5px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
  }
}

/* Carteira de horas sem rolagem horizontal. */
#tabCarteirasHorasGestao{width:100%!important;table-layout:fixed!important}
@media(min-width:901px){
  #tabCarteirasHorasGestao th:nth-child(1),#tabCarteirasHorasGestao td:nth-child(1){width:22%!important}
  #tabCarteirasHorasGestao th:nth-child(2),#tabCarteirasHorasGestao td:nth-child(2){width:10%!important;white-space:nowrap!important}
  #tabCarteirasHorasGestao th:nth-child(3),#tabCarteirasHorasGestao td:nth-child(3){width:11%!important}
  #tabCarteirasHorasGestao th:nth-child(4),#tabCarteirasHorasGestao td:nth-child(4){width:11%!important}
  #tabCarteirasHorasGestao th:nth-child(5),#tabCarteirasHorasGestao td:nth-child(5){width:9%!important}
  #tabCarteirasHorasGestao th:nth-child(6),#tabCarteirasHorasGestao td:nth-child(6){width:9%!important}
  #tabCarteirasHorasGestao th:nth-child(7),#tabCarteirasHorasGestao td:nth-child(7){width:11%!important}
  #tabCarteirasHorasGestao th:nth-child(8),#tabCarteirasHorasGestao td:nth-child(8){width:17%!important}
  #tabCarteirasHorasGestao td:nth-child(8) button{width:100%!important;min-width:125px!important;white-space:nowrap!important}
}

/* Chamados: estado vazio e tabela legível. */
#tabChamados{width:100%!important;table-layout:fixed!important}
#tabChamados td[colspan]{
  display:table-cell!important;
  width:auto!important;
  min-height:0!important;
  padding:38px 20px!important;
  text-align:center!important;
  color:var(--alt-muted)!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
}
@media(min-width:901px){
  #tabChamados th:nth-child(1),#tabChamados td:nth-child(1){width:12%!important}
  #tabChamados th:nth-child(2),#tabChamados td:nth-child(2){width:18%!important}
  #tabChamados th:nth-child(3),#tabChamados td:nth-child(3){width:20%!important}
  #tabChamados th:nth-child(4),#tabChamados td:nth-child(4){width:8%!important}
  #tabChamados th:nth-child(5),#tabChamados td:nth-child(5){width:9%!important}
  #tabChamados th:nth-child(6),#tabChamados td:nth-child(6){width:9%!important}
  #tabChamados th:nth-child(7),#tabChamados td:nth-child(7){width:8%!important}
  #tabChamados th:nth-child(8),#tabChamados td:nth-child(8){width:7%!important}
  #tabChamados th:nth-child(9),#tabChamados td:nth-child(9){width:9%!important}
  #tabChamados .ticket-row-actions{display:grid!important;grid-template-columns:1fr!important;gap:6px!important;min-width:108px!important}
  #tabChamados .ticket-row-actions button{min-width:108px!important;white-space:nowrap!important}
}

/* Portais liberados: checkbox pequeno e alinhado. */
#formGestorUsuario .card:has(#acColab){padding:16px!important}
#formGestorUsuario .card:has(#acColab) .grid3{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
  margin-top:12px!important;
}
#formGestorUsuario .card:has(#acColab) label{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  min-height:42px!important;
  margin:0!important;
  padding:9px 11px!important;
  border:1px solid var(--alt-line)!important;
  border-radius:10px!important;
  background:#f8fbfd!important;
  color:var(--alt-text)!important;
  font-weight:700!important;
}
#formGestorUsuario .card:has(#acColab) input[type="checkbox"]{
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  margin:0!important;
  accent-color:var(--alt-cyan)!important;
}
#formGestorUsuario .card:has(#acColab)>div:last-child{margin-top:10px!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}

/* Scroll horizontal não pode ser criado pelos invólucros. */
body:has(.gestor-topbar) .table-card,
body:has(.gestor-topbar) .certificate-admin-table-wrap,
body:has(.gestor-topbar) .card:has(table.tabela){overflow-x:visible!important;max-width:100%!important}

@media(max-width:900px){
  #tabCursos,#tabAlunos,#tabCertificadosGestao,#tabCertificadosProcessados,#tabCarteirasHorasGestao,#tabChamados{table-layout:auto!important}
}

/* Mantém o estilo institucional dos botões. */
body:has(.gestor-topbar) button:not(.modal-close):not(.sidebar-toggle),
body:has(.gestor-topbar) .btn,
body:has(.gestor-topbar) a.button{
  border-radius:10px;
  font-weight:800;
}
