/* Ajuste global de ajuste y overflow 2026-08-24.
   Capa final: no modifica datos ni funciones, solo presentacion responsive. */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip !important;
}

body.is-authenticated:not(.report-print-body) :is(#appMain, .app-shell, .module, .module > *, section, article, div, form, fieldset, label) {
  min-width: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
}

body.is-authenticated:not(.report-print-body) #appMain {
  width: 100% !important;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

body.is-authenticated:not(.report-print-body) #appMain .module,
body.is-authenticated:not(.report-print-body) #appMain .module.active {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

body.is-authenticated:not(.report-print-body) #appMain .module > * {
  width: min(100%, 1640px) !important;
  max-width: 100% !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.card, .list-card, .list-table-card, .panel-listado, .report-panel, .report-builder, .config-card, .course-context, .subject-summary, .layout-insight-wrap, .monthly-attendance-sheet, .head-teacher-workspace, .utp-panel, .admin-control-center, .command-center, .teacher-dashboard-home, .subject-list-card) {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.grid, .form-grid, .filter-grid, .config-grid, .course-context-main, .course-card-grid, .subject-card-grid, .guardian-main-cards, .guardian-summary, .guardian-data, .utp-alert-subject-grid, .utp-critical-split, .utp-critical-subject-grid) {
  max-width: 100% !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.form-grid, .filter-grid, .config-grid, .report-filter-grid, .users-filter-row, .table-tools, .filters-row, .report-controls, .report-options, .report-massive-options, .utp-analytics-filters, .utp-report-filters, .utp-risk-filter-bar, .achievement-filters, .subject-filter-bar) {
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)) !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.list-card-head, .card-head, .panel-head, .section-head, .toolbar-head, .report-panel-head, .config-section-head, .module-head, .module-hero, .category-panel-head) {
  min-width: 0 !important;
  max-width: 100% !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.list-card-head, .card-head, .panel-head, .section-head, .toolbar-head, .report-panel-head, .config-section-head) {
  flex-wrap: wrap !important;
  overflow: visible !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea, button, .btn-primary, .btn-soft, .btn-ghost, .btn-danger, .icon-btn) {
  max-width: 100% !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(button, .btn-primary, .btn-soft, .btn-ghost, .btn-danger, .icon-btn, .nav-btn) {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(p, small, span, strong, b, dd, dt, li, h1, h2, h3, h4, h5, h6, .table-subtext, .course-title-cell, .subject-title-cell, .student-cell) {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.table-wrap, .smart-table, .permission-table-wrap, .grade-table-wrap, .monthly-attendance-table-wrap, .daily-attendance-table-wrap, .academic-report-table-scroll, .achievement-table-scroll, .usuarios-table-desktop, .guardian-table-wrap, .guardian-official-table, .utp-critical-table-wrap, .ficha-table-wrapper) {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

body.is-authenticated:not(.report-print-body) #appMain table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.students-table, .courses-table, .daily-attendance-table, #gradeSpreadsheet, .utp-critical-table, .guardian-portal table) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: auto !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(th, td) {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  padding: 6px 7px !important;
  line-height: 1.22 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  text-overflow: clip !important;
  vertical-align: top !important;
}

body.is-authenticated:not(.report-print-body) #appMain th {
  font-size: clamp(.68rem, .72vw, .78rem) !important;
}

body.is-authenticated:not(.report-print-body) #appMain td {
  font-size: clamp(.72rem, .74vw, .84rem) !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(td, th) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-width: 0 !important;
  width: 100% !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(td, th) :is(.table-subtext, small) {
  line-height: 1.15 !important;
}

body.is-authenticated:not(.report-print-body) .students-table :is(th,td):first-child,
body.is-authenticated:not(.report-print-body) #gradeSpreadsheet :is(th,td):nth-child(2),
body.is-authenticated:not(.report-print-body) .daily-attendance-table :is(th,td):nth-child(2),
body.is-authenticated:not(.report-print-body) .grade-table-wrap td.student-cell {
  min-width: clamp(150px, 18vw, 230px) !important;
  max-width: clamp(180px, 26vw, 320px) !important;
  white-space: normal !important;
}

body.is-authenticated:not(.report-print-body) #gradeSpreadsheet :is(th,td),
body.is-authenticated:not(.report-print-body) .daily-attendance-table :is(th,td) {
  padding: 5px 6px !important;
}

body.is-authenticated:not(.report-print-body) #gradeSpreadsheet :is(input, select),
body.is-authenticated:not(.report-print-body) .daily-attendance-table :is(input, select) {
  min-width: 46px !important;
  padding-inline: 5px !important;
  text-align: center;
}

@media (max-width: 760px) {
  body.is-authenticated:not(.report-print-body) #appMain {
    padding-inline: 10px !important;
  }

  body.is-authenticated:not(.report-print-body) #appMain :is(.form-grid, .filter-grid, .config-grid, .report-filter-grid, .users-filter-row, .table-tools, .filters-row, .report-controls, .report-options, .report-massive-options, .utp-analytics-filters, .utp-report-filters, .utp-risk-filter-bar, .achievement-filters, .subject-filter-bar) {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated:not(.report-print-body) #appMain :is(.students-table, .courses-table, .daily-attendance-table, #gradeSpreadsheet, .utp-critical-table, .guardian-portal table) {
    min-width: max-content !important;
    max-width: none !important;
  }

  body.is-authenticated:not(.report-print-body) #appMain :is(.students-table, .courses-table, .utp-critical-table, .guardian-portal table) :is(th, td) {
    min-width: 96px !important;
  }

  body.is-authenticated:not(.report-print-body) #gradeSpreadsheet :is(th,td),
  body.is-authenticated:not(.report-print-body) .daily-attendance-table :is(th,td) {
    min-width: 42px !important;
  }

  body.is-authenticated:not(.report-print-body) .students-table :is(th,td):first-child,
  body.is-authenticated:not(.report-print-body) #gradeSpreadsheet :is(th,td):nth-child(2),
  body.is-authenticated:not(.report-print-body) .daily-attendance-table :is(th,td):nth-child(2),
  body.is-authenticated:not(.report-print-body) .grade-table-wrap td.student-cell {
    min-width: 165px !important;
    max-width: 240px !important;
  }
}

@media (max-width: 480px) {
  body.is-authenticated:not(.report-print-body) #appMain {
    padding-inline: 8px !important;
  }

  body.is-authenticated:not(.report-print-body) #appMain :is(.card, .list-card, .list-table-card, .panel-listado, .report-panel, .report-builder, .config-card, .course-context, .subject-summary, .layout-insight-wrap, .monthly-attendance-sheet, .head-teacher-workspace, .utp-panel, .admin-control-center, .command-center, .teacher-dashboard-home, .subject-list-card) {
    padding-inline: 8px !important;
  }

  body.is-authenticated:not(.report-print-body) #appMain :is(th, td) {
    padding: 5px 6px !important;
  }
}


/* Sistema visual compacto y uniforme para todos los apartados. */
body.is-authenticated:not(.report-print-body) #appMain {
  --compact-gap: 8px;
  --compact-pad: 10px;
  --compact-line: #d8e3f0;
  --compact-title: #08295a;
  --compact-muted: #425b78;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.module-head, .module-hero, .category-panel-head) {
  gap: var(--compact-gap) !important;
  align-items: center !important;
}

body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module.active > :is(.module-head, .module-hero, .category-panel-head) {
  grid-template-columns: minmax(190px, .62fr) minmax(180px, .75fr) minmax(260px, auto) !important;
  grid-template-areas: "title session actions" "summary summary summary" !important;
  padding: 7px 10px !important;
}

body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module-compact-summary:empty {
  display: none !important;
}

body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module-compact-title :is(h1, h2) {
  color: #ffffff !important;
  line-height: 1.08 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module-compact-session,
body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module-compact-actions {
  min-width: 0 !important;
  max-width: 100% !important;
  gap: 5px !important;
}

body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module-compact-actions {
  justify-content: flex-end !important;
}

body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module-compact-session {
  justify-content: flex-start !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.card, .list-card, .list-table-card, .panel-listado, .report-panel, .report-builder, .config-card, .course-context, .subject-summary, .layout-insight-wrap, .monthly-attendance-sheet, .head-teacher-workspace, .utp-panel, .admin-control-center, .command-center, .teacher-dashboard-home, .subject-list-card, .staff-dashboard, .professors-card, .config-module-card, .guardian-yellow-card) {
  padding: var(--compact-pad) !important;
  margin-bottom: var(--compact-gap) !important;
  border-radius: 8px !important;
  border-color: var(--compact-line) !important;
  box-shadow: 0 6px 16px rgba(15, 44, 82, .06) !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.card:hover, .course-card:hover, .subject-card:hover, .portal-card:hover, .utp-center-card:hover) {
  transform: none !important;
  box-shadow: 0 8px 18px rgba(15, 44, 82, .08) !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.list-card-head, .card-head, .panel-head, .section-head, .toolbar-head, .report-panel-head, .config-section-head, .professors-card-head) {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-height: 0 !important;
  padding: 7px 8px !important;
  margin-bottom: 8px !important;
  border-radius: 7px !important;
  background: #f6faff !important;
  border: 1px solid #dbe7f4 !important;
  color: var(--compact-title) !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.list-card-head, .card-head, .panel-head, .section-head, .toolbar-head, .report-panel-head, .config-section-head, .professors-card-head) > :first-child {
  min-width: 0 !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.list-card-head, .card-head, .panel-head, .section-head, .toolbar-head, .report-panel-head, .config-section-head, .professors-card-head) :is(h2, h3, h4) {
  margin: 0 !important;
  color: var(--compact-title) !important;
  -webkit-text-fill-color: var(--compact-title) !important;
  font-size: clamp(.92rem, 1vw, 1.05rem) !important;
  line-height: 1.12 !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.list-card-head, .card-head, .panel-head, .section-head, .toolbar-head, .report-panel-head, .config-section-head, .professors-card-head) :is(p, small, span) {
  color: var(--compact-muted) !important;
  -webkit-text-fill-color: var(--compact-muted) !important;
  line-height: 1.18 !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.filter-grid, .table-tools, .filters-row, .mini-toolbar, .report-controls, .report-options, .report-massive-options, .utp-analytics-filters, .utp-report-filters, .utp-risk-filter-bar, .achievement-filters, .subject-filter-bar, .users-filter-row) {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)) !important;
  gap: 7px !important;
  align-items: end !important;
  padding: 8px !important;
  margin-bottom: 8px !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  border: 1px solid #dbe7f4 !important;
}

body.is-authenticated:not(.report-print-body) #appMain .table-tools {
  grid-template-columns: minmax(180px, 1fr) auto !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.form-actions, .module-actions-inline, .module-head-actions, .module-hero-actions, .list-card-actions, .table-actions, .report-actions, .bulk-actions) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(button, .btn-primary, .btn-soft, .btn-ghost, .btn-danger, .icon-btn) {
  min-height: 32px !important;
  padding: 6px 9px !important;
  border-radius: 7px !important;
  font-size: .78rem !important;
  line-height: 1.12 !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.metric, .focus-card, .insight, .layout-insight, .user-role-card, .config-module-card, .portal-card, .utp-center-card, .guardian-main-cards > article, .guardian-summary article) {
  min-height: 0 !important;
  padding: 9px !important;
  border-radius: 8px !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.metric, .focus-card, .insight, .layout-insight) :is(strong, b) {
  color: #102033 !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.grid.four, .metrics-grid, .layout-insight-grid, .users-summary-grid, .config-quick-grid, .portal-metrics, .guardian-summary, .utp-risk-summary-cards, .subject-stats-row) {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)) !important;
  gap: 8px !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.course-card-grid, .subject-card-grid, .portal-card-grid, .config-module-grid, .utp-center-grid, .guardian-main-cards) {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)) !important;
  gap: 8px !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.subject-card, .course-card, .portal-card, .config-module-card, .utp-center-card) {
  min-height: 0 !important;
  padding: 10px !important;
  border-radius: 8px !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.subject-card h4, .course-card h4, .portal-card b, .config-module-card b, .utp-center-card h3) {
  color: var(--compact-title) !important;
  font-size: .95rem !important;
  line-height: 1.15 !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(table) {
  margin: 0 !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(thead th) {
  background: #eaf3ff !important;
  color: #0b345f !important;
  font-weight: 850 !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(tbody tr:nth-child(even) td) {
  background-color: rgba(248, 251, 255, .72) !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(td, th) :is(.pill, .badge, .status, .promotion-status) {
  max-width: 100% !important;
  white-space: normal !important;
}

body.is-authenticated:not(.report-print-body) #appMain :is(.empty-state, td[colspan]) {
  min-height: 0 !important;
  padding: 12px !important;
}

@media (max-width: 980px) {
  body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module.active > :is(.module-head, .module-hero, .category-panel-head) {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "title" "session" "actions" "summary" !important;
  }

  body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module-compact-actions,
  body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .module-compact-session {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }
}

@media (max-width: 620px) {
  body.is-authenticated:not(.report-print-body) #appMain :is(.list-card-head, .card-head, .panel-head, .section-head, .toolbar-head, .report-panel-head, .config-section-head, .professors-card-head) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }

  body.is-authenticated:not(.report-print-body) #appMain :is(.table-tools, .filter-grid, .filters-row, .users-filter-row, .report-controls, .report-options, .report-massive-options, .utp-analytics-filters, .utp-report-filters, .utp-risk-filter-bar, .achievement-filters, .subject-filter-bar) {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated:not(.report-print-body) #appMain :is(.form-actions, .module-actions-inline, .module-head-actions, .module-hero-actions, .list-card-actions, .table-actions, .report-actions, .bulk-actions) {
    justify-content: stretch !important;
  }

  body.is-authenticated:not(.report-print-body) #appMain :is(.form-actions, .module-actions-inline, .module-head-actions, .module-hero-actions, .list-card-actions, .table-actions, .report-actions, .bulk-actions) > :is(button, a, label, select) {
    flex: 1 1 150px !important;
  }
}
