/* Maqueta CRM · estilo «escalera de un color»: el azul completo solo en marcas pequeñas, sus tintes en las áreas. */
:root {
  --ground: #f6f8fb;
  --surface: #ffffff;
  --raised: #f1f4f8;
  --active: #e8f0fd;
  --border: #e3e8ef;
  --rule: #eef1f5;
  --control: #d3dae4;
  --text: #0f1729;
  --muted: #5a6476;
  --faint: #6b7385;
  --accent: #1b5fd1;
  --accent-soft: #eef4fe;
  --accent-track: #d7e5fc;
  --accent-ink: #123e88;
  --primary: #1b5fd1;
  --primary-ink: #ffffff;
  --positive: #247b50; --negative: #c4242a; --warning: #92400e;
  --pill-positive-bg: #dcf5e6; --pill-positive-ink: #14532d;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fff6e0; --pill-warning-ink: #8a3d0c;
  --pill-neutral-bg: #eef1f5; --pill-neutral-ink: #374151;
  --pill-accent-bg: #e8f0fd; --pill-accent-ink: #123e88;
  --chart-1: #1b5fd1; --chart-2: #8a94a6; --chart-3: #6f9be6; --chart-muted: #cfd6e0;
  --chart-mark: var(--text); --chart-span: 0.06; --grid: var(--rule); --axis-ink: var(--muted); --ink: var(--text);

  --font: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  --fs-title: 26px; --fs-section: 16px; --fs-kpi: 26px; --fs-body: 14px; --fs-small: 12px;
  --sidebar-width: 244px;
  --pad: 32px; --gap: 20px; --card-pad: 20px;
  --radius-card: 10px; --radius-control: 8px;
  --control-height: 34px; --row-height: 52px; --nav-row: 34px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 120ms; --t-hover: 150ms; --t-ui: 220ms;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 2.5 8 6l-3.5 3.5' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/20px var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, table, .kpi-value, .big { font-variant-numeric: tabular-nums; }

/* ---------- marco: menú a la izquierda y lienzo ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 2px; padding: 20px 14px; overflow: auto; background: var(--surface); border-right: 1px solid var(--border); }
.marca { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.marca svg { width: 26px; height: 26px; }
.empresa { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); text-align: left; cursor: pointer; transition: background-color var(--t-hover) ease; }
.empresa:hover { background: var(--raised); }
.empresa b { display: block; font-weight: 600; line-height: 18px; }
.empresa span { display: block; font-size: var(--fs-small); color: var(--muted); line-height: 16px; }
.empresa .logo { width: 30px; height: 30px; flex: none; border-radius: 6px; background: #fbeee2; color: #8a4512; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.empresa svg { margin-left: auto; width: 14px; height: 14px; color: var(--muted); }
.group-label { margin: 22px 10px 6px; font-size: var(--fs-small); color: var(--faint); }
.nav-item { display: flex; align-items: center; gap: 10px; height: var(--nav-row); padding: 0 10px; border-radius: var(--radius-control); color: var(--muted); font-weight: 500; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.nav-item svg { width: 17px; height: 17px; flex: none; stroke-width: 1.6; }
.nav-item .cuenta { margin-left: auto; font-size: var(--fs-small); color: var(--faint); font-weight: 500; }
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--active); color: var(--accent-ink); }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.nav-item .alerta { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.sidebar .bottom { margin-top: auto; display: grid; gap: 10px; padding-top: 16px; }
.plan { padding: 14px; border-radius: var(--radius-card); background: var(--accent-soft); color: var(--accent-ink); }
.plan b { display: block; font-weight: 600; }
.plan p { font-size: var(--fs-small); line-height: 17px; margin-top: 2px; }
.plan .track { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--accent-track); overflow: hidden; }
.plan .track i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.usuario { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.usuario b { display: block; font-weight: 600; line-height: 18px; }
.usuario span { font-size: var(--fs-small); color: var(--muted); }
.canvas { min-width: 0; padding: var(--pad); }
.vista { max-width: 1440px; margin: 0 auto; }
.vista[hidden] { display: none; }

/* ---------- títulos y filtros ---------- */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.title-row h1 { font-size: var(--fs-title); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.title-row .sub { margin-top: 6px; color: var(--muted); font-size: 15px; }
.title-row .acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.hallazgo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 12px 16px; border-radius: var(--radius-card); background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.hallazgo p { flex: 1; }
.hallazgo b { font-weight: 600; }
.filters { display: flex; align-items: center; gap: 8px; margin-bottom: var(--gap); flex-wrap: wrap; }
.filters .spacer { flex: 1; }
.stamp { color: var(--faint); font-size: var(--fs-small); }

/* ---------- paneles ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: var(--gap); align-items: start; }
.col { display: grid; gap: var(--gap); min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel h2 { font-size: var(--fs-section); line-height: 1.3; font-weight: 600; }
.panel header p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.panel .meta { color: var(--faint); font-size: var(--fs-small); }
.card-link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--accent-ink); font-weight: 600; cursor: pointer; text-underline-offset: 3px; font-size: 13px; }
.card-link::after { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--chevron) center / 12px no-repeat; mask: var(--chevron) center / 12px no-repeat; }
.card-link:hover { text-decoration: underline; }

/* KPIs en una franja */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.kpi { padding: 16px var(--card-pad) 18px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { margin-top: 6px; font-size: var(--fs-kpi); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.kpi-value small { font-size: 0.55em; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.delta { margin-top: 6px; font-size: var(--fs-small); color: var(--muted); }
.delta .up { color: var(--positive); font-weight: 600; } .delta .down { color: var(--negative); font-weight: 600; }

/* Embudo: del anuncio a la venta aprobada */
.embudo { display: grid; gap: 4px; }
.paso { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px; align-items: center; gap: 16px; min-height: 44px; }
.paso .nombre { font-weight: 500; }
.paso .nombre span { display: block; font-size: var(--fs-small); color: var(--muted); font-weight: 400; }
.barra { height: 28px; border-radius: 6px; background: var(--accent-soft); position: relative; overflow: hidden; }
.barra i { position: absolute; inset: 0 auto 0 0; background: var(--accent-track); border-radius: 6px; }
.paso:last-child .barra i { background: var(--accent); }
.barra b { position: relative; display: flex; align-items: center; height: 100%; padding-left: 10px; font-weight: 600; color: var(--accent-ink); }
.paso:last-child .barra b { color: #fff; }
.paso .tasa { text-align: right; color: var(--muted); font-size: 13px; }
.paso .tasa b { color: var(--text); font-weight: 600; font-size: 14px; margin-right: 4px; }

/* filas de lista */
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 0; }
.row + .row { border-top: 1px solid var(--rule); }
.row .grow { flex: 1; min-width: 0; }
.row b { font-weight: 600; display: block; }
.row .sub { display: block; font-size: var(--fs-small); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hora { width: 48px; flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.espera { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.espera.alta { color: var(--negative); }
.espera.media { color: var(--warning); }

/* personas: inicial y tinte propio */
.avatar { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; }
.persona { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }

/* tablas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 38px; padding: 0 12px; text-align: left; font-weight: 500; font-size: var(--fs-small); color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: calc((var(--row-height) - 20px) / 2) 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clic { cursor: pointer; transition: background-color var(--t-hover) ease; }
tbody tr.clic:hover td { background: var(--raised); }
th.n, td.n { text-align: right; }
td b { font-weight: 600; }
td .sub { display: block; font-size: var(--fs-small); color: var(--muted); }
tfoot td { font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: var(--fs-small); font-weight: 600; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill.acc { background: var(--pill-accent-bg); color: var(--pill-accent-ink); }

/* controles */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 14px; border-radius: var(--radius-control); border: 1px solid var(--control); background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.primary:hover { background: #164fb0; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.input { height: var(--control-height); padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); min-width: 0; }
.buscar { width: 300px; padding-left: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.5' fill='none' stroke='%235a6476' stroke-width='1.5'/%3E%3Cpath d='m10.5 10.5 3 3' stroke='%235a6476' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 11px center / 16px no-repeat; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: #e9eef5; }
.segmented button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; padding: 10px 0 12px; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; transition: color var(--t-hover) ease; }
.tabs button span { color: var(--faint); font-weight: 500; margin-left: 4px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent-ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.switch { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--control); position: relative; cursor: pointer; transition: background-color var(--t-ui) ease; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-ui) var(--ease-out); }
.switch:checked { background: var(--accent); } .switch:checked::after { transform: translateX(14px); }

/* agenda semanal: vendedores a la izquierda, días arriba */
.agenda { display: grid; grid-template-columns: 190px repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.agenda > div { padding: 10px; border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); min-height: 64px; min-width: 0; }
.agenda .cab { min-height: 0; padding: 10px; font-size: 13px; font-weight: 600; color: var(--muted); border-top: 0; }
.agenda .cab.hoy { color: var(--accent-ink); background: var(--accent-soft); }
.agenda .quien { border-left: 0; display: flex; align-items: center; gap: 10px; }
.agenda .quien b { font-weight: 600; display: block; line-height: 18px; }
.agenda .quien span { font-size: var(--fs-small); color: var(--muted); }
.agenda .finde { background: #fafbfd; }
.agenda .dia-hoy { background: #f8fbff; }
.cita { display: block; width: 100%; margin-bottom: 6px; padding: 6px 8px; border-radius: 6px; font-size: 12px; line-height: 16px; text-align: left; border: 1px solid transparent; cursor: pointer; }
.cita b { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.cita span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cita.confirmada { background: var(--accent-soft); color: var(--accent-ink); border-left: 3px solid var(--accent); }
.cita.sin-confirmar { background: var(--surface); color: var(--text); border: 1px dashed var(--control); }
.cita.realizada { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.cita.cancelada { background: var(--raised); color: var(--muted); text-decoration: line-through; }
.cita.reporte { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.leyenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-small); color: var(--muted); }
.leyenda i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ficha del lead */
.ficha { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.datos dt { font-size: var(--fs-small); color: var(--muted); margin-top: 14px; }
.datos dt:first-child { margin-top: 0; }
.datos dd { font-weight: 500; }
.resultados { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--control); background: var(--surface); font-weight: 500; font-size: 13px; cursor: pointer; transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease; }
.chip:hover { background: var(--raised); }
.chip[aria-pressed="true"] { background: var(--active); border-color: var(--accent); color: var(--accent-ink); }
.linea { display: grid; gap: 0; }
.evento { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; position: relative; }
.evento::before { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--rule); }
.evento:last-child::before { display: none; }
.evento .punto { width: 20px; height: 20px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; }
.evento .punto i { width: 8px; height: 8px; border-radius: 50%; background: var(--chart-2); }
.evento.acc .punto { background: var(--accent-soft); } .evento.acc .punto i { background: var(--accent); }
.evento b { font-weight: 600; }
.evento p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.evento time { font-size: var(--fs-small); color: var(--faint); }
.referidos .track { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin: 10px 0 6px; }
.referidos .track i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
textarea.input { height: 76px; padding: 10px 12px; resize: vertical; width: 100%; }

/* ajustes */
.ajuste { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; }
.ajuste + .ajuste { border-top: 1px solid var(--rule); }
.ajuste b { font-weight: 600; display: block; }
.ajuste p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.integracion { display: flex; gap: 14px; align-items: flex-start; }
.integracion .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--raised); }
.integracion .ico svg { width: 22px; height: 22px; }
.matriz th, .matriz td { text-align: center; }
.matriz th:first-child, .matriz td:first-child { text-align: left; }
.matriz td .switch { margin: 0 auto; display: block; }
.canales { display: flex; gap: 6px; justify-content: center; }

.menu-toggle { display: none; }
.solo-movil, .icon-btn.solo-movil { display: none; }

@media (max-width: 1280px) {
  .ficha { grid-template-columns: 280px minmax(0, 1fr); }
  .ficha > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .agenda { grid-template-columns: 150px repeat(7, minmax(110px, 1fr)); overflow-x: auto; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; transform: translateX(-100%); transition: transform var(--t-ui) var(--ease-out); border-right: 0; }
  .sidebar.open { transform: none; }
  .topbar { display: flex !important; }
  .canvas { padding: 16px; }
  .grid > * { grid-column: 1 / -1 !important; }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .kpi:nth-child(2n) { border-left: 1px solid var(--border); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .title-row { flex-wrap: wrap; align-items: flex-start; }
  .title-row h1 { font-size: 22px; }
  .paso { grid-template-columns: 104px minmax(0, 1fr) 46px; gap: 10px; }
  .paso .tasa span { display: none; }
  .ficha { grid-template-columns: minmax(0, 1fr); }
  .buscar { width: 100%; }
  .filters .spacer { display: none; }
  .agenda { display: block; border: 0; background: none; }
  .agenda > div { display: none; }
  .solo-movil, .icon-btn.solo-movil { display: block; }
  .icon-btn.solo-movil { display: grid; }
  .tabla-movil thead { display: none; }
  .tabla-movil tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .tabla-movil td { padding: 2px 0; border: 0; }
  .tabla-movil td.ocultar { display: none; }
}
.topbar { display: none; position: sticky; top: 0; z-index: 10; height: 52px; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar b { flex: 1; font-weight: 700; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--raised); }
.icon-btn svg { width: 20px; height: 20px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; } }

/* ---------- menú lateral en azul noche ---------- */
:root { --noche: #0b1324; --noche-2: #131e35; --noche-3: #1b2a48; --noche-borde: #1e2b45; --noche-texto: #e8edf7; --noche-gris: #93a0b8; --noche-acento: #7fa8ff; }
.sidebar, .topbar { background: var(--noche); color: var(--noche-texto); border-color: var(--noche-borde); }
.marca { color: #fff; }
.marca .check { stroke: #fff; }
.empresa { background: var(--noche-2); border-color: var(--noche-borde); color: var(--noche-texto); }
.empresa:hover { background: var(--noche-3); }
.empresa span, .empresa svg { color: var(--noche-gris); }
.empresa b { color: #fff; }
.group-label { color: #8a97b0; }
.nav-item { color: var(--noche-gris); }
.nav-item:hover { background: var(--noche-2); color: #fff; }
.nav-item[aria-current="page"] { background: var(--noche-3); color: #fff; }
.nav-item[aria-current="page"] svg { color: var(--noche-acento); }
.nav-item .cuenta { color: #9aa7bf; }
.nav-item .alerta { background: #2f6fea; }
.plan { background: var(--noche-2); color: var(--noche-texto); }
.plan p { color: var(--noche-gris); }
.plan .track { background: var(--noche-3); }
.plan .track i { background: var(--noche-acento); }
.usuario b { color: #fff; }
.usuario span { color: var(--noche-gris); }
.icon-btn:hover { background: var(--noche-2); }
.canvas .icon-btn:hover { background: var(--raised); }
.topbar b { color: #fff; }

/* marca Leads Pro */
.nombre-marca { font-weight: 700; letter-spacing: -0.02em; }
.nombre-marca em { font-style: normal; color: var(--noche-acento); margin-left: 3px; }

/* equipo: alta de personas */
.form-equipo { display: grid; gap: 14px; }
.form-equipo > label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.form-equipo .input { height: 38px; width: 100%; }
.roles { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.roles legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; padding: 0; }
.rol { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-control); cursor: pointer; font-size: 13px; color: var(--muted); line-height: 18px; transition: border-color var(--t-hover) ease, background-color var(--t-hover) ease; }
.rol b { display: block; color: var(--text); font-size: 14px; font-weight: 600; }
.rol input { accent-color: var(--accent); margin: 2px 0 0; }
.rol:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rol:has(input:checked) b { color: var(--accent-ink); }
.cupo { font-size: 12px; color: var(--muted); }
#tabla-equipo td { white-space: nowrap; }

/* franja de «Entrar como» (soporte) */
.franja-soporte { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: #fff3d6; color: #6b3a07; border-bottom: 1px solid #f1d89a; font-size: 13px; }
.franja-soporte[hidden] { display: none; }
.franja-soporte svg { width: 18px; height: 18px; flex: none; }
.franja-soporte p { flex: 1; }
.franja-soporte b { font-weight: 700; }
.franja-soporte .btn { background: #fff; border-color: #e3c477; color: #6b3a07; }
body.soporte .sidebar { top: 45px; height: calc(100svh - 45px); }
@media (max-width: 860px) { .franja-soporte { padding: 10px 16px; flex-wrap: wrap; } body.soporte .topbar { top: 0; } }
.usuario { position: relative; }
.salir-sesion { margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--noche-gris); transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.salir-sesion:hover { background: var(--noche-2); color: #fff; }
.salir-sesion svg { width: 18px; height: 18px; }

/* ---------- ventanas (diálogos) ---------- */
.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100svh - 48px); padding: 0; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(15, 23, 41, .22); }
.modal::backdrop { background: rgba(11, 19, 36, .45); }
.modal form { display: flex; flex-direction: column; max-height: calc(100svh - 48px); }
.modal-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 4px; }
.modal-cab h2 { font-size: 19px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.modal-cab p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.modal-cuerpo { padding: 16px 24px 8px; overflow: auto; display: grid; gap: 14px; align-content: start; }
.modal-pie { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; border-top: 1px solid var(--rule); margin-top: 8px; }
.modal-pie .izq { margin-right: auto; }
.campo { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.campo .input, .campo select, .campo textarea { width: 100%; height: 38px; font-weight: 400; font-size: 14px; }
.campo textarea { height: 80px; padding: 10px 12px; }
.campo .ayuda-campo { font-weight: 400; color: var(--muted); font-size: 12px; }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tres-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.opciones-radio { display: grid; gap: 8px; }
.opciones-radio label { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-control); cursor: pointer; font-size: 14px; font-weight: 500; transition: border-color var(--t-hover) ease, background-color var(--t-hover) ease; }
.opciones-radio label span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.opciones-radio input { accent-color: var(--accent); margin: 3px 0 0; }
.opciones-radio label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.marcar { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 500; }
.marcar input { accent-color: var(--accent); margin: 0; }
.sub-bloque[hidden] { display: none; }
.cuadro-info { padding: 12px 14px; border-radius: var(--radius-control); background: var(--raised); font-size: 13px; line-height: 19px; color: var(--muted); }
.cuadro-info b { color: var(--text); font-weight: 600; }
.vista-previa { padding: 12px 14px; border-radius: 10px; background: #e7f6ec; color: #133a24; font-size: 13px; line-height: 19px; white-space: pre-line; }
.tabla-previa { width: 100%; border-collapse: collapse; font-size: 12px; }
.tabla-previa th, .tabla-previa td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.dispo { font-size: 12px; color: var(--muted); font-weight: 400; }

/* aviso flotante */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 10px; background: var(--noche); color: #fff; font-weight: 500; box-shadow: 0 12px 32px rgba(11, 19, 36, .25); }
.toast[hidden] { display: none; }
.toast svg { width: 18px; height: 18px; color: #7fe0a4; flex: none; }

/* avisos de la cuenta */
.banner { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 12px 16px; border-radius: var(--radius-card); font-size: 14px; }
.banner p { flex: 1; } .banner b { font-weight: 600; }
.banner.info { background: var(--accent-soft); color: var(--accent-ink); }
.banner.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.banner.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
body.solo-lectura .canvas [data-accion]:not([data-accion^="exportar"]):not([data-accion="pdf"]), body.solo-lectura .chip, body.solo-lectura #siguiente-lead, body.solo-lectura #form-equipo button { opacity: .45; pointer-events: none; }
.bloqueo { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(11, 19, 36, .72); }
.bloqueo[hidden] { display: none; }
.bloqueo-caja { width: min(480px, 100%); padding: 28px; border-radius: 12px; background: var(--surface); }
.bloqueo-caja h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.bloqueo-caja p { color: var(--muted); margin-top: 8px; line-height: 1.55; }

/* tablas: pie y estado vacío */
.pie-tabla { padding: 10px 12px 8px; font-size: 12px; color: var(--muted); }
.vacio-bloque { display: grid; justify-items: start; gap: 10px; padding: 32px; border: 1px dashed var(--control); border-radius: var(--radius-card); background: var(--surface); }
.vacio-bloque h2 { font-size: 17px; font-weight: 700; }
.vacio-bloque p { color: var(--muted); max-width: 52ch; line-height: 1.55; }
.pasos-inicio { display: grid; gap: 0; }
.pasos-inicio li { list-style: none; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 0; }
.pasos-inicio li + li { border-top: 1px solid var(--rule); }
.pasos-inicio .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.pasos-inicio li.hecho .n { background: var(--pill-positive-bg); color: var(--positive); }
.pasos-inicio b { display: block; font-weight: 600; }
.pasos-inicio span.s { color: var(--muted); font-size: 13px; }

/* tarjetas de cita del vendedor */
.tarjetas-cita { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); }
.tarjeta-cita { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.tarjeta-cita .arriba { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tarjeta-cita .hora-grande { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.tarjeta-cita h3 { font-size: 17px; font-weight: 700; }
.tarjeta-cita .dir { color: var(--muted); line-height: 1.5; }
.tarjeta-cita .nota { font-size: 13px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--raised); }
.tarjeta-cita .botones { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tarjeta-cita .botones .btn { width: 100%; }
.tarjeta-cita .btn.primary.ancho { width: 100%; height: 42px; }
.nota-plan { margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
a.plan { display: block; color: inherit; transition: background-color var(--t-hover) ease; }
a.plan:hover { background: var(--noche-3); }
.lista-citas .pill { margin-left: 6px; }

@media (max-width: 860px) {
  .dos-col, .tres-col { grid-template-columns: 1fr; }
  .modal { width: 100vw; max-width: 100vw; max-height: 100svh; height: 100svh; border-radius: 0; margin: 0; }
  .modal form { max-height: 100svh; height: 100%; }
  .modal-cuerpo { flex: 1; }
  .tarjetas-cita { grid-template-columns: 1fr; }
}

/* imprimir / guardar como PDF */
@media print {
  .sidebar, .topbar, .franja-soporte, #banner-cuenta, .title-row .acciones, .toast, .modal { display: none !important; }
  .app { display: block; }
  .canvas { padding: 0; }
  body { background: #fff; }
  .panel, .kpis { break-inside: avoid; border-color: #ccc; }
  .vista[hidden] { display: none !important; }
}

.fila-boton { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; border-radius: 0; }
.fila-boton:hover b, a.row:hover b { color: var(--accent-ink); }
a.row { color: inherit; }
p.vacio { color: var(--muted); font-size: 13px; padding: 8px 0; }

.error-form { margin: 0; padding: 10px 12px; border-radius: 8px; background: #ffedea; color: #831c1e; font-size: 13px; font-weight: 500; }

body.cargando .app, body.cargando .topbar, body.cargando .franja-soporte { visibility: hidden; }
