/* ==============================================================
   ALTITUDE V36 — mobile/tablet, catálogo, chamados e ações
   ============================================================== */

/* Login: situação do cadastro após redirecionamento. */
.login-situation{
  margin:0 0 16px;
  padding:12px 14px;
  border:1px solid #cfe5ec;
  border-radius:12px;
  background:#f2fbfd;
  color:#123b55;
  font-size:14px;
  line-height:1.5;
}
.login-situation strong{display:block;margin-bottom:3px;color:#07314f}
.login-situation.is-warning{background:#fffaf0;border-color:#f0dca9;color:#624b11}

/* Portal do aluno: catálogo de novos cursos e filtros. */
.catalog-student-toolbar,.catalog-student-filters{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(180px,260px);
  gap:12px;
  margin:16px 0 20px;
}
.catalog-student-toolbar label,.catalog-student-filters label{display:grid;gap:6px;min-width:0}
.catalog-student-toolbar input,.catalog-student-toolbar select,.catalog-student-filters input,.catalog-student-filters select{width:100%;min-width:0}
.related-course{outline:2px solid rgba(36,180,204,.16);outline-offset:-2px}

/* Cálculo automático de horas do gestor. */
.certificate-hours-heading{align-items:flex-end!important;gap:14px!important}
.certificate-hours-heading .primary-action{flex:0 0 auto}
.hours-auto-notifications{
  display:grid;
  gap:8px;
  margin:0 0 16px;
}
.hours-auto-note{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px 18px;
  padding:12px 14px;
  border:1px solid #dbe7ee;
  border-radius:12px;
  background:#f8fbfd;
  color:#27465b;
}
.hours-auto-note strong{display:block;color:#07314f;margin-bottom:3px}
.hours-auto-note small{color:#61788a;white-space:nowrap}
.hours-auto-note.is-empty{display:block;color:#61788a}

/* Chamados: nunca empilhar letras dentro de células estreitas. */
#tabChamados td,#tabChamados th,#tabChamados button,
.ticket-history-message,.ticket-history-message *{
  word-break:normal!important;
  overflow-wrap:break-word!important;
  hyphens:none!important;
}

/* Tablets também usam navegação lateral móvel. */
@media (max-width:1120px){
  body:has(.gestor-topbar) #gestorSidebar,
  body:has(.gestor-topbar) .sidebar{
    transform:translateX(-105%)!important;
    visibility:visible!important;
  }
  body:has(.gestor-topbar) #gestorSidebar.open,
  body:has(.gestor-topbar) .sidebar.open{transform:translateX(0)!important}
  body:has(.gestor-topbar) .mobile-menu{display:grid!important}
  body:has(.gestor-topbar) .gestor-sidebar-overlay.show{display:block!important}

  /* As tabelas operacionais viram cartões já no tablet. */
  body:has(.gestor-topbar) .responsive-table-shell:has(#tabCursos),
  body:has(.gestor-topbar) .responsive-table-shell:has(#tabCertificadosGestao),
  body:has(.gestor-topbar) .responsive-table-shell:has(#tabCertificadosProcessados),
  body:has(.gestor-topbar) .responsive-table-shell:has(#tabCarteirasHorasGestao),
  body:has(.gestor-topbar) .responsive-table-shell:has(#tabChamados),
  body:has(.gestor-topbar) .responsive-table-shell:has(#tabAlunos){
    overflow:visible!important;
  }
  #tabCursos,#tabCertificadosGestao,#tabCertificadosProcessados,
  #tabCarteirasHorasGestao,#tabChamados,#tabAlunos{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
  }
  #tabCursos colgroup,#tabCertificadosGestao colgroup,#tabCertificadosProcessados colgroup,
  #tabCarteirasHorasGestao colgroup,#tabChamados colgroup,#tabAlunos colgroup,
  #tabCursos thead,#tabCertificadosGestao thead,#tabCertificadosProcessados thead,
  #tabCarteirasHorasGestao thead,#tabChamados thead,#tabAlunos thead{display:none!important}
  #tabCursos tbody,#tabCertificadosGestao tbody,#tabCertificadosProcessados tbody,
  #tabCarteirasHorasGestao tbody,#tabChamados tbody,#tabAlunos tbody{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px!important;
    width:100%!important;
  }
  #tabCursos tr,#tabCertificadosGestao tr,#tabCertificadosProcessados tr,
  #tabCarteirasHorasGestao tr,#tabChamados tr,#tabAlunos tr{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    padding:14px!important;
    border:1px solid #dbe7ee!important;
    border-radius:14px!important;
    background:#fff!important;
    box-shadow:0 5px 18px rgba(7,49,79,.04)!important;
  }
  #tabCursos td,#tabCertificadosGestao td,#tabCertificadosProcessados td,
  #tabCarteirasHorasGestao td,#tabChamados td,#tabAlunos td{
    display:grid!important;
    grid-template-columns:minmax(105px,36%) minmax(0,1fr)!important;
    align-items:start!important;
    gap:9px!important;
    width:100%!important;
    min-width:0!important;
    padding:8px 0!important;
    border:0!important;
    border-bottom:1px solid #edf2f5!important;
    text-align:left!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
  }
  #tabCursos td::before,#tabCertificadosGestao td::before,#tabCertificadosProcessados td::before,
  #tabCarteirasHorasGestao td::before,#tabChamados td::before,#tabAlunos td::before{
    content:attr(data-label)!important;
    display:block!important;
    color:#718696!important;
    font-size:11px!important;
    font-weight:800!important;
    letter-spacing:.03em!important;
    text-transform:uppercase!important;
  }
  #tabCursos td:last-child,#tabCertificadosGestao td:last-child,#tabCertificadosProcessados td:last-child,
  #tabCarteirasHorasGestao td:last-child,#tabChamados td:last-child,#tabAlunos td:last-child{
    display:block!important;
    border-bottom:0!important;
    padding-bottom:0!important;
  }
  #tabCursos td:last-child::before,#tabCertificadosGestao td:last-child::before,#tabCertificadosProcessados td:last-child::before,
  #tabCarteirasHorasGestao td:last-child::before,#tabChamados td:last-child::before,#tabAlunos td:last-child::before{
    margin-bottom:8px!important;
  }
  #tabCursos td[colspan],#tabCertificadosGestao td[colspan],#tabCertificadosProcessados td[colspan],
  #tabCarteirasHorasGestao td[colspan],#tabChamados td[colspan],#tabAlunos td[colspan]{
    display:block!important;
  }
  #tabCursos td[colspan]::before,#tabCertificadosGestao td[colspan]::before,#tabCertificadosProcessados td[colspan]::before,
  #tabCarteirasHorasGestao td[colspan]::before,#tabChamados td[colspan]::before,#tabAlunos td[colspan]::before{display:none!important}

  .course-action-cell,.cert-admin-actions,.ticket-row-actions,.student-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
  }
  .course-action-cell button,.cert-admin-actions button,.ticket-row-actions button,.student-actions button{
    width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    padding:9px 10px!important;
    white-space:normal!important;
    line-height:1.2!important;
    overflow-wrap:break-word!important;
  }
  /* Publicar nunca fica escondido no celular/tablet. */
  .course-action-cell .gc-publish{
    grid-column:1/-1!important;
    grid-row:1!important;
    order:-10!important;
    min-height:48px!important;
    font-weight:900!important;
  }
  .course-action-cell .gc-publish:not(.is-live){
    background:#07314f!important;
    color:#fff!important;
    border-color:#07314f!important;
  }

  .certificate-hours-heading{
    align-items:stretch!important;
    flex-direction:column!important;
  }
  .certificate-hours-heading .primary-action{width:100%!important}
  .hours-auto-note{grid-template-columns:1fr}
  .hours-auto-note small{white-space:normal}
}

@media (max-width:720px){
  #tabCursos tbody,#tabCertificadosGestao tbody,#tabCertificadosProcessados tbody,
  #tabCarteirasHorasGestao tbody,#tabChamados tbody,#tabAlunos tbody{grid-template-columns:1fr!important}
  #tabCursos td,#tabCertificadosGestao td,#tabCertificadosProcessados td,
  #tabCarteirasHorasGestao td,#tabChamados td,#tabAlunos td{
    grid-template-columns:1fr!important;
    gap:3px!important;
  }
  .course-action-cell,.cert-admin-actions,.ticket-row-actions,.student-actions{grid-template-columns:1fr!important}
  .course-action-cell .gc-publish{grid-column:1!important}
  .catalog-student-toolbar,.catalog-student-filters{grid-template-columns:1fr}
}

@media (max-width:1120px){
  #btnBuilderPublishNormal,#latexImportPublish,.builder-publish-button{
    width:100%!important;
    min-height:50px!important;
    white-space:normal!important;
    font-weight:900!important;
  }
}
