/* Leads · estilos. Colores como variables; el modo oscuro solo cambia los valores. */
@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fuentes/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-display: swap;
}

:root {
  --bg: #f3f0ea; --surface: #fffdf9; --subtle: #f7f4ee; --line: #e5dfd4; --line-2: #d3cbbd;
  --fg: #1c1915; --muted: #7b7366; --tenue: #a69d8f;
  --lado: #16130f; --lado-fg: #ece6db; --lado-muted: #8d8475; --lado-on: #2a2620;
  --pri: #1c1915; --pri-fg: #fffdf9; --foco: #e2632b;
  --t1: #5b8def; --t2: #3fb5a6; --t3: #e8b33a; --t4: #f08a2e; --t5: #e5412d;
  --llamada: #2b2620; --visita: #0e9a78; --otro: #9a917f; --proy: #c88a04;
  --si: #0e8a5f; --si-bg: #e3f4ec; --no: #b4472f; --no-bg: #fbe9e3; --avi: #9a6a00; --avi-bg: #fbf1d6;
  --sombra: 0 1px 2px rgb(40 30 10 / .06), 0 8px 28px rgb(40 30 10 / .08);
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110; --surface: #1b1917; --subtle: #211f1c; --line: #2d2a26; --line-2: #3d3934;
    --fg: #f1ece3; --muted: #a0978a; --tenue: #6f685d;
    --lado: #0b0a09; --lado-fg: #ece6db; --lado-muted: #7d7568; --lado-on: #24211d;
    --pri: #f1ece3; --pri-fg: #16130f; --foco: #f08a4c;
    --llamada: #e9e3d8; --visita: #35c9a3; --otro: #81796c; --proy: #e5ab2b;
    --si: #4fd3a1; --si-bg: #12352a; --no: #f08a70; --no-bg: #3b1d16; --avi: #e8c25a; --avi-bg: #3a2e10;
    --sombra: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px rgb(0 0 0 / .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 "Instrument Sans", system-ui, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
body.con-modal, body.con-ficha { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
::selection { background: color-mix(in oklab, var(--foco) 28%, transparent); }

.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gira { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.aire { flex: 1; }
.cargando { width: 26px; height: 26px; margin: 40vh auto; border: 3px solid var(--line); border-top-color: var(--fg); border-radius: 50%; animation: gira .8s linear infinite; }

/* ---------------------------------------------------------------- campos y botones */
input, select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; min-height: 36px;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; line-height: 1.45; display: block; }
input::placeholder, textarea::placeholder { color: var(--tenue); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px color-mix(in oklab, var(--fg) 10%, transparent); }
input[type=range] { padding: 0; min-height: 0; width: 140px; border: 0; background: none; box-shadow: none; accent-color: var(--fg); vertical-align: middle; }
input.num { width: 68px; text-align: center; }
select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 550; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { border-color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn.pri { background: var(--pri); color: var(--pri-fg); border-color: var(--pri); }
.btn.pri:hover { opacity: .88; }
.btn.peligro { color: var(--no); }
.btn.peligro:hover { border-color: var(--no); }
.btn.mini { min-height: 26px; padding: 0 8px; font-size: 12.5px; }
.btn.ancho { width: 100%; min-height: 40px; }
.btn.centro { display: flex; margin: 0 auto 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.grabando { background: var(--t5); border-color: var(--t5); color: #fff; animation: late 1.2s ease-in-out infinite; }
@keyframes late { 50% { opacity: .7; } }
.ib { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border: 0; border-radius: 8px; background: none; color: var(--muted); text-decoration: none; transition: background .12s, color .12s; }
.ib:hover { background: color-mix(in oklab, var(--fg) 9%, transparent); color: var(--fg); }
.ib.mini { width: 26px; height: 26px; }
.ib.mini .ico { width: 14px; height: 14px; }
.enlace { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 4px 0; color: var(--muted); font-weight: 550; font-size: 13px; text-decoration: none; cursor: pointer; }
.enlace:hover { color: var(--fg); }
.enlace.centro { display: flex; margin: 14px auto 0; }
.nota { color: var(--muted); font-size: 12.5px; }

.campo { display: grid; gap: 5px; margin-bottom: 12px; min-width: 0; }
.campo > label, .campo > span:first-child { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.campo small { color: var(--muted); font-size: 12px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ops { display: flex; flex-wrap: wrap; gap: 6px; }
.op { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 550; font-size: 13px; }
.op:hover { border-color: var(--fg); }
.op.on { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.op.r-si.on { background: var(--si); border-color: var(--si); color: #fff; }
.op.r-no.on { background: var(--no); border-color: var(--no); color: #fff; }
.op.menos { border-style: dashed; color: var(--muted); font-weight: 500; min-height: 28px; padding: 0 9px; font-size: 12.5px; }
.op .ico { width: 14px; height: 14px; }
.mas { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 6px 0; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.mas:hover { color: var(--fg); }
.mas .ico { transition: transform .15s; transform: rotate(-90deg); }
.mas.abierto .ico { transform: none; }
.mas-bloque { padding-top: 8px; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--subtle); border: 1px solid var(--line); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip .ico { width: 13px; height: 13px; }
.chip button { display: grid; place-items: center; border: 0; background: none; padding: 0; margin-right: -4px; color: var(--muted); }
.chip.r-si, .chip.pe-aceptado, .chip.e-cliente { background: var(--si-bg); border-color: transparent; color: var(--si); }
.chip.r-no, .chip.pe-rechazado, .chip.tarde { background: var(--no-bg); border-color: transparent; color: var(--no); }
.chip.r-aviso, .chip.pe-enviado { background: var(--avi-bg); border-color: transparent; color: var(--avi); }

/* ---------------------------------------------------------------- armazón */
.app { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100dvh; }
.lado { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--lado); color: var(--lado-fg); padding: 14px 10px 10px; }
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.marca img { border-radius: 7px; box-shadow: 0 0 0 1px rgb(255 255 255 / .12); }
#menu { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
#menu .grupo { padding: 14px 10px 5px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--lado-muted); }
#menu a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--lado-muted); text-decoration: none; font-weight: 550; }
#menu a span { flex: 1; }
#menu a b { font-weight: 600; font-size: 12px; color: var(--lado-muted); }
#menu a:hover { color: var(--lado-fg); }
#menu a.on { background: var(--lado-on); color: var(--lado-fg); }
#menu a.on b { color: var(--lado-fg); }
.yo { display: flex; align-items: center; gap: 9px; padding: 10px 4px 0 8px; border-top: 1px solid rgb(255 255 255 / .08); }
.yo .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.yo .ib { color: var(--lado-muted); }
.yo .ib:hover { color: var(--lado-fg); background: var(--lado-on); }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--foco); color: #fff; font-weight: 700; font-size: 13px; }

#vista { padding: 22px 28px 40px; min-width: 0; }
.cab { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cab h1 { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-right: auto; }
.cab h1 .ico { width: 20px; height: 20px; }
.cab .num { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; }
.herr { display: flex; align-items: center; gap: 8px; }
.herr select { width: auto; }
.buscar { position: relative; display: block; width: 210px; }
.buscar .ico { position: absolute; left: 10px; top: 10px; color: var(--muted); }
.buscar input { padding-left: 32px; }

/* ---------------------------------------------------------------- filas con línea de tiempo */
.filas { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.fila { display: grid; grid-template-columns: 34px minmax(140px, 230px) minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 54px; padding: 4px 8px 4px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s; }
.fila:last-child { border-bottom: 0; }
.fila:hover, .fila:focus-visible { background: var(--subtle); }
.quien { min-width: 0; }
.nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc { display: flex; gap: 1px; opacity: .55; transition: opacity .12s; }
.fila:hover .acc, .fila:focus-within .acc { opacity: 1; }
.prox { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.prox.tarde { color: var(--no); }
.prox .ico { width: 14px; height: 14px; }

.calor { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; position: relative; flex: none; }
.calor > i, .calor > button { display: block; width: 4px; border-radius: 2px; background: var(--line-2); border: 0; padding: 0; }
.calor > :nth-child(1) { height: 6px; } .calor > :nth-child(2) { height: 9px; } .calor > :nth-child(3) { height: 12px; }
.calor > :nth-child(4) { height: 15px; } .calor > :nth-child(5) { height: 18px; }
.calor.t1 { --tc: var(--t1); } .calor.t2 { --tc: var(--t2); } .calor.t3 { --tc: var(--t3); } .calor.t4 { --tc: var(--t4); } .calor.t5 { --tc: var(--t5); }
.calor > .on { background: var(--tc); }
.calor .baja { position: absolute; right: -13px; top: -4px; width: 12px; height: 12px; color: var(--t1); }
.calor.g { height: 26px; gap: 3px; }
.calor.g > i, .calor.g > button { width: 8px; border-radius: 3px; }
.calor.g > :nth-child(1) { height: 10px; } .calor.g > :nth-child(2) { height: 14px; } .calor.g > :nth-child(3) { height: 18px; }
.calor.g > :nth-child(4) { height: 22px; } .calor.g > :nth-child(5) { height: 26px; }
.calor.g .baja { right: -17px; width: 14px; height: 14px; }
.calor.ed > button { cursor: pointer; transition: transform .1s; transform-origin: bottom; }
.calor.ed > button:hover { transform: scaleY(1.15); background: color-mix(in oklab, var(--tc) 55%, var(--line-2)); }
.calor.ed > button.on:hover { background: var(--tc); }
.t-nombre { font-weight: 600; font-size: 13px; }

.tl { overflow-x: auto; overflow-y: hidden; min-width: 0; scrollbar-width: none; }
.tl::-webkit-scrollbar { display: none; }
.tl-in { position: relative; height: 40px; }
.tr { position: absolute; top: 50%; margin-top: -1px; border-top: 2px solid var(--line-2); }
.tr.hueco { border-top-style: dashed; border-top-color: var(--line-2); opacity: .85; }
.tr.fut { opacity: .5; }
.tr em { position: absolute; left: 50%; top: -17px; transform: translateX(-50%); font-style: normal; font-size: 10px; font-weight: 600; color: var(--tenue); white-space: nowrap; }
.pt { position: absolute; top: 50%; transform: translate(-50%, -50%); padding: 0; border: 0; background: none; display: block; }
.pt.alta { width: 2px; height: 9px; border-radius: 1px; background: var(--line-2); }
.pt.hoy { width: 2px; height: 16px; border-radius: 1px; background: var(--fg); }
.pt.pseg { width: 11px; height: 11px; border-radius: 50%; --c: var(--otro); background: var(--c); border: 2px solid var(--c); cursor: pointer; transition: box-shadow .1s; }
.pt.pseg.llamada { --c: var(--llamada); }
.pt.pseg.visita { --c: var(--visita); border-radius: 3px; }
.pt.pseg.no { background: var(--surface); }
.pt.pseg.prog { background: var(--surface); border-style: dashed; border-width: 1.5px; }
.pt.pseg.prog.tarde { --c: var(--t5); }
.pt.pproy { width: 10px; height: 10px; border-radius: 2px; background: var(--proy); transform: translate(-50%, -50%) rotate(45deg); cursor: pointer; }
.pt.pproy.aceptado { background: var(--si); }
.pt.pproy.rechazado { background: var(--surface); box-shadow: inset 0 0 0 2px var(--no); }
button.pt::after { content: ""; position: absolute; inset: -7px; }
button.pt:hover { box-shadow: 0 0 0 4px color-mix(in oklab, var(--fg) 14%, transparent); }
.tl.g .tl-in { height: 62px; }
.tl.g { margin: 0 -4px 14px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.tl.g .pt.pseg { width: 14px; height: 14px; }
.tl.g .pt.pproy { width: 13px; height: 13px; }
.tl.g .pt.hoy { height: 22px; }
.tl.g .tr em { top: -19px; font-size: 11px; }

.leyenda { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 4px 0; color: var(--muted); font-size: 12px; }
.leyenda span { display: inline-flex; align-items: center; gap: 7px; }
.leyenda .pt { position: static; transform: none; cursor: default; }
.leyenda .pt.pproy { transform: rotate(45deg); }
.leyenda .tr { position: static; width: 22px; margin: 0; }

.vacio { display: grid; justify-items: center; gap: 10px; padding: 56px 20px; color: var(--muted); text-align: center; }
.vacio > .ico { width: 30px; height: 30px; stroke-width: 1.5; color: var(--tenue); }
.vacio.peq { padding: 26px 10px 18px; }

/* ---------------------------------------------------------------- ficha lateral */
.velo { position: fixed; inset: 0; background: rgb(20 16 10 / .38); z-index: 20; animation: aparece .15s; }
@keyframes aparece { from { opacity: 0; } }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); z-index: 21; display: flex; flex-direction: column; background: var(--bg); box-shadow: var(--sombra); animation: entra .18s ease-out; }
@keyframes entra { from { transform: translateX(24px); opacity: 0; } }
.p-cab { padding: 16px 18px 12px; background: var(--surface); }
.p-top { display: flex; align-items: flex-start; gap: 10px; }
.p-tit { flex: 1; min-width: 0; }
.p-tit h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.p-meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; min-height: 32px; }
.p-meta .calor { margin-right: 6px; }
.p-acc { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border: 0; background: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--fg); }
.tabs button.on { color: var(--fg); border-bottom-color: var(--fg); }
.tabs b { font-size: 11px; background: var(--subtle); border-radius: 99px; padding: 0 6px; }
.p-cuerpo { flex: 1; overflow-y: auto; padding: 14px 18px 28px; overscroll-behavior: contain; }

.seg, .proy, .tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.seg { padding: 10px 12px; margin-bottom: 10px; scroll-margin: 20px; }
.seg-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--subtle); color: var(--otro); }
.seg-ico.llamada { color: var(--llamada); }
.seg-ico.visita { color: var(--visita); }
.seg-ico .ico { width: 14px; height: 14px; }
.cuando { color: var(--muted); font-size: 12.5px; }
.notas { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.hablado { display: grid; gap: 5px; margin: 10px 0 0; padding: 9px 10px; background: var(--subtle); border-radius: 8px; }
.hablado div { display: grid; grid-template-columns: 16px 118px 1fr; gap: 8px; align-items: start; }
.hablado .ico { width: 14px; height: 14px; margin-top: 3px; color: var(--muted); }
.hablado dt { color: var(--muted); font-size: 12.5px; }
.hablado dd { margin: 0; font-weight: 550; white-space: pre-wrap; overflow-wrap: anywhere; }
.seg > .enlace { margin-top: 6px; }
.audio { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.audio-top { display: flex; align-items: center; gap: 4px; }
.audio audio { flex: 1; min-width: 0; height: 34px; }
.trans { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
.trans.espera, .trans.mal { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); border-left-color: transparent; padding-left: 0; }
.trans.mal { color: var(--no); }

.rasgos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rasgos input { width: 150px; flex: 1; min-width: 130px; }
.sugeridos { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }

.proy { margin-bottom: 10px; scroll-margin: 20px; overflow: hidden; }
.proy > header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; }
.proy > header:hover { background: var(--subtle); }
.proy .tit { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.proy .total { font-weight: 700; }
.proy-cuerpo { padding: 12px; border-top: 1px solid var(--line); }
.partidas { display: grid; gap: 6px; }
.partida { display: grid; grid-template-columns: 1fr 58px 96px 26px; gap: 6px; align-items: center; }
.partida .cant, .partida .precio { text-align: right; }
.totales { display: grid; gap: 3px; margin: 8px 0 0 auto; width: min(240px, 100%); font-size: 13px; }
.totales div { display: flex; justify-content: space-between; color: var(--muted); }
.totales .total { color: var(--fg); font-weight: 700; font-size: 15px; padding-top: 5px; border-top: 1px solid var(--line); }
.proy-pie { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- modal */
#modal .velo { z-index: 40; }
.modal { position: fixed; z-index: 41; left: 50%; top: 7vh; transform: translateX(-50%); width: min(540px, calc(100vw - 20px)); max-height: 88vh; overflow-y: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--sombra); padding: 16px 18px; animation: sube .16s ease-out; }
.modal.peq { width: min(420px, calc(100vw - 20px)); }
@keyframes sube { from { transform: translate(-50%, 10px); opacity: 0; } }
.modal form { display: grid; gap: 10px; }
.modal .campo { margin-bottom: 0; }
.modal .mas-bloque { display: grid; gap: 10px; }
.m-cab { display: flex; align-items: center; gap: 8px; }
.m-cab h3 { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; min-width: 0; overflow-wrap: anywhere; }
.m-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.tipos { display: flex; gap: 6px; flex-wrap: wrap; }
.tipo { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; white-space: nowrap; }
.tipo.on { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.tipo.menos { flex: none; border-style: dashed; color: var(--muted); }
.adjuntos { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adjuntos label { cursor: pointer; }
.archivos { display: flex; gap: 5px; flex-wrap: wrap; }
.linea-temp { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.linea-temp .t-nombre { color: var(--fg); }
.alerta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: var(--r); background: var(--avi-bg); color: var(--fg); margin-bottom: 12px; }
.alerta > .ico { width: 20px; height: 20px; color: var(--avi); }
.alerta > div:nth-child(2) { flex: 1; min-width: 180px; }
.alerta .sub { white-space: normal; }
.alerta.suave { background: var(--subtle); border: 1px solid var(--line); }
.alerta.suave > .ico { color: var(--muted); }
.alerta-acc { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.enlace-largo { display: block; margin-top: 6px; font-size: 12px; overflow-wrap: anywhere; user-select: all; }

#avisos { position: fixed; z-index: 60; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.aviso { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 99px; background: var(--fg); color: var(--surface); font-weight: 600; box-shadow: var(--sombra); animation: sube2 .18s ease-out; transition: opacity .3s; max-width: 92vw; }
.aviso.mal { background: var(--no); color: #fff; }
.aviso.fuera { opacity: 0; }
@keyframes sube2 { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- acceso */
.acceso { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, color-mix(in oklab, var(--foco) 12%, transparent), transparent), var(--bg); }
.a-caja { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sombra); padding: 26px 24px 22px; }
.a-marca { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 20px; font-weight: 700; }
.a-marca img { border-radius: 10px; }
.a-caja h1 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 4px; }
.a-sub { color: var(--muted); margin-bottom: 14px; }
.a-caja form { margin-top: 14px; }
.a-error { color: var(--no); background: var(--no-bg); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; font-weight: 550; }
.con-ojo { position: relative; display: block; }
.con-ojo input { padding-right: 40px; }
.con-ojo .ib { position: absolute; right: 2px; top: 2px; }
.codigo { font-size: 24px; letter-spacing: .35em; text-align: center; font-weight: 700; }

/* ---------------------------------------------------------------- subir leads y ajustes */
.dos-col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }
.tarjeta { padding: 16px; }
.tarjeta form { display: grid; gap: 10px; margin-top: 12px; justify-items: start; }
.t-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.t-cab h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.soltar { display: grid; justify-items: center; gap: 4px; padding: 30px 16px; border: 2px dashed var(--line-2); border-radius: var(--r); color: var(--muted); cursor: pointer; text-align: center; transition: border-color .12s, background .12s; }
.soltar:hover, .soltar.encima { border-color: var(--fg); background: var(--subtle); }
.soltar .ico { width: 26px; height: 26px; stroke-width: 1.5; }
.soltar b { color: var(--fg); }
.prompt { margin: 0; max-height: 330px; overflow: auto; padding: 12px; background: var(--subtle); border-radius: 8px; font: 12px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
#revision { margin-top: 18px; scroll-margin: 16px; }
.rev-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fila-rev { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 50px; padding: 6px 14px; border-bottom: 1px solid var(--line); }
.fila-rev:last-child { border-bottom: 0; }
.fila-rev > .ico { width: 18px; height: 18px; margin: 0 8px; }
.fila-rev .quien { flex: 1 1 220px; }
.fila-rev.dup { background: color-mix(in oklab, var(--avi-bg) 55%, var(--surface)); }
.fila-rev.dup > .ico { color: var(--avi); }
.fila-rev.mal > .ico, .fila-rev.mal .porque { color: var(--no); }
.porque { font-size: 12.5px; color: var(--muted); flex: 1 1 240px; }

.ajustes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; max-width: 1060px; }
.ajustes .ancha { grid-column: 1 / -1; }
.frase { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.frase select { width: auto; }
.interruptor { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.interruptor input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.interruptor i { width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); transition: background .15s; position: relative; }
.interruptor i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.interruptor input:checked + i { background: var(--si); }
.interruptor input:checked + i::after { transform: translateX(16px); }
.interruptor input:disabled + i { opacity: .45; }
.interruptor input:focus-visible + i { outline: 2px solid var(--foco); outline-offset: 2px; }
.luz { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.luz.si { color: var(--si); }
.luces { display: grid; gap: 7px; margin-bottom: 12px; }
.equipo { display: grid; }
.socio { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.socio .quien { flex: 1; }
.socio.apagado .quien, .socio.apagado .avatar { opacity: .5; }
.socio .avatar { background: var(--fg); color: var(--surface); }
.invitar { display: grid !important; grid-template-columns: 1fr 1.3fr auto; gap: 8px; margin: 12px 0; justify-items: stretch !important; }
.pila { max-width: 320px; }
#enlace:empty { display: none; }

/* ---------------------------------------------------------------- móvil */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .lado { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: 6px 8px; }
  .marca { padding: 0 6px 0 2px; }
  .marca span, .yo .nom, .yo .avatar, #menu .grupo, #menu .aire { display: none; }
  #menu { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  #menu a { flex: none; padding: 0 9px; gap: 6px; }
  #menu a span { display: none; }
  #menu a.on span { display: inline; }
  .yo { border: 0; padding: 0; }
  #vista { padding: 14px 12px 40px; }
  .cab h1 { font-size: 19px; }
  .herr { width: 100%; }
  .buscar { flex: 1; width: auto; }
  .fila { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "c q a" "t t t"; row-gap: 0; padding: 8px 6px 2px 12px; }
  .fila > .calor { grid-area: c; } .fila > .quien { grid-area: q; } .fila > .acc { grid-area: a; opacity: 1; } .fila > .tl { grid-area: t; }
  .fila > .prox { display: none; }
  .dos-col, .ajustes { grid-template-columns: 1fr; }
  .tres { grid-template-columns: 1fr; }
  .invitar { grid-template-columns: 1fr; }
  .modal { top: 10px; max-height: calc(100dvh - 20px); padding: 14px; }
}
@media (max-width: 480px) {
  .dos { grid-template-columns: 1fr; }
  .hablado div { grid-template-columns: 16px 1fr; }
  .hablado dd { grid-column: 2; }
  .fila .acc .ib { width: 30px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---- etapas, deshacer, ficha del cliente, proyecto por pestañas, reparto */
.etapas { flex-wrap: nowrap; gap: 0; }
.etapas .op { border-radius: 0; margin-left: -1px; min-height: 30px; padding: 0 11px; }
.etapas .op:first-child { border-radius: 99px 0 0 99px; margin-left: 0; }
.etapas .op:last-child { border-radius: 0 99px 99px 0; }
.etapas .op.on { position: relative; }
.aviso button { pointer-events: auto; display: inline-flex; align-items: center; gap: 5px; margin: -3px -6px -3px 6px; padding: 4px 10px; border: 0; border-radius: 99px; background: rgb(255 255 255 / .18); color: inherit; font: inherit; cursor: pointer; }
.aviso button:hover { background: rgb(255 255 255 / .3); }
.aviso button .ico { width: 14px; height: 14px; }

.pagina { max-width: 1180px; margin: -6px auto 0; }
.pagina .p-cab { position: sticky; top: -22px; z-index: 5; border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; }
.pagina .p-top h2 { font-size: 22px; }
.pagina .p-meta { flex-wrap: wrap; }
.pagina > .tabs { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; }
.pagina .p-cuerpo { overflow: visible; padding: 18px 0 0; }
.dato { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); font-weight: 550; font-size: 13px; text-decoration: none; }
.dato:hover { text-decoration: underline; }
.dato .ico { width: 15px; height: 15px; color: var(--muted); }
.cli-ficha { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.tit-sec { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tit-sec:not(:first-child) { margin-top: 22px; }
.tit-sec .ico { width: 15px; height: 15px; }
@media (max-width: 1000px) { .cli-ficha { grid-template-columns: minmax(0, 1fr); } }

.tabs.sub { margin: -12px -12px 14px; padding: 0 6px; background: none; }
.doc-acc { display: flex; gap: 8px; margin-bottom: 12px; }
.doc-marco { display: block; width: 100%; height: min(78vh, 900px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }

.rep-res { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rep-res > div { display: grid; gap: 2px; min-width: 104px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.rep-res span { font-size: 12px; color: var(--muted); }
.rep-res b { font-size: 15px; }
.rep-res .fuerte { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.rep-res .fuerte span { color: inherit; opacity: .7; }
.rep-n { width: 76px; height: 32px; padding: 0 8px; text-align: right; }
.rep-res .rep-n { width: 88px; height: 26px; }
.rep-tabla { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; background: var(--surface); }
.rep-fila { display: grid; grid-template-columns: minmax(130px, 1fr) 76px 76px 84px 110px; gap: 4px 12px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); min-width: 520px; }
.rep-fila.cabeza { border-top: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.rep-fila.cabeza span:nth-child(n+2), .rep-fila .toca { text-align: right; }
.rep-fila.cabeza span:nth-child(4) { text-align: center; }
.rep-fila input[type=radio] { justify-self: center; width: 17px; height: 17px; }
.rep-fila .quien { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.rep-fila .quien input { width: 16px; height: 16px; }
.rep-fila .toca { font-size: 15px; }
.rep-fila.fuera .quien, .rep-fila.fuera .toca { color: var(--muted); font-weight: 500; }
.rep-det { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); padding-left: 24px; }
