/* La estética de Captación (apps/web/src/index.css): fondo claro, azul corporativo para lo que se pulsa,
   Jost en titulares, IBM Plex en texto y etiquetas en mono mayúsculas. */
:root {
  --brand: #004357; --brand-deep: #00303f; --brand-lift: #005570; --accent: #74afcb; --accent-soft: #eaf2f6;
  --canvas: #f4f7f9; --surface: #fff; --edge: #dce6ec; --ink: #0f2a35; --muted: #5d7884;
  --ok: #047857; --ok-f: #ecfdf5; --ok-b: #6ee7b7; --aviso: #b45309; --aviso-f: #fffbeb; --aviso-b: #fcd34d; --mal: #b91c1c; --mal-f: #fef2f2; --mal-b: #fca5a5;
  --display: "Jost", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --t-etiqueta: .71875rem; --t-pequeno: .84375rem; --t-normal: .90625rem; --t-destacado: 1rem; --t-sub: 1.125rem;
  --t-titulo: clamp(1.25rem, 1.05rem + .6vw, 1.5rem); --t-portada: clamp(1.625rem, 1.2rem + 1.4vw, 2.25rem);
  --sombra: 0 2px 16px rgba(15, 42, 53, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; color: var(--ink); font: var(--t-normal)/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  background: radial-gradient(60ch 40ch at 0% 0%, #fff, transparent 70%), var(--canvas); background-attachment: fixed;
}
a { color: var(--brand); }
a:hover { color: var(--brand-lift); }
.etiqueta { font-family: var(--mono); font-size: var(--t-etiqueta); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.suave, .ayuda { color: var(--muted); }

/* ── esqueleto: menú a la izquierda y el contenido en una tarjeta grande ── */
.app { display: flex; align-items: flex-start; gap: 24px; padding: 24px; }
.lateral { position: sticky; top: 24px; width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 22px; max-height: calc(100vh - 48px); }
.lateral .marca { display: flex; align-items: center; height: 40px; padding: 0 12px; }
.lateral .marca img { height: 36px; width: auto; }
.lateral .grupo { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.lateral .grupo > .etiqueta { padding: 0 12px; display: flex; justify-content: space-between; align-items: center; }
.principal-col { flex: 1; min-width: 0; }
.arriba { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-bottom: 16px; }
.usuario { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--edge); background: var(--surface); border-radius: 999px; padding: 5px 6px 5px 14px; font-size: var(--t-pequeno); color: var(--muted); box-shadow: 0 1px 2px rgba(15,42,53,.05); }
.usuario .inicial { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-family: var(--display); font-weight: 600; font-size: 13px; text-transform: uppercase; }
.lienzo { background: var(--surface); border: 1px solid var(--edge); border-radius: 26px; padding: 32px; box-shadow: var(--sombra); min-height: 60vh; }
@media (max-width: 1023px) {
  .app { display: block; padding: 12px 16px; }
  .lateral { position: static; width: auto; max-height: none; margin-bottom: 16px; }
  .lienzo { border-radius: 22px; padding: 18px 16px; }
  .arriba { margin-bottom: 12px; }
}

/* ── lista de casos ── */
.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; overflow-y: auto; min-height: 0; }
.lista li { border: 1px solid transparent; border-radius: 16px; padding: 10px 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.lista li:hover { background: var(--surface); border-color: var(--edge); }
.lista li.sel { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(116,175,203,.25); }
.lista li.vacia { cursor: default; color: var(--muted); }
.lista li.vacia:hover { background: none; border-color: transparent; }
.lista .l1 { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .l2 { font-size: var(--t-pequeno); color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.filtro { font-size: var(--t-pequeno); color: var(--muted); padding: 0 12px; display: flex; gap: 8px; align-items: center; }

/* ── títulos, paneles y datos ── */
.titular { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: 1.08; color: var(--brand-deep); margin: 0; }
h2.titular { font-size: var(--t-portada); }
.tarjeta { border: 1px solid var(--edge); border-radius: 16px; padding: 20px; margin-top: 16px; min-width: 0; }
.tarjeta.limpia { border: 0; padding: 0; margin-top: 0; }
.tarjeta h3 { font-family: var(--display); font-weight: 600; font-size: var(--t-sub); letter-spacing: -.01em; color: var(--brand); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.ayuda { margin: 8px 0 24px; font-size: var(--t-destacado); max-width: 70ch; }
.cabeza { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.datos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0 0; }
.datos dt { font-family: var(--mono); font-size: var(--t-etiqueta); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.datos dd { margin: 0; overflow-wrap: anywhere; }
ul.puntos { margin: 6px 0 0; padding-left: 20px; }
ul.puntos li { margin-bottom: 4px; }

/* ── campos ── */
form .campo, label.campo { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; }
label.campo > .etiqueta .suave { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: var(--t-pequeno); }
input:not([type=checkbox]):not([type=file]), textarea, select {
  width: 100%; border: 1px solid var(--edge); background: var(--surface); border-radius: 10px; padding: 10px 14px;
  font: var(--t-destacado)/1.4 var(--sans); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: rgba(93,120,132,.6); }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(116,175,203,.3); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: var(--t-destacado); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.soltar { position: relative; border: 1.5px dashed var(--edge); border-radius: 16px; padding: 26px; text-align: center; color: var(--muted); background: var(--canvas); transition: .15s; }
.soltar.encima { border-color: var(--brand); background: var(--accent-soft); color: var(--brand); }
.soltar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ficheros { margin: 8px 0 0; padding-left: 18px; }

/* ── botones (pastilla, como Captación) ── */
.acciones { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 9px 20px; font: var(--t-normal)/1.4 var(--sans); cursor: pointer; transition: .15s;
  border: 1px solid var(--edge); background: var(--surface); color: var(--muted); }
.boton:hover { border-color: var(--brand); color: var(--brand); }
.boton.principal { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.boton.principal:hover { background: var(--brand-lift); border-color: var(--brand-lift); color: #fff; }
.boton.peligro:hover { border-color: var(--mal); color: var(--mal); }
.boton.fila { padding: 5px 12px; font-size: var(--t-pequeno); }
.boton:disabled { opacity: .4; cursor: default; }
.boton:disabled:hover { border-color: var(--edge); color: var(--muted); }
.boton.principal:disabled:hover { background: var(--brand); color: #fff; }
.ancho { width: 100%; }
.boton svg { width: 16px; height: 16px; flex-shrink: 0; }
.mensaje { color: var(--mal); font-size: var(--t-normal); }
.enlace { background: none; border: 0; padding: 0; color: var(--muted); font: var(--t-normal) var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.enlace:hover { color: var(--brand); }

/* ── pastillas de estado ── */
.chip { display: inline-flex; white-space: nowrap; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--brand); border-radius: 999px; padding: 1px 10px; font-family: var(--mono); font-size: var(--t-etiqueta); letter-spacing: .14em; text-transform: uppercase; }
.chip.revisar { border-color: var(--aviso-b); background: var(--aviso-f); color: var(--aviso); }
.chip.publicado { border-color: var(--ok-b); background: var(--ok-f); color: var(--ok); }
.chip.error, .chip.necesita_marcos { border-color: var(--mal-b); background: var(--mal-f); color: var(--mal); }
.chip.descartado { border-color: var(--edge); background: var(--canvas); color: var(--muted); }

/* ── avisos ── */
.caja { border: 1px solid; border-radius: 14px; padding: 12px 16px; margin: 14px 0 0; }
.caja.aviso { border-color: var(--aviso-b); background: var(--aviso-f); color: #92400e; }
.caja.mal { border-color: var(--mal-b); background: var(--mal-f); color: #991b1b; }
.caja.ok { border-color: var(--ok-b); background: var(--ok-f); color: #065f46; }
.caja.info { border-color: var(--edge); background: var(--canvas); color: var(--ink); }
.caja summary { cursor: pointer; }
pre.aviso-odoo { white-space: pre-wrap; font: var(--t-pequeno)/1.5 var(--mono); margin: 8px 0 0; color: var(--ink); }

/* ── trabajo en curso, PDF, nota y chat ── */
.progreso { list-style: none; margin: 0; padding: 0; font-size: var(--t-pequeno); max-height: 340px; overflow: auto; display: flex; flex-direction: column-reverse; }
.progreso li { padding: 4px 0; border-bottom: 1px solid var(--canvas); }
.progreso li.herr { color: var(--muted); font-family: var(--mono); font-size: var(--t-etiqueta); }
.punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: lat 1.2s infinite; }
@keyframes lat { 50% { opacity: .25; } }
.pdf { width: 100%; height: 75vh; border: 1px solid var(--edge); border-radius: 12px; background: var(--canvas); }
.nota { background: var(--canvas); border: 1px solid var(--edge); border-radius: 12px; padding: 12px 16px; white-space: pre-wrap; margin-top: 14px; font-family: var(--mono); font-size: var(--t-pequeno); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dos .campo { margin: 0; }
@media (max-width: 640px) { .dos { grid-template-columns: 1fr; } .datos { grid-template-columns: 1fr; gap: 2px; } .datos dd { margin-bottom: 8px; } }
.chat { display: grid; gap: 10px; margin-bottom: 14px; }
.chat .m { padding: 10px 14px; border-radius: 14px; background: var(--canvas); white-space: pre-wrap; max-width: 75ch; }
.chat .m.persona { background: var(--accent-soft); justify-self: end; }
.chat .m.sistema { background: none; color: var(--muted); font-size: var(--t-pequeno); padding: 0 4px; }
.chat .m .quien { display: block; font-family: var(--mono); font-size: var(--t-etiqueta); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.vacio { color: var(--muted); padding: 80px 20px; text-align: center; }
.vacio .titular { font-size: var(--t-titulo); margin-bottom: 8px; }

/* ── entrada ── */
.centro { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.acceso { width: 100%; max-width: 400px; }
.acceso > img { height: 40px; width: auto; margin-bottom: 32px; }
.acceso .lienzo { border-radius: 22px; padding: 32px; min-height: 0; }
.acceso .codigo { text-align: center; font-family: var(--mono); font-size: var(--t-titulo); letter-spacing: .3em; }
.acceso .pie { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--edge); display: flex; gap: 18px; flex-wrap: wrap; }
.acceso .nota-pie { margin-top: 20px; text-align: center; font-size: var(--t-pequeno); color: var(--muted); }
@media (max-width: 480px) { .acceso .lienzo { padding: 24px; } }

[hidden] { display: none !important; }
.lista .l2 > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
