:root {
  --primary: #145fca;
  --primary-dark: #0b3f91;
  --bottom-primary: #145fca;
  --bottom-hover: #2f8af2;
  --bottom-accent: #ffcf21;
  --bottom-bg: #F5F7F9;
  --accent: #ffcf21;
  --bg: #F5F7F9;
  --surface: #ffffff;
  --text: #102033;
  --muted: #58708d;
  --line: #dce6f2;
  --danger: #dc2626;
  --success: #15803d;
  --warning: #b45309;
  --shadow: 0 14px 38px rgba(15, 44, 82, .08);
  --shadow-hover: 0 20px 48px rgba(13, 86, 168, .14);
  --radius: 8px;
  --brand-logo: url("../assets/educaapp-premium-logo.svg");
  --topbar-height: 0px;
  --login-bg: url("../assets/login-el-plumero.webp");
  --watermark-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='220' viewBox='0 0 520 220'%3E%3Ctext x='260' y='122' text-anchor='middle' font-family='Helvetica, Arial, sans-serif' font-size='36' font-weight='400' fill='%230757ad' fill-opacity='.045' transform='rotate(-16 260 110)'%3EnuVez Sistema Escolar%3C/text%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(96, 216, 255, .24), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(244, 211, 94, .16), transparent 28%),
    linear-gradient(180deg, #f8fbff 0, var(--bg) 260px);
  color: var(--text);
  font-family: Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  position: relative;
}

body.is-authenticated::after {
  content: "";
  position: fixed;
  right: clamp(18px, 4vw, 52px);
  bottom: clamp(18px, 4vw, 42px);
  width: clamp(74px, 9vw, 126px);
  aspect-ratio: 1;
  background: var(--brand-logo) center / contain no-repeat;
  opacity: .14;
  pointer-events: none;
  z-index: 0;
  animation: floatCursor 4.8s ease-in-out infinite;
}

@keyframes floatCursor {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

body::before {
  content: "nuVez Sistema Escolar";
  position: fixed;
  inset: 42% auto auto 50%;
  z-index: 0;
  transform: translate(-50%, -50%) rotate(-18deg);
  color: var(--primary-dark);
  opacity: .045;
  font-size: clamp(3rem, 11vw, 9rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: .9;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

body:not(.is-authenticated) .app-shell,
body:not(.is-authenticated) .statusbar { display: none; }
body.is-authenticated .login-screen { display: none; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(4, 42, 83, .78), rgba(8, 120, 230, .46) 54%, rgba(244, 211, 94, .24)),
    var(--login-bg) center / cover no-repeat,
    #f4f6f9;
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(4, 20, 36, .58), rgba(4, 20, 36, .2) 48%, rgba(4, 20, 36, .48)),
    rgba(5, 18, 32, .18);
}
.login-panel {
  width: min(420px, 100%);
  background:
    var(--watermark-bg) center / min(90%, 520px) no-repeat,
    rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .64);
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(3, 18, 34, .28);
  padding: 26px;
  display: grid;
  gap: 16px;
  backdrop-filter: blur(8px);
  animation: loginPanelIn .28s ease both;
  text-align: center;
}
@keyframes loginPanelIn { from { opacity: .15; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.login-badge {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffffff, #eaf8ff);
  color: var(--primary-dark);
  font-size: 1.35rem;
  font-weight: 900;
  overflow: hidden;
  margin-inline: auto;
  box-shadow: 0 14px 30px rgba(13, 122, 255, .18);
}
.login-badge img { width: 86%; height: 86%; object-fit: contain; }
.login-panel h1 { margin: 0; font-size: 1.65rem; color: var(--primary-dark); }
.login-panel p { margin: -8px 0 0; color: var(--muted); }
.login-form { display: grid; gap: 12px; }
.login-form label:has(#loginRole) { display: none !important; }
#loginHelp {
  min-height: 18px;
  color: #b91c1c;
  font-weight: 750;
  text-align: center;
  line-height: 1.3;
}
#loginHelp:empty {
  min-height: 0;
}
.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
}
.password-field input {
  border-radius: var(--radius) 0 0 var(--radius);
}
.password-toggle {
  min-height: 36px;
  width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #eef6ff;
  color: var(--primary-dark);
  box-shadow: none;
}
.login-remember {
  display: inline-flex;
  width: fit-content;
  grid-template-columns: none;
  color: #24415f;
}
.login-remember input { width: auto; min-height: auto; }

button, input, select, textarea { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-field {
  position: relative;
  display: block;
  min-width: 0;
}

.search-field i {
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 1;
  color: #0d7aff;
  pointer-events: none;
  transform: translateY(-50%);
}

.search-field input {
  width: 100%;
  padding-left: 38px;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: var(--radius);
  min-height: 36px;
  padding: 0 13px;
  font-weight: 800;
  font-size: .9rem;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, color .22s ease, border-color .22s ease;
}

button:hover { transform: translateY(-2px); }
button:active { transform: translateY(0) scale(.985); }
button:disabled {
  cursor: not-allowed;
  opacity: .52;
  transform: none;
}
button:focus, input:focus, select:focus, textarea:focus { outline: 3px solid rgba(13, 122, 255, .18); outline-offset: 1px; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  min-height: 36px;
  padding: 8px 10px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:hover, select:hover, textarea:hover { border-color: #b8d6ff; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 122, 255, .08);
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 2px 0 0;
  box-shadow: none;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: none;
}

textarea { min-height: 78px; resize: vertical; }
label { display: grid; gap: 5px; color: #24415f; font-size: .82rem; font-weight: 800; }
small { color: var(--muted); }

.app-shell { min-height: 100vh; display: grid; grid-template-rows: 1fr; padding-top: var(--topbar-height); position: relative; z-index: 1; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(184, 214, 255, .78);
  box-shadow: 0 10px 32px rgba(21, 44, 72, .08);
  backdrop-filter: blur(14px);
}

.brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px clamp(14px, 3vw, 28px);
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand > div:last-child { min-width: 0; }

.logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 5px;
  background: linear-gradient(135deg, #ffffff, #eaf8ff);
  color: var(--primary-dark);
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(13, 122, 255, .16);
  overflow: hidden;
  flex: 0 0 auto;
}

.logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.brand h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.1;
  white-space: normal;
  color: var(--primary-dark);
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
}
.brand p { display: none; }

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  overflow-x: auto;
  min-width: 0;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.actions > * { flex: 0 0 auto; }
.year-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #cfe0f3;
  border-radius: var(--radius);
  background: #f8fbff;
  color: var(--primary-dark);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}
.year-control select {
  width: auto;
  min-width: 78px;
  min-height: 28px;
  padding: 4px 8px;
  border-color: #b8d6ff;
  color: var(--primary-dark);
  font-weight: 900;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-dark { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #172033; }
.btn-soft { background: #e8f1ff; color: var(--primary-dark); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-ghost { background: #eef2f7; color: #334155; }
.btn-primary,
.btn-dark,
.btn-accent,
.btn-soft,
.btn-ghost,
.nav-btn {
  position: relative;
  overflow: hidden;
}
.btn-primary::after,
.btn-dark::after,
.btn-accent::after,
.btn-soft::after,
.btn-ghost::after,
.nav-btn::after {
  content: "";
  position: absolute;
  inset: -35% auto -35% -70%;
  width: 46%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .72), transparent);
  opacity: 0;
  pointer-events: none;
}
.btn-primary:hover::after,
.btn-dark:hover::after,
.btn-accent:hover::after,
.btn-soft:hover::after,
.btn-ghost:hover::after,
.nav-btn:hover::after {
  animation: buttonShine .65s ease;
}
@keyframes buttonShine {
  0% { left: -70%; opacity: 0; }
  18% { opacity: .55; }
  100% { left: 125%; opacity: 0; }
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  box-shadow: 0 8px 18px rgba(13, 122, 255, .08);
}
.icon-btn:hover { background: #dbeeff; box-shadow: 0 12px 24px rgba(13, 122, 255, .13); }
.btn-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.nav-scroll {
  position: static;
  z-index: 35;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100vw;
  padding: 8px clamp(14px, 3vw, 28px) 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(246,250,255,.94));
  border-top: 1px solid rgba(207, 224, 247, .75);
  box-shadow: none;
  scrollbar-width: thin;
}

.nav-btn {
  white-space: nowrap;
  background: rgba(255, 255, 255, .82);
  color: #475569;
  border: 1px solid var(--line);
  min-height: 58px;
  min-width: 92px;
  padding: 7px 12px 8px;
  font-size: .82rem;
  box-shadow: 0 6px 16px rgba(15, 44, 82, .04);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  --nav-color: var(--primary);
  --nav-soft: rgba(13, 122, 255, .12);
}
.nav-btn i {
  width: 30px;
  height: 26px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  color: var(--nav-color);
  background: var(--nav-soft);
  text-align: center;
  font-size: 1.05rem;
  line-height: 1;
  transition: transform .22s ease, background .22s ease, color .22s ease, box-shadow .22s ease;
}
.nav-btn span { line-height: 1.1; font-weight: 800; }

.nav-inicio { --nav-color: #0d7aff; --nav-soft: rgba(13, 122, 255, .13); }
.nav-estudiantes { --nav-color: #0f9f6e; --nav-soft: rgba(15, 159, 110, .14); }
.nav-profesores { --nav-color: #7c3aed; --nav-soft: rgba(124, 58, 237, .14); }
.nav-cursos { --nav-color: #0891b2; --nav-soft: rgba(8, 145, 178, .15); }
.nav-asignaturas { --nav-color: #2563eb; --nav-soft: rgba(37, 99, 235, .13); }
.nav-asistencia { --nav-color: #15803d; --nav-soft: rgba(21, 128, 61, .14); }
.nav-calificaciones { --nav-color: #db2777; --nav-soft: rgba(219, 39, 119, .14); }
.nav-informes { --nav-color: #0b69c7; --nav-soft: rgba(11, 105, 199, .14); }
.nav-historial { --nav-color: #14b8a6; --nav-soft: rgba(20, 184, 166, .15); }
.nav-orientacion { --nav-color: #b45309; --nav-soft: rgba(180, 83, 9, .14); }
.nav-personalidad { --nav-color: #4f46e5; --nav-soft: rgba(79, 70, 229, .14); }
.nav-auditoria { --nav-color: #0f172a; --nav-soft: rgba(15, 23, 42, .13); }
.nav-utp { --nav-color: #0f766e; --nav-soft: rgba(15, 118, 110, .14); }
.nav-configuracion { --nav-color: #475569; --nav-soft: rgba(71, 85, 105, .14); }

.nav-btn.active {
  color: #0f2e4f;
  background: linear-gradient(135deg, rgba(232, 247, 255, .98), rgba(255, 248, 215, .76));
  border-color: color-mix(in srgb, var(--nav-color) 38%, #ffffff);
  box-shadow: 0 10px 22px rgba(13, 122, 255, .12);
}
.nav-btn:hover {
  background: #f7fcff;
  color: #0f2e4f;
  box-shadow: 0 12px 24px rgba(13, 122, 255, .12);
}
.nav-btn:hover i,
.nav-btn.active i {
  transform: translateY(-1px);
  color: #fff;
  background: var(--nav-color);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--nav-color) 28%, transparent);
}
.nav-btn.active:hover { background: linear-gradient(135deg, #e8f7ff, #fff8d7); color: #0f2e4f; }

main { min-width: 0; padding: clamp(14px, 2.5vw, 26px); padding-bottom: 34px; }
.module { display: none; animation: fade .18s ease; }
.module.active { display: block; }
.module > * {
  width: min(100%, 1640px);
  margin-left: auto;
  margin-right: auto;
}
@keyframes fade { from { opacity: .25; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes slideInSoft { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulseClick { 0% { transform: scale(.985); } 70% { transform: scale(1.01); } 100% { transform: scale(1); } }

.module-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(184, 214, 255, .72);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(232, 247, 255, .94), rgba(255, 248, 215, .58)),
    #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  animation: slideInSoft .24s ease both;
}
.module-head::after {
  content: "";
  width: 80px;
  aspect-ratio: 1;
  background: var(--brand-logo) center / contain no-repeat;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  opacity: .08;
  pointer-events: none;
}
.module-head > div { min-width: 0; }

.module-head h2 { margin: 0; font-size: clamp(1.45rem, 2.5vw, 1.9rem); letter-spacing: 0; color: #0b345f; }
.module-head p { margin: 4px 0 0; color: var(--muted); max-width: 840px; overflow-wrap: anywhere; line-height: 1.35; font-size: .92rem; }
.module-meta { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.school-year-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #b8d6ff;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--primary-dark);
  font-size: .78rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.grid { display: grid; gap: 12px; }
.grid > * { min-width: 0; }
.course-layout { align-items: start; }
.course-layout-wide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  width: min(100%, 1640px);
  margin-inline: auto;
}
.subject-layout-wide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  width: min(100%, 1640px);
  margin-inline: auto;
}
.entity-layout-wide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  width: min(100%, 1640px);
  margin-inline: auto;
}
.compact-editor {
  margin-bottom: 2px;
}
.list-table-card {
  min-width: 0;
}
.list-table-card table {
  width: 100%;
}
.list-card-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
}
.list-card-head h3 { margin: 0; }
.list-card-head .form-actions { margin: 0; }
.grid.two { grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(251,253,255,.97)),
    var(--watermark-bg) center / min(82%, 520px) no-repeat,
    var(--surface);
  border: 1px solid rgba(207, 224, 247, .94);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 14px;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease, background .24s ease;
  animation: slideInSoft .28s ease both;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #b8d6ff;
}

.card:active,
.course-card:active,
.focus-card:active,
.nav-btn:active {
  animation: pulseClick .24s ease;
}

.card h3 { margin: 0 0 10px; font-size: 1rem; color: #0f2e4f; }
.compact-card {
  box-shadow: none;
  margin-bottom: 16px;
}
.course-context {
  background: var(--watermark-bg) center / min(82%, 520px) no-repeat, #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: minmax(260px, .8fr) auto;
  gap: 12px;
  align-items: end;
}
.course-context-main {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(160px, 1fr);
  gap: 12px;
  align-items: end;
}
.course-context-meta {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 11px;
  min-height: 56px;
}
.course-context-meta b { display: block; }
.course-context-actions {
  display: flex;
  gap: 8px;
  justify-content: end;
  flex-wrap: wrap;
}
.config-hero {
  display: grid;
  grid-template-columns: minmax(220px, .55fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.course-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.course-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  box-shadow: none;
  display: grid;
  gap: 12px;
}
.course-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}
.course-card-head > div {
  display: flex;
  align-items: start;
  gap: 8px;
  min-width: 0;
}
.course-card h4 { margin: 0; font-size: 1rem; }
.course-card small { display: block; margin-top: 3px; }
.table-subtext {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
}

.list-table-card td > b,
.course-list-card td > b,
.subject-list-card td > b,
.grade-table-wrap td.student-cell b,
.course-title-cell b,
.subject-title-cell {
  font-weight: 500;
}
.course-list-card table {
  min-width: 1240px;
  table-layout: fixed;
}
.course-admin-table th:nth-child(1),
.course-admin-table td:nth-child(1) {
  width: 46px;
  padding-left: 14px;
  padding-right: 6px;
}
.course-admin-table th:nth-child(2),
.course-admin-table td:nth-child(2) {
  width: 188px;
}
.course-admin-table th:nth-child(3),
.course-admin-table td:nth-child(3) {
  width: auto;
}
.course-admin-table th:nth-child(4),
.course-admin-table td:nth-child(4) {
  width: 86px;
  text-align: center;
}
.course-admin-table th:nth-child(5),
.course-admin-table td:nth-child(5) {
  width: 384px;
}
.course-list-card .select-col { width: 46px; }
.course-list-card .course-title-cell { width: 188px; }
.course-list-card .status-col { width: 86px; text-align: center; }
.course-view-table th:nth-child(1),
.course-view-table td:nth-child(1) {
  width: 220px;
}
.course-view-table th:nth-child(2),
.course-view-table td:nth-child(2) {
  width: auto;
}
.course-view-table th:nth-child(3),
.course-view-table td:nth-child(3) {
  width: 100px;
  text-align: center;
}
.course-feature-row {
  display: grid;
  grid-template-columns: 58px 108px minmax(160px, 1fr) 92px 98px;
  gap: 6px;
  align-items: stretch;
}
.course-feature-row span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 5px 6px;
  color: #102033;
  font-weight: 800;
}
.course-feature-row b {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: .62rem;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.course-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.course-meta span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  color: var(--muted);
  min-width: 0;
}
.course-meta b {
  display: block;
  color: #334155;
  font-size: .76rem;
  text-transform: uppercase;
}
.course-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.course-actions button { min-height: 36px; }
.course-list-card td.course-actions {
  display: table-cell;
  white-space: nowrap;
  width: 384px;
}
.course-list-card td.course-actions button {
  min-height: 32px;
  padding: 0 10px;
  margin: 0 3px 0 0;
  font-size: .8rem;
}
.metric { position: relative; overflow: hidden; min-height: 94px; }
.metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--primary); }
.metric strong { display: block; font-size: clamp(1.45rem, 3vw, 2.1rem); letter-spacing: 0; }
.metric span { color: var(--muted); font-weight: 700; }

.institution-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.institution-strip > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  min-width: 0;
}
.institution-strip span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}
.institution-strip b {
  display: block;
  margin-top: 3px;
  color: #102033;
  overflow-wrap: anywhere;
}

.risk-signal-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.risk-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #334155;
  font-size: .82rem;
  font-weight: 900;
}
.risk-chip b {
  min-width: 26px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
}
.risk-chip.green { background: #dcfce7; border-color: #b7efc5; color: var(--success); }
.risk-chip.yellow { background: #fff7cc; border-color: #f5df86; color: #7c5b00; }
.risk-chip.red { background: #fee2e2; border-color: #fecaca; color: var(--danger); }
.risk-chip.blue { background: #e8f1ff; border-color: #cfe0f7; color: var(--primary-dark); }

.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.focus-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  padding: 11px;
}
.focus-card i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f1ff;
  color: var(--primary-dark);
}
.focus-card b { display: block; margin-bottom: 3px; color: #102033; }
.focus-card small { display: block; line-height: 1.35; }
.focus-card.green { border-left-color: var(--success); }
.focus-card.green i { background: #dcfce7; color: var(--success); }
.focus-card.yellow { border-left-color: var(--warning); }
.focus-card.yellow i { background: #fff7cc; color: #7c5b00; }
.focus-card.red { border-left-color: var(--danger); }
.focus-card.red i { background: #fee2e2; color: var(--danger); }

.form-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.course-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}
.student-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}
.course-form .form-actions {
  grid-column: auto;
  align-self: end;
  margin-top: 0;
}
.student-form .form-actions {
  grid-column: auto;
  align-self: end;
  margin-top: 0;
}
.course-form .form-actions button,
.student-form .form-actions button { width: auto; }

@media (min-width: 1200px) {
  .course-form {
    grid-template-columns: minmax(160px, 1fr) 120px minmax(150px, .8fr) minmax(190px, 1.2fr) 120px auto;
  }
  .student-form {
    grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  }
}
.bulk-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.compact-bulk {
  margin: 0 0 8px;
  justify-content: start;
}
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
}
.check-row input, .course-select, .teacher-select { width: auto; }
.teacher-check-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}
.teacher-check-panel legend {
  padding: 0 6px;
  color: #24415f;
  font-weight: 800;
}
.teacher-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 7px 10px;
}
.teacher-check {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #e2ebf5;
  border-radius: 7px;
  background: #fff;
}
.function-fieldset {
  border: 1px solid rgba(20, 95, 202, .18);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}
.function-fieldset legend {
  padding: 0 6px;
  color: #0b3f91;
  font-weight: 900;
}
.function-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px 9px;
}
.function-check {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid rgba(20, 95, 202, .16);
  border-radius: 7px;
  background: #fff;
  color: #17345f;
  font-weight: 750;
}
.function-check input { accent-color: #145fca; }
.mini-toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: .9rem; }
th { background: linear-gradient(180deg, #f8fbff, #eef7ff); color: #24415f; font-size: .76rem; text-transform: uppercase; letter-spacing: .02em; }
tbody tr { transition: background .18s ease; }
tbody tr:hover td { background: #f8fcff; }
tr:last-child td { border-bottom: 0; }
td.actions-cell { white-space: nowrap; }
td.actions-cell button {
  min-height: 30px;
  padding: 0 10px;
  margin: 2px 3px 2px 0;
}
.course-list-card th,
.subject-list-card th,
.list-table-card th {
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: .68rem;
}
.course-list-card td,
.subject-list-card td,
.list-table-card td {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: .82rem;
}
.course-list-card .pill,
.subject-list-card .pill,
.list-table-card .pill {
  min-height: 21px;
  padding: 0 7px;
  font-size: .7rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  background: #eef2f7;
  color: #334155;
}
.pill.blue { background: #e8f1ff; color: var(--primary-dark); }
.pill.yellow { background: #fff7cc; color: #7c5b00; }
.pill.red { background: #fee2e2; color: var(--danger); }
.pill.green { background: #dcfce7; color: var(--success); }

.insight-list { display: grid; gap: 10px; }
.insight { border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 9px 11px; background: #fff; }
.insight.red { border-left-color: var(--danger); background: #fff7f7; }
.insight.yellow { border-left-color: var(--warning); background: #fffdf2; }
.insight.green { border-left-color: var(--success); background: #f7fff9; }
.insight b { display: block; margin-bottom: 3px; }

.subject-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; align-items: stretch; }
.subject-card { border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: 7px; background: #fff; padding: 14px 15px; box-shadow: none; min-height: 188px; display: flex; flex-direction: column; }
.subject-card h4 { margin: 0 0 6px; font-size: 1rem; }
.subject-card small { display: block; line-height: 1.45; }
.subject-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}
.subject-pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
}
.subject-course-panel {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.subject-stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.subject-card-dashboard {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  align-items: stretch;
  padding-top: 10px;
}

.subject-course-card {
  min-height: 210px;
  border-left: 0;
  border-top: 5px solid var(--subject-color, var(--primary));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--subject-color, var(--primary)) 7%, #ffffff), #ffffff 48%);
}

.subject-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.subject-card-select {
  width: auto;
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.subject-card-select input {
  width: 16px;
  min-height: 16px;
}

.subject-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--subject-color, var(--primary));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--subject-color, var(--primary)) 16%, transparent);
}

.subject-card-top .pill {
  margin-left: auto;
}

.subject-course-card h4 {
  margin-bottom: 8px;
  color: #0f253f;
  overflow-wrap: anywhere;
}

.subject-course-card small {
  color: #58708d;
}

.subject-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}

.subject-card-actions button {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: .74rem;
}
.subject-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: -4px 0 16px;
}
.subject-summary > div:first-child,
.subject-summary > button { display: none; }
.subject-workspace {
  display: grid;
  grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: start;
}
.subject-list-card { min-width: 0; }
#module-asignaturas > .course-context,
#module-asignaturas > .subject-summary { display: none; }
.subject-filter-bar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.subject-filter-bar label { width: min(250px, 100%); }
.subject-filter-bar > b {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  color: #102033;
}
.subject-admin-table table {
  min-width: 820px;
  table-layout: fixed;
}
.subject-admin-table th:nth-child(1),
.subject-admin-table td:nth-child(1) { width: 190px; }
.subject-admin-table th:nth-child(2),
.subject-admin-table td:nth-child(2) { width: auto; }
.subject-admin-table th:nth-child(3),
.subject-admin-table td:nth-child(3) { width: 80px; text-align: center; }
.subject-admin-table th:nth-child(4),
.subject-admin-table td:nth-child(4) { width: 222px; }
.subject-title-cell { font-weight: 500; }
.subject-feature-row {
  display: grid;
  grid-template-columns: minmax(124px, 1.4fr) 92px 68px 68px;
  gap: 5px;
}
.subject-feature-row span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 5px 7px;
  color: #102033;
  font-weight: 800;
}
.subject-feature-row b {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: .62rem;
  line-height: 1;
  text-transform: uppercase;
}
.subject-actions button {
  min-height: 27px;
  padding: 0 7px;
  margin: 1px 2px 1px 0;
  font-size: .76rem;
}
.subject-list-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: -2px 0 12px;
  color: var(--muted);
  font-weight: 800;
  flex-wrap: wrap;
}
.subject-list-meta b { color: #102033; }
.subject-name-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: #102033;
}
.subject-name-mark::before {
  content: "";
  width: 8px;
  height: 28px;
  border-radius: 999px;
  background: var(--subject-color, var(--primary));
}
.curriculum-card { margin-bottom: 0; }
.curriculum-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.curriculum-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  padding: 7px 10px;
  font-weight: 800;
  font-size: .84rem;
}

.grade-table-wrap table { min-width: 1180px; }
.grade-table-wrap th { background: #f7faff; color: #24415f; text-align: center; }
.grade-table-wrap td { text-align: center; }
.grade-table-wrap td.student-cell { position: sticky; left: 0; z-index: 1; text-align: left; background: #fff; min-width: 230px; font-weight: 800; }
.grade-input { width: 58px; min-height: 34px; text-align: center; padding: 6px; font-weight: 800; border-radius: 8px; display: inline-block; }
.grade-low { background: #fee2e2 !important; color: var(--danger) !important; }
.grade-mid { background: #fff7cc !important; color: #7c5b00 !important; }
.grade-high { background: #dcfce7 !important; color: var(--success) !important; }

.attendance-grid {
  display: grid;
  grid-template-columns: 210px repeat(var(--days, 31), minmax(42px, 1fr)) 72px 72px 72px 82px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.att-cell {
  min-height: 38px;
  padding: 5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: .86rem;
  position: relative;
}
.att-cell.name { justify-content: start; place-items: center start; position: sticky; left: 0; z-index: 2; background: #fff; font-weight: 400; }
.att-cell.head { position: sticky; top: 0; z-index: 3; background: #f8fafc; font-weight: 400; color: #334155; box-shadow: 0 1px 0 var(--line); }
.att-cell.head.name { left: 0; z-index: 4; }
.day-head { gap: 3px; }
.day-head b { font-size: .78rem; font-weight: 400; }
.day-select-label { display: grid; place-items: center; gap: 1px; cursor: pointer; font-size: .56rem; line-height: 1; }
.day-select { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.day-lock {
  width: auto;
  min-height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: #e8f1ff;
  color: var(--primary-dark);
  font-size: .62rem;
}
.att-cell.total { background: #fbfdff; font-weight: 400; }
.present-total { color: var(--success); }
.absent-total { color: var(--danger); }
.late-total { color: #b45309; }
.percent-total { color: var(--primary-dark); }
.att-cell.weekend { background: #f1f5f9; color: #94a3b8; }
.att-cell.present { background: #f0fdf4; }
.att-cell.absent { background: #fef2f2; }
.att-cell.late { background: #fffbeb; }
.att-cell.justified { background: #eff6ff; }
.att-toggle { width: 32px; min-height: 30px; padding: 2px; border-radius: 8px; background: transparent; color: #334155; }
.att-toggle.status-P { color: #15803d; }
.att-toggle.status-A { color: #dc2626; }
.att-toggle.status-T { color: #b45309; }
.att-toggle.status-J { color: #2563eb; }
.att-toggle:disabled { cursor: not-allowed; opacity: .55; }
.att-input {
  width: 34px;
  min-height: 30px;
  padding: 2px;
  border: 1px solid transparent;
  background: transparent;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
  color: #0f172a;
}
.att-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(13, 122, 255, .14);
}
.att-input:disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }
.att-lock {
  min-height: 24px;
  width: 28px;
  padding: 0;
  margin-top: 0;
  background: #e8f1ff;
  color: var(--primary-dark);
  font-size: .72rem;
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 1;
}

.attendance-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(420px, .65fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='220' viewBox='0 0 520 220'%3E%3Ctext x='260' y='122' text-anchor='middle' font-family='Helvetica, Arial, sans-serif' font-size='36' font-weight='400' fill='%230757ad' fill-opacity='.045' transform='rotate(-16 260 110)'%3EnuVez Sistema Escolar%3C/text%3E%3C/svg%3E") center / min(88%, 520px) no-repeat,
    #fff;
  box-shadow: var(--shadow);
  padding: 12px;
}
.attendance-controls {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(110px, .5fr) minmax(130px, .7fr) minmax(90px, .45fr) auto auto auto;
  gap: 10px;
  align-items: end;
}
.attendance-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.attendance-kpis article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
  box-shadow: none;
  padding: 10px 12px;
}
.attendance-kpis span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 400;
  text-transform: uppercase;
}
.attendance-kpis b {
  display: block;
  margin-top: 3px;
  color: #102033;
  font-size: 1rem;
  font-weight: 400;
}
.attendance-card h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.attendance-help {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 10px;
}
.attendance-help span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  color: #24415f;
  padding: 5px 9px;
  font-size: .78rem;
  font-weight: 400;
}
.attendance-save-state { color: #137a45 !important; background: #f0fdf4 !important; border-color: #bbf7d0 !important; }
.attendance-today { width: auto; min-height: 28px; padding: 5px 10px; border-radius: 999px; font-size: .78rem; }
.attendance-today:disabled { opacity: .5; cursor: not-allowed; }
.attendance-panel label { font-weight: 400; }
.attendance-panel button,
.attendance-grid button { font-weight: 400; }

.bar-chart { display: grid; gap: 10px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr) 54px;
  gap: 10px;
  align-items: center;
  font-size: .9rem;
}
.bar-row span { font-weight: 800; overflow-wrap: anywhere; }
.bar-row div { height: 14px; background: #edf2f7; border-radius: 999px; overflow: hidden; }
.bar-row i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #21a67a); }
.bar-row b { text-align: right; }

.report-paper {
  width: min(100%, 8.5in);
  max-width: 8.5in;
  min-height: 11in;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(11, 52, 95, .045), rgba(255, 255, 255, 0) 150px),
    #fff;
  border: 1px solid #d5dde8;
  border-radius: 6px;
  box-shadow: 0 22px 55px rgba(15, 23, 42, .16);
  padding: .46in .5in .42in;
  position: relative;
  overflow: hidden;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.report-paper + .report-paper {
  margin-top: 18px;
}
.report-secondary-view {
  display: none !important;
}
.report-course-paper { max-width: 8.5in; }
.report-watermark {
  position: absolute;
  inset: 42% auto auto 50%;
  z-index: 0;
  width: 92%;
  transform: translate(-50%, -50%) rotate(-16deg);
  color: var(--primary-dark);
  opacity: .055;
  font-size: clamp(2.2rem, 6.6vw, 4.4rem);
  font-weight: 900;
  line-height: .95;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
  user-select: none;
}
.report-paper::before,
.report-paper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 9px;
  background: linear-gradient(90deg, #0b345f, #1479f6 58%, #d9aa2b);
}
.report-paper::before { top: 0; }
.report-paper::after { bottom: 0; }
.report-dot-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 18px;
  position: relative;
  z-index: 1;
}
.report-dot-row.bottom { margin: 22px 0 0; }
.report-dot-row span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7eb2d2;
}
.report-header {
  display: grid;
  grid-template-columns: 78px 1fr 78px;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid #cbd5e1;
  padding: 4px 0 16px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.report-header h2 {
  margin: 0 0 5px;
  color: #0f172a;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}
.report-header p {
  margin: 0;
  color: #475569;
  font-size: .86rem;
  font-weight: 800;
  text-align: center;
}
.report-logo {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0b345f;
  font-weight: 900;
  overflow: hidden;
}
.report-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.report-title {
  margin: 15px 0 14px;
  padding: 9px 12px;
  border-top: 1px solid #dbe3ee;
  border-bottom: 1px solid #dbe3ee;
  background: #f8fafc;
  text-align: center;
  color: #0b345f;
  font-size: 1.38rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
}
.report-student {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 14px 0;
}
.report-student div {
  border: 1px solid #dbe3ee;
  border-radius: 4px;
  padding: 8px 9px;
  background: #ffffff;
}
.report-student b { display: block; color: #64748b; font-size: .68rem; text-transform: uppercase; }
.report-student span { display: block; margin-top: 3px; color: #0f172a; font-weight: 900; overflow-wrap: anywhere; }
.report-summary-line {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.report-summary-line div {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  padding: 9px 11px;
}
.report-summary-line b { display: block; color: #64748b; font-size: .68rem; text-transform: uppercase; }
.report-summary-line span { display: block; color: #0b345f; font-size: 1.18rem; font-weight: 950; }
.report-grade-box {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
.report-grade-box h3 {
  margin: 0;
  padding: 9px 12px;
  background: #0b345f;
  color: #ffffff;
  text-transform: uppercase;
  font-size: .78rem;
  letter-spacing: 0;
}
.report-grade-table { border: 0; border-radius: 0; box-shadow: none; }
.report-grade-table table { min-width: 0; }
.report-grade-table th {
  background: #eef2f7;
  color: #0f172a;
  font-size: .72rem;
  text-transform: uppercase;
}
.report-grade-table td {
  color: #1f2937;
  font-size: .78rem;
}
.report-grade-table td:last-child,
.report-grade-table th:last-child {
  text-align: center;
  font-weight: 900;
}
.report-status {
  font-weight: 900;
}
.report-status.ok {
  color: #16803a;
}
.report-status.bad {
  color: #dc2626;
}
.report-course-top {
  display: grid;
  grid-template-columns: minmax(210px, .68fr) minmax(0, 1.32fr);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}
.report-dist-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 170px;
  padding: 12px 10px 10px;
  align-items: end;
}
.report-dist-bars div {
  display: grid;
  grid-template-rows: 28px 1fr 24px;
  gap: 6px;
  min-width: 0;
  text-align: center;
  color: #334155;
  font-size: .72rem;
  font-weight: 800;
}
.report-dist-bars span {
  align-self: end;
}
.report-dist-bars i {
  width: 64%;
  min-height: 8px;
  align-self: end;
  justify-self: center;
  border-radius: 7px 7px 0 0;
  background: #38bdf8;
}
.report-dist-bars .green i { background: #22c55e; }
.report-dist-bars .blue i { background: #38bdf8; }
.report-dist-bars .yellow i { background: #eab308; }
.report-dist-bars .red i { background: #dc2626; }
.report-dist-bars b {
  color: #102033;
  font-size: .94rem;
}
.partial-grade-box {
  display: grid;
  grid-template-columns: repeat(10, minmax(28px, 1fr));
  gap: 3px;
  border: 1px solid #dbe3ee;
  border-radius: 4px;
  background: #f8fafc;
  padding: 5px;
}
.partial-grade-box span {
  display: grid;
  place-items: center;
  min-height: 23px;
  border-radius: 3px;
  background: #fff;
  color: #0f172a;
  font-size: .75rem;
  font-weight: 800;
}
.report-note-grid {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr);
  gap: 10px;
  margin-top: 12px;
}
.report-note-grid.single { grid-template-columns: minmax(180px, .65fr); }
.report-note-grid > div {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  padding: 11px 12px;
  min-height: 104px;
}
.report-note-grid h3 {
  margin: 0 0 8px;
  color: #0b345f;
  font-size: .78rem;
  font-weight: 950;
  text-transform: uppercase;
}
.report-note-grid p,
.report-note-grid ul {
  margin: 0;
  color: #334155;
  font-size: .82rem;
  line-height: 1.45;
}
.signature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
  margin-top: 62px;
  color: #334155;
  text-align: center;
}
.signature-row div {
  border-top: 1px solid #334155;
  padding-top: 8px;
  font-size: .8rem;
  font-weight: 800;
}
.report-footer {
  margin: 28px -.5in -.42in;
  padding: 11px .5in 13px;
  border-top: 1px solid #cbd5e1;
  background: #f1f5f9;
  display: flex;
  justify-content: space-between;
  color: #475569;
  font-size: .78rem;
  font-weight: 800;
}

body.is-authenticated #module-informes {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, .85), rgba(255, 255, 255, 0) 420px);
}

body.is-authenticated #module-informes .report-paper {
  margin-inline: auto;
}

body.is-authenticated #module-informes .card.no-print {
  border: 1px solid rgba(11, 52, 95, .12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
}

body.is-authenticated #module-informes .layout-insight-wrap.report-insights {
  width: min(100%, 8.5in);
  margin-inline: auto;
}

body.is-authenticated #module-informes .layout-report-actions {
  width: min(100%, 8.5in);
  margin-inline: auto;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

body.is-authenticated #module-informes .report-control-panel {
  width: min(100%, 8.5in);
  margin: 0 auto 16px;
}

body.is-authenticated #module-informes .report-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

body.is-authenticated #module-informes .report-filter-grid button {
  width: 100%;
}

body.is-authenticated #module-informes .report-student-paper,
body.is-authenticated #module-informes .report-course-paper {
  width: min(100%, 8.5in);
  min-height: auto;
  aspect-ratio: 8.5 / 11;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
}

.empty-state { border: 1px dashed #b9c6d8; padding: 22px; border-radius: var(--radius); color: var(--muted); background: #f8fafc; }
.statusbar { position: fixed; right: 18px; bottom: 18px; z-index: 40; background: #0f172a; color: #fff; padding: 12px 14px; border-radius: var(--radius); box-shadow: var(--shadow); display: none; max-width: 320px; }
.statusbar.show { display: block; }
.hidden-file { display: none; }
.role-select { max-width: 210px; }
body.is-authenticated #module-usuarios select[name="rol"],
body.is-authenticated #module-configuracion select[name="rol"] {
  min-width: 0;
  width: 100%;
  text-overflow: ellipsis;
}

body.is-authenticated #module-usuarios textarea[name="observaciones"],
body.is-authenticated #module-configuracion textarea[name="observaciones"] {
  min-height: 92px;
  resize: vertical;
}

body.is-authenticated #module-usuarios .form-grid,
body.is-authenticated #module-configuracion .config-form {
  align-items: start;
}

body.is-authenticated #module-usuarios .function-check-grid,
body.is-authenticated #module-configuracion .function-check-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.data-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.data-actions .icon-btn { width: 100%; }
.user-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) minmax(160px, 220px) minmax(130px, 170px);
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}
.user-role-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 4px 0 12px;
}
.user-role-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9e2ec;
  border-left: 4px solid #64748b;
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
}
.user-role-card i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
}
.user-role-card span {
  min-width: 0;
  font-size: .82rem;
  font-weight: 800;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role-card b {
  font-size: 1.1rem;
  color: #111827;
}
.user-role-card small {
  grid-column: 2 / -1;
  color: #64748b;
  font-size: .74rem;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}
.role-badge i { font-size: .78rem; }
.role-admin { border-left-color: #7c3aed; }
.role-admin i,
.role-badge.role-admin { background: #f3e8ff; color: #6d28d9; border-color: #ddd6fe; }
.role-leadership { border-left-color: #0f766e; }
.role-leadership i,
.role-badge.role-leadership { background: #ccfbf1; color: #0f766e; border-color: #99f6e4; }
.role-utp { border-left-color: #2563eb; }
.role-utp i,
.role-badge.role-utp { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.role-teacher { border-left-color: #16a34a; }
.role-teacher i,
.role-badge.role-teacher { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.role-pie { border-left-color: #9333ea; }
.role-pie i,
.role-badge.role-pie { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.role-support { border-left-color: #db2777; }
.role-support i,
.role-badge.role-support { background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.role-convivencia { border-left-color: #ea580c; }
.role-convivencia i,
.role-badge.role-convivencia { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.role-inspector { border-left-color: #ca8a04; }
.role-inspector i,
.role-badge.role-inspector { background: #fef3c7; color: #a16207; border-color: #fde68a; }
.role-admin-staff { border-left-color: #475569; }
.role-admin-staff i,
.role-badge.role-admin-staff { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
.role-assistant { border-left-color: #0891b2; }
.role-assistant i,
.role-badge.role-assistant { background: #cffafe; color: #0e7490; border-color: #a5f3fc; }
.role-family { border-left-color: #059669; }
.role-family i,
.role-badge.role-family { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.role-student { border-left-color: #0284c7; }
.role-student i,
.role-badge.role-student { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.role-other { border-left-color: #64748b; }
.role-other i,
.role-badge.role-other { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.user-detail-card {
  grid-column: 1 / -1;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.detail-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}
.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  margin-bottom: 4px;
}
.detail-grid b {
  display: block;
  overflow-wrap: anywhere;
}
.permission-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.permission-chip-list span {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .76rem;
  font-weight: 700;
  padding: 5px 9px;
}
.linked-staff-card {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 12px;
  margin-top: 12px;
}
.linked-staff-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.linked-staff-head span:first-child {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.linked-staff-head h4 {
  margin: 2px 0;
  font-size: 1.05rem;
}
.linked-staff-head small {
  color: var(--muted);
}
.linked-staff-note {
  border-top: 1px solid var(--line);
  margin: 12px 0 0;
  padding-top: 10px;
  color: #334155;
}
.staff-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(190px, 260px);
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}
.staff-toolbar .search-field {
  margin: 0;
}
.home-section-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.section-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.section-link-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  text-align: left;
}
.section-link-card i {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--nav-soft, #eef6ff);
  color: var(--nav-color, var(--primary));
  display: grid;
  place-items: center;
}
.section-link-card b,
.section-link-card small {
  display: block;
  overflow-wrap: anywhere;
}
.section-link-card small {
  color: var(--muted);
  font-size: .76rem;
  margin-top: 2px;
}
@media (max-width: 760px) {
  .staff-toolbar {
    grid-template-columns: 1fr;
  }
}
.logo-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.logo-config article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 12px;
}
.logo-config b { display: block; margin-bottom: 8px; color: #102033; }
.logo-preview {
  width: 96px;
  height: 96px;
  border: 1px solid #cfe0f3;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  padding: 8px;
  font-weight: 900;
  overflow: hidden;
  margin-bottom: 10px;
}
.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.import-summary {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

/* Unified platform polish */
.module > .card,
.module > .grid,
.module > .course-context,
.module > .subject-summary {
  max-width: 100%;
}
.module > .card + .card,
.module > .grid + .card,
.module > .course-context + .card { margin-top: 12px !important; }
.card .table-wrap { margin-top: 6px; }
.form-actions.full {
  justify-content: flex-start;
  align-items: center;
}
.form-actions button,
.mini-toolbar button,
.course-context-actions button,
.data-actions button {
  width: auto;
  white-space: nowrap;
}
.config-hero,
.course-context,
.card,
.table-wrap,
.login-panel,
.report-paper {
  border-color: #d8e4f1;
}
.course-card,
.insight,
.report-student div,
.course-meta span,
.course-context-meta {
  border-color: #dfe8f3;
}
.course-card:hover,
.card:hover {
  box-shadow: var(--shadow-hover);
}
.subject-summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}
.subject-summary .subject-stats-row { width: 100%; }

@media (max-width: 1420px) {
  .brand-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
@media (max-width: 980px) {
  .brand-row { grid-template-columns: 1fr; }
  .actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .config-hero { grid-template-columns: 1fr; }
  .course-context,
  .course-context-main { grid-template-columns: 1fr; }
  .course-context-actions { justify-content: start; }
  .list-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .course-list-card table { min-width: 1040px; }
  .course-feature-row { grid-template-columns: 58px 96px minmax(136px, 1fr) 78px 82px; }
  .course-list-card td.course-actions {
    width: 320px;
    white-space: nowrap;
  }
  .course-list-card td.course-actions button {
    min-height: 30px;
    padding-inline: 8px;
    margin: 0 3px 0 0;
  }
  .subject-admin-table table { min-width: 820px; }
  .subject-filter-bar { align-items: flex-start; flex-direction: column; }
  .subject-course-panel { grid-template-columns: 1fr; }
  .subject-workspace,
  .attendance-panel,
  .attendance-controls,
  .report-course-top,
  .report-note-grid { grid-template-columns: 1fr; }
  .attendance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-toolbar { grid-template-columns: 1fr; }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .module-head { align-items: start; flex-direction: column; }
  .module-head > .no-print {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .module-head > .no-print button { width: auto; }
  table { min-width: 680px; }
}
@media (max-width: 620px) {
  main { padding: 14px; padding-bottom: 26px; }
  .brand { align-items: center; }
  .brand h1 { font-size: clamp(1.05rem, 5vw, 1.35rem); }
  .actions {
    display: flex;
    gap: 6px;
  }
  .actions > * { min-width: 0; }
  .actions button {
    width: auto;
    max-width: 100%;
    white-space: nowrap;
  }
  .logo { width: 42px; height: 42px; }
  .form-grid,
  .mini-toolbar { grid-template-columns: 1fr; }
  .card { padding: 13px; }
  button { width: 100%; }
  td.actions-cell button,
  .module-head > .no-print button,
  .form-actions button,
  .mini-toolbar button,
  .course-context-actions button { width: auto; }
  .icon-btn { justify-content: flex-start; }
  .course-actions button,
  .subject-actions button,
  .list-card-head button { width: auto; }
  .course-card-grid { grid-template-columns: 1fr; }
  .nav-btn, .attendance-grid button, .attendance-grid input { width: auto; }
  .nav-scroll { padding: 9px 10px; }
  .course-context { padding: 12px; }
  table { min-width: 640px; }
  th, td { padding: 8px 9px; font-size: .86rem; }
  .grade-table-wrap table { min-width: 1040px; }
  .attendance-grid {
    grid-template-columns: 160px repeat(var(--days, 31), 40px) 62px 68px 76px;
  }
  .attendance-panel,
  .attendance-kpis { grid-template-columns: 1fr; }
  .attendance-controls,
  .logo-config,
  .report-summary-line,
  .report-note-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; gap: 5px; }
  .bar-row b { text-align: left; }
  .report-paper { padding: 22px; }
  .partial-grade-box { grid-template-columns: repeat(5, minmax(28px, 1fr)); }
  .report-header, .report-student, .signature-row { grid-template-columns: 1fr; }
  .report-title { font-size: 1.35rem; }
  .report-footer { margin: 22px -22px -22px; padding: 12px 22px; }

  .course-list-card .table-wrap,
  .subject-list-card .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    margin-top: 10px;
  }
  .course-list-card table,
  .subject-list-card table {
    display: block;
    min-width: 0;
    table-layout: auto;
  }
  .course-list-card thead,
  .subject-list-card thead { display: none; }
  .course-list-card tbody,
  .subject-list-card tbody { display: grid; gap: 10px; }
  .course-list-card tr,
  .subject-list-card tr {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 10px;
  }
  .course-list-card tr {
    grid-template-columns: 26px minmax(0, 1fr);
  }
  .course-list-card td,
  .subject-list-card td {
    display: block;
    width: auto !important;
    border-bottom: 0;
    padding: 0 !important;
  }
  .course-list-card .select-col {
    grid-row: 1 / 5;
    grid-column: 1;
    padding-top: 4px !important;
  }
  .course-list-card .course-title-cell,
  .course-list-card td:nth-child(3),
  .course-list-card .status-col,
  .course-list-card td.course-actions {
    grid-column: 2;
  }
  .course-feature-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .course-feature-row span:nth-child(3) { grid-column: 1 / -1; }
  .course-list-card .status-col { text-align: left; }
  .course-list-card td.course-actions,
  .subject-list-card td.subject-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    white-space: normal;
  }
  .course-list-card td.course-actions button,
  .subject-list-card td.subject-actions button {
    margin: 0;
    width: auto;
  }
  .subject-feature-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .subject-feature-row span:first-child { grid-column: 1 / -1; }
  .subject-list-card .status-col { text-align: left; }
}

@media print {
  body { background: #fff; }
  .app-shell { padding-top: 0; }
  .topbar, .module-head, .no-print, .statusbar { display: none !important; }
  main { padding: 0; }
  .module { display: none !important; }
  .module.active { display: block !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .table-wrap { overflow: visible; border: 0; }
  table { min-width: 0 !important; page-break-inside: auto; }
  tr, .report-grade-box, .report-note-grid > div { break-inside: avoid; page-break-inside: avoid; }
  th, td { padding: 4px 6px; font-size: .72rem; }
  .report-paper {
    width: 100% !important;
    max-width: none !important;
    min-height: auto;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  .report-paper::before,
  .report-paper::after { height: 6px; }
  .report-title { font-size: 1.14rem; margin: 8px 0; padding: 7px 10px; }
  .report-header { grid-template-columns: 58px 1fr 58px; gap: 10px; padding-bottom: 8px; margin-bottom: 8px; }
  .report-logo { width: 54px; height: 54px; }
  .report-student, .report-summary-line { gap: 6px; margin: 8px 0; }
  .report-student b,
  .report-summary-line b { font-size: .62rem; }
  .report-student span,
  .report-summary-line span { font-size: .86rem; }
  .report-grade-box h3,
  .report-note-grid h3 { font-size: .7rem; padding: 7px 9px; }
  .report-course-top { grid-template-columns: 1fr; gap: 8px; }
  .report-dist-bars { min-height: 120px; padding: 8px; }
  .partial-grade-box { grid-template-columns: repeat(10, minmax(20px, 1fr)); gap: 2px; padding: 4px; }
  .partial-grade-box span { min-height: 20px; font-size: .72rem; }
  .signature-row { margin-top: 34px; gap: 34px; }
  .report-footer { margin: 16px 0 0; padding: 8px 10px; }
  @page { size: letter; margin: 1.2cm; }
}

/* Institutional portal refresh */
body {
  background:
    linear-gradient(180deg, rgba(47, 138, 242, .18) 0, transparent 250px),
    #f2f7ff;
}
body::before { color: #0b3f91; opacity: .035; }
.topbar {
  background: #fff;
  border-bottom: 1px solid rgba(20, 95, 202, .16);
  box-shadow: 0 10px 28px rgba(9, 61, 145, .14);
}
.brand-row {
  background:
    linear-gradient(135deg, #0b3f91 0%, #145fca 54%, #1976e5 100%);
  color: #fff;
  padding-block: 16px;
  border-bottom: 5px solid #ffcf21;
}
.brand h1,
.brand p,
.year-control { color: #fff; text-shadow: none; }
.brand p { display: block; opacity: .88; font-size: .86rem; margin-top: 3px; }
.logo {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #fff;
  color: #0b3f91;
  box-shadow: 0 12px 28px rgba(3, 33, 94, .28);
}
.year-control {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .34);
}
.year-control select {
  background: #fff;
  color: #0b3f91;
  border-color: rgba(255, 255, 255, .4);
}
.btn-primary {
  background: linear-gradient(135deg, #0b3f91, #145fca);
  color: #fff;
}
.btn-primary:hover,
.icon-btn:hover {
  background: linear-gradient(135deg, #2f8af2, #dff2ff);
  color: #0b3f91;
  box-shadow: 0 14px 28px rgba(20, 95, 202, .22);
}
.btn-accent,
.btn-soft.active { background: #ffcf21; color: #0b3f91; }
.btn-ghost { background: rgba(255, 255, 255, .9); color: #0b3f91; }
.nav-scroll {
  background: #fff;
  border-top: 0;
  border-bottom: 1px solid rgba(20, 95, 202, .14);
  padding-block: 9px;
}
.nav-btn {
  min-height: 56px;
  min-width: 96px;
  border-color: rgba(20, 95, 202, .22);
  color: #0b3f91;
  background: #ffffff;
}
.nav-btn::before {
  content: none;
  display: none;
}
.nav-btn i {
  color: var(--nav-color);
  background: #ffeb7a;
}
.nav-btn.active {
  color: #0b3f91;
  background: linear-gradient(135deg, #fff2a6, #ffffff);
  border-color: #ffcf21;
  box-shadow: 0 10px 22px rgba(20, 95, 202, .14);
}
.nav-btn:hover {
  border-color: #2f8af2;
  color: #0b3f91;
  background: #eaf4ff;
  box-shadow: 0 14px 28px rgba(20, 95, 202, .16);
}
.nav-btn:hover i,
.nav-btn.active i { background: #0b3f91; color: #ffcf21; }
.mobile-menu-toggle {
  display: none;
  position: absolute;
  right: 14px;
  bottom: 10px;
  width: 42px;
  min-height: 38px;
  background: #ffcf21;
  color: #0b3f91;
  z-index: 45;
}
main { padding-top: clamp(16px, 2.4vw, 28px); }
.module-head {
  background: #fff;
  border-color: rgba(20, 95, 202, .14);
  border-top: 4px solid #2f8af2;
}
.module-head h2,
.card h3,
.portal-category-head span { color: #0b3f91; }
.card,
.course-context,
.table-wrap,
.subject-summary {
  background: #fff;
  border-color: rgba(20, 95, 202, .14);
  box-shadow: 0 8px 22px rgba(9, 61, 145, .07);
}
.card:hover {
  border-color: rgba(47, 138, 242, .8);
  box-shadow: 0 14px 34px rgba(9, 61, 145, .12);
}
.portal-hero {
  width: min(100%, 1640px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 18px;
  margin-bottom: 14px;
}
.portal-hero-main,
.portal-summary {
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(9, 61, 145, .11);
}
.portal-hero-main {
  background: #fff;
  border: 1px solid rgba(20, 95, 202, .14);
  border-left: 7px solid #2f8af2;
  padding: clamp(20px, 3vw, 32px);
}
.portal-kicker {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff6cf;
  color: #0b3f91;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.portal-hero h2 {
  margin: 12px 0 8px;
  color: #0b3f91;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.05;
}
.portal-hero p {
  margin: 0;
  color: #4b6170;
  max-width: 820px;
  line-height: 1.5;
}
.portal-search {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.portal-search i {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eaf4ff;
  color: #0b3f91;
}
.portal-search input { min-height: 42px; }
.portal-summary {
  background: linear-gradient(135deg, #0b3f91, #145fca);
  color: #fff;
  padding: 22px;
}
.portal-summary h3 { margin: 0 0 14px; color: #ffcf21; }
.portal-summary p {
  margin: 0 0 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}
.portal-summary span { opacity: .82; }
.portal-summary b { color: #fff; text-align: right; }
.portal-metrics {
  width: min(100%, 1640px);
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.portal-metrics .metric { border-left: 5px solid var(--primary); }
.portal-sections {
  width: min(100%, 1640px);
  margin: 16px auto 0;
  display: grid;
  gap: 16px;
}
.portal-category {
  background: #fff;
  border: 1px solid rgba(20, 95, 202, .14);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(9, 61, 145, .07);
}
.portal-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(20, 95, 202, .12);
  margin-bottom: 14px;
}
.portal-category-head span { font-size: 1.1rem; font-weight: 900; }
.portal-category-head b {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #0b3f91;
  font-size: .78rem;
}
.portal-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.portal-card {
  position: relative;
  isolation: isolate;
  min-height: 116px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(60, 147, 242, .24), rgba(8, 70, 164, .04)) padding-box,
    linear-gradient(135deg, #2f8af2, #0b4da8) border-box;
  background-color: #115cc1;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 14px 18px;
  color: #ffffff;
  box-shadow:
    0 13px 24px rgba(9, 61, 145, .22),
    inset 0 0 0 1px rgba(255, 255, 255, .16);
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}
.portal-card::before {
  content: "";
  position: absolute;
  inset: 8px 8px 12px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  pointer-events: none;
}
.portal-card::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -2px;
  height: 6px;
  background: linear-gradient(90deg, #ffda21, #ffc400, color-mix(in srgb, var(--nav-color) 36%, #ffc400));
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .28);
}
.portal-card i {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(255, 236, 122, .78));
  border: 1px solid rgba(255, 255, 255, .22);
  color: var(--nav-color);
  font-size: 1.16rem;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 7px 14px rgba(2, 32, 91, .16);
  transition: transform .22s ease, background .22s ease, color .22s ease;
}
.portal-card b {
  display: block;
  color: #ffffff;
  font-size: .94rem;
  line-height: 1.08;
  margin-bottom: 3px;
  text-wrap: balance;
  text-shadow: 0 2px 0 rgba(0, 42, 117, .35);
}
.portal-card small {
  display: block;
  color: rgba(255, 255, 255, .88);
  line-height: 1.15;
  font-size: .68rem;
  font-weight: 800;
  max-width: 22ch;
  margin-inline: auto;
}
.portal-card:hover {
  transform: translateY(-4px);
  filter: saturate(1.08);
  box-shadow:
    0 18px 34px rgba(9, 61, 145, .28),
    inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.portal-card:hover i {
  transform: translateY(-2px) scale(1.03);
  background: linear-gradient(135deg, #ffffff, #ffcf21);
  color: var(--nav-color);
}
table th { background: #eaf4ff; color: #0b3f91; }
table tr:hover td { background: #fbfdff; }
input:focus,
select:focus,
textarea:focus {
  border-color: #2f8af2;
  box-shadow: 0 0 0 4px rgba(47, 138, 242, .18);
}

@media (max-width: 980px) {
  .portal-hero { grid-template-columns: 1fr; }
  .portal-search { grid-template-columns: 34px minmax(0, 1fr); }
  .portal-search button { grid-column: 2; width: fit-content; }
}

@media (max-width: 620px) {
  .brand-row { padding-right: 64px; }
  .brand p { display: none; }
  .mobile-menu-toggle { display: grid; place-items: center; }
  .nav-scroll {
    display: none;
    max-height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }
  .nav-scroll.open { display: grid; }
  .nav-btn {
    width: 100%;
    min-width: 0;
    min-height: 72px;
  }
  .portal-hero-main,
  .portal-summary,
  .portal-category { padding: 14px; }
  .portal-search { grid-template-columns: 1fr; }
  .portal-search i { display: none; }
  .portal-search button { grid-column: auto; width: 100%; }
  .portal-card-grid,
  .portal-metrics { grid-template-columns: 1fr; }
  .portal-card { min-height: 112px; }
}

@media print {
  .topbar, .module-head, .no-print, .statusbar, .portal-hero, .portal-sections, .portal-metrics, .institution-strip { display: none !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; border: 0 !important; }
}

/* No jump/click movement */
button,
.card,
.course-card,
.focus-card,
.nav-btn,
.portal-card,
.portal-card i,
.nav-btn i {
  transform: none !important;
  animation-name: none !important;
}
button:hover,
button:active,
.card:hover,
.card:active,
.course-card:hover,
.course-card:active,
.focus-card:hover,
.focus-card:active,
.nav-btn:hover,
.nav-btn:active,
.portal-card:hover,
.portal-card:active,
.portal-card:hover i,
.portal-card:active i,
.nav-btn:hover i,
.nav-btn:active i {
  transform: none !important;
  animation-name: none !important;
}

/* Final protected identity layer */
:root {
  --primary: #0B4F59;
  --primary-dark: #083f47;
  --accent: #F4D35E;
  --bg: #F5F7F9;
  --surface: #FFFFFF;
}
body { background: #F5F7F9 !important; }
.brand-row,
.portal-summary { background: linear-gradient(135deg, #0B4F59, #127684) !important; }
.btn-primary { background: #0B4F59 !important; color: #FFFFFF !important; }
.btn-primary:hover,
.icon-btn:hover { background: #63C7F2 !important; color: #0B4F59 !important; }
.btn-accent,
.mobile-menu-toggle { background: #F4D35E !important; color: #0B4F59 !important; }
.brand h1,
.module-head h2,
.card h3,
.portal-hero h2,
.portal-category-head span,
.portal-card b,
table th { color: #0B4F59 !important; }
.portal-hero-main { border-left-color: #63C7F2 !important; }
.nav-btn.active { border-color: #F4D35E !important; background: #fff9dc !important; color: #0B4F59 !important; }
.nav-btn:hover { border-color: #63C7F2 !important; color: #0B4F59 !important; }
.nav-btn:hover i,
.nav-btn.active i { background: #0B4F59 !important; color: #FFFFFF !important; }
.portal-card {
  background: #FFFFFF !important;
  color: #233745 !important;
  border: 1px solid rgba(11, 79, 89, .16) !important;
  border-left: 5px solid var(--nav-color) !important;
  box-shadow: 0 8px 22px rgba(11, 79, 89, .08) !important;
}
.portal-card::after { background: #F4D35E !important; }
.portal-card i {
  background: color-mix(in srgb, var(--nav-color) 14%, #FFFFFF) !important;
  color: var(--nav-color) !important;
}
.portal-card small { color: #5b6f7c !important; }
.card,
.course-context,
.table-wrap,
.subject-summary,
.portal-category {
  background: #FFFFFF !important;
  border-color: rgba(11, 79, 89, .14) !important;
}

/* Emergency visibility recovery */
html,
body {
  min-height: 100% !important;
}
body:not(.is-authenticated) .login-screen {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}
body.is-authenticated .app-shell {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}
body.is-authenticated main,
body.is-authenticated .module.active {
  display: block !important;
  min-height: 320px !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.login-panel,
.topbar,
main,
.module.active > * {
  position: relative;
  z-index: 2;
}
.login-screen {
  z-index: 5;
}

/* Revert emergency visibility behavior */
body:not(.is-authenticated) .app-shell,
body:not(.is-authenticated) .statusbar {
  display: none !important;
}
body.is-authenticated .login-screen {
  display: none !important;
}

/* DC Gestion Educativa final identity */
:root {
  --primary: #1E40AF;
  --primary-dark: #0F172A;
  --accent: #FACC15;
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --line: #CBD5E1;
  --muted: #64748B;
  --text: #0F172A;
}
body {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}
.brand-row,
.portal-summary {
  background: linear-gradient(135deg, #0F172A, #1E40AF) !important;
}
.btn-primary {
  background: #1E40AF !important;
  color: #FFFFFF !important;
}
.btn-primary:hover,
.icon-btn:hover {
  background: #38BDF8 !important;
  color: #0F172A !important;
}
.btn-accent,
.mobile-menu-toggle {
  background: #FACC15 !important;
  color: #0F172A !important;
}
.brand h1,
.module-head h2,
.card h3,
.portal-hero h2,
.portal-category-head span,
.portal-card b,
.platform-vision h3,
.capability-card b,
table th {
  color: #0F172A !important;
}
.portal-hero-main,
.module-head {
  border-left-color: #38BDF8 !important;
  border-top-color: #38BDF8 !important;
}
.nav-btn.active {
  border-color: #FACC15 !important;
  background: #FEF9C3 !important;
  color: #0F172A !important;
}
.nav-btn:hover {
  border-color: #38BDF8 !important;
  color: #0F172A !important;
}
.nav-btn:hover i,
.nav-btn.active i {
  background: #1E40AF !important;
  color: #FFFFFF !important;
}
.portal-card,
.capability-card {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid rgba(15, 23, 42, .12) !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08) !important;
}
.portal-card {
  border-left: 5px solid var(--nav-color) !important;
}
.portal-card::after {
  background: #FACC15 !important;
}
.portal-card i {
  background: color-mix(in srgb, var(--nav-color) 14%, #FFFFFF) !important;
  color: var(--nav-color) !important;
}
.portal-card small,
.capability-card small {
  color: #64748B !important;
}
.card,
.course-context,
.table-wrap,
.subject-summary,
.portal-category,
.platform-vision {
  background: #FFFFFF !important;
  border-color: rgba(15, 23, 42, .12) !important;
}
.platform-vision {
  width: min(100%, 1640px);
  margin: 16px auto 0;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}
.platform-vision-head {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}
.platform-vision-head span {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FEF9C3;
  color: #0F172A;
  font-weight: 900;
  font-size: .75rem;
  text-transform: uppercase;
}
.platform-vision-head h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}
.platform-vision-head p {
  margin: 0;
  color: #64748B;
  line-height: 1.45;
}
.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.capability-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-radius: 8px;
  padding: 14px;
}
.capability-card i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #E0F2FE;
  color: #1E40AF;
}
.capability-card b {
  display: block;
  margin-bottom: 7px;
}
.capability-card small {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.capability-card small span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #F1F5F9;
  color: #334155;
  font-size: .72rem;
  font-weight: 800;
}

/* Fixed readable project menu */
.topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background: #FFFFFF !important;
  border-bottom: 1px solid #CBD5E1 !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .14) !important;
}
.brand-row {
  background: linear-gradient(135deg, #0F172A, #1E40AF) !important;
  border-bottom: 4px solid #FACC15 !important;
}
.brand h1,
.brand p,
.year-control {
  color: #FFFFFF !important;
  text-shadow: none !important;
}
.brand h1 {
  font-size: clamp(1.35rem, 2vw, 1.9rem) !important;
  line-height: 1.12 !important;
  font-weight: 900 !important;
}
.brand p {
  display: block !important;
  opacity: .96 !important;
}
.nav-scroll {
  position: sticky !important;
  top: 0 !important;
  z-index: 1001 !important;
  background: #FFFFFF !important;
  border-bottom: 1px solid #CBD5E1 !important;
  display: flex !important;
  gap: 10px !important;
  overflow-x: auto !important;
  padding: 12px clamp(14px, 3vw, 34px) !important;
  scrollbar-width: thin;
}
.nav-btn {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
  min-width: 120px !important;
  min-height: 76px !important;
  padding: 9px 12px !important;
  font-weight: 900 !important;
}
.nav-btn span {
  color: #0F172A !important;
  font-size: .88rem !important;
  line-height: 1.15 !important;
  white-space: normal !important;
}
.nav-btn i {
  background: #E0F2FE !important;
  color: #1E40AF !important;
}
.nav-btn.active {
  background: #FEF9C3 !important;
  border-color: #FACC15 !important;
}
.nav-btn.active i,
.nav-btn:hover i {
  background: #1E40AF !important;
  color: #FFFFFF !important;
}
.app-shell {
  padding-top: var(--topbar-height) !important;
}
@media (max-width: 620px) {
  .brand-row {
    padding-right: 64px !important;
  }
  .mobile-menu-toggle {
    display: grid !important;
    place-items: center !important;
  }
  .nav-scroll {
    display: none !important;
    grid-template-columns: 1fr 1fr !important;
    max-height: calc(100vh - var(--topbar-height)) !important;
  }
  .nav-scroll.open {
    display: grid !important;
  }
  .nav-btn {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Full-space layout + compact readable permissions */
:root {
  --preview-sidebar-width: clamp(238px, 18vw, 292px);
  --content-edge-gap: clamp(10px, 1.25vw, 18px);
}

body.is-authenticated,
body.visual-modern.is-authenticated {
  overflow-x: hidden;
}

body.is-authenticated #appMain,
body.visual-modern.is-authenticated #appMain {
  width: calc(100vw - var(--preview-sidebar-width)) !important;
  max-width: calc(100vw - var(--preview-sidebar-width)) !important;
  padding: var(--content-edge-gap) !important;
}

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

body.is-authenticated .card,
body.is-authenticated .table-wrap,
body.is-authenticated .config-card,
body.is-authenticated .function-fieldset,
body.visual-modern.is-authenticated .card,
body.visual-modern.is-authenticated .table-wrap,
body.visual-modern.is-authenticated .config-card,
body.visual-modern.is-authenticated .function-fieldset {
  width: 100% !important;
  max-width: none !important;
}

@media (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    width: var(--preview-sidebar-width) !important;
    padding: 14px 12px !important;
    gap: 10px !important;
  }

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

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

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    font-size: clamp(.98rem, 1.05vw, 1.18rem) !important;
    line-height: 1.04 !important;
  }

  body.is-authenticated .brand p,
  body.visual-modern.is-authenticated .brand p {
    -webkit-line-clamp: 1;
    font-size: .72rem !important;
    line-height: 1.15 !important;
  }

  body.is-authenticated .actions,
  body.visual-modern.is-authenticated .actions {
    padding: 10px !important;
    gap: 7px !important;
    border-radius: 16px !important;
  }

  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control {
    grid-template-columns: minmax(74px, auto) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 9px !important;
  }

  body.is-authenticated .year-control label,
  body.visual-modern.is-authenticated .year-control label {
    font-size: .76rem !important;
    white-space: nowrap !important;
  }

  body.is-authenticated .year-control select,
  body.visual-modern.is-authenticated .year-control select {
    height: 32px !important;
    min-height: 32px !important;
    padding-inline: 8px !important;
  }

  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn {
    min-height: 38px !important;
    padding: 0 9px !important;
    font-size: .82rem !important;
  }

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

  body.is-authenticated .nav-group-label,
  body.visual-modern.is-authenticated .nav-group-label {
    font-size: .68rem !important;
    margin: 8px 0 3px !important;
  }

  body.is-authenticated .nav-item,
  body.visual-modern.is-authenticated .nav-item {
    min-height: 42px !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
  }

  body.is-authenticated .nav-item i,
  body.visual-modern.is-authenticated .nav-item i {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 12px !important;
    font-size: .95rem !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: .82rem !important;
  }
}

body.is-authenticated .function-fieldset:has(.permission-panel),
body.is-authenticated .config-card:has(.permission-panel),
body.is-authenticated .permission-panel,
body.is-authenticated #module-configuracion .permission-panel {
  width: 100% !important;
  max-width: none !important;
  overflow: hidden !important;
}

body.is-authenticated .permission-panel-head,
body.is-authenticated #module-configuracion .permission-panel-head {
  grid-template-columns: minmax(150px, max-content) minmax(0, 1fr) !important;
  padding: 12px 14px 8px !important;
  gap: 12px !important;
}

body.is-authenticated .permission-panel-head b,
body.is-authenticated #module-configuracion .permission-panel-head b {
  white-space: normal !important;
  line-height: 1.15 !important;
}

body.is-authenticated .permission-panel-head small,
body.is-authenticated #module-configuracion .permission-panel-head small {
  max-width: 42rem !important;
  justify-self: end !important;
  text-align: right !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated .permission-panel-body,
body.is-authenticated #module-configuracion .permission-panel-body {
  padding: 0 14px 14px !important;
}

body.is-authenticated .permission-table-wrap,
body.is-authenticated #module-configuracion .permission-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-gutter: stable both-edges;
}

body.is-authenticated .permission-table,
body.is-authenticated #module-configuracion .permission-table {
  width: 100% !important;
  min-width: 720px !important;
  table-layout: fixed !important;
}

body.is-authenticated .permission-table th:first-child,
body.is-authenticated .permission-table td:first-child,
body.is-authenticated .permission-table tbody th,
body.is-authenticated #module-configuracion .permission-table th:first-child,
body.is-authenticated #module-configuracion .permission-table td:first-child,
body.is-authenticated #module-configuracion .permission-table tbody th {
  width: clamp(112px, 16%, 170px) !important;
}

body.is-authenticated .permission-table th,
body.is-authenticated .permission-table td,
body.is-authenticated #module-configuracion .permission-table th,
body.is-authenticated #module-configuracion .permission-table td {
  padding: 5px 4px !important;
  min-width: 0 !important;
}

body.is-authenticated .permission-table thead th,
body.is-authenticated #module-configuracion .permission-table thead th {
  height: 34px !important;
  font-size: .66rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body.is-authenticated .permission-tick,
body.is-authenticated #module-configuracion .permission-tick {
  min-height: 34px !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 4px 5px !important;
  border-radius: 8px !important;
}

body.is-authenticated .permission-tick input,
body.is-authenticated #module-configuracion .permission-tick input {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
}

body.is-authenticated .permission-tick span,
body.is-authenticated #module-configuracion .permission-tick span {
  max-width: calc(100% - 22px) !important;
  font-size: .68rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

@media (max-width: 1180px) {
  :root {
    --preview-sidebar-width: 238px;
  }

  body.is-authenticated .permission-table,
  body.is-authenticated #module-configuracion .permission-table {
    min-width: 660px !important;
  }

  body.is-authenticated .permission-tick span,
  body.is-authenticated #module-configuracion .permission-tick span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
  }

  body.is-authenticated .permission-tick,
  body.is-authenticated #module-configuracion .permission-tick {
    padding: 4px !important;
  }
}

@media (max-width: 980px) {
  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    padding: 10px !important;
  }

  body.is-authenticated .permission-panel-head,
  body.is-authenticated #module-configuracion .permission-panel-head {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated .permission-panel-head small,
  body.is-authenticated #module-configuracion .permission-panel-head small {
    justify-self: start !important;
    text-align: left !important;
  }
}

/* Sidebar structure: brand, school year, actions, then navigation */
:root {
  --preview-sidebar-width: clamp(228px, 16vw, 260px);
}

@media (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    width: var(--preview-sidebar-width) !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    align-content: start !important;
    gap: 0 !important;
    padding: 0 !important;
    background: linear-gradient(180deg, #6420bb 0%, #7a26df 48%, #8a35f1 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, .18) !important;
    box-shadow: 16px 0 42px rgba(67, 28, 128, .18) !important;
    overflow-x: hidden !important;
  }

  body.is-authenticated .brand-row,
  body.visual-modern.is-authenticated .brand-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }

  body.is-authenticated .brand,
  body.visual-modern.is-authenticated .brand {
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px 14px 12px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.is-authenticated .logo,
  body.visual-modern.is-authenticated .logo {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 24px rgba(28, 12, 61, .22) !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    font-size: clamp(1.12rem, 1.2vw, 1.34rem) !important;
    line-height: 1.02 !important;
    letter-spacing: 0 !important;
    color: #ffffff !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
  }

  body.is-authenticated .brand p,
  body.visual-modern.is-authenticated .brand p {
    display: -webkit-box !important;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    margin-top: 3px !important;
    color: rgba(255, 255, 255, .86) !important;
    font-size: .72rem !important;
    line-height: 1.15 !important;
    overflow: hidden !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 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control {
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100% !important;
    min-height: 118px !important;
    padding: 15px 12px 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #f8f2ff !important;
    color: #6d2d91 !important;
    font-size: clamp(1.55rem, 1.85vw, 1.9rem) !important;
    font-weight: 950 !important;
    line-height: .96 !important;
    text-align: center !important;
    text-transform: uppercase !important;
  }

  body.is-authenticated .year-control select,
  body.visual-modern.is-authenticated .year-control select {
    width: auto !important;
    min-width: 116px !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 22px 0 0 !important;
    margin: 2px 0 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    color: #6d2d91 !important;
    font-size: clamp(1.55rem, 1.85vw, 1.9rem) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    text-align: center !important;
    box-shadow: none !important;
  }

  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn {
    width: 100% !important;
    min-height: 42px !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #dfcff5 !important;
    color: #075c93 !important;
    font-size: .82rem !important;
    font-weight: 800 !important;
    box-shadow: none !important;
  }

  body.is-authenticated .actions .icon-btn + .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn + .icon-btn {
    margin-top: 6px !important;
  }

  body.is-authenticated .actions .icon-btn i,
  body.visual-modern.is-authenticated .actions .icon-btn i {
    color: #075c93 !important;
  }

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

  body.is-authenticated .mobile-menu-toggle,
  body.visual-modern.is-authenticated .mobile-menu-toggle {
    display: none !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 22px 16px 22px !important;
    background: transparent !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body.is-authenticated .nav-group,
  body.visual-modern.is-authenticated .nav-group {
    display: grid !important;
    gap: 10px !important;
    margin: 0 0 24px !important;
  }

  body.is-authenticated .nav-group-label,
  body.visual-modern.is-authenticated .nav-group-label {
    margin: 0 0 6px !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, .66) !important;
    font-size: .66rem !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    text-transform: uppercase !important;
  }

  body.is-authenticated .nav-item,
  body.visual-modern.is-authenticated .nav-item {
    display: grid !important;
    grid-template-columns: 44px minmax(0, max-content) !important;
    align-items: center !important;
    justify-content: start !important;
    gap: 10px !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-height: 48px !important;
    padding: 0 10px 0 0 !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: transparent !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }

  body.is-authenticated .nav-item i,
  body.visual-modern.is-authenticated .nav-item i {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 15px !important;
    background: rgba(255, 255, 255, .16) !important;
    color: #ffffff !important;
    font-size: 1.08rem !important;
  }

  body.is-authenticated .nav-item span,
  body.visual-modern.is-authenticated .nav-item span {
    min-width: 0 !important;
    color: #ffffff !important;
    font-size: .82rem !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

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

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

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    margin-left: var(--preview-sidebar-width) !important;
    width: calc(100vw - var(--preview-sidebar-width)) !important;
    max-width: calc(100vw - var(--preview-sidebar-width)) !important;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  :root {
    --preview-sidebar-width: 228px;
  }

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

  body.is-authenticated .logo,
  body.visual-modern.is-authenticated .logo {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    font-size: 1.02rem !important;
  }
}

/* Compact sidebar tuning */
:root {
  --preview-sidebar-width: clamp(196px, 14vw, 224px);
}

@media (min-width: 981px) {
  body.is-authenticated .brand,
  body.visual-modern.is-authenticated .brand {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 11px 10px 9px !important;
  }

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

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    font-size: clamp(.9rem, .95vw, 1.04rem) !important;
    line-height: 1.03 !important;
  }

  body.is-authenticated .brand p,
  body.visual-modern.is-authenticated .brand p {
    font-size: .66rem !important;
  }

  body.is-authenticated .actions,
  body.visual-modern.is-authenticated .actions {
    gap: 7px !important;
    padding: 9px 10px 11px !important;
    background: rgba(255, 255, 255, .08) !important;
  }

  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control {
    grid-template-columns: minmax(0, 1fr) auto !important;
    justify-items: stretch !important;
    min-height: 40px !important;
    padding: 7px 8px !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .16) !important;
    color: #ffffff !important;
    font-size: .72rem !important;
    line-height: 1.1 !important;
    text-align: left !important;
    text-transform: none !important;
  }

  body.is-authenticated .year-control select,
  body.visual-modern.is-authenticated .year-control select {
    width: 76px !important;
    min-width: 76px !important;
    height: 26px !important;
    min-height: 26px !important;
    padding: 0 22px 0 8px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    background-color: rgba(255, 255, 255, .92) !important;
    color: #5b21b6 !important;
    font-size: .8rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-align: left !important;
  }

  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn {
    min-height: 36px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .82) !important;
    font-size: .76rem !important;
  }

  body.is-authenticated .actions .icon-btn + .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn + .icon-btn {
    margin-top: 0 !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    padding: 16px 12px 18px !important;
  }

  body.is-authenticated .nav-group,
  body.visual-modern.is-authenticated .nav-group {
    gap: 8px !important;
    margin-bottom: 18px !important;
  }

  body.is-authenticated .nav-item,
  body.visual-modern.is-authenticated .nav-item {
    grid-template-columns: 36px minmax(0, max-content) !important;
    min-height: 40px !important;
    gap: 8px !important;
    border-radius: 13px !important;
  }

  body.is-authenticated .nav-item i,
  body.visual-modern.is-authenticated .nav-item i {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 12px !important;
    font-size: .95rem !important;
  }

  body.is-authenticated .nav-item span,
  body.visual-modern.is-authenticated .nav-item span {
    font-size: .76rem !important;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  :root {
    --preview-sidebar-width: 196px;
  }
}

/* DC Gestion Educativa final identity */
:root {
  --primary: #1E40AF;
  --primary-dark: #0F172A;
  --accent: #FACC15;
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --line: #CBD5E1;
  --muted: #64748B;
  --text: #0F172A;
}
body {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}
.brand-row,
.portal-summary {
  background: linear-gradient(135deg, #0F172A, #1E40AF) !important;
}
.btn-primary {
  background: #1E40AF !important;
  color: #FFFFFF !important;
}
.btn-primary:hover,
.icon-btn:hover {
  background: #38BDF8 !important;
  color: #0F172A !important;
}
.btn-accent,
.mobile-menu-toggle {
  background: #FACC15 !important;
  color: #0F172A !important;
}
.brand h1,
.module-head h2,
.card h3,
.portal-hero h2,
.portal-category-head span,
.portal-card b,
.platform-vision h3,
.capability-card b,
table th {
  color: #0F172A !important;
}
.portal-hero-main,
.module-head {
  border-left-color: #38BDF8 !important;
  border-top-color: #38BDF8 !important;
}
.nav-btn.active {
  border-color: #FACC15 !important;
  background: #FEF9C3 !important;
  color: #0F172A !important;
}
.nav-btn:hover {
  border-color: #38BDF8 !important;
  color: #0F172A !important;
}
.nav-btn:hover i,
.nav-btn.active i {
  background: #1E40AF !important;
  color: #FFFFFF !important;
}
.portal-card,
.capability-card {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid rgba(15, 23, 42, .12) !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08) !important;
}
.portal-card {
  border-left: 5px solid var(--nav-color) !important;
}
.portal-card::after {
  background: #FACC15 !important;
}
.portal-card small,
.capability-card small {
  color: #64748B !important;
}
.card,
.course-context,
.table-wrap,
.subject-summary,
.portal-category,
.platform-vision {
  background: #FFFFFF !important;
  border-color: rgba(15, 23, 42, .12) !important;
}
.platform-vision {
  width: min(100%, 1640px);
  margin: 16px auto 0;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}
.platform-vision-head {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}
.platform-vision-head span {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FEF9C3;
  color: #0F172A;
  font-weight: 900;
  font-size: .75rem;
  text-transform: uppercase;
}
.platform-vision-head h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}
.platform-vision-head p {
  margin: 0;
  color: #64748B;
  line-height: 1.45;
}
.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.capability-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-radius: 8px;
  padding: 14px;
}
.capability-card i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #E0F2FE;
  color: #1E40AF;
}
.capability-card b {
  display: block;
  margin-bottom: 7px;
}
.capability-card small {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.capability-card small span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #F1F5F9;
  color: #334155;
  font-size: .72rem;
  font-weight: 800;
}

/* Final protected identity layer */
:root {
  --primary: #0B4F59;
  --primary-dark: #083f47;
  --accent: #F4D35E;
  --bg: #F5F7F9;
  --surface: #FFFFFF;
}
body { background: #F5F7F9 !important; }
.brand-row,
.portal-summary { background: linear-gradient(135deg, #0B4F59, #127684) !important; }
.btn-primary { background: #0B4F59 !important; color: #FFFFFF !important; }
.btn-primary:hover,
.icon-btn:hover { background: #63C7F2 !important; color: #0B4F59 !important; }
.btn-accent,
.mobile-menu-toggle { background: #F4D35E !important; color: #0B4F59 !important; }
.brand h1,
.module-head h2,
.card h3,
.portal-hero h2,
.portal-category-head span,
.portal-card b,
table th { color: #0B4F59 !important; }
.portal-hero-main { border-left-color: #63C7F2 !important; }
.nav-btn.active { border-color: #F4D35E !important; background: #fff9dc !important; color: #0B4F59 !important; }
.nav-btn:hover { border-color: #63C7F2 !important; color: #0B4F59 !important; }
.nav-btn:hover i,
.nav-btn.active i { background: #0B4F59 !important; color: #FFFFFF !important; }
.portal-card {
  background: #FFFFFF !important;
  color: #233745 !important;
  border: 1px solid rgba(11, 79, 89, .16) !important;
  border-left: 5px solid var(--nav-color) !important;
  box-shadow: 0 8px 22px rgba(11, 79, 89, .08) !important;
}
.portal-card::after { background: #F4D35E !important; }
.portal-card i {
  background: color-mix(in srgb, var(--nav-color) 14%, #FFFFFF) !important;
  color: var(--nav-color) !important;
}
.portal-card small { color: #5b6f7c !important; }
.card,
.course-context,
.table-wrap,
.subject-summary,
.portal-category {
  background: #FFFFFF !important;
  border-color: rgba(11, 79, 89, .14) !important;
}

/* Protected institutional layer: stable identity, no data/logic impact */
:root {
  --primary: #0B4F59;
  --primary-dark: #083f47;
  --bottom-primary: #0B4F59;
  --bottom-hover: #63C7F2;
  --bottom-accent: #F4D35E;
  --bottom-bg: #F5F7F9;
  --accent: #F4D35E;
  --bg: #F5F7F9;
  --surface: #FFFFFF;
}
body {
  background:
    linear-gradient(180deg, rgba(99, 199, 242, .14) 0, transparent 250px),
    #F5F7F9 !important;
}
.brand-row,
.portal-summary {
  background: linear-gradient(135deg, #0B4F59, #127684) !important;
}
.logo,
.portal-kicker,
.mobile-menu-toggle,
.btn-accent {
  color: #0B4F59 !important;
}
.btn-primary {
  background: #0B4F59 !important;
  color: #FFFFFF !important;
}
.btn-primary:hover,
.icon-btn:hover {
  background: #63C7F2 !important;
  color: #0B4F59 !important;
}
.btn-accent,
.mobile-menu-toggle {
  background: #F4D35E !important;
}
.brand h1,
.module-head h2,
.card h3,
.portal-hero h2,
.portal-category-head span,
.portal-card b,
table th {
  color: #0B4F59 !important;
}
.portal-hero-main {
  border-left-color: #63C7F2 !important;
}
.nav-btn.active {
  border-color: #F4D35E !important;
  background: #fff9dc !important;
  color: #0B4F59 !important;
}
.nav-btn:hover {
  border-color: #63C7F2 !important;
  color: #0B4F59 !important;
}
.nav-btn:hover i,
.nav-btn.active i {
  background: #0B4F59 !important;
  color: #FFFFFF !important;
}
.portal-card {
  background: #FFFFFF !important;
  color: #233745 !important;
  border: 1px solid rgba(11, 79, 89, .16) !important;
  border-left: 5px solid var(--nav-color) !important;
  box-shadow: 0 8px 22px rgba(11, 79, 89, .08) !important;
}
.portal-card::after {
  background: #F4D35E !important;
}
.portal-card i {
  background: color-mix(in srgb, var(--nav-color) 14%, #FFFFFF) !important;
  color: var(--nav-color) !important;
}
.portal-card small {
  color: #5b6f7c !important;
}
.card,
.course-context,
.table-wrap,
.subject-summary,
.portal-category {
  background: #FFFFFF !important;
  border-color: rgba(11, 79, 89, .14) !important;
}

/* DC Gestion Educativa premium evolution */
:root {
  --primary: #2563EB;
  --primary-dark: #111827;
  --bottom-primary: #2563EB;
  --bottom-hover: #1D4ED8;
  --bottom-accent: #D97706;
  --bottom-bg: #F8FAFC;
  --accent: #D97706;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #111827;
  --muted: #64748B;
  --line: #E2E8F0;
  --success: #059669;
  --warning: #D97706;
  --shadow: 0 12px 32px rgba(17, 24, 39, .08);
  --shadow-hover: 0 18px 44px rgba(37, 99, 235, .14);
}

body {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .11) 0, rgba(248, 250, 252, 0) 310px),
    #F8FAFC;
  color: #111827;
}

body::before { color: #111827; opacity: .026; }

.login-screen {
  background:
    linear-gradient(135deg, rgba(17, 24, 39, .86), rgba(37, 99, 235, .56) 58%, rgba(217, 119, 6, .28)),
    var(--login-bg) center / cover no-repeat,
    #111827;
}

.login-panel,
.card,
.portal-category,
.portal-hero-main,
.course-context,
.table-wrap,
.subject-summary {
  border-color: rgba(148, 163, 184, .28);
  box-shadow: 0 12px 30px rgba(17, 24, 39, .08);
}

.brand-row {
  background: linear-gradient(135deg, #111827 0%, #1E3A8A 58%, #2563EB 100%);
  border-bottom-color: #D97706;
}

.logo,
.login-badge {
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(17, 24, 39, .22);
}

.btn-primary {
  background: linear-gradient(135deg, #111827, #2563EB);
}

.btn-primary:hover,
.icon-btn:hover {
  background: linear-gradient(135deg, #2563EB, #FFFFFF);
  color: #111827;
}

.btn-accent,
.btn-soft.active,
.mobile-menu-toggle {
  background: #D97706;
  color: #FFFFFF;
}

.btn-soft {
  background: #EFF6FF;
  color: #1D4ED8;
}

.btn-ghost {
  background: #F8FAFC;
  color: #334155;
}

.module-head {
  border-top-color: #2563EB;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,250,252,.96)),
    #FFFFFF;
}

.module-head h2,
.card h3,
.portal-category-head span {
  color: #111827;
}

.portal-summary {
  background: linear-gradient(135deg, #111827, #1D4ED8);
}

.portal-summary h3,
.portal-kicker {
  color: #D97706;
}

.portal-kicker {
  background: rgba(217, 119, 6, .12);
}

.portal-card {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .32), rgba(17, 24, 39, .08)) padding-box,
    linear-gradient(135deg, #2563EB, #111827) border-box;
  background-color: #1D4ED8;
  box-shadow: 0 14px 28px rgba(17, 24, 39, .18);
}

.portal-card::after {
  background: linear-gradient(90deg, #D97706, #F59E0B, color-mix(in srgb, var(--nav-color) 30%, #D97706));
}

.portal-card i {
  background: linear-gradient(135deg, #FFFFFF, rgba(217, 119, 6, .22));
}

.nav-btn {
  border-color: rgba(148, 163, 184, .28);
  color: #111827;
}

.nav-btn i {
  background: rgba(37, 99, 235, .1);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(37,99,235,.1), #FFFFFF);
  border-color: rgba(37, 99, 235, .5);
}

.nav-btn:hover i,
.nav-btn.active i {
  background: #111827;
  color: #FFFFFF;
}

table th {
  background: #EFF6FF;
  color: #111827;
}

tbody tr:hover td,
table tr:hover td {
  background: #F8FAFC;
}

.pill.green,
.risk-chip.green {
  color: #047857;
}

.statusbar {
  background: #111827;
}

/* Final override: keep clicks visually stable */
button,
.card,
.course-card,
.focus-card,
.nav-btn,
.portal-card,
.portal-card i,
.nav-btn i {
  transform: none !important;
  animation-name: none !important;
}
button:hover,
button:active,
.card:hover,
.card:active,
.course-card:hover,
.course-card:active,
.focus-card:hover,
.focus-card:active,
.nav-btn:hover,
.nav-btn:active,
.portal-card:hover,
.portal-card:active,
.portal-card:hover i,
.portal-card:active i,
.nav-btn:hover i,
.nav-btn:active i {
  transform: none !important;
  animation-name: none !important;
}

/* Final protected identity layer */
:root {
  --primary: #0B4F59;
  --primary-dark: #083f47;
  --accent: #F4D35E;
  --bg: #F5F7F9;
  --surface: #FFFFFF;
}
body { background: #F5F7F9 !important; }
.brand-row,
.portal-summary { background: linear-gradient(135deg, #0B4F59, #127684) !important; }
.btn-primary { background: #0B4F59 !important; color: #FFFFFF !important; }
.btn-primary:hover,
.icon-btn:hover { background: #63C7F2 !important; color: #0B4F59 !important; }
.btn-accent,
.mobile-menu-toggle { background: #F4D35E !important; color: #0B4F59 !important; }
.brand h1,
.module-head h2,
.card h3,
.portal-hero h2,
.portal-category-head span,
.portal-card b,
table th { color: #0B4F59 !important; }
.portal-hero-main { border-left-color: #63C7F2 !important; }
.nav-btn.active { border-color: #F4D35E !important; background: #fff9dc !important; color: #0B4F59 !important; }
.nav-btn:hover { border-color: #63C7F2 !important; color: #0B4F59 !important; }
.nav-btn:hover i,
.nav-btn.active i { background: #0B4F59 !important; color: #FFFFFF !important; }
.portal-card {
  background: #FFFFFF !important;
  color: #233745 !important;
  border: 1px solid rgba(11, 79, 89, .16) !important;
  border-left: 5px solid var(--nav-color) !important;
  box-shadow: 0 8px 22px rgba(11, 79, 89, .08) !important;
}
.portal-card::after { background: #F4D35E !important; }
.portal-card i {
  background: color-mix(in srgb, var(--nav-color) 14%, #FFFFFF) !important;
  color: var(--nav-color) !important;
}
.portal-card small { color: #5b6f7c !important; }
.card,
.course-context,
.table-wrap,
.subject-summary,
.portal-category {
  background: #FFFFFF !important;
  border-color: rgba(11, 79, 89, .14) !important;
}
/* Emergency visibility recovery */
html,
body {
  min-height: 100% !important;
}
body:not(.is-authenticated) .login-screen {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}
body.is-authenticated .app-shell {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}
body.is-authenticated main,
body.is-authenticated .module.active {
  display: block !important;
  min-height: 320px !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.login-panel,
.topbar,
main,
.module.active > * {
  position: relative;
  z-index: 2;
}
.login-screen {
  z-index: 5;
}
/* Revert emergency visibility behavior */
body:not(.is-authenticated) .app-shell,
body:not(.is-authenticated) .statusbar {
  display: none !important;
}
body.is-authenticated .login-screen {
  display: none !important;
}
/* DC Gestion Educativa final identity */
:root {
  --primary: #1E40AF;
  --primary-dark: #0F172A;
  --accent: #FACC15;
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --line: #CBD5E1;
  --muted: #64748B;
  --text: #0F172A;
}
body {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}
.brand-row,
.portal-summary {
  background: linear-gradient(135deg, #0F172A, #1E40AF) !important;
}
.btn-primary {
  background: #1E40AF !important;
  color: #FFFFFF !important;
}
.btn-primary:hover,
.icon-btn:hover {
  background: #38BDF8 !important;
  color: #0F172A !important;
}
.btn-accent,
.mobile-menu-toggle {
  background: #FACC15 !important;
  color: #0F172A !important;
}
.brand h1,
.module-head h2,
.card h3,
.portal-hero h2,
.portal-category-head span,
.portal-card b,
.platform-vision h3,
.capability-card b,
table th {
  color: #0F172A !important;
}
.platform-vision {
  width: min(100%, 1640px);
  margin: 16px auto 0;
  padding: 18px;
  background: #FFFFFF !important;
  border: 1px solid rgba(15, 23, 42, .12) !important;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}
.platform-vision-head {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}
.platform-vision-head span {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FEF9C3;
  color: #0F172A;
  font-weight: 900;
  font-size: .75rem;
  text-transform: uppercase;
}
.platform-vision-head h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}
.platform-vision-head p {
  margin: 0;
  color: #64748B;
  line-height: 1.45;
}
.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.capability-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  background: #FFFFFF !important;
  border: 1px solid rgba(15, 23, 42, .12) !important;
  border-radius: 8px;
  padding: 14px;
}
.capability-card i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #E0F2FE;
  color: #1E40AF;
}
.capability-card b {
  display: block;
  margin-bottom: 7px;
}
.capability-card small {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.capability-card small span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #F1F5F9;
  color: #334155;
  font-size: .72rem;
  font-weight: 800;
}
/* Fixed readable project menu */
.topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background: #FFFFFF !important;
  border-bottom: 1px solid #CBD5E1 !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .14) !important;
}
.brand-row {
  background: linear-gradient(135deg, #0F172A, #1E40AF) !important;
  border-bottom: 4px solid #FACC15 !important;
}
.brand h1,
.brand p,
.year-control {
  color: #FFFFFF !important;
  text-shadow: none !important;
}
.brand h1 {
  font-size: clamp(1.35rem, 2vw, 1.9rem) !important;
  line-height: 1.12 !important;
  font-weight: 900 !important;
}
.brand p {
  display: block !important;
  opacity: .96 !important;
}
.nav-scroll {
  position: sticky !important;
  top: 0 !important;
  z-index: 1001 !important;
  background: #FFFFFF !important;
  border-bottom: 1px solid #CBD5E1 !important;
  display: flex !important;
  gap: 10px !important;
  overflow-x: auto !important;
  padding: 12px clamp(14px, 3vw, 34px) !important;
  scrollbar-width: thin;
}
.nav-btn {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
  min-width: 120px !important;
  min-height: 76px !important;
  padding: 9px 12px !important;
  font-weight: 900 !important;
}
.nav-btn span {
  color: #0F172A !important;
  font-size: .88rem !important;
  line-height: 1.15 !important;
  white-space: normal !important;
}
.nav-btn i {
  background: #E0F2FE !important;
  color: #1E40AF !important;
}
.nav-btn.active {
  background: #FEF9C3 !important;
  border-color: #FACC15 !important;
}
.nav-btn.active i,
.nav-btn:hover i {
  background: #1E40AF !important;
  color: #FFFFFF !important;
}
.app-shell {
  padding-top: var(--topbar-height) !important;
}
@media (max-width: 620px) {
  .brand-row {
    padding-right: 64px !important;
  }
  .mobile-menu-toggle {
    display: grid !important;
    place-items: center !important;
  }
  .nav-scroll {
    display: none !important;
    grid-template-columns: 1fr 1fr !important;
    max-height: calc(100vh - var(--topbar-height)) !important;
  }
  .nav-scroll.open {
    display: grid !important;
  }
  .nav-btn {
    width: 100% !important;
    min-width: 0 !important;
  }
}
/* Roles and permissions matrix */
.permission-panel {
  display: grid;
  gap: 12px;
  width: 100%;
}

.permission-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.permission-panel-head b {
  color: #0f172a;
}

.permission-panel-head small {
  max-width: 620px;
  color: #64748b;
  text-align: right;
}

.permission-table-wrap {
  overflow-x: auto;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #fff;
}

.permission-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
}

.permission-table th,
.permission-table td {
  border-bottom: 1px solid #e8eef6;
  padding: 8px;
  text-align: center;
  white-space: nowrap;
}

.permission-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
  color: #174a7c;
  font-weight: 800;
}

.permission-table tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  color: #17324d;
  text-align: left;
  font-weight: 800;
  min-width: 170px;
}

.permission-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 28px;
  cursor: pointer;
}

.permission-tick input {
  width: 16px;
  height: 16px;
  accent-color: #0b4f59;
}

.permission-tick span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 760px) {
  .permission-panel-head {
    display: block;
  }

  .permission-panel-head small {
    display: block;
    margin-top: 4px;
    text-align: left;
  }
}
/* Final institutional fixed header layout */
body.is-authenticated {
  background: #f5f7f9 !important;
}

.topbar {
  position: fixed !important;
  top: 14px !important;
  left: 3px !important;
  right: 3px !important;
  z-index: 1000 !important;
  background: #ffffff !important;
  border: 3px solid #1f2937 !important;
  border-top-color: #111827 !important;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .18) !important;
  backdrop-filter: none !important;
  overflow: hidden !important;
}

.brand-row {
  display: grid !important;
  grid-template-columns: minmax(300px, 1fr) minmax(280px, 390px) auto !important;
  align-items: center !important;
  gap: 18px !important;
  min-height: 86px !important;
  padding: 14px 24px !important;
  background: linear-gradient(90deg, #062560 0%, #0f3d96 55%, #1f59d0 100%) !important;
  border-bottom: 4px solid #facc15 !important;
}

.brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.logo {
  width: 48px !important;
  height: 48px !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18) !important;
}

.brand h1 {
  color: #ffffff !important;
  font-size: clamp(1.15rem, 2vw, 1.65rem) !important;
  line-height: 1.08 !important;
  margin: 0 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .22) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.brand p {
  display: block !important;
  margin: 4px 0 0 !important;
  color: rgba(255, 255, 255, .92) !important;
  font-size: .82rem !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.active-module-card {
  display: grid !important;
  gap: 4px !important;
  min-height: 68px !important;
  padding: 12px 14px !important;
  background: rgba(255, 255, 255, .98) !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 10px 24px rgba(15, 23, 42, .13) !important;
  color: #0f172a !important;
  overflow: hidden !important;
}

.active-module-card b {
  font-size: .95rem !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  line-height: 1 !important;
}

.active-module-card small {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  color: #64748b !important;
  font-size: .68rem !important;
  line-height: 1.25 !important;
}

.active-module-card small span {
  display: inline-block !important;
  margin-right: 6px !important;
  padding: 2px 6px !important;
  border-radius: 999px !important;
  background: #eaf2ff !important;
  color: #1e40af !important;
  font-weight: 900 !important;
}

.actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.year-control {
  min-height: 44px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(255, 255, 255, .28) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, .12) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18) !important;
}

.year-control select {
  min-height: 32px !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: #ffffff !important;
  color: #1e40af !important;
}

.actions .btn-primary {
  min-height: 44px !important;
  background: #1e40af !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .12) !important;
}

.actions .btn-ghost {
  min-height: 44px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, .55) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .12) !important;
}

.nav-scroll {
  display: flex !important;
  gap: 8px !important;
  align-items: stretch !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 10px 26px 14px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #dbe7f3 !important;
  scroll-behavior: smooth !important;
  scrollbar-width: thin !important;
}

.nav-scroll::-webkit-scrollbar {
  height: 10px !important;
}

.nav-scroll::-webkit-scrollbar-thumb {
  background: #9ca3af !important;
  border-radius: 999px !important;
}

.nav-btn {
  flex: 0 0 102px !important;
  width: 102px !important;
  min-height: 64px !important;
  display: grid !important;
  place-items: center !important;
  gap: 5px !important;
  padding: 9px 8px !important;
  border: 1px solid #d7e4f2 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: none !important;
  text-align: center !important;
  transform: none !important;
}

.nav-btn i {
  width: 30px !important;
  height: 30px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 8px !important;
  background: #eaf2ff !important;
  color: #1e40af !important;
  font-size: 1rem !important;
}

.nav-btn span {
  display: block !important;
  max-width: 100% !important;
  color: inherit !important;
  font-size: .77rem !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.nav-btn.active {
  background: #fff7d6 !important;
  border-color: #facc15 !important;
  color: #0f172a !important;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, .44) !important;
}

.nav-btn.active i,
.nav-btn:hover i {
  background: #1e40af !important;
  color: #ffffff !important;
}

.nav-btn:hover {
  border-color: #38bdf8 !important;
  background: #f8fbff !important;
}

.mobile-menu-toggle {
  display: none !important;
}

@media (max-width: 1120px) {
  .brand-row {
    grid-template-columns: minmax(230px, 1fr) auto !important;
  }

  .active-module-card {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border-width: 0 0 2px !important;
  }

  .brand-row {
    grid-template-columns: 1fr auto !important;
    gap: 10px !important;
    min-height: auto !important;
    padding: 10px 12px !important;
  }

  .brand h1 {
    white-space: normal !important;
    font-size: 1.05rem !important;
  }

  .brand p,
  .actions .icon-btn i {
    display: none !important;
  }

  .actions {
    max-width: 46vw !important;
    overflow-x: auto !important;
  }

  .year-control {
    display: none !important;
  }

  .actions button {
    min-height: 38px !important;
    padding: 0 10px !important;
    font-size: .78rem !important;
  }

  .mobile-menu-toggle {
    display: grid !important;
    place-items: center !important;
    position: absolute !important;
    right: 12px !important;
    bottom: 10px !important;
    width: 38px !important;
    height: 34px !important;
    border-radius: 8px !important;
    background: #facc15 !important;
    color: #0f172a !important;
  }

  .nav-scroll {
    display: none !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 10px 12px !important;
  }

  .nav-scroll.open {
    display: grid !important;
  }

  .nav-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 56px !important;
    grid-template-columns: 30px 1fr !important;
    justify-items: start !important;
    text-align: left !important;
  }
}
/* Compact portal header exact organization */
.topbar {
  top: 6px !important;
  left: 8px !important;
  right: 8px !important;
  border-width: 2px !important;
  border-color: #111827 !important;
  border-radius: 0 !important;
}

.brand-row {
  grid-template-columns: minmax(300px, 1fr) 250px minmax(260px, 390px) auto !important;
  gap: 14px !important;
  min-height: 82px !important;
  padding: 14px 20px !important;
  background: linear-gradient(90deg, #063174 0%, #0e449d 54%, #1e56c7 100%) !important;
}

.brand {
  gap: 12px !important;
}

.logo {
  width: 42px !important;
  height: 42px !important;
  border-radius: 8px !important;
}

.brand h1 {
  font-size: 1.42rem !important;
  max-width: 330px !important;
}

.brand p {
  font-size: .72rem !important;
  max-width: 360px !important;
}

.active-module-card {
  width: 250px !important;
  min-height: 56px !important;
  padding: 9px 11px !important;
  align-content: center !important;
  border-width: 2px !important;
}

.topbar-search {
  min-width: 0 !important;
  align-self: center !important;
}

.topbar-search .search-field input {
  min-height: 40px !important;
  border-color: rgba(255, 255, 255, .62) !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12) !important;
}

.topbar-search .search-field i {
  color: #0e449d !important;
}

.active-module-card b {
  font-size: .78rem !important;
}

.active-module-card small {
  -webkit-line-clamp: 1 !important;
  font-size: .59rem !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  display: block !important;
  text-overflow: ellipsis !important;
}

.active-module-card small span {
  padding: 2px 7px !important;
  font-size: .58rem !important;
}

.actions {
  gap: 8px !important;
}

.year-control {
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 9px !important;
  font-size: .72rem !important;
}

.year-control select {
  min-width: 68px !important;
  min-height: 28px !important;
  padding: 3px 8px !important;
  font-size: .78rem !important;
}

.actions .icon-btn {
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 13px !important;
  border-radius: 8px !important;
  font-size: .82rem !important;
}

.nav-scroll {
  gap: 6px !important;
  padding: 10px 18px 13px !important;
  min-height: 76px !important;
  background: #ffffff !important;
}

.nav-btn {
  flex-basis: 101px !important;
  width: 101px !important;
  min-height: 56px !important;
  padding: 7px 6px !important;
  gap: 4px !important;
}

.nav-btn i {
  width: 28px !important;
  height: 28px !important;
  font-size: .95rem !important;
}

.nav-btn span {
  font-size: .68rem !important;
  line-height: 1.02 !important;
}

#appMain {
  padding-top: 0 !important;
}

.course-context {
  margin-top: 4px !important;
}

@media (max-width: 1280px) {
  .brand-row {
    grid-template-columns: minmax(260px, 1fr) 220px minmax(220px, 1fr) auto !important;
    gap: 10px !important;
  }

  .active-module-card {
    width: 220px !important;
  }

  .actions .icon-btn {
    padding-inline: 10px !important;
  }
}

@media (max-width: 980px) {
  .brand-row {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 240px) !important;
  }

  .topbar-search {
    grid-column: 1 / -1 !important;
  }

  .actions {
    grid-column: 1 / -1 !important;
    justify-content: flex-start !important;
  }
}
/* Module header and action row */
.module-head {
  display: flex !important;
}

.module-actions-inline {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin: 0 0 8px !important;
  padding: 0 !important;
}

.module-actions-inline button {
  min-height: 36px !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
}

.module-actions-inline + .course-context,
.module-actions-inline + .entity-layout-wide,
.module-actions-inline + .card,
.module-actions-inline + .grid {
  margin-top: 0 !important;
}

.module > .course-context:first-child,
.module > .entity-layout-wide:first-child,
.module > .grid:first-child,
.module > .card:first-child {
  margin-top: 0 !important;
}

@media (max-width: 760px) {
  .module-actions-inline {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
  }
}

/* Legacy-style Profesores module */
.professors-page {
  width: min(100%, 1640px);
  margin-inline: auto;
  font-weight: 400;
}

.professors-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #0d7aff;
  color: #ffffff;
}

.professors-hero h2 {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0;
}

.professors-hero p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .86);
  font-size: .92rem;
}

.professors-hero .school-year-badge {
  background: rgba(255, 255, 255, .16);
  color: #ffffff;
}

.staff-hero-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 220px);
  gap: 10px;
  align-items: end;
  flex: 1 1 520px;
  max-width: 720px;
}

.staff-hero-search label {
  color: #ffffff;
}

.staff-hero-search input,
.staff-hero-search select {
  border-color: rgba(255, 255, 255, .55);
  background: #ffffff;
}

.professors-card {
  padding: 14px 14px 16px;
}

.professors-card-head {
  margin-bottom: 16px;
}

.professors-card-head h3 {
  margin: 0;
  color: #10253f;
  font-size: 1rem;
  font-weight: 600;
}

.professors-card .bulk-actions {
  margin: 0 0 18px;
}

.professors-card .table-wrap {
  border-radius: 7px;
  box-shadow: none;
}

.professors-card table {
  min-width: 980px;
}

.professors-card th {
  background: #f6faff;
  color: #24415f;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .03em;
}

.professors-card td {
  height: 52px;
  padding: 10px 12px;
  color: #1c3049;
  font-size: .78rem;
  font-weight: 400;
}

.professors-card .select-col {
  width: 44px;
}

.teacher-name-cell {
  min-width: 260px;
  text-transform: uppercase;
}

.link-button {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  text-align: left;
  font-weight: 400;
  text-transform: uppercase;
}

.link-button:hover {
  transform: none;
  color: var(--primary);
}

.teacher-delete-btn {
  min-height: 31px !important;
  border-radius: 7px !important;
  background: #ffd9d9 !important;
  color: #dc1f1f !important;
  font-weight: 600 !important;
}

.professors-page button,
.professors-page label,
.professors-page .school-year-badge,
.professors-page .btn-icon {
  font-weight: 500 !important;
}

@media (max-width: 760px) {
  .professors-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .staff-hero-search {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .professors-hero .icon-btn {
    width: fit-content;
  }
}
/* Staff access suggestions */
.access-suggestion-panel {
  background: linear-gradient(180deg, #f8fbff, #ffffff) !important;
  border-color: #bfdbfe !important;
}

.access-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.access-suggestion-status {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #ffffff;
}

.access-suggestion-status b {
  color: #0b4f59;
  font-size: .82rem;
}

.access-create-check {
  margin-top: 10px;
}

@media (max-width: 980px) {
  .access-suggestion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .access-suggestion-grid {
    grid-template-columns: 1fr;
  }
}
/* Configuration inner module shortcuts */
.config-inner-modules {
  margin-top: 16px;
}

.config-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.config-module-group {
  margin-top: 14px;
}

.config-module-group h4 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: .92rem;
  font-weight: 900;
}

.config-module-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  box-shadow: none;
}

.config-module-card i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf2ff;
  color: #1e40af;
}

.config-module-card b {
  display: block;
  margin-bottom: 3px;
  color: #0f172a;
  font-size: .92rem;
}

.config-module-card small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #64748b;
  font-size: .72rem;
  line-height: 1.25;
}

.config-module-card:hover {
  border-color: #38bdf8;
  background: #f8fbff;
}

/* User preference: Helvetica text with normal weight across the app. Keep icon fonts intact. */
body,
button,
input,
select,
textarea {
  font-family: Helvetica, Arial, sans-serif !important;
  font-weight: 400 !important;
}

body :where(h1, h2, h3, h4, h5, h6, p, span, small, label, button, input, select, textarea, th, td, b, strong, a, div, legend) {
  font-family: Helvetica, Arial, sans-serif !important;
  font-weight: 400 !important;
}

body *:not(.fa-solid):not(.fa-regular):not(.fa-brands):not(.fa):not([class^="fa-"]):not([class*=" fa-"]) {
  font-family: Helvetica, Arial, sans-serif !important;
  font-weight: 400 !important;
}

.fa-solid,
.fa-regular,
.fa-brands,
.fa,
i[class^="fa-"],
i[class*=" fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

.fa-solid,
.fa {
  font-weight: 900 !important;
}

.professors-page,
.professors-page :where(h1, h2, h3, h4, h5, h6, p, span, small, label, button, input, select, textarea, th, td, b, strong, a, div, legend) {
  font-family: Helvetica, Arial, sans-serif !important;
  font-weight: 400 !important;
}

.professors-page .fa-solid,
.professors-page .fa-regular,
.professors-page .fa-brands,
.professors-page .fa,
.professors-page i[class^="fa-"],
.professors-page i[class*=" fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

.professors-page .fa-solid,
.professors-page .fa {
  font-weight: 900 !important;
}

/* User view: left menu and unified module style */
body.is-authenticated {
  --sidebar-width: 258px;
}

body.is-authenticated .app-shell {
  padding-top: 0 !important;
}

body.is-authenticated .topbar {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  width: var(--sidebar-width) !important;
  min-height: 100vh !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-right: 1px solid #c7d8ee !important;
  border-bottom: 0 !important;
  background: #ffffff !important;
  box-shadow: 10px 0 26px rgba(15, 23, 42, .12) !important;
}

body.is-authenticated .brand-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  min-height: 0 !important;
  padding: 14px 12px 12px !important;
  background: linear-gradient(180deg, #063174 0%, #0e449d 100%) !important;
}

body.is-authenticated .brand {
  min-width: 0 !important;
  align-items: center !important;
  gap: 10px !important;
}

body.is-authenticated .brand h1 {
  max-width: 178px !important;
  font-size: 1rem !important;
  line-height: 1.12 !important;
  white-space: normal !important;
}

body.is-authenticated .brand p {
  max-width: 178px !important;
  font-size: .66rem !important;
  line-height: 1.2 !important;
}

body.is-authenticated .active-module-card {
  width: 100% !important;
  min-height: 58px !important;
  padding: 9px 10px !important;
}

body.is-authenticated .topbar-search {
  width: 100% !important;
}

body.is-authenticated .actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  width: 100% !important;
  gap: 7px !important;
}

body.is-authenticated .year-control {
  grid-column: 1 / -1 !important;
  justify-content: space-between !important;
  width: 100% !important;
}

body.is-authenticated .actions .icon-btn {
  width: 100% !important;
  justify-content: center !important;
  padding-inline: 8px !important;
  font-size: .72rem !important;
}

body.is-authenticated .nav-scroll {
  flex: 1 1 auto !important;
  display: grid !important;
  grid-auto-rows: minmax(54px, auto) !important;
  align-content: start !important;
  gap: 7px !important;
  min-height: 0 !important;
  width: 100% !important;
  padding: 12px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border-top: 4px solid #ffcf21 !important;
  background: #f7fbff !important;
  box-shadow: inset 0 1px 0 #dbe7f3 !important;
}

body.is-authenticated .nav-btn {
  width: 100% !important;
  min-height: 54px !important;
  flex-basis: auto !important;
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) !important;
  justify-items: start !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  text-align: left !important;
}

body.is-authenticated .nav-btn i {
  width: 32px !important;
  height: 32px !important;
  font-size: .95rem !important;
}

body.is-authenticated .nav-btn span {
  min-width: 0 !important;
  font-size: .8rem !important;
  line-height: 1.15 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated #appMain {
  margin-left: var(--sidebar-width) !important;
  padding-top: clamp(14px, 2vw, 24px) !important;
}

body.is-authenticated .module.active {
  display: grid !important;
  gap: 14px !important;
}

body.is-authenticated .module.active > * {
  width: min(100%, 1680px) !important;
  margin-inline: auto !important;
}

body.is-authenticated .module-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  min-height: 88px !important;
  margin: 0 auto 2px !important;
  padding: 14px 16px !important;
  border: 1px solid #cfe0f5 !important;
  border-left: 5px solid #0b4f59 !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08) !important;
}

body.is-authenticated .module-title-row {
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

body.is-authenticated .module-head-icon {
  --nav-color: #0b4f59;
  --nav-soft: rgba(11, 79, 89, .12);
  width: 44px !important;
  height: 44px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 8px !important;
  background: var(--nav-soft) !important;
  color: var(--nav-color) !important;
}

body.is-authenticated .module-head h2 {
  margin: 0 !important;
  color: #0b345f !important;
  font-size: clamp(1.25rem, 1.7vw, 1.62rem) !important;
  line-height: 1.1 !important;
}

body.is-authenticated .module-head p {
  max-width: 920px !important;
  margin: 5px 0 0 !important;
  color: #52657a !important;
  font-size: .86rem !important;
  line-height: 1.35 !important;
}

body.is-authenticated .module-meta {
  margin-top: 8px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

body.is-authenticated .module-meta span {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 22px !important;
  padding: 3px 8px !important;
  border: 1px solid #dbe7f3 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #31506f !important;
  font-size: .68rem !important;
}

body.is-authenticated .module-head .module-actions-inline {
  flex: 0 0 auto !important;
  margin: 0 !important;
  justify-content: flex-end !important;
}

body.is-authenticated .card,
body.is-authenticated .course-context,
body.is-authenticated .subject-card,
body.is-authenticated .course-card,
body.is-authenticated .focus-card,
body.is-authenticated .portal-card,
body.is-authenticated .config-module-card {
  border: 1px solid #dbe7f3 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06) !important;
}

body.is-authenticated .card,
body.is-authenticated .course-context {
  padding: 14px !important;
}

body.is-authenticated .list-card-head {
  min-height: 42px !important;
  padding-bottom: 10px !important;
  margin-bottom: 10px !important;
  border-bottom: 1px solid #e6eef8 !important;
}

body.is-authenticated .card h3,
body.is-authenticated .list-card-head h3,
body.is-authenticated .subject-card h4,
body.is-authenticated .course-card h4 {
  color: #0b345f !important;
  font-size: .96rem !important;
  line-height: 1.2 !important;
}

body.is-authenticated .table-wrap {
  border: 1px solid #e2edf8 !important;
  border-radius: 8px !important;
  overflow: auto !important;
  background: #ffffff !important;
}

body.is-authenticated table th {
  background: #f3f8ff !important;
  color: #24415f !important;
  font-size: .68rem !important;
}

body.is-authenticated table td {
  border-bottom-color: #edf3fa !important;
}

body.is-authenticated input,
body.is-authenticated select,
body.is-authenticated textarea {
  border-radius: 8px !important;
  border-color: #cfe0f5 !important;
  background: #ffffff !important;
}

body.is-authenticated .compact-editor {
  border-left: 5px solid #63c7f2 !important;
}

body.is-authenticated .empty-state {
  border-radius: 8px !important;
  border: 1px dashed #cfe0f5 !important;
  background: #f8fbff !important;
  color: #52657a !important;
}

@media (max-width: 980px) {
  body.is-authenticated {
    --sidebar-width: 248px;
  }
}

@media (max-width: 760px) {
  body.is-authenticated .app-shell {
    padding-top: 64px !important;
  }

  body.is-authenticated .topbar {
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 64px !important;
    max-height: 100vh !important;
    overflow: visible !important;
    border-right: 0 !important;
    border-bottom: 1px solid #c7d8ee !important;
  }

  body.is-authenticated .brand-row {
    padding: 10px 64px 10px 12px !important;
  }

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

  body.is-authenticated .mobile-menu-toggle {
    display: grid !important;
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 4 !important;
  }

  body.is-authenticated .nav-scroll {
    display: none !important;
    position: fixed !important;
    inset: 64px 0 auto 0 !important;
    width: 100% !important;
    max-height: calc(100vh - 64px) !important;
    padding: 10px !important;
    border-top-width: 3px !important;
    box-shadow: 0 14px 24px rgba(15, 23, 42, .18) !important;
  }

  body.is-authenticated .nav-scroll.open {
    display: grid !important;
  }

  body.is-authenticated #appMain {
    margin-left: 0 !important;
    padding-top: 14px !important;
  }

  body.is-authenticated .module-head {
    align-items: stretch !important;
    flex-direction: column !important;
    min-height: auto !important;
    padding: 12px !important;
  }

  body.is-authenticated .module-title-row {
    grid-template-columns: 40px minmax(0, 1fr) !important;
  }

  body.is-authenticated .module-head-icon {
    width: 38px !important;
    height: 38px !important;
  }

  body.is-authenticated .module-head .module-actions-inline {
    justify-content: flex-start !important;
    overflow-x: auto !important;
  }
}

/* Compact institutional module hero */
body.is-authenticated .module-head.module-hero {
  min-height: 0 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 18px !important;
  padding: 18px 22px !important;
  margin: 0 auto 12px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #1479f6, #0b6ee8) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08) !important;
}

body.is-authenticated .module-hero-content {
  min-width: 0 !important;
}

body.is-authenticated .module-hero-content h1 {
  margin: 0 0 8px !important;
  color: #ffffff !important;
  font-size: clamp(1.55rem, 2.4vw, 1.9rem) !important;
  line-height: 1.08 !important;
}

body.is-authenticated .module-badge {
  width: fit-content !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 28px !important;
  padding: 4px 10px !important;
  margin-bottom: 6px !important;
  border: 1px solid rgba(255, 255, 255, .65) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .08) !important;
  color: #ffffff !important;
  font-size: .82rem !important;
}

body.is-authenticated .module-hero-content p {
  max-width: 920px !important;
  margin: 6px 0 0 !important;
  color: rgba(255, 255, 255, .95) !important;
  font-size: .94rem !important;
  line-height: 1.3 !important;
}

body.is-authenticated .module-hero .module-meta {
  display: none !important;
}

body.is-authenticated .module-hero-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 0 !important;
}

body.is-authenticated .module-hero-actions button {
  min-height: 40px !important;
  padding: 10px 14px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #f2f6ff !important;
  color: #174ecb !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

body.is-authenticated .module-hero-actions button:hover {
  background: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12) !important;
}

body.is-authenticated .module-hero-actions .btn-icon,
body.is-authenticated .module-action-btn .btn-icon {
  min-width: 22px !important;
  padding: 5px 7px !important;
  border-radius: 7px !important;
  background: #1f45ae !important;
  color: #ffffff !important;
  font-size: .68rem !important;
  text-align: center !important;
}

body.is-authenticated .module.active {
  gap: 10px !important;
}

body.is-authenticated .card,
body.is-authenticated .course-context,
body.is-authenticated .attendance-panel,
body.is-authenticated .subject-summary {
  padding: 12px !important;
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}

body.is-authenticated .grid,
body.is-authenticated .entity-layout-wide,
body.is-authenticated .course-layout-wide,
body.is-authenticated .subject-layout-wide {
  gap: 10px !important;
}

body.is-authenticated .form-grid {
  gap: 10px !important;
}

body.is-authenticated .table-wrap table th,
body.is-authenticated .table-wrap table td {
  padding: 8px 10px !important;
  font-size: .82rem !important;
  vertical-align: middle !important;
}

body.is-authenticated .actions-cell {
  width: 1% !important;
  white-space: nowrap !important;
}

body.is-authenticated .actions-cell button {
  min-height: 30px !important;
  padding: 6px 9px !important;
  border-radius: 7px !important;
  font-size: .76rem !important;
}

body.is-authenticated .list-card-head {
  min-height: 0 !important;
  padding-bottom: 8px !important;
  margin-bottom: 8px !important;
}

body.is-authenticated .professors-hero {
  display: none !important;
}

@media (max-width: 760px) {
  body.is-authenticated .module-head.module-hero {
    align-items: flex-start !important;
    flex-direction: column !important;
    padding: 16px !important;
    gap: 12px !important;
  }

  body.is-authenticated .module-hero-content h1 {
    font-size: 1.55rem !important;
  }

  body.is-authenticated .module-hero-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    overflow: visible !important;
  }

  body.is-authenticated .module-hero-actions button {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* UTP pedagogical course report */
.utp-report-builder {
  border-left: 5px solid #1479f6 !important;
}

.utp-report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.utp-report-actions {
  margin-top: 10px;
  justify-content: flex-end;
}

.utp-report-preview {
  background: #ffffff;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.utp-report-cover {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 3px solid #1479f6;
}

.utp-report-cover h1 {
  margin: 4px 0 10px;
  color: #0b4f91;
  font-size: 1.55rem;
}

.utp-report-cover h2 {
  margin: 0;
  color: #173b66;
  font-size: 1rem;
}

.utp-report-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px;
  color: #475569;
  font-size: .82rem;
}

.utp-report-section {
  margin-top: 14px;
}

.utp-report-section h3 {
  margin: 0 0 8px;
  color: #0b345f;
  font-size: 1rem;
}

.utp-report-section p {
  margin: 0 0 8px;
  color: #334155;
  line-height: 1.45;
}

.utp-report-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.pill.orange {
  background: #ffedd5 !important;
  color: #9a3412 !important;
}

body.is-authenticated table tr:has(input[type="checkbox"]:checked) {
  background: #eaf4ff !important;
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
}

body.is-authenticated .select-col {
  width: 42px !important;
  text-align: center !important;
}

/* UTP module visual adaptation */
#module-utp .module-head.module-hero {
  background: linear-gradient(135deg, #0B4F59, #083b43) !important;
  border-radius: 16px !important;
  padding: 20px !important;
  margin-bottom: 18px !important;
}

#module-utp .module-hero-content h1 {
  font-size: 24px !important;
}

#module-utp .module-hero-content p {
  opacity: .9 !important;
}

#module-utp .utp-dashboard {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 18px !important;
}

#module-utp .utp-dashboard .metric {
  border: 1px solid #d9e2ec !important;
  border-left-width: 6px !important;
  border-radius: 14px !important;
  padding: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06) !important;
}

#module-utp .utp-dashboard .metric span {
  display: block !important;
  margin-bottom: 6px !important;
  color: #52616b !important;
  font-size: 13px !important;
}

#module-utp .utp-dashboard .metric strong {
  color: #1f2933 !important;
  font-size: 30px !important;
}

#module-utp .utp-panel {
  padding: 18px !important;
  margin-bottom: 18px !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .05) !important;
}

#module-utp .utp-panel h3 {
  margin-top: 0 !important;
  color: #0B4F59 !important;
}

#module-utp .utp-report-filters,
#module-utp .course-context-main {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

#module-utp .utp-report-filters input,
#module-utp .utp-report-filters select,
#module-utp .course-context-main input,
#module-utp .course-context-main select {
  width: 100% !important;
  padding: 10px !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  font-size: 14px !important;
}

#module-utp .utp-report-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 0 0 12px !important;
  justify-content: flex-start !important;
}

#module-utp .utp-report-actions button,
#module-utp .utp-panel .btn-primary,
#module-utp .utp-panel .btn-soft {
  min-height: 38px !important;
  padding: 9px 13px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #0B4F59 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

#module-utp .utp-panel .btn-soft {
  background: #63C7F2 !important;
  color: #083b43 !important;
}

#module-utp .table-wrap {
  overflow-x: auto !important;
}

#module-utp table {
  min-width: 900px;
}

#module-utp table th,
#module-utp table td {
  padding: 9px !important;
  border-bottom: 1px solid #d9e2ec !important;
  font-size: 13px !important;
  text-align: left !important;
}

#module-utp table th {
  background: #eef5f7 !important;
  color: #0B4F59 !important;
}

/* User preference: blue module headers across all sections */
body.is-authenticated .module-head.module-hero,
body.is-authenticated #module-utp .module-head.module-hero {
  background: linear-gradient(135deg, #1479f6, #0b6ee8) !important;
}

body.is-authenticated #module-utp .utp-panel h3 {
  color: #0b4f91 !important;
}

body.is-authenticated #module-utp .utp-report-actions button,
body.is-authenticated #module-utp .utp-panel .btn-primary,
body.is-authenticated #module-utp .utp-panel .btn-soft {
  background: #1479f6 !important;
  color: #ffffff !important;
}

#module-utp .utp-center {
  border-left: 5px solid #1479f6 !important;
}

#module-utp .utp-center .list-card-head {
  align-items: end !important;
}

#module-utp .utp-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

#module-utp .utp-center-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  min-height: 190px;
  padding: 14px;
  border: 1px solid #dbe7f3;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

#module-utp .utp-center-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 10px 20px rgba(15, 23, 42, .1);
}

#module-utp .utp-center-card > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf4ff;
  color: #1479f6;
  font-size: 1.15rem;
}

#module-utp .utp-center-card h3 {
  margin: 0 0 6px !important;
  color: #0b4f91 !important;
  font-size: .98rem !important;
}

#module-utp .utp-center-card p {
  margin: 0;
  color: #52616b;
  font-size: .82rem;
  line-height: 1.35;
}

#module-utp .utp-center-card button {
  width: 100%;
  justify-content: center;
}

#module-utp .utp-focus-ring {
  outline: 3px solid rgba(20, 121, 246, .32);
  outline-offset: 3px;
}

#module-utp .utp-view-hidden {
  display: none !important;
}

#module-utp .utp-back-row {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 14px;
}

#module-utp .utp-center {
  display: grid;
  gap: 20px;
  border-left: 0 !important;
}

#module-utp .utp-center-group {
  background: rgba(255, 255, 255, .96);
  border: 1px solid #d7e5f4;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}

#module-utp .utp-center-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid #dbe7f3;
}

#module-utp .utp-center-group-head h3 {
  margin: 0 !important;
  color: #172033 !important;
  font-size: 1.2rem !important;
  font-weight: 700;
}

#module-utp .utp-center-group-head span {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #0b57b7;
  font-weight: 700;
  font-size: .85rem;
}

#module-utp .utp-center-group .utp-center-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

#module-utp .utp-center-group .utp-center-card {
  position: relative;
  min-height: 172px;
  place-items: center;
  text-align: center;
  padding: 24px 18px 22px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

#module-utp .utp-center-group .utp-center-card:focus-visible {
  outline: 3px solid rgba(20, 121, 246, .35);
  outline-offset: 3px;
}

#module-utp .utp-center-group .utp-center-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: #ffe066;
}

#module-utp .utp-center-group .utp-center-card > i {
  margin: 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #eaf4ff;
  color: #2454d6;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
}

#module-utp .utp-center-group:nth-child(2) .utp-center-card > i {
  background: #e7fff4;
  color: #059669;
}

#module-utp .utp-center-group:nth-child(3) .utp-center-card > i {
  background: #f1e7ff;
  color: #7c3aed;
}

#module-utp .utp-center-group:nth-child(4) .utp-center-card > i {
  background: #e8fbff;
  color: #0891b2;
}

#module-utp .utp-center-group .utp-center-card h3 {
  color: #172033 !important;
  font-size: 1rem !important;
}

#module-utp .utp-center-group .utp-center-card p {
  max-width: 260px;
  color: #53677a;
}

@media (max-width: 680px) {
  #module-utp .utp-center-grid {
    grid-template-columns: 1fr;
  }

  #module-utp .utp-center-card {
    min-height: 150px;
  }
}

/* UTP PRO: dashboard ejecutivo con KPIs, semaforo y visualizacion tipo informe. */
body.is-authenticated #module-utp .utp-exec {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

body.is-authenticated #module-utp .utp-exec-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b57b7 0%, #0891b2 100%);
  box-shadow: 0 20px 42px rgba(14, 91, 176, .18);
}

body.is-authenticated #module-utp .utp-exec-header span {
  display: block;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .9;
}

body.is-authenticated #module-utp .utp-exec-header h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
  letter-spacing: 0;
}

body.is-authenticated #module-utp .utp-exec-header p {
  margin: 0;
  max-width: 920px;
  color: rgba(255, 255, 255, .88);
  line-height: 1.45;
}

body.is-authenticated #module-utp .utp-gauge {
  --value: 75;
  width: 136px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: end;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 55%, transparent 56%),
    conic-gradient(#ffe066 0 calc(var(--value) * 1%), rgba(255, 255, 255, .26) 0 100%);
  color: #0b345f;
}

body.is-authenticated #module-utp .utp-gauge b,
body.is-authenticated #module-utp .utp-gauge span {
  grid-area: 1 / 1;
}

body.is-authenticated #module-utp .utp-gauge b {
  margin-top: -12px;
  font-size: 1.55rem;
}

body.is-authenticated #module-utp .utp-gauge span {
  margin-top: 34px;
  color: #52616b;
  font-size: .72rem;
}

body.is-authenticated #module-utp .utp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

body.is-authenticated #module-utp .utp-kpi {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 6px 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbe7f3;
  border-left: 5px solid var(--kpi-color, #1479f6);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}

body.is-authenticated #module-utp .utp-kpi.blue { --kpi-color: #1479f6; }
body.is-authenticated #module-utp .utp-kpi.cyan { --kpi-color: #0891b2; }
body.is-authenticated #module-utp .utp-kpi.green { --kpi-color: #16a34a; }
body.is-authenticated #module-utp .utp-kpi.yellow { --kpi-color: #eab308; }
body.is-authenticated #module-utp .utp-kpi.orange { --kpi-color: #f97316; }
body.is-authenticated #module-utp .utp-kpi.red { --kpi-color: #dc2626; }

body.is-authenticated #module-utp .utp-kpi > i {
  grid-row: 1 / 4;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--kpi-color);
  background: color-mix(in srgb, var(--kpi-color) 13%, white);
  font-size: 1.1rem;
}

body.is-authenticated #module-utp .utp-kpi span,
body.is-authenticated #module-utp .utp-kpi small,
body.is-authenticated #module-utp .utp-kpi em {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.is-authenticated #module-utp .utp-kpi span {
  color: #53677a;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

body.is-authenticated #module-utp .utp-kpi b {
  color: #172033;
  font-size: 1.55rem;
  line-height: 1;
}

body.is-authenticated #module-utp .utp-kpi small {
  color: #52616b;
  font-size: .78rem;
}

body.is-authenticated #module-utp .utp-kpi em {
  color: var(--kpi-color);
  font-size: .72rem;
  font-style: normal;
  font-weight: 800;
}

body.is-authenticated #module-utp .utp-mini-spark {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 999px;
  background: #e5edf7;
  overflow: hidden;
}

body.is-authenticated #module-utp .utp-mini-spark i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--kpi-color, #1479f6);
}

body.is-authenticated #module-utp .utp-exec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: 14px;
  align-items: start;
}

body.is-authenticated #module-utp .utp-exec-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.is-authenticated #module-utp .utp-selected-summary {
  margin-bottom: 16px;
  overflow: hidden;
}

body.is-authenticated #module-utp .utp-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

body.is-authenticated #module-utp .utp-summary-head span {
  display: block;
  color: #075bbf;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.is-authenticated #module-utp .utp-summary-head h3 {
  margin: 3px 0 4px;
  color: #0f172a;
  font-size: 1.25rem;
}

body.is-authenticated #module-utp .utp-summary-head p {
  margin: 0;
  color: #52616b;
}

body.is-authenticated #module-utp .utp-summary-head .mini-toolbar {
  justify-content: end;
  margin: 0;
}

body.is-authenticated #module-utp .utp-summary-kpis {
  margin-bottom: 14px;
}

body.is-authenticated #module-utp .utp-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 14px;
}

body.is-authenticated #module-utp .utp-summary-grid section {
  min-width: 0;
  border: 1px solid rgba(20, 121, 246, .14);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

body.is-authenticated #module-utp .utp-summary-grid h4 {
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(20, 121, 246, .14);
  color: #0b345f;
  background: #f4f9ff;
  font-size: .92rem;
}

body.is-authenticated #module-utp .utp-summary-grid .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.is-authenticated #module-utp .utp-course-report-pro,
body.is-authenticated #module-utp .utp-risk-pro {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

body.is-authenticated #module-utp .utp-report-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 3px solid #ffe066;
}

body.is-authenticated #module-utp .utp-report-title span {
  color: #dc2626;
  font-weight: 900;
  text-transform: uppercase;
  font-size: .78rem;
}

body.is-authenticated #module-utp .utp-report-title h3 {
  margin: 4px 0;
  color: #0b345f !important;
  font-size: 1.25rem !important;
}

body.is-authenticated #module-utp .utp-report-title p {
  margin: 0;
  color: #53677a;
}

body.is-authenticated #module-utp .utp-report-title strong {
  min-width: 92px;
  text-align: center;
  padding: 10px 14px;
  border-radius: 8px;
  color: #0b345f;
  background: #eef5f7;
  font-size: 1.55rem;
}

body.is-authenticated #module-utp .utp-course-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

body.is-authenticated #module-utp .utp-course-facts article {
  padding: 10px;
  border: 1px solid #e3edf7;
  border-radius: 8px;
  background: #f8fbff;
}

body.is-authenticated #module-utp .utp-course-facts span {
  display: block;
  color: #53677a;
  font-size: .74rem;
}

body.is-authenticated #module-utp .utp-course-facts b {
  color: #172033;
  font-size: 1.15rem;
}

body.is-authenticated #module-utp .utp-course-report-pro h4 {
  margin: 0 0 10px;
  color: #dc2626;
  font-size: .9rem;
  text-transform: uppercase;
}

body.is-authenticated #module-utp .utp-dist-bars {
  height: 210px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  padding: 12px 8px 4px;
  border-left: 1px solid #dbe7f3;
  border-bottom: 1px solid #dbe7f3;
}

body.is-authenticated #module-utp .utp-dist-bars div {
  display: grid;
  grid-template-rows: 1fr auto auto;
  justify-items: center;
  height: 100%;
  color: #52616b;
  font-size: .72rem;
}

body.is-authenticated #module-utp .utp-dist-bars i {
  align-self: end;
  width: 70%;
  min-height: 8px;
  border-radius: 6px 6px 0 0;
  background: var(--bar-color, #1479f6);
}

body.is-authenticated #module-utp .utp-dist-bars .red { --bar-color: #dc2626; }
body.is-authenticated #module-utp .utp-dist-bars .orange { --bar-color: #f97316; }
body.is-authenticated #module-utp .utp-dist-bars .yellow { --bar-color: #eab308; }
body.is-authenticated #module-utp .utp-dist-bars .blue { --bar-color: #38bdf8; }
body.is-authenticated #module-utp .utp-dist-bars .green { --bar-color: #22c55e; }

body.is-authenticated #module-utp .utp-badge.green,
body.is-authenticated #module-utp .utp-badge.bajo {
  background: #dcfce7;
  color: #166534;
}

body.is-authenticated #module-utp .utp-badge.yellow,
body.is-authenticated #module-utp .utp-badge.medio {
  background: #fef9c3;
  color: #854d0e;
}

body.is-authenticated #module-utp .utp-badge.orange,
body.is-authenticated #module-utp .utp-badge.alto {
  background: #ffedd5;
  color: #9a3412;
}

body.is-authenticated #module-utp .utp-badge.red {
  background: #fee2e2;
  color: #991b1b;
}

body.is-authenticated #module-utp .utp-risk-meter {
  min-width: 104px;
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  gap: 7px;
}

body.is-authenticated #module-utp .utp-risk-meter i {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #eab308, #f97316, #dc2626);
}

body.is-authenticated #module-utp .utp-risk-meter b {
  font-size: .78rem;
  color: #172033;
}

/* Informe UTP academico: formato tipo documento, respetando azul/celeste/amarillo institucional. */
body.is-authenticated #module-utp .utp-academic-report,
.utp-academic-report {
  max-width: 1120px;
  margin-inline: auto;
  padding: 28px;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
}

.utp-academic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 4px solid #ffe066;
}

.utp-report-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.utp-report-logo {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  padding: 7px;
  border-radius: 8px;
  background: #0b57b7;
  color: #ffffff;
  overflow: hidden;
}

.utp-report-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.utp-report-brand b {
  display: block;
  color: #0b345f;
  font-size: 1.05rem;
}

.utp-report-brand span,
.utp-report-title-block span {
  color: #52616b;
  font-size: .84rem;
}

.utp-report-title-block {
  text-align: right;
}

.utp-report-title-block h1 {
  margin: 0 0 5px;
  color: #0f172a;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.utp-report-title-block strong,
.utp-report-course-data h3,
.utp-report-main-record h3,
.utp-report-side h3,
.utp-report-section h3,
.utp-report-footer h3 {
  color: #0b57b7;
}

.utp-report-title-block strong {
  display: block;
  font-size: 1.05rem;
}

.utp-report-topline {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 230px 320px;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
}

.utp-report-course-data,
.utp-report-summary-box,
.utp-report-chart-card,
.utp-report-side section {
  border: 1px solid #dbe7f3;
  background: #ffffff;
}

.utp-report-course-data,
.utp-report-summary-box,
.utp-report-chart-card {
  padding: 14px;
}

.utp-report-course-data h3,
.utp-report-main-record h3,
.utp-report-side h3,
.utp-report-section h3,
.utp-report-footer h3 {
  margin: 0 0 12px;
  font-size: .95rem;
  font-weight: 900;
  text-transform: uppercase;
}

.utp-report-course-data p {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  margin: 8px 0;
  font-size: .86rem;
}

.utp-report-course-data b {
  color: #172033;
}

.utp-report-summary-box h4,
.utp-report-chart-card h4 {
  margin: 0 0 10px;
  color: #0b345f;
  text-align: center;
  font-size: .82rem;
  font-weight: 900;
}

.utp-report-summary-box article {
  display: grid;
  place-items: center;
  min-height: 64px;
  margin-bottom: 8px;
  border: 1px solid #dbe7f3;
  background: #f8fbff;
}

.utp-report-summary-box span {
  color: #172033;
  font-size: .78rem;
  font-weight: 800;
}

.utp-report-summary-box b {
  color: #0f172a;
  font-size: 1.45rem;
}

.utp-academic-report .ok,
.utp-report-status.ok {
  color: #16803a !important;
  font-weight: 900;
}

.utp-academic-report .bad,
.utp-report-status.bad {
  color: #dc2626 !important;
  font-weight: 900;
}

.utp-report-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.utp-report-main-record {
  min-width: 0;
}

.utp-academic-report table {
  width: 100%;
  min-width: 0 !important;
  border-collapse: collapse;
}

.utp-academic-report th {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #334155 !important;
  font-size: .74rem !important;
}

.utp-academic-report td {
  border: 1px solid #d9e2ec !important;
  font-size: .76rem !important;
  padding: 7px 8px !important;
}

.utp-report-total-line {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe7f3;
  border-top: 0;
  font-size: .84rem;
}

.utp-report-side {
  display: grid;
  gap: 14px;
}

.utp-report-side section {
  padding: 12px;
}

.utp-report-side p {
  margin: 0 0 8px;
  color: #334155;
  font-size: .8rem;
  line-height: 1.45;
}

.utp-report-donut {
  --value: 70;
  width: 150px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 6px auto 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 55%, transparent 56%),
    conic-gradient(#22c55e 0 calc(var(--value) * 1%), #eab308 0 76%, #f97316 0 88%, #dc2626 0 100%);
}

.utp-report-donut.attendance {
  background:
    radial-gradient(circle at center, #ffffff 0 55%, transparent 56%),
    conic-gradient(#22c55e 0 calc(var(--value) * 1%), #e5e7eb 0 100%);
}

.utp-report-donut b,
.utp-report-donut span {
  grid-area: 1 / 1;
}

.utp-report-donut b {
  margin-top: -12px;
  color: #0f172a;
  font-size: 1.5rem;
}

.utp-report-donut span {
  margin-top: 34px;
  color: #52616b;
  font-size: .72rem;
}

.utp-report-legend {
  display: grid;
  gap: 5px;
  padding: 0;
  margin: 0;
  list-style: none;
  color: #334155;
  font-size: .78rem;
}

.utp-report-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 2px;
}

.utp-report-legend .green { background: #22c55e; }
.utp-report-legend .blue { background: #38bdf8; }
.utp-report-legend .yellow { background: #eab308; }
.utp-report-legend .orange { background: #f97316; }
.utp-report-legend .red { background: #dc2626; }

.utp-report-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dbe7f3;
}

.utp-report-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #dbe7f3;
}

.utp-report-footer p {
  margin: 5px 0;
  font-size: .78rem;
}

.utp-report-signature {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.utp-report-signature span {
  width: 210px;
  height: 46px;
  border-bottom: 2px solid #172033;
}

@media (max-width: 1100px) {
  .utp-report-topline,
  .utp-report-body-grid,
  .utp-report-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  body.is-authenticated #module-utp .utp-exec-grid,
  body.is-authenticated #module-utp .utp-exec-grid.two {
    grid-template-columns: 1fr;
  }

  body.is-authenticated #module-utp .utp-summary-head,
  body.is-authenticated #module-utp .utp-summary-grid {
    grid-template-columns: 1fr;
  }

  body.is-authenticated #module-utp .utp-summary-head .mini-toolbar {
    justify-content: start;
  }

  body.is-authenticated #module-utp .utp-course-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body.is-authenticated #module-informes .mini-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.is-authenticated #module-informes .mini-toolbar label,
  body.is-authenticated #module-informes .mini-toolbar button {
    width: 100%;
  }

  .report-paper {
    width: 100%;
    min-height: auto;
    padding: 28px 16px 22px;
    border-radius: 0;
  }

  .report-header,
  .report-student,
  .report-summary-line,
  .report-note-grid,
  .signature-row,
  .report-course-top {
    grid-template-columns: 1fr;
  }

  .report-header {
    justify-items: center;
    text-align: center;
  }

  .report-title {
    font-size: 1.05rem;
  }

  .report-footer {
    margin-inline: -16px;
    padding-inline: 16px;
  }

  body.is-authenticated #module-utp .utp-exec-header {
    grid-template-columns: 1fr;
  }

  body.is-authenticated #module-utp .utp-gauge {
    justify-self: start;
  }

  body.is-authenticated #module-utp .utp-course-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-authenticated #module-utp .utp-report-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .topbar,
  .module-hero,
  .utp-report-builder,
  .statusbar,
  .no-print {
    display: none !important;
  }

  body.is-authenticated #appMain {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .module.active > *:not(.utp-report-preview) {
    display: none !important;
  }

  .utp-report-preview {
    display: block !important;
    width: auto !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}

/* Responsive global final: mantiene toda la plataforma dentro del viewport en desktop, tablet y celular. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

table {
  width: 100%;
}

.app-shell,
#appMain,
.module,
.module.active,
.content,
.dashboard-home,
.portal-metrics,
.portal-sections,
.config-grid,
.config-card,
.card,
.course-context,
.attendance-panel,
.layout-insight-wrap,
.layout-report-actions {
  max-width: 100% !important;
  min-width: 0 !important;
}

body.is-authenticated .app-shell {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

body.is-authenticated #appMain {
  width: auto !important;
  max-width: calc(100vw - var(--win-sidebar-width, 92px)) !important;
  overflow-x: hidden !important;
  padding-inline: clamp(12px, 2vw, 24px) !important;
}

body.is-authenticated .module.active {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

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

body.is-authenticated .brand-row {
  max-width: calc(100vw - var(--win-sidebar-width, 92px)) !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body.is-authenticated .brand,
body.is-authenticated .brand > div,
body.is-authenticated .topbar-search,
body.is-authenticated .actions {
  min-width: 0 !important;
}

body.is-authenticated .topbar-search .search-field,
body.is-authenticated .topbar-search input {
  width: 100% !important;
  min-width: 0 !important;
}

body.is-authenticated .actions {
  max-width: 100% !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
}

body.is-authenticated .nav-scroll {
  max-width: 100% !important;
}

body.is-authenticated .dashboard-home,
body.is-authenticated #module-inicio .home-grid,
body.is-authenticated .portal-card-grid,
body.is-authenticated .layout-insight-grid,
body.is-authenticated .config-quick-grid,
body.is-authenticated .config-form,
body.is-authenticated .form-grid,
body.is-authenticated .mini-toolbar,
body.is-authenticated .attendance-controls {
  width: 100% !important;
  max-width: 100% !important;
}

body.is-authenticated #module-inicio .home-grid,
body.is-authenticated .portal-card-grid,
body.is-authenticated .layout-insight-grid,
body.is-authenticated .config-quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)) !important;
  gap: clamp(12px, 2vw, 20px) !important;
}

body.is-authenticated .form-grid,
body.is-authenticated .config-form,
body.is-authenticated .mini-toolbar,
body.is-authenticated .attendance-controls,
body.is-authenticated .utp-report-filters {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)) !important;
}

body.is-authenticated .card,
body.is-authenticated .home-card,
body.is-authenticated .portal-card,
body.is-authenticated .layout-insight,
body.is-authenticated .config-card,
body.is-authenticated .course-card,
body.is-authenticated .subject-card,
body.is-authenticated .focus-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  overflow-wrap: break-word;
}

body.is-authenticated label,
body.is-authenticated input,
body.is-authenticated select,
body.is-authenticated textarea {
  min-width: 0 !important;
  width: 100%;
}

body.is-authenticated .form-actions,
body.is-authenticated .actions-cell,
body.is-authenticated .button-group,
body.is-authenticated .toolbar,
body.is-authenticated .data-actions {
  max-width: 100% !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body.is-authenticated button,
body.is-authenticated .btn-primary,
body.is-authenticated .btn-soft,
body.is-authenticated .btn-ghost,
body.is-authenticated .btn-danger {
  max-width: 100% !important;
}

body.is-authenticated .table-wrap,
body.is-authenticated .permission-table-wrap,
body.is-authenticated .grade-table-wrap,
body.is-authenticated .attendance-card {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

body.is-authenticated .table-wrap table,
body.is-authenticated .permission-table,
body.is-authenticated .grade-table-wrap table {
  width: 100% !important;
  min-width: min(720px, 100vw) !important;
}

body.is-authenticated .attendance-grid {
  max-width: 100% !important;
  overflow-x: auto !important;
}

h1,
h2,
h3,
p,
span,
button,
td,
th,
label,
small,
b {
  overflow-wrap: break-word;
  word-break: normal;
}

@media (max-width: 1024px) {
  body.is-authenticated #appMain {
    max-width: calc(100vw - var(--win-sidebar-width, 92px)) !important;
  }

  body.is-authenticated .brand-row {
    max-width: calc(100vw - var(--win-sidebar-width, 92px)) !important;
    grid-template-columns: minmax(180px, 1fr) auto !important;
  }

  body.is-authenticated .topbar-search {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  body.is-authenticated .app-shell {
    padding-top: 0 !important;
  }

  body.is-authenticated #appMain {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 84px 14px 20px !important;
  }

  body.is-authenticated .brand-row {
    max-width: 100vw !important;
    width: 100% !important;
  }

  body.is-authenticated .module.active .module-head.module-hero {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
    padding: 16px !important;
  }

  body.is-authenticated .module.active .module-hero-content h1,
  body.is-authenticated .module.active .module-hero-content p {
    white-space: normal !important;
    height: auto !important;
  }

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

  body.is-authenticated .config-grid,
  body.is-authenticated .config-grid-users,
  body.is-authenticated .permission-panel-body,
  body.is-authenticated .grid.two,
  body.is-authenticated .grid.three,
  body.is-authenticated .grid.four {
    grid-template-columns: 1fr !important;
  }
}

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

  body.is-authenticated .card,
  body.is-authenticated .home-card,
  body.is-authenticated .portal-card,
  body.is-authenticated .config-card {
    padding: 14px !important;
  }

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

  body.is-authenticated .nav-scroll.open {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Auditoria visual 2026: compacta espacios muertos, ordena tarjetas y normaliza grillas responsive. */
body.is-authenticated #appMain {
  width: min(100%, 1760px);
  margin-inline: auto;
}

body.is-authenticated .module.active {
  display: grid;
  gap: 12px;
}

body.is-authenticated .module > * {
  min-width: 0;
}

body.is-authenticated .module-head.module-hero {
  margin-bottom: 2px !important;
}

body.is-authenticated .card,
body.is-authenticated .course-context,
body.is-authenticated .attendance-panel,
body.is-authenticated .layout-insight-wrap,
body.is-authenticated .layout-report-actions {
  border-radius: 8px !important;
}

body.is-authenticated .layout-insight-wrap {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(207, 224, 247, .95);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 26px rgba(15, 44, 82, .06);
}

body.is-authenticated .layout-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.is-authenticated .layout-insight-head h3 {
  margin: 0;
  color: #0f2e4f;
  font-size: .98rem;
}

body.is-authenticated .layout-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body.is-authenticated .layout-insight {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 88px;
  padding: 11px;
  border: 1px solid #dbe7f3;
  border-left: 4px solid #1479f6;
  border-radius: 8px;
  background: #fbfdff;
}

body.is-authenticated .layout-insight i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f1ff;
  color: #145fca;
}

body.is-authenticated .layout-insight span,
body.is-authenticated .layout-insight small {
  display: block;
  color: #58708d;
  font-size: .78rem;
  line-height: 1.25;
}

body.is-authenticated .layout-insight b {
  display: block;
  margin: 2px 0;
  color: #102033;
  font-size: 1.22rem;
}

body.is-authenticated .layout-insight.green {
  border-left-color: #15803d;
}

body.is-authenticated .layout-insight.green i {
  background: #dcfce7;
  color: #15803d;
}

body.is-authenticated .layout-insight.yellow {
  border-left-color: #ffcf21;
}

body.is-authenticated .layout-insight.yellow i {
  background: #fff7cc;
  color: #8a6500;
}

body.is-authenticated .layout-insight.red {
  border-left-color: #dc2626;
}

body.is-authenticated .layout-insight.red i {
  background: #fee2e2;
  color: #dc2626;
}

/* Configuracion 2026: dashboard administrativo compacto sin zonas vacias. */
body.is-authenticated #module-configuracion {
  align-content: start;
}

body.is-authenticated #module-configuracion .config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 12px;
  align-items: start;
}

body.is-authenticated #module-configuracion .config-grid-users {
  grid-template-columns: minmax(360px, .95fr) minmax(0, 1.05fr);
}

body.is-authenticated #module-configuracion .config-card {
  display: grid;
  gap: 12px;
  margin-top: 0 !important;
}

body.is-authenticated #module-configuracion .config-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8eef6;
}

body.is-authenticated #module-configuracion .config-section-head h3 {
  margin: 0;
  color: #0f2e4f;
  font-size: 1rem;
}

body.is-authenticated #module-configuracion .config-section-head small {
  max-width: 420px;
  color: #58708d;
  text-align: right;
  line-height: 1.35;
}

body.is-authenticated #module-configuracion .config-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body.is-authenticated #module-configuracion .config-quick-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 116px;
  padding: 12px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 44, 82, .06);
}

body.is-authenticated #module-configuracion .config-quick-card i {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f1ff;
  color: #145fca;
}

body.is-authenticated #module-configuracion .config-quick-card b,
body.is-authenticated #module-configuracion .config-quick-card small {
  display: block;
}

body.is-authenticated #module-configuracion .config-quick-card small {
  color: #58708d;
  font-size: .78rem;
  line-height: 1.3;
}

body.is-authenticated #module-configuracion .config-form {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

body.is-authenticated #module-configuracion .config-role-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

body.is-authenticated #module-configuracion .config-role-summary span {
  min-height: 58px;
  padding: 9px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f8fbff;
  color: #58708d;
  font-size: .76rem;
}

body.is-authenticated #module-configuracion .config-role-summary b {
  display: block;
  color: #0f2e4f;
  font-size: 1.15rem;
}

body.is-authenticated #module-configuracion .config-table {
  margin-top: 0 !important;
}

body.is-authenticated .function-fieldset:has(.permission-panel),
body.is-authenticated .config-card:has(.permission-panel) {
  min-width: 0;
  overflow: visible;
}

body.is-authenticated .permission-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.is-authenticated .permission-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

body.is-authenticated .permission-table-wrap {
  width: 100%;
  max-width: calc(100vw - var(--win-sidebar-width, 92px) - 72px) !important;
  min-width: 0;
  overflow: auto !important;
  overscroll-behavior-inline: contain;
  border-radius: 8px;
}

body.is-authenticated .permission-table {
  width: max-content !important;
  min-width: 980px !important;
  table-layout: fixed;
}

body.is-authenticated .permission-table th,
body.is-authenticated .permission-table td {
  min-width: 112px;
  padding: 9px 8px;
  vertical-align: middle;
}

body.is-authenticated .permission-table tbody th {
  min-width: 190px;
  width: 190px;
}

body.is-authenticated .permission-tick {
  min-height: 36px;
  border: 1px solid #dbe7f3;
  border-radius: 7px;
  background: #ffffff;
}

body.is-authenticated .permission-tick:hover {
  border-color: #1479f6;
  background: #f4f9ff;
}

body.is-authenticated .permission-tick span {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  color: #334155;
  font-size: .72rem;
  font-weight: 800;
}

body.is-authenticated .permission-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

body.is-authenticated .permission-summary article {
  padding: 10px;
  border: 1px solid #dbe7f3;
  border-left: 4px solid #1479f6;
  border-radius: 8px;
  background: #f8fbff;
}

body.is-authenticated .permission-summary span,
body.is-authenticated .permission-summary small {
  display: block;
  color: #58708d;
  font-size: .76rem;
  line-height: 1.3;
}

body.is-authenticated .permission-summary b {
  display: block;
  margin: 2px 0;
  color: #0f2e4f;
  font-size: 1rem;
}

@media (max-width: 1180px) {
  body.is-authenticated #module-configuracion .config-grid,
  body.is-authenticated #module-configuracion .config-grid-users,
  body.is-authenticated .permission-panel-body {
    grid-template-columns: 1fr;
  }

  body.is-authenticated #module-configuracion .config-quick-grid,
  body.is-authenticated #module-configuracion .config-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-authenticated .permission-table-wrap {
    max-width: calc(100vw - 40px) !important;
  }

  body.is-authenticated .permission-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body.is-authenticated #module-configuracion .config-quick-grid,
  body.is-authenticated #module-configuracion .config-form {
    grid-template-columns: 1fr;
  }

  body.is-authenticated #module-configuracion .config-section-head {
    display: grid;
  }

  body.is-authenticated #module-configuracion .config-section-head small {
    max-width: none;
    text-align: left;
  }
}

/* Cabecera de modulo estable: evita que el menu de acciones cambie de tamano entre apartados. */
body.is-authenticated .module-head.module-hero {
  min-height: 118px !important;
  max-height: none !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, clamp(260px, 34vw, 560px)) !important;
  align-items: center !important;
  overflow: hidden !important;
  contain: layout paint !important;
}

body.is-authenticated .module-hero-content {
  display: grid !important;
  align-content: center !important;
  min-height: 86px !important;
  overflow: hidden !important;
}

body.is-authenticated .module-hero-content h1 {
  min-height: 34px !important;
  margin-bottom: 6px !important;
  font-size: 1.75rem !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.is-authenticated .module-hero-content p {
  display: block !important;
  max-width: 920px !important;
  height: 20px !important;
  margin-top: 5px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.is-authenticated .module-badge {
  min-height: 26px !important;
  max-height: 26px !important;
  margin-bottom: 4px !important;
}

body.is-authenticated .module-hero-actions {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  max-height: none !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important;
  gap: 8px !important;
  align-content: center !important;
  overflow: hidden !important;
}

body.is-authenticated .module-hero-actions button {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 12px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  justify-content: center !important;
}

body.is-authenticated .module-hero-actions button i,
body.is-authenticated .module-hero-actions button .btn-icon {
  flex: 0 0 auto !important;
}

@media (max-width: 980px) {
  body.is-authenticated .module-head.module-hero {
    min-height: 148px !important;
    max-height: none !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }

  body.is-authenticated .module-hero-actions {
    max-width: 100% !important;
    width: 100% !important;
  }
}

@media (max-width: 620px) {
  body.is-authenticated .module-head.module-hero {
    min-height: 184px !important;
    max-height: none !important;
  }

  body.is-authenticated .module-hero-actions button {
    max-width: none !important;
  }
}

/* Menu principal 2026: barra superior compacta, iconos centrados y modulos estables. */
body.is-authenticated .topbar {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: grid !important;
  grid-template-rows: auto auto !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-bottom: 1px solid #c7d8ee !important;
  background: #ffffff !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .12) !important;
}

body.is-authenticated .brand-row {
  display: grid !important;
  grid-template-columns: minmax(210px, .9fr) minmax(210px, .7fr) minmax(240px, .8fr) auto !important;
  gap: 10px !important;
  align-items: center !important;
  min-height: 74px !important;
  padding: 10px 18px !important;
  background: linear-gradient(90deg, #07357c 0%, #0f53bd 72%, #1479f6 100%) !important;
  border-bottom: 4px solid #ffcf21 !important;
}

body.is-authenticated .brand {
  min-width: 0 !important;
}

body.is-authenticated .brand h1 {
  max-width: none !important;
  color: #ffffff !important;
  font-size: 1.05rem !important;
  line-height: 1.08 !important;
  white-space: normal !important;
}

body.is-authenticated .brand p {
  display: block !important;
  max-width: 260px !important;
  margin-top: 3px !important;
  color: rgba(255, 255, 255, .86) !important;
  font-size: .68rem !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.is-authenticated .active-module-card {
  min-height: 52px !important;
  max-height: 52px !important;
  width: 100% !important;
  padding: 8px 10px !important;
  overflow: hidden !important;
}

body.is-authenticated .topbar-search {
  width: 100% !important;
  min-width: 0 !important;
}

body.is-authenticated .actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: auto !important;
  gap: 7px !important;
  overflow-x: auto !important;
  padding-bottom: 0 !important;
}

body.is-authenticated .year-control {
  width: auto !important;
  min-width: 142px !important;
  justify-content: space-between !important;
}

body.is-authenticated .actions .icon-btn {
  width: auto !important;
  min-width: 82px !important;
  min-height: 36px !important;
  padding-inline: 10px !important;
  font-size: .75rem !important;
}

body.is-authenticated #appMain {
  margin-left: 0 !important;
  padding-top: clamp(12px, 2vw, 22px) !important;
}

body.is-authenticated .nav-scroll {
  flex: none !important;
  width: 100% !important;
  min-height: 96px !important;
  max-height: 96px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 18px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  border-top: 0 !important;
  background: #f8fbff !important;
  box-shadow: inset 0 -1px 0 #dbe7f3 !important;
  scrollbar-width: thin !important;
}

body.is-authenticated .nav-scroll::before {
  content: "Modulos";
  flex: 0 0 auto;
  align-self: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #0f53bd;
  color: #ffffff;
  font-size: .72rem;
  font-weight: 800;
}

body.is-authenticated .nav-btn {
  flex: 0 0 112px !important;
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
  height: 78px !important;
  min-height: 78px !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 40px minmax(22px, auto) !important;
  place-items: center !important;
  gap: 5px !important;
  padding: 9px 8px 8px !important;
  border: 1px solid #d5e4f4 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #102033 !important;
  text-align: center !important;
  box-shadow: 0 6px 16px rgba(15, 44, 82, .04) !important;
}

body.is-authenticated .nav-btn i {
  width: 34px !important;
  height: 34px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 8px !important;
  color: var(--nav-color) !important;
  background: var(--nav-soft) !important;
  font-size: .98rem !important;
}

body.is-authenticated .nav-btn span {
  min-width: 0 !important;
  width: 100% !important;
  color: inherit !important;
  font-size: .76rem !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

body.is-authenticated .nav-btn.active {
  border-color: #ffcf21 !important;
  background: linear-gradient(135deg, #fff9dc, #eaf4ff) !important;
  color: #0b345f !important;
  box-shadow: inset 0 0 0 1px rgba(255, 207, 33, .75), 0 8px 18px rgba(15, 44, 82, .08) !important;
}

body.is-authenticated .nav-btn:hover {
  border-color: var(--nav-color) !important;
  background: #ffffff !important;
  transform: translateY(-1px) !important;
}

body.is-authenticated .nav-btn.active i,
body.is-authenticated .nav-btn:hover i {
  background: var(--nav-color) !important;
  color: #ffffff !important;
}

body.is-authenticated .nav-inicio { --nav-color: #2563eb; --nav-soft: #e8f1ff; }
body.is-authenticated .nav-estudiantes { --nav-color: #0ea5e9; --nav-soft: #e0f2fe; }
body.is-authenticated .nav-profesores { --nav-color: #7c3aed; --nav-soft: #f1e7ff; }
body.is-authenticated .nav-cursos { --nav-color: #1e40af; --nav-soft: #e8edff; }
body.is-authenticated .nav-asignaturas { --nav-color: #16a34a; --nav-soft: #dcfce7; }
body.is-authenticated .nav-asistencia { --nav-color: #0d9488; --nav-soft: #ccfbf1; }
body.is-authenticated .nav-calificaciones { --nav-color: #f97316; --nav-soft: #ffedd5; }
body.is-authenticated .nav-calendario { --nav-color: #ca8a04; --nav-soft: #fef3c7; }
body.is-authenticated .nav-informes { --nav-color: #4f46e5; --nav-soft: #eef2ff; }
body.is-authenticated .nav-apoderados { --nav-color: #059669; --nav-soft: #d1fae5; }
body.is-authenticated .nav-usuarios { --nav-color: #1d4ed8; --nav-soft: #dbeafe; }
body.is-authenticated .nav-pme,
body.is-authenticated .nav-adeco,
body.is-authenticated .nav-utp { --nav-color: #be185d; --nav-soft: #fce7f3; }

@media (max-width: 1180px) {
  body.is-authenticated .brand-row {
    grid-template-columns: minmax(210px, 1fr) minmax(210px, .8fr) auto !important;
  }

  body.is-authenticated .topbar-search {
    display: none !important;
  }
}

@media (max-width: 760px) {
  body.is-authenticated .app-shell {
    padding-top: var(--topbar-height) !important;
  }

  body.is-authenticated .topbar {
    min-height: 64px !important;
    max-height: none !important;
  }

  body.is-authenticated .brand-row {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 64px !important;
    padding: 8px 64px 8px 12px !important;
  }

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

  body.is-authenticated .mobile-menu-toggle {
    display: grid !important;
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 5 !important;
  }

  body.is-authenticated .nav-scroll {
    display: none !important;
    position: fixed !important;
    inset: 64px 0 auto 0 !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: calc(100vh - 64px) !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    padding: 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #f8fbff !important;
    border-top: 4px solid #ffcf21 !important;
    box-shadow: 0 16px 26px rgba(15, 23, 42, .18) !important;
  }

  body.is-authenticated .nav-scroll.open {
    display: grid !important;
  }

  body.is-authenticated .nav-scroll::before {
    grid-column: 1 / -1;
    width: fit-content;
  }

  body.is-authenticated .nav-btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
    height: 84px !important;
    min-height: 84px !important;
  }
}

@media (max-width: 430px) {
  body.is-authenticated .nav-scroll {
    grid-template-columns: 1fr !important;
  }
}

/* Inicio dashboard tipo app institucional: icono arriba, texto debajo y tarjetas uniformes. */
:root {
  --color-primary: #0b3f91;
  --color-secondary: #1e88e5;
  --color-accent: #f4c400;
  --color-bg: #f5f7fb;
  --color-card: #ffffff;
  --color-text: #102033;
  --color-muted: #64748b;
  --color-border: #dbe4f0;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-hover: 0 12px 32px rgba(15, 23, 42, .14);
  --transition-fast: .2s ease;
}

body.is-authenticated #module-inicio .dashboard-home {
  display: grid;
  gap: 22px;
  width: min(100%, 1680px) !important;
  padding: clamp(18px, 2.4vw, 30px);
  border: 1px solid rgba(219, 228, 240, .85);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(248, 251, 255, .96)),
    var(--color-bg);
  box-shadow: var(--shadow-soft);
}

body.is-authenticated #module-inicio .home-header span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--color-primary);
  font-size: .74rem;
  font-weight: 900;
}

body.is-authenticated #module-inicio .home-header h1 {
  margin: 0 0 8px;
  color: var(--color-text);
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  line-height: 1.08;
}

body.is-authenticated #module-inicio .home-header p {
  margin: 0;
  color: #263d66;
  font-size: .96rem;
}

body.is-authenticated #module-inicio .home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

body.is-authenticated #module-inicio .home-card {
  min-height: 220px;
  display: grid;
  grid-template-rows: 74px auto 1fr 22px;
  place-items: center;
  gap: 8px;
  padding: 22px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  color: var(--color-text);
  text-align: center;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

body.is-authenticated #module-inicio .home-card:hover {
  transform: translateY(-4px);
  border-color: var(--nav-color);
  box-shadow: var(--shadow-hover);
}

body.is-authenticated #module-inicio .home-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--nav-soft);
  color: var(--nav-color);
  font-size: 1.65rem;
}

body.is-authenticated #module-inicio .home-card b {
  color: var(--color-text);
  font-size: 1.18rem;
  line-height: 1.12;
}

body.is-authenticated #module-inicio .home-card small {
  max-width: 26ch;
  color: #263d66;
  font-size: .87rem;
  line-height: 1.38;
}

body.is-authenticated #module-inicio .home-access {
  color: #0b5ed7;
  font-size: 1.2rem;
  font-weight: 900;
}

body.is-authenticated #module-inicio .home-card.active,
body.is-authenticated #module-inicio .home-card.nav-inicio {
  border-color: rgba(244, 196, 0, .75);
}

body.is-authenticated .portal-card {
  min-height: 180px !important;
  display: grid !important;
  grid-template-rows: 58px auto 1fr !important;
  place-items: center !important;
  gap: 8px !important;
  border-radius: var(--radius-md) !important;
  background: #ffffff !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
  border-left: 0 !important;
  box-shadow: var(--shadow-soft) !important;
}

body.is-authenticated .portal-card i {
  width: 58px !important;
  height: 58px !important;
  border-radius: 18px !important;
  background: var(--nav-soft) !important;
  color: var(--nav-color) !important;
  box-shadow: none !important;
}

body.is-authenticated .portal-card b {
  color: var(--color-text) !important;
  text-shadow: none !important;
}

body.is-authenticated .portal-card small {
  color: var(--color-muted) !important;
  font-weight: 600 !important;
}

@media (max-width: 1024px) {
  body.is-authenticated #module-inicio .home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body.is-authenticated #module-inicio .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  body.is-authenticated #module-inicio .home-grid {
    grid-template-columns: 1fr;
  }

  body.is-authenticated #module-inicio .home-card {
    min-height: 190px;
  }
}

/* Windows 11 / Microsoft Store layout final: sidebar compacta + header superior. */
:root {
  --win-bg: #f3f8fb;
  --win-sidebar: #eaf7fb;
  --win-card: #ffffff;
  --win-border: #dce8f0;
  --win-text: #1f2937;
  --win-muted: #64748b;
  --win-sidebar-width: 92px;
  --win-header-height: 76px;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-hover: 0 14px 34px rgba(15, 23, 42, .14);
}

body.is-authenticated {
  background: var(--win-bg) !important;
}

body.is-authenticated .app-shell {
  padding-top: 0 !important;
}

body.is-authenticated .topbar {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  width: var(--win-sidebar-width) !important;
  height: 100vh !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: visible !important;
  background: var(--win-sidebar) !important;
  border-right: 1px solid var(--win-border) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

body.is-authenticated .brand-row {
  position: fixed !important;
  top: 0 !important;
  left: var(--win-sidebar-width) !important;
  right: 0 !important;
  z-index: 1001 !important;
  min-height: var(--win-header-height) !important;
  display: grid !important;
  grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr) auto !important;
  gap: 16px !important;
  align-items: center !important;
  padding: 10px 24px !important;
  background: rgba(255, 255, 255, .82) !important;
  backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--win-border) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05) !important;
}

body.is-authenticated .brand {
  min-width: 0 !important;
}

body.is-authenticated .brand h1 {
  color: var(--win-text) !important;
  font-size: 1rem !important;
  line-height: 1.1 !important;
  text-transform: uppercase !important;
}

body.is-authenticated .brand p {
  display: block !important;
  max-width: 280px !important;
  margin-top: 3px !important;
  color: var(--win-muted) !important;
  font-size: .72rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.is-authenticated .logo {
  width: 54px !important;
  height: 54px !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .1) !important;
}

body.is-authenticated .active-module-card {
  display: none !important;
}

body.is-authenticated .topbar-search {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.is-authenticated .topbar-search .search-field input {
  min-height: 42px !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

body.is-authenticated .actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: auto !important;
  overflow-x: auto !important;
}

body.is-authenticated .year-control,
body.is-authenticated .actions .icon-btn {
  min-height: 42px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .78) !important;
}

body.is-authenticated .mobile-menu-toggle {
  display: none !important;
}

body.is-authenticated .nav-scroll {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 14px 8px !important;
  margin-top: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.is-authenticated .nav-scroll::before {
  content: "" !important;
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;
  padding: 0 !important;
  border-radius: 14px !important;
  background: var(--brand-logo) center / contain no-repeat, #ffffff !important;
  box-shadow: var(--shadow-soft) !important;
}

body.is-authenticated .nav-btn {
  flex: 0 0 auto !important;
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;
  height: 64px !important;
  min-height: 64px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 6px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: transparent !important;
  color: #52616f !important;
  box-shadow: none !important;
}

body.is-authenticated .nav-btn i {
  width: 30px !important;
  height: 30px !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--nav-color) !important;
  font-size: 1.2rem !important;
}

body.is-authenticated .nav-btn span {
  width: 100% !important;
  color: inherit !important;
  font-size: .66rem !important;
  line-height: 1.05 !important;
  font-weight: 700 !important;
  text-align: center !important;
  white-space: normal !important;
  -webkit-line-clamp: 2 !important;
}

body.is-authenticated .nav-btn:hover {
  background: rgba(255, 255, 255, .72) !important;
  color: var(--primary) !important;
  transform: none !important;
}

body.is-authenticated .nav-btn.active {
  background: #ffffff !important;
  color: var(--primary) !important;
  box-shadow: var(--shadow-soft) !important;
}

body.is-authenticated .nav-btn.active i,
body.is-authenticated .nav-btn:hover i {
  background: var(--nav-soft) !important;
  color: var(--nav-color) !important;
}

body.is-authenticated .nav-configuracion {
  margin-top: auto !important;
}

body.is-authenticated #appMain {
  margin-left: var(--win-sidebar-width) !important;
  padding-top: calc(var(--win-header-height) + 22px) !important;
  background: var(--win-bg) !important;
}

body.is-authenticated .module.active > * {
  width: min(100%, 1680px) !important;
}

body.is-authenticated .nav-profesores,
body.is-authenticated .nav-usuarios,
body.is-authenticated .nav-orientacion {
  display: none !important;
}

body.is-authenticated #module-inicio .dashboard-home {
  border-radius: 24px !important;
  background: linear-gradient(135deg, #0b4ea2, #1e88e5) !important;
  color: #ffffff !important;
  overflow: hidden !important;
}

body.is-authenticated #module-inicio .home-header span {
  background: rgba(255, 255, 255, .16) !important;
  color: #ffffff !important;
}

body.is-authenticated #module-inicio .home-header h1,
body.is-authenticated #module-inicio .home-header p {
  color: #ffffff !important;
}

body.is-authenticated #module-inicio .home-card {
  background: #ffffff !important;
  border-radius: 20px !important;
}

@media (max-width: 1024px) {
  body.is-authenticated .brand-row {
    grid-template-columns: minmax(220px, 1fr) auto !important;
  }

  body.is-authenticated .topbar-search {
    grid-column: 1 / -1 !important;
    order: 3 !important;
  }
}

@media (max-width: 768px) {
  body.is-authenticated .topbar {
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 64px !important;
    display: block !important;
    background: #ffffff !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--win-border) !important;
  }

  body.is-authenticated .brand-row {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    min-height: 64px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 8px 64px 8px 12px !important;
  }

  body.is-authenticated .topbar-search,
  body.is-authenticated .actions {
    display: none !important;
  }

  body.is-authenticated .mobile-menu-toggle {
    display: grid !important;
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 5 !important;
  }

  body.is-authenticated .nav-scroll {
    display: none !important;
    position: fixed !important;
    inset: 64px 0 auto 0 !important;
    width: 100% !important;
    max-height: calc(100vh - 64px) !important;
    grid-template-columns: repeat(4, minmax(68px, 1fr)) !important;
    gap: 8px !important;
    padding: 10px !important;
    overflow-y: auto !important;
    background: var(--win-sidebar) !important;
    box-shadow: 0 14px 24px rgba(15, 23, 42, .16) !important;
  }

  body.is-authenticated .nav-scroll.open {
    display: grid !important;
  }

  body.is-authenticated .nav-scroll::before {
    display: none !important;
  }

  body.is-authenticated .nav-btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  body.is-authenticated #appMain {
    margin-left: 0 !important;
    padding-top: 84px !important;
  }
}

@media (max-width: 480px) {
  body.is-authenticated .nav-scroll {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

body.is-authenticated .layout-report-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe7f3;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 44, 82, .06);
}

body.is-authenticated .layout-report-actions button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 78px;
  width: 100%;
  padding: 10px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f8fbff;
  color: #0f2e4f;
  text-align: left;
  cursor: pointer;
}

/* Correccion global de desborde en cabeceras de modulos: acciones siempre dentro del ancho visible. */
body.is-authenticated .module.active .module-head.module-hero {
  width: min(100%, 1680px) !important;
  box-sizing: border-box !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, clamp(260px, 34vw, 560px)) !important;
  overflow: hidden !important;
}

body.is-authenticated .module.active .module-hero-content {
  min-width: 0 !important;
  max-width: 100% !important;
}

body.is-authenticated .module.active .module-hero-actions {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
  gap: 8px !important;
  justify-items: stretch !important;
  overflow: hidden !important;
}

body.is-authenticated .module.active .module-hero-actions button {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 980px) {
  body.is-authenticated .module.active .module-head.module-hero {
    grid-template-columns: 1fr !important;
  }
}

body.is-authenticated .layout-report-actions button.active,
body.is-authenticated .layout-report-actions button:hover {
  border-color: #1479f6;
  background: #e8f1ff;
}

/* Ultima capa responsive: previene desbordes globales despues de todas las reglas visuales. */
html,
body,
body.is-authenticated,
body.is-authenticated .app-shell,
body.is-authenticated #appMain,
body.is-authenticated .module.active {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

body.is-authenticated #appMain {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.is-authenticated .module.active > *,
body.is-authenticated .card,
body.is-authenticated .course-context,
body.is-authenticated .attendance-panel,
body.is-authenticated .dashboard-home,
body.is-authenticated .home-grid,
body.is-authenticated .config-grid,
body.is-authenticated .layout-insight-wrap {
  max-width: 100% !important;
  min-width: 0 !important;
}

body.is-authenticated .table-wrap,
body.is-authenticated .permission-table-wrap,
body.is-authenticated .grade-table-wrap {
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

body.is-authenticated .form-grid,
body.is-authenticated .config-form,
body.is-authenticated .mini-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)) !important;
}

body.is-authenticated input,
body.is-authenticated select,
body.is-authenticated textarea,
body.is-authenticated button {
  max-width: 100% !important;
  min-width: 0;
}

body.is-authenticated .module.active .module-head.module-hero {
  max-width: 100% !important;
  overflow: hidden !important;
}

body.is-authenticated .module.active .module-hero-actions {
  max-width: 100% !important;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)) !important;
}

@media (max-width: 768px) {
  body.is-authenticated #appMain {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding-inline: 12px !important;
  }

  body.is-authenticated .brand-row {
    max-width: 100vw !important;
  }

  body.is-authenticated .module.active .module-head.module-hero,
  body.is-authenticated .config-grid,
  body.is-authenticated .config-grid-users,
  body.is-authenticated .permission-panel-body {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated .permission-table-wrap {
    max-width: calc(100vw - 24px) !important;
    margin-inline: -2px;
  }

  body.is-authenticated .permission-table {
    min-width: 860px !important;
  }

  body.is-authenticated .permission-summary {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated .permission-panel-head {
    display: grid;
    gap: 4px;
  }

  body.is-authenticated .permission-panel-head small {
    max-width: none;
    text-align: left;
  }
}

/* Asistencia mensual compacta: muestra el mes completo dentro del ancho disponible. */
body.is-authenticated #module-asistencia {
  gap: 10px !important;
}

body.is-authenticated #module-asistencia .module-head.module-hero {
  min-height: 104px !important;
}

body.is-authenticated #module-asistencia .attendance-panel {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 10px !important;
  margin-bottom: 0 !important;
}

body.is-authenticated #module-asistencia .attendance-controls {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)) !important;
  gap: 8px !important;
}

body.is-authenticated #module-asistencia .attendance-controls button {
  min-height: 34px !important;
  padding: 6px 9px !important;
  font-size: .74rem !important;
}

body.is-authenticated #module-asistencia .attendance-kpis {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)) !important;
  gap: 8px !important;
}

body.is-authenticated #module-asistencia .attendance-kpis article {
  min-height: 52px !important;
  padding: 8px 9px !important;
}

body.is-authenticated #module-asistencia .layout-insight-wrap {
  padding: 10px !important;
}

body.is-authenticated #module-asistencia .layout-insight-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body.is-authenticated #module-asistencia .layout-insight {
  min-height: 68px !important;
  padding: 8px !important;
}

body.is-authenticated #module-asistencia .attendance-card {
  padding: 10px !important;
  overflow: hidden !important;
}

body.is-authenticated #module-asistencia .attendance-card h3 {
  min-height: 30px !important;
  margin-bottom: 6px !important;
}

body.is-authenticated #module-asistencia .attendance-help {
  margin-bottom: 8px !important;
  gap: 6px !important;
}

body.is-authenticated #module-asistencia .attendance-help span {
  padding: 4px 7px !important;
  font-size: .7rem !important;
}

body.is-authenticated #module-asistencia .attendance-grid {
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: minmax(150px, 180px) repeat(var(--days, 31), minmax(28px, 1fr)) 48px 48px 56px 58px !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  max-height: calc(100vh - var(--topbar-height, 0px) - 330px) !important;
  min-height: 280px !important;
  scrollbar-width: thin !important;
}

body.is-authenticated #module-asistencia .att-cell {
  min-height: 32px !important;
  padding: 3px !important;
  font-size: .72rem !important;
}

body.is-authenticated #module-asistencia .att-cell.name {
  min-width: 150px !important;
  font-size: .72rem !important;
}

body.is-authenticated #module-asistencia .day-head b {
  font-size: .68rem !important;
}

body.is-authenticated #module-asistencia .day-lock {
  min-height: 16px !important;
  padding: 0 3px !important;
  font-size: .54rem !important;
}

body.is-authenticated #module-asistencia .att-input {
  width: 25px !important;
  min-height: 24px !important;
  padding: 1px !important;
  font-size: .72rem !important;
}

body.is-authenticated #module-asistencia .att-lock {
  width: 20px !important;
  min-height: 18px !important;
  right: 2px !important;
  bottom: 2px !important;
  font-size: .58rem !important;
}

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

@media (max-width: 768px) {
  body.is-authenticated #module-asistencia .layout-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.is-authenticated #module-asistencia .attendance-grid {
    max-height: 58vh !important;
  }
}

@media (max-width: 480px) {
  body.is-authenticated #module-asistencia .layout-insight-grid {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated #module-asistencia .attendance-grid {
    grid-template-columns: 136px repeat(var(--days, 31), 30px) 44px 44px 50px 54px !important;
  }
}

body.is-authenticated .layout-report-actions i {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #1479f6;
  color: #ffffff;
}

body.is-authenticated .layout-report-actions b,
body.is-authenticated .layout-report-actions small {
  min-width: 0;
}

body.is-authenticated .layout-report-actions b {
  font-size: .9rem;
}

body.is-authenticated .layout-report-actions small {
  color: #58708d;
  font-size: .76rem;
  line-height: 1.25;
}

body.is-authenticated .grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.is-authenticated .grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.is-authenticated .grid.four,
body.is-authenticated .portal-metrics,
body.is-authenticated .utp-dashboard {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body.is-authenticated .table-wrap {
  width: 100%;
  overflow-x: auto;
}

body.is-authenticated .list-table-card table,
body.is-authenticated .attendance-card,
body.is-authenticated .grade-table-wrap table {
  width: 100%;
}

body.is-authenticated .form-actions {
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

body.is-authenticated .compact-editor {
  border-left: 4px solid #1479f6;
}

/* Diagramacion optimizada: Ficha del Alumno concentra datos clave sin dejar espacios muertos. */
body.is-authenticated .nav-ficha {
  --nav-color: #0f766e;
  --nav-soft: #ccfbf1;
}

/* Correccion de visibilidad: Matriculas vuelve al menu principal con color propio. */
body.is-authenticated .nav-matriculas {
  --nav-color: #0891b2;
  --nav-soft: #cffafe;
}

/* Matriculas: formulario por pestanas para mantener datos completos sin saturar la pantalla. */
body.is-authenticated #module-matriculas {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.is-authenticated .matricula-editor {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

body.is-authenticated .matricula-editor .list-card-head {
  align-items: center;
  gap: 12px;
}

body.is-authenticated .matricula-editor .list-card-head label {
  min-width: min(320px, 100%);
}

body.is-authenticated .matricula-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(8, 145, 178, .14);
  border-radius: 8px;
  background: #f0fdfa;
}

body.is-authenticated .matricula-tabs button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #155e75;
  font-weight: 800;
  cursor: pointer;
}

body.is-authenticated .matricula-tabs button.active,
body.is-authenticated .matricula-tabs button:hover {
  border-color: rgba(8, 145, 178, .26);
  background: #ffffff;
  color: #075985;
  box-shadow: 0 8px 18px rgba(8, 145, 178, .12);
}

body.is-authenticated .matricula-form {
  display: grid;
  gap: 14px;
}

body.is-authenticated .matricula-tab-panel {
  display: none;
}

body.is-authenticated .matricula-tab-panel.active {
  display: block;
}

body.is-authenticated .matricula-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

body.is-authenticated .matricula-check-grid .check-row,
body.is-authenticated .matricula-form .check-row {
  min-height: 42px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #d8e6f5;
  border-radius: 8px;
  background: #ffffff;
}

body.is-authenticated #module-matriculas textarea {
  min-height: 88px;
  resize: vertical;
}

body.is-authenticated #module-matriculas .table-wrap {
  width: 100%;
  overflow-x: auto;
}

@media (max-width: 760px) {
  body.is-authenticated .matricula-tabs {
    grid-template-columns: 1fr;
  }

  body.is-authenticated .matricula-editor .list-card-head {
    align-items: stretch;
    flex-direction: column;
  }
}

body.is-authenticated #module-ficha {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.is-authenticated .ficha-alumno {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 100%;
}

body.is-authenticated .ficha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 20px 22px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #075bbf 0%, #0d9488 100%);
  box-shadow: 0 18px 44px rgba(7, 91, 191, .18);
}

body.is-authenticated .ficha-header > div {
  min-width: 0;
}

body.is-authenticated .ficha-header span:not(.ficha-risk) {
  display: block;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .9;
}

body.is-authenticated .ficha-header h2 {
  margin: 4px 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.1;
}

body.is-authenticated .ficha-header p {
  margin: 0;
  color: rgba(255, 255, 255, .86);
}

body.is-authenticated .ficha-risk {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 900;
  background: #ffffff;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32);
}

body.is-authenticated .ficha-risk.green {
  color: #047857;
}

body.is-authenticated .ficha-risk.yellow {
  color: #a16207;
}

body.is-authenticated .ficha-risk.red {
  color: #b91c1c;
}

body.is-authenticated .ficha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 14px;
  width: 100%;
  min-width: 0;
}

body.is-authenticated .ficha-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.is-authenticated .ficha-kpi-grid,
body.is-authenticated .ficha-kpi-grid .layout-insight-grid {
  display: block;
}

body.is-authenticated .ficha-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(20, 121, 246, .14);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
  overflow: hidden;
}

body.is-authenticated .ficha-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 1rem;
}

body.is-authenticated .ficha-card h3 i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #075bbf;
  background: #eaf3ff;
}

body.is-authenticated .ficha-card p {
  margin: 7px 0;
  color: #314763;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body.is-authenticated .ficha-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

body.is-authenticated .ficha-table-wrapper .table-wrap {
  margin: 0;
}

body.is-authenticated .ficha-table-wrapper table {
  width: 100%;
  min-width: 760px;
}

body.is-authenticated #module-ficha .course-context {
  align-items: stretch;
  margin-bottom: 16px;
}

body.is-authenticated #module-ficha .course-context-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  body.is-authenticated .layout-insight-grid,
  body.is-authenticated .grid.three,
  body.is-authenticated .grid.four,
  body.is-authenticated .portal-metrics,
  body.is-authenticated .utp-dashboard,
  body.is-authenticated .layout-report-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

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

  body.is-authenticated .layout-insight-grid,
  body.is-authenticated .layout-report-actions,
  body.is-authenticated .grid.two,
  body.is-authenticated .grid.three,
  body.is-authenticated .grid.four,
  body.is-authenticated .portal-metrics,
  body.is-authenticated .utp-dashboard {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated .layout-insight,
  body.is-authenticated .layout-report-actions button {
    min-height: 72px;
  }

  body.is-authenticated .list-card-head,
  body.is-authenticated .module-hero-actions,
  body.is-authenticated .form-actions {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  body.is-authenticated .list-card-head .form-actions button,
  body.is-authenticated .module-hero-actions button,
  body.is-authenticated .form-actions button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  body.is-authenticated .ficha-header,
  body.is-authenticated #module-ficha .course-context,
  body.is-authenticated #module-ficha .course-context-main {
    display: grid;
  }

  body.is-authenticated .ficha-grid.two {
    grid-template-columns: 1fr;
  }

  body.is-authenticated .ficha-risk {
    width: 100%;
  }
}

@media (max-width: 680px) {
  body.is-authenticated .ficha-header,
  body.is-authenticated .ficha-card {
    padding: 14px;
  }

  body.is-authenticated #module-ficha .course-context-actions button {
    width: 100%;
    justify-content: center;
  }
}

@media print {
  body.is-authenticated #module-ficha .no-print,
  body.is-authenticated #module-ficha .course-context,
  body.is-authenticated #module-ficha .module-hero-actions {
    display: none !important;
  }

  body.is-authenticated #module-ficha .ficha-card,
  body.is-authenticated #module-ficha .ficha-header {
    box-shadow: none !important;
    break-inside: avoid;
  }

  body.is-authenticated #module-ficha .ficha-table-wrapper {
    overflow: visible;
  }
}

/* Permisos: prioridad final para que la matriz use todo el ancho disponible. */
body.is-authenticated #module-configuracion .permission-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.is-authenticated #module-configuracion .permission-panel-body {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.is-authenticated #module-configuracion .permission-table-wrap {
  width: 100% !important;
  max-width: calc(100vw - var(--win-sidebar-width, 92px) - 72px) !important;
  min-width: 0 !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

body.is-authenticated #module-configuracion .permission-table {
  width: max-content !important;
  min-width: 980px !important;
}

body.is-authenticated #module-configuracion .permission-summary {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

body.is-authenticated #module-configuracion .permission-tick span {
  position: static !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
}

@media (max-width: 768px) {
  body.is-authenticated #module-configuracion .permission-table-wrap {
    max-width: calc(100vw - 24px) !important;
  }
}

/* Oculta solo los accesos visuales del panel lateral mostrado en la captura. */
body.is-authenticated .nav-scroll {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.is-authenticated .nav-scroll *,
body.is-authenticated .nav-scroll::before {
  visibility: hidden !important;
}

body.is-authenticated .topbar-search {
  display: grid !important;
  grid-template-columns: auto minmax(180px, 1fr) !important;
  gap: 8px !important;
  align-items: center !important;
  min-width: 260px !important;
}

body.is-authenticated .topbar-home-btn {
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 10px !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 900 !important;
  padding: 0 12px !important;
  white-space: nowrap !important;
}

body.is-authenticated .topbar-home-btn i {
  font-size: 1rem !important;
}

@media (max-width: 900px) {
  body.is-authenticated .topbar-search {
    grid-template-columns: auto minmax(0, 1fr) !important;
    width: 100% !important;
  }
}

/* Boletin individual tipo colegio particular: mantiene datos reales y salida limpia para PDF/impresion. */
.report-student-paper {
  padding: 0 0 .42in !important;
  background: #ffffff !important;
  border: 0;
  border-radius: 0;
  color: #3f4b70;
}

.report-student-paper::before,
.report-student-paper::after,
.report-student-paper .report-watermark {
  display: none;
}

.boletin-cover {
  min-height: 1.58in;
  padding: .24in .46in;
  background: #3f4b78;
  color: #ffffff;
  display: grid;
  grid-template-columns: 1fr 1.2in;
  gap: .28in;
  align-items: center;
  position: relative;
}

.boletin-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .18in;
  min-width: 0;
  text-align: center;
}

.boletin-logo,
.boletin-shield {
  width: .82in;
  height: .82in;
  display: grid;
  place-items: center;
  padding: .07in;
  color: #3f4b78;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  font-size: .34in;
  font-weight: 950;
}

.boletin-logo img,
.boletin-shield img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  aspect-ratio: auto;
}

.boletin-shield {
  justify-self: end;
  width: 1in;
  height: 1in;
  border-radius: 16px;
}

.boletin-brand h2 {
  margin: 0;
  color: #ffffff;
  font-size: .38in;
  line-height: 1.08;
  text-transform: uppercase;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.boletin-brand p {
  margin: .06in 0 0;
  color: #ffffff;
  font-size: .16in;
  font-weight: 800;
  text-transform: uppercase;
}

.boletin-title {
  margin: .32in .48in .22in;
  color: #344166;
  text-align: center;
  font-size: .34in;
  font-weight: 950;
  line-height: 1.1;
}

.boletin-info-panel,
.boletin-grade-panel,
.boletin-observations {
  margin-inline: .48in;
  background: #dbe2fb;
}

.boletin-info-panel {
  padding: .24in .38in;
  display: grid;
  grid-template-columns: 1fr .78fr .5fr;
  gap: .12in .34in;
  align-items: center;
}

.boletin-field {
  display: grid;
  grid-template-columns: 1.38in minmax(0, 1fr);
  gap: .16in;
  align-items: center;
}

.boletin-field.full {
  grid-column: 1 / -1;
}

.boletin-field.small {
  grid-template-columns: .48in minmax(0, 1fr);
}

.boletin-field span {
  color: #3f4b70;
  font-size: .17in;
}

.boletin-field b,
.boletin-grade-row b {
  min-height: .32in;
  padding: .055in .16in;
  border-radius: 999px;
  background: #ffffff;
  color: #2f3a60;
  display: flex;
  align-items: center;
  font-size: .15in;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.boletin-section-title {
  margin: .22in .48in .12in;
  color: #344166;
  text-align: center;
  font-size: .22in;
  font-weight: 950;
}

.boletin-grade-panel {
  padding: .26in .38in;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.42in;
  gap: .38in;
  align-items: start;
}

.boletin-grade-list {
  display: grid;
  gap: .09in;
}

.boletin-grade-row {
  display: grid;
  grid-template-columns: minmax(1.65in, 1fr) 1.75in;
  gap: .18in;
  align-items: center;
  color: #3f4b70;
  font-size: .16in;
}

.boletin-grade-row.accent span,
.boletin-grade-row.accent b {
  font-weight: 950;
}

.boletin-scale {
  padding: .22in .24in;
  background: #bcc8ee;
  color: #344166;
}

.boletin-scale h3 {
  margin: 0 0 .14in;
  color: #344166;
  font-size: .16in;
  font-weight: 950;
}

.boletin-scale p {
  display: grid;
  grid-template-columns: .9in 1fr;
  margin: 0 0 .12in;
  font-size: .15in;
}

.boletin-scale b {
  font-weight: 950;
}

.boletin-observations {
  min-height: 2.62in;
  padding: .18in .24in .28in;
}

.boletin-observations p {
  margin: 0 0 .12in;
  min-height: .42in;
  color: #3f4b70;
  font-size: .14in;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.boletin-observations span {
  display: block;
  height: .34in;
  border-bottom: 1px solid #b8d3b5;
}

.boletin-signatures {
  margin: .44in .72in .28in;
}

.boletin-footer {
  margin: 0 !important;
  padding: .18in .48in !important;
  justify-content: center;
  background: #3f4b78 !important;
  border: 0 !important;
  color: #ffffff !important;
  text-align: center;
  font-size: .15in;
}

.boletin-page-number {
  position: absolute;
  right: .46in;
  bottom: .12in;
  color: rgba(255, 255, 255, .88);
  font-size: .11in;
  font-weight: 800;
}

.boletin-observation-continued {
  margin-top: .14in !important;
  padding: .09in .12in;
  border-left: 4px solid #3f4b78;
  border-radius: 7px;
  background: #ffffff;
  color: #344166 !important;
  font-weight: 800;
}

.boletin-observation-page {
  break-before: page;
  page-break-before: always;
}

.boletin-observations-full {
  min-height: 6.2in;
  background: #ffffff;
  border: 1px solid #dbe3ee;
}

.boletin-observations-full p {
  white-space: normal;
  font-size: .15in;
  line-height: 1.58;
}

.boletin-signatures-print {
  margin-top: .32in;
}

@media (max-width: 760px) {
  .certificate-head {
    grid-template-columns: .62in minmax(0, 1fr) .62in;
    gap: .08in;
  }

  .certificate-logo {
    width: .56in;
    height: .56in;
  }

  .certificate-head h2 {
    font-size: .18in;
  }

  .certificate-body h1 {
    font-size: .28in;
  }

  .certificate-body p {
    font-size: .14in;
    line-height: 1.5;
  }

  .certificate-meta {
    grid-template-columns: 1fr;
  }

  body.is-authenticated #module-informes .report-filter-grid {
    grid-template-columns: 1fr;
  }

  body.is-authenticated #module-informes .report-student-paper,
  body.is-authenticated #module-informes .report-course-paper {
    min-height: auto;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .1);
  }

  .boletin-cover,
  .boletin-info-panel,
  .boletin-grade-panel {
    grid-template-columns: 1fr;
  }

  .boletin-shield {
    justify-self: center;
  }

  .boletin-field,
  .boletin-field.small,
  .boletin-grade-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .boletin-title,
  .boletin-section-title,
  .boletin-info-panel,
  .boletin-grade-panel,
  .boletin-observations {
    margin-inline: 18px;
  }
}

@media print {
  @page {
    size: letter;
    margin: .28in;
  }

  .report-student-paper {
    width: 100% !important;
    max-width: none !important;
    min-height: 10.2in;
    break-after: page;
    page-break-after: always;
  }

  .report-student-paper:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .report-print-page .report-student-paper {
    break-after: auto;
    page-break-after: auto;
  }

  .boletin-cover,
  .boletin-footer,
  .boletin-observations,
  .boletin-signatures {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .boletin-cover {
    margin: 0;
  }

  .boletin-title {
    margin-top: .24in;
  }
}

/* Home hero logo correction: transparent institutional insignias on blue field. */
body.is-authenticated #module-inicio .dashboard-home,
body.visual-modern.is-authenticated #module-inicio .dashboard-home {
  background:
    radial-gradient(circle at 8% 0%, rgba(99, 199, 242, .36), transparent 34%),
    linear-gradient(135deg, #0b3f91 0%, #145fca 58%, #2f8af2 100%) !important;
  border: 1px solid rgba(99, 199, 242, .38) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
}

body.is-authenticated #module-inicio .home-header,
body.visual-modern.is-authenticated #module-inicio .home-header {
  position: relative;
  min-height: clamp(168px, 19vw, 220px);
  padding: clamp(28px, 4vw, 48px) clamp(88px, 11vw, 150px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: hidden;
}

body.is-authenticated #module-inicio .home-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 29, 70, .22), rgba(255, 255, 255, .07));
  pointer-events: none;
}

body.is-authenticated #module-inicio .home-header > span,
body.is-authenticated #module-inicio .home-header > h1,
body.is-authenticated #module-inicio .home-header > p {
  position: relative;
  z-index: 2;
}

body.is-authenticated #module-inicio .home-header > span,
body.visual-modern.is-authenticated #module-inicio .home-header > span {
  width: fit-content;
  margin-bottom: 12px;
  padding: 0 !important;
  background: transparent !important;
  color: rgba(255, 255, 255, .86) !important;
  font-weight: 800;
}

body.is-authenticated #module-inicio .home-header h1,
body.visual-modern.is-authenticated #module-inicio .home-header h1 {
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(5, 25, 54, .24);
}

body.is-authenticated #module-inicio .home-header p,
body.visual-modern.is-authenticated #module-inicio .home-header p {
  color: rgba(255, 255, 255, .92) !important;
  text-shadow: 0 1px 8px rgba(5, 25, 54, .18);
}

body.is-authenticated #module-inicio .home-corner-logo {
  position: absolute;
  z-index: 1;
  top: clamp(16px, 2vw, 24px);
  width: clamp(58px, 7vw, 104px);
  height: clamp(58px, 7vw, 104px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  opacity: .92;
  pointer-events: none;
}

body.is-authenticated #module-inicio .home-corner-logo-left {
  left: clamp(16px, 2.4vw, 34px);
}

body.is-authenticated #module-inicio .home-corner-logo-right {
  right: clamp(16px, 2.4vw, 34px);
}

body.is-authenticated #module-inicio .home-corner-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center;
  aspect-ratio: auto;
  mix-blend-mode: normal;
}

@media (max-width: 780px) {
  body.is-authenticated #module-inicio .home-header,
  body.visual-modern.is-authenticated #module-inicio .home-header {
    min-height: 176px;
    padding: 84px 18px 22px !important;
  }

  body.is-authenticated #module-inicio .home-corner-logo {
    width: 54px;
    height: 54px;
    top: 16px;
  }
}

/* Final reports header override: white top, corner logos, original alpha preserved. */
.report-paper .report-header,
.report-student-paper .report-header,
.planner-institutional-doc .planner-doc-header {
  min-height: 1.25in !important;
  display: grid !important;
  grid-template-columns: 1.05in minmax(0, 1fr) 1.05in !important;
  gap: .22in !important;
  align-items: center !important;
  margin: 0 0 .2in !important;
  padding: .18in .22in !important;
  border: 1px solid #c7d9ee !important;
  border-top: 8px solid #145fca !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0b3f91 !important;
  box-shadow: none !important;
}

.report-paper .report-header h2,
.report-student-paper .report-header h2,
.planner-institutional-doc .planner-doc-school h1 {
  color: #0b3f91 !important;
  text-align: left !important;
  text-transform: none !important;
}

.report-paper .report-header p,
.report-student-paper .report-header p,
.planner-institutional-doc .planner-doc-school p,
.planner-institutional-doc .planner-doc-school span {
  color: #24415f !important;
  text-align: left !important;
}

.report-paper .report-logo,
.report-student-paper .report-logo,
.planner-institutional-doc .planner-doc-logo,
.boletin-logo,
.boletin-shield {
  width: .92in !important;
  height: .92in !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.report-paper .report-header .report-logo:last-child,
.report-student-paper .report-header .report-logo:last-child,
.boletin-shield {
  justify-self: end !important;
}

.report-paper .report-logo img,
.report-student-paper .report-logo img,
.planner-institutional-doc .planner-doc-logo img,
.boletin-logo img,
.boletin-shield img {
  display: block !important;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  aspect-ratio: auto !important;
}

.report-student-paper .boletin-cover,
.boletin-cover.boletin-cover-print {
  min-height: 1.35in !important;
  display: grid !important;
  grid-template-columns: 1fr 1.1in !important;
  gap: .22in !important;
  align-items: center !important;
  margin: 0 !important;
  padding: .18in .24in !important;
  border: 1px solid #c7d9ee !important;
  border-top: 8px solid #145fca !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0b3f91 !important;
}

.boletin-brand {
  display: grid !important;
  grid-template-columns: 1.05in minmax(0, 1fr) !important;
  gap: .22in !important;
  align-items: center !important;
  justify-content: start !important;
  text-align: left !important;
}

.boletin-brand h2 {
  color: #0b3f91 !important;
  text-align: left !important;
  text-transform: none !important;
}

.boletin-brand p,
.boletin-page-number {
  color: #24415f !important;
  text-align: left !important;
  text-transform: none !important;
}

/* Preview-inspired app shell: same institutional colors, stronger dashboard logic. */
:root {
  --preview-sidebar-width: 285px;
  --preview-radius: 22px;
  --preview-shadow: 0 20px 60px color-mix(in srgb, var(--primary) 16%, transparent);
  --preview-panel: rgba(255, 255, 255, .88);
  --preview-soft: color-mix(in srgb, var(--primary) 10%, #ffffff);
  --preview-line: color-mix(in srgb, var(--primary) 16%, #ffffff);
  --preview-ink: var(--text);
  --modern-blue: var(--primary);
  --modern-cyan: var(--bottom-hover, var(--primary));
  --modern-green: var(--success);
  --modern-pink: var(--accent);
  --modern-violet: var(--primary-dark);
  --modern-amber: var(--accent);
}

body.visual-modern.is-authenticated,
body.is-authenticated {
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 32%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 28%),
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 5%, #ffffff) 0, var(--bg) 360px, #f8fbff 100%) !important;
}

@media (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: var(--preview-sidebar-width) !important;
    height: 100vh !important;
    min-height: 100vh !important;
    display: grid !important;
    grid-template-rows: auto 1fr !important;
    align-content: start !important;
    padding: 20px !important;
    overflow: auto !important;
    background:
      linear-gradient(180deg, var(--primary-dark), var(--primary)) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 12px 0 40px color-mix(in srgb, var(--primary-dark) 22%, transparent) !important;
  }

  body.is-authenticated .brand-row,
  body.visual-modern.is-authenticated .brand-row {
    position: static !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.is-authenticated .brand,
  body.visual-modern.is-authenticated .brand {
    gap: 12px !important;
    align-items: center !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    color: #ffffff !important;
    font-size: 1.2rem !important;
    line-height: 1.08 !important;
    text-shadow: none !important;
  }

  body.is-authenticated .brand p,
  body.visual-modern.is-authenticated .brand p {
    display: block !important;
    color: color-mix(in srgb, #ffffff 78%, var(--accent)) !important;
    font-size: .78rem !important;
  }

  body.is-authenticated .logo,
  body.visual-modern.is-authenticated .logo {
    width: 52px !important;
    height: 52px !important;
    border-radius: 18px !important;
    border: 1px solid rgba(255, 255, 255, .32) !important;
    background:
      linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--accent) 22%, #ffffff)) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .2) !important;
  }

  body.is-authenticated .active-module-card,
  body.visual-modern.is-authenticated .active-module-card {
    display: grid !important;
    gap: 4px !important;
    padding: 14px !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    border-radius: var(--preview-radius) !important;
    background: rgba(255, 255, 255, .13) !important;
    color: #ffffff !important;
  }

  body.is-authenticated .active-module-card *,
  body.visual-modern.is-authenticated .active-module-card * {
    color: #ffffff !important;
  }

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

  body.is-authenticated .topbar-search .search-field input,
  body.visual-modern.is-authenticated .topbar-search .search-field input {
    min-height: 44px !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .12) !important;
  }

  body.is-authenticated .actions,
  body.visual-modern.is-authenticated .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    justify-content: stretch !important;
    overflow: visible !important;
  }

  body.is-authenticated .actions button,
  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .actions button,
  body.visual-modern.is-authenticated .year-control {
    width: 100% !important;
    justify-content: center !important;
    border-radius: 15px !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    visibility: visible !important;
    pointer-events: auto !important;
    display: grid !important;
    grid-auto-flow: row !important;
    grid-auto-columns: auto !important;
    grid-auto-rows: minmax(48px, auto) !important;
    align-content: start !important;
    gap: 7px !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 16px 0 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.is-authenticated .nav-scroll *,
  body.is-authenticated .nav-scroll::before,
  body.visual-modern.is-authenticated .nav-scroll *,
  body.visual-modern.is-authenticated .nav-scroll::before {
    visibility: visible !important;
  }

  body.is-authenticated .nav-scroll::before,
  body.visual-modern.is-authenticated .nav-scroll::before {
    display: none !important;
  }

  body.is-authenticated .nav-btn,
  body.visual-modern.is-authenticated .nav-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    justify-content: start !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: transparent !important;
    color: color-mix(in srgb, #ffffff 88%, var(--accent)) !important;
    text-align: left !important;
    box-shadow: none !important;
  }

  body.is-authenticated .nav-btn i,
  body.visual-modern.is-authenticated .nav-btn i {
    width: 34px !important;
    height: 34px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .14) !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }

  body.is-authenticated .nav-btn span,
  body.visual-modern.is-authenticated .nav-btn span {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body.is-authenticated .nav-btn:hover,
  body.is-authenticated .nav-btn.active,
  body.visual-modern.is-authenticated .nav-btn:hover,
  body.visual-modern.is-authenticated .nav-btn.active {
    background: rgba(255, 255, 255, .18) !important;
    color: #ffffff !important;
  }

  body.is-authenticated .nav-btn:hover i,
  body.is-authenticated .nav-btn.active i,
  body.visual-modern.is-authenticated .nav-btn:hover i,
  body.visual-modern.is-authenticated .nav-btn.active i {
    background: #ffffff !important;
    color: var(--primary-dark) !important;
  }

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    margin-left: var(--preview-sidebar-width) !important;
    max-width: calc(100vw - var(--preview-sidebar-width)) !important;
    padding: 24px !important;
    padding-top: 24px !important;
    overflow-x: hidden !important;
    background: transparent !important;
  }
}

body.is-authenticated .card,
body.is-authenticated .course-context,
body.is-authenticated .module-head,
body.is-authenticated .table-wrap,
body.visual-modern.is-authenticated .card,
body.visual-modern.is-authenticated .course-context,
body.visual-modern.is-authenticated .module-head,
body.visual-modern.is-authenticated .table-wrap {
  border: 1px solid var(--preview-line) !important;
  border-radius: var(--preview-radius) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .78)) !important;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--primary) 9%, transparent) !important;
  backdrop-filter: blur(10px) saturate(1.06);
}

body.is-authenticated .module-head.module-hero,
body.visual-modern.is-authenticated .module-head.module-hero {
  border: 0 !important;
  border-radius: 32px !important;
  color: #ffffff !important;
  background:
    radial-gradient(circle at 92% -18%, rgba(255, 255, 255, .26), transparent 26%),
    linear-gradient(135deg, var(--primary-dark), var(--primary) 58%, color-mix(in srgb, var(--primary) 72%, #ffffff)) !important;
  box-shadow: var(--preview-shadow) !important;
  overflow: hidden !important;
}

body.is-authenticated .module-head.module-hero h1,
body.is-authenticated .module-head.module-hero h2,
body.is-authenticated .module-head.module-hero p,
body.is-authenticated .module-head.module-hero small,
body.visual-modern.is-authenticated .module-head.module-hero h1,
body.visual-modern.is-authenticated .module-head.module-hero h2,
body.visual-modern.is-authenticated .module-head.module-hero p,
body.visual-modern.is-authenticated .module-head.module-hero small {
  color: #ffffff !important;
}

body.is-authenticated #module-inicio .dashboard-home,
body.visual-modern.is-authenticated #module-inicio .dashboard-home {
  border: 0 !important;
  border-radius: 32px !important;
  padding: 0 !important;
  color: var(--preview-ink) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.is-authenticated #module-inicio .home-header,
body.visual-modern.is-authenticated #module-inicio .home-header {
  min-height: clamp(210px, 22vw, 280px) !important;
  display: grid !important;
  align-content: center !important;
  padding: clamp(30px, 4vw, 54px) clamp(92px, 10vw, 150px) !important;
  border: 0 !important;
  border-radius: 32px !important;
  color: #ffffff !important;
  background:
    radial-gradient(circle at 92% -18%, rgba(255, 255, 255, .26), transparent 26%),
    linear-gradient(135deg, var(--primary-dark), var(--primary) 58%, color-mix(in srgb, var(--primary) 72%, #ffffff)) !important;
  box-shadow: var(--preview-shadow) !important;
  overflow: hidden !important;
}

body.is-authenticated #module-inicio .home-header::after,
body.visual-modern.is-authenticated #module-inicio .home-header::after {
  content: "";
  position: absolute;
  right: -64px;
  top: -64px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  pointer-events: none;
}

body.is-authenticated #module-inicio .home-header > span,
body.visual-modern.is-authenticated #module-inicio .home-header > span {
  min-height: 30px;
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  padding: 6px 11px !important;
  border: 1px solid rgba(255, 255, 255, .28) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .14) !important;
  color: #ffffff !important;
}

body.is-authenticated #module-inicio .home-header h1,
body.visual-modern.is-authenticated #module-inicio .home-header h1 {
  margin-top: 8px !important;
  font-size: clamp(2rem, 4vw, 3.2rem) !important;
  color: #ffffff !important;
}

body.is-authenticated #module-inicio .home-header p,
body.visual-modern.is-authenticated #module-inicio .home-header p {
  max-width: 720px !important;
  color: rgba(255, 255, 255, .9) !important;
}

body.is-authenticated #module-inicio .home-grid,
body.visual-modern.is-authenticated #module-inicio .home-grid,
body.is-authenticated .portal-metrics,
body.visual-modern.is-authenticated .portal-metrics {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 16px !important;
  margin-top: 18px !important;
}

body.is-authenticated #module-inicio .home-card,
body.visual-modern.is-authenticated #module-inicio .home-card,
body.is-authenticated .section-link-card,
body.visual-modern.is-authenticated .section-link-card {
  min-height: 168px !important;
  padding: 18px !important;
  border-radius: var(--preview-radius) !important;
  border: 1px solid var(--preview-line) !important;
  background: var(--preview-panel) !important;
  color: var(--text) !important;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--primary) 9%, transparent) !important;
  backdrop-filter: blur(10px);
}

body.is-authenticated #module-inicio .home-icon,
body.visual-modern.is-authenticated #module-inicio .home-icon,
body.is-authenticated .section-link-card i,
body.visual-modern.is-authenticated .section-link-card i {
  width: 52px !important;
  height: 52px !important;
  border-radius: 18px !important;
  display: grid !important;
  place-items: center !important;
  background: var(--preview-soft) !important;
  color: var(--primary) !important;
  font-size: 1.35rem !important;
  box-shadow: none !important;
}

body.is-authenticated .metric,
body.visual-modern.is-authenticated .metric {
  min-height: 118px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 52px !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  gap: 4px 12px !important;
  border-left: 0 !important;
  border-radius: var(--preview-radius) !important;
  padding: 18px !important;
  background: var(--preview-panel) !important;
}

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

body.is-authenticated .metric-icon,
body.visual-modern.is-authenticated .metric-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--preview-soft);
  color: var(--primary);
  font-size: 1.35rem;
}

body.is-authenticated .metric span,
body.visual-modern.is-authenticated .metric span {
  color: var(--muted) !important;
  font-size: .82rem !important;
  font-weight: 900 !important;
}

body.is-authenticated .metric strong,
body.visual-modern.is-authenticated .metric strong {
  color: var(--text) !important;
  font-size: clamp(1.75rem, 3vw, 2.25rem) !important;
  line-height: 1 !important;
}

body.is-authenticated .btn-primary,
body.visual-modern.is-authenticated .btn-primary {
  border-radius: 15px !important;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary) 20%, transparent) !important;
}

body.is-authenticated .btn-accent,
body.visual-modern.is-authenticated .btn-accent {
  border-radius: 15px !important;
  background: var(--accent) !important;
  color: color-mix(in srgb, var(--primary-dark) 80%, #000000) !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 {
  border: 1px solid var(--preview-line) !important;
  border-radius: 15px !important;
  background: #ffffff !important;
  color: var(--primary) !important;
}

body.is-authenticated th,
body.visual-modern.is-authenticated th {
  background: color-mix(in srgb, var(--primary) 9%, #ffffff) !important;
  color: var(--primary) !important;
}

body.is-authenticated input,
body.is-authenticated select,
body.is-authenticated textarea,
body.visual-modern.is-authenticated input,
body.visual-modern.is-authenticated select,
body.visual-modern.is-authenticated textarea {
  border-color: var(--preview-line) !important;
  border-radius: 14px !important;
}

@media (max-width: 980px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    background: #ffffff !important;
  }

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    margin-left: 0 !important;
    max-width: 100vw !important;
  }

  body.is-authenticated #module-inicio .home-header,
  body.visual-modern.is-authenticated #module-inicio .home-header {
    min-height: 190px !important;
    padding: 86px 18px 24px !important;
    border-radius: 24px !important;
  }

  body.is-authenticated #module-inicio .home-grid,
  body.visual-modern.is-authenticated #module-inicio .home-grid,
  body.is-authenticated .portal-metrics,
  body.visual-modern.is-authenticated .portal-metrics {
    grid-template-columns: 1fr !important;
  }
}

/* Modern energetic interface layer: richer icons, color-coded cards and brighter dashboard depth. */
:root {
  --modern-blue: #2563eb;
  --modern-cyan: #06b6d4;
  --modern-green: #10b981;
  --modern-pink: #ec4899;
  --modern-violet: #8b5cf6;
  --modern-amber: #f59e0b;
  --modern-red: #ef4444;
  --modern-ink: #132238;
  --modern-panel: rgba(255, 255, 255, .88);
  --modern-border: rgba(148, 163, 184, .22);
  --modern-shadow: 0 18px 46px rgba(15, 44, 82, .14);
}

body.visual-modern.is-authenticated {
  background:
    radial-gradient(circle at 14% 0%, rgba(37, 99, 235, .18), transparent 28%),
    radial-gradient(circle at 92% 2%, rgba(236, 72, 153, .14), transparent 26%),
    radial-gradient(circle at 50% 18%, rgba(16, 185, 129, .12), transparent 24%),
    linear-gradient(180deg, #f8fbff 0, #eef6ff 340px, #f6f8fb 100%) !important;
}

body.visual-modern.is-authenticated .topbar {
  border-bottom: 1px solid rgba(37, 99, 235, .16) !important;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .94), rgba(241, 248, 255, .92)),
    rgba(255, 255, 255, .92) !important;
  box-shadow: 0 16px 42px rgba(15, 44, 82, .11) !important;
}

body.visual-modern.is-authenticated .brand-row {
  background:
    linear-gradient(90deg, rgba(37, 99, 235, .08), rgba(6, 182, 212, .06) 44%, rgba(245, 158, 11, .08)),
    rgba(255, 255, 255, .78) !important;
}

body.visual-modern.is-authenticated .logo,
body.visual-modern .login-badge {
  border: 1px solid rgba(37, 99, 235, .18) !important;
  background:
    linear-gradient(135deg, #ffffff, #eef6ff 52%, #fff7ed) !important;
}

body.visual-modern.is-authenticated .nav-scroll {
  gap: 9px !important;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .94), rgba(239, 246, 255, .92)) !important;
}

body.visual-modern.is-authenticated .nav-btn {
  min-width: 98px !important;
  min-height: 62px !important;
  border-radius: 16px !important;
  border-color: color-mix(in srgb, var(--nav-color, var(--modern-blue)) 22%, #e5edf8) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.9)) !important;
  box-shadow: 0 10px 24px rgba(15, 44, 82, .07) !important;
}

body.visual-modern.is-authenticated .nav-btn i {
  width: 36px !important;
  height: 34px !important;
  border-radius: 12px !important;
  background: color-mix(in srgb, var(--nav-color, var(--modern-blue)) 13%, #ffffff) !important;
  color: var(--nav-color, var(--modern-blue)) !important;
  font-size: 1.14rem !important;
}

body.visual-modern.is-authenticated .nav-btn.active,
body.visual-modern.is-authenticated .nav-btn:hover {
  color: #0f2e4f !important;
  border-color: color-mix(in srgb, var(--nav-color, var(--modern-blue)) 46%, #ffffff) !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--nav-color, var(--modern-blue)) 15%, #ffffff), #ffffff 56%, rgba(255, 247, 237, .9)) !important;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--nav-color, var(--modern-blue)) 18%, transparent) !important;
}

body.visual-modern.is-authenticated .nav-btn.active i,
body.visual-modern.is-authenticated .nav-btn:hover i {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--nav-color, var(--modern-blue)), color-mix(in srgb, var(--nav-color, var(--modern-blue)) 70%, #ffffff)) !important;
}

body.visual-modern.is-authenticated .btn-primary {
  background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
  box-shadow: 0 14px 30px rgba(37, 99, 235, .24) !important;
}

body.visual-modern.is-authenticated .btn-accent {
  background: linear-gradient(135deg, #facc15, #fb923c) !important;
  color: #332008 !important;
}

body.visual-modern.is-authenticated #module-inicio .dashboard-home {
  border-radius: 18px !important;
  border: 1px solid rgba(37, 99, 235, .18) !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .14), transparent 30%),
    radial-gradient(circle at 100% 4%, rgba(236, 72, 153, .12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(248, 252, 255, .86)) !important;
  box-shadow: var(--modern-shadow) !important;
}

body.visual-modern.is-authenticated #module-inicio .home-header {
  border-radius: 18px !important;
  background:
    linear-gradient(135deg, rgba(13, 63, 145, .94), rgba(37, 99, 235, .88) 48%, rgba(6, 182, 212, .84)),
    var(--visual-home-bg) center / cover no-repeat !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 18px 42px rgba(37, 99, 235, .22) !important;
}

body.visual-modern.is-authenticated #module-inicio .home-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
  gap: 14px !important;
}

body.visual-modern.is-authenticated #module-inicio .home-card,
body.visual-modern.is-authenticated .section-link-card {
  position: relative !important;
  overflow: hidden !important;
  border: 1px solid color-mix(in srgb, var(--nav-color, var(--modern-blue)) 24%, #e5edf8) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .92)) !important;
  box-shadow: 0 14px 30px rgba(15, 44, 82, .09) !important;
}

body.visual-modern.is-authenticated #module-inicio .home-card::before,
body.visual-modern.is-authenticated .section-link-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--nav-color, var(--modern-blue)), color-mix(in srgb, var(--nav-color, var(--modern-blue)) 48%, #ffffff));
}

body.visual-modern.is-authenticated #module-inicio .home-icon,
body.visual-modern.is-authenticated .section-link-card i {
  background: linear-gradient(135deg, var(--nav-color, var(--modern-blue)), color-mix(in srgb, var(--nav-color, var(--modern-blue)) 68%, #ffffff)) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--nav-color, var(--modern-blue)) 22%, transparent) !important;
}

body.visual-modern.is-authenticated #module-inicio .home-access {
  margin-left: auto !important;
  width: 32px !important;
  height: 32px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--nav-color, var(--modern-blue)) 12%, #ffffff) !important;
  color: var(--nav-color, var(--modern-blue)) !important;
}

body.visual-modern.is-authenticated .institution-strip > div,
body.visual-modern.is-authenticated .metric,
body.visual-modern.is-authenticated .card,
body.visual-modern.is-authenticated .course-context {
  border-color: var(--modern-border) !important;
  box-shadow: 0 14px 34px rgba(15, 44, 82, .09) !important;
}

body.visual-modern.is-authenticated .metric {
  min-height: 112px !important;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  border-left: 0 !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 11%, #ffffff), #ffffff 62%) !important;
}

body.visual-modern.is-authenticated .metric::before {
  width: 100% !important;
  height: 5px !important;
  inset: 0 0 auto 0 !important;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 45%, #ffffff)) !important;
}

body.visual-modern.is-authenticated .metric-icon {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--primary);
  color: #ffffff;
  font-size: 1.18rem;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary) 22%, transparent);
}

body.visual-modern.is-authenticated .metric span,
body.visual-modern.is-authenticated .metric strong {
  min-width: 0;
}

body.visual-modern.is-authenticated .module-head.module-hero,
body.visual-modern.is-authenticated .module-head {
  background:
    radial-gradient(circle at 0% 0%, rgba(6, 182, 212, .16), transparent 32%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.88)) !important;
}

body.visual-modern.is-authenticated input:focus,
body.visual-modern.is-authenticated select:focus,
body.visual-modern.is-authenticated textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14) !important;
}

@media (max-width: 780px) {
  body.visual-modern.is-authenticated .nav-btn {
    min-width: 0 !important;
    min-height: 52px !important;
  }

  body.visual-modern.is-authenticated #module-inicio .home-grid,
  body.visual-modern.is-authenticated .portal-metrics {
    grid-template-columns: 1fr !important;
  }
}

/* Report header requested layout: white institutional top area with corner logos. */
.report-paper .report-header,
.report-student-paper .report-header,
.planner-institutional-doc .planner-doc-header {
  min-height: 1.25in;
  display: grid;
  grid-template-columns: 1.05in minmax(0, 1fr) 1.05in;
  gap: .22in;
  align-items: center;
  margin: 0 0 .2in;
  padding: .18in .22in;
  border: 1px solid #c7d9ee;
  border-top: 8px solid #145fca;
  border-radius: 8px;
  background: #ffffff !important;
  color: #0b3f91;
  box-shadow: none;
}

.report-paper .report-header h2,
.report-student-paper .report-header h2,
.planner-institutional-doc .planner-doc-school h1 {
  margin: 0 0 .04in;
  color: #0b3f91 !important;
  font-size: clamp(18px, .24in, 26px);
  line-height: 1.08;
  text-align: left;
  text-transform: none;
}

.report-paper .report-header p,
.report-student-paper .report-header p,
.planner-institutional-doc .planner-doc-school p,
.planner-institutional-doc .planner-doc-school span {
  margin: 0;
  color: #24415f !important;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
}

.report-paper .report-logo,
.report-student-paper .report-logo,
.planner-institutional-doc .planner-doc-logo {
  justify-self: start;
  width: .92in;
  height: .92in;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}

.report-paper .report-header .report-logo:last-child,
.report-student-paper .report-header .report-logo:last-child,
.planner-institutional-doc .planner-doc-meta {
  justify-self: end;
}

.report-paper .report-logo img,
.report-student-paper .report-logo img,
.planner-institutional-doc .planner-doc-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center;
  aspect-ratio: auto;
}

.report-student-paper .boletin-cover,
.boletin-cover.boletin-cover-print {
  min-height: 1.35in;
  display: grid;
  grid-template-columns: 1fr 1.1in;
  gap: .22in;
  align-items: center;
  margin: 0;
  padding: .18in .24in;
  border: 1px solid #c7d9ee;
  border-top: 8px solid #145fca;
  border-radius: 8px;
  background: #ffffff !important;
  color: #0b3f91 !important;
}

.boletin-brand {
  display: grid !important;
  grid-template-columns: 1.05in minmax(0, 1fr);
  gap: .22in;
  align-items: center;
  justify-content: start;
  text-align: left !important;
}

.boletin-logo,
.boletin-shield {
  width: .92in !important;
  height: .92in !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.boletin-shield {
  justify-self: end;
}

.boletin-brand h2 {
  margin: 0 0 .04in !important;
  color: #0b3f91 !important;
  font-size: clamp(18px, .24in, 26px) !important;
  line-height: 1.08;
  text-align: left;
  text-transform: none !important;
}

.boletin-brand p,
.boletin-page-number {
  color: #24415f !important;
  font-size: 12px !important;
  font-weight: 750;
  text-align: left;
  text-transform: none !important;
}

.boletin-logo img,
.boletin-shield img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center;
  aspect-ratio: auto;
}

@media print {
  .report-paper .report-header,
  .report-student-paper .report-header,
  .report-student-paper .boletin-cover,
  .boletin-cover.boletin-cover-print,
  .planner-institutional-doc .planner-doc-header {
    break-inside: avoid;
    page-break-inside: avoid;
    background: #ffffff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

@media (max-width: 760px) {
  .report-paper .report-header,
  .report-student-paper .report-header,
  .report-student-paper .boletin-cover,
  .boletin-cover.boletin-cover-print,
  .planner-institutional-doc .planner-doc-header {
    grid-template-columns: 62px minmax(0, 1fr) 62px;
    gap: 10px;
    min-height: 92px;
    padding: 14px;
  }

  .boletin-brand {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
  }

  .report-paper .report-logo,
  .report-student-paper .report-logo,
  .boletin-logo,
  .boletin-shield,
  .planner-institutional-doc .planner-doc-logo {
    width: 58px !important;
    height: 58px !important;
  }
}

/* Auditoria visual permisos: matriz legible, ancho completo y controles proporcionados. */
body.is-authenticated .function-fieldset:has(.permission-panel),
body.is-authenticated .config-card:has(.permission-panel),
body.is-authenticated .permission-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body.is-authenticated .permission-panel {
  border: 1px solid #bfdbfe !important;
  border-radius: 10px !important;
  background: #f8fbff !important;
}

body.is-authenticated .permission-panel-head {
  display: grid !important;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center !important;
  padding: 12px 14px !important;
}

body.is-authenticated .permission-panel-head b {
  color: #0b345f !important;
  font-size: .98rem !important;
  white-space: nowrap !important;
}

body.is-authenticated .permission-panel-head small {
  color: #52657a !important;
  font-size: .78rem !important;
  line-height: 1.3 !important;
}

body.is-authenticated .permission-panel-body {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
  padding: 0 14px 14px !important;
  width: 100% !important;
}

body.is-authenticated .permission-table-wrap,
body.is-authenticated #module-configuracion .permission-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

body.is-authenticated .permission-table,
body.is-authenticated #module-configuracion .permission-table {
  width: 100% !important;
  min-width: 920px !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

body.is-authenticated .permission-table th,
body.is-authenticated .permission-table td,
body.is-authenticated #module-configuracion .permission-table th,
body.is-authenticated #module-configuracion .permission-table td {
  padding: 7px 6px !important;
  vertical-align: middle !important;
  font-size: .76rem !important;
  line-height: 1.15 !important;
  border-color: #bfdbfe !important;
}

body.is-authenticated .permission-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  background: #eaf4ff !important;
  color: #16427a !important;
  text-align: center !important;
  font-size: .7rem !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

body.is-authenticated .permission-table tbody th,
body.is-authenticated #module-configuracion .permission-table tbody th {
  width: 132px !important;
  background: #f1f7ff !important;
  color: #0f4a8a !important;
  font-size: .72rem !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated .permission-tick,
body.is-authenticated #module-configuracion .permission-tick {
  width: 100% !important;
  min-height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  padding: 5px 7px !important;
  border: 1px solid #d5e6fb !important;
  border-radius: 7px !important;
  background: #ffffff !important;
  color: #174163 !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

body.is-authenticated .permission-tick input,
body.is-authenticated #module-configuracion .permission-tick input {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 1.05em !important;
  height: 1.05em !important;
  min-width: 1.05em !important;
  border: 1.5px solid #8aa7c7 !important;
  border-radius: 3px !important;
  background: #ffffff !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
}

body.is-authenticated .permission-tick input:checked,
body.is-authenticated #module-configuracion .permission-tick input:checked {
  background: #0f6b7a !important;
  border-color: #0f6b7a !important;
}

body.is-authenticated .permission-tick input:checked::after,
body.is-authenticated #module-configuracion .permission-tick input:checked::after {
  content: "" !important;
  width: .34em !important;
  height: .62em !important;
  border: solid #ffffff !important;
  border-width: 0 .16em .16em 0 !important;
  transform: rotate(45deg) translateY(-.05em) !important;
}

body.is-authenticated .permission-tick span,
body.is-authenticated #module-configuracion .permission-tick span {
  position: static !important;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: .72rem !important;
  line-height: 1.1 !important;
}

body.is-authenticated .permission-summary,
body.is-authenticated #module-configuracion .permission-summary {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
}

@media (max-width: 860px) {
  body.is-authenticated .permission-panel-head {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated .permission-table,
  body.is-authenticated #module-configuracion .permission-table {
    min-width: 780px !important;
  }
}

/* Promocion y repitencia */
body.is-authenticated #module-promocion .list-table-card {
  width: min(100%, 1680px) !important;
}

body.is-authenticated #module-promocion .table-wrap {
  overflow-x: auto !important;
}

body.is-authenticated #module-promocion table {
  min-width: 1240px !important;
}

body.is-authenticated #module-promocion td textarea,
body.is-authenticated #module-promocion td select {
  width: 100%;
  min-width: 150px;
  border: 1px solid #cfe0f5;
  border-radius: 7px;
  background: #fff;
  color: #17324d;
  font-size: .78rem;
}

body.is-authenticated #module-promocion td textarea {
  min-height: 42px;
  resize: vertical;
}

body.is-authenticated #module-promocion .promotion-insights {
  width: min(100%, 1680px) !important;
}

/* Informes academicos: notas completas, observaciones y firmas. */
.report-observation-editor textarea {
  min-height: 92px;
  resize: vertical;
}

.boletin-grade-panel-table {
  display: block !important;
  padding: .18in !important;
}

.boletin-grade-table {
  overflow-x: auto;
  background: #ffffff;
}

.boletin-grade-table table {
  min-width: 7.35in !important;
}

.boletin-grade-table th,
.boletin-grade-table td {
  padding: 6px 5px !important;
  font-size: .68rem !important;
  text-align: center;
}

.boletin-grade-table th:first-child,
.boletin-grade-table td:first-child {
  text-align: left;
  min-width: 1.55in;
}

/* Optimizacion de espacios en calificaciones e informes: compacta, legible y carta/PDF. */
.boletin-grade-table {
  width: 100%;
  max-width: 100%;
  overflow: visible !important;
  border: 1px solid #cfdbea;
  border-radius: 6px;
}

.boletin-grade-table table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
  font-family: Arial, "Arial Narrow", "Segoe UI", sans-serif !important;
}

.boletin-grade-table th,
.boletin-grade-table td {
  height: auto !important;
  min-height: 0 !important;
  padding: 3px 4px !important;
  border: 1px solid #d7e1ee !important;
  color: #1f2a3a;
  font-size: .62rem !important;
  line-height: 1.15 !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap;
}

.boletin-grade-table th {
  background: #eef5ff !important;
  color: #0b345f !important;
  font-weight: 900 !important;
  text-transform: none !important;
}

.boletin-grade-table .grade-subject-col {
  width: auto;
  min-width: 1.42in !important;
  max-width: 2.05in;
  text-align: left !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.boletin-grade-table .grade-value-col {
  width: .34in;
  min-width: .3in;
  max-width: .42in;
}

.boletin-grade-table .grade-average-col {
  width: .48in;
  min-width: .42in;
  max-width: .58in;
  font-weight: 900;
}

.boletin-grade-table .report-grade-badge {
  min-width: 0 !important;
  width: auto !important;
  min-height: 0 !important;
  display: inline-block !important;
  padding: 1px 4px !important;
  border-radius: 4px !important;
  font-size: .62rem !important;
  line-height: 1.12 !important;
  font-weight: 900 !important;
}

.boletin-grade-table .grades-data-row {
  break-inside: avoid;
  page-break-inside: avoid;
}

.chilean-gradebook-table {
  width: 100% !important;
  table-layout: fixed !important;
}

.chilean-gradebook-table .grade-subject-col {
  width: 30% !important;
  min-width: 30% !important;
  max-width: 30% !important;
  font-family: "Arial Narrow", Arial, "Segoe UI", sans-serif !important;
  font-size: .64rem !important;
  line-height: 1.12 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

.chilean-gradebook-table .grade-value-col {
  width: 5.8% !important;
  min-width: 5.8% !important;
  max-width: 5.8% !important;
}

.chilean-gradebook-table .grade-average-col {
  width: 12% !important;
  min-width: 12% !important;
  max-width: 12% !important;
  background: #e8f1ff !important;
  color: #0b345f !important;
}

.chilean-gradebook-table th.grade-average-col,
.chilean-gradebook-table td.grade-average-col {
  border-left: 2px solid #9fc5ff !important;
}

.chilean-gradebook-table td.grade-average-col .report-grade-badge {
  background: #145fca !important;
  color: #ffffff !important;
  border-color: #0b3f91 !important;
  font-weight: 950 !important;
}

.chilean-gradebook-table .grade-value-col .report-grade-badge,
.chilean-gradebook-table .grade-average-col .report-grade-badge {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  display: block !important;
  padding: 1px 0 !important;
  border-radius: 3px !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}

.report-grade-badge.pending {
  background: #fff7ed;
  color: #9a3412;
}

.report-grade-badge.exempt {
  background: #f1f5f9;
  color: #334155;
}

.gradebook-summary-strip {
  margin: .1in .34in 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .08in;
}

.gradebook-summary-strip article {
  padding: .08in .1in;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  background: #f8fbff;
}

.gradebook-summary-strip span {
  display: block;
  color: #58708d;
  font-size: .08in;
  font-weight: 900;
  text-transform: uppercase;
}

.gradebook-summary-strip b {
  display: block;
  margin-top: .02in;
  color: #0b345f;
  font-size: .16in;
  font-weight: 950;
}

.gradebook-observation {
  margin: .08in .34in 0;
  padding: .08in .1in;
  border: 1px solid #d7e1ee;
  border-left: 4px solid #145fca;
  border-radius: 8px;
  background: #ffffff;
}

.gradebook-observation b {
  display: block;
  color: #0b345f;
  font-size: .09in;
  text-transform: uppercase;
}

.gradebook-observation p {
  margin: .04in 0 0;
  color: #24364a;
  font-size: .095in;
  line-height: 1.28;
  max-height: .58in;
  overflow: hidden;
}

.horizontal-grade-blocks {
  width: 100%;
  display: grid;
  gap: .08in;
}

.horizontal-grade-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  break-inside: avoid;
  page-break-inside: avoid;
}

.horizontal-grade-table th,
.horizontal-grade-table td {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.horizontal-grade-table th {
  min-height: .38in !important;
  padding: 5px 6px !important;
  font-size: .68rem !important;
  line-height: 1.12 !important;
  vertical-align: middle !important;
}

.horizontal-grade-values td {
  padding: 7px 4px !important;
  background: #ffffff;
}

.horizontal-grade-values .report-grade-badge {
  min-width: .34in !important;
  padding: 3px 6px !important;
  font-size: .78rem !important;
}

.horizontal-grade-detail td {
  padding: 3px 4px !important;
  background: #f8fbff;
  color: #58708d !important;
  font-size: .56rem !important;
  font-weight: 800;
}

.horizontal-grade-spacer {
  height: .02in;
}

.report-compact-output {
  min-height: 10.2in;
}

.report-force-letter {
  min-height: 10.2in !important;
}

.report-force-letter .boletin-cover {
  min-height: 1.12in !important;
  padding: .14in .34in !important;
}

.report-force-letter .boletin-brand h2 {
  font-size: .24in !important;
}

.report-force-letter .boletin-title {
  margin: .16in .38in .1in !important;
  font-size: .22in !important;
}

.report-force-letter .boletin-info-panel {
  padding: .12in .2in !important;
  gap: .06in .16in !important;
}

.report-force-letter .boletin-section-title {
  margin: .12in .38in .06in !important;
  font-size: .15in !important;
}

.report-force-letter .boletin-grade-panel-table {
  padding: .09in !important;
}

.report-force-letter .boletin-grade-table table {
  min-width: 0 !important;
  table-layout: fixed;
}

.report-force-letter .boletin-grade-table th,
.report-force-letter .boletin-grade-table td {
  padding: 2px !important;
  font-size: .5rem !important;
  overflow-wrap: anywhere;
}

.report-force-letter .boletin-observations {
  min-height: 1.05in !important;
  padding: .1in .16in .14in !important;
}

.report-force-letter .boletin-summary-box,
.report-force-letter .boletin-attendance-panel,
.report-force-letter .boletin-analysis-grid,
.report-force-letter .boletin-integral-grid,
.report-force-letter .boletin-observation-history {
  gap: .07in !important;
  padding: .08in .12in !important;
}

.report-force-letter .boletin-signatures {
  margin: .18in .54in .14in !important;
}

.report-one-page-wrapper {
  width: min(100%, 8.5in) !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  aspect-ratio: 8.5 / 11 !important;
  position: relative !important;
  overflow: hidden !important;
}

.report-one-page-letter {
  width: 8.5in !important;
  max-width: 8.5in !important;
  min-height: 10.55in !important;
  height: 10.55in !important;
  max-height: 10.55in !important;
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  transform: scale(var(--report-letter-scale, 1));
  transform-origin: top left;
  overflow: hidden !important;
  box-shadow: none !important;
}

.report-one-page-letter.report-student-paper {
  padding-bottom: .16in !important;
}

.report-certificate-paper,
.report-certificate-letter {
  padding: .5in .58in .42in !important;
  background: #ffffff !important;
  color: #1f2a3a !important;
}

.certificate-head {
  display: grid;
  grid-template-columns: .9in minmax(0, 1fr) .9in;
  gap: .18in;
  align-items: center;
  padding-bottom: .22in;
  border-bottom: 3px solid #145fca;
  text-align: center;
}

.certificate-logo {
  width: .78in;
  height: .78in;
  display: grid;
  place-items: center;
  justify-self: center;
  padding: .06in;
  border: 1px solid #d7e2ef;
  border-radius: 8px;
  overflow: hidden;
}

.certificate-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.certificate-head h2 {
  margin: 0;
  color: #0b345f;
  font-size: .28in;
  line-height: 1.12;
  text-transform: uppercase;
}

.certificate-head p {
  margin: .06in 0 0;
  color: #52616b;
  font-size: .13in;
  font-weight: 800;
}

.certificate-body {
  min-height: 5.7in;
  display: grid;
  align-content: center;
  gap: .18in;
  padding: .26in 0;
}

.certificate-body > span {
  color: #145fca;
  font-size: .14in;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.certificate-body h1 {
  margin: 0 0 .12in;
  color: #102033;
  font-size: .42in;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}

.certificate-body p {
  margin: 0;
  color: #24364a;
  font-size: .18in;
  line-height: 1.75;
  text-align: justify;
}

.certificate-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .12in;
  margin-bottom: .34in;
}

.certificate-meta div {
  padding: .1in .12in;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f8fbff;
}

.certificate-meta span {
  display: block;
  color: #58708d;
  font-size: .1in;
  font-weight: 900;
  text-transform: uppercase;
}

.certificate-meta b {
  display: block;
  margin-top: .04in;
  color: #102033;
  font-size: .14in;
}

.certificate-signatures {
  margin: .18in 0 .12in !important;
}

.certificate-signatures div {
  min-height: .82in !important;
}

.certificate-signatures img {
  max-height: .52in !important;
}

.certificate-footer {
  padding-top: .12in;
  border-top: 1px solid #dbe7f3;
  color: #52616b;
  font-size: .11in;
  text-align: center;
  font-weight: 800;
}

.report-one-page-letter.report-certificate-letter {
  padding: .5in .58in .42in !important;
}

.report-one-page-letter.report-certificate-letter .certificate-body p {
  font-size: .18in !important;
}

@media print {
  .report-one-page-wrapper {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    overflow: visible !important;
  }

  .report-one-page-letter {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    transform: none !important;
    overflow: visible !important;
  }
}

.report-one-page-letter .boletin-cover {
  min-height: .96in !important;
  padding: .1in .28in !important;
}

.report-one-page-letter .boletin-logo,
.report-one-page-letter .boletin-shield {
  width: .62in !important;
  height: .62in !important;
  border-radius: 10px !important;
}

.report-one-page-letter .boletin-shield {
  width: .7in !important;
  height: .7in !important;
}

.report-one-page-letter .boletin-brand h2 {
  font-size: .2in !important;
}

.report-one-page-letter .boletin-title {
  margin: .12in .34in .08in !important;
  font-size: .19in !important;
}

.report-one-page-letter .boletin-info-panel {
  margin-inline: .34in !important;
  padding: .08in .14in !important;
  gap: .04in .12in !important;
}

.report-one-page-letter .boletin-field {
  grid-template-columns: .82in minmax(0, 1fr) !important;
}

.report-one-page-letter .boletin-field span,
.report-one-page-letter .boletin-field b {
  font-size: .1in !important;
  min-height: .2in !important;
  padding: .025in .08in !important;
}

.report-one-page-letter .boletin-section-title {
  margin: .09in .34in .045in !important;
  font-size: .13in !important;
}

.report-one-page-letter .boletin-grade-panel-table {
  margin-inline: .34in !important;
  padding: .055in !important;
}

.report-one-page-letter .boletin-grade-table {
  overflow: hidden !important;
}

.report-one-page-letter .boletin-grade-table table {
  min-width: 0 !important;
  table-layout: fixed !important;
}

.report-one-page-letter .boletin-grade-table th,
.report-one-page-letter .boletin-grade-table td {
  padding: 1px 2px !important;
  font-size: .46rem !important;
  line-height: 1.12 !important;
}

.report-one-page-letter .boletin-grade-table .report-grade-badge {
  min-width: 20px !important;
  min-height: 16px !important;
  padding: 1px 2px !important;
  font-size: .48rem !important;
}

.report-one-page-letter .boletin-summary-box {
  margin-inline: .34in !important;
  padding: .055in .08in !important;
  gap: .06in !important;
}

.report-one-page-letter .boletin-summary-box article {
  min-height: .36in !important;
  padding: .045in .07in !important;
}

.report-one-page-letter .boletin-summary-box span {
  font-size: .08in !important;
}

.report-one-page-letter .boletin-summary-box b {
  font-size: .15in !important;
}

.report-one-page-letter .boletin-observations {
  margin-inline: .34in !important;
  min-height: .72in !important;
  max-height: .88in !important;
  padding: .07in .1in !important;
  overflow: hidden !important;
}

.report-one-page-letter .boletin-observations p,
.report-one-page-letter .boletin-observations li {
  font-size: .095in !important;
  line-height: 1.22 !important;
}

.report-one-page-letter .boletin-observations span {
  display: none !important;
}

.report-one-page-letter .boletin-signatures {
  margin: .12in .48in .08in !important;
  min-height: .42in !important;
}

.report-one-page-letter .signature-row div {
  min-height: .42in !important;
  font-size: .1in !important;
}

.report-one-page-letter .signature-row img {
  max-height: .34in !important;
}

.report-one-page-letter .boletin-footer {
  padding: .06in .32in !important;
  font-size: .09in !important;
}

.report-one-page-letter .boletin-page-number {
  display: none !important;
}

.report-one-page-letter.report-course-paper {
  padding: .24in !important;
}

.report-one-page-letter.report-course-paper .report-title {
  font-size: .26in !important;
  margin: .12in 0 !important;
}

.report-one-page-letter.report-course-paper .report-student,
.report-one-page-letter.report-course-paper .report-summary-line {
  gap: 6px !important;
  margin-bottom: 8px !important;
}

.report-one-page-letter.report-course-paper th,
.report-one-page-letter.report-course-paper td {
  padding: 3px 4px !important;
  font-size: .56rem !important;
}

.report-one-page-letter.report-course-paper .report-course-top,
.report-one-page-letter.report-course-paper .report-note-grid {
  display: none !important;
}

.report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-alert-grid),
.report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-attendance-panel),
.report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-analysis-grid),
.report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-integral-grid),
.report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-observation-history),
.report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-observations.compact),
.report-one-page-letter.report-student-paper .boletin-alert-grid,
.report-one-page-letter.report-student-paper .boletin-attendance-panel,
.report-one-page-letter.report-student-paper .boletin-analysis-grid,
.report-one-page-letter.report-student-paper .boletin-integral-grid,
.report-one-page-letter.report-student-paper .boletin-observation-history,
.report-one-page-letter.report-student-paper .boletin-observations.compact {
  display: none !important;
}

.report-grades-letter .boletin-cover {
  min-height: .82in !important;
  padding: .08in .24in !important;
}

.report-grades-letter .boletin-brand h2 {
  font-size: .18in !important;
}

.report-grades-letter .boletin-brand p {
  font-size: .1in !important;
}

.report-grades-letter .boletin-title {
  margin: .08in .26in .055in !important;
  font-size: .18in !important;
}

.report-grades-letter .boletin-info-panel {
  grid-template-columns: 1fr 1fr 1fr !important;
  margin-inline: .24in !important;
  padding: .055in .1in !important;
  gap: .035in .08in !important;
}

.report-grades-letter .boletin-field.full {
  grid-column: span 3 !important;
}

.report-grades-letter .boletin-field {
  grid-template-columns: .66in minmax(0, 1fr) !important;
}

.report-grades-letter .boletin-field span,
.report-grades-letter .boletin-field b {
  font-size: .092in !important;
}

.report-grades-letter .boletin-section-title {
  margin: .065in .24in .035in !important;
  font-size: .12in !important;
}

.report-grades-letter .boletin-grade-panel-table {
  margin-inline: .2in !important;
  padding: .04in !important;
}

.report-grades-letter .boletin-grade-table th,
.report-grades-letter .boletin-grade-table td {
  padding: 3px 2px !important;
  font-size: .58rem !important;
  line-height: 1.18 !important;
}

.report-grades-letter .boletin-grade-table th:first-child,
.report-grades-letter .boletin-grade-table td:first-child {
  width: 1.72in !important;
  min-width: 1.72in !important;
  max-width: 1.72in !important;
  font-size: .57rem !important;
}

.report-grades-letter .boletin-grade-table .report-grade-badge {
  min-width: 24px !important;
  min-height: 18px !important;
  padding: 2px 3px !important;
  font-size: .58rem !important;
  line-height: 1.1 !important;
}

.report-grades-letter .boletin-summary-box {
  margin-inline: .2in !important;
  padding: .05in .08in !important;
}

.report-grades-letter .boletin-summary-box article {
  min-height: .32in !important;
}

.report-grades-letter .boletin-summary-box b {
  font-size: .14in !important;
}

.report-grades-letter .boletin-section-title:has(+ .boletin-observations),
.report-grades-letter .boletin-observations {
  display: none !important;
}

.report-grades-letter .boletin-signatures {
  margin: .1in .42in .06in !important;
}

.report-grades-letter .boletin-footer {
  padding: .045in .24in !important;
}

.report-compact-output .boletin-cover {
  min-height: 1.28in;
  padding: .18in .38in;
}

.report-compact-output .boletin-brand h2 {
  font-size: .28in;
}

.report-compact-output .boletin-title {
  margin: .2in .42in .14in;
  font-size: .25in;
}

.report-compact-output .boletin-info-panel {
  padding: .16in .24in;
  gap: .08in .2in;
}

.report-compact-output .boletin-section-title {
  margin: .16in .42in .08in;
  font-size: .17in;
}

.report-compact-output .boletin-grade-panel-table {
  padding: .12in !important;
}

.report-compact-output .boletin-grade-table table {
  min-width: 0 !important;
  table-layout: fixed;
}

.report-compact-output .boletin-grade-table th,
.report-compact-output .boletin-grade-table td {
  padding: 3px 2px !important;
  font-size: .54rem !important;
  overflow-wrap: anywhere;
}

.report-compact-output .boletin-grade-table th:first-child,
.report-compact-output .boletin-grade-table td:first-child {
  min-width: 1.15in;
}

.report-compact-output .boletin-grade-table .report-grade-badge {
  min-width: 24px;
  min-height: 20px;
  padding: 2px 4px;
}

.report-compact-output .boletin-summary-box {
  padding: .1in .14in;
}

.report-compact-output .boletin-observations {
  min-height: 1.25in;
  padding: .12in .18in .16in;
}

.report-compact-output .boletin-observations p {
  font-size: .12in;
  line-height: 1.38;
}

.report-compact-output .boletin-signatures {
  margin: .24in .62in .18in;
}

.report-compact-output .boletin-footer {
  padding: .12in .42in !important;
}

.report-compact-output .boletin-section-title:has(+ .boletin-alert-grid),
.report-compact-output .boletin-section-title:has(+ .boletin-attendance-panel),
.report-compact-output .boletin-section-title:has(+ .boletin-analysis-grid),
.report-compact-output .boletin-section-title:has(+ .boletin-integral-grid),
.report-compact-output .boletin-section-title:has(+ .boletin-observation-history),
.report-compact-output .boletin-section-title:has(+ .boletin-observations.compact),
.report-compact-output .boletin-alert-grid,
.report-compact-output .boletin-attendance-panel,
.report-compact-output .boletin-analysis-grid,
.report-compact-output .boletin-integral-grid,
.report-compact-output .boletin-observation-history,
.report-compact-output .boletin-observations.compact {
  display: none !important;
}

.report-one-page-letter.report-grades-letter .boletin-cover {
  min-height: .82in !important;
  padding: .08in .24in !important;
}

.report-one-page-letter.report-grades-letter .boletin-title {
  margin: .08in .26in .055in !important;
  font-size: .18in !important;
}

.report-one-page-letter.report-grades-letter .boletin-info-panel {
  margin-inline: .24in !important;
  padding: .055in .1in !important;
  gap: .035in .08in !important;
}

.report-one-page-letter.report-grades-letter .boletin-section-title {
  margin: .065in .24in .035in !important;
  font-size: .12in !important;
}

.report-one-page-letter.report-grades-letter .boletin-grade-panel-table {
  margin-inline: .2in !important;
  padding: .04in !important;
}

.report-one-page-letter.report-grades-letter .boletin-grade-table th,
.report-one-page-letter.report-grades-letter .boletin-grade-table td {
  padding: 2px 3px !important;
  font-size: .61rem !important;
  line-height: 1.18 !important;
}

.report-one-page-letter.report-grades-letter .boletin-grade-table th:first-child,
.report-one-page-letter.report-grades-letter .boletin-grade-table td:first-child {
  width: auto !important;
  min-width: 1.48in !important;
  max-width: 1.9in !important;
  font-size: .6rem !important;
}

.report-one-page-letter.report-grades-letter .boletin-grade-table .report-grade-badge {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 1px 4px !important;
  font-size: .61rem !important;
}

.report-one-page-letter.report-grades-letter .boletin-grade-table .grade-value-col {
  width: .34in !important;
  min-width: .29in !important;
  max-width: .4in !important;
}

.report-one-page-letter.report-grades-letter .boletin-grade-table .grade-average-col {
  width: .5in !important;
  min-width: .42in !important;
  max-width: .6in !important;
}

.report-one-page-letter.report-grades-letter .boletin-section-title:has(+ .boletin-observations),
.report-one-page-letter.report-grades-letter .boletin-observations {
  display: none !important;
}

.report-one-page-letter.report-grades-letter {
  padding-bottom: 0 !important;
}

.report-one-page-letter.report-grades-letter .boletin-grade-panel-table {
  min-height: 0 !important;
  display: block !important;
  margin-inline: .2in !important;
  padding: .055in !important;
}

.report-one-page-letter.report-grades-letter .horizontal-grade-blocks {
  gap: .1in !important;
}

.report-one-page-letter.report-grades-letter .horizontal-grade-table th {
  padding: 6px 7px !important;
  font-size: .72rem !important;
}

.report-one-page-letter.report-grades-letter .horizontal-grade-values td {
  padding: 8px 4px !important;
}

.report-one-page-letter.report-grades-letter .horizontal-grade-values .report-grade-badge {
  min-width: .38in !important;
  padding: 3px 7px !important;
  font-size: .82rem !important;
}

.report-one-page-letter.report-grades-letter .horizontal-grade-detail td {
  padding: 3px 4px !important;
  font-size: .58rem !important;
}

.report-one-page-letter.report-grades-letter .boletin-summary-box {
  margin-top: .08in !important;
}

.report-one-page-letter.report-grades-letter .boletin-signatures {
  margin-top: .28in !important;
}

.report-one-page-letter.report-grades-letter .chilean-gradebook-table th,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table td {
  padding: 3px 3px !important;
  font-size: .62rem !important;
  line-height: 1.12 !important;
}

.report-one-page-letter.report-grades-letter .chilean-gradebook-table .grade-subject-col {
  width: 30% !important;
  min-width: 30% !important;
  max-width: 30% !important;
  font-family: "Arial Narrow", Arial, "Segoe UI", sans-serif !important;
  font-size: .62rem !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

.report-one-page-letter.report-grades-letter .chilean-gradebook-table .grade-value-col {
  width: 5.8% !important;
  min-width: 5.8% !important;
  max-width: 5.8% !important;
}

.report-one-page-letter.report-grades-letter .chilean-gradebook-table .grade-average-col {
  width: 12% !important;
  min-width: 12% !important;
  max-width: 12% !important;
}

.report-one-page-letter.report-grades-letter .chilean-gradebook-table .report-grade-badge {
  padding: 2px 4px !important;
  font-size: .62rem !important;
}

.report-one-page-letter.report-grades-letter .gradebook-summary-strip {
  margin-inline: .2in !important;
  margin-top: .1in !important;
}

.report-one-page-letter.report-grades-letter .gradebook-observation {
  margin-inline: .2in !important;
}

/* Libreta chilena: asignaturas en una linea y columnas de notas uniformes. */
.report-grades-letter .chilean-gradebook-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border: 1px solid #c9d7e8 !important;
}

.report-grades-letter .chilean-gradebook-table th,
.report-grades-letter .chilean-gradebook-table td {
  padding-block: 2px !important;
  padding-inline: 2px !important;
  border-color: #d5e0ee !important;
  vertical-align: middle !important;
}

.report-grades-letter .chilean-gradebook-table .grade-subject-col {
  width: 30% !important;
  min-width: 30% !important;
  max-width: 30% !important;
  white-space: normal !important;
  text-align: left !important;
  font-family: "Arial Narrow", Arial, "Segoe UI", sans-serif !important;
  font-size: .62rem !important;
  line-height: 1.12 !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  letter-spacing: 0 !important;
}

.report-grades-letter .chilean-gradebook-table .grade-value-col,
.report-grades-letter .chilean-gradebook-table .grade-average-col {
  text-align: center !important;
}

.report-grades-letter .chilean-gradebook-table .grade-value-col {
  width: 5.8% !important;
  min-width: 5.8% !important;
  max-width: 5.8% !important;
}

.report-grades-letter .chilean-gradebook-table .grade-average-col {
  width: 12% !important;
  min-width: 12% !important;
  max-width: 12% !important;
}

.report-grades-letter .chilean-gradebook-table .report-grade-badge {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  display: block !important;
  padding: 1px 0 !important;
  border-radius: 3px !important;
  line-height: 1.12 !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}

/* Ajuste avanzado: libreta chilena con 10 notas parciales y asignaturas en una linea. */
.report-grades-letter .boletin-grade-panel-table,
.report-one-page-letter.report-grades-letter .boletin-grade-panel-table {
  margin-inline: .08in !important;
  padding: .035in !important;
}

.report-grades-letter .boletin-info-panel,
.report-one-page-letter.report-grades-letter .boletin-info-panel,
.report-grades-letter .gradebook-summary-strip,
.report-one-page-letter.report-grades-letter .gradebook-summary-strip,
.report-grades-letter .gradebook-observation,
.report-one-page-letter.report-grades-letter .gradebook-observation {
  margin-inline: .08in !important;
}

.report-grades-letter .boletin-grade-table,
.report-one-page-letter.report-grades-letter .boletin-grade-table {
  width: 100% !important;
  border-radius: 4px !important;
  overflow: hidden !important;
}

.report-grades-letter .chilean-gradebook-table,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  font-family: Arial, sans-serif !important;
}

.report-grades-letter .chilean-gradebook-table th,
.report-grades-letter .chilean-gradebook-table td,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table th,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table td {
  height: 22px !important;
  min-height: 22px !important;
  padding: 1px 2px !important;
  border: 1px solid #cfdae8 !important;
  font-family: Arial, sans-serif !important;
  font-size: 12px !important;
  line-height: 1.05 !important;
  vertical-align: middle !important;
}

.report-grades-letter .chilean-gradebook-table th,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table th {
  font-weight: 900 !important;
}

.report-grades-letter .chilean-gradebook-table .grade-subject-col,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table .grade-subject-col {
  width: 35% !important;
  min-width: 35% !important;
  max-width: 35% !important;
  text-align: left !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  font-size: 12px !important;
}

.report-grades-letter .chilean-gradebook-table .grade-value-col,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table .grade-value-col {
  width: 5.5% !important;
  min-width: 5.5% !important;
  max-width: 5.5% !important;
  text-align: center !important;
}

.report-grades-letter .chilean-gradebook-table .grade-average-col,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table .grade-average-col {
  width: 10% !important;
  min-width: 10% !important;
  max-width: 10% !important;
  text-align: center !important;
  font-weight: 900 !important;
}

.report-grades-letter .chilean-gradebook-table .grade-value-col .report-grade-badge,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table .grade-value-col .report-grade-badge {
  display: inline-block !important;
  width: auto !important;
  min-width: 2.1em !important;
  max-width: 100% !important;
  padding: 1px 2px !important;
  border-radius: 3px !important;
  text-align: center !important;
  font-size: 12px !important;
  line-height: 1.05 !important;
  font-weight: 800 !important;
}

.report-grades-letter .chilean-gradebook-table .grade-average-col .report-grade-badge,
.report-one-page-letter.report-grades-letter .chilean-gradebook-table .grade-average-col .report-grade-badge {
  display: inline-block !important;
  width: auto !important;
  min-width: 2.4em !important;
  padding: 1px 4px !important;
  background: #145fca !important;
  color: #ffffff !important;
  border-color: #0b3f91 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.boletin-summary-box {
  margin-inline: .48in;
  padding: .14in .2in;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .12in;
  background: #dbe2fb;
}

.boletin-summary-box article {
  min-height: .56in;
  padding: .1in .14in;
  border-radius: 14px;
  background: #ffffff;
}

.boletin-summary-box span {
  display: block;
  color: #596786;
  font-size: .12in;
  font-weight: 800;
  text-transform: uppercase;
}

.boletin-summary-box b {
  display: block;
  margin-top: .04in;
  color: #344166;
  font-size: .2in;
  font-weight: 950;
}

.boletin-summary-box + .boletin-section-title {
  display: none;
}

.report-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 900;
}

.report-grade-badge.green { background: #dcfce7; color: #166534; }
.report-grade-badge.blue { background: #dbeafe; color: #1d4ed8; }
.report-grade-badge.yellow { background: #fef3c7; color: #92400e; }
.report-grade-badge.red { background: #fee2e2; color: #b91c1c; }
.report-grade-badge.empty { background: #f1f5f9; color: #64748b; }

.boletin-attendance-panel,
.boletin-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .1in;
  margin: .1in .48in .14in;
}

.boletin-attendance-panel article,
.boletin-analysis-grid article {
  border: 1px solid #dbe3ee;
  border-radius: 7px;
  background: #ffffff;
  padding: .1in;
}

.boletin-attendance-panel span {
  display: block;
  color: #64748b;
  font-size: .11in;
  text-transform: uppercase;
}

.boletin-attendance-panel b {
  display: block;
  margin-top: .04in;
  color: #0b345f;
  font-size: .2in;
  font-weight: 950;
}

.boletin-analysis-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.boletin-analysis-grid h3 {
  margin: 0 0 .06in;
  color: #0b345f;
  font-size: .12in;
  text-transform: uppercase;
}

.boletin-analysis-grid ul {
  margin: 0;
  padding-left: .16in;
  color: #334155;
  font-size: .12in;
  line-height: 1.35;
}

.boletin-alert-grid,
.boletin-integral-grid,
.boletin-observation-history {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: .1in;
  margin: .1in .48in .14in;
}

.boletin-alert-grid article,
.boletin-integral-grid article,
.boletin-observation-history article {
  min-width: 0;
  padding: .1in;
  border: 1px solid #dbe3ee;
  border-radius: 7px;
  background: #ffffff;
  break-inside: avoid;
  page-break-inside: avoid;
}

.boletin-alert-grid b,
.boletin-integral-grid b,
.boletin-observation-history b {
  display: block;
  color: #0b345f;
  font-size: .13in;
  overflow-wrap: anywhere;
}

.boletin-alert-grid span,
.boletin-integral-grid span,
.boletin-integral-grid small,
.boletin-observation-history span,
.boletin-observation-history p {
  display: block;
  margin: .04in 0 0;
  color: #475569;
  font-size: .115in;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.boletin-alert-grid .red {
  border-color: #fecaca;
  background: #fff5f5;
}

.boletin-alert-grid .red b {
  color: #b91c1c;
}

.boletin-alert-grid .yellow {
  border-color: #fde68a;
  background: #fffbeb;
}

.boletin-alert-grid .yellow b {
  color: #92400e;
}

.boletin-observations.compact {
  min-height: 1.15in;
}

.boletin-signatures {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.boletin-signatures div {
  min-height: .82in;
  display: grid;
  align-items: end;
}

.boletin-signatures img {
  max-width: 1.45in;
  max-height: .52in;
  margin: 0 auto .06in;
  object-fit: contain;
}

.boletin-signatures span {
  display: block;
}

@media (max-width: 760px) {
  .boletin-summary-box,
  .boletin-signatures {
    grid-template-columns: 1fr;
    margin-inline: 18px;
  }

  .boletin-attendance-panel,
  .boletin-analysis-grid,
  .boletin-alert-grid,
  .boletin-integral-grid,
  .boletin-observation-history {
    grid-template-columns: 1fr;
    margin-inline: 18px;
  }

  .boletin-grade-table table {
    min-width: 0 !important;
    table-layout: fixed;
  }

  .boletin-grade-table th,
  .boletin-grade-table td {
    overflow-wrap: anywhere;
    font-size: .62rem !important;
    padding: 4px 3px !important;
  }
}

@media print {
  .boletin-grade-table {
    overflow: visible !important;
  }

  .boletin-grade-table table {
    min-width: 0 !important;
  }

  .boletin-grade-table th,
  .boletin-grade-table td {
    font-size: 7.4pt !important;
    padding: 3px 3px !important;
  }
}

/* Mejora visual moderada: sistema escolar moderno, sobrio y configurable. */
:root {
  --visual-primary: #0f4c81;
  --visual-secondary: #7dd3fc;
  --visual-accent: #f4c95d;
  --visual-ink: #102033;
  --visual-muted: #64748b;
  --visual-line: #d8e5f0;
  --visual-soft: rgba(255, 255, 255, .72);
  --visual-login-bg: var(--login-bg);
  --visual-home-bg: none;
  --visual-shadow: 0 14px 34px rgba(15, 44, 82, .09);
}

body.visual-modern:not(.is-authenticated) .login-screen {
  background:
    linear-gradient(135deg, rgba(10, 33, 63, .74), rgba(15, 76, 129, .5) 54%, rgba(125, 211, 252, .28)),
    var(--visual-login-bg) center / cover no-repeat,
    #eef6fb !important;
}

body.visual-modern .login-screen::before {
  background:
    linear-gradient(90deg, rgba(3, 15, 32, .46), rgba(3, 15, 32, .12) 52%, rgba(3, 15, 32, .34)),
    rgba(255, 255, 255, .08) !important;
}

body.visual-modern .login-panel {
  width: min(440px, 100%) !important;
  padding: 30px !important;
  border: 1px solid rgba(255, 255, 255, .72) !important;
  background:
    var(--watermark-bg) center / min(88%, 500px) no-repeat,
    rgba(255, 255, 255, .9) !important;
  box-shadow: 0 24px 62px rgba(8, 26, 50, .28) !important;
}

body.visual-modern .login-badge {
  width: 84px !important;
  height: 84px !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 34px rgba(15, 76, 129, .2) !important;
}

body.visual-modern.is-authenticated {
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--visual-secondary) 28%, transparent), transparent 30%),
    radial-gradient(circle at 100% 8%, rgba(244, 201, 93, .18), transparent 26%),
    linear-gradient(180deg, #f7fbff 0, #eef5f9 320px, #f5f8fb 100%) !important;
  color: var(--visual-ink) !important;
}

body.visual-modern.is-authenticated .nav-scroll,
body.visual-modern.is-authenticated .nav-scroll *,
body.visual-modern.is-authenticated .nav-scroll::before {
  visibility: visible !important;
  pointer-events: auto !important;
}

body.visual-modern.is-authenticated .topbar {
  background: rgba(239, 248, 251, .92) !important;
  border-right-color: rgba(15, 76, 129, .12) !important;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .65) !important;
}

body.visual-modern.is-authenticated .brand-row {
  background: rgba(255, 255, 255, .82) !important;
  border-bottom: 1px solid rgba(15, 76, 129, .12) !important;
  box-shadow: 0 12px 28px rgba(15, 44, 82, .06) !important;
}

body.visual-modern.is-authenticated .brand h1,
body.visual-modern.is-authenticated .module-head h2,
body.visual-modern.is-authenticated .card h3,
body.visual-modern.is-authenticated .list-card-head h3 {
  color: #0d2f4f !important;
}

body.visual-modern.is-authenticated .brand p,
body.visual-modern.is-authenticated small,
body.visual-modern.is-authenticated .module-head p {
  color: var(--visual-muted) !important;
}

body.visual-modern.is-authenticated .logo {
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 10px 22px rgba(15, 76, 129, .12) !important;
}

body.visual-modern.is-authenticated .nav-btn {
  border-radius: 14px !important;
  color: #526579 !important;
}

body.visual-modern.is-authenticated .nav-btn i {
  color: var(--nav-color, var(--visual-primary)) !important;
}

body.visual-modern.is-authenticated .nav-btn:hover,
body.visual-modern.is-authenticated .nav-btn.active {
  background: #ffffff !important;
  color: var(--visual-primary) !important;
  box-shadow: 0 10px 24px rgba(15, 76, 129, .1) !important;
}

body.visual-modern.is-authenticated .nav-btn:hover i,
body.visual-modern.is-authenticated .nav-btn.active i {
  background: color-mix(in srgb, var(--nav-color, var(--visual-primary)) 14%, #ffffff) !important;
  color: var(--nav-color, var(--visual-primary)) !important;
}

body.visual-modern.is-authenticated .topbar-search .search-field input,
body.visual-modern.is-authenticated input,
body.visual-modern.is-authenticated select,
body.visual-modern.is-authenticated textarea {
  border-color: var(--visual-line) !important;
  background: rgba(255, 255, 255, .86) !important;
  color: var(--visual-ink) !important;
  box-shadow: none !important;
}

body.visual-modern.is-authenticated .year-control,
body.visual-modern.is-authenticated .actions .icon-btn,
body.visual-modern.is-authenticated .btn-soft,
body.visual-modern.is-authenticated .btn-ghost {
  border: 1px solid var(--visual-line) !important;
  background: rgba(255, 255, 255, .78) !important;
  color: var(--visual-primary) !important;
}

body.visual-modern.is-authenticated .btn-primary {
  background: linear-gradient(135deg, var(--visual-primary), color-mix(in srgb, var(--visual-primary) 72%, #1fb6ff)) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--visual-primary) 20%, transparent) !important;
}

body.visual-modern.is-authenticated .module-head,
body.visual-modern.is-authenticated .card,
body.visual-modern.is-authenticated .course-context,
body.visual-modern.is-authenticated .subject-card,
body.visual-modern.is-authenticated .course-card,
body.visual-modern.is-authenticated .focus-card,
body.visual-modern.is-authenticated .config-module-card,
body.visual-modern.is-authenticated .layout-insight,
body.visual-modern.is-authenticated .metric {
  border: 1px solid rgba(216, 229, 240, .9) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .72)) !important;
  box-shadow: var(--visual-shadow) !important;
  backdrop-filter: blur(12px) saturate(1.08);
}

body.visual-modern.is-authenticated #module-inicio .dashboard-home {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 229, 240, .86) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(248, 252, 255, .82)),
    var(--visual-home-bg) center / cover no-repeat,
    #ffffff !important;
  box-shadow: var(--visual-shadow) !important;
}

body.visual-modern.is-authenticated #module-inicio .home-header {
  min-height: 170px;
  display: grid;
  align-content: center;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(15, 76, 129, .12);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(15, 76, 129, .1), rgba(125, 211, 252, .18)),
    rgba(255, 255, 255, .72);
}

body.visual-modern.is-authenticated #module-inicio .home-header span {
  background: color-mix(in srgb, var(--visual-primary) 10%, #ffffff) !important;
  color: var(--visual-primary) !important;
}

body.visual-modern.is-authenticated #module-inicio .home-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 12px !important;
}

body.visual-modern.is-authenticated #module-inicio .home-card {
  min-height: 164px !important;
  grid-template-rows: 50px auto 1fr !important;
  gap: 7px !important;
  padding: 16px !important;
  border-radius: 14px !important;
  text-align: left !important;
  place-items: start !important;
  background: rgba(255, 255, 255, .86) !important;
}

body.visual-modern.is-authenticated #module-inicio .home-icon {
  width: 46px !important;
  height: 46px !important;
  border-radius: 12px !important;
  font-size: 1.16rem !important;
}

body.visual-modern.is-authenticated #module-inicio .home-card b {
  font-size: .98rem !important;
}

body.visual-modern.is-authenticated #module-inicio .home-card small {
  max-width: none !important;
  color: #4b6078 !important;
  font-size: .78rem !important;
}

body.visual-modern.is-authenticated .portal-metrics .metric,
body.visual-modern.is-authenticated .metric {
  min-height: 92px !important;
  border-left: 4px solid var(--primary) !important;
}

body.visual-modern.is-authenticated .metric strong {
  color: #0d2f4f !important;
}

body.visual-modern.is-authenticated .table-wrap,
body.visual-modern.is-authenticated .permission-table-wrap,
body.visual-modern.is-authenticated .grade-table-wrap {
  border: 1px solid var(--visual-line) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .9) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76) !important;
}

body.visual-modern.is-authenticated table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

body.visual-modern.is-authenticated th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef6fb !important;
  color: #24415f !important;
  font-size: .72rem !important;
  letter-spacing: 0 !important;
}

body.visual-modern.is-authenticated td {
  background: rgba(255, 255, 255, .72);
}

body.visual-modern.is-authenticated tbody tr:nth-child(even) td {
  background: #f9fcff;
}

body.visual-modern.is-authenticated tbody tr:hover td {
  background: #edf7ff !important;
}

body.visual-modern.is-authenticated .actions-cell button {
  min-height: 30px !important;
  padding-inline: 9px !important;
  border-radius: 7px !important;
  font-size: .74rem !important;
}

body.visual-modern.is-authenticated .logo-config {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
}

body.visual-modern.is-authenticated .logo-config article {
  border-color: var(--visual-line) !important;
  background: rgba(255, 255, 255, .78) !important;
  box-shadow: 0 10px 22px rgba(15, 44, 82, .06) !important;
}

body.visual-modern.is-authenticated .visual-image-config {
  grid-column: span 2;
}

body.visual-modern.is-authenticated .visual-image-preview {
  width: 100%;
  min-height: 132px;
  border-radius: 10px;
  background: #eef6fb;
}

body.visual-modern.is-authenticated .visual-image-preview img {
  width: 100%;
  height: 132px;
  object-fit: cover;
}

body.visual-modern.is-authenticated .visual-image-preview span {
  min-height: 132px;
  display: grid;
  place-items: center;
  color: var(--visual-muted);
  font-weight: 900;
}

body.visual-classic.is-authenticated {
  background: #f6f8fb !important;
}

body.visual-classic.is-authenticated .module-head,
body.visual-classic.is-authenticated .card {
  backdrop-filter: none !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06) !important;
}

@media (max-width: 920px) {
  body.visual-modern.is-authenticated .visual-image-config {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  body.visual-modern.is-authenticated #module-inicio .home-card {
    min-height: 132px !important;
  }
}

/* Cabecera superior de cada apartado: azul institucional con lectura clara. */
body.visual-modern.is-authenticated .module-head.module-hero,
body.visual-classic.is-authenticated .module-head.module-hero,
body.is-authenticated .module.active .module-head.module-hero {
  border: 1px solid rgba(12, 62, 118, .22) !important;
  background:
    linear-gradient(135deg, var(--visual-primary, #0f4c81) 0%, #145fca 58%, #1d8ad8 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 36px rgba(15, 76, 129, .2) !important;
}

body.visual-modern.is-authenticated .module-head.module-hero h1,
body.visual-modern.is-authenticated .module-head.module-hero h2,
body.visual-modern.is-authenticated .module-head.module-hero p,
body.visual-modern.is-authenticated .module-head.module-hero small,
body.visual-modern.is-authenticated .module-head.module-hero .module-badge,
body.visual-classic.is-authenticated .module-head.module-hero h1,
body.visual-classic.is-authenticated .module-head.module-hero h2,
body.visual-classic.is-authenticated .module-head.module-hero p,
body.visual-classic.is-authenticated .module-head.module-hero small,
body.visual-classic.is-authenticated .module-head.module-hero .module-badge,
body.is-authenticated .module.active .module-head.module-hero h1,
body.is-authenticated .module.active .module-head.module-hero h2,
body.is-authenticated .module.active .module-head.module-hero p,
body.is-authenticated .module.active .module-head.module-hero small,
body.is-authenticated .module.active .module-head.module-hero .module-badge {
  color: #ffffff !important;
}

body.visual-modern.is-authenticated .module-head.module-hero .module-badge,
body.visual-classic.is-authenticated .module-head.module-hero .module-badge,
body.is-authenticated .module.active .module-head.module-hero .module-badge {
  border: 1px solid rgba(255, 255, 255, .32) !important;
  background: rgba(255, 255, 255, .16) !important;
}

body.visual-modern.is-authenticated .module-head.module-hero .module-save-btn,
body.visual-modern.is-authenticated .module-head.module-hero .btn-soft,
body.visual-classic.is-authenticated .module-head.module-hero .module-save-btn,
body.visual-classic.is-authenticated .module-head.module-hero .btn-soft,
body.is-authenticated .module.active .module-head.module-hero .module-save-btn,
body.is-authenticated .module.active .module-head.module-hero .btn-soft {
  border: 1px solid rgba(255, 255, 255, .72) !important;
  background: rgba(255, 255, 255, .94) !important;
  color: var(--visual-primary, #0f4c81) !important;
}

body.visual-modern.is-authenticated .module-head.module-hero .module-save-btn:hover,
body.visual-modern.is-authenticated .module-head.module-hero .btn-soft:hover,
body.visual-classic.is-authenticated .module-head.module-hero .module-save-btn:hover,
body.visual-classic.is-authenticated .module-head.module-hero .btn-soft:hover,
body.is-authenticated .module.active .module-head.module-hero .module-save-btn:hover,
body.is-authenticated .module.active .module-head.module-hero .btn-soft:hover {
  background: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(2, 20, 45, .18) !important;
}

/* Asignaciones docentes: tablero visual, panel lateral y resumen responsive. */
.assignment-board {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}

.assignment-board-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.assignment-board-head h3,
.teacher-assignment-card h3,
.assignment-drawer h2 {
  margin: 0;
  letter-spacing: 0;
}

.assignment-board-head p {
  max-width: 760px;
  margin: 4px 0 0;
  color: var(--muted);
}

.assignment-board-head > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  background: #eaf6ff;
  color: var(--primary-dark);
  font-weight: 900;
  font-size: .82rem;
}

.teacher-assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.teacher-assignment-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(190, 212, 235, .9);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fcff);
  box-shadow: 0 14px 32px rgba(15, 76, 129, .09);
}

.teacher-assignment-card.inactive {
  opacity: .68;
}

.teacher-assignment-top {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.teacher-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #145fca, #63c7f2);
  color: #ffffff;
  font-size: 1.2rem;
}

.teacher-assignment-top p,
.teacher-assignment-top small,
.teacher-course-line span,
.teacher-user-note {
  min-width: 0;
  overflow-wrap: anywhere;
}

.teacher-assignment-top p {
  margin: 5px 0 2px;
  display: flex;
  gap: 7px;
  align-items: center;
  color: #38536f;
  font-size: .86rem;
}

.teacher-assignment-top small,
.teacher-user-note {
  color: var(--muted);
  font-size: .78rem;
}

.teacher-assignment-tags {
  min-height: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.teacher-assignment-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef8ff;
  color: #0b4f91;
  font-weight: 850;
  font-size: .76rem;
}

.teacher-assignment-tags .muted {
  background: #f1f5f9;
  color: #64748b;
}

.teacher-course-line {
  min-width: 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #24415f;
  font-size: .86rem;
}

.teacher-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.teacher-card-metrics span {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #f5f8fc;
  color: #4b6078;
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
}

.teacher-card-metrics b {
  display: block;
  color: #102033;
  font-size: 1rem;
}

.teacher-card-metrics .green b { color: var(--success); }
.teacher-card-metrics .yellow b { color: var(--warning); }

.teacher-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.teacher-card-actions button {
  min-height: 32px;
  padding-inline: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
}

.teacher-user-note.warning {
  color: var(--warning);
  font-weight: 800;
}

.assignment-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 32, 51, .38);
  backdrop-filter: blur(5px);
}

.assignment-drawer {
  width: min(940px, 100%);
  height: 100%;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: clamp(16px, 3vw, 28px);
  background: #f6f9fd;
  box-shadow: -20px 0 48px rgba(15, 32, 51, .2);
}

.assignment-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.assignment-drawer-head span {
  color: var(--primary);
  font-weight: 900;
  font-size: .78rem;
  text-transform: uppercase;
}

.assignment-drawer-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.assignment-flow {
  display: grid;
  gap: 16px;
}

.assignment-flow > section {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(203, 218, 234, .95);
  border-radius: 8px;
  background: #ffffff;
}

.assignment-step-title {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #143b66;
  font-weight: 900;
}

.assignment-step-title b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #145fca;
  color: #ffffff;
}

.assignment-step-help {
  margin: 0;
  color: #5c6f8a;
  font-size: .88rem;
  line-height: 1.35;
}

.assignment-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.assignment-subject-hidden {
  display: none !important;
}

.assignment-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.assignment-course-picker {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #cfe0f3;
  border-radius: 8px;
  background: #eef8ff;
}

.assignment-course-picker small {
  align-self: center;
  color: #38536f;
  font-weight: 800;
}

.assignment-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f8fbff;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}

.assignment-option:hover {
  transform: translateY(-1px);
  border-color: #63c7f2;
}

.assignment-option.selected {
  border-color: #145fca;
  background: #eaf4ff;
  box-shadow: 0 10px 20px rgba(20, 95, 202, .12);
}

.assignment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.assignment-option > i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  color: #145fca;
  box-shadow: inset 0 0 0 1px #dbe7f3;
}

.assignment-option b,
.assignment-option small {
  display: block;
  overflow-wrap: anywhere;
}

.assignment-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .74rem;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch-row span {
  width: 46px;
  height: 26px;
  position: relative;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .2s ease;
}

.switch-row span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform .2s ease;
}

.switch-row input:checked + span {
  background: #15803d;
}

.switch-row input:checked + span::after {
  transform: translateX(20px);
}

.assignment-summary-card {
  display: grid;
  gap: 12px;
}

.assignment-summary-person {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #eef8ff;
}

.assignment-summary-person > i {
  color: #145fca;
  font-size: 1.2rem;
}

.assignment-preview-list {
  display: grid;
  gap: 9px;
}

.assignment-preview-list article {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e0e9f4;
  border-radius: 8px;
}

.assignment-preview-list strong {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #0b3f91;
}

.assignment-preview-list span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assignment-preview-list em {
  padding: 5px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534;
  font-style: normal;
  font-weight: 850;
  font-size: .76rem;
}

.assignment-head-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
}

.assignment-drawer-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(246, 249, 253, 0), #f6f9fd 28%);
}

.hidden {
  display: none !important;
}

.assignment-print-page {
  padding: 24px;
}

.teacher-dashboard-home {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 76, 129, .08);
}

.teacher-dashboard-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.teacher-dashboard-title h2 {
  margin: 2px 0 4px;
  letter-spacing: 0;
}

.teacher-dashboard-title span {
  color: var(--primary);
  font-weight: 900;
  font-size: .78rem;
  text-transform: uppercase;
}

.teacher-dashboard-title p {
  margin: 0;
  color: var(--muted);
}

.teacher-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.teacher-dash-grid article {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 13px;
  border-radius: 8px;
  background: #f3f8ff;
}

.teacher-dash-grid i {
  color: #145fca;
  font-size: 1.15rem;
}

.teacher-dash-grid span {
  color: #4b6078;
  font-weight: 850;
  font-size: .78rem;
}

.teacher-dash-grid b {
  color: #102033;
  font-size: 1.55rem;
}

.teacher-alert-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.teacher-alert-lanes article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 900;
}

.teacher-alert-lanes span {
  font-size: 1.2rem;
}

.teacher-alert-lanes .red { background: #fef2f2; color: #991b1b; }
.teacher-alert-lanes .yellow { background: #fffbeb; color: #92400e; }
.teacher-alert-lanes .blue { background: #eff6ff; color: #1d4ed8; }

.auto-planner {
  display: grid;
  gap: 16px;
  grid-column: 1 / -1;
}

.planner-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: clamp(16px, 3vw, 24px);
  border-radius: 8px;
  background: linear-gradient(135deg, #0b4f91, #145fca 58%, #63c7f2);
  color: #ffffff;
}

.planner-hero span {
  display: inline-block;
  margin-bottom: 5px;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-hero h2,
.planner-hero p {
  margin: 0;
  color: #ffffff;
  letter-spacing: 0;
}

.planner-hero p {
  max-width: 760px;
  margin-top: 6px;
  opacity: .92;
}

.planner-hero small {
  display: block;
  max-width: 860px;
  margin-top: 10px;
  color: rgba(255, 255, 255, .88);
  line-height: 1.35;
}

.planner-hero > i {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  font-size: 1.8rem;
}

.planner-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: end;
}

.planner-assistant-steps,
.planner-capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.planner-assistant-steps article,
.planner-capability-card {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #ffffff;
}

.planner-assistant-steps article {
  min-height: 112px;
  position: relative;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
}

.planner-assistant-steps i,
.planner-capability-card > i {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #145fca;
}

.planner-assistant-steps span {
  display: block;
  color: #64748b;
  font-size: .72rem;
  text-transform: uppercase;
}

.planner-assistant-steps b,
.planner-capability-card b {
  display: block;
  color: #102033;
  font-size: .98rem;
  line-height: 1.18;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.planner-assistant-steps p,
.planner-capability-card p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: .84rem;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.planner-form .full,
.planner-checks.full {
  grid-column: 1 / -1;
}

.planner-form > label {
  grid-column: span 2;
  min-width: 0;
}

.planner-form > label:nth-of-type(1),
.planner-form > label:nth-of-type(2),
.planner-form > label:nth-of-type(3),
.planner-form > label:nth-of-type(4) {
  grid-column: span 3;
}

.planner-form > label:nth-of-type(5),
.planner-form > label:nth-of-type(6),
.planner-form > label:nth-of-type(7),
.planner-form > label:nth-of-type(8) {
  grid-column: span 3;
}

.planner-form label input,
.planner-form label select {
  width: 100%;
  min-width: 0;
}

.planner-checks {
  min-width: 0;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f8fbff;
}

.planner-checks legend {
  padding-inline: 6px;
  color: #143b66;
  font-weight: 900;
}

.planner-checks label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #24415f;
  font-size: .86rem;
}

.planner-checks span {
  overflow-wrap: anywhere;
}

.planner-days {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
}

.planner-days legend {
  grid-column: 1 / -1;
}

.planner-days label {
  display: flex;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 900;
}

.planner-mode {
  grid-column: span 4;
  align-content: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.planner-mode legend {
  grid-column: 1 / -1;
}

.planner-mode label {
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
}

.planner-capability-section,
.planner-ai-actions,
.planner-utp-dashboard {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f8fbff;
}

.planner-capability-card small,
.planner-resource-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.planner-capability-card small span,
.planner-resource-list span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #24415f;
  font-size: .74rem;
}

.planner-trace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.planner-trace-grid article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #ffffff;
}

.planner-trace-grid article > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: .72rem;
}

.planner-trace-grid strong {
  color: #0b4f59;
}

.planner-trace-grid .ok {
  background: #ecfdf5;
  color: #166534;
}

.planner-trace-grid .warn {
  background: #fff7ed;
  color: #9a3412;
}

.planner-ai-actions {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  background: #ffffff;
}

.planner-ai-actions button {
  justify-content: center;
}

.planner-official-validation {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
}

.planner-official-validation.blocked {
  border-color: #fed7aa;
  background: #fff7ed;
}

.planner-official-validation h3 {
  margin: 0 0 4px;
}

.planner-official-validation p {
  margin: 0;
  color: #64748b;
}

.planner-validation-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planner-validation-checks span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .76rem;
  background: #ffffff;
}

.planner-validation-checks .ok {
  color: #166534;
}

.planner-validation-checks .warn {
  color: #9a3412;
}

.planner-utp-dashboard {
  background: linear-gradient(135deg, #f8fbff, #ffffff);
}

.planner-utp-dashboard p {
  margin: 4px 0 0;
  color: #64748b;
}

.planner-info-grid,
.planner-dua-panel > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.planner-info-grid article,
.planner-dua-panel article {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #e0e9f4;
  border-radius: 8px;
  background: #ffffff;
}

.planner-info-grid span,
.planner-dua-panel b {
  color: #145fca;
  font-weight: 900;
  font-size: .78rem;
}

.planner-info-grid b {
  overflow-wrap: anywhere;
  color: #102033;
}

.planner-info-grid small,
.planner-dua-panel span,
.planner-utp-panel p,
.planner-mineduc-note p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.planner-utp-panel,
.planner-dua-panel,
.planner-mineduc-note,
.planner-saved {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f8fbff;
}

.planner-utp-panel h3,
.planner-dua-panel h3,
.planner-mineduc-note h3 {
  margin: 0;
}

.planner-utp-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planner-utp-checks span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .78rem;
}

.planner-utp-checks .ok {
  background: #ecfdf5;
  color: #166534;
}

.planner-utp-checks .warn {
  background: #fffbeb;
  color: #92400e;
}

.planner-print-page {
  padding: 26px;
}

.planner-print-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #145fca;
}

.planner-print-head span {
  color: #145fca;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-print-head h2 {
  margin: 4px 0;
  color: #102033;
}

.planner-print-head b {
  color: #145fca;
}

@media (max-width: 1180px) {
  .planner-assistant-steps {
    grid-template-columns: 1fr;
  }
  .planner-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .planner-form > label,
  .planner-form > label:nth-of-type(1),
  .planner-form > label:nth-of-type(2),
  .planner-form > label:nth-of-type(3),
  .planner-form > label:nth-of-type(4),
  .planner-form > label:nth-of-type(5),
  .planner-form > label:nth-of-type(6),
  .planner-form > label:nth-of-type(7),
  .planner-form > label:nth-of-type(8) {
    grid-column: span 3;
  }
  .planner-mode {
    grid-column: 1 / -1;
  }
}

.planner-institutional-doc {
  width: min(100%, 8.5in);
  margin: 0 auto;
  padding: 24px;
  background: #ffffff;
  color: #07314a;
  font-size: 12px;
  line-height: 1.42;
}

.planner-doc-header {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1.5px solid #9dd3ef;
  border-radius: 8px;
}

.planner-doc-logo {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed #63c7f2;
  border-radius: 8px;
  overflow: hidden;
}

.planner-doc-logo img {
  max-width: 100%;
  max-height: 70px;
  object-fit: contain;
}

.planner-doc-school h1 {
  margin: 0 0 4px;
  color: #0b4f59;
  font-size: 18px;
  text-transform: uppercase;
}

.planner-doc-school p,
.planner-doc-school span,
.planner-doc-meta span {
  margin: 0;
  color: #47677a;
}

.planner-doc-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.planner-doc-meta b {
  color: #0b4f59;
  font-size: 11px;
  text-transform: uppercase;
}

.planner-doc-ficha,
.planner-doc-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  border: 1px solid #9dd3ef;
  border-radius: 8px;
  overflow: hidden;
}

.planner-doc-cards {
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
}

.planner-doc-ficha div,
.planner-doc-cards div {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid #c8e8f7;
}

.planner-doc-ficha div:last-child,
.planner-doc-cards div:last-child {
  border-right: 0;
}

.planner-doc-ficha span,
.planner-doc-cards span {
  display: block;
  margin-bottom: 4px;
  color: #0b4f59;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-doc-ficha b,
.planner-doc-cards b {
  display: block;
  overflow-wrap: anywhere;
  color: #07314a;
}

.planner-doc-title {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #9dd3ef;
  border-radius: 8px;
  text-align: center;
}

.planner-doc-title span,
.planner-doc-section-head h3 {
  color: #0b4f59;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-doc-title h2 {
  margin: 4px 0 0;
  color: #07314a;
  font-size: 18px;
}

.planner-doc-section {
  margin-top: 12px;
  border: 1px solid #9dd3ef;
  border-radius: 8px;
  overflow: hidden;
  page-break-inside: avoid;
  break-inside: avoid;
}

.planner-doc-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #c8e8f7;
  background: #f7fcff;
}

.planner-doc-section-head h3 {
  margin: 0;
}

.planner-doc-section-head span {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-doc-section-head .warn {
  background: #fff7ed;
  color: #9a3412;
}

.planner-doc-section-head .ok {
  background: #ecfdf5;
  color: #166534;
}

.planner-source-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #c8e8f7;
  border-radius: 8px;
  background: #f7fcff;
}

.planner-source-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.planner-source-legend .official {
  background: #dbeafe;
  color: #1e40af;
}

.planner-source-legend .ai {
  background: #fef3c7;
  color: #92400e;
}

.planner-source-legend .validation {
  flex: 1 1 240px;
  border-radius: 7px;
  background: #ffffff;
  color: #47677a;
  font-weight: 400;
}

.planner-print-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
}

.planner-print-chip-list span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #24415f;
  font-size: 10px;
}

.planner-alert {
  margin: 10px;
  padding: 10px;
  border-left: 4px solid #0ea5e9;
  border-radius: 7px;
  background: #f0f9ff;
}

.planner-coverage-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
}

.planner-coverage-grid > div {
  min-width: 0;
  padding: 10px;
  border-bottom: 1px solid #c8e8f7;
}

.planner-coverage-grid > div:nth-child(odd) {
  border-right: 1px solid #c8e8f7;
  background: #f7fcff;
}

.planner-coverage-grid .label {
  color: #0b4f59;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-oa-card {
  padding: 9px;
  border: 1px solid #bfe3f3;
  border-radius: 7px;
  background: #ffffff;
}

.planner-dua-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.planner-dua-matrix section {
  min-width: 0;
  border-right: 1px solid #c8e8f7;
}

.planner-dua-matrix section:last-child {
  border-right: 0;
}

.planner-dua-matrix h4 {
  min-height: 46px;
  margin: 0;
  padding: 9px;
  border-bottom: 1px solid #c8e8f7;
  color: #07314a;
  font-size: 11px;
}

.planner-dua-matrix p {
  min-height: 34px;
  margin: 0;
  padding: 7px 9px;
  border-bottom: 1px solid #e0f1f8;
}

.planner-dua-matrix span {
  display: inline-block;
  min-width: 18px;
  color: #64748b;
  font-size: 13px;
}

.planner-dua-matrix span.checked {
  color: #0b7bd3;
}

.planner-route-list {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.planner-route-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid #c8e8f7;
  border-radius: 8px;
  background: #ffffff;
  page-break-inside: avoid;
  break-inside: avoid;
}

.planner-route-date {
  display: grid;
  align-content: start;
  gap: 4px;
  color: #0b4f59;
}

.planner-route-card h4 {
  margin: 0 0 6px;
  color: #07314a;
  font-size: 12px;
}

.planner-route-card p,
.planner-doc-section > p {
  margin: 0 0 5px;
}

.planner-doc-section > p {
  padding: 0 10px 10px;
}

.planner-doc-section > p:first-of-type {
  padding-top: 10px;
}

.planner-doc-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid #c8e8f7;
  color: #47677a;
  font-size: 10px;
}

@media print {
  .planner-institutional-doc {
    width: 100%;
    padding: 0;
    font-size: 10.5px;
  }
  .planner-doc-section,
  .planner-route-card,
  .page-avoid {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

@media (max-width: 760px) {
  .planner-doc-header,
  .planner-doc-ficha,
  .planner-doc-cards,
  .planner-coverage-grid,
  .planner-dua-matrix,
  .planner-route-card {
    grid-template-columns: 1fr;
  }
  .planner-doc-ficha div,
  .planner-doc-cards div,
  .planner-coverage-grid > div,
  .planner-dua-matrix section {
    border-right: 0;
  }
  .planner-doc-meta {
    justify-items: start;
    text-align: left;
  }
}

/* Sidebar module grouping: keeps Funcionarios in the left menu without changing its module logic. */
body.is-authenticated .nav-group-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: #35526f;
  font-size: .64rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

body.is-authenticated .nav-profesores {
  border-color: rgba(124, 58, 237, .34) !important;
}

body.is-authenticated .nav-profesores.active {
  background: linear-gradient(135deg, #f1e7ff, #ffffff) !important;
}

@media (min-width: 781px) {
  body.is-authenticated .nav-scroll {
    align-items: center;
  }
}

@media (min-width: 1181px) {
  body.is-authenticated .nav-scroll .nav-group-label {
    width: 70px;
    min-height: 30px;
    padding: 4px 6px;
    border-radius: 10px;
    white-space: normal;
    font-size: .55rem;
  }
}

@media (max-width: 780px) {
  body.is-authenticated .nav-group-label {
    width: 100%;
    justify-content: flex-start;
    padding-inline: 10px;
    border-radius: 8px;
    font-size: .68rem;
  }
}

@media (max-width: 780px) {
  .assignment-board-head,
  .assignment-drawer-head,
  .assignment-drawer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-card-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-card-actions button,
  .assignment-drawer-actions button {
    width: 100%;
    justify-content: center;
  }

  .assignment-drawer {
    padding: 14px;
  }

  .assignment-course-picker {
    grid-template-columns: 1fr;
  }

  .teacher-dashboard-title {
    align-items: stretch;
    flex-direction: column;
  }

  .planner-hero,
  .planner-print-head {
    align-items: stretch;
    flex-direction: column;
  }

  .planner-assistant-steps,
  .planner-capability-grid,
  .planner-form {
    grid-template-columns: 1fr;
  }

  .planner-assistant-steps article {
    min-height: auto;
    align-items: flex-start;
  }

  .planner-form > label,
  .planner-form > label:nth-of-type(1),
  .planner-form > label:nth-of-type(2),
  .planner-form > label:nth-of-type(3),
  .planner-form > label:nth-of-type(4),
  .planner-form > label:nth-of-type(5),
  .planner-form > label:nth-of-type(6),
  .planner-form > label:nth-of-type(7),
  .planner-form > label:nth-of-type(8),
  .planner-mode {
    grid-column: 1 / -1;
  }

  .planner-mode {
    grid-template-columns: 1fr;
  }

  .planner-days {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Institutional visual audit 2026: unified school platform polish. */
:root {
  --primary: #145fca;
  --primary-dark: #0b3f91;
  --institutional-sky: #63c7f2;
  --accent: #63c7f2;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #102033;
  --muted: #5c728c;
  --line: #d8e4f2;
  --success: #15803d;
  --warning: #b7791f;
  --danger: #dc2626;
  --info: #145fca;
  --radius: 8px;
  --shadow: 0 12px 30px rgba(15, 44, 82, .08);
  --shadow-hover: 0 18px 42px rgba(20, 95, 202, .13);
  --institutional-watermark: var(--brand-logo);
  --watermark-opacity: .08;
  --watermark-display: block;
  --watermark-size: min(64%, 560px);
}

html {
  font-size: 16px;
}

body {
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(99, 199, 242, .16), transparent 320px),
    var(--bg) !important;
  color: var(--text);
  font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif !important;
  font-size: 14px;
}

body::before {
  content: "";
  display: var(--watermark-display);
  position: fixed;
  inset: 50% auto auto 50%;
  width: var(--watermark-size);
  max-width: 920px;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  background: var(--institutional-watermark) center / contain no-repeat;
  opacity: var(--watermark-opacity);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

body.watermark-full::before {
  width: min(92vw, 1000px);
  height: min(72vh, 720px);
  aspect-ratio: auto;
}

h1, h2, h3, h4,
.brand h1,
.module-head h2 {
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: max(12px, .88rem);
}

button {
  min-height: 38px;
}

.topbar {
  background: rgba(255, 255, 255, .96) !important;
  border-bottom: 1px solid rgba(216, 228, 242, .95);
}

.brand-row {
  grid-template-columns: minmax(240px, 1fr) minmax(190px, auto) minmax(230px, .75fr) auto;
}

.brand p {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.logo,
.login-badge,
.report-logo,
.utp-report-logo,
.boletin-logo,
.planner-doc-logo,
.logo-preview {
  overflow: hidden;
  background: #ffffff;
}

.logo img,
.login-badge img,
.report-logo img,
.utp-report-logo img,
.boletin-logo img,
.planner-doc-logo img,
.logo-preview img,
img[class*="logo"],
img[class*="insignia"] {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain !important;
  object-position: center;
  aspect-ratio: auto;
}

.nav-scroll {
  gap: 6px;
  padding-block: 8px;
  background: #ffffff !important;
}

.nav-btn {
  min-width: 86px;
  min-height: 54px;
  border-color: #d8e4f2;
  background: #ffffff;
  color: #344a63;
}

.nav-btn.active {
  background: linear-gradient(180deg, #eef8ff, #ffffff) !important;
  border-color: rgba(20, 95, 202, .34);
  color: var(--primary-dark);
}

.mobile-menu-toggle {
  right: 14px;
  bottom: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--primary-dark);
}

main {
  width: 100%;
  max-width: none;
}

.module > * {
  max-width: 1680px;
}

.module-head,
.card,
.course-context,
.config-quick-card,
.planner-capability-card,
.planner-assistant-steps article {
  border-radius: 8px !important;
  border-color: rgba(216, 228, 242, .96) !important;
  box-shadow: var(--shadow) !important;
}

.module-head {
  background:
    linear-gradient(135deg, rgba(232, 247, 255, .94), rgba(255, 255, 255, .98)),
    #ffffff !important;
}

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(250, 253, 255, .98)),
    #ffffff !important;
}

.card:hover {
  box-shadow: var(--shadow-hover) !important;
}

.form-grid,
.config-form,
.planner-form {
  align-items: end;
}

label {
  color: #24415f;
  line-height: 1.25;
}

.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.check-row input {
  flex: 0 0 auto;
}

input,
select,
textarea {
  border-color: #cfdceb;
  background: #ffffff;
}

input:invalid:not(:placeholder-shown),
select:invalid,
textarea:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .08);
}

.pill.green,
.insight.green,
.report-grade-badge.green {
  background: #ecfdf5 !important;
  color: #166534 !important;
}

.pill.yellow,
.insight.yellow,
.report-grade-badge.yellow {
  background: #fffbeb !important;
  color: #92400e !important;
}

.pill.red,
.insight.red,
.report-grade-badge.red {
  background: #fef2f2 !important;
  color: #991b1b !important;
}

.pill.blue,
.insight.blue,
.report-grade-badge.blue {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.smart-table {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.table-tools {
  display: grid;
  grid-template-columns: minmax(180px, 360px) auto;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.table-count {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  scrollbar-width: thin;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef6ff !important;
}

th,
td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.table-sort {
  width: 100%;
  min-height: 28px;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  text-align: left;
}

.table-sort:hover {
  transform: none;
  background: transparent;
}

.table-sort i {
  margin-left: auto;
  color: #6b87a6;
  font-size: .72rem;
}

.report-paper,
.report-student-paper,
.planner-institutional-doc,
.utp-academic-report {
  position: relative;
  background: #ffffff !important;
}

.report-paper::marker,
.report-student-paper::marker {
  content: "";
}

.report-paper .report-watermark,
.report-student-paper .report-watermark {
  opacity: var(--watermark-opacity);
}

.report-paper::after,
.report-student-paper::after,
.planner-institutional-doc::after,
.utp-academic-report::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: var(--watermark-size);
  max-width: 760px;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  background: var(--institutional-watermark) center / contain no-repeat;
  opacity: var(--watermark-opacity);
  pointer-events: none;
  z-index: 0;
}

.report-paper > *,
.report-student-paper > *,
.planner-institutional-doc > *,
.utp-academic-report > * {
  position: relative;
  z-index: 1;
}

.report-header,
.planner-doc-header {
  grid-template-columns: 78px minmax(0, 1fr) 78px;
  align-items: center;
}

.report-header h2,
.planner-doc-school h1 {
  text-align: center;
}

@media (min-width: 1181px) {
  body.is-authenticated .nav-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(86px, max-content);
    align-items: stretch;
  }
}

@media (max-width: 1180px) {
  .brand-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .active-module-card,
  .topbar-search {
    grid-column: 1 / -1;
  }

  .actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  body {
    font-size: 13px;
  }

  .brand-row {
    padding-right: 62px;
  }

  .brand p,
  .active-module-card {
    display: none !important;
  }

  .nav-scroll {
    display: none;
    position: fixed;
    inset: var(--topbar-height) 10px auto 10px;
    max-height: min(70vh, 560px);
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 22px 50px rgba(15, 44, 82, .22);
  }

  .nav-scroll.open {
    display: grid;
    grid-template-columns: 1fr;
  }

  .nav-btn {
    width: 100%;
    min-height: 44px;
    flex-direction: row;
    justify-content: flex-start;
  }

  .nav-btn i {
    flex: 0 0 30px;
  }

  .actions,
  .data-actions,
  .form-actions,
  .table-tools,
  .list-card-head {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .actions button,
  .data-actions button,
  .form-actions button,
  .table-tools .search-field {
    width: 100%;
  }

  .report-header,
  .planner-doc-header {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    gap: 8px;
  }
}

@media (min-width: 1800px) {
  .module > * {
    max-width: 1760px;
  }

  .grid.auto {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media print {
  @page {
    size: letter;
    margin: 1.2cm;
  }

  body {
    background: #ffffff !important;
    font-size: 12px;
  }

  body::before {
    display: none !important;
  }

  body.watermark-print-only .report-paper::after,
  body.watermark-print-only .report-student-paper::after,
  body.watermark-print-only .planner-institutional-doc::after,
  body.watermark-print-only .utp-academic-report::after {
    display: block;
  }

  .topbar,
  .module-head,
  .no-print,
  .statusbar,
  .table-tools,
  form,
  .form-actions {
    display: none !important;
  }

  .app-shell,
  main {
    padding: 0 !important;
  }

  .card {
    box-shadow: none !important;
    border: 0 !important;
  }

  .table-wrap {
    overflow: visible !important;
    border: 0;
  }

  th {
    position: static;
  }
}

/* Home hero logo correction: final override for transparent institutional logos. */
body.is-authenticated #module-inicio .dashboard-home,
body.visual-modern.is-authenticated #module-inicio .dashboard-home {
  background:
    radial-gradient(circle at 8% 0%, rgba(99, 199, 242, .36), transparent 34%),
    linear-gradient(135deg, #0b3f91 0%, #145fca 58%, #2f8af2 100%) !important;
  border: 1px solid rgba(99, 199, 242, .38) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
}

body.is-authenticated #module-inicio .home-header,
body.visual-modern.is-authenticated #module-inicio .home-header {
  position: relative;
  min-height: clamp(168px, 19vw, 220px);
  padding: clamp(28px, 4vw, 48px) clamp(88px, 11vw, 150px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: hidden;
}

body.is-authenticated #module-inicio .home-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 29, 70, .22), rgba(255, 255, 255, .07));
  pointer-events: none;
}

body.is-authenticated #module-inicio .home-header > span,
body.is-authenticated #module-inicio .home-header > h1,
body.is-authenticated #module-inicio .home-header > p {
  position: relative;
  z-index: 2;
}

body.is-authenticated #module-inicio .home-header > span,
body.visual-modern.is-authenticated #module-inicio .home-header > span {
  width: fit-content;
  margin-bottom: 12px;
  padding: 0 !important;
  background: transparent !important;
  color: rgba(255, 255, 255, .86) !important;
  font-weight: 800;
}

body.is-authenticated #module-inicio .home-header h1,
body.visual-modern.is-authenticated #module-inicio .home-header h1 {
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(5, 25, 54, .24);
}

body.is-authenticated #module-inicio .home-header p,
body.visual-modern.is-authenticated #module-inicio .home-header p {
  color: rgba(255, 255, 255, .92) !important;
  text-shadow: 0 1px 8px rgba(5, 25, 54, .18);
}

body.is-authenticated #module-inicio .home-corner-logo {
  position: absolute;
  z-index: 1;
  top: clamp(16px, 2vw, 24px);
  width: clamp(58px, 7vw, 104px);
  height: clamp(58px, 7vw, 104px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  opacity: .92;
  pointer-events: none;
}

body.is-authenticated #module-inicio .home-corner-logo-left {
  left: clamp(16px, 2.4vw, 34px);
}

body.is-authenticated #module-inicio .home-corner-logo-right {
  right: clamp(16px, 2.4vw, 34px);
}

body.is-authenticated #module-inicio .home-corner-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center;
  aspect-ratio: auto;
  mix-blend-mode: normal;
}

@media (max-width: 780px) {
  body.is-authenticated #module-inicio .home-header,
  body.visual-modern.is-authenticated #module-inicio .home-header {
    min-height: 176px;
    padding: 84px 18px 22px !important;
  }

  body.is-authenticated #module-inicio .home-corner-logo {
    width: 54px;
    height: 54px;
    top: 16px;
  }
}

/* Final reports header override: white top, corner logos, original alpha preserved. */
.report-paper .report-header,
.report-student-paper .report-header,
.planner-institutional-doc .planner-doc-header {
  min-height: 1.25in !important;
  display: grid !important;
  grid-template-columns: 1.05in minmax(0, 1fr) 1.05in !important;
  gap: .22in !important;
  align-items: center !important;
  margin: 0 0 .2in !important;
  padding: .18in .22in !important;
  border: 1px solid #c7d9ee !important;
  border-top: 8px solid #145fca !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0b3f91 !important;
  box-shadow: none !important;
}

.report-paper .report-header h2,
.report-student-paper .report-header h2,
.planner-institutional-doc .planner-doc-school h1 {
  color: #0b3f91 !important;
  text-align: left !important;
  text-transform: none !important;
}

.report-paper .report-header p,
.report-student-paper .report-header p,
.planner-institutional-doc .planner-doc-school p,
.planner-institutional-doc .planner-doc-school span {
  color: #24415f !important;
  text-align: left !important;
}

.report-paper .report-logo,
.report-student-paper .report-logo,
.planner-institutional-doc .planner-doc-logo,
.boletin-logo,
.boletin-shield {
  width: .92in !important;
  height: .92in !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.report-paper .report-header .report-logo:last-child,
.report-student-paper .report-header .report-logo:last-child,
.boletin-shield {
  justify-self: end !important;
}

.report-paper .report-logo img,
.report-student-paper .report-logo img,
.planner-institutional-doc .planner-doc-logo img,
.boletin-logo img,
.boletin-shield img {
  display: block !important;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  aspect-ratio: auto !important;
}

.report-student-paper .boletin-cover,
.boletin-cover.boletin-cover-print {
  min-height: 1.35in !important;
  display: grid !important;
  grid-template-columns: 1fr 1.1in !important;
  gap: .22in !important;
  align-items: center !important;
  margin: 0 !important;
  padding: .18in .24in !important;
  border: 1px solid #c7d9ee !important;
  border-top: 8px solid #145fca !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0b3f91 !important;
}

.boletin-brand {
  display: grid !important;
  grid-template-columns: 1.05in minmax(0, 1fr) !important;
  gap: .22in !important;
  align-items: center !important;
  justify-content: start !important;
  text-align: left !important;
}

.boletin-brand h2 {
  color: #0b3f91 !important;
  text-align: left !important;
  text-transform: none !important;
}

.boletin-brand p,
.boletin-page-number {
  color: #24415f !important;
  text-align: left !important;
  text-transform: none !important;
}

/* Final preview-style override: dashboard layout from reference, preserving nuVez colors. */
:root {
  --preview-sidebar-width: 285px;
  --preview-radius: 22px;
  --preview-panel: rgba(255, 255, 255, .9);
  --preview-soft: color-mix(in srgb, var(--primary) 10%, #ffffff);
  --preview-line: color-mix(in srgb, var(--primary) 16%, #ffffff);
  --preview-shadow: 0 20px 60px color-mix(in srgb, var(--primary) 16%, transparent);
  --modern-blue: var(--primary);
  --modern-cyan: var(--bottom-hover, var(--primary));
  --modern-pink: var(--accent);
  --modern-violet: var(--primary-dark);
  --modern-amber: var(--accent);
}

body.is-authenticated,
body.visual-modern.is-authenticated {
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 32%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 28%),
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 5%, #ffffff) 0, var(--bg) 360px, #f8fbff 100%) !important;
}

@media (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: var(--preview-sidebar-width) !important;
    height: 100vh !important;
    min-height: 100vh !important;
    display: grid !important;
    grid-template-rows: auto 1fr !important;
    padding: 20px !important;
    overflow: auto !important;
    background: linear-gradient(180deg, var(--primary-dark), var(--primary)) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 12px 0 40px color-mix(in srgb, var(--primary-dark) 22%, transparent) !important;
  }

  body.is-authenticated .brand-row,
  body.visual-modern.is-authenticated .brand-row {
    position: static !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    color: #ffffff !important;
    font-size: 1.2rem !important;
    text-shadow: none !important;
  }

  body.is-authenticated .brand p,
  body.visual-modern.is-authenticated .brand p {
    display: block !important;
    color: color-mix(in srgb, #ffffff 78%, var(--accent)) !important;
    font-size: .78rem !important;
  }

  body.is-authenticated .logo,
  body.visual-modern.is-authenticated .logo {
    width: 52px !important;
    height: 52px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--accent) 22%, #ffffff)) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .2) !important;
  }

  body.is-authenticated .active-module-card,
  body.visual-modern.is-authenticated .active-module-card {
    display: grid !important;
    gap: 4px !important;
    padding: 14px !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    border-radius: var(--preview-radius) !important;
    background: rgba(255, 255, 255, .13) !important;
    color: #ffffff !important;
  }

  body.is-authenticated .active-module-card *,
  body.visual-modern.is-authenticated .active-module-card * {
    color: #ffffff !important;
  }

  body.is-authenticated .topbar-search .search-field input,
  body.visual-modern.is-authenticated .topbar-search .search-field input {
    min-height: 44px !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .12) !important;
  }

  body.is-authenticated .actions,
  body.visual-modern.is-authenticated .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    justify-content: stretch !important;
    overflow: visible !important;
  }

  body.is-authenticated .actions button,
  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .actions button,
  body.visual-modern.is-authenticated .year-control {
    width: 100% !important;
    justify-content: center !important;
    border-radius: 15px !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    visibility: visible !important;
    pointer-events: auto !important;
    display: grid !important;
    grid-auto-flow: row !important;
    align-content: start !important;
    gap: 7px !important;
    width: 100% !important;
    max-width: none !important;
    padding: 16px 0 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.is-authenticated .nav-scroll *,
  body.is-authenticated .nav-scroll::before,
  body.visual-modern.is-authenticated .nav-scroll *,
  body.visual-modern.is-authenticated .nav-scroll::before {
    visibility: visible !important;
  }

  body.is-authenticated .nav-scroll::before,
  body.visual-modern.is-authenticated .nav-scroll::before {
    display: none !important;
  }

  body.is-authenticated .nav-btn,
  body.visual-modern.is-authenticated .nav-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: transparent !important;
    color: color-mix(in srgb, #ffffff 88%, var(--accent)) !important;
    text-align: left !important;
    box-shadow: none !important;
  }

  body.is-authenticated .nav-btn i,
  body.visual-modern.is-authenticated .nav-btn i {
    width: 34px !important;
    height: 34px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .14) !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }

  body.is-authenticated .nav-btn:hover,
  body.is-authenticated .nav-btn.active,
  body.visual-modern.is-authenticated .nav-btn:hover,
  body.visual-modern.is-authenticated .nav-btn.active {
    background: rgba(255, 255, 255, .18) !important;
    color: #ffffff !important;
  }

  body.is-authenticated .nav-btn:hover i,
  body.is-authenticated .nav-btn.active i,
  body.visual-modern.is-authenticated .nav-btn:hover i,
  body.visual-modern.is-authenticated .nav-btn.active i {
    background: #ffffff !important;
    color: var(--primary-dark) !important;
  }

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    margin-left: var(--preview-sidebar-width) !important;
    max-width: calc(100vw - var(--preview-sidebar-width)) !important;
    padding: 24px !important;
    overflow-x: hidden !important;
    background: transparent !important;
  }
}

body.is-authenticated .card,
body.is-authenticated .course-context,
body.is-authenticated .module-head,
body.is-authenticated .table-wrap,
body.visual-modern.is-authenticated .card,
body.visual-modern.is-authenticated .course-context,
body.visual-modern.is-authenticated .module-head,
body.visual-modern.is-authenticated .table-wrap {
  border: 1px solid var(--preview-line) !important;
  border-radius: var(--preview-radius) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.78)) !important;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--primary) 9%, transparent) !important;
  backdrop-filter: blur(10px) saturate(1.06);
}

body.is-authenticated #module-inicio .dashboard-home,
body.visual-modern.is-authenticated #module-inicio .dashboard-home {
  border: 0 !important;
  border-radius: 32px !important;
  padding: 0 !important;
  color: var(--text) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.is-authenticated #module-inicio .home-header,
body.visual-modern.is-authenticated #module-inicio .home-header,
body.is-authenticated .module-head.module-hero,
body.visual-modern.is-authenticated .module-head.module-hero {
  border: 0 !important;
  border-radius: 32px !important;
  color: #ffffff !important;
  background:
    radial-gradient(circle at 92% -18%, rgba(255,255,255,.26), transparent 26%),
    linear-gradient(135deg, var(--primary-dark), var(--primary) 58%, color-mix(in srgb, var(--primary) 72%, #ffffff)) !important;
  box-shadow: var(--preview-shadow) !important;
  overflow: hidden !important;
}

body.is-authenticated #module-inicio .home-header {
  min-height: clamp(210px, 22vw, 280px) !important;
  display: grid !important;
  align-content: center !important;
  padding: clamp(30px, 4vw, 54px) clamp(92px, 10vw, 150px) !important;
}

body.is-authenticated #module-inicio .home-header h1,
body.visual-modern.is-authenticated #module-inicio .home-header h1 {
  margin-top: 8px !important;
  font-size: clamp(2rem, 4vw, 3.2rem) !important;
  color: #ffffff !important;
}

body.is-authenticated #module-inicio .home-header p,
body.visual-modern.is-authenticated #module-inicio .home-header p,
body.is-authenticated .module-head.module-hero p,
body.visual-modern.is-authenticated .module-head.module-hero p {
  color: rgba(255,255,255,.9) !important;
}

body.is-authenticated #module-inicio .home-grid,
body.visual-modern.is-authenticated #module-inicio .home-grid,
body.is-authenticated .portal-metrics,
body.visual-modern.is-authenticated .portal-metrics {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 16px !important;
  margin-top: 18px !important;
}

body.is-authenticated #module-inicio .home-card,
body.visual-modern.is-authenticated #module-inicio .home-card,
body.is-authenticated .section-link-card,
body.visual-modern.is-authenticated .section-link-card {
  min-height: 168px !important;
  padding: 18px !important;
  border-radius: var(--preview-radius) !important;
  border: 1px solid var(--preview-line) !important;
  background: var(--preview-panel) !important;
  color: var(--text) !important;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--primary) 9%, transparent) !important;
}

body.is-authenticated #module-inicio .home-icon,
body.visual-modern.is-authenticated #module-inicio .home-icon,
body.is-authenticated .section-link-card i,
body.visual-modern.is-authenticated .section-link-card i,
body.is-authenticated .metric-icon,
body.visual-modern.is-authenticated .metric-icon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 18px !important;
  display: grid !important;
  place-items: center !important;
  background: var(--preview-soft) !important;
  color: var(--primary) !important;
  font-size: 1.35rem !important;
  box-shadow: none !important;
}

body.is-authenticated .metric,
body.visual-modern.is-authenticated .metric {
  min-height: 118px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 52px !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  gap: 4px 12px !important;
  border-left: 0 !important;
  padding: 18px !important;
  background: var(--preview-panel) !important;
}

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

body.is-authenticated .metric-icon,
body.visual-modern.is-authenticated .metric-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
}

body.is-authenticated .metric strong,
body.visual-modern.is-authenticated .metric strong {
  color: var(--text) !important;
  font-size: clamp(1.75rem, 3vw, 2.25rem) !important;
  line-height: 1 !important;
}

body.is-authenticated .btn-primary,
body.visual-modern.is-authenticated .btn-primary {
  border-radius: 15px !important;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
  color: #ffffff !important;
}

body.is-authenticated .btn-accent,
body.visual-modern.is-authenticated .btn-accent {
  border-radius: 15px !important;
  background: var(--accent) !important;
  color: color-mix(in srgb, var(--primary-dark) 80%, #000000) !important;
}

body.is-authenticated th,
body.visual-modern.is-authenticated th {
  background: color-mix(in srgb, var(--primary) 9%, #ffffff) !important;
  color: var(--primary) !important;
}

@media (max-width: 980px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    background: #ffffff !important;
  }

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    margin-left: 0 !important;
    max-width: 100vw !important;
  }

  body.is-authenticated #module-inicio .home-header,
  body.visual-modern.is-authenticated #module-inicio .home-header {
    min-height: 190px !important;
    padding: 86px 18px 24px !important;
    border-radius: 24px !important;
  }
}

/* Final responsive cleanup: left menu remains ordered on desktop and collapses cleanly on smaller screens. */
:root {
  --preview-sidebar-width: clamp(236px, 21vw, 285px);
}

@media (min-width: 981px) {
  body.is-authenticated .app-shell,
  body.visual-modern.is-authenticated .app-shell {
    padding-top: 0 !important;
  }

  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    width: var(--preview-sidebar-width) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    overflow: hidden !important;
  }

  body.is-authenticated .brand-row,
  body.visual-modern.is-authenticated .brand-row {
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.is-authenticated .brand,
  body.visual-modern.is-authenticated .brand {
    min-width: 0 !important;
    align-items: center !important;
  }

  body.is-authenticated .brand > div:last-child,
  body.visual-modern.is-authenticated .brand > div:last-child {
    min-width: 0 !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    font-size: clamp(1rem, 1.2vw, 1.2rem) !important;
  }

  body.is-authenticated .brand p,
  body.visual-modern.is-authenticated .brand p {
    max-width: 100% !important;
    overflow-wrap: anywhere !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: 8px !important;
    padding: 12px !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .1) !important;
  }

  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: stretch !important;
    gap: 6px !important;
    padding: 9px !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, .12) !important;
    border-color: rgba(255, 255, 255, .2) !important;
  }

  body.is-authenticated .year-control select,
  body.visual-modern.is-authenticated .year-control select {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn {
    min-width: 0 !important;
    min-height: 38px !important;
    padding-inline: 10px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body.is-authenticated .mobile-menu-toggle,
  body.visual-modern.is-authenticated .mobile-menu-toggle {
    display: none !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 2px 10px 0 !important;
    scrollbar-width: thin !important;
  }

  body.is-authenticated .nav-group-label,
  body.visual-modern.is-authenticated .nav-group-label {
    width: 100% !important;
    min-height: 24px !important;
    justify-content: flex-start !important;
    padding: 6px 12px 3px !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .58) !important;
    font-size: .62rem !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
  }

  body.is-authenticated .nav-btn,
  body.visual-modern.is-authenticated .nav-btn {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
  }

  body.is-authenticated .nav-btn span,
  body.visual-modern.is-authenticated .nav-btn span {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
  }

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    margin-left: var(--preview-sidebar-width) !important;
    width: auto !important;
    max-width: calc(100vw - var(--preview-sidebar-width)) !important;
    padding: clamp(16px, 2vw, 28px) !important;
    overflow-x: hidden !important;
  }
}

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

  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 64px !important;
    max-height: none !important;
    display: block !important;
    padding: 0 !important;
    overflow: visible !important;
    color: var(--text) !important;
    background: rgba(255, 255, 255, .97) !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: 0 12px 30px rgba(15, 44, 82, .12) !important;
  }

  body.is-authenticated .brand-row,
  body.visual-modern.is-authenticated .brand-row {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 64px !important;
    gap: 0 !important;
    padding: 8px 62px 8px 12px !important;
    background: #ffffff !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    color: var(--primary-dark) !important;
    font-size: clamp(1rem, 4vw, 1.18rem) !important;
    overflow-wrap: anywhere !important;
  }

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

  body.is-authenticated .mobile-menu-toggle,
  body.visual-modern.is-authenticated .mobile-menu-toggle {
    display: grid !important;
    place-items: center !important;
    position: absolute !important;
    top: 13px !important;
    right: 12px !important;
    bottom: auto !important;
    width: 40px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, #ffffff) !important;
    border-radius: 12px !important;
    background: var(--accent) !important;
    color: var(--primary-dark) !important;
    z-index: 1200 !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    display: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: fixed !important;
    inset: var(--topbar-height) 10px auto 10px !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(72vh, 560px) !important;
    overflow: auto !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 10px !important;
    border: 1px solid var(--line) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 22px 50px rgba(15, 44, 82, .24) !important;
    z-index: 1190 !important;
  }

  body.is-authenticated .nav-scroll.open,
  body.visual-modern.is-authenticated .nav-scroll.open {
    display: grid !important;
  }

  body.is-authenticated .nav-scroll *,
  body.visual-modern.is-authenticated .nav-scroll * {
    visibility: visible !important;
  }

  body.is-authenticated .nav-group-label,
  body.visual-modern.is-authenticated .nav-group-label {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 6px 8px 2px !important;
    color: var(--muted) !important;
    background: transparent !important;
  }

  body.is-authenticated .nav-btn,
  body.visual-modern.is-authenticated .nav-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 58px !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 9px !important;
    padding: 9px !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: var(--text) !important;
    text-align: left !important;
  }

  body.is-authenticated .nav-btn i,
  body.visual-modern.is-authenticated .nav-btn i {
    background: var(--preview-soft) !important;
    color: var(--primary) !important;
  }

  body.is-authenticated .nav-btn.active,
  body.visual-modern.is-authenticated .nav-btn.active {
    border-color: color-mix(in srgb, var(--primary) 34%, #ffffff) !important;
    background: color-mix(in srgb, var(--primary) 7%, #ffffff) !important;
    color: var(--primary-dark) !important;
  }

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

@media (max-width: 520px) {
  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    grid-template-columns: 1fr !important;
    inset-inline: 8px !important;
  }

  body.is-authenticated #module-inicio .home-header,
  body.visual-modern.is-authenticated #module-inicio .home-header {
    padding: 72px 16px 22px !important;
  }
}

/* Appoderado-inspired palette: vivid blue base, clean white surfaces, green success and apple-red alerts. */
:root {
  --appo-blue: #0b8fe8;
  --appo-blue-dark: #0572c8;
  --appo-blue-deep: #075fbd;
  --appo-purple: #9b1cff;
  --appo-green: #35c84a;
  --appo-red: #ef3f43;
  --appo-pink: #e91e63;
  --appo-soft: #eaf6ff;
  --appo-line: #d7e9f8;
  --primary: var(--appo-blue);
  --primary-dark: var(--appo-blue-dark);
  --bottom-primary: var(--appo-blue);
  --bottom-hover: #16a6f2;
  --bottom-accent: var(--appo-green);
  --accent: var(--appo-green);
  --success: var(--appo-green);
  --danger: var(--appo-red);
  --warning: #f59f00;
  --bg: #f5fbff;
  --surface: #ffffff;
  --line: var(--appo-line);
  --preview-soft: var(--appo-soft);
  --preview-line: var(--appo-line);
  --preview-shadow: 0 20px 60px rgba(11, 143, 232, .16);
}

body.is-authenticated,
body.visual-modern.is-authenticated {
  background:
    radial-gradient(circle at 0% 0%, rgba(11, 143, 232, .2), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(53, 200, 74, .16), transparent 28%),
    linear-gradient(180deg, #f3fbff 0, #f8fcff 360px, #f5fbff 100%) !important;
}

body.is-authenticated .topbar,
body.visual-modern.is-authenticated .topbar {
  background:
    linear-gradient(180deg, var(--appo-blue-dark), var(--appo-blue)) !important;
}

body.is-authenticated .logo,
body.visual-modern.is-authenticated .logo,
body.visual-modern .login-badge {
  background: linear-gradient(135deg, #ffffff, #e6f6ff 60%, #ecffe9) !important;
  color: var(--appo-blue-dark) !important;
}

body.is-authenticated .mobile-menu-toggle,
body.visual-modern.is-authenticated .mobile-menu-toggle,
body.is-authenticated .btn-accent,
body.visual-modern.is-authenticated .btn-accent {
  background: var(--appo-green) !important;
  color: #05365f !important;
}

body.is-authenticated .btn-primary,
body.visual-modern.is-authenticated .btn-primary {
  background: linear-gradient(135deg, var(--appo-blue-dark), var(--appo-blue)) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 30px rgba(11, 143, 232, .24) !important;
}

body.is-authenticated #module-inicio .home-header,
body.visual-modern.is-authenticated #module-inicio .home-header,
body.is-authenticated .module-head.module-hero,
body.visual-modern.is-authenticated .module-head.module-hero {
  background:
    radial-gradient(circle at 92% -18%, rgba(255,255,255,.28), transparent 26%),
    linear-gradient(135deg, var(--appo-blue-dark), var(--appo-blue) 56%, var(--appo-purple)) !important;
}

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

body.is-authenticated .nav-btn.active i,
body.is-authenticated .nav-btn:hover i,
body.visual-modern.is-authenticated .nav-btn.active i,
body.visual-modern.is-authenticated .nav-btn:hover i {
  color: var(--appo-blue-dark) !important;
}

body.is-authenticated .nav-estudiantes,
body.visual-modern.is-authenticated .nav-estudiantes,
body.is-authenticated .nav-asistencia,
body.visual-modern.is-authenticated .nav-asistencia {
  --nav-color: var(--appo-green);
  --nav-soft: #e8fbe8;
}

body.is-authenticated .nav-calificaciones,
body.visual-modern.is-authenticated .nav-calificaciones,
body.is-authenticated .nav-informes,
body.visual-modern.is-authenticated .nav-informes {
  --nav-color: var(--appo-purple);
  --nav-soft: #f3e8ff;
}

body.is-authenticated .nav-utp,
body.visual-modern.is-authenticated .nav-utp,
body.is-authenticated .nav-orientacion,
body.visual-modern.is-authenticated .nav-orientacion {
  --nav-color: var(--appo-red);
  --nav-soft: #ffe9ea;
}

body.is-authenticated #module-inicio .home-icon,
body.visual-modern.is-authenticated #module-inicio .home-icon,
body.is-authenticated .section-link-card i,
body.visual-modern.is-authenticated .section-link-card i,
body.is-authenticated .metric-icon,
body.visual-modern.is-authenticated .metric-icon {
  background: color-mix(in srgb, var(--nav-color, var(--appo-blue)) 12%, #ffffff) !important;
  color: var(--nav-color, var(--appo-blue)) !important;
}

body.is-authenticated .metric,
body.visual-modern.is-authenticated .metric {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, #ffffff), #ffffff 62%) !important;
}

body.is-authenticated .risk-chip.green,
body.visual-modern.is-authenticated .risk-chip.green,
body.is-authenticated .pill.green,
body.visual-modern.is-authenticated .pill.green {
  background: #e8fbe8 !important;
  border-color: #bff2c6 !important;
  color: #14892d !important;
}

body.is-authenticated .risk-chip.red,
body.visual-modern.is-authenticated .risk-chip.red,
body.is-authenticated .pill.red,
body.visual-modern.is-authenticated .pill.red,
body.is-authenticated .insight.red,
body.visual-modern.is-authenticated .insight.red {
  background: #ffe9ea !important;
  border-color: #ffc7ca !important;
  color: var(--appo-red) !important;
}

body.is-authenticated th,
body.visual-modern.is-authenticated th {
  background: #eaf6ff !important;
  color: var(--appo-blue-dark) !important;
}

body.is-authenticated input:focus,
body.is-authenticated select:focus,
body.is-authenticated textarea:focus,
body.visual-modern.is-authenticated input:focus,
body.visual-modern.is-authenticated select:focus,
body.visual-modern.is-authenticated textarea:focus {
  border-color: var(--appo-blue) !important;
  box-shadow: 0 0 0 4px rgba(11, 143, 232, .14) !important;
}

@media (max-width: 980px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar,
  body.is-authenticated .brand-row,
  body.visual-modern.is-authenticated .brand-row {
    background: #ffffff !important;
  }

  body.is-authenticated .nav-btn.active,
  body.visual-modern.is-authenticated .nav-btn.active {
    border-color: rgba(11, 143, 232, .34) !important;
    background: #eaf6ff !important;
    color: var(--appo-blue-dark) !important;
  }
}

/* Friendly school-platform palette: calm, familiar and easy to read. */
:root {
  --school-blue: #2563eb;
  --school-blue-dark: #1e3a8a;
  --school-blue-soft: #eff6ff;
  --school-sky: #38bdf8;
  --school-green: #16a34a;
  --school-green-soft: #ecfdf5;
  --school-amber: #f59e0b;
  --school-amber-soft: #fffbeb;
  --school-red: #dc2626;
  --school-red-soft: #fef2f2;
  --school-purple: #7c3aed;
  --school-purple-soft: #f5f3ff;
  --school-bg: #f6f8fb;
  --school-line: #dbe4f0;
  --primary: var(--school-blue);
  --primary-dark: var(--school-blue-dark);
  --bottom-primary: var(--school-blue);
  --bottom-hover: #1d4ed8;
  --bottom-accent: var(--school-amber);
  --accent: var(--school-amber);
  --success: var(--school-green);
  --warning: var(--school-amber);
  --danger: var(--school-red);
  --bg: var(--school-bg);
  --surface: #ffffff;
  --line: var(--school-line);
  --preview-soft: var(--school-blue-soft);
  --preview-line: var(--school-line);
  --preview-shadow: 0 18px 48px rgba(37, 99, 235, .12);
}

body.is-authenticated,
body.visual-modern.is-authenticated {
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .16), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, .11), transparent 26%),
    linear-gradient(180deg, #f8fbff 0, var(--school-bg) 360px, #f8fafc 100%) !important;
}

body.is-authenticated .topbar,
body.visual-modern.is-authenticated .topbar {
  background: linear-gradient(180deg, var(--school-blue-dark), var(--school-blue)) !important;
}

body.is-authenticated .logo,
body.visual-modern.is-authenticated .logo,
body.visual-modern .login-badge {
  background: linear-gradient(135deg, #ffffff, #eef6ff 70%, #fff7ed) !important;
  color: var(--school-blue-dark) !important;
}

body.is-authenticated #module-inicio .home-header,
body.visual-modern.is-authenticated #module-inicio .home-header,
body.is-authenticated .module-head.module-hero,
body.visual-modern.is-authenticated .module-head.module-hero {
  background:
    radial-gradient(circle at 92% -18%, rgba(255,255,255,.24), transparent 26%),
    linear-gradient(135deg, var(--school-blue-dark), var(--school-blue) 64%, var(--school-sky)) !important;
}

body.is-authenticated .btn-primary,
body.visual-modern.is-authenticated .btn-primary {
  background: linear-gradient(135deg, var(--school-blue-dark), var(--school-blue)) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .2) !important;
}

body.is-authenticated .btn-accent,
body.visual-modern.is-authenticated .btn-accent,
body.is-authenticated .mobile-menu-toggle,
body.visual-modern.is-authenticated .mobile-menu-toggle {
  background: var(--school-amber) !important;
  color: #422006 !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: #ffffff !important;
  border-color: var(--school-line) !important;
  color: var(--school-blue-dark) !important;
}

body.is-authenticated .nav-inicio,
body.visual-modern.is-authenticated .nav-inicio,
body.is-authenticated .nav-cursos,
body.visual-modern.is-authenticated .nav-cursos,
body.is-authenticated .nav-asignaturas,
body.visual-modern.is-authenticated .nav-asignaturas {
  --nav-color: var(--school-blue);
  --nav-soft: var(--school-blue-soft);
}

body.is-authenticated .nav-estudiantes,
body.visual-modern.is-authenticated .nav-estudiantes,
body.is-authenticated .nav-profesores,
body.visual-modern.is-authenticated .nav-profesores,
body.is-authenticated .nav-asistencia,
body.visual-modern.is-authenticated .nav-asistencia {
  --nav-color: var(--school-green);
  --nav-soft: var(--school-green-soft);
}

body.is-authenticated .nav-calificaciones,
body.visual-modern.is-authenticated .nav-calificaciones,
body.is-authenticated .nav-informes,
body.visual-modern.is-authenticated .nav-informes,
body.is-authenticated .nav-utp,
body.visual-modern.is-authenticated .nav-utp {
  --nav-color: var(--school-purple);
  --nav-soft: var(--school-purple-soft);
}

body.is-authenticated .nav-configuracion,
body.visual-modern.is-authenticated .nav-configuracion,
body.is-authenticated .nav-auditoria,
body.visual-modern.is-authenticated .nav-auditoria {
  --nav-color: #64748b;
  --nav-soft: #f1f5f9;
}

body.is-authenticated .metric,
body.visual-modern.is-authenticated .metric,
body.is-authenticated .card,
body.visual-modern.is-authenticated .card {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.86)) !important;
  border-color: var(--school-line) !important;
}

body.is-authenticated #module-inicio .home-icon,
body.visual-modern.is-authenticated #module-inicio .home-icon,
body.is-authenticated .section-link-card i,
body.visual-modern.is-authenticated .section-link-card i,
body.is-authenticated .metric-icon,
body.visual-modern.is-authenticated .metric-icon {
  background: var(--nav-soft, var(--school-blue-soft)) !important;
  color: var(--nav-color, var(--school-blue)) !important;
}

body.is-authenticated .risk-chip.green,
body.visual-modern.is-authenticated .risk-chip.green,
body.is-authenticated .pill.green,
body.visual-modern.is-authenticated .pill.green {
  background: var(--school-green-soft) !important;
  border-color: #bbf7d0 !important;
  color: #166534 !important;
}

body.is-authenticated .risk-chip.yellow,
body.visual-modern.is-authenticated .risk-chip.yellow,
body.is-authenticated .pill.yellow,
body.visual-modern.is-authenticated .pill.yellow {
  background: var(--school-amber-soft) !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}

body.is-authenticated .risk-chip.red,
body.visual-modern.is-authenticated .risk-chip.red,
body.is-authenticated .pill.red,
body.visual-modern.is-authenticated .pill.red,
body.is-authenticated .insight.red,
body.visual-modern.is-authenticated .insight.red {
  background: var(--school-red-soft) !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}

body.is-authenticated th,
body.visual-modern.is-authenticated th {
  background: var(--school-blue-soft) !important;
  color: var(--school-blue-dark) !important;
}

body.is-authenticated input:focus,
body.is-authenticated select:focus,
body.is-authenticated textarea:focus,
body.visual-modern.is-authenticated input:focus,
body.visual-modern.is-authenticated select:focus,
body.visual-modern.is-authenticated textarea:focus {
  border-color: var(--school-blue) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12) !important;
}

@media (max-width: 980px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar,
  body.is-authenticated .brand-row,
  body.visual-modern.is-authenticated .brand-row {
    background: #ffffff !important;
  }

  body.is-authenticated .nav-btn.active,
  body.visual-modern.is-authenticated .nav-btn.active {
    border-color: rgba(37, 99, 235, .28) !important;
    background: var(--school-blue-soft) !important;
    color: var(--school-blue-dark) !important;
  }
}

/* Module-aware colors: each active apartado carries its own calm accent without changing responsive layout. */
:root {
  --module-blue: #2563eb;
  --module-blue-dark: #1e40af;
  --module-blue-soft: #eff6ff;
  --module-green: #16a34a;
  --module-green-dark: #166534;
  --module-green-soft: #ecfdf5;
  --module-purple: #7c3aed;
  --module-purple-dark: #5b21b6;
  --module-purple-soft: #f5f3ff;
  --module-amber: #d97706;
  --module-amber-dark: #92400e;
  --module-amber-soft: #fffbeb;
  --module-red: #dc2626;
  --module-red-dark: #991b1b;
  --module-red-soft: #fef2f2;
  --module-teal: #0f766e;
  --module-teal-dark: #115e59;
  --module-teal-soft: #f0fdfa;
  --module-slate: #64748b;
  --module-slate-dark: #334155;
  --module-slate-soft: #f1f5f9;
  --active-module-color: var(--module-blue);
  --active-module-dark: var(--module-blue-dark);
  --active-module-soft: var(--module-blue-soft);
  --active-module-shadow: rgba(37, 99, 235, .14);
}

body[data-current-module="inicio"],
body[data-current-module="cursos"],
body[data-current-module="asignaturas"],
body[data-current-module="calendario"] {
  --active-module-color: var(--module-blue);
  --active-module-dark: var(--module-blue-dark);
  --active-module-soft: var(--module-blue-soft);
  --active-module-shadow: rgba(37, 99, 235, .14);
}

body[data-current-module="profesores"],
body[data-current-module="estudiantes"],
body[data-current-module="matriculas"],
body[data-current-module="apoderados"],
body[data-current-module="asistencia"] {
  --active-module-color: var(--module-green);
  --active-module-dark: var(--module-green-dark);
  --active-module-soft: var(--module-green-soft);
  --active-module-shadow: rgba(22, 163, 74, .14);
}

body[data-current-module="calificaciones"],
body[data-current-module="informes"],
body[data-current-module="ficha"],
body[data-current-module="historial"],
body[data-current-module="libro"] {
  --active-module-color: var(--module-purple);
  --active-module-dark: var(--module-purple-dark);
  --active-module-soft: var(--module-purple-soft);
  --active-module-shadow: rgba(124, 58, 237, .14);
}

body[data-current-module="orientacion"],
body[data-current-module="entrevistas"],
body[data-current-module="personalidad"],
body[data-current-module="utp"],
body[data-current-module="promocion"] {
  --active-module-color: var(--module-red);
  --active-module-dark: var(--module-red-dark);
  --active-module-soft: var(--module-red-soft);
  --active-module-shadow: rgba(220, 38, 38, .13);
}

body[data-current-module="pme"],
body[data-current-module="adeco"] {
  --active-module-color: var(--module-amber);
  --active-module-dark: var(--module-amber-dark);
  --active-module-soft: var(--module-amber-soft);
  --active-module-shadow: rgba(217, 119, 6, .14);
}

body[data-current-module="usuarios"],
body[data-current-module="auditoria"],
body[data-current-module="configuracion"] {
  --active-module-color: var(--module-slate);
  --active-module-dark: var(--module-slate-dark);
  --active-module-soft: var(--module-slate-soft);
  --active-module-shadow: rgba(100, 116, 139, .14);
}

body.is-authenticated,
body.visual-modern.is-authenticated {
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--active-module-color) 15%, transparent), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, .1), transparent 26%),
    linear-gradient(180deg, #f8fbff 0, var(--school-bg) 360px, #f8fafc 100%) !important;
}

@media (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    background:
      linear-gradient(180deg, var(--active-module-dark), var(--active-module-color)) !important;
    box-shadow: 12px 0 40px var(--active-module-shadow) !important;
  }
}

body.is-authenticated #module-inicio .home-header,
body.visual-modern.is-authenticated #module-inicio .home-header,
body.is-authenticated .module-head.module-hero,
body.visual-modern.is-authenticated .module-head.module-hero {
  background:
    radial-gradient(circle at 92% -18%, rgba(255,255,255,.24), transparent 26%),
    linear-gradient(135deg, var(--active-module-dark), var(--active-module-color) 66%, color-mix(in srgb, var(--active-module-color) 70%, #ffffff)) !important;
  box-shadow: 0 18px 48px var(--active-module-shadow) !important;
}

body.is-authenticated .nav-btn.active,
body.visual-modern.is-authenticated .nav-btn.active {
  background: color-mix(in srgb, var(--active-module-color) 18%, rgba(255, 255, 255, .18)) !important;
  color: #ffffff !important;
}

body.is-authenticated .nav-btn.active i,
body.visual-modern.is-authenticated .nav-btn.active i {
  background: #ffffff !important;
  color: var(--active-module-dark) !important;
}

body.is-authenticated .module.active .card,
body.visual-modern.is-authenticated .module.active .card,
body.is-authenticated .module.active .course-context,
body.visual-modern.is-authenticated .module.active .course-context {
  border-color: color-mix(in srgb, var(--active-module-color) 18%, var(--school-line)) !important;
}

body.is-authenticated .module.active .card h3,
body.visual-modern.is-authenticated .module.active .card h3,
body.is-authenticated .module.active .list-card-head h3,
body.visual-modern.is-authenticated .module.active .list-card-head h3 {
  color: var(--active-module-dark) !important;
}

body.is-authenticated .module.active .btn-primary,
body.visual-modern.is-authenticated .module.active .btn-primary,
body.is-authenticated .module.active .module-save-btn,
body.visual-modern.is-authenticated .module.active .module-save-btn {
  background: linear-gradient(135deg, var(--active-module-dark), var(--active-module-color)) !important;
  box-shadow: 0 12px 26px var(--active-module-shadow) !important;
}

body.is-authenticated .module.active .btn-soft,
body.visual-modern.is-authenticated .module.active .btn-soft,
body.is-authenticated .module.active .btn-ghost,
body.visual-modern.is-authenticated .module.active .btn-ghost {
  color: var(--active-module-dark) !important;
  border-color: color-mix(in srgb, var(--active-module-color) 18%, var(--school-line)) !important;
  background: color-mix(in srgb, var(--active-module-soft) 70%, #ffffff) !important;
}

body.is-authenticated .nav-inicio,
body.visual-modern.is-authenticated .nav-inicio,
body.is-authenticated .nav-cursos,
body.visual-modern.is-authenticated .nav-cursos,
body.is-authenticated .nav-asignaturas,
body.visual-modern.is-authenticated .nav-asignaturas,
body.is-authenticated .nav-calendario,
body.visual-modern.is-authenticated .nav-calendario {
  --nav-color: var(--module-blue);
  --nav-soft: var(--module-blue-soft);
}

body.is-authenticated .nav-profesores,
body.visual-modern.is-authenticated .nav-profesores,
body.is-authenticated .nav-estudiantes,
body.visual-modern.is-authenticated .nav-estudiantes,
body.is-authenticated .nav-matriculas,
body.visual-modern.is-authenticated .nav-matriculas,
body.is-authenticated .nav-apoderados,
body.visual-modern.is-authenticated .nav-apoderados,
body.is-authenticated .nav-asistencia,
body.visual-modern.is-authenticated .nav-asistencia {
  --nav-color: var(--module-green);
  --nav-soft: var(--module-green-soft);
}

body.is-authenticated .nav-calificaciones,
body.visual-modern.is-authenticated .nav-calificaciones,
body.is-authenticated .nav-informes,
body.visual-modern.is-authenticated .nav-informes,
body.is-authenticated .nav-ficha,
body.visual-modern.is-authenticated .nav-ficha,
body.is-authenticated .nav-historial,
body.visual-modern.is-authenticated .nav-historial,
body.is-authenticated .nav-libro,
body.visual-modern.is-authenticated .nav-libro {
  --nav-color: var(--module-purple);
  --nav-soft: var(--module-purple-soft);
}

body.is-authenticated .nav-orientacion,
body.visual-modern.is-authenticated .nav-orientacion,
body.is-authenticated .nav-entrevistas,
body.visual-modern.is-authenticated .nav-entrevistas,
body.is-authenticated .nav-personalidad,
body.visual-modern.is-authenticated .nav-personalidad,
body.is-authenticated .nav-utp,
body.visual-modern.is-authenticated .nav-utp,
body.is-authenticated .nav-promocion,
body.visual-modern.is-authenticated .nav-promocion {
  --nav-color: var(--module-red);
  --nav-soft: var(--module-red-soft);
}

body.is-authenticated .nav-pme,
body.visual-modern.is-authenticated .nav-pme,
body.is-authenticated .nav-adeco,
body.visual-modern.is-authenticated .nav-adeco {
  --nav-color: var(--module-amber);
  --nav-soft: var(--module-amber-soft);
}

body.is-authenticated .nav-usuarios,
body.visual-modern.is-authenticated .nav-usuarios,
body.is-authenticated .nav-auditoria,
body.visual-modern.is-authenticated .nav-auditoria,
body.is-authenticated .nav-configuracion,
body.visual-modern.is-authenticated .nav-configuracion {
  --nav-color: var(--module-slate);
  --nav-soft: var(--module-slate-soft);
}

body.is-authenticated #module-inicio .home-card,
body.visual-modern.is-authenticated #module-inicio .home-card,
body.is-authenticated .section-link-card,
body.visual-modern.is-authenticated .section-link-card {
  border-top: 4px solid var(--nav-color, var(--module-blue)) !important;
}

body.is-authenticated #module-inicio .home-icon,
body.visual-modern.is-authenticated #module-inicio .home-icon,
body.is-authenticated .section-link-card i,
body.visual-modern.is-authenticated .section-link-card i {
  background: var(--nav-soft, var(--module-blue-soft)) !important;
  color: var(--nav-color, var(--module-blue)) !important;
}

@media (max-width: 980px) {
  body.is-authenticated .nav-btn.active,
  body.visual-modern.is-authenticated .nav-btn.active {
    background: var(--active-module-soft) !important;
    border-color: color-mix(in srgb, var(--active-module-color) 34%, #ffffff) !important;
    color: var(--active-module-dark) !important;
  }

  body.is-authenticated .nav-btn.active i,
  body.visual-modern.is-authenticated .nav-btn.active i {
    background: #ffffff !important;
    color: var(--active-module-dark) !important;
  }
}

/* Informe observations: sectioned editor and printed blocks. */
body.is-authenticated .report-observation-editor {
  overflow: hidden !important;
}

body.is-authenticated .report-observation-layout {
  display: grid;
  gap: 14px;
}

body.is-authenticated .report-period-field {
  width: min(320px, 100%);
}

body.is-authenticated .report-observation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

body.is-authenticated .report-observation-box {
  min-width: 0;
  min-height: 210px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 7px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--active-module-color) 18%, var(--school-line));
  border-top: 4px solid var(--active-module-color);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--active-module-soft) 54%, #ffffff));
}

body.is-authenticated .report-observation-box > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--active-module-dark);
  font-size: .9rem;
  font-weight: 900;
}

body.is-authenticated .report-observation-box > span i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--active-module-soft);
  color: var(--active-module-color);
}

body.is-authenticated .report-observation-box small {
  min-height: 32px;
  color: var(--muted) !important;
  line-height: 1.25;
}

body.is-authenticated .report-observation-box textarea {
  min-height: 128px;
  height: 100%;
  resize: vertical;
  border-radius: 14px !important;
  background: #ffffff !important;
}

body.is-authenticated .report-observation-box.utp {
  --active-module-color: var(--module-red);
  --active-module-dark: var(--module-red-dark);
  --active-module-soft: var(--module-red-soft);
}

body.is-authenticated .report-observation-box.conclusion {
  --active-module-color: var(--module-purple);
  --active-module-dark: var(--module-purple-dark);
  --active-module-soft: var(--module-purple-soft);
}

body.is-authenticated .report-observation-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.boletin-observation-stack {
  display: grid;
  gap: .14in;
  margin: .1in .48in .18in;
}

.boletin-observation-block {
  border: 1px solid #dbe3ee;
  border-left: 5px solid #3f4b78;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.boletin-observation-block h3 {
  margin: 0;
  padding: .08in .14in;
  background: #eef3ff;
  color: #344166;
  font-size: .14in;
  font-weight: 950;
}

.boletin-observation-block .boletin-observations {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.boletin-observation-block.teacher { border-left-color: #2563eb; }
.boletin-observation-block.teacher h3 { background: #eff6ff; color: #1e3a8a; }
.boletin-observation-block.utp { border-left-color: #dc2626; }
.boletin-observation-block.utp h3 { background: #fef2f2; color: #991b1b; }
.boletin-observation-block.conclusion { border-left-color: #7c3aed; }
.boletin-observation-block.conclusion h3 { background: #f5f3ff; color: #5b21b6; }

@media (max-width: 1180px) {
  body.is-authenticated .report-observation-grid {
    grid-template-columns: 1fr;
  }

  body.is-authenticated .report-observation-box {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .boletin-observation-stack {
    margin-inline: 18px;
  }
}

/* Sidebar anti-overlap: keep brand, year selector and actions inside the left menu. */
:root {
  --preview-sidebar-width: clamp(300px, 23vw, 340px);
}

@media (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    width: var(--preview-sidebar-width) !important;
    padding: 18px !important;
    gap: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.is-authenticated .topbar *,
  body.visual-modern.is-authenticated .topbar * {
    box-sizing: border-box;
    max-width: 100%;
  }

  body.is-authenticated .brand-row,
  body.visual-modern.is-authenticated .brand-row {
    width: 100% !important;
    min-width: 0 !important;
    align-content: start !important;
  }

  body.is-authenticated .brand,
  body.visual-modern.is-authenticated .brand {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: center !important;
  }

  body.is-authenticated .logo,
  body.visual-modern.is-authenticated .logo {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    align-self: start !important;
  }

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    color: #ffffff !important;
    font-size: clamp(1.08rem, 1.35vw, 1.42rem) !important;
    line-height: 1.04 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
  }

  body.is-authenticated .brand p,
  body.visual-modern.is-authenticated .brand p {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 4px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    color: rgba(255, 255, 255, .88) !important;
    font-size: .78rem !important;
    line-height: 1.2 !important;
  }

  body.is-authenticated .actions,
  body.visual-modern.is-authenticated .actions {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    padding: 14px !important;
    overflow: hidden !important;
    border-radius: 20px !important;
  }

  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    min-height: auto !important;
    padding: 10px 12px !important;
    white-space: normal !important;
  }

  body.is-authenticated .year-control select,
  body.visual-modern.is-authenticated .year-control select {
    width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
  }

  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 12px !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.15 !important;
  }

  body.is-authenticated .actions .icon-btn i,
  body.visual-modern.is-authenticated .actions .icon-btn i {
    flex: 0 0 auto !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    width: 100% !important;
    min-width: 0 !important;
    padding-right: 2px !important;
  }

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    margin-left: var(--preview-sidebar-width) !important;
    max-width: calc(100vw - var(--preview-sidebar-width)) !important;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  :root {
    --preview-sidebar-width: 300px;
  }

  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    padding: 14px !important;
  }

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

  body.is-authenticated .logo,
  body.visual-modern.is-authenticated .logo {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
  }
}

/* Soft platform style + letter-safe documents */
:root {
  --doc-stage: #edf3fb;
  --doc-card: #ffffff;
  --doc-ink: #172033;
  --doc-muted: #69758c;
  --doc-line: #dbe7f3;
  --doc-shadow: 0 22px 58px rgba(26, 45, 80, .14);
  --doc-soft-shadow: 0 12px 28px rgba(26, 45, 80, .1);
  --doc-radius: 22px;
  --success-vivid: #48c70f;
  --danger-vivid: #f00646;
  --warning-vivid: #f5a006;
  --info-vivid: #1689f2;
}

body.is-authenticated #appMain,
body.visual-modern.is-authenticated #appMain {
  background:
    radial-gradient(circle at 18% 8%, rgba(22, 137, 242, .12), transparent 32%),
    linear-gradient(180deg, #f5f8fd 0%, var(--doc-stage) 100%) !important;
}

body.is-authenticated .card,
body.is-authenticated .table-wrap,
body.is-authenticated .course-context,
body.is-authenticated .report-paper,
body.is-authenticated .report-student-paper,
body.is-authenticated .planner-institutional-doc,
body.is-authenticated .utp-academic-report,
body.visual-modern.is-authenticated .card,
body.visual-modern.is-authenticated .table-wrap,
body.visual-modern.is-authenticated .course-context,
body.visual-modern.is-authenticated .report-paper,
body.visual-modern.is-authenticated .report-student-paper,
body.visual-modern.is-authenticated .planner-institutional-doc,
body.visual-modern.is-authenticated .utp-academic-report {
  border: 1px solid rgba(219, 231, 243, .95) !important;
  border-radius: var(--doc-radius) !important;
  box-shadow: var(--doc-shadow) !important;
}

body.is-authenticated .stat-card,
body.visual-modern.is-authenticated .stat-card {
  border-radius: 20px !important;
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: var(--doc-soft-shadow) !important;
}

body.is-authenticated .metric-icon,
body.visual-modern.is-authenticated .metric-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--info-vivid), #0b5ec9);
  box-shadow: 0 10px 20px rgba(22, 137, 242, .22);
}

.boletin-grade-table,
.chilean-gradebook-table {
  border-radius: 16px !important;
  overflow: hidden;
}

.boletin-grade-table th,
.chilean-gradebook-table th {
  background: #f6f9fe !important;
  color: #24314a !important;
}

.report-grade-badge {
  min-width: 42px;
  min-height: 34px;
  border-radius: 9px !important;
  color: #fff !important;
  box-shadow: 0 9px 18px rgba(15, 23, 42, .12);
}

.report-grade-badge.green { background: var(--success-vivid) !important; }
.report-grade-badge.blue { background: var(--info-vivid) !important; }
.report-grade-badge.yellow { background: var(--warning-vivid) !important; }
.report-grade-badge.red { background: var(--danger-vivid) !important; }
.report-grade-badge.empty {
  background: #e8eef7 !important;
  color: #64748b !important;
  box-shadow: none;
}

.boletin-summary-box article,
.boletin-attendance-panel article,
.boletin-analysis-grid article,
.boletin-alert-grid article,
.boletin-integral-grid article,
.boletin-observation-history article,
.boletin-observation-block {
  border: 1px solid var(--doc-line) !important;
  border-radius: 16px !important;
  background: var(--doc-card) !important;
  box-shadow: var(--doc-soft-shadow) !important;
}

.boletin-attendance-panel b,
.boletin-summary-box b {
  color: var(--doc-ink) !important;
}

.report-observation-editor,
.report-observation-box,
.report-observation-actions {
  border-radius: 20px !important;
}

@media (max-width: 980px) {
  body.is-authenticated .card,
  body.is-authenticated .table-wrap,
  body.is-authenticated .course-context,
  body.is-authenticated .report-paper,
  body.is-authenticated .report-student-paper,
  body.visual-modern.is-authenticated .card,
  body.visual-modern.is-authenticated .table-wrap,
  body.visual-modern.is-authenticated .course-context,
  body.visual-modern.is-authenticated .report-paper,
  body.visual-modern.is-authenticated .report-student-paper {
    border-radius: 18px !important;
  }

  .boletin-attendance-panel,
  .boletin-analysis-grid,
  .boletin-alert-grid,
  .boletin-integral-grid,
  .boletin-observation-history {
    grid-template-columns: 1fr !important;
    margin-inline: 0 !important;
  }

  .report-grade-badge {
    min-width: 36px;
    min-height: 30px;
  }
}

@media print {
  @page {
    size: letter;
    margin: .42in;
  }

  html,
  body {
    width: auto !important;
    min-height: auto !important;
    background: #fff !important;
  }

  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar,
  .module-head,
  .layout-report-actions,
  .report-insights,
  .no-print {
    display: none !important;
  }

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain,
  .report-print-root {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .report-paper,
  .report-student-paper,
  .planner-institutional-doc,
  .utp-academic-report,
  .assignment-print-page,
  .planner-print-page {
    width: 100% !important;
    max-width: 7.65in !important;
    min-height: auto !important;
    margin: 0 auto !important;
    padding: .22in !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #111827 !important;
    break-after: page;
    page-break-after: always;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report-paper:last-child,
  .report-student-paper:last-child,
  .planner-institutional-doc:last-child,
  .utp-academic-report:last-child,
  .assignment-print-page:last-child,
  .planner-print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .boletin-cover,
  .report-header,
  .certificate-head,
  .certificate-meta,
  .certificate-body,
  .boletin-info-panel,
  .boletin-summary-box,
  .boletin-grade-panel-table,
  .boletin-observations,
  .boletin-observation-stack,
  .boletin-observation-block,
  .boletin-signatures,
  .planner-doc-section,
  .utp-report-section,
  .page-avoid {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  table {
    page-break-inside: auto;
  }

  thead {
    display: table-header-group;
  }

  tr,
  td,
  th {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .boletin-section-title {
    break-after: avoid;
    page-break-after: avoid;
  }

  .report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-alert-grid),
  .report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-attendance-panel),
  .report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-analysis-grid),
  .report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-integral-grid),
  .report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-observation-history),
  .report-one-page-letter.report-student-paper .boletin-section-title:has(+ .boletin-observations.compact),
  .report-compact-output .boletin-section-title:has(+ .boletin-alert-grid),
  .report-compact-output .boletin-section-title:has(+ .boletin-attendance-panel),
  .report-compact-output .boletin-section-title:has(+ .boletin-analysis-grid),
  .report-compact-output .boletin-section-title:has(+ .boletin-integral-grid),
  .report-compact-output .boletin-section-title:has(+ .boletin-observation-history),
  .report-compact-output .boletin-section-title:has(+ .boletin-observations.compact),
  .report-grades-letter .boletin-section-title:has(+ .boletin-observations) {
    display: block !important;
  }

  .report-one-page-letter.report-student-paper .boletin-alert-grid,
  .report-one-page-letter.report-student-paper .boletin-attendance-panel,
  .report-one-page-letter.report-student-paper .boletin-analysis-grid,
  .report-one-page-letter.report-student-paper .boletin-integral-grid,
  .report-one-page-letter.report-student-paper .boletin-observation-history,
  .report-compact-output .boletin-alert-grid,
  .report-compact-output .boletin-attendance-panel,
  .report-compact-output .boletin-analysis-grid,
  .report-compact-output .boletin-integral-grid,
  .report-compact-output .boletin-observation-history {
    display: grid !important;
  }

  .report-one-page-letter.report-student-paper .boletin-observations.compact,
  .report-compact-output .boletin-observations.compact,
  .report-grades-letter .boletin-observations {
    display: block !important;
  }

  .report-one-page-letter.report-student-paper,
  .report-compact-output {
    font-size: 10.5px !important;
  }

  .report-grade-badge {
    min-width: 28px !important;
    min-height: 22px !important;
    padding: 2px 5px !important;
    border-radius: 7px !important;
    box-shadow: none !important;
  }
}

/* Final sidebar polish: narrow, clean, proportional controls */
:root {
  --preview-sidebar-width: clamp(176px, 12vw, 198px);
}

@media (min-width: 981px) {
  body.is-authenticated .topbar,
  body.visual-modern.is-authenticated .topbar {
    width: var(--preview-sidebar-width) !important;
    padding: 0 !important;
    gap: 0 !important;
    background: linear-gradient(180deg, #5f1fbe 0%, #7525dd 55%, #8532ee 100%) !important;
    overflow-x: hidden !important;
  }

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

  body.is-authenticated .brand,
  body.visual-modern.is-authenticated .brand {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 7px !important;
    padding: 9px 9px 7px !important;
    align-items: center !important;
  }

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

  body.is-authenticated .brand h1,
  body.visual-modern.is-authenticated .brand h1 {
    font-size: .82rem !important;
    line-height: 1.03 !important;
    color: #fff !important;
    overflow-wrap: normal !important;
  }

  body.is-authenticated .brand p,
  body.visual-modern.is-authenticated .brand p {
    display: -webkit-box !important;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    margin-top: 1px !important;
    font-size: .56rem !important;
    line-height: 1.08 !important;
    color: rgba(255, 255, 255, .82) !important;
    overflow: hidden !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 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    padding: 5px 0 7px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.is-authenticated .year-control,
  body.visual-modern.is-authenticated .year-control {
    grid-template-columns: minmax(0, 1fr) 64px !important;
    align-items: center !important;
    min-height: 28px !important;
    padding: 3px 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .1) !important;
    color: rgba(255, 255, 255, .9) !important;
    font-size: .62rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-align: left !important;
    text-transform: none !important;
  }

  body.is-authenticated .year-control select,
  body.visual-modern.is-authenticated .year-control select {
    width: 64px !important;
    min-width: 64px !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 18px 0 5px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, .86) !important;
    color: #5b21b6 !important;
    font-size: .68rem !important;
    font-weight: 900 !important;
    box-shadow: none !important;
  }

  body.is-authenticated .actions .icon-btn,
  body.visual-modern.is-authenticated .actions .icon-btn {
    width: 100% !important;
    min-height: 26px !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    padding: 0 9px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .12) !important;
    color: #e9dcff !important;
    font-size: .64rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: none !important;
  }

  body.is-authenticated .actions .icon-btn i,
  body.visual-modern.is-authenticated .actions .icon-btn i {
    width: 13px !important;
    min-width: 13px !important;
    color: #9ed8ff !important;
    font-size: .68rem !important;
  }

  body.is-authenticated .nav-scroll,
  body.visual-modern.is-authenticated .nav-scroll {
    padding: 13px 10px 16px !important;
  }

  body.is-authenticated .nav-group,
  body.visual-modern.is-authenticated .nav-group {
    gap: 6px !important;
    margin-bottom: 16px !important;
  }

  body.is-authenticated .nav-group-label,
  body.visual-modern.is-authenticated .nav-group-label {
    margin: 0 0 4px !important;
    font-size: .58rem !important;
  }

  body.is-authenticated .nav-item,
  body.visual-modern.is-authenticated .nav-item {
    grid-template-columns: 30px minmax(0, 1fr) !important;
    width: 100% !important;
    min-height: 34px !important;
    gap: 7px !important;
    padding: 0 6px 0 0 !important;
    border-radius: 10px !important;
  }

  body.is-authenticated .nav-item i,
  body.visual-modern.is-authenticated .nav-item i {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    border-radius: 10px !important;
    font-size: .82rem !important;
  }

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

  body.is-authenticated #appMain,
  body.visual-modern.is-authenticated #appMain {
    margin-left: var(--preview-sidebar-width) !important;
    width: calc(100vw - var(--preview-sidebar-width)) !important;
    max-width: calc(100vw - var(--preview-sidebar-width)) !important;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  :root {
    --preview-sidebar-width: 176px;
  }
}

/* Institutional UX pass: dashboard, permissions, reports and responsive polish */
:root {
  --ux-purple: #6d28d9;
  --ux-purple-dark: #4c1d95;
  --ux-purple-soft: #f3e8ff;
  --ux-blue: #0ea5e9;
  --ux-green: #22c55e;
  --ux-yellow: #f59e0b;
  --ux-red: #ef4444;
  --ux-ink: #162033;
  --ux-muted: #667085;
  --ux-line: #d9e4f2;
  --ux-surface: #ffffff;
}

body.is-authenticated #appMain,
body.visual-modern.is-authenticated #appMain {
  background:
    radial-gradient(circle at 6% 4%, rgba(109, 40, 217, .1), transparent 26%),
    linear-gradient(180deg, #f7f9fd 0%, #eef4fb 100%) !important;
}

.dashboard-home,
.command-center,
.portal-risk-card,
body.is-authenticated .card,
body.visual-modern.is-authenticated .card {
  border: 1px solid rgba(217, 228, 242, .95) !important;
  box-shadow: 0 14px 34px rgba(18, 32, 58, .08) !important;
}

.dashboard-home {
  border-radius: 20px !important;
  background: linear-gradient(135deg, #ffffff 0%, #fbfdff 64%, #f5edff 100%) !important;
  overflow: hidden;
}

.home-header {
  min-height: 132px !important;
  padding: clamp(18px, 2vw, 28px) clamp(18px, 2.6vw, 36px) !important;
  background:
    linear-gradient(135deg, rgba(109, 40, 217, .96), rgba(124, 58, 237, .88)),
    var(--ux-purple) !important;
}

.home-header h1 {
  max-width: 760px !important;
  font-size: clamp(1.55rem, 2.5vw, 2.45rem) !important;
  letter-spacing: 0 !important;
}

.home-header p {
  max-width: 680px !important;
}

.home-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 12px !important;
  padding: 16px !important;
}

.home-card,
.section-link-card {
  min-height: 108px !important;
  border: 1px solid var(--ux-line) !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 10px 24px rgba(18, 32, 58, .07) !important;
}

.home-card b,
.section-link-card b {
  color: var(--ux-ink) !important;
}

.home-card small,
.section-link-card small {
  color: var(--ux-muted) !important;
}

.home-icon,
.section-link-card i {
  background: var(--active-module-soft, var(--ux-purple-soft)) !important;
  color: var(--active-module-color, var(--ux-purple)) !important;
}

.portal-metrics {
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)) !important;
  gap: 12px !important;
}

.portal-metrics .metric {
  min-height: 104px !important;
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 14px !important;
}

.portal-metrics .metric span,
.portal-metrics .metric strong {
  grid-column: 2;
}

.portal-metrics .metric .metric-icon {
  grid-row: 1 / span 2;
}

.command-center {
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  background: var(--ux-surface);
}

.command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.command-head span {
  display: block;
  color: var(--ux-purple);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.command-head h2 {
  margin: 2px 0 0;
  color: var(--ux-ink);
  font-size: clamp(1.1rem, 1.5vw, 1.45rem);
  letter-spacing: 0;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.command-kpi {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid var(--ux-line);
}

.command-kpi i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
}

.command-kpi span {
  color: var(--ux-muted);
  font-size: .72rem;
  font-weight: 800;
}

.command-kpi b {
  color: var(--ux-ink);
  font-size: 1.38rem;
  line-height: 1;
}

.command-kpi.green i { background: var(--ux-green); }
.command-kpi.yellow i { background: var(--ux-yellow); }
.command-kpi.red i { background: var(--ux-red); }
.command-kpi.blue i { background: var(--ux-blue); }

.command-columns {
  display: grid;
  grid-template-columns: 1.15fr .9fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.command-columns > article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ux-line);
  border-radius: 14px;
  background: #fbfdff;
}

.command-columns h3 {
  margin: 0 0 10px;
  color: var(--ux-ink);
  font-size: .88rem;
  letter-spacing: 0;
}

.command-alert,
.command-note {
  display: grid;
  gap: 3px;
  padding: 8px 0;
  border-top: 1px solid #e8eef7;
}

.command-alert:first-of-type,
.command-note:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.command-alert strong,
.command-note strong,
.command-list b {
  color: var(--ux-ink);
  font-size: .82rem;
}

.command-alert span,
.command-note span,
.command-list span,
.command-columns small {
  color: var(--ux-muted);
  font-size: .74rem;
  line-height: 1.25;
}

.command-list {
  display: grid;
  gap: 7px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.command-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e8eef7;
}

.empty-state.compact {
  min-height: auto !important;
  padding: 12px !important;
  border-radius: 12px !important;
}

body.is-authenticated .permission-panel,
body.is-authenticated #module-configuracion .permission-panel {
  border-radius: 16px !important;
  background: #ffffff !important;
}

body.is-authenticated .permission-panel-head,
body.is-authenticated #module-configuracion .permission-panel-head {
  background: linear-gradient(135deg, #ffffff, #f8f4ff) !important;
  border-bottom: 1px solid var(--ux-line) !important;
}

body.is-authenticated .permission-table,
body.is-authenticated #module-configuracion .permission-table {
  min-width: 640px !important;
}

body.is-authenticated .permission-tick,
body.is-authenticated #module-configuracion .permission-tick {
  background: #f8fbff !important;
}

body.is-authenticated .permission-tick:has(input:checked),
body.is-authenticated #module-configuracion .permission-tick:has(input:checked) {
  background: #ecfeff !important;
  border-color: #67e8f9 !important;
}

@media (max-width: 1180px) {
  .command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .home-grid,
  .portal-metrics,
  .command-grid {
    grid-template-columns: 1fr !important;
  }

  .command-head {
    align-items: stretch;
    flex-direction: column;
  }

  .command-head .icon-btn {
    width: 100%;
    justify-content: center;
  }
}

@media print {
  .command-center,
  .dashboard-home,
  .portal-metrics,
  .portal-risk-card {
    box-shadow: none !important;
  }

  .boletin-section-title,
  .utp-report-section h3,
  .planner-doc-section h3 {
    color: #111827 !important;
  }
}

/* Real sidebar button class compatibility */
@media (min-width: 981px) {
  body.is-authenticated .nav-btn,
  body.visual-modern.is-authenticated .nav-btn {
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 34px !important;
    gap: 7px !important;
    padding: 0 6px 0 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #ffffff !important;
    box-shadow: none !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;
    display: grid !important;
    place-items: center !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, .16) !important;
    color: #ffffff !important;
    font-size: .82rem !important;
  }

  body.is-authenticated .nav-btn span,
  body.visual-modern.is-authenticated .nav-btn span {
    min-width: 0 !important;
    color: #ffffff !important;
    font-size: .66rem !important;
    font-weight: 850 !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

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

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

/* Ultra UX Premium 2026 */
body.is-authenticated .module.active,
body.visual-modern.is-authenticated .module.active {
  width: min(95vw, calc(100vw - var(--preview-sidebar-width) - 18px)) !important;
  max-width: none !important;
  margin-inline: auto !important;
}

body.is-authenticated .grid,
body.visual-modern.is-authenticated .grid,
.config-quick-grid,
.section-link-grid,
.layout-insight-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)) !important;
  gap: clamp(10px, 1vw, 16px) !important;
}

@media (min-width: 1440px) {
  body.is-authenticated .grid.four,
  body.visual-modern.is-authenticated .grid.four,
  .portal-metrics,
  .home-grid,
  .config-quick-grid,
  .admin-control-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  }
}

.global-search-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(217, 228, 242, .9);
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(18px);
}

.global-search-box {
  min-height: 48px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--ux-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(18, 32, 58, .08);
  overflow: hidden;
}

.global-search-box i {
  display: grid;
  place-items: center;
  color: var(--ux-purple);
}

.global-search-box input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--ux-ink);
  font-size: .95rem;
  background: transparent;
}

.global-quick-actions,
.global-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.global-quick-actions button,
.global-results button {
  min-width: 0;
  display: inline-grid;
  align-items: center;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #e6edf7;
  border-radius: 12px;
  background: #fff;
  color: var(--ux-ink);
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.global-results button {
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 54px;
}

.global-quick-actions i,
.global-results i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ux-purple-soft);
  color: var(--ux-purple);
}

.global-results b,
.global-results small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-results small {
  margin-top: 2px;
  color: var(--ux-muted);
  font-size: .72rem;
}

.admin-control-center {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: clamp(16px, 1.5vw, 22px);
  border: 1px solid rgba(217, 228, 242, .95);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .12), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 60%, #f3e8ff 100%);
  box-shadow: 0 18px 44px rgba(18, 32, 58, .1);
}

.admin-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-control-head span {
  color: var(--ux-purple);
  font-size: .72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-control-head h2 {
  margin: 3px 0;
  color: var(--ux-ink);
  font-size: clamp(1.25rem, 1.7vw, 1.8rem);
  letter-spacing: 0;
}

.admin-control-head p,
.admin-control-status small {
  margin: 0;
  color: var(--ux-muted);
  line-height: 1.35;
}

.admin-control-status {
  min-width: 190px;
  padding: 11px 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e6edf7;
}

.admin-control-status b {
  display: block;
  color: var(--ux-ink);
  font-size: .86rem;
}

.admin-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.admin-control-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid #e6edf7;
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 24px rgba(18, 32, 58, .06);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.admin-control-card > i {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--ux-blue), var(--ux-purple));
  color: #fff;
}

.admin-control-card span,
.admin-control-card b,
.admin-control-card small {
  display: block;
  min-width: 0;
}

.admin-control-card span {
  color: var(--ux-muted);
  font-size: .72rem;
  font-weight: 900;
}

.admin-control-card b {
  margin: 2px 0;
  color: var(--ux-ink);
  font-size: 1.1rem;
}

.admin-control-card small {
  color: var(--ux-muted);
  font-size: .74rem;
  line-height: 1.25;
}

.admin-control-card button {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .72rem;
  font-weight: 900;
  cursor: pointer;
}

.admin-control-card:hover,
.home-card:hover,
.section-link-card:hover,
.global-quick-actions button:hover,
.global-results button:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 40, 217, .24) !important;
  box-shadow: 0 16px 34px rgba(18, 32, 58, .12) !important;
}

body.is-authenticated input,
body.is-authenticated select,
body.is-authenticated textarea,
body.visual-modern.is-authenticated input,
body.visual-modern.is-authenticated select,
body.visual-modern.is-authenticated textarea {
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}

body.is-authenticated input:focus,
body.is-authenticated select:focus,
body.is-authenticated textarea:focus,
body.visual-modern.is-authenticated input:focus,
body.visual-modern.is-authenticated select:focus,
body.visual-modern.is-authenticated textarea:focus {
  border-color: rgba(37, 99, 235, .58) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12) !important;
  outline: none !important;
}

@media (max-width: 980px) {
  body.is-authenticated .module.active,
  body.visual-modern.is-authenticated .module.active {
    width: 100% !important;
  }

  .admin-control-head {
    flex-direction: column;
  }

  .admin-control-status {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .global-quick-actions,
  .global-results,
  .admin-control-grid {
    grid-template-columns: 1fr !important;
  }

  .global-search-panel,
  .admin-control-center {
    padding: 12px;
    border-radius: 16px;
  }
}

/* Institutional color correction: blue/cyan/gray, no violet dominance */
:root {
  --ux-purple: #0f5fb8;
  --ux-purple-dark: #0b3f7a;
  --ux-purple-soft: #eaf5ff;
  --ux-blue: #145fca;
  --ux-green: #16a34a;
  --ux-yellow: #d97706;
  --ux-red: #dc2626;
  --ux-ink: #132238;
  --ux-muted: #607089;
  --ux-line: #d8e6f4;
  --primary: #145fca;
  --primary-dark: #0b3f7a;
  --primary-light: #63c7f2;
  --appo-purple: #0ea5e9;
  --school-purple: #0ea5e9;
  --school-purple-soft: #e0f2fe;
  --module-purple: #0ea5e9;
  --module-purple-dark: #075985;
  --module-purple-soft: #e0f2fe;
}

body.is-authenticated .topbar,
body.visual-modern.is-authenticated .topbar {
  background: linear-gradient(180deg, #0b3f7a 0%, #145fca 58%, #0ea5e9 100%) !important;
  box-shadow: 12px 0 34px rgba(11, 63, 122, .2) !important;
}

.home-header {
  background:
    linear-gradient(135deg, rgba(11, 63, 122, .98), rgba(20, 95, 202, .92) 58%, rgba(14, 165, 233, .86)),
    #145fca !important;
}

.dashboard-home {
  background: linear-gradient(135deg, #ffffff 0%, #fbfdff 64%, #eaf6ff 100%) !important;
}

.admin-control-center {
  background:
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .16), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 62%, #eaf5ff 100%) !important;
}

.admin-control-head span,
.command-head span,
.global-search-box i,
.home-icon,
.section-link-card i,
.global-quick-actions i,
.global-results i {
  color: #145fca !important;
}

.home-icon,
.section-link-card i,
.global-quick-actions i,
.global-results i {
  background: #eaf5ff !important;
}

.admin-control-card > i,
.metric-icon,
body.is-authenticated .metric-icon,
body.visual-modern.is-authenticated .metric-icon {
  background: linear-gradient(135deg, #0ea5e9, #145fca) !important;
  color: #ffffff !important;
}

.admin-control-card:hover,
.home-card:hover,
.section-link-card:hover,
.global-quick-actions button:hover,
.global-results button:hover {
  border-color: rgba(20, 95, 202, .28) !important;
  box-shadow: 0 16px 34px rgba(11, 63, 122, .12) !important;
}

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 {
  background: rgba(255, 255, 255, .12) !important;
}

body.is-authenticated .year-control select,
body.visual-modern.is-authenticated .year-control select {
  color: #0b3f7a !important;
}

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

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

.role-badge.role-admin,
.role-badge.role-pie {
  background: #eaf5ff !important;
  color: #0b3f7a !important;
  border-color: #bfdbfe !important;
}

.report-observation-box.conclusion {
  --active-module-color: #0ea5e9;
  --active-module-dark: #075985;
  --active-module-soft: #e0f2fe;
}

.boletin-observation-block.conclusion {
  border-left-color: #0ea5e9 !important;
}

.boletin-observation-block.conclusion h3 {
  background: #e0f2fe !important;
  color: #075985 !important;
}

/* Configuration media grid: horizontal, compact and responsive */
body.is-authenticated #module-configuracion .logo-config,
body.visual-modern.is-authenticated #module-configuracion .logo-config {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
}

body.is-authenticated #module-configuracion .logo-config article,
body.visual-modern.is-authenticated #module-configuracion .logo-config article {
  min-width: 0 !important;
  display: grid !important;
  grid-template-rows: auto 1fr auto !important;
  gap: 8px !important;
  padding: 12px !important;
  border: 1px solid #cfe0f2 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  box-shadow: 0 10px 22px rgba(11, 63, 122, .06) !important;
}

body.is-authenticated #module-configuracion .logo-config b,
body.visual-modern.is-authenticated #module-configuracion .logo-config b {
  margin: 0 !important;
  color: #132238 !important;
  font-size: .82rem !important;
  font-weight: 850 !important;
}

body.is-authenticated #module-configuracion .logo-preview,
body.visual-modern.is-authenticated #module-configuracion .logo-preview {
  width: 96px !important;
  height: 96px !important;
  min-height: 96px !important;
  display: grid !important;
  place-items: center !important;
  align-self: start !important;
  border-radius: 9px !important;
  background: #eef7ff !important;
  border: 1px solid #bfdbfe !important;
  overflow: hidden !important;
}

body.is-authenticated #module-configuracion .logo-preview img,
body.visual-modern.is-authenticated #module-configuracion .logo-preview img {
  max-width: 86px !important;
  max-height: 86px !important;
  object-fit: contain !important;
}

body.is-authenticated #module-configuracion .visual-image-config,
body.visual-modern.is-authenticated #module-configuracion .visual-image-config {
  grid-column: span 2 !important;
}

body.is-authenticated #module-configuracion .visual-image-preview,
body.visual-modern.is-authenticated #module-configuracion .visual-image-preview {
  width: 100% !important;
  height: 118px !important;
  min-height: 118px !important;
}

body.is-authenticated #module-configuracion .visual-image-preview img,
body.visual-modern.is-authenticated #module-configuracion .visual-image-preview img {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
}

body.is-authenticated #module-configuracion .logo-config .form-actions,
body.visual-modern.is-authenticated #module-configuracion .logo-config .form-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin: 0 !important;
}

body.is-authenticated #module-configuracion .logo-config .form-actions button,
body.visual-modern.is-authenticated #module-configuracion .logo-config .form-actions button {
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  font-size: .78rem !important;
  white-space: nowrap !important;
}

@media (min-width: 1400px) {
  body.is-authenticated #module-configuracion .logo-config,
  body.visual-modern.is-authenticated #module-configuracion .logo-config {
    grid-template-columns: repeat(4, minmax(170px, 1fr)) !important;
  }
}

@media (max-width: 780px) {
  body.is-authenticated #module-configuracion .logo-config,
  body.visual-modern.is-authenticated #module-configuracion .logo-config {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated #module-configuracion .visual-image-config,
  body.visual-modern.is-authenticated #module-configuracion .visual-image-config {
    grid-column: auto !important;
  }
}

/* Centered logo/text composition across the app */
body.is-authenticated .logo-config,
body.visual-modern.is-authenticated .logo-config {
  align-items: start !important;
}

body.is-authenticated #module-configuracion .logo-config,
body.visual-modern.is-authenticated #module-configuracion .logo-config {
  grid-template-columns: repeat(7, minmax(118px, 1fr)) !important;
  gap: 8px !important;
}

body.is-authenticated #module-configuracion .logo-config article,
body.visual-modern.is-authenticated #module-configuracion .logo-config article {
  min-height: 128px !important;
  padding: 8px !important;
  justify-items: center !important;
  text-align: center !important;
}

body.is-authenticated #module-configuracion .logo-config b,
body.visual-modern.is-authenticated #module-configuracion .logo-config b {
  width: 100% !important;
  text-align: center !important;
  font-size: .68rem !important;
  line-height: 1.15 !important;
}

body.is-authenticated #module-configuracion .logo-preview,
body.visual-modern.is-authenticated #module-configuracion .logo-preview {
  width: 64px !important;
  height: 64px !important;
  min-height: 64px !important;
  justify-self: center !important;
}

body.is-authenticated #module-configuracion .logo-preview img,
body.visual-modern.is-authenticated #module-configuracion .logo-preview img {
  max-width: 56px !important;
  max-height: 56px !important;
}

body.is-authenticated #module-configuracion .visual-image-config,
body.visual-modern.is-authenticated #module-configuracion .visual-image-config {
  grid-column: span 2 !important;
}

body.is-authenticated #module-configuracion .visual-image-preview,
body.visual-modern.is-authenticated #module-configuracion .visual-image-preview {
  width: 100% !important;
  height: 64px !important;
  min-height: 64px !important;
}

body.is-authenticated #module-configuracion .visual-image-preview img,
body.visual-modern.is-authenticated #module-configuracion .visual-image-preview img {
  object-fit: cover !important;
}

body.is-authenticated #module-configuracion .logo-config .form-actions,
body.visual-modern.is-authenticated #module-configuracion .logo-config .form-actions {
  width: 100% !important;
  justify-content: center !important;
  gap: 5px !important;
}

body.is-authenticated #module-configuracion .logo-config .form-actions button,
body.visual-modern.is-authenticated #module-configuracion .logo-config .form-actions button {
  min-height: 24px !important;
  padding: 0 8px !important;
  font-size: .62rem !important;
}

body.is-authenticated .home-card,
body.is-authenticated .section-link-card,
body.is-authenticated .admin-control-card,
body.is-authenticated .config-quick-card,
body.visual-modern.is-authenticated .home-card,
body.visual-modern.is-authenticated .section-link-card,
body.visual-modern.is-authenticated .admin-control-card,
body.visual-modern.is-authenticated .config-quick-card {
  text-align: center;
}

body.is-authenticated .home-icon,
body.is-authenticated .section-link-card i,
body.is-authenticated .admin-control-card > i,
body.visual-modern.is-authenticated .home-icon,
body.visual-modern.is-authenticated .section-link-card i,
body.visual-modern.is-authenticated .admin-control-card > i {
  justify-self: center;
}

@media (max-width: 1280px) {
  body.is-authenticated #module-configuracion .logo-config,
  body.visual-modern.is-authenticated #module-configuracion .logo-config {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
  }
}

@media (max-width: 780px) {
  body.is-authenticated #module-configuracion .logo-config,
  body.visual-modern.is-authenticated #module-configuracion .logo-config {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.is-authenticated #module-configuracion .visual-image-config,
  body.visual-modern.is-authenticated #module-configuracion .visual-image-config {
    grid-column: span 2 !important;
  }
}

@media (max-width: 480px) {
  body.is-authenticated #module-configuracion .logo-config,
  body.visual-modern.is-authenticated #module-configuracion .logo-config,
  body.is-authenticated #module-configuracion .visual-image-config,
  body.visual-modern.is-authenticated #module-configuracion .visual-image-config {
    grid-template-columns: 1fr !important;
    grid-column: auto !important;
  }
}

/* Clean menus after role/report simplification */
body.is-authenticated .user-role-deck,
body.visual-modern.is-authenticated .user-role-deck {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 10px !important;
}

body.is-authenticated .user-role-card,
body.visual-modern.is-authenticated .user-role-card {
  min-height: 92px !important;
  padding: 12px !important;
}

body.is-authenticated .function-check-grid,
body.visual-modern.is-authenticated .function-check-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 8px !important;
}

body.is-authenticated .layout-report-actions,
body.visual-modern.is-authenticated .layout-report-actions {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  gap: 10px !important;
}

body.is-authenticated .report-observation-layout,
body.visual-modern.is-authenticated .report-observation-layout {
  gap: 12px !important;
}

body.is-authenticated .report-period-field,
body.visual-modern.is-authenticated .report-period-field {
  width: min(260px, 100%) !important;
}

body.is-authenticated #reportObservationPeriod,
body.visual-modern.is-authenticated #reportObservationPeriod,
body.is-authenticated #reportType,
body.visual-modern.is-authenticated #reportType {
  min-width: 0 !important;
}

/* Permission matrix and function checks: use full width without text collisions */
body.is-authenticated .function-fieldset,
body.visual-modern.is-authenticated .function-fieldset {
  min-width: 0 !important;
  overflow: hidden !important;
}

body.is-authenticated .function-check-grid,
body.visual-modern.is-authenticated .function-check-grid {
  width: 100% !important;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
  align-items: stretch !important;
}

body.is-authenticated .function-check,
body.visual-modern.is-authenticated .function-check {
  min-width: 0 !important;
  min-height: 42px !important;
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 8px 10px !important;
  border: 1px solid #cfe0f2 !important;
  border-radius: 8px !important;
  background: #f8fbff !important;
  color: #18304f !important;
  font-size: .78rem !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  text-align: left !important;
  white-space: normal !important;
  overflow: hidden !important;
}

body.is-authenticated .function-check input,
body.visual-modern.is-authenticated .function-check input {
  justify-self: center !important;
  margin: 0 !important;
}

body.is-authenticated .permission-panel,
body.visual-modern.is-authenticated .permission-panel {
  max-width: 100% !important;
  overflow: hidden !important;
}

body.is-authenticated .permission-table-wrap,
body.is-authenticated #module-configuracion .permission-table-wrap,
body.visual-modern.is-authenticated .permission-table-wrap,
body.visual-modern.is-authenticated #module-configuracion .permission-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  padding-bottom: 4px !important;
}

body.is-authenticated .permission-table,
body.is-authenticated #module-configuracion .permission-table,
body.visual-modern.is-authenticated .permission-table,
body.visual-modern.is-authenticated #module-configuracion .permission-table {
  width: max(100%, 760px) !important;
  min-width: 760px !important;
  table-layout: fixed !important;
}

body.is-authenticated .permission-table th:first-child,
body.is-authenticated .permission-table tbody th,
body.visual-modern.is-authenticated .permission-table th:first-child,
body.visual-modern.is-authenticated .permission-table tbody th {
  width: 116px !important;
  min-width: 116px !important;
  max-width: 116px !important;
}

body.is-authenticated .permission-table th,
body.is-authenticated .permission-table td,
body.visual-modern.is-authenticated .permission-table th,
body.visual-modern.is-authenticated .permission-table td {
  padding: 4px !important;
}

body.is-authenticated .permission-table tbody th,
body.visual-modern.is-authenticated .permission-table tbody th {
  font-size: .7rem !important;
  line-height: 1.1 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated .permission-tick,
body.is-authenticated #module-configuracion .permission-tick,
body.visual-modern.is-authenticated .permission-tick,
body.visual-modern.is-authenticated #module-configuracion .permission-tick {
  min-height: 36px !important;
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-items: start !important;
  gap: 5px !important;
  padding: 4px 6px !important;
}

body.is-authenticated .permission-tick input,
body.is-authenticated #module-configuracion .permission-tick input,
body.visual-modern.is-authenticated .permission-tick input,
body.visual-modern.is-authenticated #module-configuracion .permission-tick input {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
}

body.is-authenticated .permission-tick span,
body.is-authenticated #module-configuracion .permission-tick span,
body.visual-modern.is-authenticated .permission-tick span,
body.visual-modern.is-authenticated #module-configuracion .permission-tick span {
  max-width: 100% !important;
  font-size: .64rem !important;
  line-height: 1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

@media (max-width: 1320px) {
  body.is-authenticated .permission-table,
  body.is-authenticated #module-configuracion .permission-table,
  body.visual-modern.is-authenticated .permission-table,
  body.visual-modern.is-authenticated #module-configuracion .permission-table {
    min-width: 700px !important;
  }

  body.is-authenticated .permission-tick,
  body.visual-modern.is-authenticated .permission-tick {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
  }

  body.is-authenticated .permission-tick span,
  body.visual-modern.is-authenticated .permission-tick span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
  }
}

/* Permission cards method: replaces cramped horizontal table */
body.is-authenticated .permission-card-grid,
body.visual-modern.is-authenticated .permission-card-grid {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: 10px !important;
  align-items: stretch !important;
}

body.is-authenticated .permission-module-card,
body.visual-modern.is-authenticated .permission-module-card {
  min-width: 0 !important;
  display: grid !important;
  grid-template-rows: auto 1fr !important;
  gap: 9px !important;
  padding: 11px !important;
  border: 1px solid #cfe0f2 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(11, 63, 122, .06) !important;
}

body.is-authenticated .permission-module-card header,
body.visual-modern.is-authenticated .permission-module-card header {
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
}

body.is-authenticated .permission-module-card header i,
body.visual-modern.is-authenticated .permission-module-card header i {
  width: 30px !important;
  height: 30px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 10px !important;
  background: #eaf5ff !important;
  color: #145fca !important;
  font-size: .82rem !important;
}

body.is-authenticated .permission-module-card header b,
body.visual-modern.is-authenticated .permission-module-card header b {
  min-width: 0 !important;
  color: #0b3f7a !important;
  font-size: .8rem !important;
  line-height: 1.15 !important;
  overflow-wrap: anywhere !important;
  text-transform: uppercase !important;
}

body.is-authenticated .permission-action-grid,
body.visual-modern.is-authenticated .permission-action-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body.is-authenticated .permission-chip,
body.visual-modern.is-authenticated .permission-chip {
  min-width: 0 !important;
  min-height: 34px !important;
  display: grid !important;
  grid-template-columns: 17px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 8px !important;
  border: 1px solid #d6e7f8 !important;
  border-radius: 9px !important;
  background: #f8fbff !important;
  color: #18304f !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}

body.is-authenticated .permission-chip:has(input:checked),
body.visual-modern.is-authenticated .permission-chip:has(input:checked) {
  border-color: #38bdf8 !important;
  background: #e0f2fe !important;
  color: #075985 !important;
}

body.is-authenticated .permission-chip input,
body.visual-modern.is-authenticated .permission-chip input {
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  accent-color: #0f5fb8 !important;
}

body.is-authenticated .permission-chip span,
body.visual-modern.is-authenticated .permission-chip span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

@media (min-width: 1500px) {
  body.is-authenticated .permission-card-grid,
  body.visual-modern.is-authenticated .permission-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  body.is-authenticated .permission-card-grid,
  body.visual-modern.is-authenticated .permission-card-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Staff-centered access management */
body.is-authenticated #module-configuracion .config-grid-users,
body.visual-modern.is-authenticated #module-configuracion .config-grid-users {
  display: none !important;
}

body.is-authenticated .staff-access-panel,
body.visual-modern.is-authenticated .staff-access-panel {
  border-color: #bfdbfe !important;
  background: linear-gradient(135deg, #ffffff, #f0f8ff) !important;
}

body.is-authenticated .staff-special-permissions,
body.visual-modern.is-authenticated .staff-special-permissions {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  gap: 10px !important;
  margin-top: 12px !important;
}

body.is-authenticated .staff-permission-switch,
body.visual-modern.is-authenticated .staff-permission-switch {
  min-width: 0 !important;
  min-height: 46px !important;
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 11px !important;
  border: 1px solid #d6e7f8 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #18304f !important;
  cursor: pointer !important;
}

body.is-authenticated .staff-permission-switch input,
body.visual-modern.is-authenticated .staff-permission-switch input {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.is-authenticated .staff-permission-switch span,
body.visual-modern.is-authenticated .staff-permission-switch span {
  width: 40px !important;
  height: 22px !important;
  display: block !important;
  border-radius: 999px !important;
  background: #dbe7f3 !important;
  position: relative !important;
  transition: background .22s ease !important;
}

body.is-authenticated .staff-permission-switch span::after,
body.visual-modern.is-authenticated .staff-permission-switch span::after {
  content: "" !important;
  width: 18px !important;
  height: 18px !important;
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .18) !important;
  transition: transform .22s ease !important;
}

body.is-authenticated .staff-permission-switch input:checked + span,
body.visual-modern.is-authenticated .staff-permission-switch input:checked + span {
  background: #145fca !important;
}

body.is-authenticated .staff-permission-switch input:checked + span::after,
body.visual-modern.is-authenticated .staff-permission-switch input:checked + span::after {
  transform: translateX(18px) !important;
}

body.is-authenticated .staff-permission-switch b,
body.visual-modern.is-authenticated .staff-permission-switch b {
  min-width: 0 !important;
  color: #0b3f7a !important;
  font-size: .82rem !important;
  line-height: 1.15 !important;
}

body.is-authenticated .staff-role-choice,
body.visual-modern.is-authenticated .staff-role-choice {
  min-height: 46px !important;
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 11px !important;
  border: 1px solid #cfe0f2 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #0b3f7a !important;
  font-weight: 850 !important;
}

body.is-authenticated .staff-role-choice:has(input:checked),
body.visual-modern.is-authenticated .staff-role-choice:has(input:checked) {
  border-color: #38bdf8 !important;
  background: #e0f2fe !important;
}

body.is-authenticated .staff-role-choice input,
body.visual-modern.is-authenticated .staff-role-choice input {
  accent-color: #145fca !important;
}
.actions #saveBtn[data-save-status="saving"] {
  opacity: .75;
  cursor: progress;
}

.actions #saveBtn[data-save-status="saved"] {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
}

.actions #saveBtn[data-save-status="error"] {
  background: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .2);
}

/* Profesores: editor de funcionarios ordenado y asignaciones legibles */
body.is-authenticated #module-profesores .compact-editor,
body.visual-modern.is-authenticated #module-profesores .compact-editor {
  padding: 18px !important;
  border: 1px solid #cfe0f2 !important;
  border-left: 5px solid #145fca !important;
  background: #ffffff !important;
}

body.is-authenticated #module-profesores .compact-editor > h3,
body.visual-modern.is-authenticated #module-profesores .compact-editor > h3 {
  margin: 0 0 14px !important;
  color: #0f253f !important;
  font-size: 1.08rem !important;
  font-weight: 850 !important;
}

body.is-authenticated #teacherForm.staff-editor-form,
body.visual-modern.is-authenticated #teacherForm.staff-editor-form {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: start !important;
}

body.is-authenticated #teacherForm.staff-editor-form > label,
body.visual-modern.is-authenticated #teacherForm.staff-editor-form > label {
  grid-column: span 3 !important;
  min-width: 0 !important;
}

body.is-authenticated #teacherForm.staff-editor-form > label.full,
body.visual-modern.is-authenticated #teacherForm.staff-editor-form > label.full,
body.is-authenticated #teacherForm.staff-editor-form > fieldset,
body.visual-modern.is-authenticated #teacherForm.staff-editor-form > fieldset,
body.is-authenticated #teacherForm.staff-editor-form > .form-actions,
body.visual-modern.is-authenticated #teacherForm.staff-editor-form > .form-actions {
  grid-column: 1 / -1 !important;
}

body.is-authenticated #teacherForm.staff-editor-form input,
body.is-authenticated #teacherForm.staff-editor-form select,
body.is-authenticated #teacherForm.staff-editor-form textarea,
body.visual-modern.is-authenticated #teacherForm.staff-editor-form input,
body.visual-modern.is-authenticated #teacherForm.staff-editor-form select,
body.visual-modern.is-authenticated #teacherForm.staff-editor-form textarea {
  min-width: 0 !important;
}

body.is-authenticated #module-profesores .teacher-check-panel,
body.visual-modern.is-authenticated #module-profesores .teacher-check-panel {
  padding: 14px !important;
  border-color: #cfe0f2 !important;
  background: #f8fbff !important;
}

body.is-authenticated #module-profesores .teacher-check-panel legend,
body.visual-modern.is-authenticated #module-profesores .teacher-check-panel legend {
  padding: 0 8px !important;
  color: #143b66 !important;
  font-size: .88rem !important;
  font-weight: 850 !important;
}

body.is-authenticated #module-profesores .access-suggestion-grid,
body.visual-modern.is-authenticated #module-profesores .access-suggestion-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(230px, .95fr) !important;
  align-items: stretch !important;
}

body.is-authenticated #module-profesores .access-suggestion-status,
body.visual-modern.is-authenticated #module-profesores .access-suggestion-status {
  min-width: 0 !important;
  min-height: 64px !important;
  align-content: center !important;
  gap: 5px !important;
  overflow: hidden !important;
}

body.is-authenticated #module-profesores .access-suggestion-status small,
body.visual-modern.is-authenticated #module-profesores .access-suggestion-status small {
  line-height: 1.25 !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated #module-profesores .staff-special-permissions,
body.visual-modern.is-authenticated #module-profesores .staff-special-permissions {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
}

body.is-authenticated #module-profesores .staff-role-choice,
body.visual-modern.is-authenticated #module-profesores .staff-role-choice {
  grid-template-columns: 18px minmax(0, 1fr) !important;
  min-height: 44px !important;
  border-radius: 8px !important;
}

body.is-authenticated #module-profesores .staff-role-choice span,
body.visual-modern.is-authenticated #module-profesores .staff-role-choice span {
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated #module-profesores .staff-assignment-panel,
body.visual-modern.is-authenticated #module-profesores .staff-assignment-panel {
  background: #ffffff !important;
}

body.is-authenticated #module-profesores .staff-course-grid,
body.visual-modern.is-authenticated #module-profesores .staff-course-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: 10px !important;
}

body.is-authenticated #module-profesores .staff-subject-grid,
body.visual-modern.is-authenticated #module-profesores .staff-subject-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 10px !important;
}

body.is-authenticated #module-profesores .staff-picker-card,
body.visual-modern.is-authenticated #module-profesores .staff-picker-card {
  position: relative !important;
  min-width: 0 !important;
  min-height: 68px !important;
  display: grid !important;
  grid-template-columns: 18px 34px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  border: 1px solid #d6e7f8 !important;
  border-radius: 8px !important;
  background: #f8fbff !important;
  color: #18304f !important;
  cursor: pointer !important;
}

body.is-authenticated #module-profesores .staff-picker-card:hover,
body.visual-modern.is-authenticated #module-profesores .staff-picker-card:hover {
  border-color: #63c7f2 !important;
  background: #ffffff !important;
}

body.is-authenticated #module-profesores .staff-picker-card:has(input:checked),
body.visual-modern.is-authenticated #module-profesores .staff-picker-card:has(input:checked) {
  border-color: #145fca !important;
  background: #eaf4ff !important;
  box-shadow: 0 8px 18px rgba(20, 95, 202, .1) !important;
}

body.is-authenticated #module-profesores .staff-picker-card input,
body.visual-modern.is-authenticated #module-profesores .staff-picker-card input {
  position: static !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  accent-color: #145fca !important;
}

body.is-authenticated #module-profesores .staff-picker-card > i,
body.visual-modern.is-authenticated #module-profesores .staff-picker-card > i {
  width: 34px !important;
  height: 34px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #145fca !important;
  box-shadow: inset 0 0 0 1px #dbe7f3 !important;
}

body.is-authenticated #module-profesores .staff-picker-card span,
body.visual-modern.is-authenticated #module-profesores .staff-picker-card span,
body.is-authenticated #module-profesores .staff-picker-card b,
body.visual-modern.is-authenticated #module-profesores .staff-picker-card b,
body.is-authenticated #module-profesores .staff-picker-card small,
body.visual-modern.is-authenticated #module-profesores .staff-picker-card small {
  min-width: 0 !important;
  display: block !important;
  overflow-wrap: anywhere !important;
}

body.is-authenticated #module-profesores .staff-picker-card b,
body.visual-modern.is-authenticated #module-profesores .staff-picker-card b {
  color: #0f253f !important;
  font-size: .86rem !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
}

body.is-authenticated #module-profesores .staff-picker-card small,
body.visual-modern.is-authenticated #module-profesores .staff-picker-card small {
  margin-top: 3px !important;
  color: #5c6f8a !important;
  font-size: .74rem !important;
  line-height: 1.25 !important;
}

body.is-authenticated #module-profesores .assignment-option,
body.visual-modern.is-authenticated #module-profesores .assignment-option {
  grid-template-columns: 34px minmax(0, 1fr) !important;
}

body.is-authenticated #module-profesores .assignment-option b,
body.visual-modern.is-authenticated #module-profesores .assignment-option b {
  color: #0f253f !important;
  font-weight: 850 !important;
}

body.is-authenticated #module-profesores .assignment-option small,
body.visual-modern.is-authenticated #module-profesores .assignment-option small {
  line-height: 1.25 !important;
}

body.is-authenticated #module-profesores .staff-toolbar,
body.visual-modern.is-authenticated #module-profesores .staff-toolbar {
  grid-template-columns: minmax(260px, 1fr) !important;
}

body.is-authenticated #module-profesores .professors-card table,
body.visual-modern.is-authenticated #module-profesores .professors-card table {
  width: 100% !important;
  min-width: 820px !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: 30% !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: 126px !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: 132px !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: 180px !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: 132px !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: 132px !important;
}

body.is-authenticated #module-profesores .professors-card td,
body.visual-modern.is-authenticated #module-profesores .professors-card td {
  overflow-wrap: anywhere !important;
}

body.is-authenticated #module-profesores .professors-card .table-tools,
body.visual-modern.is-authenticated #module-profesores .professors-card .table-tools {
  grid-template-columns: minmax(220px, 380px) !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

body.is-authenticated #module-profesores .professors-card .table-count,
body.visual-modern.is-authenticated #module-profesores .professors-card .table-count {
  display: none !important;
}

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

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

body.is-authenticated #module-profesores .icon-only-btn i,
body.visual-modern.is-authenticated #module-profesores .icon-only-btn i {
  margin: 0 !important;
  font-size: .9rem !important;
}

@media (max-width: 1180px) {
  body.is-authenticated #teacherForm.staff-editor-form,
  body.visual-modern.is-authenticated #teacherForm.staff-editor-form {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  body.is-authenticated #teacherForm.staff-editor-form > label,
  body.visual-modern.is-authenticated #teacherForm.staff-editor-form > label {
    grid-column: span 3 !important;
  }

  body.is-authenticated #module-profesores .access-suggestion-grid,
  body.visual-modern.is-authenticated #module-profesores .access-suggestion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 680px) {
  body.is-authenticated #teacherForm.staff-editor-form,
  body.visual-modern.is-authenticated #teacherForm.staff-editor-form,
  body.is-authenticated #module-profesores .access-suggestion-grid,
  body.visual-modern.is-authenticated #module-profesores .access-suggestion-grid {
    grid-template-columns: 1fr !important;
  }

  body.is-authenticated #teacherForm.staff-editor-form > label,
  body.visual-modern.is-authenticated #teacherForm.staff-editor-form > label {
    grid-column: 1 / -1 !important;
  }
}
.skip-link {
  position: fixed;
  z-index: 10000;
  left: 12px;
  top: 8px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #0b4f59;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .form-actions > button,
  .data-actions > button {
    min-height: 44px;
  }
}
.mandatory-password-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, rgba(7, 30, 54, .96), rgba(13, 74, 89, .94));
  backdrop-filter: blur(12px);
}

.mandatory-password-card {
  width: min(100%, 470px);
  display: grid;
  gap: 15px;
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .35);
}

.mandatory-password-card h2,
.mandatory-password-card p { margin: 0; }
.mandatory-password-card label { display: grid; gap: 7px; font-weight: 700; }
.mandatory-password-card small { color: #526273; line-height: 1.5; }
.mandatory-password-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #087f8c, #0b5f75);
  font-size: 24px;
}

body.password-change-required { overflow: hidden; }

/* Ajuste de pantalla completa: menu integrado y contenido sin cortes laterales */
@media screen {
  body.is-authenticated,
  body.visual-modern.is-authenticated {
    --screen-edge-gap: 1cm;
    overflow-x: hidden !important;
  }

  @media (min-width: 981px) {
    body.is-authenticated .topbar,
    body.visual-modern.is-authenticated .topbar {
      top: 0 !important;
      left: 0 !important;
      bottom: 0 !important;
      width: var(--preview-sidebar-width) !important;
      height: 100vh !important;
      min-height: 100vh !important;
      padding: 10px 8px !important;
      gap: 6px !important;
      border-radius: 0 !important;
      box-shadow: 8px 0 24px rgba(11, 63, 122, .18) !important;
      overflow: hidden !important;
    }

    body.is-authenticated .brand-row,
    body.visual-modern.is-authenticated .brand-row {
      gap: 8px !important;
      padding: 8px !important;
    }

    body.is-authenticated .actions,
    body.visual-modern.is-authenticated .actions {
      gap: 3px !important;
      padding: 6px 8px !important;
    }

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

    body.is-authenticated .nav-group-label,
    body.visual-modern.is-authenticated .nav-group-label {
      margin: 10px 10px 4px !important;
    }

    body.is-authenticated .nav-item,
    body.visual-modern.is-authenticated .nav-item {
      min-height: 38px !important;
      padding: 6px 10px !important;
      border-radius: 10px !important;
    }

    body.is-authenticated #appMain,
    body.visual-modern.is-authenticated #appMain {
      width: auto !important;
      max-width: none !important;
      min-width: 0 !important;
      margin-left: var(--preview-sidebar-width) !important;
      padding: var(--screen-edge-gap) !important;
      box-sizing: border-box !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 > * {
      max-width: 100% !important;
      box-sizing: border-box !important;
    }

    body.is-authenticated .module.active .module-head.module-hero,
    body.visual-modern.is-authenticated .module.active .module-head.module-hero {
      width: 100% !important;
      max-width: 100% !important;
      grid-template-columns: minmax(0, 1fr) minmax(260px, 390px) !important;
      gap: 12px !important;
      padding: 18px 22px !important;
      overflow: hidden !important;
    }

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

    body.is-authenticated .module.active .module-hero-content p,
    body.visual-modern.is-authenticated .module.active .module-hero-content p {
      height: auto !important;
      max-width: 100% !important;
      white-space: normal !important;
    }

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

    body.is-authenticated .module.active .module-hero-actions button,
    body.visual-modern.is-authenticated .module.active .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;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
    }

    body.is-authenticated .table-wrap,
    body.visual-modern.is-authenticated .table-wrap {
      max-width: 100% !important;
      overflow-x: auto !important;
    }
  }

  @media (max-width: 980px) {
    body.is-authenticated #appMain,
    body.visual-modern.is-authenticated #appMain {
      padding-inline: clamp(12px, 4vw, 1cm) !important;
      box-sizing: border-box !important;
    }
  }
}

/* Libro mensual de asistencia: vista tipo planilla, julio 2026. */
body.is-authenticated #module-asistencia .module-head.module-hero {
  min-height: 76px !important;
  padding: 14px 18px !important;
}
body.is-authenticated #module-asistencia .attendance-panel {
  background: #fff !important;
  border: 1px solid #d9e7ec !important;
  border-left: 4px solid #18aaa5 !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(32, 69, 85, .07) !important;
}
body.is-authenticated #module-asistencia .attendance-controls {
  display: grid !important;
  grid-template-columns: minmax(150px, .8fr) 110px 140px minmax(220px, 1.25fr) 92px repeat(4, auto) !important;
  align-items: end !important;
}
body.is-authenticated #module-asistencia .attendance-search-label { min-width: 220px; }
body.is-authenticated #module-asistencia .attendance-controls label {
  color: #294653 !important;
  font-size: .69rem !important;
  gap: 4px !important;
}
body.is-authenticated #module-asistencia .attendance-controls input,
body.is-authenticated #module-asistencia .attendance-controls select {
  min-height: 36px !important;
  border-color: #d8e4e9 !important;
  background: #fff !important;
  font-size: .76rem !important;
}
body.is-authenticated #module-asistencia .attendance-kpis {
  display: flex !important;
  flex-wrap: wrap !important;
}
body.is-authenticated #module-asistencia .attendance-kpis article {
  min-width: 125px !important;
  flex: 1 1 125px !important;
  border-radius: 8px !important;
  background: #f7fafb !important;
}
body.is-authenticated #module-asistencia .attendance-card {
  border: 1px solid #dce9ed !important;
  border-left: 4px solid #18aaa5 !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(32, 69, 85, .08) !important;
}
body.is-authenticated #module-asistencia .attendance-card h3 {
  display: flex !important;
  align-items: baseline !important;
  gap: 10px !important;
  color: #203f4c !important;
  font-size: 1rem !important;
}
body.is-authenticated #module-asistencia .attendance-card h3 small {
  color: #6f858e !important;
  font-size: .68rem !important;
  font-weight: 500 !important;
}
body.is-authenticated #module-asistencia .attendance-grid {
  grid-template-columns: minmax(190px, 230px) repeat(var(--days, 31), 31px) 52px 48px 55px !important;
  border: 1px solid #dce8ec !important;
  border-radius: 8px !important;
  background: #fff !important;
  max-height: 58vh !important;
}
body.is-authenticated #module-asistencia .att-cell {
  min-height: 38px !important;
  border-right: 1px solid #e5edef !important;
  border-bottom: 1px solid #e5edef !important;
  background: #fff !important;
}
body.is-authenticated #module-asistencia .att-cell.head {
  min-height: 34px !important;
  background: #edf7f8 !important;
  color: #244753 !important;
  font-weight: 700 !important;
}
body.is-authenticated #module-asistencia .att-cell.name {
  min-width: 190px !important;
  padding: 5px 10px !important;
  color: #344f5a !important;
  font-size: .69rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.is-authenticated #module-asistencia .att-cell.weekend { background: #fff9e8 !important; }
body.is-authenticated #module-asistencia .att-cell.present { background: #f2f8fd !important; }
body.is-authenticated #module-asistencia .att-toggle {
  width: 18px !important;
  min-height: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  border: 1px solid #aebdc4 !important;
  border-radius: 2px !important;
  background: #fff !important;
  color: #fff !important;
  font-size: .67rem !important;
}
body.is-authenticated #module-asistencia .att-toggle.status-P {
  border-color: #4c86bd !important;
  background: #4c86bd !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18) !important;
}
body.is-authenticated #module-asistencia .att-toggle:not(:disabled):hover {
  border-color: #18aaa5 !important;
  transform: scale(1.08);
}
body.is-authenticated #module-asistencia .att-cell.total { background: #fbfdfe !important; }
body.is-authenticated #module-asistencia .present-total b { color: #315d72 !important; }
body.is-authenticated #module-asistencia .absent-total b { color: #b04d52 !important; }
body.is-authenticated #module-asistencia .percent-total b { color: #274a58 !important; }
body.is-authenticated #module-asistencia .day-lock {
  position: absolute !important;
  inset: auto 2px 1px !important;
  min-height: 11px !important;
  opacity: 0 !important;
  font-size: .45rem !important;
}
body.is-authenticated #module-asistencia .day-head:hover .day-lock,
body.is-authenticated #module-asistencia .day-lock:focus { opacity: 1 !important; }
@media (max-width: 1450px) {
  body.is-authenticated #module-asistencia .attendance-controls {
    grid-template-columns: repeat(5, minmax(120px, 1fr)) !important;
  }
}
@media (max-width: 800px) {
  body.is-authenticated #module-asistencia .attendance-controls { grid-template-columns: 1fr 1fr !important; }
  body.is-authenticated #module-asistencia .attendance-search-label { min-width: 0; grid-column: 1 / -1; }
  body.is-authenticated #module-asistencia .attendance-grid {
    grid-template-columns: 170px repeat(var(--days, 31), 30px) 48px 46px 52px !important;
  }
}
/* Controles masivos y selección del libro de asistencia. */
body.is-authenticated #module-asistencia .att-select-all,
body.is-authenticated #module-asistencia .att-student-select {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}
body.is-authenticated #module-asistencia .att-select-all input,
body.is-authenticated #module-asistencia .att-student-select input {
  width: 15px !important;
  height: 15px !important;
  min-height: 15px !important;
  flex: 0 0 15px;
  accent-color: #168f91;
}
body.is-authenticated #module-asistencia .att-student-select span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.is-authenticated #module-asistencia .att-toggle.status-A {
  color: #fff !important;
  border-color: #d9545c !important;
  background: #d9545c !important;
  font-size: .62rem !important;
  font-weight: 800 !important;
}
body.is-authenticated #module-asistencia .att-cell.absent { background: #fff3f3 !important; }
body.is-authenticated #module-asistencia .att-cell.selected-day {
  box-shadow: inset 2px 0 0 rgba(20, 164, 164, .28), inset -2px 0 0 rgba(20, 164, 164, .28);
}
body.is-authenticated #module-asistencia .day-head.selected-day { background: #d9f4f2 !important; }
body.is-authenticated #module-asistencia .attendance-live-kpis .kpi-present b { color: #17804b !important; }
body.is-authenticated #module-asistencia .attendance-live-kpis .kpi-absent b { color: #c33f49 !important; }
body.is-authenticated #module-asistencia #attAllAbsent { background: #fff1f2 !important; color: #b4232d !important; border-color: #fecdd3 !important; }
body.is-authenticated #module-asistencia #attInvert { color: #315d72 !important; border-color: #cbdde5 !important; }
@media (min-width: 1451px) {
  body.is-authenticated #module-asistencia .attendance-controls {
    grid-template-columns: minmax(145px,.8fr) 100px 125px minmax(210px,1.2fr) 78px repeat(6,auto) !important;
  }
}
/* Identidad institucional en acceso: insignia escolar y marca Educadmaule. */
body:not(.is-authenticated) .login-panel {
  position: relative !important;
  overflow: hidden !important;
  padding-bottom: 70px !important;
}
body:not(.is-authenticated) .login-panel > *:not(.login-platform-watermark) {
  position: relative;
  z-index: 2;
}
body:not(.is-authenticated) .login-badge {
  width: 112px !important;
  height: 126px !important;
  padding: 4px !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 12px 30px rgba(18,52,86,.16) !important;
}
body:not(.is-authenticated) .login-badge img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}
body:not(.is-authenticated) .login-panel h1 {
  max-width: 100% !important;
  color: #0b4b87 !important;
  font-size: clamp(1.55rem, 4vw, 2rem) !important;
  line-height: 1.12 !important;
  text-align: center !important;
}
body:not(.is-authenticated) .login-panel > div:nth-of-type(2) p {
  color: #60758a !important;
}
.login-platform-watermark {
  position: absolute !important;
  z-index: 0 !important;
  right: 18px !important;
  bottom: -22px !important;
  width: 174px !important;
  height: 112px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  opacity: .075 !important;
  pointer-events: none !important;
  user-select: none !important;
  filter: saturate(.75) !important;
}
.login-platform-watermark img {
  width: 104px !important;
  height: 104px !important;
  object-fit: contain !important;
}
.login-platform-watermark span {
  display: none !important;
}
@media (max-width: 600px) {
  body:not(.is-authenticated) .login-badge { width: 88px !important; height: 100px !important; }
  body:not(.is-authenticated) .login-panel { padding-bottom: 58px !important; }
  .login-platform-watermark { width: 132px !important; height: 92px !important; right: 8px !important; }
  .login-platform-watermark img { width: 88px !important; height: 88px !important; }
}
/* Selector visible de función en el acceso institucional. */
body:not(.is-authenticated) .login-form label:has(#loginRole) {
  display: grid !important;
}
body:not(.is-authenticated) #loginRole {
  width: 100% !important;
  min-height: 44px !important;
  border: 1px solid #b9cee6 !important;
  border-radius: 10px !important;
  background: #edf4ff !important;
  color: #173958 !important;
}