/* mensajes.css — el buzón «Mensajes» de Mi cuenta y la vista previa de la consola del Back Office (public/js/mensajes.js, docs/centro-mensajes.md).
   Sobrio, igual que las demás pantallas: solo piezas y tokens del sistema (.tarjeta, .btn, .btn-ghost, .btn-texto, .hoja-acciones, .interruptor, .grupo-fila; --sp-*, --fs-*, --lh-*, --text-*, --sep,
   --surface-*, --radio-*, --touch). Ningún color suelto, ninguna capa propia, ninguna animación propia; claro y oscuro salen de los tokens. Mobile primero (360/390 px) y escritorio (1440 px). */

/* El ícono del encabezado (negro en los dos temas): zona táctil de 44 px, contador blanco sobre negro. Sin el interruptor, el botón ni existe (hidden). */
.mhead-msg { flex: 0 0 auto; position: relative; display: inline-grid; place-items: center; width: var(--touch); height: var(--touch); margin-right: calc(var(--sp-2) * -1); padding: 0; border: 0; border-radius: var(--radio-full); background: transparent; color: var(--oli-00); cursor: pointer; }
.mhead-msg[hidden] { display: none; }
.mhead-msg:hover { background: var(--oli-825); }
.mhead-msg:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.mhead-msg .ic { width: 22px; height: 22px; }
.mhead-msg-n { position: absolute; top: 3px; right: 1px; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radio-full); background: var(--oli-00); color: var(--oli-900); font: 700 var(--t-11) / 1 var(--display); }
.mhead-msg-n[hidden] { display: none; }

/* La pantalla */
.msg-sec { display: block; }
.msg-barra { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.msg-cuenta { margin: 0; font-size: var(--fs-apoyo); line-height: var(--lh-apoyo); color: var(--text-secondary); }
.msg-todos { min-height: var(--alto-boton-ter); padding: 0 var(--sp-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.msg-lista { margin: 0; padding: 0; list-style: none; overflow: hidden; }
.msg-item + .msg-item { border-top: 1px solid var(--sep); }
.msg-fila { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--touch); padding: var(--sp-3) var(--sp-4); border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.msg-fila:hover { background: var(--surface-grouped); }
.msg-fila:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.msg-fila > .ic { flex: none; color: var(--text-tertiary); }
.msg-punto { flex: none; width: 10px; height: 10px; border-radius: var(--radio-full); background: transparent; }
.msg-nuevo .msg-punto { background: var(--info-fg); }
.msg-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.msg-titulo { display: block; font-weight: 400; overflow-wrap: anywhere; }
.msg-nuevo .msg-titulo { font-weight: 700; }
.msg-linea { display: block; font-size: var(--fs-apoyo); line-height: var(--lh-apoyo); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin: 0; font-size: var(--fs-apoyo); line-height: var(--lh-apoyo); color: var(--text-secondary); }
.msg-tipo { padding: 0 var(--sp-2); border: 1px solid var(--border-default); border-radius: var(--radio-full); color: var(--text-secondary); }
.msg-urg { font-weight: 700; color: var(--error-fg); }
.msg-fecha { color: var(--text-tertiary); }

/* Estado vacío */
.msg-vacio { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-6) var(--sp-5) var(--sp-5); text-align: center; color: var(--text-secondary); }
.msg-vacio-medalla { position: relative; display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: var(--sp-1); border-radius: var(--radio-full); background: var(--surface-grouped); border: 1px solid var(--sep); color: var(--text-primary); }
.msg-vacio-medalla::after { content: ""; position: absolute; top: 10px; right: 12px; width: 12px; height: 12px; border-radius: var(--radio-full); background: var(--info-fg); border: 2px solid var(--surface-card); }
.msg-vacio h3 { margin: 0; color: var(--text-primary); font-size: var(--fs-titulo-chico); line-height: var(--lh-titulo-chico); }
.msg-vacio p { margin: 0; max-width: 34ch; }
.msg-vacio-que { margin-top: var(--sp-3) !important; font-size: var(--fs-apoyo); line-height: var(--lh-apoyo); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary); }
.msg-vacio-lista { display: grid; gap: 0; width: 100%; max-width: 340px; margin: 0; padding: 0; list-style: none; text-align: left; border: 1px solid var(--sep); border-radius: var(--radio-sm); overflow: hidden; }
.msg-vacio-lista li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
.msg-vacio-lista li + li { border-top: 1px solid var(--sep); }
.msg-vacio-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radio-full); background: var(--surface-grouped); color: var(--text-primary); }
.msg-vacio-tx { display: grid; gap: 2px; min-width: 0; }
.msg-vacio-tx b { color: var(--text-primary); font-weight: 600; }
.msg-vacio-tx small { font-size: var(--fs-apoyo); line-height: var(--lh-apoyo); color: var(--text-secondary); }
.msg-vacio-btn { margin-top: var(--sp-2); }

/* Paginación */
.msg-pag { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-4); }
.msg-pag-n { font-size: var(--fs-apoyo); line-height: var(--lh-apoyo); color: var(--text-secondary); }
.msg-cargando { margin: 0; color: var(--text-secondary); }

/* El mensaje abierto (hoja) y la vista previa de la consola */
.msg-detalle { display: grid; gap: var(--sp-3); min-width: 0; }
.msg-texto p { margin: 0 0 var(--sp-3); overflow-wrap: anywhere; }
.msg-texto p:last-child { margin-bottom: 0; }
.msg-titulo-grande { margin: 0; font-size: var(--fs-seccion); line-height: var(--lh-seccion); overflow-wrap: anywhere; }
.msg-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.msg-accion { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.msg-quitar { min-height: var(--alto-boton-ter); padding: 0 var(--sp-2); text-decoration: underline; text-underline-offset: 3px; color: var(--text-secondary); cursor: pointer; }

/* Preferencias en Avisos */
.msg-nota { margin: var(--sp-3) 0 0; }

/* La línea discreta de Inicio: una oración, sin recuadro de color */
.msg-aviso { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3); padding: 0 var(--sp-1); font-size: var(--fs-apoyo); line-height: var(--lh-apoyo); color: var(--text-secondary); }
.msg-aviso[hidden] { display: none; }
.msg-aviso .ic { flex: none; color: var(--error-fg); }
.msg-aviso-ver { min-height: var(--alto-boton-ter); padding: 0 var(--sp-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (min-width: 900px) {
  .msg-fila { padding: var(--sp-4) var(--sp-5); }
}

/* El botón de acción es un enlace con aspecto de botón principal: el color del texto sale del token del botón (no del color de los enlaces del panel o de la página). */
a.msg-accion { color: var(--action-primary-text); background: var(--action-primary-bg); }
a.msg-accion:hover { color: var(--action-primary-text); }
