/* Layout: barra lateral en laptop, barra inferior en celular; tarjetas en cuadrícula que se apilan. */
:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #e8edf7; --fg: #0f172a; --muted: #556079; --line: #d5dceb;
  --accent: #2563eb; --accent-fg: #ffffff; --accent-soft: #dbe6fe; --earth: #ea580c;
  --c1: #1d4ed8; --c2: #c2852b; --c3: #3c78a8; --c4: #8a5aa3; --c5: #c45a3f; --c6: #3f9a8a;
  --exc: #1d4ed8; --ok: #3b8f4f; --warn: #b9811f; --bad: #c0462f; --info: #3c78a8;
  --font-d: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-b: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 12px; --nav-w: 208px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #131b2e; --surface-2: #1b2540; --fg: #e5eaf5; --muted: #97a3bd; --line: #28344f;
    --accent: #7aa2ff; --accent-fg: #0b1120; --accent-soft: #1e2d55; --earth: #fb923c;
    --c1: #7aa2ff; --c2: #e0a24e; --c3: #6aa8dc; --c4: #b48ad0; --c5: #e57f63; --c6: #5fc4b2;
    --exc: #7aa2ff; --ok: #79c487; --warn: #e0ad4e; --bad: #ec7a62; --info: #6aa8dc; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #131b2e; --surface-2: #1b2540; --fg: #e5eaf5; --muted: #97a3bd; --line: #28344f;
  --accent: #7aa2ff; --accent-fg: #0b1120; --accent-soft: #1e2d55; --earth: #fb923c;
  --c1: #7aa2ff; --c2: #e0a24e; --c3: #6aa8dc; --c4: #b48ad0; --c5: #e57f63; --c6: #5fc4b2;
  --exc: #7aa2ff; --ok: #79c487; --warn: #e0ad4e; --bad: #ec7a62; --info: #6aa8dc; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font-b); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h2, h3, h4 { font-family: var(--font-d); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Estructura */
.app { display: flex; min-height: 100vh; }
.nav { position: fixed; inset: 0 auto 0 0; width: var(--nav-w); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; padding: 16px 10px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-family: var(--font-d); font-weight: 700; font-size: 17px; line-height: 1.1; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { font-family: var(--font-b); font-weight: 500; font-size: 12px; color: var(--muted); }
.nav button { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 500; color: var(--muted); text-align: left; }
.nav button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.nav button:hover { background: var(--surface-2); color: var(--fg); }
.nav button.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
main { flex: 1; min-width: 0; margin-left: var(--nav-w); padding-block: 0 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
#view { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; display: flex; align-items: center; gap: 8px; padding: 10px 0; background: var(--bg); max-width: 1320px; margin: 0 auto; }
.sp { flex: 1; }

@media (max-width: 860px) {
  .nav { inset: auto 0 0 0; width: auto; height: auto; flex-direction: row; overflow-x: auto; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); border-right: 0; border-top: 1px solid var(--line); gap: 0; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .brand { display: none; }
  .nav button { flex: 1 0 auto; min-width: 64px; flex-direction: column; gap: 3px; padding: 6px 6px; font-size: 11px; text-align: center; }
  main { margin-left: 0; padding-block: 0 96px; }
}

/* Encabezados y filtros */
.ptitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.ptitle h2 { font-size: clamp(22px, 3vw, 30px); }
.ptitle span { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters > input[type=search] { flex: 1 1 220px; min-width: 0; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; min-height: 40px; max-width: 100%; }
textarea { width: 100%; resize: vertical; min-height: 60px; }
select { padding-right: 28px; }
.datenav { display: flex; align-items: center; gap: 4px; }
.ib { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; min-width: 40px; height: 40px; cursor: pointer; font-size: 18px; line-height: 1; }
.ib:hover { background: var(--surface-2); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); padding: 8px 16px; border-radius: 9px; min-height: 40px; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn.file { position: relative; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.row-end { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip b { font-weight: 700; color: var(--muted); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip.on b { color: inherit; opacity: .75; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.banner { background: var(--accent-soft); border-radius: var(--r); padding: 12px 16px; }

.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 0; letter-spacing: .01em; background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); }
.pill.exc { background: color-mix(in srgb, var(--exc) 18%, transparent); color: var(--exc); }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.pill.info { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
button.pill { cursor: pointer; padding: 5px 12px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.kpi.score { grid-column: span 2; display: flex; gap: 14px; align-items: center; }
.kpi.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.kpi.accent .kl, .kpi.accent .ks { color: inherit; opacity: .85; }
.kl { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kv { margin: 4px 0 2px; font-family: var(--font-d); font-size: 30px; font-weight: 700; line-height: 1.1; }
.ks { margin: 0; font-size: 13px; color: var(--muted); }
.gauge { width: 130px; flex: none; }
.comp { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 13px; }
.comp li { display: flex; justify-content: space-between; gap: 8px; }
.comp small { color: var(--muted); margin-left: 4px; }
@media (max-width: 520px) { .kpi.score { grid-column: 1 / -1; flex-direction: column; align-items: flex-start; } .kpis { grid-template-columns: 1fr 1fr; } .kv { font-size: 24px; } }

/* Tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 14px; align-items: start; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.card-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; align-items: flex-start; margin-bottom: 12px; }
.card-h h3 { font-size: 17px; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.sub.center { text-align: center; }
.warn-t { color: var(--warn); font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; margin: 0; }
.empty.ok { color: var(--ok); }
.muted { color: var(--muted); }
.mt { margin-top: 18px; margin-bottom: 6px; font-size: 15px; }

/* Gráficos */
.donut { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: center; }
.donut svg { width: 168px; flex: none; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1 1 180px; min-width: 0; display: grid; gap: 6px; font-size: 13px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 40px; gap: 8px; align-items: center; }
.lg-v { font-weight: 700; } .lg-p { color: var(--muted); text-align: right; }
.ch-big { font-family: var(--font-d); font-size: 28px; font-weight: 700; fill: var(--fg); }
.ch-sub { font-size: 11px; fill: var(--muted); }
.ch-in { font-size: 15px; font-weight: 700; fill: #fff; }
.ch-lab { font-size: 13px; font-weight: 600; fill: var(--fg); }
.ch-ax { font-size: 11px; fill: var(--muted); }
.ch-val { font-size: 12px; font-weight: 700; fill: var(--fg); }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-web { fill: none; stroke: var(--line); stroke-width: 1; }
svg.funnel, svg.line, svg.cols { width: 100%; height: auto; display: block; }
svg.radar { width: 100%; max-width: 380px; display: block; margin: 0 auto; }
.hbars { display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 54px; gap: 10px; align-items: center; font-size: 14px; border-radius: 8px; }
.hb.clickable { cursor: pointer; } .hb.clickable:hover { background: var(--surface-2); }
.hb-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hb-l small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hb-f { display: block; height: 100%; border-radius: 6px; }
.hb-v { text-align: right; font-weight: 700; }
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); }
.stack span { display: block; height: 100%; }

/* Logros y alertas */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.badge { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; opacity: .7; }
.badge.got { opacity: 1; border-color: var(--exc); background: color-mix(in srgb, var(--exc) 7%, transparent); }
.bi { font-size: 26px; text-align: center; filter: grayscale(1); } .badge.got .bi { filter: none; }
.badge b { display: block; } .badge small { display: block; color: var(--muted); font-size: 12px; } .badge em { display: block; font-style: normal; font-size: 12px; font-weight: 600; margin-top: 2px; }
.dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--muted); }
.dot.ok { background: color-mix(in srgb, var(--exc) 18%, transparent); color: var(--exc); font-weight: 700; }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alerts li { display: grid; gap: 2px; padding: 8px 12px; border-left: 3px solid var(--bad); background: color-mix(in srgb, var(--bad) 6%, transparent); border-radius: 0 8px 8px 0; font-size: 14px; }
.alerts span { color: var(--muted); font-size: 13px; }
.fbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; margin-top: 12px; }
.fb { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.fb h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-family: var(--font-b); }
.fb p { margin: 6px 0 0; font-size: 14px; }

/* Tablas */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
.t th small { display: block; font-weight: 400; }
.t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t td small { display: block; color: var(--muted); font-size: 12px; }
.t .n { text-align: right; white-space: nowrap; } .t .c { text-align: center; }
.t tr.clickable { cursor: pointer; } .t tr.clickable:hover td { background: var(--surface-2); }
.t tr.sub-t td { font-weight: 700; background: var(--surface-2); }
.t tr.tot td, .t tfoot td { font-weight: 700; border-top: 2px solid var(--fg); }
.t .obs { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t.lg th.c { white-space: normal; min-width: 76px; font-size: 18px; } .t.lg th.c small { font-size: 11px; }
.t .stick { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 140px; }
.t tr.sub-t .stick { background: var(--surface-2); }
.t td input { width: 100%; }
.good { color: var(--ok); font-weight: 700; }
.entry th.grp { text-align: center; border-bottom: 2px solid; }
.entry th.g1 { color: var(--c1); } .entry th.g2 { color: var(--c3); } .entry th.g3 { color: var(--muted); }
.entry td.ro { color: var(--muted); }
.ni { width: 64px; min-width: 56px; text-align: right; padding: 6px 8px; min-height: 36px; }
.ni::placeholder { color: var(--line); }

/* Registro por asesor */
.stps { display: grid; gap: 8px; }
.stp { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.stp label { font-weight: 500; }
.stp-c { display: flex; gap: 6px; align-items: center; }
.stp-c .ni { width: 64px; text-align: center; font-weight: 700; font-size: 17px; }
.stp-c .ib { width: 40px; font-weight: 700; }

/* Evaluación */
.evlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.evc { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 14px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); text-align: left; cursor: pointer; }
.evc:hover { border-color: var(--accent); }
.evc b { display: block; } .evc small { color: var(--muted); }
.evd { display: flex; gap: 3px; }
.sq { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.sq.E { background: var(--exc); color: var(--accent-fg); } .sq.B { background: var(--ok); color: #fff; } .sq.R { background: var(--warn); color: #fff; } .sq.D { background: var(--bad); color: #fff; }
.crit { display: grid; gap: 10px; margin-bottom: 14px; }
.cr { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cr > span { font-weight: 600; } .cr small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.seg.sm .r { position: relative; }
.seg.sm .r input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg.sm .r span { display: block; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg.sm .r:has(input:focus-visible) span { outline: 2px solid var(--accent); }
.seg.sm .r.E input:checked + span { background: var(--exc); color: var(--accent-fg); }
.seg.sm .r.B input:checked + span { background: var(--ok); color: #fff; }
.seg.sm .r.R input:checked + span { background: var(--warn); color: #fff; }
.seg.sm .r.D input:checked + span { background: var(--bad); color: #fff; }

/* Lotes */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 16px; font-family: var(--font-d); font-weight: 600; font-size: 16px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button small { font-family: var(--font-b); font-size: 12px; font-weight: 500; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--earth); }

/* Formularios y diálogo */
dialog { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--fg); width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
dialog::backdrop { background: rgb(10 20 14 / .45); }
.dlg-f { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.dlg-f > header, .dlg-f > footer { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg-f > header h3 { flex: 1; font-size: 19px; }
.dlg-f > footer { border-bottom: 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlg-b { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0; padding: 12px 14px 14px; min-width: 0; }
legend { font-family: var(--font-d); font-weight: 700; padding: 0 6px; }
.fg { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px 12px; }
.fg2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px 12px; }
.fl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fl > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.fl input, .fl select { width: 100%; }
.fl.chk { flex-direction: row; align-items: center; gap: 8px; align-self: end; min-height: 40px; }
.fl.chk input { width: 20px; height: 20px; min-height: 0; }
.fl.chk span { color: var(--fg); }
.suf { display: flex; align-items: center; gap: 6px; } .suf i { font-style: normal; color: var(--muted); }
.sync-st { margin: 0 0 10px; font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--bad); color: #fff; }
@media (max-width: 860px) { #toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.t td b { white-space: nowrap; }

/* Logos oficiales: siempre sobre fondo claro para que se lean en modo oscuro */
.plogo { display: inline-block; height: 28px; width: auto; max-width: 100%; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 6px; vertical-align: middle; }
.plogo.xs, .plogo.tab { width: 136px; height: 40px; padding: 4px 8px; box-shadow: inset 0 0 0 1px var(--line); }
.hb:has(.plogo) { grid-template-columns: 144px 1fr 54px; }
@media (max-width: 520px) { .hb:has(.plogo) { grid-template-columns: 140px 1fr 40px; } }
.plogo.big { height: 44px; padding: 5px 10px; }
.dlg-b > .plogo.big { align-self: flex-start; }
.hb-i { display: block; margin-bottom: 2px; }
.tabs button { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.tabs button .plogo { opacity: .6; } .tabs button.on .plogo { opacity: 1; }
.brand { flex-direction: column; align-items: stretch; gap: 6px; }
.brand img { width: 100%; background: #fff; border-radius: 10px; padding: 8px 10px; }
.brand span { font-family: var(--font-b); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-left: 2px; }
.top-logo { display: none; height: 34px; background: #fff; border-radius: 8px; padding: 3px 8px; }
@media (max-width: 860px) { .top-logo { display: block; } }

/* Estado en el registro diario */
.est { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 220px; }
.estc { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 3px 8px 3px 4px; cursor: pointer; font-size: 13px; max-width: 100%; text-align: left; }
.estc:hover { background: var(--surface-2); }
.estc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry th.est-h { vertical-align: middle; min-width: 220px; }
.entry th.est-h small { display: block; font-weight: 400; }
.t td input.ni { width: 60px; }
.t td.otros { white-space: nowrap; }
.t td input.otxt, .otxt { width: 110px; min-height: 36px; padding: 6px 8px; margin-left: 4px; }
.stp .otxt { width: 160px; margin: 0; }

/* Descargas del Panel (PDF e imagen) */
.ptitle .exports { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.exports .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.exp {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #e8edf7; --fg: #0f172a; --muted: #556079; --line: #d5dceb;
  --accent: #2563eb; --accent-fg: #ffffff; --accent-soft: #dbe6fe; --earth: #ea580c;
  --c1: #1d4ed8; --c2: #c2852b; --c3: #3c78a8; --c4: #8a5aa3; --c5: #c45a3f; --c6: #3f9a8a;
  --exc: #1d4ed8; --ok: #3b8f4f; --warn: #b9811f; --bad: #c0462f; --info: #3c78a8; color-scheme: light;
  position: fixed; left: -10000px; top: 0; width: 794px; padding: 30px 32px; background: #fff; color: var(--fg); display: grid; gap: 14px; }
.exp.img { width: 540px; padding: 24px; background: var(--bg); }
.exp .ex-h { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--accent); padding-bottom: 12px; }
.exp .ex-h .ex-logo { width: 150px; height: 56px; background: center / contain no-repeat; flex: none; }
.exp .ex-h h1 { font-family: var(--font-d); font-size: 24px; margin: 0; line-height: 1.1; }
.exp .ex-h p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.exp .ex-foot { color: var(--muted); font-size: 11px; text-align: center; }
.exp .kpi.score { grid-column: 1 / -1; flex-direction: row; align-items: center; }
.exp .kv { font-size: 24px; }
.exp .grid { grid-template-columns: 1fr 1fr; }
.exp .card { break-inside: avoid; }
.exp .tw { overflow: visible; }
.exp .t { font-size: 11.5px; }
.exp .t th { font-size: 10.5px; white-space: normal; }
.exp .t td, .exp .t th { padding: 5px 6px; }
.exp .hb { grid-template-columns: 170px 1fr 44px; }
.exp .hb:has(.plogo-bg) { grid-template-columns: 150px 1fr 48px; }
.exp .hb-l, .exp .hb-l small { overflow: visible; white-space: normal; }
.exp .kpis { grid-template-columns: repeat(4, 1fr); }
.exp .plogo-bg { border: 1px solid var(--line); display: inline-block; background: #fff center / contain no-repeat; background-origin: content-box; border-radius: 6px; vertical-align: middle; }
.exp.img .kpis { grid-template-columns: 1fr 1fr; }
.exp.img .kpi.score { grid-column: 1 / -1; }
.exp.img .grid { grid-template-columns: 1fr; }

/* Ajustes: listas editables */
.ib.sm { min-width: 32px; height: 32px; font-size: 14px; }
.ib.warn-b { color: var(--bad); border-color: var(--bad); font-size: 12px; padding: 0 6px; }
.t td input.nw { width: 120px; text-align: right; }
.t td input.emo { width: 48px; text-align: center; font-size: 18px; }
.emo-pick .r span { font-size: 18px; }
.seg.sm .r input:checked + span { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.nowrap { white-space: nowrap; }

/* Calendario */
.sp { flex: 1; }
.cal-leg { display: inline-flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); margin-left: auto; flex-wrap: wrap; }
.cal-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--ec); margin-right: -6px; }
.card.cal { padding: 8px; }
.cg-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cg { min-width: 760px; }
.cg.one { min-width: 0; }
.cg-h, .cg-b { display: grid; grid-template-columns: 52px repeat(var(--n), minmax(0, 1fr)); }
.cg-h { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.cg-d { border: 0; background: none; cursor: pointer; padding: 6px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); border-radius: 8px; }
.cg-d small { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cg-d b { font-family: var(--font-d); font-size: 20px; color: var(--fg); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.cg-d.hoy b { background: var(--accent); color: var(--accent-fg); }
.cg-d:hover { background: var(--surface-2); }
.cg-ax { position: relative; }
.cg-ax span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.cg-ax span:first-child { transform: none; }
.cg-col { position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(var(--hr) / 2), color-mix(in srgb, var(--line) 45%, transparent) calc(var(--hr) / 2) calc(var(--hr) / 2 + 1px), transparent calc(var(--hr) / 2 + 1px) var(--hr)); }
.cg-col.hoy { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.ev { position: absolute; z-index: 1; overflow: hidden; text-align: left; cursor: pointer; border: 0; border-left: 4px solid var(--ec); border-radius: 6px; padding: 3px 6px;
  background: color-mix(in srgb, var(--ec) 16%, var(--surface)); color: var(--fg); font-size: 12px; line-height: 1.25; display: flex; flex-direction: column; gap: 1px; }
.ev:hover { background: color-mix(in srgb, var(--ec) 26%, var(--surface)); z-index: 2; }
.ev b { font-size: 12.5px; }
.ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev .ev-t { font-size: 11px; color: var(--muted); font-weight: 600; }
.ev .ev-c { color: var(--muted); }
.ev .ev-p { font-weight: 600; color: var(--ec); filter: brightness(.85); }
.ev .ev-o { white-space: normal; font-style: italic; color: var(--muted); }
.ev.tiny { padding-top: 1px; padding-bottom: 0; justify-content: center; }
.ev.tiny span { display: none; }
.ev.tiny b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.ev b { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; flex: none; }
.cg.one .ev { font-size: 13px; padding: 5px 10px; }
.cg.one .ev b { font-size: 14px; }
.cm-h, .cm-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cm-h span { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 0; text-transform: uppercase; letter-spacing: .04em; }
.cm-g { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cm-c { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; }
.cm-c:hover { background: var(--surface-2); }
.cm-c > b { font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cm-c.hoy > b { background: var(--accent); color: var(--accent-fg); }
.cm-c.out { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.cm-c.out > b { color: var(--muted); font-weight: 500; }
.cm-e { border: 0; background: color-mix(in srgb, var(--ec) 14%, transparent); border-radius: 5px; padding: 2px 5px; font-size: 11.5px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; width: 100%; }
.cm-e i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ec); margin-right: 3px; vertical-align: middle; }
.cm-e span { color: var(--muted); font-weight: 600; }
.cm-more { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
@media (max-width: 600px) { .cm-c { min-height: 70px; padding: 2px; } .cm-e span, .cm-e i { display: none; } .cm-e { font-size: 10.5px; padding: 1px 3px; } }
.t.reg td { padding: 4px; }
.t.reg td input, .t.reg td select { min-height: 36px; padding: 5px 7px; font-size: 13.5px; }
.t.reg td input { min-width: 160px; }
.t.reg td input.tm { min-width: 118px; width: 118px; }
.t.reg tr.rep td { color: var(--muted); font-size: 13px; background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.t.reg td select { max-width: 190px; }
.chip.ck { position: relative; }
.chip.ck input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.chip.ck:has(input:checked) { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip.ck:has(input:focus-visible) { outline: 2px solid var(--accent); }
.seg.sm.tipo .r.t-recurrente input:checked + span { background: var(--c1); color: #fff; }
.seg.sm.tipo .r.t-planificada input:checked + span { background: var(--c3); color: #fff; }
.seg.sm.tipo .r.t-imprevista input:checked + span { background: var(--c5); color: #fff; }
h3.sec { margin: 22px 0 10px; font-size: 18px; }
.alerts.info li { border-left-color: var(--info); background: color-mix(in srgb, var(--info) 6%, transparent); }
.ev > * { flex: none; }

/* ===== Ventas: proyectos, mapa de lotes y cotizador ===== */
.pcard { gap: 12px; display: flex; flex-direction: column; border-top: 4px solid var(--pc); }
.pband { position: relative; display: grid; place-items: center; background: #fff; border-radius: 10px; min-height: 120px; padding: 26px 16px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.pband > span { position: absolute; top: 8px; right: 8px; background: var(--pc); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.plogo.hero { height: 84px; max-width: 80%; padding: 0; background: none; }
.clogo { display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 10px; margin-bottom: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.clogo .plogo.hero { height: 64px; }
.pfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.pfacts > div { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 0; }
.pfacts b { font-family: var(--font-d); font-size: 17px; }
.pfacts span { font-size: 12px; color: var(--muted); }
.eyebrow { margin: 10px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.mz:first-child .eyebrow { margin-top: 0; }
.lots { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.lot { border: 0; border-radius: 10px; padding: 8px 4px; font-weight: 700; font-size: 13px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.lot small { font-weight: 500; font-size: 10.5px; opacity: .8; }
.lot.e-libre { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.lot.e-separado { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.lot.e-vendido { background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); text-decoration: line-through; }
.lot.e-bloqueado { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); opacity: .8; }
.lot.e-cedido { background: color-mix(in srgb, var(--c4) 16%, transparent); color: var(--c4); opacity: .85; }
.lot.e-invendible { background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--muted); opacity: .7; }
.lot:hover { filter: brightness(.95); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.legend i.lot { display: inline-block; width: 12px; height: 12px; padding: 0; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.qbig { background: var(--pc); color: #fff; border-radius: 14px; padding: 14px 18px; display: flex; flex-direction: column; margin: 10px 0; }
.qbig span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.qbig b { font-family: var(--font-d); font-size: 30px; }
.gatbox { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.gatbox b { font-family: var(--font-d); font-size: 16px; white-space: nowrap; }
.cres .btns { margin: 12px 0; }
.cres tr.on td { color: var(--accent); font-weight: 700; }
.warn-t { color: var(--warn); font-weight: 600; }
.editado { color: var(--warn); font-style: normal; font-weight: 600; }
.card.hoy { border-color: var(--warn); }
.tline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tline:last-child { border-bottom: 0; }
.tline > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.tline small { color: var(--muted); }
.btn.wa { align-self: end; }

/* Planos: lote resaltado y herramienta para marcarlo */
.plano-c .card-h { align-items: flex-start; }
.plano-img { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); min-height: 80px; display: grid; place-items: center; background: var(--bg); }
.plano-img img { display: block; width: 100%; height: auto; }
dialog:has(.pl-dlg) { width: min(1280px, calc(100vw - 16px)); height: calc(100dvh - 16px); max-height: none; }
.pl-dlg { height: 100%; max-height: none; }
.pl-dlg > header select { max-width: 46%; }
.pl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.pl-bar #pl-msg { flex: 1 1 220px; }
.pl-wrap { flex: 1; overflow: auto; background: #20242a; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.pl-in { position: relative; cursor: crosshair; }
.pl-in img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; pointer-events: none; }
.pl-in svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pl-o { fill: rgb(255 230 0 / .08); stroke: #FFE600; stroke-dasharray: 6 5; opacity: .75; }
.pl-a { fill: rgb(255 230 0 / .18); stroke: #FFE600; stroke-linejoin: round; filter: drop-shadow(0 0 1.5px rgb(0 0 0 / .8)); }
.pl-v { fill: #FFE600; stroke: #000; stroke-width: 1; }

/* Ficha de separación */
.t.kv td:first-child { color: var(--muted); width: 44%; }
.t.kv td:last-child { text-align: right; }
.dni-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.dni-b { border: 1px dashed var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dni-b img { width: 100%; aspect-ratio: 1.58; object-fit: contain; background: var(--bg); border-radius: 8px; }
.dni-e { aspect-ratio: 1.58; display: grid; place-items: center; text-align: center; color: var(--muted); background: var(--bg); border-radius: 8px; font-size: 14px; padding: 8px; }
.dni-b .btns { margin: 0; }
.dni-b label.btn { cursor: pointer; }

/* Visitas: cuadro de movilidad y derivaciones */
.mv-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: -4px -4px 8px; padding: 4px; }
.mv { display: grid; grid-template-columns: 52px repeat(var(--n), minmax(var(--cw), 1fr)); }
.mv-d { position: sticky; top: 0; text-align: center; border-left: 2px solid var(--line); background: var(--surface); }
.mv-d button { position: sticky; left: 56px; right: 0; border: 0; background: none; cursor: pointer; font-family: var(--font-d); font-weight: 700; font-size: 15px; padding: 6px; color: var(--fg); border-radius: 8px; }
.mv-d button:hover { background: var(--surface-2); }
.mv-d.hoy button { color: var(--accent); }
.mv-v { font-size: 11px; font-weight: 700; padding: 4px 4px 6px; border-left: 1px solid var(--line); border-bottom: 3px solid var(--vc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.mv-ax { position: relative; }
.mv-ax span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.mv-ax span:first-child { transform: none; }
.mv-c { position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(var(--hr) / 2), color-mix(in srgb, var(--line) 45%, transparent) calc(var(--hr) / 2) calc(var(--hr) / 2 + 1px), transparent calc(var(--hr) / 2 + 1px) var(--hr)); }
.mv-c.first { border-left: 2px solid color-mix(in srgb, var(--fg) 30%, var(--line)); }
.mv-c.hoy { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.mv-alm { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 14%, transparent) 0 6px, transparent 6px 12px); pointer-events: none; display: flex; align-items: center; justify-content: center; }
.mv-alm span { font-size: 10px; color: var(--muted); font-style: normal; }
.ev.mv-e { left: 2px; right: 2px; font-size: 11px; }
.ev.mv-e b { font-size: 11.5px; }
.ev.mv-e.tiny { flex-direction: row; gap: 4px; padding: 1px 4px; }
.ev.mv-e.x { opacity: .55; text-decoration: line-through; }
.kpis.sm { margin: 12px 0; }
.kpis.sm .kv { font-size: 22px; }
.cal-l { font-family: var(--font-d); font-size: 16px; }
.nbadge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; margin-left: 4px; }
.der-l { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; margin-top: 12px; }
.card.der .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Áreas: Medición de agentes / Cotización y ventas / Ajustes */
.areas { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.areas button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.areas button:hover { color: var(--fg); }
.areas button.on { background: var(--accent); color: var(--accent-fg); }
.nav-h { margin: 0 0 6px; padding: 0 12px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.nav button[hidden] { display: none; }
@media (max-width: 860px) {
  .top { flex-wrap: wrap; }
  .areas { order: 3; width: 100%; display: grid; grid-template-columns: 1fr 1fr auto; }
  .areas button { padding: 8px 6px; font-size: 13px; }
  .nav-h { display: none; }
  body[data-area="ajustes"] .nav { display: none; }
  body[data-area="ajustes"] main { padding-block-end: 48px; }
}

.areas .sm { display: none; }
.t.inv td { font-size: 13px; } .t .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.fl.wide { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .areas { grid-template-columns: repeat(4, auto); }
  .areas .lg { display: none; } .areas .sm { display: inline; }
  body[data-area="inventario"] .nav { display: none; }
  body[data-area="inventario"] main { padding-block-end: 48px; }
}
.t.inv .mono { min-width: 130px; }
@media (max-width: 600px) {
  .inv-f { display: grid; grid-template-columns: 1fr 1fr; }
  .inv-f > input[type=search] { grid-column: 1 / -1; }
  .inv-f select { width: 100%; min-width: 0; }
}

/* Celular de asesor: solo Cotización y ventas */
body:not([data-rol="asesor"]) .nav .solo-as { display: none; }
body[data-rol="asesor"] .areas { display: none; }
/* Pantalla de entrada del asesor */
body[data-lock="1"] .nav, body[data-lock="1"] .areas { display: none; }
body[data-lock="1"] main { margin-left: 0; }
body[data-lock="1"] .top { display: none; }
.entrar { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 32px 0; }
.entrar { position: relative; }
.entrar-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 0; }
.entrar-hero { display: grid; justify-items: center; gap: 6px; text-align: center; }
.entrar-hero h1 { font-family: var(--font-d); font-size: 30px; margin: 10px 0 0; letter-spacing: -0.01em; }
.entrar-hero p { margin: 0; color: var(--muted); }
.entrar .card { width: min(100%, 400px); display: grid; gap: 10px; }
.entrar-logo { width: min(240px, 70vw); height: auto; background: #fff; border-radius: 18px; padding: 16px 22px; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.entrar form { display: grid; gap: 10px; }
.btn.wide { width: 100%; justify-content: center; }
body[data-lock="1"] #syncpill { display: none; }

/* Imagen de ubicación del lote */
.zoom-c .card-h { align-items: flex-start; }
.zoom-img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; }
.zoom-full { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.zoom-full img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.zoom-full .ib { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.15); color: #fff; }

/* Instalar la app */
.pill.inst { background: var(--accent); color: var(--accent-fg); border: 0; cursor: pointer; font-weight: 600; }
.entrar-hero .btn { margin-top: 10px; }
ol.pasos { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 8px; }
code.enlace { display: block; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; word-break: break-all; font-size: 13px; }
/* Pedidos: filas de artículos del formulario */
dialog:has(.ped-dlg) { width: min(920px, calc(100vw - 16px)); }
#ped-its { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ped-it { display: grid; grid-template-columns: 130px minmax(0, 1fr) 80px 96px 110px 32px; gap: 8px; align-items: end; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ped-it .ib { margin-bottom: 4px; }
@media (max-width: 720px) {
  .ped-it { grid-template-columns: 1fr 1fr; }
  .ped-it .ped-d { grid-column: 1 / -1; }
  .ped-it .ib { justify-self: end; }
}
/* Comprobante de pago de la separación: suele ser vertical (voucher o captura) */
.comp-g { grid-template-columns: minmax(0, 360px); }
.comp-g .dni-b img, .comp-g .dni-e { aspect-ratio: 3 / 4; }

/* Kommo CRM */
.kommo-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 1px 6px; border-radius: 999px; vertical-align: 1px;
  color: var(--info, #2563eb); background: color-mix(in srgb, var(--info, #2563eb) 12%, transparent); }
.kommo-line { margin: 8px 0 0; line-height: 1.6; }

/* Áreas Marketing y Administración: seis pestañas en celular (dos filas de tres) */
@media (max-width: 860px) {
  body:not([data-rol="asesor"]) .areas { grid-template-columns: repeat(3, 1fr); }
}

/* Ingreso: elegir área */
.en-areas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.en-area { border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); border-radius: 12px; padding: 12px 10px; cursor: pointer; font: inherit; font-weight: 600; text-align: left; display: grid; gap: 2px; }
.en-area small { font-weight: 400; color: var(--muted); font-size: 12px; }
.en-area:hover { border-color: var(--accent); }
.en-area.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pill.user { cursor: pointer; font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-lock="1"] #userpill { display: none; }

/* Usuario de consulta (Gerencia): ve todo sin modificar */
.ro-banner { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
body[data-ro="1"] .dlg-f footer button[type=submit], body[data-ro="1"] .btn.danger, body[data-ro="1"] [data-act$="New"], body[data-ro="1"] [data-act="kommoNow"] { display: none; }

/* Finanzas y administración */
.grp-row td { background: var(--surface-2); font-weight: 700; }
.t.flujo .neto td { font-weight: 700; border-top: 2px solid var(--line); }
.bad-t { color: var(--bad); }
.fl.inl { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.fl.inl input { width: auto; }

/* Grilla de grabaciones */
.gr-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.gr-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; padding: 2px 0; }
.gr-d { min-height: 92px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gr-d.fuera { opacity: .4; }
.gr-d.hoy { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.gr-n { font-size: 12px; font-weight: 700; color: var(--muted); }
.gr-i { border: 0; border-radius: 6px; padding: 3px 5px; font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-2); color: var(--fg); border-left: 3px solid var(--muted); }
.gr-i.st-ok { border-left-color: var(--good, #16a34a); } .gr-i.st-info { border-left-color: var(--info, #2563eb); }
.gr-i.st-warn { border-left-color: var(--warn, #d97706); } .gr-i.st-bad { border-left-color: var(--bad); text-decoration: line-through; }
@media (max-width: 600px) { .gr-d { min-height: 64px; padding: 2px; } .gr-i { font-size: 10px; padding: 1px 3px; } .gr-i b { display: none; } }
body[data-una-area="1"] .areas { display: none; }
/* Recibo por honorarios / factura en la planilla */
.comp-arch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.comp-arch label.btn { cursor: pointer; }
/* Directorio de colaboradores */
.dir-l { list-style: none; margin: 0; padding: 0; }
.dir-l li { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.dir-l li:first-child { border-top: 0; }
.dir-n small { display: block; color: var(--muted); }
.dir-c { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.dir-c a { text-decoration: none; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: inherit; word-break: break-all; }
.dir-c a.dir-wa { background: rgba(37, 211, 102, .14); }
.co-pct { display: flex; gap: 6px; align-items: center; }
/* Aviso de lote separado */
.sep-alert { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: 12px; width: min(560px, calc(100% - 24px)); background: var(--surface); border: 2px solid var(--warn); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px 14px; }
.sep-alert h4 { margin: 0 0 4px; }
.sep-alert ul { margin: 4px 0 8px; padding-left: 18px; }
.sep-alert .row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.seg-cot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.seg-cot h4 { margin: 0 0 2px; }

/* ---------- v36: áreas en construcción ---------- */
.en-area { position: relative; overflow: hidden; min-height: 64px; align-content: center; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.en-area:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgb(0 0 0 / .08); }
.en-area.obra { color: var(--muted); }
.en-area.obra { align-content: start; padding-bottom: 40px; }
.obra-cinta { position: absolute; left: -10%; right: -10%; bottom: 10px; transform: rotate(-5deg); padding: 3px 0; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #1b1b1b;
  background: repeating-linear-gradient(-45deg, #f2c230 0 14px, #f7d665 14px 28px); box-shadow: 0 2px 6px rgb(0 0 0 / .18); pointer-events: none; }
.obra-banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--warn) 14%, transparent) 0 16px, color-mix(in srgb, var(--warn) 6%, transparent) 16px 32px); }
.obra-banner > span { font-size: 26px; }
.obra-banner b { display: block; color: var(--warn); }
.obra-banner small { color: var(--muted); }


/* ---------- v36: animaciones ---------- */
@keyframes cg-sube { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cg-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cg-fondo { from { opacity: 0; } to { opacity: 1; } }
@keyframes cg-brillo { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
#view.anim-in > * { animation: cg-sube .38s cubic-bezier(.2, .7, .2, 1) both; }
#view.anim-in > :nth-child(2) { animation-delay: .04s; } #view.anim-in > :nth-child(3) { animation-delay: .08s; } #view.anim-in > :nth-child(4) { animation-delay: .12s; }
#view.anim-in > :nth-child(5) { animation-delay: .16s; } #view.anim-in > :nth-child(n+6) { animation-delay: .2s; }
#view.anim-in .kpi { animation: cg-sube .4s cubic-bezier(.2, .7, .2, 1) both; }
#view.anim-in .kpi:nth-child(2) { animation-delay: .06s; } #view.anim-in .kpi:nth-child(3) { animation-delay: .12s; } #view.anim-in .kpi:nth-child(n+4) { animation-delay: .18s; }
#view.anim-in .entrar-logo { animation: cg-pop .6s cubic-bezier(.2, .7, .2, 1) both; }
#view.anim-in .en-area { animation: cg-pop .4s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + .15s); }
#view:not(.anim-in) .en-area.on { animation: cg-brillo 1.2s ease-in-out 1; }
dialog[open] { animation: cg-pop .26s cubic-bezier(.2, .7, .2, 1); }
dialog[open]::backdrop { animation: cg-fondo .2s ease; }
.btn, .chip, .nav button, .areas button { transition: transform .12s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease; }
.btn:active, .chip:active, .nav button:active, .areas button:active { transform: scale(.96); }
.btn:not(.ghost):hover { box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.card, .kpi { transition: box-shadow .2s ease, transform .2s ease; }
@media (hover: hover) { .kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgb(0 0 0 / .07); } }
.t tbody tr { transition: background-color .15s ease; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

/* ---------- v37: herramientas comerciales ---------- */
.alerta-48 { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad) 5%, var(--surface)); }
.alerta-48 h3 { color: var(--bad); }
.wa-pl .wa-pl-r { display: flex; gap: 8px; } .wa-pl select { flex: 1; min-width: 0; }
.podio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.podio-i { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-align: center; display: grid; gap: 2px; animation: cg-pop .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 90ms); }
.podio-i.p1 { order: 2; padding-top: 26px; border-color: #e3b33b; background: linear-gradient(180deg, color-mix(in srgb, #f2c230 18%, var(--surface)), var(--surface)); }
.podio-i.p2 { order: 1; } .podio-i.p3 { order: 3; }
.podio-i .med { font-size: 34px; line-height: 1; } .podio-i.p1 .med { font-size: 44px; }
.podio-i p { margin: 6px 0 0; } .podio-i small { color: var(--muted); }
.podio-i.yo, .t.rk tr.yo td { box-shadow: inset 0 0 0 2px var(--accent); }
.t.rk tr.yo td { box-shadow: none; background: var(--accent-soft); }
.rk-bar div { width: 120px; background: var(--surface-2); border-radius: 6px; overflow: hidden; } .rk-bar span, .proy-bar span, .emb-b span { display: block; height: 10px; border-radius: 6px; background: var(--accent); transform-origin: left; animation: cg-crece .7s cubic-bezier(.2, .7, .2, 1) both; }
.proy-bar, .emb-b { background: var(--surface-2); border-radius: 6px; overflow: hidden; } .proy-bar { margin-top: 12px; } .proy-bar span { height: 12px; }
.proy .kpi.ok .kv { color: var(--ok); } .proy .kpi.warn .kv { color: var(--warn); } .proy .kpi.bad .kv { color: var(--bad); }
.embudo, .motivos { display: grid; gap: 10px; margin-top: 8px; }
.emb-f, .mot { display: grid; grid-template-columns: 130px 1fr 54px; gap: 4px 10px; align-items: center; animation: cg-sube .4s ease both; animation-delay: calc(var(--i) * 70ms); }
.mot { grid-template-columns: minmax(120px, 34%) 1fr 40px; }
.emb-f small, .mot small { grid-column: 2 / 4; color: var(--muted); margin-top: -4px; }
.emb-b span { height: 18px; } .mot .emb-b span { background: var(--bad); height: 14px; }
.emb-f b, .mot b { text-align: right; }
@keyframes cg-crece { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (max-width: 600px) { .podio { gap: 6px; } .podio-i { padding: 10px 6px; } .podio-i b { font-size: 13px; } .emb-f { grid-template-columns: 96px 1fr 44px; } .rk-bar { display: none; } }
.pt-ref { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
/* v38: lote vendido o separado (pintado en el plano) */
.lote-nodisp { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; margin: 0 0 12px; border-radius: 12px; background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); animation: cg-pop .35s ease both; }
.lote-nodisp b { font-size: 16px; color: var(--bad); }
.lote-nodisp.e-separado { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.lote-nodisp.e-separado b { color: var(--warn); }
.lote-nodisp span { font-size: 13px; color: var(--muted); }
/* Aviso de 48 h en el celular: el nombre arriba y los botones debajo, sin cortarse */
@media (max-width: 600px) { .alerta-48 .tw { overflow: visible; } .alerta-48 tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); } .alerta-48 tr:last-child { border-bottom: 0; } .alerta-48 td { border: 0; padding: 0; } .alerta-48 td:first-child { flex: 1 1 100%; } .alerta-48 td.nowrap { white-space: normal; display: flex; gap: 6px; flex-wrap: wrap; } }
.qini-h { margin: 14px 0 6px; font-size: .95rem; }
.t.rep tr.sub-tot td, .t.rep tr.tot td { background: rgba(127,127,127,.09); }
.t.rep tr.tot td { border-top: 2px solid var(--line); }

/* Mi meta del mes: mapa de sueños */
.mm-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 6px; }
.mm-camino { display: flex; align-items: center; flex: 1; min-width: 220px; max-width: 420px; }
.mm-camino span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); border: 2px solid var(--line); flex: none; }
.mm-camino span.on { border-color: var(--accent); }
.mm-camino span.ok { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.mm-camino i { flex: 1; height: 3px; background: var(--line); min-width: 8px; }
.mm-plazo { margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.mm-plazo::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c1); }
.mm-mediano::before { background: var(--c2); } .mm-largo::before { background: var(--c3); }
.mm-plazo small { font-weight: 400; color: var(--muted); }
.mm-niveles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mm-niv { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mm-niv.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mm-niv.ok { border-color: #2e9e5b; }
.mm-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mm-n { font-weight: 700; }
.mm-ok { margin-left: auto; background: #2e9e5b; color: #fff; border-radius: 99px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.mm-img { display: grid; place-items: center; text-align: center; aspect-ratio: 16 / 9; border-radius: 10px; border: 2px dashed var(--line); background: var(--surface) center / cover no-repeat; cursor: pointer; color: var(--muted); font-size: 13px; position: relative; overflow: hidden; }
.mm-img[style] { border-style: solid; }
.mm-cambiar { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.mm-niv textarea { width: 100%; resize: vertical; }

/* Ranking: premios e insignias */
.premios-l { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.premios-l div { background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: center; display: grid; gap: 2px; }
.premios-l span { font-size: 26px; } .premios-l small { color: var(--muted); }
.insig-ley { margin-top: 10px; }
.insig { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); margin-right: 3px; font-size: 14px; cursor: help; }
.insigs { margin-top: 4px; } .podio-pr { display: block; margin-top: 4px; color: var(--accent) !important; font-weight: 600; }

/* Avisos por WhatsApp */
tr.av-ok td { opacity: .6; }

/* Cambiar marca */
.marca-prev { display: grid; place-items: center; background: var(--surface-2); border-radius: 10px; padding: 14px; margin: 6px 0 10px; }
.marca-prev img { max-height: 80px; max-width: 100%; object-fit: contain; }
.tour-btn { cursor: pointer; border: 0; }

/* Recorrido guiado */
#tour { position: fixed; z-index: 9000; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 32px)); background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.28); animation: cg-pop .3s ease both; }
#tour h3 { margin: 8px 0 4px; } #tour p { margin: 0 0 10px; line-height: 1.45; }
.tour-h { display: flex; align-items: center; justify-content: space-between; }
.tour-bar { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-bottom: 12px; } .tour-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.tour-b { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.tour-hl { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: var(--r); transition: outline-color .3s; }
@media (max-width: 600px) { #tour { right: 16px; left: 16px; bottom: 76px; width: auto; } .premios-l { gap: 6px; } .premios-l b { font-size: 13px; } }
a.btn, a.btn:hover { text-decoration: none; }
