/* LeoCode IA | lblanco © Copyright 2026 */
:root {
  --ink: #0b1220;
  --muted: #5b6577;
  --bg: #f6f8fb;
  --line: #d9dee6;
  --error: #b42318;
  --error-bg: #fef3f2;
  --shell: #0b1220;
  --shell-text: #c8d0de;
  --shell-text-2: #8791a5;
  --shell-border: rgba(255, 255, 255, 0.09);
  --shell-hover: rgba(255, 255, 255, 0.08);
  --acento: #4f8cff;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

body {
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---------- Pantalla de acceso ---------- */
.centro {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: linear-gradient(100deg, #fff 0%, #eef2f7 55%, #e6ebf2 100%);
}

.tarjeta {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(11, 18, 32, 0.08);
}

.logo { display: block; height: 44px; width: auto; margin-bottom: 28px; }

h1 { font-size: 1.8rem; font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 500; }
.sub { margin-top: 6px; color: var(--muted); font-weight: 300; }

form { margin-top: 24px; display: grid; gap: 8px; }
label { font-size: 0.95rem; font-weight: 500; margin-top: 8px; }

input[type="email"], input[type="password"], input[type="text"], select {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
input:disabled { background: var(--bg); color: var(--muted); }
input:focus, select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

.btn {
  margin-top: 16px;
  padding: 15px 24px;
  font: inherit;
  font-size: 1.05rem;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(11, 18, 32, 0.2);
}
.btn:hover { background: #1a2438; }
.btn-chico { margin: 0; padding: 10px 18px; font-size: 0.95rem; box-shadow: none; }

.error {
  margin-top: 18px; padding: 12px 14px; color: var(--error);
  background: var(--error-bg); border: 1px solid #fecdca; border-radius: 12px; font-size: 0.95rem;
}
.btn-entrar { margin-top: 10px; }
.btn-entrar:disabled { background: #e4e7ec; color: #667085; box-shadow: none; cursor: not-allowed; }
.fila-alerta td { background: #fff7ed; }
.etiqueta.alerta { color: #93370d; background: #ffead5; border-color: transparent; white-space: normal; }
details summary { cursor: pointer; padding: 4px 0; }
.aviso {
  margin-top: 18px; padding: 12px 14px; color: #93370d;
  background: #fffaeb; border: 1px solid #fedf89; border-radius: 12px; font-size: 0.95rem;
}
.exito {
  margin-top: 18px; padding: 12px 14px; color: #05603a;
  background: #ecfdf3; border: 1px solid #abefc6; border-radius: 12px;
}
.nota { margin-top: 22px; font-size: 0.9rem; color: var(--muted); text-align: center; }
.nota-chica { margin-top: 12px; font-size: 0.85rem; color: var(--muted); }

/* ---------- Estructura: menú lateral + contenido ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
/* Al colapsar el menú en escritorio se declara UNA sola columna (si no, el contenido cae en la de 0px). */
.app.sidebar-oculto { grid-template-columns: 1fr; }

.sidebar {
  background: var(--shell);
  color: var(--shell-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--shell-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.app.sidebar-oculto .sidebar { display: none; }
.sidebar-overlay { display: none; }

.sidebar-marca {
  display: flex; align-items: center;
  padding: 20px; border-bottom: 1px solid var(--shell-border);
}
.sidebar-marca:hover { background: var(--shell-hover); }
.sidebar-marca img { display: block; height: 32px; width: auto; }

.sidebar-grupo {
  padding: 18px 20px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--shell-text-2);
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: var(--shell-text); text-decoration: none; font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--shell-hover); color: #fff; }
.nav-item[aria-current="page"] {
  background: var(--shell-hover); color: #fff; font-weight: 500; border-left-color: var(--acento);
}
.nav-ico { flex: none; opacity: 0.9; }

/* Usuario: una sola opción, abajo a la izquierda del menú. El desplegable se abre hacia arriba. */
.sidebar-pie {
  margin-top: auto;
  position: relative;
  padding: 10px 12px;
  border-top: 1px solid var(--shell-border);
}
.sidebar-pie .user-chip { width: 100%; padding: 8px; color: #fff; }
.sidebar-pie .user-chip:hover,
.sidebar-pie .user-chip[aria-expanded="true"] { background: var(--shell-hover); border-color: transparent; }
.sidebar-pie .user-chip-texto { flex: 1; min-width: 0; }
.sidebar-pie .user-chip-texto strong {
  display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-pie .role { color: var(--shell-text-2); }
.sidebar-pie .chevron { flex: none; color: var(--shell-text-2); transition: transform 0.15s ease; }
.sidebar-pie .user-chip[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.sidebar-pie .user-dropdown { left: 12px; right: 12px; top: auto; bottom: calc(100% - 4px); min-width: 0; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 24px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--bg); border-color: var(--line); }
.crumb { font-size: 0.9rem; color: var(--muted); }
.crumb strong { color: var(--ink); font-weight: 500; }

/* ---------- Avatar y menú de usuario ---------- */
.avatar {
  width: 36px; height: 36px; flex: none;
  border-radius: 50%; object-fit: cover;
  background: #1d4ed8; color: #fff;
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 600;
}
.avatar.grande { width: 112px; height: 112px; font-size: 2rem; }
.avatar.mini-av { width: 28px; height: 28px; font-size: 0.7rem; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 1px solid transparent; border-radius: 12px;
  padding: 4px 10px 4px 4px; cursor: pointer; font: inherit; color: inherit; text-align: left;
}
.user-chip:hover { background: var(--bg); border-color: var(--line); }
.user-chip-texto { font-size: 0.9rem; line-height: 1.25; }
.user-chip .role { display: block; font-size: 0.75rem; }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 190px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(11, 18, 32, 0.14); z-index: 30;
}
.user-dropdown form { margin: 0; display: block; }
.user-dropdown-item {
  display: block; width: 100%; padding: 9px 12px;
  background: transparent; border: 0; border-radius: 8px;
  font: inherit; font-size: 0.95rem; color: var(--ink);
  text-align: left; text-decoration: none; cursor: pointer;
}
.user-dropdown-item:hover { background: var(--bg); }
.user-dropdown-item.danger { color: var(--error); }
.user-dropdown-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- Contenido ---------- */
/* El contenido usa todo el ancho disponible (sin tope ni márgenes vacíos a los lados). */
.contenido { padding: 28px clamp(16px, 2vw, 32px) 56px; min-width: 0; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.sidebar-grupo-vacio { height: 12px; }
.contenido form { margin-top: 0; }
.page-head h1 { font-size: 1.6rem; }
.enlace { color: var(--ink); font-weight: 500; }

.bloque { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.bloque form { margin-top: 16px; }
.rejilla { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: end; gap: 16px; }
.rejilla label { display: block; margin: 0 0 6px; }
.rejilla .btn { margin: 0; }
.fila { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }

.perfil-foto { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.perfil-foto-acciones form + form { margin-top: 10px; }
input[type="file"] { font: inherit; font-size: 0.9rem; max-width: 100%; }

.clave { padding: 16px; background: #fffaeb; border: 1px solid #fedf89; border-radius: 12px; }
.clave code {
  display: inline-block; margin-top: 8px; padding: 8px 12px; font-size: 1.15rem;
  background: #fff; border: 1px dashed #b54708; border-radius: 8px; user-select: all;
}

.tabla-caja { margin-top: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 500; color: var(--muted); }
.celda-nombre { display: inline-flex; align-items: center; gap: 10px; }
.acciones { display: flex; gap: 8px; }
.acciones form { margin: 0; display: block; }
.mini {
  padding: 6px 12px; font: inherit; font-size: 0.85rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.mini:hover { border-color: var(--ink); }
.etiqueta { padding: 2px 8px; font-size: 0.75rem; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.inactivo { color: var(--error); }

/* ---------- Calendario ---------- */
textarea {
  width: 100%; padding: 14px 16px; font: inherit; color: var(--ink); resize: vertical;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
input[type="date"], input[type="time"], input[type="url"] {
  width: 100%; padding: 14px 16px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
input[type="date"]:focus, input[type="time"]:focus, input[type="url"]:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.rejilla .doble { grid-column: 1 / -1; }
.casilla label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 0; cursor: pointer; }
.acciones-form { display: flex; align-items: center; gap: 12px; }
a.mini { display: inline-block; text-decoration: none; }
.peligro { color: var(--error); }
.peligro:hover { border-color: var(--error); }
.cal-cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cal-cabecera .btn { text-decoration: none; display: inline-block; }

/* Repetición de clases */
.repeticion { padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.casilla-inline { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-weight: 500; }
#bloque-repeticion { margin-top: 12px; display: grid; gap: 12px; }
#bloque-repeticion .rejilla { margin-top: 0; }
.dias-semana { display: flex; flex-wrap: wrap; gap: 8px; }
.dia-sem { margin: 0; cursor: pointer; }
.dia-sem input { position: absolute; opacity: 0; pointer-events: none; }
.dia-sem span {
  display: inline-block; min-width: 56px; padding: 10px 14px; text-align: center; font-weight: 500;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.dia-sem input:checked + span { color: #fff; background: var(--ink); border-color: var(--ink); }
.dia-sem input:focus-visible + span { outline: 2px solid var(--acento); outline-offset: 2px; }
.vp-titulo { margin: 0; }
.vp-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; padding: 4px; }
.vp-dia { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 10px; font-weight: 400; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
[hidden] { display: none !important; }

/* Pestañas de la sección (Calendario / Configuración) */
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: -4px; }
.pestanas a {
  padding: 10px 18px; margin-bottom: -1px; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; font-weight: 500;
}
.pestanas a:hover { color: var(--ink); }
.pestanas a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* Calendario a la izquierda, detalle del día a la derecha */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 26vw, 460px); gap: 24px; align-items: start; }
.cal-lateral {
  position: sticky; top: 84px; padding: 18px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  max-height: calc(100vh - 110px); overflow-y: auto;
}
.cal-chip.cont { opacity: 0.75; border-radius: 0 6px 6px 0; }
@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-lateral { position: static; max-height: none; }
}

.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cal-mes::first-letter, .cal-lateral h3::first-letter { text-transform: uppercase; }
.cal-botones { display: flex; gap: 6px; }
.cal-rejilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dia-nombre { padding: 4px; font-size: 0.8rem; text-align: center; color: var(--muted); text-transform: uppercase; }
.cal-celda {
  min-height: clamp(92px, 13vh, 150px); padding: 6px; display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  font: inherit; text-align: left; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; overflow: hidden;
}
.cal-celda:hover { border-color: var(--ink); }
.cal-celda.fuera { background: var(--bg); color: var(--muted); }
.cal-celda.hoy .cal-num { background: var(--ink); color: #fff; }
.cal-celda.sel { outline: 2px solid var(--acento); outline-offset: -1px; }
.cal-num { align-self: flex-start; min-width: 24px; padding: 1px 6px; font-size: 0.85rem; text-align: center; border-radius: 999px; }
.cal-chip {
  display: block; padding: 1px 6px; font-size: 0.72rem; line-height: 1.4; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-mas { font-size: 0.72rem; color: var(--muted); }

.tipo-clase { --tc: #1d4ed8; --tf: #eaf1ff; }
.tipo-evento { --tc: #067647; --tf: #e8f8ef; }
.tipo-aviso { --tc: #b54708; --tf: #fff4e5; }
.cal-chip.tipo-clase, .cal-chip.tipo-evento, .cal-chip.tipo-aviso,
.etiqueta.tipo-clase, .etiqueta.tipo-evento, .etiqueta.tipo-aviso { color: var(--tc); background: var(--tf); border-color: transparent; }

.cal-lateral h3 { font-weight: 500; margin-bottom: 10px; }
.cal-evento { margin-top: 10px; padding: 14px 16px; background: var(--tf, #fff); border: 1px solid var(--line); border-left: 4px solid var(--tc, var(--ink)); border-radius: 10px; }
.cal-evento p { margin-top: 6px; }
.cal-evento-cab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-hora { color: var(--muted); font-size: 0.9rem; }
.cal-evento .acciones { margin-top: 10px; }

.lista-prox { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.prox { display: grid; grid-template-columns: 190px 1fr; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--tc, var(--ink)); border-radius: 10px; }
.prox time { color: var(--muted); font-size: 0.9rem; }
.prox-cuerpo p { margin-top: 4px; }

/* ---------- Cursos (al estilo Skool) ---------- */
progress { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: #e4e7ec; }
progress::-webkit-progress-bar { background: #e4e7ec; }
progress::-webkit-progress-value { background: #12b76a; border-radius: 999px; }
progress::-moz-progress-bar { background: #12b76a; border-radius: 999px; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mini:disabled { opacity: 0.35; cursor: not-allowed; }
.mini:disabled:hover { border-color: var(--line); }

.cursos-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.curso-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.curso-card:hover { box-shadow: 0 14px 34px rgba(11, 18, 32, 0.12); transform: translateY(-2px); }
.curso-card.es-borrador { border-style: dashed; }
.curso-enlace { display: block; color: inherit; text-decoration: none; flex: 1; }
.curso-portada { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg); }
.curso-portada.sin-imagen { display: grid; place-items: center; background: linear-gradient(135deg, #0b1220 0%, #24324d 100%); color: #fff; font-size: 2.6rem; font-weight: 500; letter-spacing: 0.04em; }
.curso-info { padding: 16px 18px 18px; display: grid; gap: 8px; }
.curso-info h2 { font-size: 1.15rem; line-height: 1.3; }
.curso-desc { color: var(--muted); font-size: 0.92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.curso-admin { padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg); align-items: center; }

.curso-layout { display: grid; grid-template-columns: clamp(280px, 24vw, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.curso-indice { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 10px; }
.curso-indice h2 { font-size: 1.1rem; line-height: 1.3; }
.indice-modulo h3 { margin-top: 10px; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.indice-modulo ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 2px; }
.indice-leccion { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 0.93rem; }
.indice-leccion:hover { background: var(--bg); }
.indice-leccion.actual { background: var(--ink); color: #fff; }
.indice-leccion .marca { flex: none; width: 20px; height: 20px; margin-top: 1px; display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; border: 1.5px solid #98a2b3; border-radius: 50%; }
.indice-leccion.hecha .marca { background: #12b76a; border-color: #12b76a; color: #fff; }
.indice-leccion.actual .marca { border-color: #fff; }
.indice-leccion.actual.hecha .marca { border-color: #12b76a; }

.curso-contenido { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px clamp(16px, 2.5vw, 36px) 32px; min-width: 0; display: grid; gap: 18px; }
.curso-contenido h1 { font-size: 1.6rem; }
.miga-curso { font-size: 0.88rem; color: var(--muted); }
.miga-curso a { color: inherit; }
.video { aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: 12px; overflow: hidden; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-externo { padding: 20px; background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; }
.leccion-texto p { margin: 0 0 12px; line-height: 1.7; }
.leccion-texto a, .recursos a { color: var(--ink); }
.recursos h2 { font-size: 1.05rem; margin-bottom: 8px; }
.recursos ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.leccion-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.leccion-acciones form { margin: 0; display: block; }
.leccion-acciones .btn { margin: 0; }
.btn-hecho { background: #067647; box-shadow: none; }
.btn-hecho:hover { background: #05603a; }
.leccion-nav { display: flex; gap: 8px; margin-left: auto; }

.portada-campo { display: grid; gap: 8px; }
.portada-actual { max-width: 280px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.mod-editor { margin-top: 16px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; }
.mod-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.mod-cab form.fila { margin: 0; flex: 1; min-width: 240px; flex-wrap: nowrap; }
.mod-cab input[type="text"] { flex: 1; padding: 10px 12px; }
.lecciones-editor { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lecciones-editor li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.le-titulo { min-width: 0; overflow-wrap: anywhere; }
.fila input[type="text"] { flex: 1; min-width: 200px; padding: 12px 14px; font: inherit; border: 1px solid var(--line); border-radius: 12px; }

@media (max-width: 1100px) {
  .curso-layout { grid-template-columns: minmax(0, 1fr); }
  .curso-indice { position: static; max-height: none; order: 2; }
  .curso-contenido { order: 1; }
}

/* ---------- Comunidad ---------- */
.com-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 24vw, 380px); gap: 24px; align-items: start; }
.com-principal { display: grid; gap: 16px; min-width: 0; }
.com-detalle { display: grid; gap: 16px; max-width: none; }
.com-lateral-col { position: sticky; top: 84px; display: grid; gap: 16px; align-self: start; }
.com-lateral, .proximo-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 10px; }
.com-lateral { position: static; }
.proximo-card { border-top: 4px solid #1d4ed8; }
.proximo-card h2 { font-size: 1.1rem; }
.proximo-card .lista-prox { margin: 0; }
.proximo-card .prox { grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; }
.proximo-card .prox time { font-weight: 500; color: var(--ink); }
.casillas-ajuste { display: grid; gap: 10px; }
.celda-titulo { white-space: normal; min-width: 220px; max-width: 420px; }
.com-lateral h2 { font-size: 1.1rem; }
.com-lateral h3 { margin-top: 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.com-lateral ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: #344054; font-size: 0.93rem; }
.com-cifras { color: var(--muted); }
.com-cifras strong { color: var(--ink); font-size: 1.15rem; }

.redactar { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.redactar summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
.redactar summary::-webkit-details-marker { display: none; }
.redactar-texto { flex: 1; padding: 11px 16px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.redactar[open] summary { border-bottom: 1px solid var(--line); }
.redactar .rejilla { padding: 18px; margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; color: var(--ink); text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 0.93rem; }
.chip:hover { border-color: var(--ink); }
.chip[aria-current="page"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.chip-n { opacity: 0.7; font-size: 0.82rem; }

.post { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; display: grid; gap: 10px; }
.post.fijada { border-color: #f5c36a; background: #fffdf7; }
.post.es-anuncio { border-left: 4px solid #1d4ed8; }
.post-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.autor { display: inline-flex; align-items: center; gap: 10px; }
.autor-texto { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-meta { font-size: 0.85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.insignia { padding: 2px 9px; font-size: 0.72rem; font-weight: 600; color: #fff; background: #1d4ed8; border-radius: 999px; }
.etiqueta.cat-anuncio { color: #1d4ed8; background: #eaf1ff; border-color: transparent; }
.etiqueta.cat-pregunta { color: #93370d; background: #fff4e5; border-color: transparent; }
.etiqueta.cat-general { color: #344054; background: var(--bg); }
.etiqueta.fijada-et { color: #93370d; background: #ffead5; border-color: transparent; }
.etiqueta.cerrada-et { color: #475467; background: #f2f4f7; border-color: transparent; }
.post-titulo { font-size: 1.25rem; line-height: 1.3; }
.post-titulo a { color: inherit; text-decoration: none; }
.post-titulo a:hover { text-decoration: underline; }
.post-texto p { margin: 0 0 10px; line-height: 1.65; overflow-wrap: anywhere; }
.post-texto.recortado { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.post-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.post-pie form { margin: 0; display: block; }
.gusta { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font: inherit; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.gusta:hover { border-color: #f04438; color: #d92d20; }
.gusta.activo { color: #d92d20; background: #fef3f2; border-color: #fecdca; }
.gusta:disabled { opacity: 0.6; cursor: progress; }
.com-enlace { color: var(--muted); text-decoration: none; font-size: 0.93rem; }
.com-enlace:hover { color: var(--ink); text-decoration: underline; }
.post-acciones { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.mas-pub { text-align: center; }
.mas-pub .btn { text-decoration: none; display: inline-block; margin: 0; }

.comentarios h2 { font-size: 1.1rem; }
.lista-comentarios { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 14px; }
.comentario { display: flex; gap: 12px; align-items: flex-start; }
.comentario-cuerpo { flex: 1; min-width: 0; display: grid; gap: 4px; }
.comentario-cab { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.comentario-texto { padding: 10px 14px; background: var(--bg); border-radius: 12px; }
.comentario-texto p { margin: 0 0 6px; line-height: 1.55; overflow-wrap: anywhere; }
.comentario-texto p:last-child { margin: 0; }
.comentario-cuerpo form { margin: 0; display: block; justify-self: start; }
.form-comentar { margin-top: 10px; }

@media (max-width: 1100px) {
  .com-layout { grid-template-columns: minmax(0, 1fr); }
  .com-lateral-col { position: static; order: -1; }
}

/* ---------- Móvil: el menú es un cajón que empieza oculto ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 260px;
    transform: translateX(-100%); transition: transform 0.18s ease; z-index: 40;
  }
  .sidebar.abierta { transform: translateX(0); }
  .app.sidebar-oculto .sidebar { display: flex; transform: translateX(-100%); }
  .app.sidebar-oculto .sidebar.abierta { transform: translateX(0); }
  .sidebar-overlay.abierta { display: block; position: fixed; inset: 0; background: rgba(7, 18, 40, 0.5); z-index: 35; }
  .topbar { padding: 10px 14px; }
  .cal-celda { min-height: 64px; padding: 4px; }
  .cal-chip, .cal-mas { display: none; }
  .cal-celda:has(.cal-chip)::after { content: ""; width: 6px; height: 6px; margin: 0 auto; border-radius: 50%; background: var(--acento); }
  .prox { grid-template-columns: 1fr; gap: 4px; }
  .perfil-foto { gap: 18px; }
}

/* ---------- Campanita de notificaciones ---------- */
.top-acciones { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.campana { position: relative; }
.icon-btn { position: relative; text-decoration: none; }
.chat-top[aria-current="page"] { background: var(--bg); border-color: var(--line); }
.campana .icon-btn { position: relative; }
.campana-n, .nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #e5484d; color: #fff; font-size: 0.68rem; font-weight: 600; line-height: 18px; text-align: center;
}
.campana-n { position: absolute; top: 1px; right: 0; }
.nav-badge { margin-left: auto; }
.campana-panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(360px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(11, 18, 32, 0.14); z-index: 30; overflow: hidden;
}
.campana-cab { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.campana-lista, .lista-notif { list-style: none; padding: 0; margin: 0; }
.campana-lista { max-height: 380px; overflow-y: auto; }
.campana-vacio { padding: 18px 16px; color: var(--muted); font-size: 0.9rem; }
.campana-lista a, .lista-notif a {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 16px;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line);
}
.campana-lista a:hover, .lista-notif a:hover { background: var(--bg); }
.campana-lista a.sin-leer, .lista-notif li.sin-leer a { background: #eef4ff; }
.notif-ico { flex: none; font-size: 1.1rem; line-height: 1.4; }
.notif-texto { flex: 1; font-size: 0.92rem; line-height: 1.35; }
.notif-texto small, .notif-texto time { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.lista-notif .punto { flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: #2563eb; }
.campana-pie { display: block; padding: 11px 16px; text-align: center; font-size: 0.9rem; color: #1d4ed8; text-decoration: none; }
.campana-pie:hover { background: var(--bg); }
.lista-notif li:last-child a { border-bottom: 0; }

/* ---------- Chat ---------- */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; height: calc(100vh - 190px); min-height: 460px; }
.chat-lista, .chat-hilo { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.chat-lista h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 14px 16px 6px; }
.chat-contactos { overflow-y: auto; flex: 1; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.chat-item:hover { background: var(--bg); }
.chat-item[aria-current="page"] { background: #eef4ff; }
.chat-item-texto { flex: 1; min-width: 0; line-height: 1.3; }
.chat-item-texto strong { display: block; font-weight: 500; }
.chat-item-texto small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .nav-badge { margin-left: 0; }
.chat-general-ico { width: 36px; height: 36px; flex: none; border-radius: 50%; background: #0b1220; color: #fff; display: grid; place-items: center; font-size: 1.05rem; }
.chat-cab { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-cab .volver-lista { display: none; }
.chat-cab small { display: block; color: var(--muted); }
.chat-mensajes { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { display: flex; gap: 8px; max-width: 78%; align-self: flex-start; }
.msg.mio { align-self: flex-end; flex-direction: row-reverse; }
.msg-burbuja { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; min-width: 0; }
.msg.mio .msg-burbuja { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.msg-autor { font-size: 0.78rem; font-weight: 600; margin-bottom: 2px; }
.msg-texto { overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-hora { display: block; font-size: 0.7rem; opacity: 0.65; margin-top: 2px; }
.msg-borrar { display: inline; }
.msg-borrar button { background: none; border: 0; padding: 0; font: inherit; font-size: 0.7rem; opacity: 0.65; cursor: pointer; color: inherit; text-decoration: underline; }
.chat-vacio { margin: auto; color: var(--muted); text-align: center; }
.chat-escribir { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-escribir textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; }
.chat-aviso { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
@media (max-width: 860px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .chat.con-hilo .chat-lista { display: none; }
  .chat:not(.con-hilo) .chat-hilo { display: none; }
  .chat-cab .volver-lista { display: inline; }
  .msg { max-width: 92%; }
}

.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
