/* FAUM · Sistema de Gestión Académica — componentes (CSS propio, compatible con Bootstrap 5).
   Depende de tokens.css (variables --azul, --space-4, --radius-lg…). Prefijo: sg- */

/* ---------- Base ---------- */
.sg, .sg * { box-sizing: border-box; }
.sg { font-family: var(--font-sans); color: var(--texto); font-size: 15px; line-height: 22px; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
:where(.sg) :is(h1, h2, h3, h4, p) { margin: 0; }
:where(.sg) a { color: var(--azul-oscuro); text-decoration: underline; text-underline-offset: 2px; }
:where(.sg) button { font: inherit; color: inherit; }
:where(.sg) h1, :where(.sg) h2, :where(.sg) h3 { font-size: inherit; }
.sg-ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex: none; }
.sg-spin { animation: sg-spin 1s linear infinite; }
@keyframes sg-spin { to { transform: rotate(360deg); } }
.sg :focus-visible, .sg .is-focus { outline: 2px solid var(--foco); outline-offset: 2px; }
.sg .sg-on-dark :focus-visible, .sg .sg-on-dark .is-focus { outline-color: var(--foco-sobre-oscuro); }
.sg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sg-num { font-variant-numeric: tabular-nums; }
.sg-muted { color: var(--texto-secundario); }
.sg-row { display: flex; align-items: center; gap: var(--space-2); }
.sg-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.sg-grow { flex: 1 1 auto; min-width: 0; }
.sg-t-apoyo { font-size: 13px; line-height: 18px; color: var(--texto-secundario); }
.sg-t-mini { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.sg-t-titulo { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.01em; }
.sg-t-seccion { font-size: 17px; line-height: 24px; font-weight: 600; }
.sg-t-sub { font-size: 15px; line-height: 22px; font-weight: 600; }

/* ---------- Lienzo de presentación (solo documentación) ---------- */
.sg-board { display: flex; gap: 40px; padding: 32px; background: #DFE3E9; align-items: flex-start; min-height: 100%; flex-wrap: nowrap; }
.sg-board.wrap { flex-wrap: wrap; }
.sg-frame { display: flex; flex-direction: column; gap: 10px; flex: none; }
.sg-frame-label { font-size: 13px; line-height: 18px; color: #374151; display: flex; gap: 8px; align-items: baseline; }
.sg-frame-label b { color: var(--texto); font-weight: 600; }
.sg-frame-note { font-size: 13px; line-height: 19px; color: #374151; max-width: var(--w, 390px); }
.sg-screen { --w: 390px; --h: 844px; width: var(--w); height: var(--h); position: relative; overflow: hidden; background: var(--fondo); display: flex; flex-direction: column; box-shadow: 0 0 0 1px rgba(17,24,39,.10), 0 12px 32px rgba(17,24,39,.12); }
.sg-screen.w320 { --w: 320px; --h: 640px; } .sg-screen.w360 { --w: 360px; --h: 780px; } .sg-screen.w430 { --w: 430px; --h: 932px; }
.sg-screen.tab { --w: 768px; --h: 1024px; } .sg-screen.desk { --w: 1440px; --h: 900px; }
.sg-screen.tall { --h: auto; min-height: 844px; }

/* Áreas seguras (simuladas) */
.sg-status { height: 47px; flex: none; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 28px 8px 32px; font-size: 15px; font-weight: 600; background: var(--superficie); color: var(--texto); }
.sg-status.dark { background: var(--gris-institucional); color: #fff; }
.sg-status.blue { background: var(--azul-profundo); color: #fff; }
.sg-status.clear { background: transparent; }
.sg-status .sg-status-i { display: flex; gap: 6px; font-size: 13px; align-items: center; }
.sg-status .bat { width: 24px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; opacity: .9; }
.sg-status .bat::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; background: currentColor; border-radius: 1px; }
.sg-home { height: 34px; flex: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; background: inherit; }
.sg-home::after { content: ""; width: 134px; height: 5px; border-radius: 3px; background: var(--texto); }
.sg-home.dark::after { background: #fff; }

/* ---------- Barra superior móvil ---------- */
.sg-appbar { height: var(--barra-superior); flex: none; display: flex; align-items: center; gap: 4px; padding: 0 4px 0 4px; background: var(--superficie); border-bottom: 1px solid var(--borde); position: relative; z-index: 2; }
.sg-appbar-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.sg-appbar-title small { display: block; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--texto-secundario); }
.sg-appbar.dark { background: var(--gris-institucional); color: #fff; border-bottom-color: var(--gris-institucional-2); }
.sg-appbar.dark .sg-appbar-title small { color: var(--texto-sobre-oscuro-2); }
.sg-appbar-logo { height: 26px; width: auto; display: block; }
.sg-iconbtn { width: var(--tactil-min); height: var(--tactil-min); flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: var(--radius-md); font-size: 20px; color: inherit; position: relative; cursor: pointer; }
.sg-iconbtn:hover { background: var(--azul-tenue); }
.sg-appbar.dark .sg-iconbtn:hover { background: var(--gris-institucional-2); }
.sg-dot { position: absolute; top: 9px; right: 9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--error-texto); color: #fff; font-size: 11px; line-height: 16px; font-weight: 700; text-align: center; box-shadow: 0 0 0 2px var(--superficie); }
.sg-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--azul-tenue); color: var(--azul-oscuro); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex: none; overflow: hidden; }
.sg-avatar.lg { width: 88px; height: 88px; font-size: 30px; }
.sg-avatar.md { width: 48px; height: 48px; font-size: 17px; }
.sg-avatar.photo { background: linear-gradient(160deg, #C9D6E2, #8FA6BC); color: #fff; }

/* Chip de contexto (nodo · ciclo) */
.sg-ctx { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--superficie); border-bottom: 1px solid var(--borde); flex: none; }
.sg-ctx-chip { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--azul-tenue); color: var(--azul-oscuro); font-size: 14px; font-weight: 600; border: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; position: relative; }
.sg-ctx-chip::before { content: ""; position: absolute; inset: -4px 0; } /* área táctil 44 px */
.sg-ctx-chip .sg-ico:last-child { font-size: 12px; }
.sg-ctx-role { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--texto-secundario); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Contenido ---------- */
.sg-body { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.sg-body.flush { padding: 0; gap: 0; }
.sg-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.sg-section-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sg-section-h a, .sg-link { font-size: 14px; font-weight: 600; color: var(--azul-oscuro); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.sg-section-h a:hover, .sg-link:hover { text-decoration: underline; }

/* ---------- Tarjetas y listas ---------- */
.sg-card { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radius-lg); box-shadow: var(--sombra-1); }
.sg-card-b { padding: 16px; }
.sg-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--borde); min-height: 52px; }
.sg-card-f { padding: 4px 16px; border-top: 1px solid var(--borde); }
.sg-list { list-style: none; margin: 0; padding: 0; }
.sg-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; border-bottom: 1px solid var(--borde); text-decoration: none; color: inherit; }
.sg-item:last-child { border-bottom: 0; }
.sg-item-ico { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--azul-tenue); color: var(--azul-oscuro); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.sg-item-ico.warn { background: var(--advertencia-tenue); color: var(--advertencia-texto); }
.sg-item-ico.err { background: var(--error-tenue); color: var(--error-texto); }
.sg-item-ico.ok { background: var(--exito-tenue); color: var(--exito-texto); }
.sg-item-ico.neutral { background: var(--fondo); color: var(--texto-secundario-fondo); }
.sg-item-t { font-weight: 600; font-size: 15px; line-height: 20px; }
.sg-item-s { font-size: 13px; line-height: 18px; color: var(--texto-secundario); }
.sg-chev { color: var(--texto-secundario); font-size: 13px; }
.sg-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; line-height: 20px; }
.sg-dl dt { color: var(--texto-secundario); } .sg-dl dd { margin: 0; font-weight: 500; }

/* ---------- Botones ---------- */
.sg-btn { min-height: var(--tactil-min); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: var(--radius-md); border: 1px solid transparent; font-size: 15px; font-weight: 600; line-height: 20px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.sg-btn-primary { background: var(--azul-oscuro); color: #fff; }
.sg-btn-primary:hover, .sg-btn-primary.is-hover { background: var(--azul-profundo); }
.sg-btn-secondary { background: var(--superficie); color: var(--azul-oscuro); border-color: var(--borde-control); }
.sg-btn-secondary:hover, .sg-btn-secondary.is-hover { background: var(--azul-tenue); border-color: var(--azul-oscuro); }
.sg-btn-soft { background: var(--azul-tenue); color: var(--azul-oscuro); }
.sg-btn-ghost { background: transparent; color: var(--azul-oscuro); padding: 0 12px; }
.sg-btn-ghost:hover { background: var(--azul-tenue); }
.sg-btn-danger { background: var(--superficie); color: var(--error-texto); border-color: var(--error); }
.sg-btn-lg { min-height: var(--boton-alto); font-size: 16px; }
.sg-btn-block { width: 100%; }
.sg-btn[disabled], .sg-btn.is-disabled { background: #E5E7EB; color: #6B7280; border-color: transparent; cursor: not-allowed; }
.sg-btn.is-loading { background: var(--azul-profundo); cursor: progress; }
.sg-btn-on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }

/* ---------- Campos ---------- */
.sg-field { display: flex; flex-direction: column; gap: 6px; }
.sg-label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--texto); }
.sg-label .opt { font-weight: 400; color: var(--texto-secundario); }
.sg-input, .sg-select, .sg-textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--borde-control); border-radius: var(--radius-md); background: var(--superficie); font: inherit; font-size: 16px; line-height: 24px; color: var(--texto); }
.sg-input::placeholder { color: #6B7280; }
.sg-input:focus, .sg-input.is-focus, .sg-textarea:focus { outline: 2px solid var(--foco); outline-offset: 1px; border-color: var(--azul-oscuro); }
.sg-input.is-invalid { border-color: var(--error); border-width: 2px; padding: 10px 13px; }
.sg-input[readonly], .sg-input.is-readonly { background: var(--fondo); border-style: dashed; color: var(--texto); }
.sg-textarea { min-height: 112px; resize: vertical; }
.sg-inputgroup { position: relative; display: flex; }
.sg-inputgroup .sg-input { padding-right: 52px; }
.sg-inputgroup .sg-iconbtn { position: absolute; right: 2px; top: 2px; font-size: 18px; color: var(--texto-secundario); }
.sg-inputgroup .lead { position: absolute; left: 14px; top: 14px; color: var(--texto-secundario); font-size: 16px; pointer-events: none; }
.sg-inputgroup.has-lead .sg-input { padding-left: 42px; }
.sg-help { font-size: 13px; line-height: 18px; color: var(--texto-secundario); }
.sg-err { font-size: 13px; line-height: 18px; color: var(--error-texto); font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.sg-err .sg-ico { margin-top: 2px; }
.sg-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.sg-legend { font-size: 17px; font-weight: 600; line-height: 24px; padding: 0; margin-bottom: 4px; }
.sg-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.sg-check .box { width: 22px; height: 22px; border: 2px solid var(--borde-control); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.sg-check .box.on { background: var(--azul-oscuro); border-color: var(--azul-oscuro); }
.sg-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--texto-secundario); }

/* Pestañas segmentadas (tipo de entrada, día/semana) */
.sg-seg { display: flex; padding: 4px; gap: 4px; background: var(--fondo); border-radius: 12px; border: 1px solid var(--borde); }
.sg-seg button, .sg-seg a { flex: 1 1 0; min-height: 44px; border: 0; background: transparent; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--texto-secundario-fondo); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; padding: 0 6px; white-space: nowrap; }
.sg-seg [aria-selected="true"], .sg-seg [aria-pressed="true"] { background: var(--superficie); color: var(--azul-oscuro); box-shadow: 0 1px 2px rgba(17,24,39,.12), inset 0 0 0 1px var(--borde); }
.sg-seg.compact { gap: 2px; } .sg-seg.compact button { flex: 1 1 auto; padding: 0 5px; font-size: 13.5px; }
.sg-seg.xs button { font-size: 13px; padding: 0 3px; gap: 3px; letter-spacing: -.01em; }
.sg-seg .soon { font-size: 11px; font-weight: 700; color: var(--texto-secundario-fondo); background: var(--borde); border-radius: 4px; padding: 1px 5px; }

/* ---------- Avisos ---------- */
.sg-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md); font-size: 14px; line-height: 20px; border: 1px solid; }
.sg-alert > .sg-ico { font-size: 18px; margin-top: 1px; }
.sg-alert b { font-weight: 600; }
.sg-alert > div > b:first-child { display: block; }
.sg-alert.info { background: var(--azul-tenue); border-color: #BFDDEE; color: var(--texto); } .sg-alert.info > .sg-ico { color: var(--azul-oscuro); }
.sg-alert.ok { background: var(--exito-tenue); border-color: #B7DEC8; color: var(--texto); } .sg-alert.ok > .sg-ico { color: var(--exito); }
.sg-alert.warn { background: var(--advertencia-tenue); border-color: #F5D3A1; color: var(--texto); } .sg-alert.warn > .sg-ico { color: var(--advertencia); }
.sg-alert.err { background: var(--error-tenue); border-color: #F2B8BE; color: var(--texto); } .sg-alert.err > .sg-ico { color: var(--error); }
.sg-alert .sg-btn { margin-top: 8px; }
.sg-demo { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px; background: var(--advertencia-tenue); color: var(--advertencia-texto); font-size: 13px; font-weight: 600; line-height: 18px; border-bottom: 1px solid #F5D3A1; flex: none; text-align: center; }
.sg-offline { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--gris-institucional); color: #fff; font-size: 14px; line-height: 20px; flex: none; }
.sg-offline .sg-btn { min-height: 36px; padding: 0 12px; font-size: 14px; margin-left: auto; position: relative; }
.sg-offline .sg-btn::before { content: ""; position: absolute; inset: -4px 0; }
.sg-toast { position: absolute; left: 16px; right: 16px; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-md); background: var(--gris-institucional); color: #fff; font-size: 14px; line-height: 20px; box-shadow: var(--sombra-2); z-index: 20; }
.sg-toast .sg-ico { color: #7FD1A6; font-size: 18px; }

/* Insignias de estado (siempre icono + texto) */
.sg-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.sg-badge.ok { background: var(--exito-tenue); color: var(--exito-texto); }
.sg-badge.warn { background: var(--advertencia-tenue); color: var(--advertencia-texto); }
.sg-badge.err { background: var(--error-tenue); color: var(--error-texto); }
.sg-badge.info { background: var(--azul-tenue); color: var(--azul-oscuro); }
.sg-badge.neutral { background: var(--fondo); color: var(--texto-secundario-fondo); border: 1px solid var(--borde); }
.sg-badge.soon { background: var(--fondo); color: var(--texto-secundario-fondo); border: 1px dashed var(--borde-control); }
.sg-badge.temp { background: var(--advertencia-tenue); color: var(--advertencia-texto); border: 1px solid #F5D3A1; }
.sg-badge.dark { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- Navegación inferior (profesor) ---------- */
.sg-tabbar { flex: none; background: var(--superficie); border-top: 1px solid var(--borde); position: relative; z-index: 3; }
.sg-tabbar ul { display: flex; list-style: none; margin: 0; padding: 4px 4px 0; height: var(--nav-inferior); }
.sg-tabbar li { flex: 1 1 0; }
.sg-tabbar a { height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--texto-secundario); text-decoration: none; font-size: 12px; line-height: 16px; font-weight: 500; border-radius: var(--radius-md); }
.sg-tabbar a .pill { width: 56px; height: 30px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; }
.sg-tabbar a[aria-current="page"] { color: var(--azul-oscuro); font-weight: 700; }
.sg-tabbar a[aria-current="page"] .pill { background: var(--azul-tenue); }
.sg-tabbar .sg-home { background: var(--superficie); }

/* ---------- Menú lateral / cajón ---------- */
.sg-scrim { position: absolute; inset: 0; background: var(--velo); z-index: 10; }
.sg-drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(var(--menu-lateral), 86%); background: var(--gris-institucional); color: #fff; z-index: 11; display: flex; flex-direction: column; box-shadow: 8px 0 24px rgba(0,0,0,.25); }
.sg-side { background: var(--gris-institucional); color: #fff; display: flex; flex-direction: column; width: var(--menu-lateral); flex: none; }
.sg-side-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 14px 20px; border-bottom: 1px solid var(--gris-institucional-2); min-height: 64px; }
.sg-side-brand img { height: 30px; width: auto; display: block; }
.sg-side-nav { flex: 1; overflow: hidden; padding: 8px 12px 12px; }
.sg-side-g { margin-top: 14px; }
.sg-side-g:first-child { margin-top: 4px; }
.sg-side-gt { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-sobre-oscuro-2); padding: 0 10px 6px; }
.sg-side-a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-md); color: #E6EBF2; text-decoration: none; font-size: 15px; font-weight: 500; }
.sg-side-a .sg-ico { width: 18px; font-size: 16px; color: var(--texto-sobre-oscuro-2); }
.sg-side-a:hover { background: var(--gris-institucional-2); }
.sg-side-a[aria-current="page"] { background: var(--azul-oscuro); color: #fff; font-weight: 600; }
.sg-side-a[aria-current="page"] .sg-ico { color: #fff; }
.sg-side-a.soon { color: var(--texto-sobre-oscuro-2); cursor: default; }
.sg-side-a.soon:hover { background: transparent; }
.sg-side-a .tag { white-space: nowrap; margin-left: auto; font-size: 11px; font-weight: 600; color: var(--texto-sobre-oscuro-2); border: 1px dashed #5E6B80; border-radius: 4px; padding: 0 5px; line-height: 18px; }
.sg-side-foot { border-top: 1px solid var(--gris-institucional-2); padding: 12px; display: flex; align-items: center; gap: 10px; }
.sg-side-foot .who { flex: 1; min-width: 0; font-size: 14px; line-height: 18px; }
.sg-side-foot .who small { display: block; color: var(--texto-sobre-oscuro-2); font-size: 12px; }
.sg-side .sg-iconbtn:hover, .sg-drawer .sg-iconbtn:hover { background: var(--gris-institucional-2); }
.sg-side-ctx { margin: 12px 12px 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--gris-institucional-2); font-size: 13px; line-height: 18px; color: var(--texto-sobre-oscuro-2); }
.sg-side-ctx b { color: #fff; font-weight: 600; display: block; font-size: 14px; }

/* ---------- Panel inferior (bottom sheet) ---------- */
.sg-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--superficie); border-radius: var(--radius-xl) var(--radius-xl) 0 0; z-index: 12; box-shadow: var(--sombra-panel); display: flex; flex-direction: column; max-height: 88%; }
.sg-sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: #C3C8D0; margin: 8px auto 4px; }
.sg-sheet-h { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px 20px; }
.sg-sheet-h h2 { flex: 1; font-size: 18px; font-weight: 700; line-height: 24px; }
.sg-sheet-b { padding: 0 16px 8px; overflow: hidden; }
.sg-sheet-f { padding: 12px 16px; border-top: 1px solid var(--borde); display: flex; gap: 8px; }
.sg-opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: var(--radius-md); border: 1px solid var(--borde); margin-bottom: 8px; background: var(--superficie); }
.sg-opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--borde-control); flex: none; position: relative; }
.sg-opt[aria-checked="true"] { border-color: var(--azul-oscuro); background: var(--azul-tenue); box-shadow: inset 0 0 0 1px var(--azul-oscuro); }
.sg-opt[aria-checked="true"] .radio { border-color: var(--azul-oscuro); }
.sg-opt[aria-checked="true"] .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--azul-oscuro); }
.sg-opt.is-disabled { opacity: 1; background: var(--fondo); color: var(--texto-secundario-fondo); border-style: dashed; }
.sg-opt-t { font-weight: 600; font-size: 15px; line-height: 20px; }
.sg-opt-s { font-size: 13px; line-height: 18px; color: var(--texto-secundario); }

/* ---------- Dashboard ---------- */
.sg-kpis { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.sg-kpi { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.sg-kpi-top { display: flex; align-items: center; justify-content: space-between; font-size: 13px; line-height: 18px; color: var(--texto-secundario); font-weight: 500; }
.sg-kpi-top .sg-ico { color: var(--azul); font-size: 16px; }
.sg-kpi-v { font-size: 28px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sg-kpi-s { font-size: 12px; line-height: 16px; color: var(--texto-secundario); }
.sg-quick { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.sg-quick a { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--superficie); border: 1px solid var(--borde); color: var(--texto); font-weight: 600; font-size: 14px; line-height: 18px; text-decoration: none; }
.sg-quick a .sg-ico { color: var(--azul-oscuro); font-size: 17px; }
.sg-bars { display: flex; flex-direction: column; gap: 14px; }
.sg-bar-row { display: grid; grid-template-columns: 1fr; gap: 6px; }
.sg-bar-l { display: flex; justify-content: space-between; font-size: 14px; line-height: 20px; }
.sg-bar-l b { font-weight: 600; }
.sg-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--fondo); gap: 2px; }
.sg-bar i { display: block; height: 100%; }
.sg-bar .a { background: var(--exito); } .sg-bar .r { background: var(--advertencia); } .sg-bar .f { background: var(--error); } .sg-bar .p { background: repeating-linear-gradient(45deg, #C3C8D0 0 3px, #E5E7EB 3px 6px); }
.sg-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; line-height: 18px; color: var(--texto); }
.sg-key span { display: inline-flex; align-items: center; gap: 6px; }
.sg-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sg-agenda-i { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--borde); }
.sg-agenda-i:last-child { border-bottom: 0; }
.sg-agenda-d { text-align: center; border-radius: var(--radius-md); background: var(--azul-tenue); color: var(--azul-oscuro); padding: 4px 0; line-height: 1.1; }
.sg-agenda-d b { display: block; font-size: 19px; }
.sg-agenda-d small { font-size: 12px; font-weight: 600; text-transform: uppercase; }

/* ---------- Horario ---------- */
.sg-days { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 4px; }
.sg-day { min-height: 56px; border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid transparent; background: transparent; color: var(--texto); text-decoration: none; position: relative; cursor: pointer; }
.sg-day small { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--texto-secundario); text-transform: uppercase; }
.sg-day b { font-size: 17px; line-height: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sg-day .cnt { font-size: 11px; line-height: 14px; color: var(--texto-secundario); }
.sg-day[aria-selected="true"] { background: var(--azul-oscuro); color: #fff; }
.sg-day[aria-selected="true"] small, .sg-day[aria-selected="true"] .cnt { color: #DDEBF5; }
.sg-day.today:not([aria-selected="true"]) { border-color: var(--azul-oscuro); }
.sg-today { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--azul-oscuro); background: var(--azul-tenue); border-radius: var(--radius-pill); padding: 2px 8px; }
.sg-class { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 14px 14px 14px 12px; text-decoration: none; color: inherit; position: relative; }
.sg-class-time { text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; line-height: 20px; font-weight: 700; padding-right: 12px; border-right: 3px solid var(--azul); }
.sg-class-time small { display: block; font-size: 13px; font-weight: 500; color: var(--texto-secundario); }
.sg-class.now .sg-class-time { border-right-color: var(--exito); }
.sg-class.done { opacity: 1; }
.sg-class.done .sg-class-time { border-right-color: var(--borde-control); }
.sg-class-m { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; line-height: 18px; color: var(--texto-secundario); margin-top: 4px; }
.sg-class-m span { display: inline-flex; align-items: center; gap: 5px; }
.sg-class-m .sg-ico { font-size: 12px; }
.sg-break { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--texto-secundario-fondo); padding: 0 4px; }
.sg-break::before, .sg-break::after { content: ""; flex: 1; border-top: 1px dashed #C3C8D0; }
.sg-week { display: grid; grid-template-columns: 64px repeat(6, minmax(0,1fr)); background: var(--superficie); }
.sg-week-h { padding: 10px 8px; font-size: 13px; font-weight: 600; text-align: center; border-bottom: 1px solid var(--borde); border-left: 1px solid var(--borde); line-height: 18px; }
.sg-week-h.today { background: var(--azul-tenue); color: var(--azul-oscuro); }
.sg-week-t { font-size: 12px; color: var(--texto-secundario); text-align: right; padding: 4px 8px 0 0; height: 56px; font-variant-numeric: tabular-nums; }
.sg-week-c { border-left: 1px solid var(--borde); border-top: 1px solid #F1F3F6; height: 56px; position: relative; }
.sg-week-c.today { background: #F7FBFD; }
.sg-ev { position: absolute; left: 4px; right: 4px; top: 3px; border-radius: 8px; padding: 6px 8px; background: var(--azul-tenue); border: 1px solid #BFDDEE; font-size: 12px; line-height: 16px; overflow: hidden; z-index: 1; }
.sg-ev b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 16px; font-weight: 600; color: var(--texto); hyphens: auto; overflow-wrap: break-word; }
.sg-ev span { color: #3F4A5A; }
.sg-ev.alt { background: #F2F4F7; border-color: #D5DAE1; }
.sg-ev.now { background: var(--exito-tenue); border-color: #B7DEC8; }

/* ---------- Filtros ---------- */
.sg-chips { flex: none; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.sg-chip { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--borde-control); background: var(--superficie); font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--texto); position: relative; cursor: pointer; }
.sg-chip::before { content: ""; position: absolute; inset: -4px 0; }
.sg-chip[aria-pressed="true"] { background: var(--azul-oscuro); border-color: var(--azul-oscuro); color: #fff; }
.sg-chip .n { min-width: 20px; height: 20px; border-radius: 10px; background: var(--azul-oscuro); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.sg-chip[aria-pressed="true"] .n { background: #fff; color: var(--azul-oscuro); }
.sg-search { position: relative; }
.sg-search .sg-input { padding-left: 42px; }
.sg-search .sg-ico { position: absolute; left: 14px; top: 16px; color: var(--texto-secundario); }

/* ---------- Registro de asistencia ---------- */
.sg-att { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--borde); }
.sg-att:last-child { border-bottom: 0; }
.sg-att-m { font-size: 13px; line-height: 18px; color: var(--texto-secundario); display: flex; gap: 10px; flex-wrap: wrap; }
.sg-dategroup { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--texto-secundario-fondo); padding: 4px 4px 0; }
.sg-sum { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.sg-sum > div { padding: 12px; text-align: center; border-left: 1px solid var(--borde); }
.sg-sum > div:first-child { border-left: 0; }
.sg-sum b { display: block; font-size: 22px; line-height: 28px; font-variant-numeric: tabular-nums; }
.sg-sum span { font-size: 12px; line-height: 16px; color: var(--texto-secundario); display: inline-flex; gap: 4px; align-items: center; }

/* ---------- Tabla de escritorio ---------- */
.sg-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.sg-table th { text-align: left; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--texto-secundario); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--borde); background: #FAFBFC; }
.sg-table td { padding: 12px 16px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.sg-table tr:last-child td { border-bottom: 0; }

/* ---------- Pantallas de escritorio ---------- */
.sg-shell { display: flex; flex: 1; min-height: 0; }
.sg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sg-topbar { height: 64px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px 0 32px; background: var(--superficie); border-bottom: 1px solid var(--borde); }
.sg-topbar .sg-ctx-chip { min-height: 40px; }
.sg-page { flex: 1; min-height: 0; overflow: hidden; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.sg-grid { display: grid; gap: 20px; }
.sg-crumb { font-size: 13px; color: var(--texto-secundario-fondo); }
.sg-menu { position: absolute; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radius-lg); box-shadow: var(--sombra-2); padding: 6px; z-index: 15; min-width: 260px; }
.sg-menu a, .sg-menu .mi { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--texto); text-decoration: none; font-size: 15px; }
.sg-menu a:hover { background: var(--azul-tenue); }
.sg-menu hr { border: 0; border-top: 1px solid var(--borde); margin: 6px 0; }

/* ---------- Acceso ---------- */
.sg-auth-band { background: var(--azul-profundo); color: #fff; position: relative; overflow: hidden; flex: none; }
.sg-auth-band .geo { position: absolute; inset: 0; pointer-events: none; }
.sg-auth-band .geo line, .sg-auth-band .geo path, .sg-auth-band .geo rect { stroke: rgba(255,255,255,.14); fill: none; stroke-width: 1; }
.sg-auth-band .geo .fillb { fill: rgba(41,139,192,.35); stroke: none; }
.sg-auth-logo { height: 40px; width: auto; display: block; position: relative; }
.sg-auth-form { display: flex; flex-direction: column; gap: 16px; }
.sg-foot { font-size: 12px; line-height: 16px; color: var(--texto-secundario-fondo); display: flex; align-items: center; gap: 8px; }
.sg-foot img { height: 28px; width: auto; }
.sg-kb { flex: none; height: 291px; background: #D1D5DB; display: grid; grid-template-rows: repeat(4, 1fr) 34px; gap: 10px; padding: 8px 4px 0; z-index: 5; }
.sg-kb-r { display: flex; gap: 6px; justify-content: center; padding: 0 3px; }
.sg-kb-r span { flex: 1; max-width: 33px; background: #fff; border-radius: 5px; box-shadow: 0 1px 0 #9CA3AF; font-size: 17px; display: flex; align-items: center; justify-content: center; color: #111827; }
.sg-kb-r span.w { max-width: none; flex: 1.6; background: #ADB3BC; font-size: 13px; }
.sg-kb-r span.sp { max-width: none; flex: 5; font-size: 14px; }
.sg-kb-bar { position: absolute; left: 0; right: 0; height: 44px; background: #F3F4F6; border-top: 1px solid #D1D5DB; display: flex; align-items: center; padding: 0 12px; gap: 12px; font-size: 14px; color: #111827; z-index: 6; }
.sg-kb-bar .pw { white-space: nowrap; }
.sg-kb-bar .pw { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--azul-oscuro); }

/* Conceptual / futuro */
.sg-concept { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px dashed var(--borde-control); border-radius: var(--radius-md); background: repeating-linear-gradient(135deg, #F7F8FA 0 8px, #FFFFFF 8px 16px); font-size: 13px; line-height: 18px; color: var(--texto-secundario); font-weight: 500; }
.sg-skel { background: #E9ECF0; border-radius: 6px; }
.sg-slot { border: 1px dashed var(--borde-control); border-radius: var(--radius-lg); background: var(--superficie); min-height: 88px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--texto-secundario); gap: 8px; }

/* Barra de acción fija (formularios en pantalla completa) */
.sg-actionbar { flex: none; background: var(--superficie); border-top: 1px solid var(--borde); padding: 12px 16px; display: flex; gap: 8px; box-shadow: var(--sombra-panel); position: relative; z-index: 4; }
.sg-steps { display: flex; gap: 6px; }
.sg-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--borde); }
.sg-steps i.on { background: var(--azul-oscuro); }
.sg-upload { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; border: 1px dashed var(--borde-control); border-radius: var(--radius-lg); background: var(--superficie); text-align: center; }
.sg-progress { height: 6px; border-radius: 3px; background: var(--borde); overflow: hidden; width: 100%; }
.sg-progress i { display: block; height: 100%; background: var(--azul-oscuro); }

/* Ampliación de texto: el diseño usa unidades fluidas; con .sg-zoom se simula 130 %. */
.sg-zoom { font-size: 19.5px; line-height: 28px; }

/* Escritorio: menú fijo más compacto (puntero fino) */
.sg-side .sg-side-a { min-height: 40px; }
.sg-side .sg-side-g { margin-top: 10px; }

/* ---------- Módulo de asignación ---------- */
.sg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); background: var(--superficie); padding: 0 12px; flex: none; overflow-x: auto; scrollbar-width: none; }
.sg-tabs a, .sg-tabs button { min-height: 48px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 0; background: none; font-size: 15px; font-weight: 600; color: var(--texto-secundario); text-decoration: none; white-space: nowrap; box-shadow: inset 0 -3px 0 transparent; cursor: pointer; }
.sg-tabs [aria-selected="true"], .sg-tabs [aria-current="page"] { color: var(--azul-oscuro); box-shadow: inset 0 -3px 0 var(--azul-oscuro); }
.sg-tabs .n { font-size: 12px; font-weight: 700; background: var(--fondo); color: var(--texto-secundario-fondo); border-radius: 10px; padding: 1px 7px; }
.sg-meter { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sg-meter-l { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 18px; color: var(--texto-secundario); }
.sg-meter-l b { color: var(--texto); font-variant-numeric: tabular-nums; }
.sg-meter-bar { height: 8px; border-radius: 4px; background: var(--fondo); overflow: hidden; box-shadow: inset 0 0 0 1px var(--borde); }
.sg-meter-bar i { display: block; height: 100%; background: var(--azul); border-radius: 4px; }
.sg-meter-bar i.warn { background: var(--advertencia); }
.sg-meter-bar i.err { background: var(--error); }
.sg-meter-bar i.ok { background: var(--exito); }
.sg-assign { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--borde); align-items: start; }
.sg-assign:last-child { border-bottom: 0; }
.sg-assign-m { display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 18px; color: var(--texto-secundario); }
.sg-assign-m span { display: inline-flex; gap: 6px; align-items: center; }
.sg-assign-m .sg-ico { font-size: 12px; width: 14px; }
.sg-assign-m .miss { color: var(--error-texto); font-weight: 600; }
.sg-assign-m .warn { color: var(--advertencia-texto); font-weight: 600; }
.sg-stepper { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--texto-secundario); }
.sg-stepper ol { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex: 1; }
.sg-stepper li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; line-height: 16px; }
.sg-stepper li::before { content: ""; height: 4px; border-radius: 2px; background: var(--borde); }
.sg-stepper li.done::before, .sg-stepper li.on::before { background: var(--azul-oscuro); }
.sg-stepper li.on { color: var(--azul-oscuro); }
.sg-stepper li.done { color: var(--texto); }
.sg-pick { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; border: 1px solid var(--borde); border-radius: var(--radius-md); background: var(--superficie); margin-bottom: 8px; }
.sg-pick[aria-checked="true"] { border-color: var(--azul-oscuro); box-shadow: inset 0 0 0 1px var(--azul-oscuro); background: var(--azul-tenue); }
.sg-pick.is-blocked { background: var(--fondo); border-style: dashed; }
.sg-slot-chip { min-height: 44px; min-width: 52px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-md); border: 1px solid var(--borde-control); background: var(--superficie); font-weight: 600; font-size: 14px; }
.sg-slot-chip[aria-pressed="true"] { background: var(--azul-oscuro); color: #fff; border-color: var(--azul-oscuro); }
.sg-ev.conflict { background: var(--error-tenue); border: 2px solid var(--error); }
.sg-ev.pending { background: repeating-linear-gradient(135deg, #FFFFFF 0 6px, #F3F5F8 6px 12px); border: 1px dashed var(--borde-control); }
.sg-ev .flag { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--error-texto); font-size: 11px; }
.sg-panel-end { width: 420px; flex: none; background: var(--superficie); border-left: 1px solid var(--borde); display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(17,24,39,.08); }
.sg-panel-h { display: flex; align-items: center; gap: 8px; padding: 14px 12px 14px 24px; border-bottom: 1px solid var(--borde); }
.sg-panel-h h2 { flex: 1; font-size: 18px; line-height: 24px; font-weight: 700; }
.sg-panel-b { flex: 1; min-height: 0; overflow: hidden; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.sg-panel-f { padding: 14px 24px; border-top: 1px solid var(--borde); display: flex; gap: 8px; justify-content: flex-end; }
.sg-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--borde); flex-wrap: wrap; }
.sg-pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--borde); font-size: 13px; color: var(--texto-secundario); }
.sg-table tr.is-sel td { background: var(--azul-tenue); }
.sg-table td .sub { display: block; font-size: 12px; color: var(--texto-secundario); line-height: 16px; }
.sg-occ { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; }
.sg-occ i { height: 20px; border-radius: 3px; background: var(--fondo); box-shadow: inset 0 0 0 1px var(--borde); }
.sg-occ i.on { background: var(--azul); box-shadow: none; }
.sg-occ i.now { background: var(--exito); box-shadow: none; }
.sg-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.sg-count { font-size: 13px; color: var(--texto-secundario); font-variant-numeric: tabular-nums; }
.sg-fab { position: absolute; right: 16px; z-index: 5; min-height: 56px; padding: 0 20px; border-radius: 16px; background: var(--azul-oscuro); color: #fff; border: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; box-shadow: var(--sombra-2); }
.sg-meter-l span:last-child { white-space: nowrap; text-align: right; }
.sg-body:has(~ .sg-fab) { padding-bottom: 88px; }
