/* ISONA CORE · perito — pantalla limpia: avisos a la izquierda, chat amplio en el centro y capas encima. */
:root {
  /* D01 · azul y blanco, modo claro. Origen: apps/web/src/isona-shell.css (:root), heredado de panel-hoy-estudio. */
  --fondo: #F6F7FB;
  --papel: #FFFFFF;
  --tinta: #1B2333;
  --suave: #5B6479;          /* secundario: AA sobre fondo, blanco y azul suave */
  --terciario: #838BA3;      /* solo decorativo (íconos, bordes): no llega a AA como texto */
  --linea: #E3E6EE;
  --acento: #3B6FD8;         /* azul Isona: acción principal, Enviar, links y foco (blanco encima: 4,72:1) */
  --acento-hover: #2F5CC2;   /* hover del botón (blanco encima: 6,12:1) */
  --acento-texto: #2F5CC2;   /* azul para TEXTO sobre azul suave (#3B6FD8 ahí daba 4,13:1) */
  --acento-suave: #EAF0FD;
  --acento-tinta: #FFFFFF;
  --alerta: #A1453B;
  --rojo: #A1453B;
  --rojo-tenue: #F6E3E0;
  --ambar: #B8863F;          /* relleno / marcas */
  --ambar-tinta: #80591A;    /* TEXTO sobre #F6ECD9 (el #B8863F daba 2,75:1) */
  --ambar-tenue: #F6ECD9;
  --ok: #2A7352;             /* hecho / pagado: TEXTO (el #2F7D5C daba 4,34:1 sobre #E6F2EC) */
  --ok-fondo: #E6F2EC;
  --apagado: #EEF0F6;
  --gris: #C9CEDB;
  --riel: #101F38;
  --riel-activo: #1C3054;
  --riel-texto: #E8ECF5;
  --sombra-suave: 0 1px 2px rgba(16, 31, 56, .06);
  --sombra: 0 1px 2px rgba(16, 31, 56, .06), 0 6px 20px rgba(16, 31, 56, .10);
  --sombra-capa: 0 1px 2px rgba(16, 31, 56, .06), 0 6px 20px rgba(16, 31, 56, .10), 0 24px 60px rgba(16, 31, 56, .18);
  --radio: 20px;
  --dur: 150ms;
  --fuente: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-reduced-motion: reduce) { :root { --dur: 0ms; } }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 15.5px/1.5 var(--fuente); }
body.con-capas { overflow: hidden; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }

/* ── básicos ─────────────────────────────────────────────────────────────── */
.marca { font-weight: 700; font-size: 17px; letter-spacing: .02em; margin: 0; color: var(--acento); }
.titulo { font-size: 22px; margin: 8px 0 4px; }
.ayuda { color: var(--suave); font-size: 14px; margin: 4px 0 12px; }
.aviso { color: var(--alerta); margin: 8px 0 0; }
.vacio { color: var(--suave); margin: 4px 0; }
input, select { font: inherit; padding: 11px 12px; border: 1px solid var(--linea); border-radius: 10px; background: var(--papel); color: var(--tinta); width: 100%; }
input:disabled { background: var(--fondo); color: var(--suave); }
/* C16: el width:100% de arriba no aplica a checkbox ni radio (en una fila flex los estiraba y los centraba). */
input[type="checkbox"], input[type="radio"] { width: auto; flex: none; padding: 0; margin: 0; accent-color: var(--acento); }
input[type="checkbox"] { width: 18px; height: 18px; }

.btn { font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--linea); background: var(--papel); color: var(--tinta); cursor: pointer; transition: background var(--dur), opacity var(--dur); }
.btn:hover:not(:disabled) { background: var(--fondo); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-principal { background: var(--acento); border-color: var(--acento); color: var(--acento-tinta); }
.btn-principal:hover:not(:disabled) { background: var(--acento); opacity: .92; }
.btn-texto { font: inherit; border: 0; background: none; color: var(--suave); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.btn-texto:hover { color: var(--tinta); }
.btn-enlace { font: inherit; border: 0; background: none; color: var(--acento); text-decoration: underline; cursor: pointer; padding: 0; }
.btn-ancho { width: 100%; }

.pantalla-sola { max-width: 400px; margin: 0 auto; padding: 16px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.login { display: flex; flex-direction: column; gap: 10px; }

/* ── estructura ──────────────────────────────────────────────────────────── */
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.barra { grid-column: 1 / -1; position: relative; display: flex; align-items: center; gap: 4px; padding: 10px 20px; }
.espacio { flex: 1; }
.secciones { grid-column: 2; grid-row: 2; min-height: 0; overflow-y: auto; padding: 4px 24px 24px 8px; }
.seccion { max-width: 760px; }
.seccion[hidden] { display: none; }
.seccion-chat { max-width: none; height: 100%; }
.seccion-chat.chat { display: flex; }
.seccion-chat[hidden] { display: none; }

/* ≥1200 px: Hoy a la izquierda y el chat del junior a la derecha, al lado de las tarjetas. */
@media (min-width: 1200px) {
  .rail-item[data-sec="chat"] { display: none; }
  .secciones.dos-columnas { display: grid; grid-template-columns: minmax(0, 5fr) minmax(400px, 4fr); grid-template-rows: minmax(0, 1fr); gap: 24px; overflow: hidden; padding-bottom: 16px; }
  .secciones.dos-columnas > .seccion { max-width: none; min-height: 0; }
  .secciones.dos-columnas > .seccion[data-sec="hoy"] { overflow-y: auto; padding: 0 8px 24px 0; }
  .secciones.dos-columnas > .seccion-chat { height: 100%; }
}

/* Rail (escritorio) y barra de abajo (celular). */
.rail { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 4px; padding: 4px 10px 16px 14px; overflow-y: auto; }
.rail-item { font: inherit; font-size: 14px; color: var(--suave); background: none; border: 0; border-radius: 12px; padding: 10px 6px; cursor: pointer; text-align: center; }
.rail-item:hover { background: var(--acento-suave); color: var(--tinta); }
.rail-item[aria-current="page"] { background: var(--acento-suave); color: var(--acento); font-weight: 600; }
.rail-mas { display: none; }

/* Avatar y menú de perfil. */
.avatar { width: 36px; height: 36px; border-radius: 999px; border: 0; background: var(--acento); color: var(--acento-tinta); font: inherit; font-weight: 600; cursor: pointer; }
.menu-perfil { position: absolute; right: 16px; top: 54px; z-index: 60; min-width: 210px; display: flex; flex-direction: column; padding: 6px; background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra-capa); }
.menu-perfil[hidden] { display: none; }
.menu-item { font: inherit; text-align: left; color: var(--tinta); background: none; border: 0; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.menu-item:hover { background: var(--acento-suave); }
.menu-salir { color: var(--alerta); border-top: 1px solid var(--linea); border-radius: 0 0 10px 10px; margin-top: 4px; }

/* Mi Día, chips y filas tenues. */
.mi-dia { margin: 4px 4px 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fuentes-estado:empty { display: none; }
.fuente-fila { margin: 0 4px 8px; font-size: 13px; color: var(--suave); }
/* La tarjeta es el envoltorio: chip arriba, contenido en el medio, botones abajo (siempre visibles). */
.tarjeta-item { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--papel); border-radius: var(--radio);
  box-shadow: var(--sombra); padding: 10px 14px 6px 18px; overflow: hidden; }
.tarjeta-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gris); }
.tarjeta-item[data-color="rojo"]::before { background: var(--rojo); }
.tarjeta-item[data-color="ambar"]::before { background: var(--ambar); }
.tarjeta-item .aviso-tarjeta { background: none; box-shadow: none; border-radius: 8px; padding: 0; transform: none; overflow: visible; }
.tarjeta-item .aviso-tarjeta::before { display: none; }
.tarjeta-item .aviso-tarjeta:hover { transform: none; box-shadow: none; }
.tarjeta-chips { display: flex; gap: 6px; }
.chip-fuente, .chip-estado { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.5; border-radius: 999px; padding: 0 9px; }
.chip-fuente { color: var(--suave); background: var(--papel); border: 1px solid var(--linea); }
.chip-falta { color: #6b4e00; background: #fdf0c8; }
.chip-completo { color: var(--acento); background: var(--acento-suave); }
.falta-dato { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: #fff8e3; border-radius: 12px; }
.falta-dato .campo-en-linea { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--suave); flex: 1; min-width: 140px; }
.tarjeta-botones { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 2px 0 0 -10px; border-top: 1px solid var(--linea); padding-top: 4px; }
.tarjeta-botones .btn-texto { font-size: 14px; padding: 8px 10px; min-height: 36px; }
.tarjeta-botones [data-accion="aprobar"] { color: var(--acento); font-weight: 600; }
.tarjeta-botones [data-accion="aprobar"]:disabled { color: var(--suave); font-weight: 400; opacity: .55; cursor: default; }
.tarjeta-botones [data-accion="despues"] { margin-left: auto; }
.fila-agenda { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--papel); border: 0;
  border-radius: var(--radio); box-shadow: var(--sombra); padding: 12px 14px 12px 18px; min-height: 44px; }
.fila-agenda .hora { color: var(--suave); font-variant-numeric: tabular-nums; }
.despues-contador { margin: 8px 0 0; font-size: 13px; }
.efectos { margin: 2px 0 0; padding: 10px 14px; background: var(--fondo); border-radius: 12px; font-size: 14px; cursor: default; }
.efectos ol { margin: 0 0 6px; padding-left: 20px; }
.efectos li { margin: 2px 0; }

/* Inicio, Casos y estados vacíos. */
.panel { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 14px 18px; margin: 0 0 12px; }
.panel-titulo { font-size: 13px; font-weight: 600; color: var(--suave); margin: 0 0 8px; }
.panel-lista { list-style: none; margin: 0; padding: 0; }
.panel-lista li { padding: 4px 0; display: flex; gap: 10px; }
.panel-lista .fecha { color: var(--suave); font-variant-numeric: tabular-nums; min-width: 44px; }
.panel-dato { margin: 0 0 6px; font-weight: 600; }
.medidor { height: 8px; border-radius: 999px; background: var(--linea); overflow: hidden; }
.medidor span { display: block; height: 100%; width: 0; background: var(--acento); border-radius: 999px; }
.medidor.cerca span { background: var(--ambar); }
.casos-lista .caso { margin: 0 0 14px; }
.casos-lista .caso-titulo { font-weight: 600; margin: 0 0 4px; overflow-wrap: anywhere; }
.casos-lista ul { list-style: none; margin: 0; padding: 0 0 0 4px; color: var(--suave); font-size: 14px; }
.proximamente { color: var(--suave); margin: 24px 4px; }
.esp-fila { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }

.columna { overflow-y: auto; padding: 4px 6px 16px 2px; min-height: 0; }
.columna-titulo { font-size: 13px; font-weight: 600; color: var(--suave); margin: 14px 4px 10px; }
.columna-titulo:first-child { margin-top: 4px; }

/* Tarjetas de aviso: franja fina a la izquierda, sin bordes pesados. */
.avisos { display: flex; flex-direction: column; gap: 10px; }
.aviso-tarjeta { position: relative; display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--papel); border: 0; border-radius: var(--radio); padding: 12px 14px 12px 18px; box-shadow: var(--sombra);
  transition: transform var(--dur), box-shadow var(--dur); overflow: hidden; }
.aviso-tarjeta::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gris); }
.aviso-tarjeta[data-color="rojo"]::before { background: var(--rojo); }
.aviso-tarjeta[data-color="ambar"]::before { background: var(--ambar); }
.aviso-tarjeta:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(28,28,26,.06), 0 8px 22px rgba(28,28,26,.08); }
.aviso-fila { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.aviso-caratula { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.aviso-fecha { font-weight: 700; white-space: nowrap; font-size: 14px; }
.aviso-tarjeta[data-color="rojo"] .aviso-fecha { color: var(--alerta); }
.aviso-accion { color: var(--suave); font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aviso-notificado { color: var(--suave); font-size: 13px; margin-top: 4px; }
/* Línea chica gris: la fecha de notificación es estimada (no vino del portal). */
.nota-gris { color: var(--suave); font-size: 12px; line-height: 1.35; }
.nota-gris.pie { margin: 14px 4px 0; }
.gris { color: var(--suave); }

.hoy { list-style: none; margin: 0; padding: 0 4px; }
.hoy li { padding: 6px 0; }
.hoy .btn-hoy { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.hoy .hora { color: var(--suave); font-variant-numeric: tabular-nums; }
.btn-agenda { color: var(--acento); font-weight: 600; margin: 8px 0 0; padding-left: 4px; }

/* Chat: lo más grande. */
.chat { min-height: 0; display: flex; flex-direction: column; background: var(--papel); border-radius: 18px; box-shadow: var(--sombra); overflow: hidden; }
.franja { margin: 0; padding: 10px 18px; background: var(--rojo-tenue); color: var(--tinta); font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.chat-mensajes { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.burbuja { max-width: min(560px, 80%); margin: 0; padding: 10px 14px; border-radius: 16px; }
.burbuja-isona { background: var(--fondo); border-bottom-left-radius: 6px; align-self: flex-start; }
.burbuja-yo { background: var(--acento); color: var(--acento-tinta); border-bottom-right-radius: 6px; align-self: flex-end; }
.chat-sugerencias { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; flex: none; }
.chip-sugerencia { font: inherit; font-size: 13px; padding: 6px 12px; border: 1px solid var(--linea); border-radius: 999px; background: var(--papel); color: inherit; cursor: pointer; min-height: 32px; }
.chip-sugerencia:hover { border-color: var(--acento); }
.chat-escribir { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--linea); flex: none; align-items: flex-end; }
/* C27: el cuadro del chat crece con un escrito pegado; + adjunta un escrito propio. */
#chat-texto { flex: 1; min-width: 0; min-height: 44px; max-height: 40vh; resize: vertical; font: inherit; line-height: 1.4; padding: 10px 12px;
  border: 1px solid var(--linea); border-radius: 12px; background: var(--papel); color: inherit; }
.btn-adjuntar { flex: none; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 700; }
/* C27c: el input de archivo existe pero no se ve (con display:none algunos navegadores no abren el selector); lo abre el botón +. */
.solo-lector { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
/* C27c: el archivo adjunto se ve antes de Enviar: nombre y Quitar. */
.chat-adjuntado { display: flex; align-items: center; gap: 8px; margin: 0 12px; padding: 8px 12px 0; font-size: 14px; color: var(--suave); }
.chat-adjuntado[hidden] { display: none; }
.chat-adjuntado .adjunto-nombre { font-weight: 600; color: var(--tinta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-adjuntado .btn-texto { flex: none; }
/* C27: el borrador vive en el chat (Word · Editar · Listo), editable en el lugar. */
.borrador-chat { width: min(560px, 100%); box-sizing: border-box; }
.borrador-chat .acciones { justify-content: flex-start; flex-wrap: wrap; }
.junior-acciones:has(.borrador-chat) { max-width: min(560px, 100%); align-self: stretch; }
@media (max-width: 760px) { .borrador-chat .acciones .btn { flex: 1 1 0; min-width: 0; } }
/* C27d: el escrito es un documento en el chat (como Hark). Toda la ficha se toca y abre la vista previa. */
.doc-ficha { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--linea); border-radius: 12px;
  background: var(--papel); color: var(--tinta); font: inherit; text-align: left; cursor: pointer; transition: border-color var(--dur), background var(--dur); }
.doc-ficha:hover:not(:disabled) { border-color: var(--acento); background: var(--acento-suave); }
.doc-ficha:disabled { cursor: default; opacity: .7; }
.doc-icono { flex: none; width: 36px; height: 36px; padding: 6px; border-radius: 10px; background: var(--acento-suave); color: var(--acento-texto);
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; box-sizing: border-box; }
.doc-textos { display: flex; flex-direction: column; min-width: 0; }
.doc-titulo { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 13px; color: var(--suave); }
.borrador-chat .doc-acciones { margin-top: 8px; }
.btn-chico { padding: 6px 12px; font-size: 14px; }
/* Vista previa: hoja A4 (21 cm, márgenes de 2,5 cm), blanca, sobre gris. Fuente, tamaño, interlineado y sangría los pone el JS (= Word). */
.capa-vista-previa .capa-panel { width: min(70vw, 960px); }
.capa-vista-previa .capa-cuerpo { background: var(--apagado); padding: 16px; }
.capa-vista-previa .capa-titulo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vp-acciones { display: flex; gap: 8px; flex: none; }
.vp-marco { display: flex; justify-content: center; }
.vp-hoja { flex: none; box-sizing: border-box; width: 21cm; min-height: 29.7cm; padding: 2.5cm; background: #fff; color: #000; box-shadow: var(--sombra); }
.vp-p { margin: 0; text-align: justify; overflow-wrap: anywhere; }
.vp-negrita { font-weight: 700; }
@media (max-width: 760px) {
  .capa-vista-previa .capa-panel { top: 0; height: 100%; border-radius: 0; }
  .capa-vista-previa .capa-cuerpo { padding: 8px 8px calc(96px + env(safe-area-inset-bottom)); }
  /* En el celular, Descargar queda abajo, fijo y grande. */
  .capa-vista-previa .vp-descargar { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); min-height: 52px; font-size: 17px; z-index: 5;
    box-shadow: var(--sombra-capa); }
}
.borrador-caratula { margin: 0; font-weight: 800; letter-spacing: -.01em; }
.borrador-titulo { margin: 2px 0 6px; font-size: 13px; color: var(--gris, #6b7280); }
.borrador-vista { margin: 0 0 6px; font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.borrador-nota { margin: 0 0 4px; font-size: 13px; }
.borrador-editor { width: 100%; box-sizing: border-box; margin: 6px 0; font: inherit; font-size: 14px; line-height: 1.5; padding: 10px; border: 1px solid var(--linea); border-radius: 10px; background: var(--papel); color: inherit; resize: vertical; }
.borrador-pregunta { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--linea); }
.modelo-fila { padding: 10px 0; border-bottom: 1px solid var(--linea); }
.modelo-fila:last-child { border-bottom: 0; }
.modelo-fila input[name="instrucciones"] { width: 100%; box-sizing: border-box; }

/* ── capas ───────────────────────────────────────────────────────────────── */
.capa { position: fixed; inset: 0; }
.capa-velo { position: absolute; inset: 0; background: rgba(20, 20, 18, .5); opacity: 0; transition: opacity var(--dur); }
@supports ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .capa-velo { background: rgba(20, 20, 18, .32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
}
.capa-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(60vw, 920px); background: var(--fondo); box-shadow: var(--sombra-capa);
  display: flex; flex-direction: column; transform: translateX(24px); opacity: 0; outline: none;
  transition: transform var(--dur) ease-out, opacity var(--dur) ease-out, filter var(--dur); border-radius: 18px 0 0 18px; }
.capa[data-nivel="1"] .capa-panel { width: min(54vw, 820px); }
.capa[data-nivel="2"] .capa-panel { width: min(48vw, 720px); }
.capa.is-abierta .capa-velo { opacity: 1; }
.capa.is-abierta .capa-panel { transform: none; opacity: 1; }
.capa.is-saliendo .capa-velo { opacity: 0; }
.capa.is-saliendo .capa-panel { transform: translateX(24px); opacity: 0; }
/* Las de atrás: un poco más lejos y atenuadas. */
.capa.is-atras .capa-panel { transform: translateX(-28px) scale(.98); filter: brightness(.93); }
.capa-cabeza { display: flex; align-items: center; gap: 8px; padding: 16px 20px 8px 24px; flex: none; }
.capa-titulo { font-size: 18px; margin: 0; flex: 1; }
.capa-cerrar { font: inherit; font-size: 18px; width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--papel); color: var(--tinta); cursor: pointer; box-shadow: var(--sombra); }
.capa-cuerpo { flex: 1; overflow-y: auto; padding: 8px 24px 32px; }

/* Contenido de capas */
.bloque { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 16px 18px; margin: 0 0 12px; }
.bloque p { margin: 0 0 4px; }
.etiqueta { font-size: 13px; color: var(--suave); margin: 0 0 2px; }
.fecha-grande { font-size: 34px; font-weight: 700; line-height: 1.15; margin: 2px 0 4px; }
.fecha-grande.is-rojo { color: var(--alerta); }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fondo); color: var(--suave); vertical-align: middle; }
.dato { color: var(--suave); font-size: 14px; }
.gracia { color: var(--alerta); font-weight: 700; }
.causa { font-weight: 600; overflow-wrap: anywhere; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.turnos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pregunta { background: var(--acento-suave); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.pregunta p { margin: 0 0 4px; font-weight: 600; }
.formulario { display: flex; flex-direction: column; gap: 12px; }
.fila { display: flex; gap: 8px; }
.fila > * { flex: 1; }
.campo { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--suave); }
.grupo { border: 0; border-radius: var(--radio); padding: 14px 16px; margin: 0; background: var(--papel); box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 10px; }
.grupo legend { font-weight: 700; padding: 0; float: left; width: 100%; margin-bottom: 4px; }
.perfil { display: flex; flex-direction: column; gap: 14px; }

/* Agenda: lista por día */
.semana-nav { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.semana-nav .btn-texto { font-size: 22px; line-height: 1; padding: 4px 12px; }
.semana-titulo { font-weight: 600; flex: 1; text-align: center; margin: 0; }
.dia { padding: 12px 0; border-bottom: 1px solid var(--linea); }
.dia:last-of-type { border-bottom: 0; }
.dia-titulo { margin: 0 0 4px; font-weight: 700; }
.dia.is-hoy .dia-titulo { color: var(--acento); }
.dia-feriado { margin: 2px 0; font-size: 14px; color: var(--alerta); background: var(--rojo-tenue); border-radius: 8px; padding: 2px 8px; display: inline-block; }
.dia-feriado.is-otra { color: var(--suave); background: var(--fondo); }
.dia ul { list-style: none; margin: 0; padding: 0; }
.dia li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.dia .hora { color: var(--suave); font-variant-numeric: tabular-nums; margin-right: 6px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 480px; margin: 0 auto; background: var(--tinta); color: var(--fondo); padding: 12px 16px; border-radius: 12px; z-index: 500; }

/* ── celular: barra de abajo (Hoy · Chat · Agenda · Más), capas desde abajo ─ */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .barra { padding: 10px 16px; }
  .secciones { grid-column: 1; padding: 0 16px 84px; }
  .seccion-chat { height: calc(100dvh - 140px); }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; flex-direction: row; justify-content: space-around; gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--papel); box-shadow: 0 -2px 14px rgba(28, 28, 26, .08); overflow: visible; }
  .rail-item { flex: 1; padding: 10px 4px; min-height: 48px; }
  .mi-dia { font-size: 14px; }
  .avatar { width: 44px; height: 44px; }
  .btn, .btn-texto, .menu-item, input:not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; }
  .tarjeta-botones { margin-left: -12px; }
  .chip-sugerencia { min-height: 44px; }
  .tarjeta-botones .btn-texto { min-height: 44px; padding: 10px 12px; }
  .fila-agenda { min-height: 48px; }
  .capa-cerrar { width: 44px; height: 44px; }
  .rail-sec { display: none; }
  .rail-mas { display: block; }
  .menu-perfil { right: 12px; }
  .capa-panel { top: auto; left: 0; right: 0; width: 100%; height: calc(100% - 24px); border-radius: 18px 18px 0 0; transform: translateY(32px); }
  .capa[data-nivel] .capa-panel { width: 100%; }
  .capa.is-abierta .capa-panel { transform: none; }
  .capa.is-saliendo .capa-panel { transform: translateY(32px); }
  .capa.is-atras .capa-panel { transform: translateY(-10px) scale(.96); }
  .capa-cuerpo { padding: 8px 16px 24px; }
}

/* Informe pericial (borrador local) */
textarea { font: inherit; color: var(--tinta); background: var(--papel); border: 1px solid var(--gris); border-radius: 10px; padding: 8px 10px; resize: vertical; width: 100%; box-sizing: border-box; }
.tecnicas { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tecnica { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.tecnica-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--tinta); min-width: 0; }
.tecnica-nombre { overflow-wrap: anywhere; }
.tecnica-texto[hidden] { display: none; }
/* C16: bloques plegables del informe */
.seccion > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; font-weight: 600; list-style: none; }
.seccion > summary::-webkit-details-marker { display: none; }
.seccion > summary::after { content: "›"; color: var(--suave); transition: transform var(--dur); }
.seccion[open] > summary::after { transform: rotate(90deg); }
.seccion > summary > span:first-child { flex: 1; }
.seccion[open] > summary { margin-bottom: 12px; }
.tilde { color: var(--acento); font-weight: 700; }
.tilde[hidden] { display: none; }
.grilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 640px) { .grilla-2 { grid-template-columns: 1fr; } }
.puntos { display: flex; flex-direction: column; gap: 12px; }
.punto .causa { margin: 0 0 6px; }
.petitorio { margin: 0; padding-left: 20px; }
.bloque-parte { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--gris); }
.bloque-parte:first-child { border-top: 0; padding-top: 0; }

/* C14: sección "Pericias" de la columna (siempre visible) */
.pericias-lista { display: flex; flex-direction: column; gap: 6px; }
.pericia-fila { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  font: inherit; color: inherit; cursor: pointer; background: var(--papel); border: 0; border-radius: 10px; padding: 9px 12px 9px 16px; box-shadow: var(--sombra); }
.pericia-fila::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 10px 0 0 10px; background: var(--gris); }
.pericia-fila[data-color="rojo"]::before { background: var(--rojo); }
.pericia-fila[data-color="ambar"]::before { background: var(--ambar); }
.pericia-caratula { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pericia-vence { color: var(--suave); font-size: 13px; white-space: nowrap; }
.pericia-fila[data-color="rojo"] .pericia-vence { color: var(--alerta); font-weight: 600; }
.btn-agregar { color: var(--acento); font-weight: 600; padding: 4px; align-self: flex-start; }
/* C17: Armar con IA */
.ia input[type="file"] { padding: 8px; font-size: 14px; }
.ia-faltas .aviso { margin: 4px 0; }
.chip-ia { background: var(--fondo); color: var(--acento); font-weight: 600; }
.ia-barra { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 0 0 10px; font-size: 14px; }
.aviso-ia { color: var(--alerta); margin-right: auto; }
/* C18: Word — lo que lo bloquea en rojo (completo, con links); el estado del borrador aparte, gris y chico */
.btn-principal:disabled { background: var(--gris); border-color: var(--gris); color: var(--suave); opacity: 1; }
.falta-word { margin: 8px 0 0; }
.falta-word .aviso { margin: 0 0 4px; }
.falta-lista { margin: 0; padding-left: 18px; color: var(--alerta); }
.falta-lista li { margin: 2px 0; }
.falta-item { color: var(--alerta); text-align: left; }
.nota-word { margin: 8px 0 0; font-weight: 600; }
.borrador-estado { margin-top: 20px; font-size: 12px; }
.ia-faltas-lista { margin: 4px 0 0; padding-left: 18px; color: var(--suave); font-size: 13px; }

/* C20 · tareas genéricas en la columna de avisos */
.columna-cabeza { display: flex; align-items: center; justify-content: space-between; }
.columna-cabeza .columna-titulo { margin-bottom: 10px; }
.btn-mas { font-size: 22px; line-height: 1; padding: 2px 10px; }
.ver-hechas { align-self: flex-start; font-size: 13px; }
.fila-hecha { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--linea, rgba(28,28,26,.08)); }

/* Tu correo en Isona (C21) */
.mail-direccion { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--gris); border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px; }
.mail-guia { margin: 8px 0 0; font-size: 14px; }
.mail-guia summary { cursor: pointer; color: var(--suave); }
.mail-guia ol { margin: 6px 0 0; padding-left: 20px; }
.mail-guia li { margin: 4px 0; cursor: help; }

/* Chat junior (C22) */
.burbuja { white-space: pre-wrap; overflow-wrap: anywhere; }
.junior-acciones { display: flex; flex-direction: column; gap: 8px; align-self: flex-start; max-width: min(560px, 80%); }
.junior-accion { border: 1px solid var(--linea); border-radius: 14px; padding: 10px 12px; background: var(--papel); }
.junior-linea { margin: 0 0 4px; }
.propuesta-renglon { white-space: pre-wrap; }
.propuesta-agregado { background: var(--acento-suave); color: var(--acento-texto); font-weight: 600; border-radius: 3px; padding: 0 2px; }
.propuesta-quitado { color: var(--suave); }
.junior-accion .acciones { display: flex; gap: 8px; margin-top: 6px; }
.memoria-fila { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.memoria-fila input { flex: 1; min-width: 0; }

/* ── Agenda, Clientes y Cobros (C24) ── */
.agenda-cuerpo .dia li { display: block; padding: 4px 0; }
.agenda-cuerpo .fila-agenda .chip-fuente { margin: 0 4px; }
.buscador { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 14px; margin: 0 0 10px; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--papel); color: inherit; }
.lista-simple { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.lista-simple[hidden] { display: none; }
.fila-lista { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; box-sizing: border-box; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--papel); border: 0; border-radius: var(--radio); box-shadow: var(--sombra); padding: 12px 14px; min-height: 44px; }
.fila-lista.is-vencido { box-shadow: inset 4px 0 0 var(--alerta), var(--sombra); }
.fila-lista.is-archivado { opacity: .6; }
.fila-nombre { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fila-dato { color: var(--suave); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fila-saldo { color: var(--alerta); font-weight: 600; }
.cobros-resumen { margin: 0 0 12px; font-weight: 600; }
.junior-accion select { max-width: 100%; margin: 4px 0; }
@media (max-width: 760px) {
  .fila-lista { min-height: 48px; flex-wrap: wrap; }
  .fila-dato { white-space: normal; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   D01 · Diseño: azul y blanco (modo claro) con la forma y la tipografía de la landing.
   Solo tokens, CSS y markup mínimo; ninguna lógica. Íconos Lucide (20 px, trazo 1,75) como máscaras.
   ═══════════════════════════════════════════════════════════════════════════ */
body { font-family: var(--fuente); font-weight: 400; -webkit-font-smoothing: antialiased; }
input, select, textarea, button { font-family: inherit; }
.hora, .aviso-fecha, .fila-dato, .fecha-grande, .cobro-total, .pastilla, .chip-resumen, .panel-lista .fecha, .saludo { font-variant-numeric: tabular-nums; }

/* Títulos con presencia */
.eyebrow { display: inline-block; margin: 0 0 14px; padding: 5px 12px; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--suave); background: var(--papel); border: 1px solid var(--linea); border-radius: 999px; line-height: 1.3; }
.saludo { margin: 0 0 16px; font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; overflow-wrap: anywhere; }
.columna-titulo, .panel-titulo { font-size: clamp(22px, 2.4vw, 26px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; text-transform: none; color: var(--tinta); margin: 36px 0 14px; }
.columna-titulo:first-child { margin-top: 4px; }
.panel-titulo { font-size: 18px; margin: 0 0 10px; }
.titulo, .capa-titulo { font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.capa-titulo { font-size: 22px; }
.fecha-grande { font-weight: 800; letter-spacing: -.03em; }
.marca { font-weight: 800; letter-spacing: -.03em; font-size: 22px; color: var(--acento-texto); }
.etiqueta, .dato, .ayuda, .nota-gris { font-weight: 500; }

/* Cabecera de Mi Día: eyebrow, saludo y chips de resumen; degradé azul muy suave arriba a la derecha */
.hoy-cabeza { position: relative; padding: 6px 0 4px; margin: 0 0 8px; isolation: isolate; }
.hoy-cabeza::before { content: ""; position: absolute; z-index: -1; right: 0; top: -72px; width: min(520px, 90%); height: 300px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(59, 111, 216, .08), rgba(59, 111, 216, 0)); }
.chips-resumen { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-resumen { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--acento-suave); color: var(--acento-texto); }
.chip-resumen.is-alerta { background: var(--rojo-tenue); color: var(--alerta); }
.mi-dia { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Estructura: rail azul noche a la izquierda de punta a punta; contenido hasta ~1180 px */
.app { grid-template-columns: 224px minmax(0, 1fr); }
.barra { grid-column: 2; padding: 14px clamp(16px, 3vw, 40px) 6px; background: none; }
.barra .marca { display: none; }
.rail { grid-row: 1 / -1; grid-column: 1; gap: 4px; padding: 22px 14px 18px; background: var(--riel); }
.rail::before { content: "Isona"; color: #fff; font-weight: 800; font-size: 24px; letter-spacing: -.03em; padding: 4px 12px 22px; }
.rail-item { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 44px; padding: 10px 12px; border-radius: 12px; font-size: 15px; font-weight: 500;
  color: var(--riel-texto); background: none; transition: background-color var(--dur), color var(--dur); }
.rail-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.rail-item[aria-current="page"] { background: var(--riel-activo); color: #fff; font-weight: 700; }
.rail-item::before { content: ""; flex: none; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.rail-item[data-sec="hoy"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2'/%3E%3Cpath d='M12 20v2'/%3E%3Cpath d='m4.93 4.93 1.41 1.41'/%3E%3Cpath d='m17.66 17.66 1.41 1.41'/%3E%3Cpath d='M2 12h2'/%3E%3Cpath d='M20 12h2'/%3E%3Cpath d='m6.34 17.66-1.41 1.41'/%3E%3Cpath d='m19.07 4.93-1.41 1.41'/%3E%3C/svg%3E"); }
.rail-item[data-sec="chat"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.9 20A9 9 0 1 0 4 16.1L2 22Z'/%3E%3C/svg%3E"); }
.rail-item[data-sec="inicio"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='7' height='9' x='3' y='3' rx='1'/%3E%3Crect width='7' height='5' x='14' y='3' rx='1'/%3E%3Crect width='7' height='9' x='14' y='12' rx='1'/%3E%3Crect width='7' height='5' x='3' y='16' rx='1'/%3E%3C/svg%3E"); }
.rail-item[data-sec="casos"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E"); }
.rail-item[data-sec="agenda"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E"); }
.rail-item[data-sec="clientes"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.rail-item[data-sec="cobros"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4'/%3E%3C/svg%3E"); }
.rail-mas { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E"); display: none; }
.rail :focus-visible { outline-color: #9db8f0; }
.secciones { padding: 4px max(16px, calc((100% - 1180px) / 2)) 48px; }
.seccion { max-width: 1180px; }
.seccion[data-sec="hoy"], .seccion[data-sec="clientes"], .seccion[data-sec="cobros"], .seccion[data-sec="inicio"], .seccion[data-sec="casos"] { max-width: 860px; }
.seccion[data-sec="agenda"] { max-width: 1180px; }
.seccion > * + .columna-cabeza { margin-top: 32px; }
@media (min-width: 1200px) {
  .secciones.dos-columnas { padding-inline: max(24px, calc((100% - 1180px) / 2)); gap: 32px; grid-template-columns: minmax(0, 6fr) minmax(380px, 5fr); }
  .secciones.dos-columnas > .seccion[data-sec="hoy"] { max-width: none; }
}
.avatar { width: 40px; height: 40px; background: var(--acento); color: #fff; font-weight: 800; transition: background-color var(--dur); }
.avatar:hover { background: var(--acento-hover); }
.menu-perfil { border-radius: 16px; border: 1px solid var(--linea); }
.menu-item { border-radius: 12px; font-weight: 500; transition: background-color var(--dur); }
.menu-item:hover { background: var(--acento-suave); }

/* Botones, campos y chips */
.btn { padding: 12px 20px; border-radius: 12px; font-weight: 800; background: var(--papel); color: var(--tinta); border: 1px solid var(--linea);
  transition: background-color var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur); }
.btn:hover:not(:disabled) { background: var(--papel); border-color: var(--acento); color: var(--acento-texto); }
.btn-principal { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn-principal:hover:not(:disabled) { background: var(--acento-hover); border-color: var(--acento-hover); color: #fff; opacity: 1; }
.btn-principal:disabled { background: var(--apagado); border-color: var(--apagado); color: var(--suave); }
.btn-texto { font-weight: 700; color: var(--suave); border-radius: 10px; transition: background-color var(--dur), color var(--dur); }
.btn-texto:hover { color: var(--acento-texto); background: var(--acento-suave); }
.btn-enlace, .btn-agenda, .btn-agregar { color: var(--acento); font-weight: 700; }
.btn-mas { font-size: 24px; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--linea); background: var(--papel); color: var(--acento-texto); padding: 0; }
input, select, textarea { border-radius: 12px; border: 1px solid var(--linea); background: var(--papel); transition: border-color var(--dur), box-shadow var(--dur); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 8px; }
.chip-fuente, .chip-estado, .chip, .chip-ia { border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 10px; }
.chip-fuente { color: var(--suave); background: var(--papel); border: 1px solid var(--linea); }
.chip-falta { color: var(--ambar-tinta); background: var(--ambar-tenue); }
.chip-completo { color: var(--ok); background: var(--ok-fondo); }
.chip-ia { color: var(--acento-texto); background: var(--acento-suave); }
.pastilla { display: inline-block; flex: none; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; }
.p-pendiente { background: var(--acento-suave); color: var(--acento-texto); }
.p-vencido { background: var(--rojo-tenue); color: var(--alerta); }
.p-semana { background: var(--ambar-tenue); color: var(--ambar-tinta); }
.p-pagado { background: var(--ok-fondo); color: var(--ok); }
.p-anulado { background: var(--apagado); color: var(--suave); }

/* Tarjetas: radio 20, borde fino, sombra suave; las que abren algo llevan la flecha en un círculo de 36 px */
.tarjeta-item, .panel, .bloque, .grupo, .junior-accion { border: 1px solid var(--linea); background: var(--papel); }
.tarjeta-item { gap: 8px; padding: 16px 20px 10px; border-radius: var(--radio); box-shadow: var(--sombra-suave);
  transition: box-shadow var(--dur), border-color var(--dur); }
.tarjeta-item::before { display: none; }
.tarjeta-item::after { content: ""; position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 1px solid var(--linea); border-radius: 50%;
  background: var(--papel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235B6479' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E") center / 18px no-repeat; transition: border-color var(--dur), background-color var(--dur); pointer-events: none; }
.tarjeta-item:hover { box-shadow: var(--sombra); border-color: #d3d8e6; }
.tarjeta-item:hover::after { border-color: var(--acento); background: var(--acento-suave) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232F5CC2' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E") center / 18px no-repeat; }
.tarjeta-chips, .tarjeta-item .aviso-fila { margin-right: 48px; }
.aviso-fila { align-items: center; }
.aviso-caratula { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.aviso-accion { font-weight: 500; }
.aviso-fecha { padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #EEF0F6; color: var(--suave); }
.aviso-tarjeta[data-color="ambar"] .aviso-fecha { background: var(--ambar-tenue); color: var(--ambar-tinta); }
.aviso-tarjeta[data-color="rojo"] .aviso-fecha { background: var(--rojo-tenue); color: var(--alerta); }
.tarjeta-item .aviso-tarjeta:hover { background: none; }
.falta-dato { background: var(--ambar-tenue); border-radius: 14px; }
.tarjeta-botones { gap: 8px; margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--linea); }
.tarjeta-botones .btn-texto { font-size: 14px; min-height: 40px; padding: 8px 14px; border-radius: 12px; }
.tarjeta-botones [data-accion="ver"], .tarjeta-botones [data-accion="editar"] { border: 1px solid var(--linea); color: var(--tinta); font-weight: 800; background: var(--papel); }
.tarjeta-botones [data-accion="ver"]:hover { border-color: var(--acento); color: var(--acento-texto); background: var(--papel); }
.tarjeta-botones [data-accion="aprobar"], .tarjeta-botones [data-accion="hecha"], .tarjeta-botones [data-accion="pagar"] { background: var(--acento); color: #fff; font-weight: 800; }
.tarjeta-botones [data-accion="aprobar"]:hover:not(:disabled), .tarjeta-botones [data-accion="hecha"]:hover, .tarjeta-botones [data-accion="pagar"]:hover { background: var(--acento-hover); color: #fff; }
.tarjeta-botones [data-accion="aprobar"]:disabled { background: var(--apagado); color: var(--suave); font-weight: 800; opacity: 1; cursor: not-allowed; }
.tarjeta-botones [data-accion="aprobar"]:disabled::before { content: ""; display: inline-block; width: 14px; height: 14px; margin: 0 6px -2px 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat; }
.tarjeta-botones [data-accion="despues"] { margin-left: auto; font-weight: 700; }
.efectos { background: var(--acento-suave); border-radius: 14px; }
.fila-agenda { border: 1px solid var(--linea); border-radius: 16px; box-shadow: none; font-weight: 500; transition: border-color var(--dur), background-color var(--dur); }
.fila-agenda:hover { border-color: var(--acento); }
.despues-contador { font-weight: 700; color: var(--acento-texto); }
.fuente-fila { font-weight: 500; }
.franja { background: var(--rojo-tenue); border-radius: 14px; margin-bottom: 12px; }

/* Vacíos: ícono, una línea y botón si corresponde */
.estado-vacio { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 16px; margin: 8px 0; text-align: center; color: var(--suave); font-weight: 500;
  background: var(--papel); border: 1px dashed #cfd5e4; border-radius: var(--radio); }
.estado-vacio::before { content: ""; width: 48px; height: 48px; border-radius: 50%; background: var(--acento-suave) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232F5CC2' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2v2'/%3E%3Cpath d='M14 2v2'/%3E%3Cpath d='M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1'/%3E%3Cpath d='M6 2v4'/%3E%3C/svg%3E") center / 24px no-repeat; }

/* Chat */
.chat { border-radius: var(--radio); border: 1px solid var(--linea); box-shadow: var(--sombra-suave); }
.burbuja { padding: 11px 16px; border-radius: 18px; font-weight: 400; }
.burbuja-isona { background: var(--acento-suave); color: var(--tinta); border-bottom-left-radius: 6px; }
.burbuja-yo { background: var(--acento); color: #fff; border-bottom-right-radius: 6px; }
.chip-sugerencia { border-radius: 999px; font-weight: 700; color: var(--acento-texto); border-color: var(--linea); background: var(--papel); transition: border-color var(--dur), background-color var(--dur); }
.chip-sugerencia:hover { border-color: var(--acento); background: var(--acento-suave); }
.chat-escribir { border-top: 1px solid var(--linea); }
.junior-accion { border-radius: 16px; }

/* Clientes: filas livianas con iniciales */
.fila-lista { gap: 14px; border: 1px solid var(--linea); border-radius: 16px; box-shadow: none; padding: 12px 16px; font-weight: 500; transition: border-color var(--dur), box-shadow var(--dur); }
.fila-lista:hover { border-color: var(--acento); box-shadow: var(--sombra-suave); }
.fila-lista.is-vencido { box-shadow: none; border-color: #e6c2bd; }
.fila-nombre { font-weight: 700; }
.iniciales { flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--acento-suave); color: var(--acento-texto); font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.fila-dato { color: var(--suave); font-weight: 500; }
.fila-saldo { color: var(--tinta); font-weight: 700; }
.fila-saldo.is-vencido { color: var(--alerta); font-weight: 800; }
.buscador { border-radius: 12px; }

/* Cobros: "Te deben" grande, chips y estado en pastilla */
.cobros-resumen { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cobros-cabeza { margin: 4px 0 20px; }
.cobros-cabeza .etiqueta { margin: 0; font-size: 13px; font-weight: 500; color: var(--suave); }
.cobro-total { margin: 2px 0 10px; font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; overflow-wrap: anywhere; }

/* Agenda: una columna por día en escritorio; lista del día en celular */
.agenda-cuerpo .semana-nav { grid-column: 1 / -1; }
@media (min-width: 761px) {
  .agenda-cuerpo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: start; }
}
.semana-titulo { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.dia { padding: 14px; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }
.dia:last-of-type { border-bottom: 1px solid var(--linea); }
.dia.is-hoy { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
.dia.is-hoy .dia-titulo { color: var(--acento-texto); }
.dia-titulo { font-size: 14px; font-weight: 800; text-transform: none; }
.dia-feriado { display: block; width: 100%; margin: 4px 0 8px; padding: 5px 10px; border-radius: 8px; background: var(--rojo-tenue); color: var(--alerta); font-weight: 700; font-size: 13px; }
.dia-feriado.is-otra { background: #EEF0F6; color: var(--suave); }
.agenda-cuerpo .dia .vacio { margin: 0; font-size: 13px; color: var(--suave); }
.agenda-cuerpo .dia ul { display: flex; flex-direction: column; gap: 6px; }
.agenda-cuerpo .dia li { padding: 0; }
.agenda-cuerpo .fila-agenda { padding: 8px 10px; min-height: 0; border: 0; border-radius: 12px; font-size: 14px; background: var(--acento-suave); color: var(--tinta); }
.agenda-cuerpo .fila-agenda .hora { font-weight: 800; color: var(--tinta); }
.agenda-cuerpo .fila-agenda .chip-fuente { display: block; width: max-content; margin: 2px 0; background: rgba(255, 255, 255, .7); border: 0; }
.agenda-cuerpo .fila-agenda.tipo-entrevista { background: #E6EDF0; }
.agenda-cuerpo .fila-agenda.tipo-vencimiento { background: var(--ambar-tenue); }
.agenda-cuerpo .fila-agenda:hover { box-shadow: 0 0 0 2px var(--acento); }

/* Capas: fondo atenuado, panel con radio 20 y botón principal abajo a la derecha */
.capa-velo { background: rgba(16, 31, 56, .45); }
.capa-panel { border-radius: 20px 0 0 20px; background: var(--fondo); box-shadow: var(--sombra-capa); }
.capa-cerrar { border: 1px solid var(--linea); box-shadow: none; transition: border-color var(--dur), color var(--dur); }
.capa-cerrar:hover { border-color: var(--acento); color: var(--acento-texto); }
.bloque { border-radius: var(--radio); box-shadow: var(--sombra-suave); }
.formulario .btn-principal { align-self: flex-end; }
.acciones { justify-content: flex-end; }
.pregunta { background: var(--acento-suave); border-radius: 14px; }
.panel { border-radius: 24px; box-shadow: var(--sombra-suave); padding: 20px 24px; }
.medidor span { background: var(--acento); }
.pericia-fila { border: 1px solid var(--linea); border-radius: 16px; box-shadow: none; }
.pericia-fila:hover { border-color: var(--acento); }
.toast { background: var(--riel); color: #fff; border-radius: 14px; font-weight: 500; }

/* Vacío y animaciones: todo quieto con prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── celular: barra de abajo blanca con el activo en azul ───────────────── */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .barra { grid-column: 1; padding: 12px 16px 4px; }
  .barra .marca { display: block; }
  .rail { grid-row: auto; grid-column: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--papel); border-top: 1px solid var(--linea); gap: 0; }
  .rail::before { display: none; }
  .rail-item { flex: 1; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 2px; font-size: 12px; font-weight: 700; color: var(--suave); border-radius: 12px; text-align: center; }
  .rail-item:hover { background: var(--acento-suave); color: var(--acento-texto); }
  .rail-item[aria-current="page"] { background: none; color: var(--acento-texto); }
  .rail-item[aria-current="page"]::before { background: var(--acento); }
  .rail :focus-visible { outline-color: var(--acento); }
  .rail-sec { display: none; }
  .rail-mas { display: flex; }
  .secciones { padding: 0 16px 92px; }
  .seccion[data-sec] { max-width: none; }
  .columna-titulo { margin: 28px 0 12px; }
  .saludo { margin-bottom: 14px; }
  .tarjeta-item { padding: 14px 16px 8px; }
  .tarjeta-botones { margin: 4px 0 0; }
  .tarjeta-botones .btn-texto, .tarjeta-botones [data-accion] { min-height: 44px; }
  .btn, .btn-texto, .menu-item, input:not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; }
  .btn-mas, .avatar { width: 44px; height: 44px; }
  .chip-sugerencia { min-height: 44px; }
  .fila-lista { min-height: 56px; }
  .cobro-total { font-size: 32px; }
  .capa-panel { border-radius: 20px 20px 0 0; }
  .agenda-cuerpo .fila-agenda { min-height: 48px; padding: 10px 12px; }
  /* El título va en su línea (una sola, con puntos suspensivos); la fecha en pastilla debajo. */
  .tarjeta-item .aviso-fila { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tarjeta-item .aviso-caratula { max-width: 100%; }
  #cobros-lista .fila-nombre, #cobros-cerrados-lista .fila-nombre { flex: 1 1 100%; }
  #cobros-lista .fila-dato, #cobros-cerrados-lista .fila-dato { flex: 1; }
}

/* ── C25 · Arranque por profesión: asistente de primera vez y "Qué hacés" ── */
.asistente { position: fixed; inset: 0; z-index: 300; overflow-y: auto; background: var(--fondo); display: flex; justify-content: center; padding: clamp(24px, 6vw, 72px) 16px; }
.asistente[hidden] { display: none; }
.asistente-panel { width: 100%; max-width: 680px; }
.asistente-panel .saludo { margin-bottom: 8px; }
.asistente-acciones { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 24px; }
.opciones-grandes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 20px 0 4px; }
.opcion-grande { position: relative; min-height: 88px; padding: 16px 44px 16px 18px; text-align: left; font: inherit; font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2;
  color: var(--tinta); background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); cursor: pointer; box-shadow: var(--sombra-suave);
  transition: border-color var(--dur), background-color var(--dur), box-shadow var(--dur); }
.opcion-grande:hover { border-color: var(--acento); }
.opcion-grande::after { content: ""; position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border: 1px solid var(--linea); border-radius: 50%; background: var(--papel); }
.opcion-grande[aria-pressed="true"] { border-color: var(--acento); background: var(--acento-suave); color: var(--acento-texto); box-shadow: 0 0 0 3px var(--acento-suave); }
.opcion-grande[aria-pressed="true"]::after { border-color: var(--acento); background: var(--acento)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat; }
[data-bloque="que-haces"] .opciones-grandes { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 10px 0 14px; }
[data-bloque="que-haces"] .opcion-grande { min-height: 60px; font-size: 15px; }
@media (max-width: 760px) { .opcion-grande { min-height: 64px; } .asistente-acciones .btn, .asistente-acciones .btn-texto { min-height: 44px; } }
.asistente .bloque .btn-principal { background: var(--papel); border-color: var(--linea); color: var(--tinta); }
.asistente .bloque .btn-principal:hover:not(:disabled) { background: var(--papel); border-color: var(--acento); color: var(--acento-texto); }

/* C26: escritos con un toque — puntos de la parte (solo en este dispositivo) y turno de entrevista de la pericia. */
.puntos { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.punto { display: flex; flex-direction: column; gap: 4px; }
.punto textarea { min-height: 56px; }
.puntos .vacio { margin: 0; }
[data-bloque="entrevista"] .chip { margin-left: 6px; }
label.btn input[type="file"] { display: none; }
.acciones label.btn { cursor: pointer; display: inline-flex; align-items: center; }
