/* ==========================================================
   Responsividade global HomeControl / Landing / Área do aluno
   Breakpoints solicitados:
   - Notebook até 1366px
   - Tablet paisagem até 1200px
   - Tablet retrato até 1024px
   - Mobile paisagem até 880px
   - Mobile retrato até 767px
   ========================================================== */

:root{
  --hc-page-x: clamp(14px, 2.2vw, 34px);
  --hc-page-y: clamp(14px, 2.2vw, 30px);
  --hc-gap: clamp(12px, 1.8vw, 24px);
  --hc-radius: clamp(12px, 1.4vw, 18px);
  --hc-text: clamp(14px, .95vw, 16px);
  --hc-small: clamp(11px, .8vw, 13px);
  --hc-title: clamp(24px, 2.1vw, 36px);
  --hc-card-pad: clamp(14px, 1.8vw, 24px);
}

*,*::before,*::after{box-sizing:border-box}
html{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{width:100%;max-width:100%;overflow-x:hidden;font-size:var(--hc-text)}
img,video,svg,canvas,iframe{max-width:100%;height:auto}
input,select,textarea,button{max-width:100%;font:inherit}
button,.btn,a[class*="btn"],.tab,.tabs button{white-space:normal;line-height:1.18}
h1,h2,h3,h4,p,span,strong,small,label,td,th,li,a,button{overflow-wrap:break-word;word-break:normal}
.container,.wrap,.section,.hero-wrap,.nav-shell,.footer,.top,.card,.panel,.box,.modal,.modal-content{max-width:100%}
.grid,.kpis,.analysis,.tabs,.cards,.feature-grid,.subject-grid,.approval-grid,.proof-band,.quiz-options,.checks{min-width:0}
.grid>*,.kpis>*,.analysis>*,.tabs>*,.cards>*,.feature-grid>*,.subject-grid>*,.approval-grid>*,.proof-band>*,.quiz-options>*,.checks>*{min-width:0}
.card,.kpi,.insc-card,.form-card,.radar-card,.subject-card,.feature-card,.approval-card,.quiz-card,.final-cta,.hc-agent-panel,.hc-insc-box,.hc-aluno-box{overflow:hidden}
.table-wrap,.insc-table-wrap,.hc-table-wrap,.body:has(table),.card:has(table){max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
table{max-width:100%}

/* Desktop / notebook até 1366px */
@media (max-width:1366px){
  :root{--hc-page-x:clamp(14px,1.8vw,26px);--hc-gap:clamp(12px,1.4vw,20px);--hc-card-pad:clamp(13px,1.35vw,20px);--hc-title:clamp(23px,1.9vw,32px)}
  .wrap,.container{width:min(100% - 28px,1280px)!important;padding-left:var(--hc-page-x)!important;padding-right:var(--hc-page-x)!important}
  .hero-wrap{gap:clamp(24px,3vw,52px)!important;padding-left:var(--hc-page-x)!important;padding-right:var(--hc-page-x)!important}
  .hero-copy h1,.hero-title-organized{font-size:clamp(42px,4.1vw,58px)!important;line-height:1.04!important;letter-spacing:-.045em!important}
  .hero-copy p,.hero-subtitle-organized{font-size:clamp(15px,1.25vw,18px)!important;line-height:1.45!important}
  .section-title h2,.method-copy h2,.quiz-copy h2,.final-cta h2{font-size:clamp(28px,2.55vw,40px)!important;line-height:1.1!important}
  .top h1{font-size:clamp(22px,2vw,30px)!important}
  .card,.insc-card{border-radius:var(--hc-radius)!important}
  .card .body,.body,.insc-table-wrap{padding:var(--hc-card-pad)!important}
  .kpis,.analysis{gap:var(--hc-gap)!important}
  .kpi strong,.insc-kpi strong{font-size:clamp(20px,2vw,28px)!important}
}

/* Tablet paisagem até 1200px */
@media (max-width:1200px){
  :root{--hc-page-x:20px;--hc-gap:16px;--hc-card-pad:17px;--hc-title:clamp(22px,2.2vw,30px)}
  .hero-wrap,.method-section,.quiz-section,.final-cta{grid-template-columns:1fr!important}
  .hero-wrap{min-height:auto!important;align-items:start!important;text-align:center!important}
  .hero-copy,.hero-left,.hero-text{max-width:920px!important;margin-left:auto!important;margin-right:auto!important;text-align:center!important}
  .hero-actions{justify-content:center!important}
  .hero-visual{margin-left:auto!important;margin-right:auto!important;min-height:auto!important}
  .grid{grid-template-columns:1fr!important}
  .tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .kpis,.analysis,.insc-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .feature-grid,.subject-grid,.approval-grid,.proof-band{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .filter,.insc-filter,.hc-top-actions,.actions{flex-wrap:wrap!important}
  .filter div,.insc-filter div{min-width:min(220px,100%)!important}
  .hc-agent-panel.open{width:min(100%,1120px)!important}
  .hc-agent-list{min-width:0!important}
}

/* Tablet retrato até 1024px */
@media (max-width:1024px){
  :root{--hc-page-x:18px;--hc-gap:14px;--hc-card-pad:15px;--hc-title:clamp(21px,3vw,28px)}
  .nav-shell,.top,.head,.insc-head,.hc-aluno-head{align-items:flex-start!important;gap:12px!important}
  .top,.head,.insc-head,.hc-aluno-head{flex-wrap:wrap!important}
  .top>*,.head>*,.insc-head>*,.hc-aluno-head>*{min-width:0!important}
  .top p,.head p,.insc-head p{font-size:13px!important;line-height:1.35!important}
  .hero-copy h1,.hero-title-organized{font-size:clamp(36px,6vw,50px)!important;line-height:1.05!important}
  .section{padding-top:clamp(42px,6vw,64px)!important;padding-bottom:clamp(42px,6vw,64px)!important}
  .section-title,.method-copy,.quiz-copy{text-align:center!important}
  .tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .tab,.tabs button{min-height:auto!important;padding:11px 12px!important;font-size:13px!important}
  .form-grid,.hc-aluno-grid{grid-template-columns:1fr!important}
  .hc-agent-panel.open{grid-template-columns:1fr!important;height:min(720px,calc(100dvh - 24px))!important}
  .hc-agent-list{max-height:230px!important;border-right:0!important;border-bottom:1px solid #e2e8f0!important}
  .modal,.hc-insc-modal,.hc-aluno-modal{padding:12px!important}
  .modal-content,.hc-insc-box,.hc-aluno-box{width:100%!important;max-width:100%!important;max-height:calc(100dvh - 24px)!important}
}

/* Dispositivo móvel em paisagem até 880px */
@media (max-width:880px){
  :root{--hc-page-x:16px;--hc-gap:12px;--hc-card-pad:14px;--hc-title:clamp(20px,3.4vw,26px)}
  .wrap,.container{width:100%!important;padding-left:var(--hc-page-x)!important;padding-right:var(--hc-page-x)!important}
  .hero-wrap{padding-top:clamp(28px,5vw,48px)!important;padding-bottom:clamp(28px,5vw,48px)!important}
  .hero-copy h1,.hero-title-organized{font-size:clamp(32px,6.6vw,44px)!important;line-height:1.06!important}
  .hero-copy p,.hero-subtitle-organized,.lead{font-size:clamp(14px,2.1vw,16px)!important}
  .feature-grid,.subject-grid,.approval-grid,.proof-band,.quiz-options,.checks,.kpis,.analysis,.insc-kpis{grid-template-columns:1fr!important}
  .tabs{grid-template-columns:1fr!important}
  .filter div,.insc-filter div,.filter input,.insc-filter input,.filter select,.insc-filter select{width:100%!important;min-width:0!important}
  .btn,.primary,.danger,.muted,.top a,.hc-top-actions .btn{width:auto;max-width:100%;justify-content:center;text-align:center}
  .hc-top-actions{width:100%!important;gap:8px!important}
  .hc-top-actions .btn{flex:1 1 170px!important}
  th,td{font-size:12px!important;padding:8px!important}
  .hc-agent-panel{left:10px!important;right:10px!important;width:auto!important;max-width:none!important;bottom:82px!important}
  .hc-chat-panel,#hcChatBox.chat-box{left:10px!important;right:10px!important;width:auto!important;max-width:none!important;bottom:82px!important}
}

/* Dispositivo móvel em retrato até 767px */
@media (max-width:767px){
  :root{--hc-page-x:14px;--hc-gap:10px;--hc-card-pad:13px;--hc-title:clamp(20px,6vw,25px)}
  body{font-size:14px!important}
  input,select,textarea{font-size:16px!important}
  .nav-shell{height:auto!important;min-height:64px!important;padding:10px 14px!important}
  .brand-name{font-size:18px!important;line-height:1.05!important}
  .brand-mark,.hc-brand-mark{width:42px!important;height:42px!important;flex:0 0 42px!important}
  .top{padding:13px!important;border-radius:14px!important}
  .top h1{font-size:clamp(21px,6vw,25px)!important;line-height:1.1!important}
  .top p{font-size:12px!important}
  .hero-wrap{padding:34px 14px!important;gap:22px!important}
  .hero-copy h1,.hero-title-organized{font-size:clamp(31px,9.6vw,42px)!important;line-height:1.07!important;letter-spacing:-.035em!important}
  .hero-copy p,.hero-subtitle-organized{font-size:14px!important;line-height:1.45!important}
  .hero-actions,.actions,.insc-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;width:100%!important}
  .hero-actions .btn-gradient,.hero-actions .btn-ghost,.actions .btn,.insc-actions .btn,.top a,.hc-top-actions .btn{width:100%!important;text-align:center!important;justify-content:center!important}
  .section{padding:42px 14px!important}
  .section-title h2,.method-copy h2,.quiz-copy h2,.final-cta h2{font-size:clamp(25px,7vw,32px)!important;line-height:1.12!important}
  .card,.insc-card,.form-card,.final-cta{border-radius:14px!important}
  .card .body,.body,.insc-table-wrap,.insc-filter,.insc-kpis{padding:13px!important}
  .kpi,.insc-kpi{padding:12px!important}
  .kpi strong,.insc-kpi strong{font-size:22px!important}
  .head,.insc-head{padding:13px!important}
  .head h2,.insc-head h2{font-size:19px!important;line-height:1.15!important}
  .modal,.hc-insc-modal,.hc-aluno-modal{padding:6px!important}
  .modal-content,.hc-insc-box,.hc-aluno-box{height:calc(100dvh - 12px)!important;max-height:calc(100dvh - 12px)!important;border-radius:12px!important}
  .hc-agent-panel.open{height:calc(100dvh - 92px)!important;max-height:calc(100dvh - 92px)!important;border-radius:14px!important}
  .hc-agent-list{max-height:180px!important}
  .hc-chat-fab,.chat-float{right:14px!important;bottom:14px!important;width:58px!important;height:58px!important}
  .hc-chat-panel,#hcChatBox.chat-box{left:8px!important;right:8px!important;bottom:78px!important;max-height:calc(100dvh - 88px)!important;border-radius:14px!important}
  .hc-chat-body,#hcChatBox .chat-body{max-height:calc(100dvh - 260px)!important}
}

/* Celulares muito estreitos */
@media (max-width:420px){
  :root{--hc-page-x:12px;--hc-card-pad:12px}
  .hero-copy h1,.hero-title-organized{font-size:clamp(29px,10.5vw,38px)!important}
  .brand-name{display:none!important}
  .tabs button,.tab{font-size:12px!important;padding:10px!important}
  th,td{font-size:11px!important;padding:7px!important}
}

/* Altura reduzida, comum em notebook/MacBook com zoom alto */
@media (min-width:768px) and (max-height:760px){
  .hero-section{min-height:auto!important}
  .hero-wrap{padding-top:26px!important;padding-bottom:26px!important}
  .hero-copy h1,.hero-title-organized{font-size:clamp(35px,3.7vw,50px)!important;line-height:1.03!important}
  .hero-copy p,.hero-subtitle-organized{font-size:clamp(14px,1.1vw,16px)!important;line-height:1.38!important}
  .top{padding-top:12px!important;padding-bottom:12px!important}
  .wrap{padding-top:14px!important;padding-bottom:14px!important}
  .card .body,.body{padding:14px!important}
}

/* Landscape baixo em celular */
@media (orientation:landscape) and (max-height:560px) and (max-width:880px){
  .hero-wrap{padding-top:18px!important;padding-bottom:18px!important;gap:16px!important}
  .hero-copy h1,.hero-title-organized{font-size:clamp(28px,5vw,38px)!important}
  .section{padding-top:28px!important;padding-bottom:28px!important}
  .hc-chat-panel,#hcChatBox.chat-box,.hc-agent-panel.open{top:8px!important;bottom:8px!important;max-height:calc(100dvh - 16px)!important}
}

/* ==========================================================
   CORREÇÃO: botões Editar/Excluir lado a lado nas tabelas
   Mantém ações de lançamentos financeiros na mesma linha em
   todos os breakpoints, inclusive mobile com rolagem horizontal.
   ========================================================== */
td .actions,
td .table-actions{
  display:inline-flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:6px!important;
  width:auto!important;
  min-width:max-content!important;
  white-space:nowrap!important;
}
td .actions form,
td .table-actions form{
  display:inline-flex!important;
  align-items:center!important;
  margin:0!important;
  padding:0!important;
  width:auto!important;
  min-width:0!important;
}
td .actions .btn,
td .actions button,
td .table-actions .btn,
td .table-actions button{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  min-width:54px!important;
  min-height:0!important;
  padding:7px 10px!important;
  line-height:1.15!important;
  white-space:nowrap!important;
  text-align:center!important;
}
td:last-child,
th:last-child{
  width:150px!important;
  min-width:150px!important;
}
@media (max-width:767px){
  td .actions,
  td .table-actions{
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    width:auto!important;
  }
  td .actions .btn,
  td .actions button,
  td .table-actions .btn,
  td .table-actions button{
    width:auto!important;
    min-width:52px!important;
    padding:7px 9px!important;
    font-size:11px!important;
  }
}
