/* Teacher Control — Portal do Professor — Mobile 1.0
   Ajustes responsivos sem alterar regras de negócio ou banco de dados. */
@media (max-width: 900px){
  html,body{max-width:100%;overflow-x:hidden}
  body.app-page{min-width:0}
  body.app-page .app-content{width:100%!important;max-width:none!important;box-sizing:border-box!important}
  body.app-page .app-welcome{max-width:100%;box-sizing:border-box}
  body.app-page .app-welcome h1{overflow-wrap:anywhere}
  body.app-page input,body.app-page select,body.app-page textarea,body.app-page button{max-width:100%}
}

/* ATIVIDADES */
@media (max-width:700px){
  .activity-toolbar{grid-template-columns:1fr!important;gap:13px!important;align-items:stretch!important}
  .activity-toolbar select{width:100%!important;min-width:0!important;box-sizing:border-box}
  .activity-toolbar button{width:100%!important}
  .tc-activity-form .tc-grid{grid-template-columns:1fr!important}
  .tc-activity-form .tc-full{grid-column:auto!important}
  .tc-activity-row{display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;column-gap:12px!important;row-gap:10px!important;align-items:start!important}
  .tc-activity-row>.activity-icon{grid-column:1!important;grid-row:1!important}
  .tc-activity-row>.tc-activity-main{grid-column:2!important;grid-row:1!important;min-width:0!important}
  .tc-activity-row>.activity-value{display:none!important}
  .tc-activity-row>.tc-activity-actions{grid-column:2!important;grid-row:2!important;width:100%!important;min-width:0!important;margin:0!important;display:flex!important;flex-wrap:wrap!important;justify-content:flex-start!important;gap:8px!important;white-space:normal!important}
  .tc-activity-row>.tc-activity-actions a{white-space:normal!important;text-align:center!important}
  .tc-resource-badges{gap:5px!important}
  .tc-resource-badges span{font-size:10px!important}
}

/* SEQUÊNCIAS */
@media (max-width:800px){
  .seq-grid{grid-template-columns:1fr!important;min-width:0!important}
  .seq-panel,.seq-card{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  .seq-form{min-width:0!important}
  .seq-form label{min-width:0!important}
  .seq-form input,.seq-form textarea,.seq-form select{width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  .seq-item{align-items:flex-start!important;flex-wrap:wrap!important}
  .seq-item-main{min-width:calc(100% - 46px)!important}
  .seq-actions{width:100%!important;justify-content:flex-end!important;flex-wrap:wrap!important}
  .add-row{grid-template-columns:1fr!important;min-width:0!important}
  .progress-panel{overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .progress-table{min-width:520px}
}

/* BIBLIOTECA */
@media (max-width:800px){
  .library-wrap{padding:0 0 40px!important;min-width:0!important}
  .library-wrap h1{font-size:29px!important;line-height:1.12!important}
  .toolbar-row{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  .toolbar-row .search,.toolbar-row select,.toolbar-row .btn{width:100%!important;min-width:0!important;box-sizing:border-box!important}
  .library-tabs{display:grid!important;grid-template-columns:1fr 1fr!important}
  .library-tab{justify-content:center!important}
  .material{grid-template-columns:76px minmax(0,1fr)!important;column-gap:12px!important;row-gap:12px!important;padding:16px!important;align-items:start!important}
  .material .cover-preview{width:76px!important;height:101px!important;max-width:76px!important}
  .material-main{min-width:0!important;overflow-wrap:anywhere!important}
  .material h3{font-size:15px!important;line-height:1.3!important;overflow-wrap:anywhere!important}
  .material .meta{overflow-wrap:anywhere!important;word-break:break-word!important}
  .chips{gap:5px!important}
  .chip{font-size:10px!important;max-width:100%!important;overflow-wrap:anywhere!important}
  .cover-actions{flex-direction:column!important;align-items:stretch!important}
  .cover-actions form,.cover-upload,.remove-cover{width:100%!important;box-sizing:border-box!important}
  .material-actions{grid-column:1/-1!important;width:100%!important;max-width:none!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .material-actions .btn,.material-actions .archive,.material-actions .delete-material{width:100%!important;min-width:0!important}
  .edit-panel,.new-panel{padding:18px!important}
  .grid{grid-template-columns:1fr!important}
  .grid .full{grid-column:auto!important}
}
@media (max-width:430px){
  .library-tabs{grid-template-columns:1fr!important}
  .material{grid-template-columns:66px minmax(0,1fr)!important;column-gap:10px!important}
  .material .cover-preview{width:66px!important;height:88px!important;max-width:66px!important}
  .material-actions{grid-template-columns:1fr!important}
}

/* RELATÓRIOS */
@media (max-width:650px){
  .report-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:12px!important;align-items:stretch!important}
  .report-toolbar form,.report-toolbar select,.report-toolbar button{width:100%!important;min-width:0!important;box-sizing:border-box!important}
  .report-options{grid-template-columns:1fr!important}
  .report-sheet{padding:16px!important;overflow:hidden!important}
  .report-sheet-head{gap:10px!important;align-items:flex-start!important}
  .report-sheet-head h2{font-size:20px!important;line-height:1.2!important}
  .report-summary{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}
  .report-summary div{padding:9px!important;min-width:0!important}
  .report-summary strong{font-size:18px!important}
  .report-summary span{font-size:9px!important}
  .report-table-head{display:none!important}
  .report-table-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:5px 10px!important;padding:13px 8px!important}
  .report-table-row b{grid-column:1/-1!important;font-size:14px!important}
  .report-table-row span{grid-column:1!important;font-size:12px!important;color:#68758a!important}
  .report-table-row strong{grid-column:2!important;grid-row:2!important;text-align:right!important;font-size:15px!important}
  .report-table-row em{grid-column:1/-1!important;font-size:12px!important}
}

/* MINHA CONTA */
@media (max-width:700px){
  .account-grid{grid-template-columns:1fr!important;min-width:0!important}
  .account-card,.account-card.full{grid-column:auto!important;min-width:0!important;box-sizing:border-box!important}
  .account-card{padding:18px!important}
  .account-form input,.account-form button{width:100%!important;box-sizing:border-box!important}
  .usage-line{grid-template-columns:1fr!important}
  .usage-line div{min-width:0!important;overflow:hidden!important}
  .usage-line b{font-size:22px!important;overflow-wrap:anywhere!important}
  .password-grid{grid-template-columns:1fr!important}
  .account-footer{font-size:10px!important}
}

/* DASHBOARD DO PROFESSOR */
@media (max-width:550px){
  .dashboard4 .dash-kpis{grid-template-columns:1fr 1fr!important}
  .dashboard4 .dash-card{min-width:0!important}
  .dashboard4 .class-performance{grid-template-columns:72px minmax(0,1fr) 34px!important}
  .dashboard4 .attention-row{grid-template-columns:36px minmax(0,1fr) 38px!important}
  .dashboard4 .recent-grid>a{min-width:0!important}
  .dashboard4 .quick-actions a{flex:1 1 46%!important;text-align:center!important}
}

/* FORMULÁRIOS / PÁGINAS GENÉRICAS */
@media (max-width:700px){
  .class-actions,.content-actions,.tc-form-actions,.edit-actions{max-width:100%!important;flex-wrap:wrap!important}
  .content-actions{width:100%!important}
  .content-actions .content-action-link,.content-actions button{min-width:0!important}
  .report-table,.report-sheet,.import-preview,.import-box,.export-toolbar,.export-grid,.pricing-app{min-width:0!important;max-width:100%!important}
}
