/* Campus Bio-Optic — estética roja corporativa (seda roja, fondos claros, Arial/Calibri) */
:root {
  --red: #E0081A; --deep: #8E0A16; --red-ink: #C10716;
  --ink: #1E1E1E; --muted: #5F5F5F; --soft: #8A8A8A;
  --bg: #F5F5F6; --card: #FFFFFF; --sunk: #F4F4F4; --line: #E3E3E3; --tint: #FDECEE; --track: #ECECEC;
  --ok: #2E9E4F; --ok-bg: #E8F5EC; --warn: #B7791F; --warn-bg: #FFF6E5; --bad: #B42318; --bad-bg: #FDECEC;
  --info: #3159B8; --info-bg: #EAF0FC;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.14);
  --radius: 14px; --radius-sm: 9px;
  --font: "Segoe UI", Calibri, system-ui, -apple-system, Arial, sans-serif;
  --display: Arial, "Helvetica Neue", "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #FF3347; --deep: #8E0A16; --red-ink: #FF5A6A;
    --ink: #F1F1F3; --muted: #B4B4BA; --soft: #8C8C94;
    --bg: #121214; --card: #1C1C1F; --sunk: #242428; --line: #2F2F35; --tint: #3A1519; --track: #2F2F35;
    --ok: #4CC273; --ok-bg: #16301F; --warn: #E8A93B; --warn-bg: #33270F; --bad: #FF6B5E; --bad-bg: #3A1714;
    --info: #7FA2F2; --info-bg: #1A2440;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --red: #FF3347; --red-ink: #FF5A6A; --ink: #F1F1F3; --muted: #B4B4BA; --soft: #8C8C94;
  --bg: #121214; --card: #1C1C1F; --sunk: #242428; --line: #2F2F35; --tint: #3A1519; --track: #2F2F35;
  --ok: #4CC273; --ok-bg: #16301F; --warn: #E8A93B; --warn-bg: #33270F; --bad: #FF6B5E; --bad-bg: #3A1714;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .7em; }
a { color: var(--red-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--sunk); padding: 1px 5px; border-radius: 5px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; }
.ic.big { width: 40px; height: 40px; stroke-width: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.bad { color: var(--bad) !important; }
.warn { color: var(--warn); }
.right { text-align: right; }
.pre { white-space: pre-line; }
.pad { padding: 18px 20px; margin: 0; }
.mt { margin-top: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap, .wrap { flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.center { justify-content: center; }
.stack { display: grid; gap: 14px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--red-ink); margin-bottom: 8px; }
.eyebrow .ic { width: 15px; height: 15px; }
.eyebrow.light { color: rgba(255,255,255,.85); }
.lede { font-size: 16px; color: var(--muted); max-width: 70ch; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.boot { min-height: 100vh; display: grid; place-items: center; opacity: .5; }

/* ---------- Botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid transparent;
  font: 600 14px/1.2 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; background: var(--sunk); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--deep); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--soft); background: var(--sunk); }
.btn.white { background: #fff; color: var(--deep); }
.btn.white:hover { background: #ffe9eb; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--bad); border-color: transparent; }
.btn.danger-ghost:hover { background: var(--bad-bg); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn.lg { min-height: 48px; padding: 12px 24px; font-size: 16px; }
.btn.pulse { box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 25%, transparent); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--sunk); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover:not(:disabled) { color: var(--bad); background: var(--bad-bg); }
.pill { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 5px 12px; font: 600 13px var(--font); cursor: pointer; }
.pill:hover { border-color: var(--red); color: var(--red-ink); }

label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; cursor: pointer; }
label.check input { margin-top: 3px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; color: var(--muted); }
input, select, textarea { font: 15px var(--font); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px; width: 100%; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--red); flex: none; padding: 0; }
input[type=file] { padding: 7px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
input[readonly] { background: var(--sunk); color: var(--muted); }
.w-xs { width: 76px; } .w-sm { width: 130px; }
.help { font-weight: 400; font-size: 13px; color: var(--muted); }
.form-error { color: var(--bad); font-size: 14px; min-height: 1em; margin: 8px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid.inner { gap: 14px 20px; }
.span2 { grid-column: 1 / -1; }
.checklist { display: grid; gap: 8px; max-height: 300px; overflow: auto; padding: 4px 2px; }
.checklist.cols { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); max-height: none; }

/* ---------- Ingreso ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--deep) url('/img/silk_wide.jpg') center/cover; position: relative; display: flex; align-items: flex-end; padding: 56px; color: #fff; }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(60,0,8,0) 30%, rgba(60,0,8,.65)); }
.login-art-text { position: relative; z-index: 1; max-width: 520px; }
.login-art h1 { font-size: clamp(28px, 3.4vw, 44px); color: #fff; }
.login-art p { font-size: 17px; opacity: .92; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; background: var(--card); }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 6px; }
.login-logo { width: 200px; margin-bottom: 26px; }
.login-card h2 { font-size: 24px; }
.gbtn { min-height: 44px; margin: 16px 0 4px; }
.login-foot { margin-top: 40px; color: var(--soft); font-size: 12px; text-align: center; }
.devlogin { margin-top: 16px; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.devlogin summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.devlogin form { margin-top: 12px; }

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 64px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--red); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand img { height: 34px; }
.brand-tag { font: 700 11px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--red-ink); border-left: 1px solid var(--line); padding-left: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img, :root:not([data-theme="light"]) .login-logo { background: #fff; border-radius: 8px; padding: 4px 8px; } }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; text-decoration: none; }
.mainnav a:hover { background: var(--sunk); color: var(--ink); }
.mainnav a.active { background: var(--tint); color: var(--red-ink); }
.top-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font: 700 10px/17px var(--font); text-align: center; padding: 0 4px; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: var(--tint); color: var(--red-ink); font-weight: 700; cursor: pointer; overflow: hidden; padding: 0; display: grid; place-items: center; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.popover { position: absolute; right: 0; top: 50px; width: 290px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 30; overflow: hidden; }
.popover.notif { width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; }
.pop-head { display: grid; gap: 2px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border: 0; background: none; color: var(--ink); font: 15px var(--font); cursor: pointer; text-align: left; }
.pop-item:hover { background: var(--sunk); }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li a { display: grid; gap: 3px; padding: 12px 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); font-size: 14px; }
.notif-list li a:hover { background: var(--sunk); }
.notif-list li.unread a { background: var(--tint); }
.nbody { color: var(--muted); font-size: 13px; }

/* ---------- Página ---------- */
main { outline: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.page.narrow { max-width: 860px; }
.page.wide { max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2:first-child { margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.two-col > .card { margin: 0; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--ink); margin: 0 0 16px; font-size: 14px; text-decoration: none !important; }
.note .ic { color: var(--info); margin-top: 1px; }
.note.warn { background: var(--warn-bg); }
.note.warn .ic { color: var(--warn); }
.note ul { margin: 4px 0 0; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; color: var(--red); margin-bottom: 8px; }
.empty h3 { color: var(--ink); font-size: 18px; }
.empty .btn { margin-top: 8px; }
.loading { display: flex; justify-content: center; gap: 6px; padding: 64px; }
.loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: blink 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* ---------- Chips, barras, anillos ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px; font: 700 12px/1.4 var(--font); background: var(--sunk); color: var(--muted); white-space: nowrap; }
.chip .ic { width: 13px; height: 13px; stroke-width: 2.5; }
.chip.available { background: var(--info-bg); color: var(--info); }
.chip.progress { background: var(--warn-bg); color: var(--warn); }
.chip.quiz { background: var(--tint); color: var(--red-ink); }
.chip.done { background: var(--ok-bg); color: var(--ok); }
.chip.blocked { background: var(--bad-bg); color: var(--bad); }
.chip.locked { background: var(--sunk); color: var(--soft); }
.chip.admin { background: var(--tint); color: var(--red-ink); }
.bar { height: 7px; background: var(--track); border-radius: 9px; overflow: hidden; flex: 1; min-width: 60px; }
.bar span { display: block; height: 100%; background: var(--red); border-radius: 9px; transition: width .3s; }
.bar.ok span { background: var(--ok); } .bar.warn span { background: var(--warn); } .bar.bad span { background: var(--bad); }
.prog { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ring { color: var(--red); flex: none; }
.ring text { font: 800 22px var(--display); fill: currentColor; }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--sunk); color: var(--muted); font-size: 12px; font-weight: 700; }

/* ---------- Mi campus ---------- */
.hero { position: relative; background: var(--deep) url('/img/silk_wide.jpg') center 40%/cover; color: #fff; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(60,0,8,.72), rgba(60,0,8,.15)); }
.hero > * { position: relative; z-index: 1; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 44px max(24px, calc((100vw - 1180px) / 2 + 24px)); }
.hero h1 { color: #fff; font-size: clamp(28px, 4vw, 40px); }
.hero p { max-width: 560px; font-size: 16px; opacity: .95; }
.hero .btn { margin-top: 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hero-ring { display: grid; justify-items: center; gap: 6px; color: #fff; background: rgba(255,255,255,.12); padding: 18px 22px; border-radius: 20px; backdrop-filter: blur(6px); }
.hero-ring .ring { color: #fff; }
.hero-ring .ring circle:first-child { stroke: rgba(255,255,255,.25); }
.hero-ring .ring text { font-size: 26px; }
.hero-ring span { font-size: 13px; font-weight: 600; letter-spacing: .04em; }
section.block { margin-top: 30px; }
.block-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.block-head h2 { margin: 0; font-size: 21px; }
.block-head p { margin: 0 0 0 6px; font-size: 14px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.ccard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.ccard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ccard-link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none !important; }
.ccard-cover { position: relative; height: 128px; background: var(--deep) url('/img/silk_mid.jpg') center/cover; display: flex; align-items: flex-end; justify-content: space-between; padding: 12px 14px; }
.ccard-cover.has-img { background-size: cover; background-position: center; }
.ccard-cover .chip { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.95); }
.ccard-cover .chip.done { color: var(--ok); } .ccard-cover .chip.quiz { color: var(--red); } .ccard-cover .chip.available { color: var(--info); } .ccard-cover .chip.progress { color: #8a5a10; }
.ccard-num { font: 800 44px/1 var(--display); color: rgba(255,255,255,.92); letter-spacing: -.02em; }
.ccard.is-locked .ccard-cover { filter: grayscale(.85) brightness(.85); }
.ccard.is-locked h3 { color: var(--muted); }
.ccard-body { padding: 16px 18px 6px; display: grid; gap: 8px; align-content: start; }
.ccard-body h3 { margin: 0; font-size: 17px; }
.ccard-body p { margin: 0; color: var(--muted); font-size: 14px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccard-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.ccard-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ccard-meta .ic { width: 15px; height: 15px; }
.ccard-foot { display: flex; gap: 8px; padding: 12px 18px 16px; flex-wrap: wrap; }
.blockers { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.blockers li { display: flex; gap: 6px; align-items: flex-start; }
.blockers .ic { width: 14px; height: 14px; margin-top: 3px; }
.done-line { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; font-size: 14px; }

/* ---------- Capacitación ---------- */
.course-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.course-head h1 { margin: 10px 0 8px; }
.course-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.steps { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li > a, .steps li.cert-step { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; color: var(--ink); text-decoration: none !important; }
.steps li > a:hover { background: var(--sunk); }
.steps li.active > a { background: var(--tint); }
.step-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); font: 700 13px var(--display); color: var(--muted); flex: none; background: var(--card); }
.step-dot .ic { width: 15px; height: 15px; }
.steps li.done .step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.active:not(.done) .step-dot { border-color: var(--red); color: var(--red); }
.steps li.quiz-step.ready .step-dot { background: var(--red); border-color: var(--red); color: #fff; }
.step-txt { display: grid; min-width: 0; font-size: 14px; }
.step-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.viewer { min-height: 420px; }
.viewer-head { margin-bottom: 16px; }
.viewer-head h2 { font-size: 22px; }
.viewer-locked { text-align: center; padding: 60px 20px; color: var(--muted); }
.frame { position: relative; width: 100%; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.frame.video { aspect-ratio: 16 / 9; }
.frame.pdf { height: min(78vh, 760px); background: var(--sunk); }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media { width: 100%; border-radius: var(--radius-sm); background: #000; display: block; max-height: 78vh; }
img.media { background: none; object-fit: contain; }
.viewer-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.linkcard { display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); flex-wrap: wrap; }
.linkcard > div { flex: 1; display: grid; min-width: 200px; word-break: break-all; }
.linkcard .ic.big { color: var(--red); }
.prose { font-size: 16px; line-height: 1.65; max-width: 72ch; }
.quiz-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 20px; }
.quiz-facts > div { background: var(--sunk); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 2px; text-align: center; }
.quiz-facts b { font: 800 26px/1.1 var(--display); color: var(--red-ink); }
.quiz-facts span { font-size: 12px; color: var(--muted); }
.quiz-facts.compact b { font-size: 20px; }
.attempts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.attempts a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none !important; font-size: 14px; flex-wrap: wrap; }
.attempts a:hover { background: var(--sunk); }
.attempts a > span:first-child { font-weight: 600; flex: 1; min-width: 120px; }
.score { font-weight: 700; font-size: 13px; }
.score.ok { color: var(--ok); } .score.bad { color: var(--bad); }

/* ---------- Evaluación ---------- */
.quiz-head { margin-bottom: 18px; }
.quiz-progress { position: sticky; top: 64px; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 10px 0; margin-bottom: 8px; }
.qp-inner { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.qp-inner .bar { max-width: 360px; }
.qsec { margin-top: 26px; }
.qsec-head { border-left: 4px solid var(--red); padding: 4px 0 4px 14px; margin-bottom: 14px; }
.qsec-head h2 { margin: 0; font-size: 21px; }
.qsec-head p { margin: 4px 0 0; }
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow); scroll-margin-top: 130px; }
.qcard.answered { border-left: 4px solid var(--ok); }
.q-top, .rv-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.q-num { font: 700 12px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--red-ink); }
.q-pts { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qcard h3, .rv h3 { font-size: 17px; font-weight: 600; font-family: var(--font); line-height: 1.4; }
.scenario { font-style: italic; color: var(--muted); background: var(--sunk); padding: 10px 14px; border-radius: var(--radius-sm); }
.hint { font-size: 13px; color: var(--muted); margin-top: -4px; }
.qimg { display: block; max-height: 420px; margin: 8px 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }
.qimg.sm { max-height: 240px; } .qimg.xs { max-height: 70px; margin: 0; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--soft); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sunk); font: 700 13px var(--display); color: var(--muted); flex: none; }
.opt input[type=checkbox] + .opt-mark { border-radius: 7px; }
.opt:has(input:checked) { border-color: var(--red); background: var(--tint); }
.opt:has(input:checked) .opt-mark { background: var(--red); color: #fff; }
.opt:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.opt-txt { flex: 1; }
.match { display: grid; gap: 8px; }
.match-row { display: grid; grid-template-columns: 1fr minmax(160px, 260px); gap: 12px; align-items: center; font-weight: 400; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.quiz-submit { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 26px; border-top: 4px solid var(--red); }
.quiz-submit p { margin: 4px 0 0; }

/* ---------- Resultado ---------- */
.result-hero { display: flex; align-items: center; gap: 28px; padding: 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); margin: 10px 0 16px; flex-wrap: wrap; }
.result-hero.pass { border-top: 5px solid var(--ok); }
.result-hero.pass .ring { color: var(--ok); }
.result-hero.fail { border-top: 5px solid var(--red); }
.result-hero > div:last-child { flex: 1; min-width: 240px; }
.result-hero h1 { margin: 6px 0 8px; font-size: 40px; }
.result-hero h1 small { font-size: 18px; color: var(--muted); font-weight: 600; }
.result-ring .ring text { font-size: 30px; }
.result-level { display: inline-block; font: 800 13px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--red-ink); }
.pass .result-level { color: var(--ok); }
.result-actions { margin: 4px 0 18px; }
.secbars { display: grid; gap: 14px; }
.secbar { display: grid; gap: 6px; font-size: 14px; }
.review { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rv { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.rv.ok { border-left-color: var(--ok); } .rv.partial { border-left-color: var(--warn); } .rv.wrong, .rv.blank { border-left-color: var(--bad); }
.rv-badge { display: inline-flex; align-items: center; gap: 5px; font: 700 12px var(--font); padding: 3px 10px 3px 7px; border-radius: 999px; }
.rv-badge .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.rv-badge.ok { background: var(--ok-bg); color: var(--ok); } .rv-badge.partial { background: var(--warn-bg); color: var(--warn); }
.rv-badge.wrong, .rv-badge.blank { background: var(--bad-bg); color: var(--bad); }
.q-pts.ok { color: var(--ok); font-weight: 700; } .q-pts.partial { color: var(--warn); font-weight: 700; } .q-pts.wrong, .q-pts.blank { color: var(--bad); font-weight: 700; }
.rv-opts { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.rv-opts li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.rv-opts li.picked { border-color: var(--soft); background: var(--sunk); }
.rv-opts li.correct { border-color: var(--ok); background: var(--ok-bg); }
.rv-opts li.wrong { border-color: var(--bad); background: var(--bad-bg); }
.rv-opts .opt-mark { width: 24px; height: 24px; font-size: 12px; }
.rv-opts li.correct .opt-mark { background: var(--ok); color: #fff; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.tag.ok { color: var(--ok); border-color: var(--ok); }
.rv-match { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 10px; }
.rv-match th, .rv-match td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.rv-match th { font-size: 12px; color: var(--muted); }
.rv-match td.ok { color: var(--ok); font-weight: 600; } .rv-match td.bad { color: var(--bad); font-weight: 600; }
.why { display: flex; gap: 10px; background: var(--sunk); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }
.why .ic { color: var(--red); margin-top: 2px; }
.why p { margin: 0; }
.rv .muted.small { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.rv .muted.small .ic { width: 15px; height: 15px; }

/* ---------- Certificados ---------- */
.certgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.certcard { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--red); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.cert-top { display: flex; justify-content: space-between; align-items: flex-start; color: var(--red); }
.certcard h3 { margin: 6px 0 0; font-size: 18px; }

/* ---------- Administración ---------- */
.subnav { display: flex; gap: 4px; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 64px; z-index: 15; }
.subnav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; }
.subnav a:hover { background: var(--sunk); color: var(--ink); }
.subnav a.active { background: var(--ink); color: var(--card); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tiles.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; }
a.tile:hover { border-color: var(--red); }
.tile-ic { color: var(--red); }
.tile-l { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile-v { font: 800 30px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.tile-v.sm { font-size: 16px; }
.alerts { display: grid; gap: 8px; margin-bottom: 18px; }
.alerts .note { margin: 0; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed a { display: flex; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; }
.feed a:hover { background: var(--sunk); }
.feed b { font-size: 14px; font-weight: 600; }
.feed p { margin: 2px 0; }
.feed-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--soft); margin-top: 6px; flex: none; }
.feed-attempt_passed .feed-dot { background: var(--ok); }
.feed-attempt_failed .feed-dot { background: var(--warn); }
.feed-attempt_blocked .feed-dot { background: var(--bad); }
.feed-new_user .feed-dot { background: var(--info); }
.syslist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.syslist li { display: flex; gap: 12px; align-items: flex-start; }
.syslist .ic { color: var(--red); margin-top: 2px; }
.syslist div { display: grid; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select { width: auto; min-width: 200px; }
.search { position: relative; display: block; flex: 1; min-width: 220px; max-width: 420px; }
.search .ic { position: absolute; left: 12px; top: 11px; color: var(--soft); }
.search input { padding-left: 38px; }
.search.sm { max-width: none; margin: 8px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--sunk); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--sunk); }
.table tr.inactive td { opacity: .55; }
.table .prog { min-width: 130px; }
.card.flush { overflow-x: auto; }
.who { display: flex; align-items: center; gap: 10px; }
.who > div { display: grid; }
.av { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--tint); color: var(--red-ink); font: 700 13px var(--display); flex: none; }
.clist { display: grid; gap: 10px; }
.crow { display: flex; align-items: center; gap: 16px; margin: 0; color: var(--ink); text-decoration: none !important; flex-wrap: wrap; }
.crow:hover { border-color: var(--red); }
.crow-num { font: 800 26px var(--display); color: var(--red); width: 40px; }
.crow .ccard-meta { margin-top: 4px; }
.crow-stats { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.crow-stats b { color: var(--ink); font-size: 16px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.active { color: var(--red-ink); border-bottom-color: var(--red); }
.dropzone { display: grid; justify-items: center; text-align: center; gap: 6px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; cursor: pointer; color: var(--muted); font-weight: 400; min-width: 260px; }
.dropzone .ic.big { color: var(--red); }
.dropzone b { color: var(--ink); }
.dropzone:hover, .dropzone.over { border-color: var(--red); background: var(--tint); }
.add-btns { min-width: 240px; }
.add-btns .btn { justify-content: flex-start; }
.upl { display: grid; grid-template-columns: minmax(0, 1fr) 160px 50px; gap: 12px; align-items: center; font-size: 13px; padding: 8px 0; }
.upl.bad { color: var(--bad); }
.items { list-style: none; padding: 0; margin: 0 0 18px; }
.items li { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.items li:last-child { border-bottom: 0; }
.items .grow { overflow: hidden; }
.items .muted.small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--tint); color: var(--red); flex: none; margin-right: 6px; }
.qe-head { position: sticky; top: 118px; z-index: 5; }
.qe-list { list-style: none; padding: 0; margin: 0; }
.qe { display: grid; gap: 12px; }
.qe-top select { width: auto; }
.qe-opts, .qe-match > div { display: grid; gap: 8px; }
.qe-match { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.qe-match select { width: auto; max-width: 180px; }
details summary { cursor: pointer; }
.sections { display: grid; gap: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.matrix-wrap { max-height: 72vh; overflow: auto; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); padding: 6px; text-align: center; background: var(--card); }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--sunk); vertical-align: bottom; min-width: 130px; max-width: 170px; padding: 10px 8px; }
.matrix thead th a { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); font-weight: 600; font-size: 12px; line-height: 1.3; }
.matrix .sticky { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 200px; max-width: 240px; padding: 8px 14px; }
.matrix thead .sticky { z-index: 3; vertical-align: bottom; }
.matrix tbody th a { color: var(--ink); text-decoration: none; display: block; }
.mcell { border: 0; background: none; cursor: pointer; display: grid; justify-items: center; gap: 2px; padding: 4px; border-radius: 8px; width: 100%; color: var(--muted); }
.mcell:hover { background: var(--sunk); }
.mcell.overdue { box-shadow: inset 0 0 0 2px var(--bad); }
.cell-st { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--sunk); color: var(--soft); }
.cell-st .ic { width: 15px; height: 15px; stroke-width: 2.5; }
.cell-st.available { background: var(--info-bg); color: var(--info); }
.cell-st.progress { background: var(--warn-bg); color: var(--warn); }
.cell-st.quiz { background: var(--tint); color: var(--red-ink); }
.cell-st.done { background: var(--ok); color: #fff; }
.cell-st.blocked { background: var(--bad); color: #fff; }
.cell-st.none { background: transparent; border: 1px dashed var(--line); }
.assign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.assign-grid .areas { margin-bottom: 4px; }
.narrow-col { max-width: 900px; }

/* ---------- Ventanas y avisos ---------- */
dialog.modal { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal.wide { width: min(940px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(20, 10, 12, .45); backdrop-filter: blur(2px); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-inner header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 6px; }
.modal-inner header h2 { margin: 0; font-size: 20px; }
.modal-body { padding: 10px 20px 18px; overflow: auto; }
.modal-inner footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-inner footer .danger-ghost { margin-right: auto; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; width: min(460px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--card); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: up .2s ease-out; transition: opacity .4s, transform .4s; }
.toast.error { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Pantallas chicas ---------- */
@media (max-width: 960px) {
  .course-layout { grid-template-columns: 1fr; }
  .steps { position: static; }
  .two-col, .assign-grid, .qe-match { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 240px; padding: 28px 24px; }
  .qe-head { position: static; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .brand-tag { display: none; }
  .mainnav a span { display: none; }
  .mainnav a { padding: 9px 11px; }
  .page { padding: 20px 16px 48px; }
  .hero { padding: 30px 16px; flex-direction: column; align-items: flex-start; }
  .hero-ring { display: none; }
  .subnav { padding: 8px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .quiz-facts { grid-template-columns: repeat(2, 1fr); }
  .match-row { grid-template-columns: 1fr; }
  .cgrid { grid-template-columns: 1fr; }
  .result-hero { padding: 20px; gap: 16px; }
  .upl { grid-template-columns: 1fr 80px 40px; }
  .toolbar select { min-width: 0; width: 100%; }
  .crow-stats { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Seguridad y privacidad ---------- */
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); margin-top: 18px; }
.danger-zone p { margin: 2px 0 0; }
.prose-page { line-height: 1.65; }
.prose-page h2 { margin-top: 28px; }
.prose-page ul { padding-left: 20px; }
.prose-page li { margin-bottom: 6px; }
a.pop-item { text-decoration: none !important; }
.mt-xs { margin-top: 6px; justify-self: start; }
