/* ============================================================
   Aula Virtual Grupo SARP — hoja de estilos compartida
   Sobria y legible. Se usa desde teléfono, muchas veces con
   conexión mala: nada de fuentes externas ni imágenes pesadas.
   ============================================================ */

:root {
  --tinta: #16202b;
  --tinta-suave: #5a6b7b;
  --fondo: #eef1f4;
  --panel: #ffffff;
  --borde: #d3dae1;
  --acento: #1c5d99;
  --acento-oscuro: #164a7a;
  --exito: #1b7f4f;
  --alerta: #a8570f;
  --error: #b3261e;
  --radio: 8px;
  --sombra: 0 1px 3px rgba(22, 32, 43, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--tinta);
  background: var(--fondo);
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

h1 {
  font-size: 1.4rem;
}
h2 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--acento);
}

/* ---------- Estructuras ---------- */

.pagina {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1rem;
}

.centrado {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.5rem;
}

.panel-acceso {
  width: 100%;
  max-width: 24rem;
}

.encabezado {
  background: var(--panel);
  border-bottom: 1px solid var(--borde);
}

.encabezado .pagina {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.marca {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.marca span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--tinta-suave);
}

.sesion {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--tinta-suave);
}

/* ---------- Formularios ---------- */

.campo {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.pista {
  font-weight: 400;
  color: var(--tinta-suave);
  font-size: 0.85rem;
}

input[type='text'],
input[type='password'],
input[type='email'],
input[type='number'],
input[type='date'],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.7rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--tinta);
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--acento);
  outline-offset: 1px;
  border-color: var(--acento);
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radio);
  border: 1px solid transparent;
  cursor: pointer;
}

.boton-principal {
  width: 100%;
  color: #fff;
  background: var(--acento);
}

.boton-principal:hover:not(:disabled) {
  background: var(--acento-oscuro);
}

.boton-secundario {
  color: var(--tinta);
  background: #fff;
  border-color: var(--borde);
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---------- Avisos ---------- */

.aviso {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radio);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  border: 1px solid;
}

.aviso-error {
  color: var(--error);
  background: #fdf2f1;
  border-color: #f0c9c6;
}

.aviso-exito {
  color: var(--exito);
  background: #f0f8f3;
  border-color: #bfe0cd;
}

.aviso-atencion {
  color: var(--alerta);
  background: #fdf6ee;
  border-color: #eed9bd;
}

.oculto {
  display: none;
}

/* ---------- Pantallas angostas ---------- */

@media (max-width: 30rem) {
  .panel {
    padding: 1.1rem;
  }
  .pagina {
    padding: 0.75rem;
  }
}

/* ---------- Navegación ---------- */

.navegacion {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--borde);
  background: var(--panel);
}

.navegacion a {
  padding: 0.6rem 0.9rem;
  color: var(--tinta-suave);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}

.navegacion a:hover {
  color: var(--tinta);
}

.navegacion a.activa {
  color: var(--acento);
  border-bottom-color: var(--acento);
}

/* ---------- Barra de herramientas ---------- */

.barra {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.barra .campo {
  margin-bottom: 0;
  flex: 1 1 10rem;
  min-width: 0;
}

.barra .acciones {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.seccion {
  margin-bottom: 1.25rem;
}

.seccion-titulo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.conteo {
  font-size: 0.88rem;
  color: var(--tinta-suave);
}

/* ---------- Tablas ---------- */

.tabla-envoltorio {
  overflow-x: auto;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--borde);
  white-space: nowrap;
}

th {
  background: #f7f9fb;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tinta-suave);
  position: sticky;
  top: 0;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f7f9fb;
}

td.envuelve {
  white-space: normal;
}

.vacio {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--tinta-suave);
}

/* ---------- Insignias ---------- */

.insignia {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid;
}

.insignia-neutra {
  color: var(--tinta-suave);
  background: #f2f5f8;
  border-color: var(--borde);
}
.insignia-exito {
  color: var(--exito);
  background: #f0f8f3;
  border-color: #bfe0cd;
}
.insignia-atencion {
  color: var(--alerta);
  background: #fdf6ee;
  border-color: #eed9bd;
}
.insignia-error {
  color: var(--error);
  background: #fdf2f1;
  border-color: #f0c9c6;
}
.insignia-acento {
  color: var(--acento);
  background: #eef4fa;
  border-color: #c3d8ea;
}

/* ---------- Acciones en fila ---------- */

.acciones-fila {
  display: flex;
  gap: 0.35rem;
}

.boton-enlace {
  background: none;
  border: none;
  padding: 0.2rem 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--acento);
  cursor: pointer;
  border-radius: 4px;
}

.boton-enlace:hover {
  background: #eef4fa;
}

.boton-enlace.peligro {
  color: var(--error);
}

.boton-enlace.peligro:hover {
  background: #fdf2f1;
}

/* ---------- Diálogo ---------- */

dialog {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 0;
  max-width: 34rem;
  width: calc(100% - 2rem);
  color: var(--tinta);
  background: var(--panel);
}

dialog::backdrop {
  background: rgba(22, 32, 43, 0.45);
}

.dialogo-cuerpo {
  padding: 1.25rem;
}

.dialogo-pie {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--borde);
  background: #f7f9fb;
}

.dialogo-pie button {
  width: auto;
}

.rejilla {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.75rem;
}

@media (max-width: 30rem) {
  .rejilla {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reportes de carga en lote ---------- */

.reporte {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.reporte-resumen {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.reporte-lista {
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
}

.reporte-lista table {
  font-size: 0.86rem;
}

.clave-temporal {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.entrada-archivo {
  display: block;
  width: 100%;
  padding: 0.5rem 0;
  font-size: 0.92rem;
}

/* ---------- Editor de texto con formato ---------- */

.editor-barra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.4rem;
  border: 1px solid var(--borde);
  border-bottom: none;
  border-radius: var(--radio) var(--radio) 0 0;
  background: #f7f9fb;
}

.editor-boton {
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tinta);
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 5px;
}

.editor-boton:hover {
  background: #eef4fa;
  border-color: var(--acento);
}

.editor-boton.negrita {
  font-weight: 800;
}
.editor-boton.cursiva {
  font-style: italic;
}

.editor-area {
  min-height: 10rem;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.7rem;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 0 0 var(--radio) var(--radio);
}

.editor-area:focus {
  outline: 2px solid var(--acento);
  outline-offset: -2px;
}

.editor-area h2,
.editor-area h3 {
  margin: 0.6rem 0 0.3rem;
}

.editor-area p {
  margin: 0 0 0.6rem;
}

.editor-area ul,
.editor-area ol {
  margin: 0 0 0.6rem;
  padding-left: 1.4rem;
}

/* ---------- Temario editable ---------- */

.modulo {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: var(--panel);
  margin-bottom: 0.9rem;
}

.modulo-cabecera {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--borde);
  background: #f7f9fb;
  border-radius: var(--radio) var(--radio) 0 0;
}

.modulo-numero {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tinta-suave);
  letter-spacing: 0.04em;
}

.modulo-titulo {
  font-weight: 600;
  flex: 1 1 12rem;
}

.modulo-acciones {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.lecciones {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leccion {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--borde);
}

.leccion:last-child {
  border-bottom: none;
}

.leccion-titulo {
  flex: 1 1 12rem;
  min-width: 0;
}

.leccion-datos {
  font-size: 0.82rem;
  color: var(--tinta-suave);
}

.modulo-pie {
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--borde);
  background: #fbfcfd;
  border-radius: 0 0 var(--radio) var(--radio);
}

.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.9rem;
}

.tarjeta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.tarjeta h3 {
  margin: 0;
}

.tarjeta-codigo {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--tinta-suave);
}

.tarjeta-datos {
  font-size: 0.85rem;
  color: var(--tinta-suave);
}

.tarjeta-pie {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.5rem;
}

.migaja {
  font-size: 0.88rem;
  color: var(--tinta-suave);
  margin-bottom: 0.4rem;
}

.migaja a {
  color: var(--tinta-suave);
}
