/* INESUR Cursos - estilos livianos, sin librerías ni fuentes externas */
:root {
  --primario: #1f4e8c;   /* cambiar por el color de INESUR */
  --primario-osc: #163a69;
  --fondo: #f4f6f9;
  --borde: #dde3ea;
  --texto: #1d2430;
  --muted: #6b7685;
  --ok: #1e7b45;
  --error: #b3261e;
  --aviso: #8a5a00;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--texto); background: var(--fondo); }
a { color: var(--primario); }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 1.2em 0 .5em; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 18px 16px 60px; }
.top { background: var(--primario); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px; }
.top a, .top button.link { color: #fff; text-decoration: none; }
.top .marca { font-weight: 700; font-size: 1.1rem; }
.top nav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.muted { color: var(--muted); font-size: .9em; }
.inline { display: inline; margin: 0; }

.card { background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.grid .card { margin: 0; display: flex; flex-direction: column; }
.grid .card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.grid .card .acciones { margin-top: auto; padding-top: 10px; }
.etiqueta { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 10px; background: #e8eef7; color: var(--primario-osc); }
.etiqueta.gris { background: #eceef1; color: var(--muted); }

.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; border: 1px solid; }
.msg-ok { background: #e8f5ee; border-color: #b7dfc6; color: var(--ok); }
.msg-error { background: #fcebea; border-color: #f2c0bc; color: var(--error); }
.msg-aviso { background: #fff6e0; border-color: #f0d9a0; color: var(--aviso); }

label { display: block; font-weight: 600; margin: 10px 0 4px; font-size: .92em; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--borde); border-radius: 6px; font: inherit; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
.fila { display: flex; gap: 12px; flex-wrap: wrap; }
.fila > * { flex: 1 1 200px; }
.check { display: flex; align-items: center; gap: 6px; font-weight: normal; }

button, .btn { display: inline-block; background: var(--primario); color: #fff; border: 0; border-radius: 6px; padding: 8px 16px; font: inherit; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--primario-osc); }
.btn-sec { background: #fff; color: var(--primario); border: 1px solid var(--primario); }
.btn-sec:hover { background: #eef3fa; }
.btn-chico { background: #fff; color: var(--texto); border: 1px solid var(--borde); padding: 3px 9px; font-size: .85em; border-radius: 5px; }
.btn-chico:hover { background: #eef1f5; }
.btn-peligro { background: var(--error); }
button.link { background: none; padding: 0; color: var(--primario); }
.acciones { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { background: #f0f3f7; font-size: .88em; }
.tabla-scroll { overflow-x: auto; }

/* Curso */
details.unidad { background: #fff; border: 1px solid var(--borde); border-radius: 8px; margin-bottom: 10px; }
details.unidad > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; }
details.unidad > summary::-webkit-details-marker { display: none; }
details.unidad > summary::before { content: "▸ "; color: var(--muted); }
details.unidad[open] > summary::before { content: "▾ "; }
.unidad-cuerpo { padding: 0 16px 12px; }
.material { padding: 10px 0; border-top: 1px solid #eef1f4; }
.material.oculto, .oculto > summary { opacity: .55; }
.mat-titulo { font-weight: 500; }
.mat-texto { margin-top: 6px; }
.video { position: relative; padding-top: 56.25%; margin-top: 8px; max-width: 720px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }

/* Edición */
.item-edit { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid #eef1f4; flex-wrap: wrap; }

/* Login */
.pagina-login { min-height: 100vh; margin: 0; overflow-x: hidden; background: linear-gradient(160deg, #f3f7fc 0%, #e6eef8 100%); }
.pagina-login .wrap { position: relative; z-index: 1; max-width: 1120px; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px 120px; }
.deco-esquina { position: fixed; top: 0; right: 0; width: 34vw; max-width: 420px; height: 190px; z-index: 0; }
.olas { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 150px; z-index: 0; }

.login-caja { display: flex; width: 100%; max-width: 1060px; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 18px 50px rgba(20, 60, 120, .14); }

.login-panel { position: relative; flex: 0 0 37%; padding: 80px 46px 190px; color: #fff; background: linear-gradient(160deg, #1a6fc4 0%, #0c4c97 55%, #0a3f80 100%); overflow: hidden; }
.login-panel .raya { display: block; width: 90px; height: 7px; border-radius: 4px; background: #f5c518; margin-bottom: 26px; }
.login-panel h2 { font-size: 3.4rem; line-height: 1.08; margin: 0 0 22px; font-weight: 800; letter-spacing: -.01em; }
.login-panel p { font-size: 1.3rem; line-height: 1.5; margin: 0; color: #e6effa; }
.login-panel .ilustracion { display: block; width: 72%; max-width: 250px; margin: 46px auto 0; fill: none; stroke: #8cc0f5; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.panel-olas { position: absolute; left: 0; bottom: 0; width: 100%; height: 130px; }

.login { flex: 1; padding: 26px 58px 30px; }
.login h1 { font-size: 2.3rem; margin: 18px 0 2px; }
.login-sub { margin: 0 0 8px; color: #2a3342; font-size: 1.15rem; }
.login-logo { text-align: center; padding-bottom: 20px; border-bottom: 1px solid var(--borde); }
.login-logo img { max-width: 330px; width: 100%; height: auto; }
.logo-texto strong { display: block; font-size: 3rem; color: var(--primario); letter-spacing: .02em; }
.logo-texto span { display: block; font-weight: 700; font-size: .9rem; letter-spacing: .05em; text-transform: uppercase; color: #2a2f38; }
.login label { font-size: 1.1rem; margin-top: 18px; }
.campo-icono { position: relative; }
.campo-icono > svg { position: absolute; left: 18px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%); fill: none; stroke: var(--primario); stroke-width: 1.7; pointer-events: none; }
.campo-icono input { padding: 13px 50px 13px 58px; background: #fff; border: 1.5px solid #cfd7e3; border-radius: 9px; font-size: 1.05rem; }
.campo-icono input::placeholder { color: #6b7380; }
.campo-icono input:focus { outline: none; border-color: #2f6fc0; box-shadow: 0 0 0 3px rgba(47, 111, 192, .15); }
.ver-clave { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; padding: 6px; border-radius: 6px; line-height: 0; }
.ver-clave:hover { background: #e6edf8; }
.ver-clave svg { width: 24px; height: 24px; fill: none; stroke: #2a2f38; stroke-width: 1.7; }
.ver-clave.activo svg { stroke: var(--primario); }
.btn-login { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin-top: 24px; padding: 13px; font-size: 1.25rem; font-weight: 600; border-radius: 9px; background: #0d4a94; }
.btn-login:hover { background: #0a3b78; }
.btn-login svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.olvido { margin-top: 18px; text-align: center; }
.olvido summary { color: #1561b8; cursor: pointer; list-style: none; font-size: 1.1rem; }
.olvido summary::-webkit-details-marker { display: none; }
.olvido summary:hover { text-decoration: underline; }
.olvido p { font-size: .95em; color: #3a4556; margin: 8px 0 0; }
.login-info { display: flex; gap: 14px; align-items: center; margin-top: 18px; padding: 14px 22px; border-radius: 10px; background: #edf2fa; color: #1d2430; font-size: 1.02rem; }
.login-info svg { flex: 0 0 28px; width: 28px; height: 28px; fill: none; stroke: #4a5565; stroke-width: 1.6; stroke-linecap: round; }

@media (max-width: 860px) {
  .login-caja { flex-direction: column; max-width: 520px; }
  .login-panel { flex: none; padding: 30px 28px 80px; }
  .login-panel h2 { font-size: 2.2rem; margin-bottom: 10px; }
  .login-panel p { font-size: 1.05rem; }
  .login-panel .ilustracion { display: none; }
  .panel-olas { height: 60px; }
  .login { padding: 22px 24px 26px; }
  .deco-esquina { width: 50vw; height: 90px; }
  .olas { height: 80px; }
}

/* Listados estilo panel (Usuarios) */
.lead { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding: 24px 28px; border: 1px solid #d9e5f3; border-radius: 12px; background: #eaf2fc; margin-bottom: 20px; }
.lead h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; line-height: 1.14; margin: 0; }
.lead p { margin: 8px 0 0; color: #53647a; }
.lead .btn { font-weight: 650; }
.panel { background: #fff; border: 1px solid var(--borde); border-radius: 12px; overflow: hidden; }
.filtros { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 200px) auto; align-items: end; gap: 12px; padding: 20px; }
.filtros label { display: grid; gap: 5px; margin: 0; }
.filtros input, .filtros select { min-height: 42px; border-color: #bfcfdf; border-radius: 8px; }
.filtros button, .filtros .btn { min-height: 42px; }
.resumen { padding: 0 20px 14px; margin: 0; color: #53647a; font-size: .92rem; }
.tabla-usuarios { min-width: 845px; }
.tabla-usuarios th, .tabla-usuarios td { padding: 11px 14px; vertical-align: middle; }
.tabla-usuarios th:first-child, .tabla-usuarios td:first-child { padding-left: 20px; }
.tabla-usuarios th { background: #f4f7fb; color: #344d69; }
.tabla-usuarios td { font-size: .92rem; }
.tabla-usuarios tbody tr:hover td { background: #f8fafe; }
.persona { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 8px; background: #ebf2fa; color: #193e70; font-size: .84rem; font-weight: 750; }
.tenue { color: #53647a; white-space: nowrap; }
.rol { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: .85rem; font-weight: 650; color: #194c7c; background: #e8f1fc; }
.rol-docente { color: #225648; background: #e4f4ed; }
.rol-admin { color: #6b3d00; background: #fbefd9; }
.acciones-fila { white-space: nowrap; }
.accion-fila { display: inline-block; border: 0; padding: 7px 6px; border-radius: 5px; background: transparent; color: #193e70; font-size: .86rem; font-weight: 700; text-decoration: none; }
.accion-fila:hover { background: #ebf2fa; text-decoration: underline; }
.vacio { text-align: center; padding: 30px 12px; color: #53647a; }
.paginador { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--borde); }
.paginador h2 { font-size: 1rem; margin: 0; }
.paginador .btn { padding-block: 5px; }
.paginador .pagina { padding-inline: 8px; font-size: .9rem; }
.deshabilitado { opacity: .5; pointer-events: none; }
@media (max-width: 680px) {
  .lead, .filtros { padding: 16px; }
  .filtros { grid-template-columns: minmax(0, 1fr) auto; }
  .filtros label:first-child { grid-column: 1 / -1; }
  .resumen, .paginador { padding-inline: 16px; }
}

/* Barra superior con birrete */
.top { background: linear-gradient(90deg, #0d4a94, #1a5fae); }
.top .marca { display: inline-flex; align-items: center; gap: 8px; }
.top .marca svg { width: 26px; height: 26px; fill: #fff; stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; }
.top .marca svg path + path { fill: none; stroke-width: 1.8; }

/* Grilla de cursos */
.pagina-cursos { background:
  radial-gradient(ellipse 420px 120px at 0 0, #cfe0f5 0, transparent 70%),
  radial-gradient(ellipse 420px 130px at 100% 0, #cfe0f5 0, transparent 70%), #f2f6fb; }
.pagina-cursos .wrap { max-width: 1240px; }
.cursos-cabecera { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 6px 0 24px; }
.cursos-titulo { display: flex; align-items: center; gap: 18px; }
.cursos-icono { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 12px; background: linear-gradient(150deg, #1a6fc4, #0c4c97); flex: none; }
.cursos-icono svg { width: 42px; height: 42px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.cursos-titulo h1 { font-size: 2.1rem; margin: 0; color: #0f2a4d; }
.cursos-titulo p { margin: 2px 0 0; color: #53647a; }
.buscador { position: relative; margin: 0; font-weight: normal; }
.buscador svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: #33445a; stroke-width: 2; stroke-linecap: round; }
.buscador input { width: 300px; max-width: 70vw; padding: 11px 14px 11px 44px; border-radius: 10px; border-color: #cbd6e3; }
.btn-nuevo { padding: 11px 22px; border-radius: 10px; font-weight: 700; background: #0d4a94; }

.grid-cursos { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }
.curso-card { display: flex; flex-direction: column; background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 4px 18px rgba(20, 60, 120, .08); border: 1px solid #e6edf5; }
.curso-card[hidden] { display: none; }
.curso-cuerpo { display: flex; gap: 18px; flex: 1; }
.curso-tile { position: relative; display: grid; place-items: center; width: 110px; height: 140px; flex: none; border-radius: 10px; overflow: hidden; }
.curso-tile > svg:first-child { position: relative; z-index: 1; width: 58px; height: 58px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; margin-bottom: 26px; }
.tile-ola { position: absolute; left: 0; bottom: 0; width: 100%; height: 42%; }
.tile-ola path { fill: rgba(255, 255, 255, .35); }
.tile-azul { background: linear-gradient(170deg, #0a5aa6 55%, #33b6ee); }
.tile-violeta { background: linear-gradient(170deg, #5b3aa8 55%, #a47be0); }
.tile-turquesa { background: linear-gradient(170deg, #1a8e8a 55%, #5fd0d6); }
.tile-celeste { background: linear-gradient(170deg, #1d74e0 55%, #7db6f7); }
.tile-naranja { background: linear-gradient(170deg, #d4730f 55%, #f6b24a); }
.tile-marino { background: linear-gradient(170deg, #163a69 55%, #4a82c9); }
.curso-info { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.curso-info h3 { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.curso-info h3 a { color: #0f3a73; text-decoration: none; }
.curso-info h3 a:hover { text-decoration: underline; }
.chip { display: inline-block; max-width: 100%; padding: 3px 12px; border-radius: 14px; background: #e6eef9; color: #1d3555; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-docente { background: #e4f4ed; color: #225648; }
.chip-gris { background: #eceef1; color: #6b7685; }
.curso-alumnos { display: flex; align-items: center; gap: 6px; margin: 0; color: #2a3342; }
.curso-alumnos svg { width: 20px; height: 20px; fill: none; stroke: #2a3342; stroke-width: 1.7; }
.curso-botones { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.btn-borde { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border: 1.5px solid #cdd8e6; border-radius: 10px; color: #0f3a73; text-decoration: none; font-weight: 500; background: #fff; }
.btn-borde.fuerte { font-weight: 700; }
.btn-borde:hover { background: #eef3fa; border-color: #9fb6d4; }
.btn-borde svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
@media (max-width: 520px) {
  .grid-cursos { grid-template-columns: 1fr; }
  .curso-tile { width: 84px; height: 110px; }
  .cursos-icono { width: 56px; height: 56px; }
  .buscador input { width: 100%; max-width: none; }
  .cursos-cabecera .acciones, .buscador { width: 100%; }
}
.accion-fila.peligro { color: #b3261e; }
.accion-fila.peligro:hover { background: #fcebea; }

/* ===== Vista del curso ===== */
.pagina-curso { background: #f2f6fb; }
.pagina-curso .wrap { max-width: 1240px; }
.migas { font-size: .9rem; color: #53647a; margin: 4px 0 14px; }
.migas a { color: #1561b8; text-decoration: none; }
.migas a:hover { text-decoration: underline; }
.migas span { margin: 0 6px; color: #9aa7b8; }

.curso-hero { position: relative; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; padding: 34px 36px 54px; border-radius: 18px; color: #fff; overflow: hidden; margin-bottom: 26px; box-shadow: 0 10px 30px rgba(15, 50, 100, .15); }
.hero-azul { background: linear-gradient(120deg, #0a4f96, #1b7fd0); }
.hero-violeta { background: linear-gradient(120deg, #4a2d93, #7d55cc); }
.hero-turquesa { background: linear-gradient(120deg, #11706d, #23a3a3); }
.hero-celeste { background: linear-gradient(120deg, #1560c4, #4a9cf0); }
.hero-naranja { background: linear-gradient(120deg, #b85c06, #e8942a); }
.hero-marino { background: linear-gradient(120deg, #0f2f5c, #275d9f); }
.hero-icono { position: relative; z-index: 1; display: grid; place-items: center; width: 92px; height: 92px; flex: none; border-radius: 18px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); }
.hero-icono svg { width: 54px; height: 54px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.hero-texto { position: relative; z-index: 1; flex: 1; min-width: 260px; }
.hero-codigo { display: inline-block; padding: 3px 12px; border-radius: 14px; background: rgba(255, 255, 255, .2); font-size: .82rem; font-weight: 600; letter-spacing: .03em; margin-bottom: 10px; }
.curso-hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.2; margin: 0 0 14px; color: #fff; }
.hero-datos { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; font-size: .95rem; color: rgba(255, 255, 255, .92); }
.hero-datos li { display: flex; align-items: center; gap: 7px; }
.hero-datos svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.hero-acciones { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-hero { padding: 9px 18px; border-radius: 10px; background: rgba(255, 255, 255, .95); color: #0f3a73; font-weight: 600; text-decoration: none; }
.btn-hero:hover { background: #fff; }
.hero-ola { position: absolute; left: 0; bottom: 0; width: 100%; height: 60px; }
.hero-ola path { fill: rgba(255, 255, 255, .12); }

.curso-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 26px; align-items: start; }
.curso-indice { position: sticky; top: 16px; background: #fff; border: 1px solid #e3eaf3; border-radius: 14px; padding: 18px 14px; box-shadow: 0 4px 16px rgba(20, 60, 120, .05); max-height: calc(100vh - 32px); overflow-y: auto; }
.curso-indice h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #6b7685; margin: 0 8px 10px; }
.curso-indice ol { list-style: none; margin: 0; padding: 0; }
.curso-indice a { display: flex; gap: 12px; align-items: flex-start; padding: 9px 8px; border-radius: 9px; color: #1d2c42; text-decoration: none; }
.curso-indice a:hover { background: #eef4fb; }
.curso-indice .num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: #e6eef9; color: #0f3a73; font-weight: 700; font-size: .85rem; }
.curso-indice .txt { font-size: .93rem; font-weight: 600; line-height: 1.3; padding-top: 3px; }
.curso-indice small { display: block; font-weight: 400; color: #6b7685; font-size: .8rem; margin-top: 2px; }

.bloque-presentacion { background: #fff; border: 1px solid #e3eaf3; border-radius: 14px; padding: 22px 26px; margin-bottom: 18px; }
.bloque-presentacion h2 { margin: 0 0 8px; font-size: 1.1rem; color: #0f2a4d; }
.texto-rico { color: #2a3342; line-height: 1.65; }
.texto-rico p { margin: 0 0 10px; }
.texto-rico p:last-child { margin-bottom: 0; }
.texto-rico a { color: #1561b8; word-break: break-all; }
.texto-rico .video { margin: 12px 0; }

.unidad-card { background: #fff; border: 1px solid #e3eaf3; border-radius: 14px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(20, 60, 120, .04); overflow: hidden; scroll-margin-top: 16px; }
.unidad-card > summary { display: flex; align-items: center; gap: 16px; padding: 16px 22px; cursor: pointer; list-style: none; }
.unidad-card > summary::-webkit-details-marker { display: none; }
.unidad-card > summary:hover { background: #f8fbff; }
.unidad-num { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: linear-gradient(150deg, #1a6fc4, #0c4c97); color: #fff; font-weight: 700; font-size: 1.05rem; }
.unidad-tit { flex: 1; font-weight: 700; font-size: 1.06rem; color: #0f2a4d; line-height: 1.3; }
.unidad-tit small { display: block; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: #6b7685; margin-bottom: 2px; }
.unidad-cant { font-size: .85rem; color: #53647a; background: #eef3f9; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.unidad-flecha { width: 22px; height: 22px; flex: none; fill: none; stroke: #53647a; stroke-width: 2; transition: transform .2s; }
.unidad-card[open] .unidad-flecha { transform: rotate(180deg); }
.unidad-card[open] > summary { border-bottom: 1px solid #eef2f6; }
.unidad-body { padding: 18px 22px 20px; }
.unidad-desc { margin-bottom: 14px; }

.lista-mat { display: flex; flex-direction: column; gap: 10px; }
.mat { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border: 1px solid #e6edf5; border-radius: 12px; background: #fbfcfe; transition: border-color .15s, box-shadow .15s; }
.mat:hover { border-color: #c9d8ea; box-shadow: 0 3px 12px rgba(20, 60, 120, .06); }
.mat-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 11px; }
.mat-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.mat-pdf .mat-ico { background: #fdeaea; color: #c62828; }
.mat-rojo .mat-ico { background: #fdeaea; color: #d32f2f; }
.mat-azul .mat-ico { background: #e5effc; color: #1f5fae; }
.mat-verde .mat-ico { background: #e3f4ea; color: #1e7b45; }
.mat-naranja .mat-ico { background: #fdf0e1; color: #c66a0a; }
.mat-violeta .mat-ico { background: #efe8fb; color: #6a42b8; }
.mat-celeste .mat-ico { background: #e3f3fb; color: #0f7fb5; }
.mat-gris .mat-ico { background: #eef1f5; color: #4a5565; }
.mat-cuerpo { flex: 1; min-width: 0; }
.mat-tit { font-weight: 650; color: #13253f; }
.mat-meta { font-size: .82rem; color: #6b7685; margin-top: 1px; }
.mat-texto { margin-top: 10px; color: #2a3342; line-height: 1.6; }
.mat-texto p { margin: 0 0 8px; }
.mat-texto a { color: #1561b8; word-break: break-all; }
.mat .video { margin-top: 12px; max-width: 760px; }
.mat-btn { display: inline-flex; align-items: center; gap: 7px; align-self: center; padding: 8px 16px; border-radius: 9px; background: #0d4a94; color: #fff; font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.mat-btn:hover { background: #0a3b78; }
.mat-btn svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 900px) {
  .curso-layout { grid-template-columns: 1fr; }
  .curso-indice { position: static; max-height: none; }
}
@media (max-width: 560px) {
  .curso-hero { padding: 24px 20px 46px; gap: 16px; }
  .hero-icono { width: 64px; height: 64px; }
  .hero-icono svg { width: 38px; height: 38px; }
  .unidad-card > summary { padding: 14px; gap: 12px; }
  .unidad-cant { display: none; }
  .unidad-body { padding: 14px; }
  .mat { flex-wrap: wrap; }
  .mat-btn { margin-left: 58px; }
}

/* ===== Íconos de la barra (notificaciones / mensajes) ===== */
.nav-ico { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; }
.nav-ico:hover { background: rgba(255, 255, 255, .15); }
.nav-ico svg { width: 23px; height: 23px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.nav-badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #e53935; color: #fff; font-size: .7rem; font-weight: 700; line-height: 1; }
.nav-ico .nav-badge { position: absolute; top: 0; right: -2px; border: 2px solid #0d4a94; }

/* ===== Notificaciones ===== */
.notif { display: flex; align-items: center; gap: 14px; padding: 15px 20px; border-top: 1px solid var(--borde); color: #1d2c42; text-decoration: none; }
.notif:first-child { border-top: 0; }
.notif:hover { background: #f8fafe; }
.notif.no-leida { background: #f1f6fd; }
.notif.no-leida .notif-txt { font-weight: 600; }
.notif-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: #e6eef9; }
.notif-ico svg { width: 21px; height: 21px; fill: none; stroke: #1f5fae; stroke-width: 1.8; stroke-linejoin: round; }
.notif-txt { flex: 1; line-height: 1.4; }
.notif-txt small { display: block; font-weight: 400; color: #6b7685; font-size: .82rem; margin-top: 2px; }
.notif-punto { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #1f6fd0; }

/* ===== Mensajes ===== */
.pagina-mensajes .wrap { max-width: 1240px; padding-bottom: 20px; }
.chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 110px); min-height: 480px; background: #fff; border: 1px solid #e3eaf3; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 24px rgba(20, 60, 120, .07); }
.chat-lista { display: flex; flex-direction: column; border-right: 1px solid #e3eaf3; overflow-y: auto; }
.chat-lista-cab { position: sticky; top: 0; z-index: 1; background: #fff; padding: 18px 16px 12px; border-bottom: 1px solid #eef2f6; }
.chat-lista-cab h1 { font-size: 1.4rem; margin: 0 0 12px; }
.chat-lista-cab .buscador input { width: 100%; max-width: none; padding: 9px 12px 9px 40px; }
.chat-seccion { padding: 10px 16px 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #6b7685; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #1d2c42; text-decoration: none; border-left: 3px solid transparent; }
.chat-item:hover { background: #f5f8fc; }
.chat-item.activo { background: #eaf2fc; border-left-color: #1f5fae; }
.chat-item-txt { flex: 1; min-width: 0; }
.chat-item-txt strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-txt small { display: block; color: #6b7685; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.no-leido small { color: #1d2c42; font-weight: 600; }
.chat-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: .75rem; color: #6b7685; white-space: nowrap; }
.chat-vacio { padding: 16px; color: #6b7685; font-size: .92rem; text-align: center; }

.chat-hilo { display: flex; flex-direction: column; min-width: 0; background: #f6f9fc; }
.chat-bienvenida { margin: auto; text-align: center; color: #6b7685; padding: 20px; }
.chat-bienvenida svg { width: 64px; height: 64px; fill: none; stroke: #b9c8db; stroke-width: 1.4; stroke-linejoin: round; }
.chat-hilo-cab { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: #fff; border-bottom: 1px solid #e3eaf3; }
.chat-hilo-cab strong { display: block; }
.chat-hilo-cab small { color: #6b7685; }
.chat-volver { display: none; font-size: 2rem; line-height: 1; text-decoration: none; color: #1f5fae; padding: 0 6px; }
.chat-mensajes { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.burbuja { max-width: min(72%, 560px); align-self: flex-start; padding: 9px 13px 6px; border-radius: 14px 14px 14px 4px; background: #fff; border: 1px solid #e3eaf3; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); line-height: 1.45; overflow-wrap: anywhere; }
.burbuja.mia { align-self: flex-end; background: #0d4a94; border-color: #0d4a94; color: #fff; border-radius: 14px 14px 4px 14px; }
.burbuja.mia a { color: #cfe3ff; }
.burbuja time { display: block; text-align: right; font-size: .7rem; opacity: .65; margin-top: 3px; }
.chat-enviar { display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px; background: #fff; border-top: 1px solid #e3eaf3; }
.chat-enviar textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; padding: 11px 14px; border-radius: 22px; border-color: #cfd8e4; }
.chat-enviar button { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border-radius: 50%; }
.chat-enviar button svg { width: 20px; height: 20px; fill: #fff; stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; }
.chat-aviso { margin: 0; padding: 14px 20px; background: #fff6e0; color: #8a5a00; border-top: 1px solid #f0d9a0; font-size: .92rem; }

@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 140px); }
  .chat.con-hilo .chat-lista { display: none; }
  .chat:not(.con-hilo) .chat-hilo { display: none; }
  .chat-volver { display: inline; }
  .burbuja { max-width: 85%; }
}

/* ===== Progreso y avance secuencial ===== */
.progreso { position: relative; height: 10px; border-radius: 999px; background: #e3eaf3; overflow: hidden; }
.progreso > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1a6fc4, #3fa0f0); transition: width .6s ease; }
.progreso.completo > span { background: linear-gradient(90deg, #4c9a1a, #8cc63f); }
.barra-mini { height: 7px; }
.barra-hero { height: 12px; background: rgba(255, 255, 255, .22); }
.barra-hero > span { background: linear-gradient(90deg, #f5c518, #ffe27a); }
.barra-hero.completo > span { background: linear-gradient(90deg, #8cc63f, #b7e07a); }
.hero-progreso { margin-top: 18px; max-width: 560px; }
.hero-progreso-txt { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.hero-progreso-txt strong { display: inline-flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.hero-progreso-txt strong svg { width: 22px; height: 22px; fill: none; stroke: #f5c518; stroke-width: 1.8; stroke-linejoin: round; }
.hero-progreso-txt span { font-size: .88rem; color: rgba(255, 255, 255, .85); }
.hero-datos li svg { flex: none; }

/* índice lateral */
.curso-indice a.completa .num { background: #e3f4ea; color: #1e7b45; }
.curso-indice a.bloqueada { color: #8a96a6; }
.curso-indice a.bloqueada .num { background: #eef1f5; color: #8a96a6; }
.curso-indice .num svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* tarjetas de unidad */
.unidad-card.completa .unidad-num { background: linear-gradient(150deg, #4c9a1a, #8cc63f); }
.unidad-card.bloqueada .unidad-num { background: #c9d3df; }
.unidad-card.bloqueada .unidad-tit { color: #6b7685; }
.unidad-num svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.unidad-avance { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: #53647a; white-space: nowrap; }
.unidad-avance .progreso { width: 90px; }
.unidad-bloqueo { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 12px; background: #f4f6f9; border: 1px dashed #c9d3df; color: #53647a; }
.unidad-bloqueo svg { width: 34px; height: 34px; flex: none; fill: none; stroke: #8a96a6; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.unidad-bloqueo p { margin: 0; }

/* materiales */
.mat-acciones { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; align-self: center; }
.mat-completar { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; background: #fff; color: #1e7b45; border: 1.5px solid #9fd0b2; font-weight: 600; font-size: .86rem; white-space: nowrap; }
.mat-completar:hover { background: #e8f5ee; }
.mat-completar svg, .mat-hecho svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mat-hecho { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; background: #e3f4ea; color: #1e7b45; font-weight: 700; font-size: .86rem; white-space: nowrap; }
.mat.hecho { border-color: #cfe9d9; background: #f7fcf9; }

/* tarjeta en "Mis cursos" */
.tarjeta-progreso { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.tarjeta-progreso span { font-size: .88rem; color: #53647a; }
.tarjeta-progreso strong { color: #0f3a73; }

/* resumen para docentes (Participantes) */
.resumen-progreso { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 8px; }
.resumen-progreso > div { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.resumen-progreso strong { font-size: 1.6rem; color: #0f2a4d; line-height: 1.1; }
.resumen-progreso span { font-size: .85rem; color: #53647a; }
.resumen-progreso .ok strong { color: #1e7b45; }
.resumen-progreso .gris strong { color: #8a96a6; }
.celda-progreso { min-width: 150px; white-space: nowrap; }
.celda-progreso .progreso { display: inline-block; width: 90px; vertical-align: middle; margin-right: 8px; }
.pct-ok { color: #1e7b45; font-weight: 700; }

@media (max-width: 700px) {
  .resumen-progreso { grid-template-columns: 1fr 1fr; }
  .unidad-avance .progreso { width: 50px; }
  .mat-acciones { flex-direction: row; align-items: center; margin-left: 58px; }
}
.mat-acciones .mat-btn { margin-left: 0; }

/* ---------- Portada (imagen) del curso ---------- */
.curso-tile.con-portada { background: #e8eef7; }
.curso-tile.con-portada img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.curso-card:hover .curso-tile.con-portada img { transform: scale(1.05); }
.hero-icono.hero-portada { width: 150px; height: 110px; padding: 0; overflow: hidden; border-width: 3px; border-color: rgba(255, 255, 255, .55); }
.hero-portada img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portada-editar { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.portada-editar > div:last-child { flex: 1 1 260px; }
.portada-editar .muted { display: block; margin-top: 6px; }
@media (max-width: 640px) {
  .hero-icono.hero-portada { width: 110px; height: 80px; }
}

/* ---------- Usuarios: página ancha, tabla sin scroll horizontal ---------- */
.pagina-usuarios .wrap { max-width: 1400px; }
.pagina-usuarios .tabla-usuarios { min-width: 0; }
.pagina-usuarios .tabla-scroll { overflow-x: visible; }
.tabla-usuarios .col-correo { overflow-wrap: anywhere; }
.tabla-usuarios .acciones-fila { white-space: nowrap; text-align: right; }
.tabla-usuarios th:last-child { text-align: right; padding-right: 20px; }
.tabla-usuarios td:last-child { padding-right: 14px; }
@media (max-width: 1100px) {
  .tabla-usuarios th, .tabla-usuarios td { padding: 10px 8px; }
  .tabla-usuarios .acciones-fila { white-space: normal; }
}
/* En pantallas chicas cada usuario es una tarjeta */
@media (max-width: 860px) {
  .tabla-usuarios thead { display: none; }
  .tabla-usuarios, .tabla-usuarios tbody, .tabla-usuarios tr, .tabla-usuarios td { display: block; width: 100%; }
  .tabla-usuarios tr { padding: 12px 16px; border-top: 1px solid var(--borde); }
  .tabla-usuarios td, .tabla-usuarios td:first-child, .tabla-usuarios td:last-child { padding: 3px 0; border: 0; }
  .tabla-usuarios td[data-col]::before { content: attr(data-col) ": "; color: #53647a; font-weight: 600; }
  .tabla-usuarios td:first-child { margin-bottom: 6px; }
  .tabla-usuarios .acciones-fila { text-align: left; margin-left: -6px; padding-top: 6px; }
  .tabla-usuarios .vacio { text-align: center; }
}

/* ---------- Foto de perfil ---------- */
.avatar.con-foto { padding: 0; overflow: hidden; background: #dfe8f3; }
.avatar.con-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-grande { width: 112px; height: 112px; border-radius: 50%; font-size: 2.1rem; box-shadow: 0 0 0 4px #fff, 0 0 0 5px #cfdcec; }
.avatar-mini { display: inline-grid; width: 28px; height: 28px; border-radius: 50%; font-size: .7rem; margin-right: 8px; vertical-align: middle; background: rgba(255, 255, 255, .2); color: #fff; }
.avatar-mini.con-foto { background: rgba(255, 255, 255, .2); box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
.nav-perfil { display: inline-flex; align-items: center; }
.perfil-cabecera { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.perfil-datos { flex: 1 1 280px; }
.perfil-datos > p:first-child { margin-top: 0; }
.perfil-form-foto { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-right: 6px; }
.perfil-datos form.inline { display: inline-block; }
.subir-foto { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.subir-foto svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.subir-foto:focus-within { outline: 2px solid #1a5fae; outline-offset: 2px; }
.perfil-ayuda { font-size: .88rem; margin: 10px 0 0; }
@media (max-width: 520px) {
  .perfil-cabecera { flex-direction: column; text-align: center; }
  .perfil-form-foto { justify-content: center; }
}
