/* Fold · «HOY» COMO LA CARTA DEL DÍA (David H1, 11/11/2026; maqueta A de docs/agent-state/pc-c-fable-hoy)  ·  15/11/2026 · prefijo hoyc-
   La pinta hoy-carta.js SOLO con GET /api/hoy-dia activo. Colores SOLO de la paleta (paleta.css), que cambia sola con el tema claro/oscuro.
   Los estados llevan siempre su palabra («Vencido», «Vence hoy»), nunca solo el color. Botones de 44 px y foco visible. */

/* ---------------------------------------------------------------- con la carta encendida, el bloque de arriba de siempre deja el sitio */
#sitio-trabajo.hoyc-activo #hoy-d,
#sitio-trabajo.hoyc-activo #para-hoy { display: none !important; }
#sitio-trabajo.hoyc-activo > .sp-cabecera { max-width: 720px; margin-left: auto; margin-right: auto; width: 100%; box-sizing: border-box; }
/* (Windows de PC-A, 16/11/2026) Con la carta, lo de debajo («Para tu visto bueno», «Agenda») en la MISMA columna que el titular (a 1440 empezaba
   en otra), y la frase de arriba legible (13 px → 15 px). */
#sitio-trabajo.hoyc-activo > :not(.sp-cabecera):not(.hoyc) { max-width: 720px; margin-left: auto; margin-right: auto; width: 100%; box-sizing: border-box; }
#sitio-trabajo.hoyc-activo.hoyd-activo > .sp-cabecera .sp-frase, #sitio-trabajo.hoyc-activo > .sp-cabecera .sp-frase { font-size: .9375rem; color: var(--texto-2); }

/* ---------------------------------------------------------------- la columna */
.hoyc { max-width: 720px; width: 100%; margin: 0 auto 32px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hoyc[hidden] { display: none; }
.hoyc p, .hoyc h3, .hoyc h4, .hoyc ul { margin: 0; }
.hoyc ul { padding: 0; list-style: none; }

.hoyc-cab { display: flex; flex-direction: column; gap: 6px; }
.hoyc-fecha { font-size: 1rem; color: var(--texto-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.hoyc-titular { font-size: 1.75rem; line-height: 1.25; font-weight: 750; letter-spacing: -.015em; color: var(--texto); text-wrap: pretty; overflow-wrap: anywhere; }
.hoyc-titular:focus { outline: none; }
.hoyc-linea { font-size: .9375rem; color: var(--texto-2); line-height: 1.45; }
.hoyc-sugerencia { font-size: 1rem; line-height: 1.45; color: var(--texto); background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-panel, 12px); padding: 14px 18px; margin-top: 6px; }

/* ---------------------------------------------------------------- un aviso */
.hoyc-aviso { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-panel, 12px); box-shadow: var(--sombra-2);
  padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hoyc-aviso.hoyc-vencido, .hoyc-aviso.hoyc-hoy { border-left: 4px solid var(--rojo); }
.hoyc-plazo { align-self: flex-start; font-size: .8125rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: var(--hundido); color: var(--texto-2); }
.hoyc-plazo-vencido, .hoyc-plazo-hoy { background: var(--rojo-tenue); color: var(--rojo); }
.hoyc-plazo-pronto { background: var(--ambar-tenue); color: var(--ambar-texto); }
.hoyc-aviso-titulo { font-size: 1.1875rem; line-height: 1.35; font-weight: 650; color: var(--texto); overflow-wrap: anywhere; }
.hoyc-porque, .hoyc-falta { font-size: .9375rem; color: var(--texto-2); line-height: 1.45; }
.hoyc-falta { color: var(--ambar-texto); }
/* (Windows de PC-A, 16/11/2026) Cada factura: su línea a 16 px y, debajo, de dónde sale a 15 px (antes, todo a 13 px y gris claro). El nombre
   del archivo no se parte por el guion («facturas- / emitidas.xlsx» a 500 px): va entero; si no cabe en la línea, baja entero a la siguiente. */
.hoyc-facturas { display: flex; flex-direction: column; gap: 10px; font-size: 1rem; color: var(--texto); }
.hoyc-facturas li { overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hoyc-f-texto { font-size: 1rem; line-height: 1.4; color: var(--texto); font-variant-numeric: tabular-nums; }
.hoyc-origen { font-size: .9375rem; line-height: 1.4; color: var(--texto-2); overflow-wrap: normal; }
.hoyc-archivo { white-space: nowrap; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.hoyc-linea-titular { font-size: 1rem; color: var(--texto-2); }
.hoyc-acciones-cab { margin-top: 10px; }

.hoyc-propone { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--linea); }
.hoyc-propone-etiqueta { font-size: .8125rem; font-weight: 650; color: var(--ambar-texto); display: flex; align-items: center; gap: 6px; }
.hoyc-propone-etiqueta::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--ambar); }
.hoyc-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.hoyc-nota-plan { font-size: .8125rem; color: var(--texto-3); }

/* ---------------------------------------------------------------- botones */
.hoyc-boton { font: inherit; font-size: .9375rem; font-weight: 600; min-height: 44px; padding: 10px 16px; line-height: 1.2; box-sizing: border-box;
  border-radius: var(--r-control, 8px); border: 1px solid var(--linea-fuerte); background: transparent; color: var(--texto); cursor: pointer;
  text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.hoyc-boton:hover { background: var(--superficie-hover); }
.hoyc-boton.hoyc-principal { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.hoyc-boton.hoyc-principal:hover { background: var(--acento-hover); border-color: var(--acento-hover); }
.hoyc-boton.hoyc-enlace { border-color: transparent; background: none; color: var(--texto-2); text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; font-weight: 500; font-size: .875rem; }
.hoyc-boton.hoyc-enlace:hover { color: var(--texto); }
/* (16/11/2026) «Y N facturas más de este cliente, míralas en Dinero.»: un enlace que se lee entero (texto de 15 px, se parte en líneas). */
.hoyc-mas-cliente-p { margin: 4px 0 0; }
.hoyc-boton.hoyc-enlace.hoyc-mas-cliente { padding: 2px 0; font-size: .9375rem; text-align: left; white-space: normal; }
.hoyc-boton:disabled { opacity: .55; cursor: not-allowed; }
.hoyc-boton:focus-visible, .hoyc-mas:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

/* ---------------------------------------------------------------- la vista previa (lo que pide sí) y el texto preparado */
.hoyc-vista { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--linea); }
.hoyc-elegido { font-size: .875rem; color: var(--texto-2); }
.hoyc-elegido strong { color: var(--texto); }
.hoyc-vista-etiqueta { font-size: .8125rem; font-weight: 650; color: var(--texto-2); }
.hoyc-vista-lista { display: flex; flex-direction: column; gap: 4px; font-size: .9375rem; color: var(--texto); }
.hoyc-vista-lista li { padding-left: 16px; text-indent: -16px; }
.hoyc-vista-lista li::before { content: "✓ "; color: var(--verde); }
.hoyc-vista-lista.hoyc-no li::before { content: "– "; color: var(--texto-3); }
.hoyc-borrador { background: var(--propuesta); border: 1px solid var(--propuesta-borde); border-radius: var(--r-control, 8px); padding: 14px 16px; font-size: .9375rem; display: flex; flex-direction: column; gap: 6px; }
.hoyc-borrador-cab { font-size: .875rem; overflow-wrap: anywhere; }
.hoyc-borrador-cab span { color: var(--texto-2); margin-right: 6px; }
.hoyc-borrador-cuerpo { border-top: 1px solid var(--propuesta-borde); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.hoyc-aviso-fuera { font-size: .8125rem; color: var(--texto-2); }

/* ---------------------------------------------------------------- hecho hoy */
.hoyc-hecho { display: flex; flex-direction: column; gap: 10px; }
.hoyc-seccion { font-size: .8125rem; font-weight: 700; color: var(--texto-2); text-transform: uppercase; letter-spacing: .06em; }
.hoyc-hecho ul { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-panel, 12px); }
.hoyc-hecho li { display: flex; align-items: center; gap: 4px 12px; padding: 8px 8px 8px 18px; flex-wrap: wrap; min-width: 0; }
.hoyc-hecho li + li { border-top: 1px solid var(--linea); }
.hoyc-que { flex: 1 1 260px; font-size: .9375rem; color: var(--texto); overflow-wrap: anywhere; min-width: 0; }
.hoyc-que::before { content: "✓"; color: var(--verde); font-weight: 800; margin-right: 8px; }
.hoyc-deshecho .hoyc-que { color: var(--texto-3); }
.hoyc-deshecho .hoyc-que::before { content: "↺"; color: var(--texto-3); }
.hoyc-estado { font-size: .8125rem; font-weight: 700; color: var(--texto-2); }
.hoyc-hora { font-size: .8125rem; color: var(--texto-3); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- «Y N más» y la nota */
.hoyc-mas { align-self: flex-start; font: inherit; font-size: .9375rem; font-weight: 650; min-height: 44px; padding: 0 4px; background: none; border: 0; color: var(--acento-texto);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; border-radius: 4px; overflow-wrap: anywhere; max-width: 100%; }
.hoyc-mas:hover { color: var(--acento-hover, var(--acento-texto)); }
.hoyc-nota { font-size: .875rem; color: var(--texto-2); min-height: 1.2em; }
.hoyc-nota:empty { min-height: 0; }
/* (C-24/C-25) El error junto al botón pulsado (dentro de su aviso o de su línea de «Hecho hoy») y el de «ha cambiado» arriba */
.hoyc-error { margin: 10px 0 0; font-size: .9375rem; color: var(--rojo, var(--texto)); font-weight: 600; }
.hoyc-hecho li .hoyc-error { flex-basis: 100%; }

/* ---------------------------------------------------------------- el móvil */
@media (max-width: 560px) {
  .hoyc { gap: 16px; }
  .hoyc-titular { font-size: 1.4375rem; }
  .hoyc-aviso { padding: 16px; }
  .hoyc-aviso-titulo { font-size: 1.0625rem; }
  .hoyc-acciones .hoyc-boton:not(.hoyc-enlace) { flex: 1 1 auto; }
}
