:root {
  --bg: #F7F6F9;
  --panel: #FFFFFF;
  --panel-soft: #F1EDF5;
  --panel-gold: #FBF7EA;
  --ink: #000000;
  --muted: #56505C;
  --line: #DED8E6;
  --brand: #5A2D82;
  --brand-2: #C9A646;
  --secondary: #1C5B3C;
  --accent: #5A2D82;
  --gold: #C9A646;
  --ok: #1C5B3C;
  --warn: #C9A646;
  --bad: #8B2040;
  --focus: rgba(90, 45, 130, .20);
  --shadow: 0 18px 45px rgba(31, 18, 45, .10);
  --shadow-soft: 0 10px 28px rgba(31, 18, 45, .07);
}

* { box-sizing: border-box; }
.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;
}
body {
  margin: 0;
  background:
    linear-gradient(180deg, #FFFFFF 0, var(--bg) 230px);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a {
  color: var(--brand);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { color: #432061; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 560px) 1fr;
}
.login-panel {
  padding: clamp(24px, 5vw, 72px);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}
.login-side {
  color: white;
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(135deg, rgba(90, 45, 130, .92), rgba(28, 91, 60, .78)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='700' viewBox='0 0 900 700'%3E%3Crect width='900' height='700' fill='%231C5B3C'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.18' stroke-width='2'%3E%3Cpath d='M90 80h720v120H90zM140 250h260v120H140zM500 250h260v120H500zM140 420h620v120H140z'/%3E%3Cpath d='M210 140h480M210 310h120M570 310h120M230 480h440'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-side.has-video {
  justify-content: center;
  align-items: center;
  padding: clamp(18px, 4vw, 56px);
}
.login-video-wrap {
  width: min(100%, 1120px);
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.login-video-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.login-side h2 { font-size: clamp(34px, 6vw, 72px); line-height: .96; margin: 8px 0 16px; max-width: 720px; }
.login-side p { max-width: 590px; font-size: 18px; color: rgba(255,255,255,.86); }
.login-tutorial-heading {
  width: min(100%, 1120px);
  margin-bottom: 20px;
  text-align: center;
}
.login-side .login-tutorial-heading h2 {
  max-width: none;
  margin: 0;
  font-size: clamp(22px, 2.3vw, 34px);
  line-height: 1.2;
}
.login-side .login-tutorial-heading p {
  max-width: none;
  margin: 0 0 8px;
  font-size: 14px;
}
.login-brand { display: grid; gap: 18px; align-items: start; }
.login-brand img {
  width: min(100%, 420px);
  height: auto;
  display: block;
}
.login-intro-title {
  width: min(100%, 420px);
  margin: 0;
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
}
.evaluation-closed-card {
  width: min(100%, 420px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid #BFE3CC;
  border-radius: 8px;
  background: #EFFAF3;
  color: #123D29;
  box-shadow: var(--shadow-soft);
}
.evaluation-closed-card .closed-mark {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #CFF7DE;
  color: #0B7A48;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}
.evaluation-closed-card h2 {
  margin: 0 0 6px;
  color: #123D29;
  font-size: 18px;
  line-height: 1.2;
}
.evaluation-closed-card p {
  margin: 0;
  color: #24533C;
  font-size: 14px;
  line-height: 1.45;
}
.evaluation-closed-card .closed-note {
  margin-top: 8px;
  font-weight: 750;
}
.login-panel h1 { margin: 0; font-size: clamp(32px, 4vw, 50px); line-height: 1.05; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); font-weight: 800; }
.login-side .eyebrow { color: rgba(255,255,255,.72); }
.lead { color: var(--muted); font-size: 17px; line-height: 1.55; margin: 0; }
.login-form {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
}
.forgot-link { color: var(--brand); font-weight: 800; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.forgot-link:hover { color: #432061; }
.support-widget-login {
  width: min(100%, 420px);
  text-align: center;
}
.support-widget-login .support-fab {
  width: auto;
  justify-content: center;
  position: static;
  box-shadow: none;
  margin: 0 auto;
  padding: 8px 12px;
  font-size: 13px;
}
.support-widget-student .support-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  box-shadow: 0 16px 36px rgba(31,18,45,.22);
}
.support-fab {
  border: 1px solid rgba(90,45,130,.26);
  border-radius: 999px;
  background: white;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  font-weight: 900;
  cursor: pointer;
}
.support-fab:hover {
  border-color: var(--brand);
  background: #F6F0FA;
}
.support-fab span:first-child {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
  font-size: 15px;
  line-height: 1;
}
.support-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: end;
  padding: 18px;
  background: rgba(20, 14, 28, .26);
}
.support-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.support-toggle:checked ~ .support-modal {
  display: grid;
}
.support-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.support-card {
  width: min(100%, 380px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 80px rgba(13,20,32,.28);
  padding: 20px;
  position: relative;
  z-index: 1;
}
.support-card h2 {
  margin: 0 36px 4px 0;
  color: var(--brand);
  font-size: 22px;
  line-height: 1.2;
}
.support-help {
  margin: 0 0 14px;
  color: var(--muted);
}
.support-card form {
  display: grid;
  gap: 12px;
}
.support-card textarea {
  resize: vertical;
  min-height: 112px;
}
.support-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.support-feedback {
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 750;
}
.support-feedback.is-success {
  background: #E9F7EF;
  color: #155C3A;
  border: 1px solid #BEE6CF;
}
.support-feedback.is-error {
  background: #FCECEF;
  color: #8B2040;
  border: 1px solid #F1C3CD;
}
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--brand);
  box-shadow: none;
}
input:hover, select:hover, textarea:hover { border-color: #C8BED5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
textarea { min-height: 96px; resize: vertical; }
.primary, .ghost, .small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 800;
  text-decoration: none;
  line-height: 1.2;
  min-height: 42px;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.primary { background: var(--brand); color: white; box-shadow: 0 8px 18px rgba(90,45,130,.18); }
.primary:hover { background: #432061; color: white; transform: translateY(-1px); }
.primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.ghost { background: white; color: var(--brand); border-color: #CBBED8; }
.ghost:hover { background: var(--panel-soft); color: #432061; border-color: var(--brand); }
.danger { color: var(--bad); }
.small-btn { background: var(--panel-soft); color: var(--brand); padding: 8px 10px; }
.inline-action { display: inline-flex; align-items: center; width: fit-content; margin-bottom: 12px; }
.demo-users, .mini-grid, .top-actions, .toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.demo-users button, .mini-grid span {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
}
.mini-grid span { background: rgba(255,255,255,.13); color: white; border-color: rgba(255,255,255,.22); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 284px 1fr; }
.sidebar {
  background: white;
  border-right: 1px solid var(--line);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
nav { display: grid; gap: 7px; }
.nav-btn {
  display: block;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 800;
  text-decoration: none;
}
.nav-btn.active, .nav-btn:hover { background: var(--panel-soft); color: var(--brand); }
#reset-demo { margin-top: auto; }
.main-shell { min-width: 0; }
.topbar {
  min-height: 86px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 248, .88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 26px;
}
.topbar h2 { margin: 4px 0 0; font-size: 25px; }
#content { padding: 26px; display: grid; gap: 20px; }
.status-chip, .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--panel-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 12px;
}
.tag.warn { background: var(--panel-gold); color: #765C12; border: 1px solid #E6D49A; }
.tag.ok { background: #e6f5ef; color: var(--ok); }
.tag.bad { background: #f8e7e7; color: var(--bad); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.card h3 { margin: 0 0 8px; }
.card p { color: var(--muted); line-height: 1.45; }
.metric { display: grid; gap: 4px; }
.metric strong { font-size: 30px; color: var(--brand); }
.progress {
  height: 10px;
  border-radius: 999px;
  background: #EEE9F4;
  overflow: hidden;
}
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--gold)); }
.course-card { display: grid; gap: 14px; }
.course-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.teacher-row, .period-row, .audit-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #3C2A4D; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: #F3EEF7; border-bottom-color: #D4C7DF; }
tbody tr:hover td { background: #FCFAF3; }
td a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; font-weight: 700; }
td a:hover { color: #432061; }
td a.profile-link { text-decoration: none; }
td a.profile-link:hover { text-decoration: none; color: #432061; }
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: white;
}
.rubric-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 420px);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.rubric-item.is-missing {
  border: 1px solid #F3C4CC;
  border-radius: 8px;
  background: #FDF5F5;
  padding: 14px;
}
.score-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.rubric-category { margin: 24px 0 8px; color: var(--brand); }
.criterion-description { text-align: justify; line-height: 1.5; margin: 0; }
.score-options label { position: relative; cursor: pointer; }
.score-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.score-options input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 3px; }
.score-options span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.score-options input:checked + span { border-color: var(--brand); background: var(--panel-soft); color: var(--brand); box-shadow: inset 0 -3px 0 var(--gold); }
.chart-bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 60px; gap: 10px; align-items: center; }
.bar-track { height: 18px; border-radius: 999px; background: #EEE9F4; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--brand); }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.filters-wide { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.import-box {
  border: 1px dashed #C7B6D6;
  background: #FCFAFE;
  border-radius: 8px;
  padding: 18px;
}
.import-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.file-picker input { display: none; }
.file-picker span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--brand);
  color: white;
  font-weight: 800;
}
.preview-meta { margin-bottom: 14px; }
.form-alert {
  margin-bottom: 14px;
  border-radius: 8px;
  border: 1px solid #F3C4CC;
  background: #FDE8EC;
  color: var(--bad);
  padding: 12px 14px;
  font-weight: 700;
}
.form-alert.success,
.alert-success {
  background: #E8F5EE;
  color: var(--ok);
  border-color: #BFE0CC;
}
.form-alert.warning {
  background: #FFF8E0;
  color: #765C12;
  border-color: #E6D49A;
}
.form-alert.info {
  background: var(--panel-soft);
  color: var(--brand);
  border-color: #D4C7DF;
}
.cell-input {
  min-width: 140px;
  border: 1px solid var(--line);
  background: #FCFDFC;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--ink);
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 20;
}
.hidden { display: none !important; }

@media (max-width: 980px) {
  .login-shell, .app-shell { grid-template-columns: 1fr; }
  .login-side { min-height: 360px; }
  .sidebar { position: static; height: auto; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .filters { grid-template-columns: 1fr; }
  .rubric-item { grid-template-columns: 1fr; }
  .score-options { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .score-options span { padding: 6px 2px; font-size: 10px; min-height: 64px; overflow-wrap: anywhere; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .teacher-row, .period-row, .audit-row { grid-template-columns: 1fr; }
  table { min-width: 720px; }
}

/* ==== Capa PHP Vanilla (Experto 1) ==== */
.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.app-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  padding: 18px clamp(20px, 4vw, 48px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,.02), inset 0 -3px 0 var(--gold);
}
.app-header .brand { display: flex; align-items: center; gap: 12px; }
.app-header .brand h1 { font-size: 16px; margin: 0; color: var(--ink); }
.app-header .eyebrow { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.app-header .seal {
  width: 42px; height: 42px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #432061); color: white; font-weight: 800; letter-spacing: .04em;
}
.app-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.app-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  color: #2F2538;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.app-nav a:hover { background: var(--panel-soft); color: var(--brand); box-shadow: inset 0 -2px 0 var(--gold); }
.env-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--panel-soft); color: var(--brand);
  font-weight: 700; font-size: 12px;
}
.env-badge .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--gold); }
.app-main { flex: 1; padding: clamp(20px, 3vw, 40px); }
.app-footer {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 48px);
  background: var(--panel); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.app-footer .sep { color: var(--line); margin: 0 6px; }
.app-footer a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }

.hero { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: clamp(20px, 3vw, 36px); margin-bottom: 28px; box-shadow: var(--shadow-soft); }
.hero h2 { margin-top: 0; }
.hero .lead { color: var(--muted); max-width: 820px; }
.env-grid {
  display: grid; gap: 16px; margin-top: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.env-card { background: var(--panel-soft); border-radius: 8px; padding: 16px 18px; }
.env-card h3 { margin-top: 0; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.env-card ul { list-style: none; padding: 0; margin: 0; }
.env-card li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.env-card li:last-child { border-bottom: 0; }
.env-card li span { color: var(--muted); }
.status { margin: 0 0 10px; font-weight: 700; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.error-pre { background: #FDE8EC; color: var(--bad); padding: 8px 10px; border-radius: 6px; font-size: 12px; overflow: auto; }
.link-list li a { color: var(--brand-2); text-decoration: none; font-weight: 600; }
.link-list li a:hover { text-decoration: underline; }

.modulos h2 { margin-bottom: 4px; }
.muted { color: var(--muted); }
.modulo-grid {
  display: grid; gap: 14px; margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.modulo-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px 18px; transition: border-color .15s, transform .15s;
}
.modulo-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.modulo-card h3 { margin: 0 0 6px; color: var(--brand); }
.modulo-card p { color: var(--muted); margin: 0 0 10px; font-size: 14px; }
.modulo-card .cta { color: #765C12; font-weight: 800; font-size: 13px; }

.modulo-detalle { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: clamp(20px, 3vw, 32px); }
.modulo-detalle .back-link { color: var(--brand-2); text-decoration: none; font-size: 13px; }
.modulo-detalle h2 { margin: 10px 0 4px; }
.placeholder { margin-top: 22px; padding: 18px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel-soft); }
.placeholder h3 { margin-top: 0; color: var(--muted); }
.empty-state { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; text-align: center; }
.empty-state h1 { margin-top: 0; }

/* ===================== Auth & roles ===================== */
.auth-body { background: var(--bg); }
.alert {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 0;
  border: 1px solid transparent;
}
.alert-error   { background: #FDE8EC; color: #8B2040; border-color: #F3C4CC; }
.alert-success { background: #E8F5EE; color: #1C5B3C; border-color: #BFE0CC; }
.recovery-success {
  display: grid;
  gap: 10px;
  border: 1px solid #BFE0CC;
  border-radius: 8px;
  background: #E8F5EE;
  color: #1C5B3C;
  padding: 16px;
}
.recovery-success strong { font-size: 18px; }
.recovery-success p { margin: 0; }
.recovery-success small { color: #35684D; font-weight: 700; }
.recovery-success .primary { margin-top: 4px; width: fit-content; }
.demo-users {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel-soft);
}
.demo-users ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.demo-users code { background: white; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); }

.user-bar { display: flex; align-items: center; gap: 12px; }
.user-info { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.user-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--brand-2);
  border: 1px solid var(--line);
}
.role-badge.role-student       { background: #EDF0F5; color: #4A2570; border-color: #D5D5E8; }
.role-badge.role-ute           { background: #F5ECD7; color: #8B6914; border-color: #E8D8A8; }
.role-badge.role-admin_general { background: #EEE5F2; color: #4A2570; border-color: #D5C8E0; }

.logout-form { margin: 0; }
.link-button {
  background: white;
  border: 1px solid #CBBED8;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 700;
}
.link-button:hover { background: var(--panel-soft); }

.back-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 12px;
  color: var(--brand);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reportes-index > h2,
.reportes-dashboard > h2,
.import-page > h2,
.padrones-page > h2,
.modulos > h2 {
  margin: 0 0 6px;
  color: #251432;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.12;
}

.reportes-index > .lead,
.reportes-dashboard > .lead,
.import-page > .lead,
.padrones-page > .lead {
  max-width: 980px;
  margin-bottom: 20px;
}

.filters,
.filters-card {
  border-top: 4px solid var(--gold);
}

.filter-actions,
.form-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.report-card {
  position: relative;
  border-top: 4px solid var(--brand);
}

.report-card h3 {
  color: #251432;
}

.report-card .metric-line strong {
  color: var(--brand);
}

.report-card .primary::after {
  content: "xlsx";
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: white;
  font-size: 11px;
  text-transform: uppercase;
}

.data-table {
  min-width: 720px;
}

.data-table td:first-child,
.data-table th:first-child {
  border-left: 3px solid transparent;
}

.data-table tbody tr:hover td:first-child {
  border-left-color: var(--gold);
}

.metric-row > div,
.summary-card {
  border-top: 3px solid var(--gold);
}

.distribution-list li,
.evo-list li {
  border: 1px solid var(--line);
}

.inline-check input {
  width: auto;
}

.check,
.inline-check {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
}

.check input,
.inline-check input {
  flex: 0 0 auto;
}

.periodos-modulo .form-grid {
  display: grid;
  gap: 14px;
}

.periodos-modulo .check {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FCFAFE;
}

.periodos-modulo .card {
  overflow-x: auto;
}

.import-page .preview-table td:last-child {
  white-space: nowrap;
}

.filters .form-actions {
  height: 100%;
}

.action-line {
  margin: 12px 0 20px;
}

.progress-top {
  margin-top: 8px;
}

.progress-spaced {
  margin-bottom: 6px;
}

.progress-spaced-sm {
  margin-bottom: 4px;
}

.progress-block {
  margin: 6px 0;
}

.progress-cell {
  min-width: 180px;
}

.progress-cell-wide {
  min-width: 200px;
}

.meta-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.data-table tr.is-selected td {
  background: #FCFAF3;
}

.score-total {
  display: inline-block;
  margin-left: 8px;
  color: var(--brand);
}

.text-right {
  text-align: right;
}

.subhead {
  margin: 18px 0 8px;
  color: #251432;
}

.comment-box {
  margin: 0;
  padding: 12px 14px;
  background: var(--panel-soft);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
}

.field-spaced {
  margin-top: 14px;
}

.toolbar-spaced {
  margin-top: 14px;
}

.toolbar-spaced-lg {
  margin-top: 18px;
}

.block-spaced {
  margin-bottom: 18px;
}

.block-spaced-sm {
  margin-bottom: 14px;
}

.tag-inline {
  margin-left: 8px;
}

@media (max-width: 360px) {
  .score-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .score-options span { font-size: 12px; min-height: 52px; }
}
@media (max-width: 780px) {
  .app-header { grid-template-columns: 1fr; }
  .app-nav ul { justify-content: flex-start; }
  .user-bar { flex-direction: column; align-items: flex-start; }
  .user-info { align-items: flex-start; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-panel {
    justify-content: flex-start;
    padding: 22px 18px;
    gap: 16px;
  }
  .login-brand img { width: min(100%, 300px); }
  .lead { font-size: 15px; }
  .login-side { display: none; }
  .login-side.has-video {
    display: flex;
    min-height: auto;
    padding: 0 14px 24px;
  }
  .login-side.has-video .login-video-wrap {
    width: 100%;
    box-shadow: 0 12px 32px rgba(0,0,0,.22);
  }
  .app-main { padding: 18px 14px 28px; }
  .app-nav a { padding: 8px 10px; }
  .primary, .ghost, .small-btn { width: 100%; }
  .toolbar .primary,
  .toolbar .ghost,
  .import-actions .primary,
  .import-actions .ghost,
  .filter-actions .primary,
  .filter-actions .ghost,
  .form-actions .primary,
  .form-actions .ghost {
    width: auto;
  }
  .support-widget-student .support-fab {
    right: 14px;
    bottom: 14px;
  }
  .support-modal {
    place-items: end center;
    padding: 14px;
  }
  .support-card {
    width: 100%;
  }
  .reportes-dashboard .metric-row { grid-template-columns: 1fr; }
  .score-total { margin-left: 0; margin-top: 8px; }
  .tag-inline { margin-left: 0; margin-top: 6px; }
}
