:root {
  --ink: #000;
  --paper: #fff;
  --muted: #555;
  --line: #000;
  --soft: #f2f2f2;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* buttons and inline labels set their own display */
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  color: var(--ink); background: var(--paper);
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--ink); }
main#app { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 20px 48px; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 2px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; text-decoration: none; font-size: 19px; }
.brand img { width: 36px; height: 36px; display: block; }
.brand b { font-weight: 800; }
.login-logo { display: block; width: min(320px, 80%); margin: 0 auto 18px; }
#nav a { margin-left: 22px; text-decoration: none; padding-bottom: 3px; border-bottom: 2px solid transparent; }
#nav a.active { border-bottom-color: var(--ink); }
.foot { border-top: 1px solid var(--line); padding: 12px 20px; font-size: 12px; color: var(--muted); }

h1 { font-size: 26px; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 18px; margin: 28px 0 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
h3 { font-size: 15px; margin: 18px 0 6px; font-weight: 700; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.center { text-align: center; }

label { display: block; font-weight: 700; margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
label.inline { display: inline-flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 15px; margin: 8px 16px 0 0; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 0;
  font: inherit; color: var(--ink); background: var(--paper);
}
input[type=number] { width: 90px; }
textarea { min-height: 120px; resize: vertical; }
textarea.short { min-height: 64px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
input[type=file] { font: inherit; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

button, .btn {
  display: inline-block; padding: 9px 16px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; border-radius: 0; letter-spacing: .02em;
}
button:hover, .btn:hover { background: var(--paper); color: var(--ink); }
button.ghost, .btn.ghost { background: var(--paper); color: var(--ink); }
button.ghost:hover, .btn.ghost:hover { background: var(--ink); color: var(--paper); }
button.small, .btn.small { padding: 5px 10px; font-size: 13px; }
button[disabled] { opacity: .45; cursor: default; }
.actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.card { border: 1px solid var(--line); padding: 18px 20px; margin: 14px 0; background: var(--paper); }
.card.soft { background: var(--soft); border-color: var(--soft); }
.warn { border: 2px solid var(--ink); padding: 10px 14px; font-weight: 700; margin: 12px 0; }
.error { border: 2px dashed var(--ink); padding: 10px 14px; margin: 12px 0; }
.badge { display: inline-block; border: 1px solid var(--ink); padding: 1px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.badge.fill { background: var(--ink); color: var(--paper); }

table { width: 100%; border-collapse: collapse; margin: 10px 0; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--ink); color: var(--paper); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.sub td { color: var(--muted); }
td[rowspan] { vertical-align: top; }
.tablewrap { overflow-x: auto; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .grid2, .split { grid-template-columns: 1fr; } }

.pdf { border: 1px solid var(--line); background: var(--soft); padding: 10px; max-height: 85vh; overflow: auto; position: sticky; top: 12px; }
.pdf canvas { display: block; width: 100%; height: auto; background: #fff; margin: 0 auto 10px; border: 1px solid #ccc; cursor: zoom-in; }
.pdf .pagenum { font-size: 11px; color: var(--muted); text-align: right; margin: -6px 0 10px; }

.q { border: 1px solid var(--line); padding: 14px 16px; margin: 12px 0; }
.q .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.q .head strong { font-size: 16px; }
.q .question { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.q .reason { margin: 8px 0; }
.q blockquote { margin: 6px 0 6px 14px; padding-left: 10px; border-left: 3px solid var(--ink); font-style: italic; }
.q .final { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--ink); }
.q .final input { width: 80px; }

.keyq { border: 1px solid var(--line); padding: 10px 12px; margin: 8px 0; }
.keyq .row { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.keyq .row input[type=number] { width: 70px; }
.keyq label { margin: 6px 0 2px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 14px; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; }
.login { max-width: 380px; margin: 80px auto; }
.progress { font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
.totals { font-size: 22px; font-weight: 700; margin: 6px 0 14px; }
.totals span { font-weight: 400; color: var(--muted); font-size: 15px; }
.dropzone { border: 2px dashed var(--ink); padding: 26px; text-align: center; margin: 12px 0; }
.dropzone.over { background: var(--soft); }
.radio { margin: 6px 0; }
.radio input { margin-right: 8px; }

/* full-screen page magnifier */
.magnifier { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.92); display: flex; flex-direction: column; }
.magbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--paper); border-bottom: 2px solid var(--ink); }
.magbar .magpage, .magbar .magzoom { font-size: 13px; min-width: 110px; text-align: center; font-variant-numeric: tabular-nums; }
.magbody { flex: 1; overflow: auto; padding: 16px; cursor: grab; }
.magbody canvas { display: block; margin: 0 auto; background: #fff; box-shadow: 0 0 0 1px #000; }

/* home flow */
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.flow .step { border: 1px solid var(--line); padding: 16px 18px; }
.flow .step.wide { grid-column: 1 / -1; }
.flow h3 { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.flow .dropzone { padding: 18px; margin: 0; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; } }

/* home: one step at a time */
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: 0; margin: 14px 0 0; padding: 0; counter-reset: none; }
.stepper li { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); margin: 0 -1px -1px 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); cursor: default; }
.stepper li b { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--ink); font-size: 13px; color: var(--ink); flex: none; }
.stepper li.open { cursor: pointer; color: var(--ink); }
.stepper li.open:hover { background: var(--soft); }
.stepper li.done b { background: var(--ink); color: var(--paper); }
.stepper li.on { color: var(--ink); font-weight: 700; border-bottom: 3px solid var(--ink); }
.stepper li.on b { background: var(--ink); color: var(--paper); }
#f .pane { border: 1px solid var(--line); border-top: 0; padding: 18px 20px; }
#f .pane h3 { margin: 0 0 12px; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
#f .pane .dropzone { margin: 0; }
.wiznav { margin-top: 16px; }
.wiznav #next, .wiznav #go { padding: 12px 28px; font-size: 16px; }
.review { margin: 0 0 16px; font-size: 15px; }
.review dd a { margin-left: 6px; }
details.crit { border: 1px solid var(--line); padding: 10px 14px; }
details.crit > summary { cursor: pointer; }

#navAccount { font-weight: 400; }

.export { display: inline-flex; align-items: center; gap: 6px; }

/* camera capture */
.capture-host { margin-top: 10px; }
.capture { border: 1px dashed var(--ink); padding: 10px 12px; }
.capture .thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.capture figure { margin: 0; width: 84px; text-align: center; }
.capture figure img { width: 84px; height: 110px; object-fit: cover; border: 1px solid var(--ink); display: block; }
.capture figcaption { font-size: 11px; display: flex; justify-content: center; align-items: center; gap: 2px; margin-top: 2px; }
.capture figcaption button { padding: 0 4px; font-size: 11px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }

.plancells { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
.plancells label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 12px; text-transform: none; letter-spacing: 0; }
.plancells input { width: 62px; padding: 5px 6px; }

/* course roster / impersonation flags */
.flag { display: inline-block; font-size: 12px; padding: 1px 6px; border: 1px solid var(--ink); white-space: nowrap; }
.flag.ok { border-style: dotted; color: var(--muted); }
.flag.bad { background: var(--ink); color: var(--paper); font-weight: 700; }
.flag.fix { border-style: dashed; }
.rosterbox { border: 1px solid var(--line); padding: 12px 14px; margin: 10px 0; }
.rosterbox.bad { border-width: 2px; }
.rosterbox .actions { margin-top: 8px; }
tr.missing td { color: var(--muted); font-style: italic; }
.summary { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }

/* table tools: search + sort */
.tabletools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 10px 0 -4px; font-size: 13px; }
.tabletools input[type=search] { width: 260px; max-width: 100%; padding: 6px 8px; border: 1px solid var(--line); font: inherit; border-radius: 0; }
.tabletools .count { color: var(--muted); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { text-decoration: underline; }
th.sortable .arrow { font-size: 10px; margin-left: 4px; opacity: .8; }

/* row action menu (three dots) */
.menuwrap { position: relative; display: inline-block; }
button.dots { padding: 2px 10px; font-size: 18px; line-height: 1; letter-spacing: 2px; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; background: var(--paper); border: 1px solid var(--line); min-width: 220px; box-shadow: 4px 4px 0 var(--ink); }
.menu button { display: block; width: 100%; text-align: left; background: var(--paper); color: var(--ink); border: 0; border-bottom: 1px solid var(--soft); padding: 9px 12px; font-weight: 400; font-size: 14px; }
.menu button:last-child { border-bottom: 0; }
.menu button:hover { background: var(--ink); color: var(--paper); }

/* collapsible sections */
details.section > summary { list-style: none; cursor: pointer; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary h2 { display: flex; align-items: baseline; gap: 10px; }
details.section > summary h2::before { content: "▸"; font-size: 14px; }
details.section[open] > summary h2::before { content: "▾"; }

/* entrega pop-up over the práctica page */
.submodal { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,.55); display: flex; padding: 18px; }
.submodal-box { background: var(--paper); border: 2px solid var(--ink); margin: auto; width: min(1500px, 100%); height: 100%; display: flex; flex-direction: column; }
.submodal-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 2px solid var(--ink); flex-wrap: wrap; }
.submodal-title { font-size: 13px; font-variant-numeric: tabular-nums; }
.submodal-body { flex: 1; overflow: auto; padding: 14px 16px; }
.submodal-body .split { align-items: start; }
.submodal-body .pdf { max-height: calc(100vh - 120px); top: 0; }
@media (max-width: 700px) { .submodal { padding: 0; } .submodal-box { border-width: 0; } }

/* compact práctica data card (two rows) */
.card.meta { padding: 10px 14px; }
.metarow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.metarow + .metarow { margin-top: 6px; }
.metarow label.inline { margin: 0; font-size: 14px; gap: 6px; white-space: nowrap; }
.metarow label.inline.grow { flex: 1 1 320px; }
.metarow label.inline.grow input { flex: 1; min-width: 0; }
.metarow input[type=text], .metarow select, .metarow input[type=date] { padding: 5px 8px; font-size: 14px; width: auto; }
.metarow select#eCourse { max-width: 320px; }

/* weekly class schedule (Prácticas page) */
.sched { display: grid; gap: 0; border: 1px solid var(--ink); background: var(--paper); font-size: 12px; overflow: hidden; }
.sched-corner { grid-column: 1; grid-row: 1; border-bottom: 2px solid var(--ink); border-right: 1px solid var(--line); background: var(--soft); }
.sched-day { grid-row: 1; padding: 6px 4px; text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; border-bottom: 2px solid var(--ink); border-right: 1px solid var(--line); background: var(--soft); }
.sched-hour { grid-column: 1; font-size: 11px; color: var(--muted); padding: 2px 6px 0 0; text-align: right; border-top: 1px solid var(--line); border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sched-cell { border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.sched-item { z-index: 1; margin: 1px 2px; padding: 3px 5px; border: 1px solid var(--ink); background: var(--paper); box-shadow: 2px 2px 0 var(--ink); overflow: hidden; display: flex; flex-direction: column; gap: 2px; line-height: 1.2; color: var(--ink); text-decoration: none; }
a.sched-item:hover { background: var(--soft); }
.sched-item strong { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sched-item span { font-size: 11px; color: var(--muted); }
.schedrows td { padding: 3px 4px; vertical-align: middle; }
.schedrows input, .schedrows select { padding: 5px 6px; font-size: 13px; width: 100%; }
.schedrows input[type=time] { width: 96px; }
@media (max-width: 900px) { .sched { font-size: 11px; } .sched-item strong { font-size: 11px; } }

/* language switch in the header */
#langToggle { font-size: 12px; letter-spacing: .08em; border: 1px solid var(--ink); padding: 2px 7px; font-weight: 700; }

/* posibles copias */
.copy { border-top: 1px solid var(--soft); padding: 6px 0; }
.copy summary { cursor: pointer; }
.copy summary .badge { min-width: 44px; text-align: center; margin-right: 6px; }
.copy blockquote { margin: 6px 0 6px 14px; padding-left: 10px; border-left: 3px solid var(--ink); font-style: italic; overflow-wrap: anywhere; }

/* table pages (enhanceTables, data-page) */
.pager { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 16px; }
