/* Clases (/classes/): vista del profesor y pantalla para unirse. Hoja propia, sin depender de otra página. */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/paquetesDescargados/Inter/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/paquetesDescargados/Inter/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/paquetesDescargados/Inter/inter-latin-700-normal.woff2') format('woff2'); }

:root {
  --navy: #285260; --navy-2: #1d3f4b; --teal: #548C92; --aqua: #B4D7D8;
  --good: #2f7d6d; --warn: #AB9072; --bad: #c0443a; --bad-bg: #fce8e6;
  --bg: #f3f6f7; --surface: #ffffff; --surface-2: #f6f9fa;
  --ink: #15232a; --ink-2: #4f5f67; --ink-3: #8a979e; --line: #e1e8ea;
  --track: #e6edef; --r: 14px; --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
html[data-theme="dark"] {
  --bg: #0e171b; --surface: #16232a; --surface-2: #1b2b33;
  --ink: #e6eef0; --ink-2: #a9b8be; --ink-3: #74858c; --line: #263840; --track: #24363e;
  --navy: #7fb9c0; --navy-2: #9fd0d5; --teal: #7fb9c0; --bad-bg: #3a1f1c; --bad: #ef8d84; --good: #5fc0a8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
.cl-body {
  font-family: var(--font); color: var(--ink); background: var(--bg); min-height: 100vh;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
a { color: var(--teal); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Encabezado */
.cl-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px max(16px, env(safe-area-inset-left)); max-width: 1180px; margin: 0 auto;
}
.cl-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--navy); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.cl-brand svg { width: 30px; height: 16px; fill: currentColor; }
.cl-nav { display: flex; gap: 18px; }
.cl-nav a { font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.cl-nav a:hover { color: var(--navy); }

.cl-main { max-width: 1180px; margin: 0 auto; padding: 8px 16px 64px; }
.cl-narrow { max-width: 520px; margin: 4vh auto 0; }
.cl-noscript { text-align: center; padding: 40px 16px; color: var(--ink-2); }

.cl-loading { display: grid; place-items: center; min-height: 40vh; }
.cl-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--track); border-top-color: var(--teal); animation: clSpin .7s linear infinite; }
@keyframes clSpin { to { transform: rotate(360deg); } }
@keyframes clUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cl-in { animation: clUp .32s var(--ease) both; }

/* Texto */
.cl-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin-bottom: 8px; }
.cl-h1 { font-size: clamp(24px, 4.4vw, 32px); font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.cl-h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 30px 0 12px; }
.cl-lead { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); margin-top: 10px; }
.cl-meta { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }
.cl-error { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: 14px; font-weight: 600; }

/* Botones */
.cl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 0; background: #285260; color: #fff; font-size: 15px; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: filter .15s, transform .15s;
}
.cl-btn:hover { filter: brightness(1.1); }
.cl-btn:active { transform: scale(.98); }
.cl-btn[disabled] { opacity: .6; cursor: default; }
.cl-btn svg { width: 17px; height: 17px; flex: none; }
.cl-btn--2 { background: var(--surface); color: var(--navy); border: 1.5px solid var(--line); }
.cl-btn--2:hover { filter: none; border-color: var(--teal); }
.cl-btn--sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.cl-btn--block { width: 100%; }
.cl-link { border: 0; background: none; color: var(--ink-3); font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 6px 4px; text-decoration: none; }
.cl-link:hover { color: var(--bad); }
.cl-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.cl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Tarjetas */
.cl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cl-class { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.cl-class:hover { border-color: var(--teal); transform: translateY(-1px); }
.cl-class b { font-size: 16px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cl-class small { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.cl-class__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.cl-class__foot i { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; }
.cl-class.is-archived { opacity: .6; }
.cl-tag { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.cl-empty { padding: 26px 18px; text-align: center; color: var(--ink-3); font-size: 14.5px; border: 1.5px dashed var(--line); border-radius: var(--r); }

/* Formularios */
.cl-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.cl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cl-field--wide { grid-column: 1 / -1; }
.cl-field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.cl-field label span { font-weight: 400; color: var(--ink-3); }
.cl-input {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 15px; outline: none;
}
.cl-input:focus { border-color: var(--teal); }
.cl-input--code { text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-variant-numeric: tabular-nums; max-width: 190px; }
.cl-form .cl-row { grid-column: 1 / -1; }

/* Unirse: qué ve el profesor */
.cl-sees { list-style: none; margin-top: 16px; display: grid; gap: 9px; }
.cl-sees li { display: flex; gap: 9px; align-items: flex-start; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.cl-sees svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--good); }
.cl-sees li.is-no svg { color: var(--ink-3); }

/* Clase del profesor */
.cl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 6px; }
.cl-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); text-decoration: none; margin-bottom: 10px; }
.cl-back:hover { color: var(--navy); }
.cl-back svg { width: 15px; height: 15px; }
.cl-invite { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 18px; }
.cl-invite__code { font-size: 26px; font-weight: 700; letter-spacing: .14em; font-variant-numeric: tabular-nums; color: var(--navy); }
.cl-invite small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.cl-invite__link { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cl-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.cl-tile small { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.cl-tile b { display: block; margin-top: 6px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cl-tile b span { font-size: 14px; font-weight: 600; color: var(--ink-3); margin-left: 3px; }

.cl-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 10px; }
.cl-tools .cl-h2 { margin: 0; }
.cl-tools .cl-row { flex-wrap: nowrap; }
.cl-tools .cl-btn { white-space: nowrap; }
.cl-search { max-width: 220px; min-height: 36px; font-size: 14px; }

.cl-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 980px; }
.cl-table th, .cl-table td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cl-table tbody tr:last-child td { border-bottom: 0; }
.cl-table th { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); }
.cl-table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.cl-table th button:hover, .cl-table th[aria-sort] button { color: var(--navy); }
.cl-table th[aria-sort="ascending"] button::after { content: '↑'; }
.cl-table th[aria-sort="descending"] button::after { content: '↓'; }
.cl-table td.num, .cl-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cl-table td.mod, .cl-table th.mod { text-align: center; padding-left: 5px; padding-right: 5px; }
.cl-table td:first-child, .cl-table th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; padding-left: 16px; }
.cl-table th:first-child { background: var(--surface-2); }
.cl-table tbody tr:hover td { background: var(--surface-2); }
.cl-who b { display: block; font-size: 14px; font-weight: 600; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.cl-who small { display: block; font-size: 12px; color: var(--ink-3); max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.cl-prog { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.cl-prog i { flex: 1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.cl-prog i u { display: block; height: 100%; border-radius: 3px; background: var(--teal); }
.cl-prog span { width: 34px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-chip {
  display: inline-grid; place-items: center; min-width: 38px; height: 24px; padding: 0 6px; border-radius: 7px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--track); color: var(--ink-3);
}
.cl-chip.is-part { background: rgba(84,140,146,.16); color: var(--teal); }
.cl-chip.is-done { background: var(--good); color: #fff; }
.cl-tick { display: inline-block; margin: 0 4px 0 0; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.cl-dim { color: var(--ink-3); }
.cl-x { all: unset; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--ink-3); font-size: 15px; line-height: 1; }
.cl-x:hover { background: var(--bad-bg); color: var(--bad); }
.cl-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.cl-legend .cl-chip { min-width: 24px; height: 16px; margin-right: 5px; vertical-align: -3px; }

@media (max-width: 760px) {
  .cl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-form { grid-template-columns: minmax(0, 1fr); }
  .cl-invite { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cl-search { max-width: none; flex: 1; }
  .cl-who b, .cl-who small { max-width: 150px; }
}
@media (prefers-reduced-motion: reduce) { .cl-in { animation: none; } }

/* ---------- Tareas (classes-tasks.js) ---------- */
.cl-class__name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.cl-class__name:hover { color: var(--teal); }
select.cl-input { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a979e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.cl-area { min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.cl-input--sm { min-height: 36px; font-size: 14px; width: auto; }
.cl-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.cl-instr { margin-top: 14px; font-size: 15px; line-height: 1.55; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; }

.cl-tasks { display: grid; gap: 8px; }
.cl-task { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .15s; }
.cl-task:hover { border-color: var(--teal); }
.cl-task__main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cl-task__main b { font-size: 15px; overflow-wrap: anywhere; }
.cl-task__main small { font-size: 13px; color: var(--ink-3); }
.cl-task__count { flex: none; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-task__count b { color: var(--ink); }
.cl-task__count i { width: 64px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.cl-task__count i u { display: block; height: 100%; background: var(--teal); border-radius: 3px; }

.cl-state { flex: none; display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--track); color: var(--ink-3); white-space: nowrap; }
.cl-state.is-done { background: var(--good); color: #fff; }
.cl-state.is-late { background: var(--warn); color: #fff; }
.cl-state.is-todo { background: rgba(84,140,146,.16); color: var(--teal); }

.cl-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.cl-table--tasks { min-width: 720px; }
.cl-table--tasks td { vertical-align: top; }
.cl-table--tasks td.cl-note { white-space: pre-wrap; min-width: 180px; max-width: 320px; overflow-wrap: anywhere; color: var(--ink-2); }
.cl-file { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; max-width: 100%; }
.cl-file:hover { text-decoration: underline; }
.cl-file svg { width: 15px; height: 15px; flex: none; }
.cl-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.cl-up { color: var(--good); font-weight: 600; }
.cl-down { color: var(--bad); font-weight: 600; }

.cl-narrow--task { max-width: 600px; margin-top: 0; }
.cl-status { margin-top: 14px; }
.cl-box { margin-top: 16px; }
.cl-box > small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.cl-hint { margin-top: 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink-3); }
.cl-vals { list-style: none; display: grid; gap: 8px; }
.cl-vals li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: baseline; font-size: 14.5px; }
.cl-vals b { font-variant-numeric: tabular-nums; }
.cl-vals i { font-style: normal; font-size: 12.5px; color: var(--ink-3); }
.cl-filein { display: block; width: 100%; margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.cl-filein::file-selector-button { margin-right: 12px; min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--navy); font: inherit; font-weight: 700; cursor: pointer; }
@media (max-width: 760px) {
  .cl-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cl-tiles--3 .cl-card { padding: 12px; }
  .cl-task { align-items: flex-start; flex-direction: column; gap: 10px; }
}

/* Licencia de la clase */
.cl-lic { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 12px; padding: 12px 16px; border-radius: var(--r); border: 1.5px dashed var(--line); font-size: 14px; color: var(--ink-2); }
.cl-lic b { color: var(--ink); }
.cl-lic.is-on { border-style: solid; border-color: var(--good); background: rgba(47,125,109,.08); }
.cl-lic.is-on b { color: var(--good); }
.cl-lic a { font-weight: 700; text-decoration: none; }
.cl-sees li.is-plus span { color: var(--ink); font-weight: 600; }
