/* ==========================================================================
   EduTrack — Gradebooks (BETA). Mismos tokens y medidas que el Campus (app.css): Inter,
   blanco, carmesí #960E0B, barra de 80 px. Autocontenido a propósito para que el módulo
   no dependa de app.css (docs/variados/GRADEBOOKS.md §2.2).
   ========================================================================== */
:root {
  --brand: #960e0b; --brand-hover: #7a0b08;
  --ink: #222222; --muted: #6a6a6a; --ink-3: #3f3f3f;
  --line: #dddddd; --line-soft: #ebebeb;
  --fam-bg: #f6ecec; --chip: #f2f2f2; --row-hover: #f7f7f7; --danger: #c13515;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: #fff;
  font-size: 14px; letter-spacing: -0.1px; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-size: 13px; margin-top: 4px; }
a { color: inherit; text-decoration: none; }
input, select, button, textarea { font-family: inherit; }

/* ---- Buttons (como en app.css) ---- */
.btn { font-size: 16px; font-weight: 500; border: 1px solid transparent; border-radius: 8px;
  padding: 0 22px; height: 48px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; transition: background .13s ease, border-color .13s ease, color .13s ease, opacity .13s; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover:not(:disabled) { background: #f7f7f7; }
.btn-block { width: 100%; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }

/* ---- Login ---- */
.login-view { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; border: 1px solid var(--line); border-radius: 20px; background: #fff;
  padding: 34px 30px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: rgba(0,0,0,.03) 0 1px 3px, rgba(0,0,0,.06) 0 8px 28px; }
.login-logo { width: 210px; height: auto; display: block; margin: 4px 0 2px; }
.login-card h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.5px; margin-top: 12px; }
.btn-google { width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 11px;
  transition: box-shadow .15s, border-color .15s; }
.btn-google:hover { box-shadow: rgba(0,0,0,.08) 0 3px 12px; border-color: #c9c9c9; }
.btn-google svg { width: 19px; height: 19px; }
.fineprint { font-size: 12.5px; line-height: 1.5; text-align: center; margin-top: 4px; }

/* ---- Topbar ---- */
.topbar { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line-soft); }
.topbar-inner { max-width: 1360px; margin: 0 auto; height: 80px; padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.logo-mark { width: 42px; height: 42px; object-fit: contain; flex: none; display: block; }
.wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text { font-size: 19px; font-weight: 700; color: var(--brand); letter-spacing: -0.4px; }
.logo-sub { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 1px; margin-top: 2px; text-transform: uppercase; }
.user { display: flex; align-items: center; gap: 14px; flex: none; }
#user-email { font-size: 14px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { max-width: 1360px; margin: 0 auto; padding: 32px 40px 64px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 13px 20px; border-radius: 10px; z-index: 70; box-shadow: rgba(0,0,0,.25) 0 10px 30px; font-size: 14px; }
.toast.err { background: var(--danger); }
@media (max-width: 760px) { .topbar-inner, .content { padding-left: 16px; padding-right: 16px; } .topbar-inner { height: 68px; } #user-email { display: none; } }

/* etiqueta BETA junto al título */
.beta-tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; color: var(--brand);
  background: #fbeceb; border-radius: 9999px; padding: 3px 9px; vertical-align: middle; margin-left: 8px; }
.empty-state { margin-top: 40px; text-align: center; color: var(--muted); }
.empty-state h2 { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* ==========================================================================
   Prototipo de la grilla (fase 2)
   ========================================================================== */
.gb-banner { background: #fff7e6; border: 1px solid #f0d9a8; color: #6b4e0a; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.gb-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.gb-spacer { flex: 1; }
.gb-field { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; }
.gb-field select, .gb-grid select, .gm-card input, .gm-card select, .gm-card textarea {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); text-transform: none; letter-spacing: -0.1px;
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.gb-field select:focus, .gb-grid select:focus, .gm-card input:focus, .gm-card select:focus, .gm-card textarea:focus { outline: none; border-color: var(--ink); }
.gb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.gb-seg button { height: 40px; min-width: 48px; padding: 0 14px; border: none; background: none; font: inherit; font-size: 14px;
  font-weight: 600; color: var(--muted); cursor: pointer; }
.gb-seg button + button { border-left: 1px solid var(--line); }
.gb-seg button.on { background: var(--ink); color: #fff; }
.gb-status { font-size: 12.5px; color: var(--muted); align-self: center; min-width: 120px; text-align: right; }
.gb-status.saving { color: #9a6a11; }
.gb-desc { margin: 10px 0 2px; font-size: 13px; }
.gb-tabs { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); margin: 8px 0 14px; }
.gb-tabs button[data-tab] { height: 44px; padding: 0 16px; border: none; background: none; border-bottom: 2px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.gb-tabs button[data-tab].on { color: var(--ink); border-bottom-color: var(--ink); }
.gb-link { background: none; border: none; font: inherit; font-size: 12.5px; color: var(--muted); text-decoration: underline; cursor: pointer; white-space: nowrap; }
.gb-hint { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.gb-empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.gb-scroll { position: relative; overflow: auto; flex: 1 1 auto; min-height: 120px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; -webkit-overflow-scrolling: touch; }
.gb-grid { border-collapse: separate; border-spacing: 0; font-size: 13px; outline: none; }
.gb-grid th, .gb-grid td { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: #fff; }
.gb-grid thead th { position: sticky; top: 0; z-index: 3; background: #fafafa; padding: 6px 8px; text-align: left; vertical-align: bottom;
  border-bottom: 1px solid var(--line); font-weight: 600; }
.gb-grid thead .h-n, .gb-grid thead .h-name, .gb-grid thead .h-grp { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.gb-grid .h-n, .gb-grid .c-n { position: sticky; left: 0; z-index: 4; min-width: 40px; width: 40px; text-align: center; color: var(--muted); }
.gb-grid .h-name, .gb-grid .c-name { position: sticky; left: 40px; z-index: 4; min-width: 220px; width: 220px; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 10px; }
.gb-grid .h-grp, .gb-grid .c-grp { position: sticky; left: 260px; z-index: 4; min-width: 54px; width: 54px; text-align: center; color: var(--muted);
  border-right: 1px solid var(--line); }
.gb-grid thead .h-n, .gb-grid thead .h-name, .gb-grid thead .h-grp { z-index: 5; }
.gb-grid td { height: 34px; padding: 0 8px; }
.gb-grid .h-calc { min-width: 124px; width: 124px; max-width: 124px; overflow: hidden; background: #f6f6f7; }
.gb-grid td.calc { min-width: 124px; width: 124px; max-width: 124px; text-align: center; background: #fbfbfc; }
.gb-grid .h-ta { max-width: none; width: auto; }
.gb-grid td.calc-soft { color: var(--muted); }
.gb-grid td.calc-final { background: #f4f4f6; }
.gb-grid .bajo { color: #c13515; }
.ath { min-width: 112px; width: 112px; max-width: 112px; }
.ah-top { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-top i { font-style: normal; }
.cat-formative { color: #8a8a8a; } .cat-summative { color: #1f6f8b; } .cat-project { color: #7a4fa0; }
.ah-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-sub { font-size: 11px; font-weight: 500; color: var(--muted); }
.gb-grid td.cell { text-align: center; cursor: cell; user-select: none; -webkit-user-select: none; }
.gb-grid td.cell.sel { background-image: linear-gradient(rgba(150,14,11,.10), rgba(150,14,11,.10)); }
.gb-grid td.cell.sel:not(.lc) { background-color: #f3e4e3; background-image: none; }
.gb-grid td.cell.cur { box-shadow: inset 0 0 0 2px var(--brand); }
.gb-grid td.cell.cur:not(.lc) { background-color: #fff; background-image: none; }
.gb-grid tr.row-cur .c-name { color: var(--brand); font-weight: 600; }
.gb-grid .over { color: #7a4fa0; font-weight: 700; }
.lvl { display: inline-block; font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 9999px; white-space: nowrap; }
.n-mas { background: #e4f4ea; color: #1a7f4b; } .n-pro { background: #e3f0f5; color: #1f6f8b; }
.n-bas { background: #f8efd9; color: #9a6a11; } .n-not { background: #fbe6e1; color: #c13515; }
.n-noe { background: #eee; color: #6a6a6a; } .n-dash { background: #f1f1f1; color: #8a8a8a; }
.gb-editor { position: absolute; z-index: 6; border: 2px solid var(--brand); border-radius: 0; padding: 0 8px; font: inherit; font-size: 14px;
  text-align: center; background: #fff; outline: none; }
.gb-grid select { height: 32px; width: 100%; min-width: 150px; font-size: 13px; }
.gb-grid .cell-sel { padding: 0 6px; }
.gb-grid .cell-ta { padding: 4px; min-width: 260px; }
.gb-grid .cell-ta textarea { width: 100%; min-width: 250px; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.gb-grid .h-ta { min-width: 260px; }

.gb-tests { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.gb-tests li { font-size: 13.5px; padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; display: flex; gap: 10px; }
.gb-tests li.ok span { color: #1a7f4b; font-weight: 700; } .gb-tests li.mal { border-color: #c13515; background: #fdf1ef; } .gb-tests li.mal span { color: #c13515; font-weight: 700; }
.gb-stress h4 { font-size: 15px; margin-bottom: 4px; } .gb-stress p { font-size: 13px; margin-bottom: 10px; }

.gb-modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35); display: grid; place-items: center; padding: 16px; }
.gm-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: rgba(0,0,0,.25) 0 14px 40px; }
.gm-card h3 { font-size: 18px; letter-spacing: -0.3px; }
.gm-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.gm-card label small { text-transform: none; font-weight: 500; letter-spacing: 0; }
.gm-actions { display: flex; justify-content: flex-end; gap: 10px; }

.gb-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px 20px;
  box-shadow: rgba(0,0,0,.3) 0 -8px 30px; display: flex; flex-direction: column; gap: 14px; max-width: 560px; margin: 0 auto; }
.gs-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.gs-x { border: none; background: #f1f1f1; border-radius: 9999px; width: 34px; height: 34px; font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.gs-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gs-o { height: 52px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.gs-o.on { box-shadow: inset 0 0 0 2px var(--ink); }
.gs-pts { display: flex; gap: 10px; } .gs-pts input { flex: 1; height: 52px; font: inherit; font-size: 20px; text-align: center; border: 1px solid var(--line); border-radius: 12px; }
.gs-foot { display: flex; justify-content: space-between; gap: 10px; }
@media (max-width: 760px) { .gb-grid .h-name, .gb-grid .c-name { min-width: 150px; width: 150px; max-width: 150px; }
  .gb-grid .h-grp, .gb-grid .c-grp { left: 190px; } .gb-status { min-width: 0; } }

/* ==========================================================================
   Pulido de la interfaz: menos ruido, más hoja de cálculo
   ========================================================================== */
.gb-toolbar { margin-bottom: 4px; }
.gb-proto { align-self: center; font-size: 11px; font-weight: 600; color: #8a6a1f; background: #fff7e6; border: 1px solid #f0d9a8;
  border-radius: 9999px; padding: 4px 10px; white-space: nowrap; cursor: help; }
.gb-tabs-l { display: flex; gap: 4px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.gb-tabs-l::-webkit-scrollbar { display: none; }
.gb-tabs .gb-desc { margin: 0 0 0 auto; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gb-menu-wrap { position: relative; display: flex; gap: 6px; flex: none; margin-left: auto; }
.gb-icon { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9999px; background: #fff; font-size: 15px;
  font-weight: 700; color: var(--muted); cursor: pointer; line-height: 1; }
.gb-icon:hover { color: var(--ink); border-color: var(--ink); }
.gb-menu { position: absolute; right: 0; top: 40px; z-index: 30; min-width: 230px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: rgba(0,0,0,.12) 0 8px 24px; padding: 6px; }
.gb-menu button { width: 100%; text-align: left; background: none; border: none; padding: 10px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.gb-menu button:hover { background: var(--row-hover); }

/* Resultado del trimestre | Actividades */
.gb-grid2 thead tr.grp th { top: 0; height: 28px; padding: 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted); background: #fff; border-bottom: 1px solid var(--line-soft); }
.gb-grid2 thead tr.grp th.g-res { background: #f3f3f5; text-align: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.gb-grid2 thead tr.cols th { top: 28px; }
.gb-grid th.ath, .gb-grid th.h-calc { box-shadow: inset 0 3px 0 var(--stripe, transparent); }
.gb-grid .h-calc { border-left: 0; }
.gb-grid td.calc:first-of-type { border-left: 1px solid var(--line); }
.dchip { display: inline-block; min-width: 24px; text-align: center; font-size: 10.5px; font-weight: 700; color: #fff; border-radius: 5px;
  padding: 2px 6px; font-style: normal; letter-spacing: .2px; line-height: 1.3; }
.ah-top { min-height: 16px; }
.gb-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.gb-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Color solo donde hay que mirar */
/* Celdas coloreadas por nivel: mismo fondo y color de texto que el selector (.n-*). */
.lv { display: inline-block; font-size: 13px; font-weight: 600; white-space: nowrap; color: inherit; }
.gb-grid td.lc.n-mas { background-color: #e4f4ea; color: #1a7f4b; } .gb-grid td.lc.n-pro { background-color: #e3f0f5; color: #1f6f8b; }
.gb-grid td.lc.n-bas { background-color: #f8efd9; color: #9a6a11; } .gb-grid td.lc.n-not { background-color: #fbe6e1; color: #c13515; }
.gb-grid td.lc.n-noe { background-color: #eee; color: #6a6a6a; } .gb-grid td.lc.n-dash { background-color: #f1f1f1; color: #8a8a8a; }
.gb-grid tbody tr:hover td.lc { filter: brightness(.96); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; padding: 0; }
.dot.n-mas { background: #1a7f4b; } .dot.n-pro { background: #1f6f8b; } .dot.n-bas { background: #d19a1f; }
.dot.n-not { background: #c13515; } .dot.n-noe { background: #9a9a9a; } .dot.n-dash { background: #cfcfcf; }
.gb-grid td.cell.vacia::before { content: "·"; color: #cfcfcf; }
.gb-grid { font-variant-numeric: tabular-nums; }

/* Sensación de hoja de cálculo */
.gb-grid tbody tr:hover td:not(.sel):not(.cur):not(.lc) { background-color: var(--row-hover); }
.gb-grid .c-n.hl, .gb-grid .c-name.hl { background: #f3e4e3; color: var(--brand); font-weight: 600; }
.gb-grid th.ath.hl { background: #f3e4e3; }
.gb-grid .h-add, .gb-grid .c-add { min-width: 52px; width: 52px; text-align: center; }
.gb-grid thead .h-add { vertical-align: middle; }
.add-col { width: 32px; height: 32px; border-radius: 8px; border: 1px dashed #bbb; background: #fff; font-size: 18px; line-height: 1;
  color: var(--muted); cursor: pointer; }
.add-col:hover { border-color: var(--ink); color: var(--ink); }

/* Atajos */
.gm-card:has(.gb-keys) { max-width: 580px; }
.gb-keys { display: grid; grid-template-columns: 110px 1fr; gap: 12px 14px; font-size: 13.5px; line-height: 1.6; }
.gb-keys dt { font-weight: 700; color: var(--muted); }
kbd { font: inherit; font-size: 12px; font-weight: 600; padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; background: #fafafa; white-space: nowrap; }
.gb-empty b { color: var(--ink); font-size: 15px; }
@media (max-width: 760px) { .gb-tabs .gb-desc { display: none; } .gb-proto { display: none; } }
.gb-grid.kind-rubrica td.cell, .gb-grid.kind-rubrica td.calc, .gb-grid.kind-aprobado td.cell, .gb-grid.kind-aprobado td.calc { text-align: left; padding-left: 16px; }
.gb-grid.kind-rubrica th.ath, .gb-grid.kind-rubrica th.h-calc, .gb-grid.kind-aprobado th.ath, .gb-grid.kind-aprobado th.h-calc { padding-left: 16px; }
@media (max-width: 760px) {
  .logo-sub, .user .lbl { display: none; }
  .topbar-inner { gap: 10px; } .brand { flex: 0 1 auto; min-width: 0; } .user { gap: 8px; }
  .user .btn-sm { padding: 0 12px; }
  .gb-toolbar { gap: 8px; } .gb-toolbar .btn-sm { flex: none; }
  .gb-status { text-align: left; }
}
html, body { overflow-x: hidden; }
@media (max-width: 760px) {   /* columnas fijas más estrechas: en celular casi todo el ancho es para las notas */
  .gb-grid .h-n, .gb-grid .c-n { min-width: 28px; width: 28px; font-size: 11px; }
  .gb-grid .h-name, .gb-grid .c-name { left: 28px; min-width: 112px; width: 112px; max-width: 112px; padding: 0 6px; font-size: 12.5px; }
  .gb-grid .h-grp, .gb-grid .c-grp { left: 140px; min-width: 38px; width: 38px; font-size: 12px; }
  .gb-grid2 thead tr.grp th { font-size: 10px; padding: 0 6px; }
}

/* La página ocupa la pantalla y no scrollea; el scroll es de la tabla (vertical y horizontal). */
body.gb-app { overflow: hidden; }
body.gb-app #app-view { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
#app-view.hidden { display: none !important; }
body.gb-app #app-view .topbar { flex: none; }
body.gb-app #gb-main.content { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; padding-top: 20px; padding-bottom: 20px; }
#gb-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.gb-toolbar, .gb-tabs, .gb-legend, .gb-hint { flex: none; }
.gb-tests, .gb-stress { flex: none; }

/* Una sola columna fija menos cuando hay un solo grupo */
.gb-grid.no-grp .h-name, .gb-grid.no-grp .c-name { border-right: 1px solid var(--line); }

/* Eliminar actividad */
.ah-del { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0;
  border: none; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s; }
.ah-del svg { width: 15px; height: 15px; }
.gb-grid th.ath:hover .ah-del, .ah-del:focus-visible { opacity: 1; }
.ah-del:hover { background: #fdf1ef; color: var(--danger); }
@media (hover: none) { .ah-del { opacity: .55; } }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a02b10; }
.gm-text { font-size: 14px; line-height: 1.55; color: var(--ink-3); }
.gm-card label.gm-check { flex-direction: row; align-items: flex-start; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 14px;
  font-weight: 500; color: var(--ink); cursor: pointer; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.gm-check input { width: 18px; height: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--danger); padding: 0; }
.btn-outline:disabled { opacity: .45; cursor: default; }

/* ==========================================================================
   Celular: los controles en una sola línea
   [ gradebook ][ T1 T2 T3 ][ ↶ ][ + ]  y, debajo, las pestañas con el grupo y «⋯».
   ========================================================================== */
.gb-grp-m { display: none; }
@media (max-width: 760px) {
  #gb-main.content { padding-top: 12px; padding-bottom: 12px; }
  .gb-toolbar { flex-wrap: nowrap; gap: 6px; align-items: center; margin-bottom: 0; }
  .gb-toolbar .gb-field > span { display: none; }
  .gb-toolbar .gb-field { flex: 1 1 auto; min-width: 0; }
  .gb-toolbar .gb-field select { width: 100%; min-width: 0; padding: 0 8px; }
  .gb-grp-d, .gb-toolbar .gb-spacer, .gb-proto, .gb-status { display: none; }
  .gb-seg { flex: none; }
  .gb-seg button { min-width: 34px; padding: 0 8px; font-size: 13.5px; }
  #gb-undo, #gb-add { flex: none; width: 40px; height: 40px; padding: 0; }
  #gb-undo .tx, #gb-add .tx { display: none; }
  #gb-undo .ic, #gb-add .ic { font-size: 20px; line-height: 1; }
  .gb-tabs { gap: 8px; margin: 8px 0 10px; }
  .gb-tabs button[data-tab] { padding: 0 12px; font-size: 14px; }
  .gb-grp-m { display: block; flex: none; height: 34px; max-width: 92px; padding: 0 6px; font-size: 13px; font-weight: 500;
    border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
  #gb-help { display: none; }   /* los atajos de teclado no sirven en un teléfono */
  .gb-legend { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; gap: 14px; scrollbar-width: none; margin-bottom: 8px; }
  .gb-legend::-webkit-scrollbar { display: none; }
  .gb-legend span { flex: none; }
}
#gb-undo .ic { display: inline-flex; }
#gb-undo .ic svg { width: 17px; height: 17px; }
#gb-undo { gap: 7px; }
@media (max-width: 760px) { #gb-undo .ic svg { width: 19px; height: 19px; } #gb-add .ic { font-size: 22px; } }

/* Los títulos fijos (#, Estudiante, Grupo) ocupan las dos filas del encabezado y van centrados en vertical:
   así no queda un recuadro vacío encima. */
.gb-grid2 thead tr.grp th.fx { height: auto; vertical-align: middle; padding: 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  text-transform: uppercase; color: var(--muted); background: #fafafa; border-bottom: 1px solid var(--line); z-index: 5; }
.gb-grid2 thead tr.grp th.h-n.fx, .gb-grid2 thead tr.grp th.h-grp.fx { text-align: center; padding: 0 4px; }
@media (max-width: 760px) { .gb-grid2 thead tr.grp th.fx { font-size: 11px; } .gb-grid2 thead tr.grp th.h-name.fx { padding: 0 6px; } }

/* Ventanas medianas: la fila de controles no debe partirse en dos. Primero se va la etiqueta
   «Datos de ejemplo» y luego el texto de guardado (el estado sigue en el menú de la barra). */
@media (max-width: 1180px) { .gb-proto { display: none; } }
@media (max-width: 1000px) and (min-width: 761px) { .gb-status { display: none; } }
@media (max-width: 900px) { #gb-undo .tx { display: none; } #gb-undo { width: 40px; padding: 0; } }
@media (min-width: 761px) and (max-width: 840px) { .gb-toolbar .gb-field select { max-width: 150px; } .gb-toolbar .gb-field.gb-grp-d select { max-width: 76px; } }

/* ==========================================================================
   Dominios más distintivos: paleta propia, nombre corto y modo foco. El fondo de la celda NO lleva el color
   del dominio: el color de la celda es solo de la nota (rojo suave en lo bajo).
   ========================================================================== */
.dchip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; padding: 2px 8px; }
.gb-legend { gap: 6px 8px; }
.gb-legend .lg { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border: 1px solid var(--line); border-radius: 9999px;
  background: #fff; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-3); cursor: pointer; white-space: nowrap;
  transition: border-color .12s, background .12s, box-shadow .12s; }
.gb-legend .lg i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.gb-legend .lg:hover { border-color: var(--c); background: #fafafa; }
.gb-legend .lg.on { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); color: var(--ink); font-weight: 600; }
.gb-legend .lg:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

/* Modo foco: lo que no es del dominio elegido se atenúa. Se atenúa el contenido, no el fondo, para que
   los encabezados fijos sigan tapando lo que pasa por debajo al hacer scroll. */
.gb-grid[data-focus="0"] th:is(.dm1, .dm2, .dm3) > :not(.ah-del):not(.ah-edit),
.gb-grid[data-focus="1"] th:is(.dm0, .dm2, .dm3) > :not(.ah-del):not(.ah-edit),
.gb-grid[data-focus="2"] th:is(.dm0, .dm1, .dm3) > :not(.ah-del):not(.ah-edit),
.gb-grid[data-focus="3"] th:is(.dm0, .dm1, .dm2) > :not(.ah-del):not(.ah-edit) { opacity: .22; }
/* las celdas de datos no son fijas, así que se atenúan enteras (fondo de color incluido) */
.gb-grid[data-focus="0"] td:is(.dm1, .dm2, .dm3),
.gb-grid[data-focus="1"] td:is(.dm0, .dm2, .dm3),
.gb-grid[data-focus="2"] td:is(.dm0, .dm1, .dm3),
.gb-grid[data-focus="3"] td:is(.dm0, .dm1, .dm2) { opacity: .28; }

.dchip { text-transform: none; letter-spacing: 0; }

/* La fecha ahora lleva el año (dd/mm/aaaa); en HS comparte línea con los puntos máximos, así que la columna es un poco más ancha. */
.gb-grid.kind-puntos th.ath { min-width: 126px; width: 126px; max-width: 126px; }
.ah-sub { white-space: nowrap; }

/* Línea gruesa a la izquierda de las columnas de RESULTADO por dominio (no de las actividades), del color de su
   dominio: recorre el encabezado y todas las filas. El color sale de --d0..--d3, que pone el JS (DOM_COL) en la tabla. */
.gb-grid td.calc.dm0, .gb-grid th.h-calc.dm0 { border-left: 3px solid var(--d0); }
.gb-grid td.calc.dm1, .gb-grid th.h-calc.dm1 { border-left: 3px solid var(--d1); }
.gb-grid td.calc.dm2, .gb-grid th.h-calc.dm2 { border-left: 3px solid var(--d2); }
.gb-grid td.calc.dm3, .gb-grid th.h-calc.dm3 { border-left: 3px solid var(--d3); }
/* La última columna de resultado también lleva la línea gruesa a la derecha, para cerrar el bloque. */
.gb-grid td.calc.dlast.dm0, .gb-grid th.h-calc.dlast.dm0 { border-right: 3px solid var(--d0); }
.gb-grid td.calc.dlast.dm1, .gb-grid th.h-calc.dlast.dm1 { border-right: 3px solid var(--d1); }
.gb-grid td.calc.dlast.dm2, .gb-grid th.h-calc.dlast.dm2 { border-right: 3px solid var(--d2); }
.gb-grid td.calc.dlast.dm3, .gb-grid th.h-calc.dlast.dm3 { border-right: 3px solid var(--d3); }

/* ---- Listado de gradebooks (pantalla inicial; mismas medidas que la vista del Campus) ---- */
.grp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.grp-chip { height: 30px; min-width: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-3); transition: all .12s; }
.grp-chip:hover { border-color: var(--ink); }
.grp-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.empty { padding: 48px; text-align: center; color: var(--muted); font-size: 16px; }
.gl-wrap { display: flex; flex-direction: column; gap: 16px; }
.gl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.gl-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gl-title h2 { font-size: 18px; font-weight: 700; }
.gl-pill { font-size: 11px; font-weight: 600; color: #8a6a1f; background: #fff7e6; border: 1px solid #f0d9a8;
  border-radius: 999px; padding: 3px 10px; cursor: help; white-space: nowrap; }
.gl-head-r { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gl-as-wrap { position: relative; }
.gl-as { font: inherit; font-size: 13px; width: 260px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 9999px; background: #fff; }
.gl-as:focus { outline: none; border-color: var(--ink); }
.gl-as-list { position: absolute; right: 0; top: calc(100% + 6px); width: 340px; max-width: 88vw; z-index: 30; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: rgba(0,0,0,.14) 0 8px 28px; padding: 6px; max-height: 340px; overflow-y: auto; }
.gl-as-it { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: none;
  background: none; cursor: pointer; padding: 8px 10px; border-radius: 8px; font: inherit; }
.gl-as-it:hover, .gl-as-it:focus-visible { background: var(--row-hover); outline: none; }
.gl-as-it strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.gl-as-it span { font-size: 12px; color: var(--muted); }
.gl-as-none { padding: 10px; font-size: 12.5px; color: var(--muted); }
.gl-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line-soft); border-radius: 16px; padding: 14px 16px; background: #fff; }
.gl-search { flex: 1 1 240px; min-width: 0; font: inherit; font-size: 14px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 9999px; background: #fff; }
.gl-search:focus { outline: none; border-color: var(--ink); }
.gl-sel { font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-3); height: 30px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.gl-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.gl-seg button { border: none; background: #fff; cursor: pointer; padding: 7px 12px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); }
.gl-seg button.active { background: var(--brand); color: #fff; }
.gl-exp { display: flex; gap: 12px; margin-left: auto; }
.gl-lnk { border: none; background: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.gl-lnk:hover { color: var(--brand); text-decoration: underline; }
.gl-note { font-size: 13px; color: var(--muted); }
.gl-secs { display: flex; flex-direction: column; }
.gl-sec { border-top: 1px solid var(--line-soft); padding: 12px 0 2px; }
.gl-sec:not([open]) { padding-bottom: 12px; }
.gl-sec-head { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.gl-sec:not([open]) > .gl-sec-head { margin-bottom: 0; }
.gl-sec-head::-webkit-details-marker { display: none; }
.gl-sec-head::before { content: "▸"; font-size: 11px; color: var(--muted); transition: transform .13s ease; }
.gl-sec[open] > .gl-sec-head::before { transform: rotate(90deg); }
.gl-sec-head:hover { color: var(--brand); }
.gl-count { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; font-size: 13px; }
.gl-mailtag { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 4px; }
.gl-nivs { display: inline-flex; gap: 6px; margin-left: 6px; }
.gl-nivs i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--chip); border-radius: 999px; padding: 2px 9px; }
mark { background: #fff1a8; color: inherit; border-radius: 3px; padding: 0 1px; }
.gl-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.gl-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit;
  border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; transition: border-color .13s, box-shadow .13s; }
.gl-card.gl-one { cursor: pointer; }
.gl-card:hover, .gl-card:focus-visible { border-color: var(--ink); box-shadow: rgba(0,0,0,.07) 0 3px 12px; outline: none; }
.gl-ico { flex: none; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 10px; background: var(--fam-bg); color: var(--brand); }
.gl-ico svg { width: 20px; height: 20px; }
.gl-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; align-items: flex-start; }
.gl-subject { font-size: 15px; font-weight: 600; color: var(--ink); }
.gl-meta { font-size: 13px; color: var(--muted); }
.gl-co { font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-arrow { flex: none; color: var(--muted); font-size: 15px; }
.gl-card.gl-one:hover .gl-arrow { color: var(--brand); }
.gl-grs { display: flex; flex-wrap: wrap; gap: 5px; }
.gl-chip { font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-3); background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 3px 9px; cursor: pointer; transition: all .12s; }
.gl-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--fam-bg); }
.gl-sheet { font-size: 12px; font-weight: 600; color: var(--muted); width: fit-content; cursor: pointer; white-space: nowrap; list-style: none; }
.gl-sheet::-webkit-details-marker { display: none; }
.gl-sheet:hover { color: var(--brand); text-decoration: underline; }
.gl-pop { position: relative; display: inline-block; }
.gl-pop-box { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 110px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: rgba(0,0,0,.14) 0 6px 20px; padding: 6px; display: flex; flex-direction: column; text-align: left; }
.gl-pop-box a { font-size: 12.5px; font-weight: 600; padding: 5px 8px; border-radius: 6px; color: var(--ink-3); white-space: nowrap; }
.gl-pop-box a:hover { background: var(--row-hover); color: var(--brand); }
.gl-table-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.gl-scroll { overflow-x: auto; }
table.gl-dt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.gl-dt th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .3px; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.gl-dt td { padding: 9px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.gl-dt tbody tr:last-child td { border-bottom: none; }
tr.gl-one { cursor: pointer; }
tr.gl-row:hover td { background: var(--row-hover); }
.gl-subj { font-weight: 600; }
.gl-mail { color: var(--ink-3); }
.gl-act { text-align: right; white-space: nowrap; width: 1%; }
@media (max-width: 640px) { .gl-cards { grid-template-columns: 1fr; } .gl-exp { margin-left: 0; } .gl-as { width: 100%; } .gl-head-r { width: 100%; } .gl-as-wrap { flex: 1; } }

/* ---- «Ver como» (administradores): franja inferior como la del Campus; la grilla queda en solo lectura ---- */
body.gb-preview { padding-bottom: 52px; }
#preview-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; background: #2a2a2a; color: #fff; font-size: 13px; box-shadow: 0 -2px 14px rgba(0,0,0,.22); }
#preview-bar .pv-badge { background: var(--brand); color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .5px; padding: 3px 8px; border-radius: 6px; flex: none; }
#preview-bar .pv-tx { flex: 1; min-width: 0; }
#preview-bar .pv-tx strong { font-weight: 700; }
#preview-bar .pv-tx em { font-style: normal; color: #ffd7a8; font-weight: 600; }
#preview-bar .pv-note { color: #bdbdbd; }
#preview-bar .pv-exit { background: #fff; color: #222; border: none; border-radius: 8px; padding: 6px 14px; font-weight: 600; font-size: 13px; cursor: pointer; flex: none; }
#preview-bar .pv-exit:hover { background: #f0f0f0; }
body.gb-app.gb-preview { padding-bottom: 0; }
body.gb-app.gb-preview #app-view { height: calc(100vh - 46px); height: calc(100dvh - 46px); }
.gb-ro:not(.gb-prev) #gb-add, .gb-ro #gb-add-col, .gb-ro:not(.gb-prev) #gb-undo, .gb-ro .ah-del, .gb-ro .ah-edit, .gb-ro #gb-reset { display: none !important; }
@media (max-width: 760px) { #preview-bar .pv-note { display: none; } }

/* ---- Selector de idioma (preferencia del docente) ---- */
.gb-lang { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex: none; }
.gb-lang button { border: none; background: #fff; cursor: pointer; padding: 7px 11px; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.gb-lang button:hover { color: var(--ink); }
.gb-lang button.on { background: var(--brand); color: #fff; }
.gb-lang-login { align-self: center; }
@media (max-width: 760px) { .gb-lang button { padding: 7px 9px; } }
@media (max-width: 480px) { .beta-tag { display: none; } .logo-text { font-size: 17px; } .topbar-inner { gap: 8px; } .brand .logo-mark { width: 36px; height: 36px; } .wordmark { min-width: 0; } }
@media (max-width: 480px) { .topbar .btn-sm { padding: 0 11px; } .gb-lang button { padding: 7px 8px; } .user { gap: 6px; } }

.gb-proto.gb-real { color: #1f6f4a; background: #eaf6ef; border-color: #bfe3cd; }
.gb-status.err { color: var(--danger); cursor: pointer; text-decoration: underline; }

/* ---- Cierre de trimestre (bloqueo de edición) ---- */
.gb-lockbar { flex: none; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; border-radius: 10px; padding: 8px 12px; margin: 2px 0 8px; }
.gb-lockbar svg { width: 16px; height: 16px; flex: none; }
.gb-lockbar.cerrado { background: #fdecea; color: #9b1c12; border: 1px solid #f5c2bd; }
.gb-lockbar.reabierto { background: #eaf6ef; color: #1f6f4a; border: 1px solid #bfe3cd; }
.gb-lockbar.admin { background: #fff7e6; color: #8a6a1f; border: 1px solid #f0d9a8; }
.gm-wide { max-width: 640px; width: 94vw; }
.cz-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 4px; }
.cz-row { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cz-t { font-size: 13.5px; }
.cz-re { color: #1f6f4a; font-weight: 600; font-size: 12.5px; margin-top: 2px; }
.cz-f { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cz-d, .cz-m { font: inherit; font-size: 13px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.cz-m { flex: 1 1 140px; min-width: 0; }

/* ---- Notas heredadas por traslado ---- */
.her-b { display: inline-block; font-size: 10.5px; font-weight: 700; color: #8a6a1f; background: #fff7e6; border: 1px solid #f0d9a8; border-radius: 999px; padding: 0 6px; margin-left: 6px; white-space: nowrap; vertical-align: middle; }
.gb-grid td.calc.her { box-shadow: inset 0 -3px 0 #f0d9a8; }
.her-note { color: #8a6a1f; }

/* Editar actividad: lápiz junto al de eliminar */
.ah-edit { position: absolute; top: 5px; right: 31px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0;
  border: none; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s; }
.ah-edit svg { width: 15px; height: 15px; }
.gb-grid th.ath:hover .ah-edit, .ah-edit:focus-visible { opacity: 1; }
.ah-edit:hover { background: var(--row-hover); color: var(--brand); }
@media (hover: none) { .ah-edit { opacity: .55; } }

/* Encabezado de actividad clicable + modal de detalle */
.gb-grid th.ath { cursor: pointer; }
.gb-grid th.ath:hover { background: #f7f2f2; }
.gb-grid th.ath:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ad-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.ad-head h3 { margin: 0; }
.ad-cat { align-self: flex-start; font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 999px; padding: 2px 10px; }
.ad-list { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 10px 0 4px; font-size: 14px; }
.ad-list dt { color: var(--muted); font-weight: 600; font-size: 12.5px; padding-top: 1px; }
.ad-list dd { margin: 0; }
.ad-res { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.ad-dist { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-dist .lv { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.ad-foot { font-size: 12px; margin: 8px 0 0; }
.gm-actions .gb-spacer { flex: 1; }
@media (max-width: 480px) { .ad-list { grid-template-columns: 1fr; gap: 2px 0; } .ad-list dd { margin-bottom: 6px; } }
.ad-dist .lv.n-mas { background: #e4f4ea; color: #1a7f4b; } .ad-dist .lv.n-pro { background: #e3f0f5; color: #1f6f8b; }
.ad-dist .lv.n-bas { background: #f8efd9; color: #9a6a11; } .ad-dist .lv.n-not { background: #fbe6e1; color: #c13515; }
.ad-dist .lv.n-noe, .ad-dist .lv.n-dash { background: #eee; color: #6a6a6a; }
.gbf-del { color: var(--danger); border-color: var(--danger); }
.gbf-del:hover:not(:disabled) { background: #fdf3f1; }

/* ---- Opciones de arriba plegables (flecha) ---- */
.gb-controls { flex: none; display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s ease, opacity .22s ease; }
.gb-controls-in { min-height: 0; }
.gb-folded .gb-controls { grid-template-rows: 0fr; opacity: 0; pointer-events: none; }
.gb-folded .gb-controls-in, .gb-anim .gb-controls-in { overflow: hidden; }
.gb-legend { max-height: 96px; overflow-y: hidden; transition: max-height .3s ease, opacity .22s ease, margin .3s ease, padding .3s ease; }
.gb-folded .gb-legend { max-height: 0; opacity: 0; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.gb-fold-row { flex: none; display: flex; align-items: center; gap: 10px; min-height: 28px; margin: 0 0 6px; }
.gb-fold { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: color .12s, border-color .12s; }
.gb-fold:hover, .gb-fold:focus-visible { color: var(--ink); border-color: var(--ink); outline: none; }
.gb-fold svg { width: 14px; height: 14px; transition: transform .3s ease; }
.gb-folded .gb-fold svg { transform: rotate(180deg); }
.gb-fold-row .gb-status { display: block !important; min-width: 0; margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .gb-controls, .gb-legend, .gb-fold svg { transition: none; } }

/* En celular el acceso al Campus lleva una casa (y no otra flecha igual a la de volver al listado) */
.ic-home { display: none; width: 18px; height: 18px; }
@media (max-width: 760px) { .topbar .ar { display: none; } .ic-home { display: block; } }

/* Fallo de guardado: aviso fijo + celdas pendientes en rojo */
.gb-errbar { flex: none; display: flex; align-items: center; gap: 12px; justify-content: space-between; background: #fdecea; color: #9b1c12; border: 1px solid #f5c2bd; border-radius: 10px; padding: 8px 12px; margin: 2px 0 8px; font-size: 13px; }
.gb-errbar.hidden { display: none; }
.gb-errbar .eb-m { font-weight: 400; font-size: 12px; opacity: .85; }
td.cell.unsaved { box-shadow: inset 0 0 0 2px var(--danger, #c0392b); background-image: linear-gradient(rgba(192,57,43,.12), rgba(192,57,43,.12)); }

.gl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 12px; }
.gl-tabs button { border: none; background: none; cursor: pointer; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.gl-tabs button:hover { color: var(--ink, #222); }
.gl-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.gl-chip-off { cursor: default; pointer-events: none; }

.gm-card textarea { resize: vertical; height: auto; min-height: 64px; padding: 8px 12px; line-height: 1.4; font: inherit; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink); }

/* estándar con sugerencias */
.gm-combo { position: relative; }
.gm-combo-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 5; max-height: 180px; overflow-y: auto; background: var(--bg, #fff); border: 1px solid var(--line, #d8d8d8); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.gm-combo-opt { padding: 8px 12px; font-size: 13px; font-weight: 400; line-height: 1.35; text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer; }
.gm-combo-opt:hover { background: rgba(0,0,0,.06); }

/* diálogo de actividad: más ancho en pantallas grandes, fecha y dominio/categoría en dos columnas */
.gm-combo textarea { width: 100%; box-sizing: border-box; }
.gm-card.gm-act { max-width: 640px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.gm-card.gm-act > h3, .gm-card.gm-act > .gm-full, .gm-card.gm-act > .gm-actions, .gm-card.gm-act > .gm-text { grid-column: 1 / -1; }
.gm-card.gm-act .gm-combo textarea { min-height: 110px; }
@media (max-width: 560px) { .gm-card.gm-act { display: flex; } }

/* descarga a Excel */
.gm-card.gm-exp { max-width: 520px; max-height: 88vh; overflow-y: auto; }
.gx-niv-t { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px; }
.gx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px 12px; }
.gx-sel { padding-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.gx-bar { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.gx-bar i { display: block; height: 100%; width: 0; background: var(--brand, #a00000); transition: width .2s; }
.gx-txt { margin-top: 6px; font-size: 12px; color: var(--muted); }
.gx-niv { margin-top: 6px; }
.gx-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.gx-row > .gm-check { flex: 0 0 120px; }
.gx-hrs { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-hr { position: relative; cursor: pointer; }
.gx-hr input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.gx-hr span { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--ink); background: #fff; }
.gx-hr input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.gx-hr input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
