/* Reestructura visual final: pantalla completa, menu integrado y lectura tranquila. */
:root {
  --app-sidebar-width: clamp(188px, 14vw, 218px);
  --app-page-gap: clamp(16px, 2vw, 28px);
  --app-surface: #ffffff;
  --app-stage: #eef4fb;
  --app-line: #d9e6f5;
  --app-ink: #17324d;
  --app-muted: #63758a;
  --app-blue: #145fca;
  --app-blue-dark: #0b3f7a;
  --app-blue-soft: #eaf4ff;
  --app-green: #16a34a;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.is-authenticated,
body.visual-modern.is-authenticated {
  background: var(--app-stage) !important;
  color: var(--app-ink) !important;
}

body.is-authenticated *,
body.visual-modern.is-authenticated * {
  box-sizing: border-box;
}

body.is-authenticated .app-shell,
body.visual-modern.is-authenticated .app-shell {
  display: block !important;
  min-height: 100dvh !important;
  padding-top: 0 !important;
}

@media screen and (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: var(--app-sidebar-width) !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    padding: 9px 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: linear-gradient(180deg, var(--app-blue-dark), var(--app-blue) 70%, #0ea5e9) !important;
    box-shadow: 8px 0 26px rgba(11, 63, 122, .18) !important;
    overflow: hidden !important;
    z-index: 50 !important;
  }

  body.is-authenticated .brand-row,
  body.visual-modern.is-authenticated .brand-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  body.is-authenticated .brand,
  body.visual-modern.is-authenticated .brand {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 7px !important;
    align-items: center !important;
    min-width: 0 !important;
    padding: 7px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .12) !important;
  }

  body.is-authenticated .logo,
  body.visual-modern.is-authenticated .logo {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: .9rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.is-authenticated .brand p,
  body.visual-modern.is-authenticated .brand p {
    display: none !important;
  }

  body.is-authenticated .active-module-card,
  body.is-authenticated .topbar-search,
  body.visual-modern.is-authenticated .active-module-card,
  body.visual-modern.is-authenticated .topbar-search {
    display: none !important;
  }

  body.is-authenticated .actions,
  body.visual-modern.is-authenticated .actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 3px !important;
    padding: 2px 0 0 !important;
    background: transparent !important;
  }

  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control,
  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn {
    width: 100% !important;
    min-height: 30px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, .16) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    box-shadow: none !important;
  }

  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 70px !important;
    gap: 5px !important;
    align-items: center !important;
    padding: 3px 6px !important;
    font-size: .66rem !important;
  }

  body.is-authenticated .year-control select,
  body.visual-modern.is-authenticated .year-control select {
    width: 70px !important;
    min-width: 0 !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 6px !important;
    border-radius: 8px !important;
    font-size: .76rem !important;
  }

  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn {
    justify-content: flex-start !important;
    gap: 6px !important;
    padding: 0 8px !important;
    font-size: .7rem !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    padding: 5px 3px 8px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
  }

  body.is-authenticated .nav-group-label,
  body.visual-modern.is-authenticated .nav-group-label {
    margin: 6px 8px 2px !important;
    color: rgba(255, 255, 255, .72) !important;
    font-size: .56rem !important;
    letter-spacing: .02em !important;
  }

  body.is-authenticated .nav-item,
  body.visual-modern.is-authenticated .nav-item {
    min-height: 31px !important;
    display: grid !important;
    grid-template-columns: 26px minmax(0, 1fr) !important;
    gap: 7px !important;
    align-items: center !important;
    padding: 3px 7px !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    background: transparent !important;
  }

  body.is-authenticated .nav-item.active,
  body.visual-modern.is-authenticated .nav-item.active {
    background: rgba(255, 255, 255, .18) !important;
  }

  body.is-authenticated .nav-item i,
  body.visual-modern.is-authenticated .nav-item i {
    width: 26px !important;
    height: 26px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, .18) !important;
  }

  body.is-authenticated .nav-item span,
  body.visual-modern.is-authenticated .nav-item span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: .7rem !important;
  }

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    margin-left: var(--app-sidebar-width) !important;
    margin-right: 0 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 100dvh !important;
    padding: var(--app-page-gap) !important;
    background: linear-gradient(180deg, #f6f9fd 0%, var(--app-stage) 100%) !important;
    overflow-x: hidden !important;
  }

  body.is-authenticated .module,
  body.visual-modern.is-authenticated .module,
  body.is-authenticated .module.active,
  body.visual-modern.is-authenticated .module.active {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    min-width: 0 !important;
  }

  body.is-authenticated .module.active > *,
  body.visual-modern.is-authenticated .module.active > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.is-authenticated .module-head.module-hero,
  body.visual-modern.is-authenticated .module-head.module-hero {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px) !important;
    gap: 14px !important;
    align-items: center !important;
    padding: 18px 22px !important;
    margin: 0 0 14px !important;
    border: 1px solid rgba(20, 95, 202, .14) !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, var(--app-blue-dark), var(--app-blue)) !important;
    box-shadow: 0 10px 24px rgba(20, 95, 202, .16) !important;
    overflow: hidden !important;
  }

  body.is-authenticated .module-hero-content,
  body.visual-modern.is-authenticated .module-hero-content {
    min-width: 0 !important;
    min-height: 0 !important;
    display: block !important;
  }

  body.is-authenticated .module-hero-content h1,
  body.visual-modern.is-authenticated .module-hero-content h1 {
    margin: 0 0 7px !important;
    color: #ffffff !important;
    font-size: clamp(1.35rem, 2vw, 1.75rem) !important;
    line-height: 1.1 !important;
  }

  body.is-authenticated .module-badge,
  body.visual-modern.is-authenticated .module-badge {
    width: fit-content !important;
    padding: 4px 9px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .16) !important;
    color: #ffffff !important;
    font-size: .74rem !important;
  }

  body.is-authenticated .module-hero-content p,
  body.visual-modern.is-authenticated .module-hero-content p {
    height: auto !important;
    max-width: 100% !important;
    margin: 8px 0 0 !important;
    color: rgba(255, 255, 255, .94) !important;
    white-space: normal !important;
    overflow: visible !important;
    font-size: .86rem !important;
    line-height: 1.35 !important;
  }

  body.is-authenticated .module-hero-actions,
  body.visual-modern.is-authenticated .module-hero-actions {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    align-content: center !important;
  }

  body.is-authenticated .module-hero-actions button,
  body.visual-modern.is-authenticated .module-hero-actions button {
    width: 100% !important;
    min-width: 0 !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    justify-content: center !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    box-shadow: none !important;
  }
}

body.is-authenticated .card,
body.visual-modern.is-authenticated .card,
body.is-authenticated .table-wrap,
body.visual-modern.is-authenticated .table-wrap,
body.is-authenticated .course-context,
body.visual-modern.is-authenticated .course-context {
  border: 1px solid var(--app-line) !important;
  border-radius: 10px !important;
  background: var(--app-surface) !important;
  box-shadow: 0 8px 20px rgba(23, 50, 77, .06) !important;
}

body.is-authenticated .card,
body.visual-modern.is-authenticated .card {
  padding: 16px !important;
  margin-bottom: 14px !important;
}

body.is-authenticated .list-card-head,
body.visual-modern.is-authenticated .list-card-head {
  gap: 10px !important;
  margin-bottom: 12px !important;
}

body.is-authenticated .smart-table,
body.visual-modern.is-authenticated .smart-table,
body.is-authenticated .table-wrap,
body.visual-modern.is-authenticated .table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.is-authenticated .table-wrap,
body.visual-modern.is-authenticated .table-wrap {
  overflow-x: auto !important;
  overflow-y: visible !important;
}

body.is-authenticated .table-tools,
body.visual-modern.is-authenticated .table-tools {
  display: grid !important;
  grid-template-columns: minmax(240px, 380px) auto !important;
  gap: 10px !important;
  align-items: center !important;
  padding: 0 0 12px !important;
}

body.is-authenticated .search-field,
body.visual-modern.is-authenticated .search-field {
  max-width: 100% !important;
}

body.is-authenticated table,
body.visual-modern.is-authenticated table {
  width: 100% !important;
}

body.is-authenticated th,
body.is-authenticated td,
body.visual-modern.is-authenticated th,
body.visual-modern.is-authenticated td {
  padding: 10px 12px !important;
  line-height: 1.25 !important;
}

body.is-authenticated th,
body.visual-modern.is-authenticated th {
  color: #0f3d78 !important;
  background: var(--app-blue-soft) !important;
  font-size: .76rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body.is-authenticated td,
body.visual-modern.is-authenticated td {
  font-size: .84rem !important;
  color: var(--app-ink) !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated .table-sort,
body.visual-modern.is-authenticated .table-sort {
  width: 100% !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  color: inherit !important;
}

body.is-authenticated #module-profesores .professors-card table,
body.visual-modern.is-authenticated #module-profesores .professors-card table {
  min-width: 0 !important;
  table-layout: fixed !important;
}

body.is-authenticated #module-profesores .professors-card th:nth-child(1),
body.is-authenticated #module-profesores .professors-card td:nth-child(1),
body.visual-modern.is-authenticated #module-profesores .professors-card th:nth-child(1),
body.visual-modern.is-authenticated #module-profesores .professors-card td:nth-child(1) {
  width: 31% !important;
}

body.is-authenticated #module-profesores .professors-card th:nth-child(2),
body.is-authenticated #module-profesores .professors-card td:nth-child(2),
body.visual-modern.is-authenticated #module-profesores .professors-card th:nth-child(2),
body.visual-modern.is-authenticated #module-profesores .professors-card td:nth-child(2) {
  width: 12% !important;
}

body.is-authenticated #module-profesores .professors-card th:nth-child(3),
body.is-authenticated #module-profesores .professors-card td:nth-child(3),
body.visual-modern.is-authenticated #module-profesores .professors-card th:nth-child(3),
body.visual-modern.is-authenticated #module-profesores .professors-card td:nth-child(3) {
  width: 12% !important;
}

body.is-authenticated #module-profesores .professors-card th:nth-child(4),
body.is-authenticated #module-profesores .professors-card td:nth-child(4),
body.visual-modern.is-authenticated #module-profesores .professors-card th:nth-child(4),
body.visual-modern.is-authenticated #module-profesores .professors-card td:nth-child(4) {
  width: 18% !important;
}

body.is-authenticated #module-profesores .professors-card th:nth-child(5),
body.is-authenticated #module-profesores .professors-card td:nth-child(5),
body.visual-modern.is-authenticated #module-profesores .professors-card th:nth-child(5),
body.visual-modern.is-authenticated #module-profesores .professors-card td:nth-child(5) {
  width: 13% !important;
}

body.is-authenticated #module-profesores .professors-card th:nth-child(6),
body.is-authenticated #module-profesores .professors-card td:nth-child(6),
body.visual-modern.is-authenticated #module-profesores .professors-card th:nth-child(6),
body.visual-modern.is-authenticated #module-profesores .professors-card td:nth-child(6) {
  width: 110px !important;
}

body.is-authenticated #module-profesores .staff-icon-actions,
body.visual-modern.is-authenticated #module-profesores .staff-icon-actions {
  width: 100% !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  justify-content: flex-start !important;
  align-items: center !important;
}

body.is-authenticated #module-profesores .icon-only-btn,
body.visual-modern.is-authenticated #module-profesores .icon-only-btn {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 9px !important;
}

body.is-authenticated .btn-primary,
body.visual-modern.is-authenticated .btn-primary {
  background: linear-gradient(135deg, var(--app-green), #15803d) !important;
  color: #ffffff !important;
}

body.is-authenticated .btn-soft,
body.is-authenticated .btn-ghost,
body.visual-modern.is-authenticated .btn-soft,
body.visual-modern.is-authenticated .btn-ghost {
  background: #f8fbff !important;
  color: var(--app-blue-dark) !important;
  border: 1px solid #cfe0f2 !important;
}

@media screen and (max-width: 1180px) and (min-width: 981px) {
  :root {
    --app-sidebar-width: 188px;
    --app-page-gap: 16px;
  }

  body.is-authenticated .module-head.module-hero,
  body.visual-modern.is-authenticated .module-head.module-hero {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated .module-hero-actions,
  body.visual-modern.is-authenticated .module-hero-actions {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  }
}

@media screen and (max-width: 980px) {
  body.is-authenticated .app-shell,
  body.visual-modern.is-authenticated .app-shell {
    padding-top: var(--topbar-height) !important;
  }

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    width: 100% !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    padding: clamp(12px, 4vw, 18px) !important;
    overflow-x: hidden !important;
  }

  body.is-authenticated .module-head.module-hero,
  body.visual-modern.is-authenticated .module-head.module-hero {
    grid-template-columns: 1fr !important;
    border-radius: 12px !important;
    padding: 16px !important;
  }

  body.is-authenticated .module-hero-actions,
  body.visual-modern.is-authenticated .module-hero-actions {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated .table-tools,
  body.visual-modern.is-authenticated .table-tools {
    grid-template-columns: 1fr !important;
  }
}

/* Ajuste solicitado: Calibri global, menu 11px e inicio mas sobrio. */
body,
button,
input,
select,
textarea {
  font-family: Calibri, "Segoe UI", Arial, sans-serif !important;
}

@media screen and (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar,
  body.is-authenticated .topbar button,
  body.is-authenticated .topbar select,
  body.is-authenticated .topbar label,
  body.visual-modern.is-authenticated .topbar button,
  body.visual-modern.is-authenticated .topbar select,
  body.visual-modern.is-authenticated .topbar label {
    font-family: Calibri, "Segoe UI", Arial, sans-serif !important;
    font-size: 11px !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1,
  body.is-authenticated .nav-item span,
  body.visual-modern.is-authenticated .nav-item span,
  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn,
  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control {
    font-size: 11px !important;
  }

  body.is-authenticated .nav-group-label,
  body.visual-modern.is-authenticated .nav-group-label {
    font-size: 10px !important;
    margin: 5px 8px 2px !important;
  }
}

body.is-authenticated #module-inicio .dashboard-home,
body.visual-modern.is-authenticated #module-inicio .dashboard-home {
  border-radius: 12px !important;
  background: #ffffff !important;
}

body.is-authenticated #module-inicio .home-header,
body.visual-modern.is-authenticated #module-inicio .home-header {
  min-height: 96px !important;
  display: grid !important;
  grid-template-columns: 78px minmax(0, 1fr) 72px !important;
  gap: 14px !important;
  align-items: center !important;
  padding: 14px 18px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #0b3f7a, #145fca 72%, #3b82f6) !important;
}

body.is-authenticated #module-inicio .home-header .home-corner-logo,
body.visual-modern.is-authenticated #module-inicio .home-header .home-corner-logo {
  position: static !important;
  width: 70px !important;
  height: 70px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: none !important;
  transform: none !important;
}

body.is-authenticated #module-inicio .home-header .home-corner-logo-left,
body.visual-modern.is-authenticated #module-inicio .home-header .home-corner-logo-left {
  grid-column: 1 !important;
  grid-row: 1 / span 3 !important;
}

body.is-authenticated #module-inicio .home-header .home-corner-logo-right,
body.visual-modern.is-authenticated #module-inicio .home-header .home-corner-logo-right {
  grid-column: 3 !important;
  grid-row: 1 / span 3 !important;
  justify-self: end !important;
}

body.is-authenticated #module-inicio .home-header > span,
body.visual-modern.is-authenticated #module-inicio .home-header > span,
body.is-authenticated #module-inicio .home-header > h1,
body.visual-modern.is-authenticated #module-inicio .home-header > h1,
body.is-authenticated #module-inicio .home-header > p,
body.visual-modern.is-authenticated #module-inicio .home-header > p {
  grid-column: 2 !important;
  min-width: 0 !important;
}

body.is-authenticated #module-inicio .home-header > span,
body.visual-modern.is-authenticated #module-inicio .home-header > span {
  width: fit-content !important;
  margin: 0 !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, .9) !important;
  border: 1px solid rgba(255, 255, 255, .28) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .1) !important;
}

body.is-authenticated #module-inicio .home-header h1,
body.visual-modern.is-authenticated #module-inicio .home-header h1 {
  max-width: 100% !important;
  margin: 2px 0 !important;
  color: #ffffff !important;
  font-size: clamp(22px, 2.1vw, 30px) !important;
  line-height: 1.05 !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated #module-inicio .home-header p,
body.visual-modern.is-authenticated #module-inicio .home-header p {
  max-width: 100% !important;
  margin: 0 !important;
  color: rgba(255, 255, 255, .9) !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
}

body.is-authenticated #module-inicio .global-search-panel,
body.is-authenticated #module-inicio .home-grid,
body.is-authenticated #module-inicio .home-section-stack,
body.visual-modern.is-authenticated #module-inicio .global-search-panel,
body.visual-modern.is-authenticated #module-inicio .home-grid,
body.visual-modern.is-authenticated #module-inicio .home-section-stack {
  display: none !important;
}

.sidebar-resize-handle {
  display: none;
}

@media screen and (min-width: 981px) {
  body.is-authenticated .sidebar-resize-handle,
  body.visual-modern.is-authenticated .sidebar-resize-handle {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: var(--app-sidebar-width) !important;
    z-index: 80 !important;
    display: block !important;
    width: 10px !important;
    transform: translateX(-5px) !important;
    cursor: col-resize !important;
    touch-action: none !important;
    background: transparent !important;
  }

  body.is-authenticated .sidebar-resize-handle::before,
  body.visual-modern.is-authenticated .sidebar-resize-handle::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 4px;
    width: 2px;
    background: rgba(255, 255, 255, .22);
    box-shadow: 1px 0 0 rgba(20, 95, 202, .12);
    transition: width .16s ease, background .16s ease, box-shadow .16s ease;
  }

  body.is-authenticated .sidebar-resize-handle:hover::before,
  body.is-authenticated .sidebar-resize-handle:focus-visible::before,
  body.is-authenticated.is-resizing-sidebar .sidebar-resize-handle::before,
  body.visual-modern.is-authenticated .sidebar-resize-handle:hover::before,
  body.visual-modern.is-authenticated .sidebar-resize-handle:focus-visible::before,
  body.visual-modern.is-authenticated.is-resizing-sidebar .sidebar-resize-handle::before {
    width: 4px;
    background: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, .18);
  }

  body.is-resizing-sidebar,
  body.is-resizing-sidebar * {
    cursor: col-resize !important;
    user-select: none !important;
  }
}

@media screen and (max-width: 760px) {
  body.is-authenticated #module-inicio .home-header,
  body.visual-modern.is-authenticated #module-inicio .home-header {
    grid-template-columns: 56px minmax(0, 1fr) !important;
    min-height: 82px !important;
    padding: 12px !important;
  }

  body.is-authenticated #module-inicio .home-header .home-corner-logo,
  body.visual-modern.is-authenticated #module-inicio .home-header .home-corner-logo {
    width: 54px !important;
    height: 54px !important;
  }

  body.is-authenticated #module-inicio .home-header .home-corner-logo-right,
  body.visual-modern.is-authenticated #module-inicio .home-header .home-corner-logo-right {
    display: none !important;
  }

  body.is-authenticated #module-inicio .home-header h1,
  body.visual-modern.is-authenticated #module-inicio .home-header h1 {
    font-size: 21px !important;
  }
}

/* Inicio: metricas compactas en una sola fila y nuevo formato de menu lateral. */
@media screen and (min-width: 981px) {
  body.is-authenticated #module-inicio .portal-metrics,
  body.visual-modern.is-authenticated #module-inicio .portal-metrics {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin: 10px 0 0 !important;
  }

  body.is-authenticated #module-inicio .portal-metrics .metric,
  body.visual-modern.is-authenticated #module-inicio .portal-metrics .metric {
    min-height: 72px !important;
    height: 72px !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) auto !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    border: 1px solid #d7e4f6 !important;
    border-left: 4px solid var(--primary) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: 0 6px 14px rgba(23, 50, 77, .06) !important;
    overflow: hidden !important;
  }

  body.is-authenticated #module-inicio .portal-metrics .metric::before,
  body.visual-modern.is-authenticated #module-inicio .portal-metrics .metric::before {
    display: none !important;
  }

  body.is-authenticated #module-inicio .portal-metrics .metric .metric-icon,
  body.visual-modern.is-authenticated #module-inicio .portal-metrics .metric .metric-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 9px !important;
    font-size: 15px !important;
  }

  body.is-authenticated #module-inicio .portal-metrics .metric span,
  body.visual-modern.is-authenticated #module-inicio .portal-metrics .metric span {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    display: block !important;
    color: #435872 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.12 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.is-authenticated #module-inicio .portal-metrics .metric strong,
  body.visual-modern.is-authenticated #module-inicio .portal-metrics .metric strong {
    grid-column: 3 !important;
    grid-row: 1 !important;
    color: #132238 !important;
    font-size: 26px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    text-align: right !important;
    white-space: nowrap !important;
  }

  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    background: #0b3f7a !important;
    box-shadow: 6px 0 18px rgba(11, 63, 122, .16) !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    gap: 0 !important;
    padding: 6px 4px 10px !important;
  }

  body.is-authenticated .nav-group-label,
  body.visual-modern.is-authenticated .nav-group-label {
    margin: 9px 8px 3px !important;
    padding: 0 0 0 4px !important;
    color: rgba(255, 255, 255, .62) !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
  }

  body.is-authenticated .nav-btn,
  body.visual-modern.is-authenticated .nav-btn {
    width: 100% !important;
    min-height: 30px !important;
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 7px !important;
    align-items: center !important;
    margin: 1px 0 !important;
    padding: 3px 7px !important;
    border: 0 !important;
    border-left: 3px solid transparent !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .88) !important;
    box-shadow: none !important;
    text-align: left !important;
  }

  body.is-authenticated .nav-btn i,
  body.visual-modern.is-authenticated .nav-btn i {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, .1) !important;
    color: rgba(255, 255, 255, .9) !important;
    font-size: 12px !important;
  }

  body.is-authenticated .nav-btn span,
  body.visual-modern.is-authenticated .nav-btn span {
    min-width: 0 !important;
    color: inherit !important;
    font-family: Calibri, "Segoe UI", Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.is-authenticated .nav-btn:hover,
  body.visual-modern.is-authenticated .nav-btn:hover {
    background: rgba(255, 255, 255, .09) !important;
  }

  body.is-authenticated .nav-btn.active,
  body.visual-modern.is-authenticated .nav-btn.active {
    border-left-color: #7dd3fc !important;
    background: rgba(255, 255, 255, .14) !important;
    color: #ffffff !important;
  }

  body.is-authenticated .nav-btn.active i,
  body.visual-modern.is-authenticated .nav-btn.active i {
    background: #ffffff !important;
    color: #0b3f7a !important;
  }
}

@media screen and (min-width: 981px) and (max-width: 1280px) {
  body.is-authenticated #module-inicio .portal-metrics,
  body.visual-modern.is-authenticated #module-inicio .portal-metrics {
    grid-template-columns: repeat(5, minmax(116px, 1fr)) !important;
  }

  body.is-authenticated #module-inicio .portal-metrics .metric {
    padding-inline: 9px !important;
  }

  body.is-authenticated #module-inicio .portal-metrics .metric span,
  body.visual-modern.is-authenticated #module-inicio .portal-metrics .metric span {
    font-size: 11px !important;
  }

  body.is-authenticated #module-inicio .portal-metrics .metric strong,
  body.visual-modern.is-authenticated #module-inicio .portal-metrics .metric strong {
    font-size: 23px !important;
  }
}

/* Alumnos: nomina unica, filtros claros y acciones solo con iconos. */
body.is-authenticated #module-estudiantes .students-card,
body.visual-modern.is-authenticated #module-estudiantes .students-card {
  overflow: hidden !important;
}

body.is-authenticated #module-estudiantes .student-filter-bar,
body.visual-modern.is-authenticated #module-estudiantes .student-filter-bar {
  display: grid !important;
  grid-template-columns: minmax(220px, 390px) minmax(180px, 260px) !important;
  gap: 10px !important;
  align-items: end !important;
  margin: 0 0 12px !important;
}

body.is-authenticated #module-estudiantes .student-course-filter,
body.visual-modern.is-authenticated #module-estudiantes .student-course-filter {
  display: grid !important;
  gap: 4px !important;
  color: #284663 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

body.is-authenticated #module-estudiantes .student-course-filter select,
body.visual-modern.is-authenticated #module-estudiantes .student-course-filter select,
body.is-authenticated #module-estudiantes .student-filter-bar .search-field input,
body.visual-modern.is-authenticated #module-estudiantes .student-filter-bar .search-field input {
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 9px !important;
}

body.is-authenticated #module-estudiantes .students-table,
body.visual-modern.is-authenticated #module-estudiantes .students-table {
  min-width: 0 !important;
  table-layout: fixed !important;
}

body.is-authenticated #module-estudiantes .students-table th:nth-child(1),
body.is-authenticated #module-estudiantes .students-table td:nth-child(1),
body.visual-modern.is-authenticated #module-estudiantes .students-table th:nth-child(1),
body.visual-modern.is-authenticated #module-estudiantes .students-table td:nth-child(1) {
  width: 28% !important;
}

body.is-authenticated #module-estudiantes .students-table th:nth-child(2),
body.is-authenticated #module-estudiantes .students-table td:nth-child(2),
body.visual-modern.is-authenticated #module-estudiantes .students-table th:nth-child(2),
body.visual-modern.is-authenticated #module-estudiantes .students-table td:nth-child(2) {
  width: 14% !important;
}

body.is-authenticated #module-estudiantes .students-table th:nth-child(3),
body.is-authenticated #module-estudiantes .students-table td:nth-child(3),
body.visual-modern.is-authenticated #module-estudiantes .students-table th:nth-child(3),
body.visual-modern.is-authenticated #module-estudiantes .students-table td:nth-child(3) {
  width: 20% !important;
}

body.is-authenticated #module-estudiantes .students-table th:nth-child(4),
body.is-authenticated #module-estudiantes .students-table td:nth-child(4),
body.visual-modern.is-authenticated #module-estudiantes .students-table th:nth-child(4),
body.visual-modern.is-authenticated #module-estudiantes .students-table td:nth-child(4) {
  width: 15% !important;
}

body.is-authenticated #module-estudiantes .students-table th:nth-child(5),
body.is-authenticated #module-estudiantes .students-table td:nth-child(5),
body.visual-modern.is-authenticated #module-estudiantes .students-table th:nth-child(5),
body.visual-modern.is-authenticated #module-estudiantes .students-table td:nth-child(5) {
  width: 178px !important;
}

body.is-authenticated #module-estudiantes .student-icon-actions,
body.visual-modern.is-authenticated #module-estudiantes .student-icon-actions {
  width: 100% !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

body.is-authenticated #module-estudiantes .icon-only-btn,
body.visual-modern.is-authenticated #module-estudiantes .icon-only-btn {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 9px !important;
}

body.is-authenticated #module-estudiantes tr.is-inactive td,
body.visual-modern.is-authenticated #module-estudiantes tr.is-inactive td {
  color: #64748b !important;
  background: #f8fafc !important;
}

body.is-authenticated #module-estudiantes .table-subtext,
body.visual-modern.is-authenticated #module-estudiantes .table-subtext {
  display: block !important;
  margin-top: 2px !important;
  color: #b91c1c !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

@media screen and (max-width: 720px) {
  body.is-authenticated #module-estudiantes .student-filter-bar,
  body.visual-modern.is-authenticated #module-estudiantes .student-filter-bar {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated #module-estudiantes .students-table,
  body.visual-modern.is-authenticated #module-estudiantes .students-table {
    min-width: 680px !important;
  }
}

/* Menu lateral: mayor legibilidad para usuarios con baja vision. */
@media screen and (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    gap: 6px !important;
  }

  body.is-authenticated .brand,
  body.visual-modern.is-authenticated .brand {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    padding: 8px !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    font-size: 14px !important;
    line-height: 1.1 !important;
  }

  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control,
  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn {
    min-height: 36px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  body.is-authenticated .year-control select,
  body.visual-modern.is-authenticated .year-control select {
    height: 28px !important;
    min-height: 28px !important;
    font-size: 13px !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    gap: 2px !important;
    padding: 8px 5px 12px !important;
  }

  body.is-authenticated .nav-group-label,
  body.visual-modern.is-authenticated .nav-group-label {
    margin: 14px 8px 5px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
  }

  body.is-authenticated .nav-btn,
  body.visual-modern.is-authenticated .nav-btn {
    min-height: 42px !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    gap: 9px !important;
    padding: 6px 8px !important;
    border-radius: 9px !important;
  }

  body.is-authenticated .nav-btn i,
  body.visual-modern.is-authenticated .nav-btn i {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
  }

  body.is-authenticated .nav-btn span,
  body.visual-modern.is-authenticated .nav-btn span {
    font-size: 14px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
  }
}

/* Cursos: tabla limpia con columnas esenciales y acciones compactas. */
body.is-authenticated #module-cursos .courses-card,
body.visual-modern.is-authenticated #module-cursos .courses-card {
  overflow: hidden !important;
}

body.is-authenticated #module-cursos .course-search-field,
body.visual-modern.is-authenticated #module-cursos .course-search-field {
  max-width: 420px !important;
  margin: 0 0 12px !important;
}

body.is-authenticated #module-cursos .courses-table,
body.visual-modern.is-authenticated #module-cursos .courses-table {
  min-width: 0 !important;
  table-layout: fixed !important;
}

body.is-authenticated #module-cursos .courses-table th:nth-child(1),
body.is-authenticated #module-cursos .courses-table td:nth-child(1),
body.visual-modern.is-authenticated #module-cursos .courses-table th:nth-child(1),
body.visual-modern.is-authenticated #module-cursos .courses-table td:nth-child(1) {
  width: 18% !important;
}

body.is-authenticated #module-cursos .courses-table th:nth-child(2),
body.is-authenticated #module-cursos .courses-table td:nth-child(2),
body.visual-modern.is-authenticated #module-cursos .courses-table th:nth-child(2),
body.visual-modern.is-authenticated #module-cursos .courses-table td:nth-child(2) {
  width: 15% !important;
}

body.is-authenticated #module-cursos .courses-table th:nth-child(3),
body.is-authenticated #module-cursos .courses-table td:nth-child(3),
body.visual-modern.is-authenticated #module-cursos .courses-table th:nth-child(3),
body.visual-modern.is-authenticated #module-cursos .courses-table td:nth-child(3) {
  width: 20% !important;
}

body.is-authenticated #module-cursos .courses-table th:nth-child(4),
body.is-authenticated #module-cursos .courses-table td:nth-child(4),
body.is-authenticated #module-cursos .courses-table th:nth-child(5),
body.is-authenticated #module-cursos .courses-table td:nth-child(5),
body.visual-modern.is-authenticated #module-cursos .courses-table th:nth-child(4),
body.visual-modern.is-authenticated #module-cursos .courses-table td:nth-child(4),
body.visual-modern.is-authenticated #module-cursos .courses-table th:nth-child(5),
body.visual-modern.is-authenticated #module-cursos .courses-table td:nth-child(5) {
  width: 10% !important;
}

body.is-authenticated #module-cursos .courses-table th:nth-child(6),
body.is-authenticated #module-cursos .courses-table td:nth-child(6),
body.visual-modern.is-authenticated #module-cursos .courses-table th:nth-child(6),
body.visual-modern.is-authenticated #module-cursos .courses-table td:nth-child(6) {
  width: 10% !important;
}

body.is-authenticated #module-cursos .courses-table th:nth-child(7),
body.is-authenticated #module-cursos .courses-table td:nth-child(7),
body.visual-modern.is-authenticated #module-cursos .courses-table th:nth-child(7),
body.visual-modern.is-authenticated #module-cursos .courses-table td:nth-child(7) {
  width: 178px !important;
}

body.is-authenticated #module-cursos .course-icon-actions,
body.visual-modern.is-authenticated #module-cursos .course-icon-actions {
  width: 100% !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

body.is-authenticated #module-cursos .icon-only-btn,
body.visual-modern.is-authenticated #module-cursos .icon-only-btn {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 9px !important;
}

body.is-authenticated .icon-only-btn:disabled,
body.visual-modern.is-authenticated .icon-only-btn:disabled,
body.is-authenticated button:disabled,
body.visual-modern.is-authenticated button:disabled {
  opacity: .42 !important;
  cursor: not-allowed !important;
  filter: grayscale(.35) !important;
  box-shadow: none !important;
}

body.is-authenticated .actions-cell .icon-only-btn:disabled,
body.visual-modern.is-authenticated .actions-cell .icon-only-btn:disabled {
  background: #f1f5f9 !important;
  border-color: #dbe3ee !important;
  color: #64748b !important;
}

@media screen and (max-width: 760px) {
  body.is-authenticated #module-cursos .courses-table,
  body.visual-modern.is-authenticated #module-cursos .courses-table {
    min-width: 820px !important;
  }
}

/* Asistencia: controles pegados a la planilla y marcado circular de un clic. */
body.is-authenticated #module-asistencia .attendance-panel,
body.visual-modern.is-authenticated #module-asistencia .attendance-panel {
  margin-bottom: 8px !important;
}

body.is-authenticated #module-asistencia .attendance-card,
body.visual-modern.is-authenticated #module-asistencia .attendance-card {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}

body.is-authenticated #module-asistencia .layout-insight-wrap,
body.visual-modern.is-authenticated #module-asistencia .layout-insight-wrap {
  margin-top: 0 !important;
}

body.is-authenticated #module-asistencia .attendance-help,
body.visual-modern.is-authenticated #module-asistencia .attendance-help {
  align-items: center !important;
}

body.is-authenticated #module-asistencia .att-cell.empty,
body.visual-modern.is-authenticated #module-asistencia .att-cell.empty {
  background: #ffffff !important;
}

body.is-authenticated #module-asistencia .att-cell.justified,
body.visual-modern.is-authenticated #module-asistencia .att-cell.justified {
  background: #eff6ff !important;
}

body.is-authenticated #module-asistencia .att-toggle,
body.visual-modern.is-authenticated #module-asistencia .att-toggle {
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08) !important;
  cursor: pointer !important;
  line-height: 1 !important;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease !important;
}

body.is-authenticated #module-asistencia .att-toggle i,
body.visual-modern.is-authenticated #module-asistencia .att-toggle i,
body.is-authenticated #module-asistencia .att-toggle span,
body.visual-modern.is-authenticated #module-asistencia .att-toggle span {
  font-size: 12px !important;
  line-height: 1 !important;
}

body.is-authenticated #module-asistencia .att-toggle:hover:not(:disabled),
body.visual-modern.is-authenticated #module-asistencia .att-toggle:hover:not(:disabled) {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .14) !important;
}

body.is-authenticated #module-asistencia .att-toggle:focus-visible,
body.visual-modern.is-authenticated #module-asistencia .att-toggle:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .32) !important;
  outline-offset: 2px !important;
}

body.is-authenticated #module-asistencia .att-toggle.status-P,
body.visual-modern.is-authenticated #module-asistencia .att-toggle.status-P {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #15803d !important;
}

body.is-authenticated #module-asistencia .att-toggle.status-A,
body.visual-modern.is-authenticated #module-asistencia .att-toggle.status-A {
  background: #fee2e2 !important;
  border-color: #fecaca !important;
  color: #b91c1c !important;
}

body.is-authenticated #module-asistencia .att-toggle.status-T,
body.visual-modern.is-authenticated #module-asistencia .att-toggle.status-T {
  background: #fef3c7 !important;
  border-color: #fde68a !important;
  color: #a16207 !important;
}

body.is-authenticated #module-asistencia .att-toggle.status-J,
body.visual-modern.is-authenticated #module-asistencia .att-toggle.status-J {
  background: #dbeafe !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
  font-weight: 800 !important;
}

body.is-authenticated #module-asistencia .att-toggle.status-empty,
body.visual-modern.is-authenticated #module-asistencia .att-toggle.status-empty {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

body.is-authenticated #module-asistencia .att-toggle:disabled,
body.visual-modern.is-authenticated #module-asistencia .att-toggle:disabled {
  opacity: .58 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

body.is-authenticated #module-asistencia .att-lock,
body.visual-modern.is-authenticated #module-asistencia .att-lock {
  z-index: 2 !important;
}

body.is-authenticated #module-asistencia .attendance-grid,
body.visual-modern.is-authenticated #module-asistencia .attendance-grid {
  grid-template-columns: minmax(150px, 180px) repeat(var(--days, 31), minmax(28px, 1fr)) 48px 48px 58px !important;
}

@media screen and (max-width: 1280px) {
  body.is-authenticated #module-asistencia .attendance-grid,
  body.visual-modern.is-authenticated #module-asistencia .attendance-grid {
    grid-template-columns: 150px repeat(var(--days, 31), 30px) 46px 46px 56px !important;
  }
}

@media screen and (max-width: 480px) {
  body.is-authenticated #module-asistencia .attendance-grid,
  body.visual-modern.is-authenticated #module-asistencia .attendance-grid {
    grid-template-columns: 136px repeat(var(--days, 31), 30px) 44px 44px 54px !important;
  }
}
