/* ═══════════════════════════════════════════════════════════════════════
   Blink CRM · sistema de diseño
   Neutro por defecto (marca blanca): cada cuenta cambia --accent, --font-display,
   --font-body y el logo desde Ajustes → Marca. El fondo se tiñe sutilmente con su color.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  /* Marca (las sobrescribe applyBrand) */
  --accent: #1C1C21;
  --accent-ink: #FFFFFF;
  --font-display: 'Urbanist', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Manrope', ui-sans-serif, system-ui, sans-serif;

  /* Neutros */
  --bg: #F2F2F4;
  --surface: #FFFFFF;
  --surface-2: #F7F7F9;
  --surface-3: #EEEEF1;
  --border: rgba(20, 20, 30, 0.07);
  --border-strong: rgba(20, 20, 30, 0.13);
  --text: #141418;
  --text-2: #3A3A42;
  --muted: #71717B;
  --faint: #A3A3AD;

  /* Derivados del acento */
  --accent-soft: color-mix(in srgb, var(--accent) 9%, white);
  --accent-line: color-mix(in srgb, var(--accent) 28%, transparent);
  --ring: color-mix(in srgb, var(--accent) 22%, transparent);

  /* Semánticos */
  --success: #15803D; --success-bg: #E7F6EC;
  --danger: #D92D35;  --danger-bg: #FDECEC;
  --warn: #B45309;    --warn-bg: #FEF3E2;
  --info: #2563EB;    --info-bg: #E8F0FE;

  /* Forma */
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 16, 24, 0.05);
  --shadow: 0 1px 2px rgba(16, 16, 24, 0.04), 0 10px 30px -12px rgba(16, 16, 24, 0.10);
  --shadow-lg: 0 2px 6px rgba(16, 16, 24, 0.04), 0 30px 70px -20px rgba(16, 16, 24, 0.25);
  --sidebar: 260px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { color: var(--text); font: 400 14px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; background: var(--bg); }
/* Lienzo: degradado muy suave teñido con el color de marca + grano */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 65%),
    radial-gradient(800px 700px at 105% 15%, color-mix(in srgb, var(--accent) 5%, #FFFFFF 40%), transparent 60%),
    radial-gradient(1000px 700px at 50% 120%, #E9E9EE, transparent 70%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app { position: relative; z-index: 1; height: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
.num, .kpi .v, .grid td.num { font-variant-numeric: tabular-nums; }

/* ── Arranque y animaciones ───────────────────────────── */
.boot { min-height: 160px; height: 100%; display: grid; place-items: center; }
.boot-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.55); opacity: .4; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
@keyframes slide { from { opacity: 0; transform: translateX(28px); } }

/* ── Estructura ───────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100%; padding: 12px; gap: 12px; }
.sidebar {
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .85); box-shadow: var(--shadow);
  border-radius: var(--radius-lg); display: flex; flex-direction: column; padding: 14px 12px; gap: 2px; overflow-y: auto; min-height: 0;
}
.workspace { display: flex; align-items: center; gap: 11px; padding: 8px; margin-bottom: 8px; border-radius: 14px; text-decoration: none; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.workspace img { height: 30px; max-width: 150px; object-fit: contain; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 15px/1 var(--font-display); flex: none; letter-spacing: -.02em; }
.workspace .ws-text { min-width: 0; line-height: 1.25; }
.workspace .ws-text b { display: block; font: 700 15px/1.2 var(--font-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace .ws-text span { font-size: 12px; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font: 700 20px/1 var(--font-display); letter-spacing: -.02em; }
.nav-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); padding: 16px 12px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13.5px; transition: background .18s, color .18s;
}
.nav-item:hover { background: rgba(20, 20, 30, .045); color: var(--text); }
.nav-item.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav-item.active svg, .nav-item:hover svg { color: var(--text); }
.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--danger); color: #fff; border-radius: 99px; padding: 1px 7px; }
.nav-sub { padding: 6px 12px 6px 41px; font-size: 13px; color: var(--muted); font-weight: 600; }
.nav-sub::after { content: ''; position: absolute; left: 21px; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.nav-sub.active::before { display: none; }
.nav-item.faint { color: var(--faint); cursor: default; }
.nav-item.faint:hover { background: none; color: var(--faint); }
.nav-item.faint svg { color: var(--faint); }
.nav-item .soon { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--muted); background: var(--surface-3); padding: 2px 7px; border-radius: 99px; }
.nav-group { display: grid; gap: 2px; }
.nav-group + .nav-group, .nav-item + .nav-group, .nav-group + .nav-block { margin-top: 4px; }
.nav-group-head { list-style: none; cursor: pointer; user-select: none; color: var(--text); }
.nav-group-head::-webkit-details-marker { display: none; }
.nav-group-head svg { color: var(--text-2); }
.nav-group-head .nav-chev { margin-left: auto; display: flex; transition: transform .2s ease; transform: rotate(180deg); }
.nav-group-head .nav-chev svg { width: 14px; height: 14px; color: var(--faint); }
.nav-group[open] > .nav-group-head .nav-chev { transform: rotate(0deg); }
.nav-group-body { display: grid; gap: 2px; position: relative; padding-left: 14px; }
.nav-group-body::before { content: ''; position: absolute; left: 21px; top: 2px; bottom: 6px; width: 1px; background: var(--border-strong); }
.nav-group-body .nav-item { font-size: 13.5px; }
.nav-group-body .nav-item.active::before { left: -26px; }
.nav-block { color: var(--text); }
.nav-block svg { color: var(--text-2); }
.sidebar-foot { margin-top: auto; padding-top: 10px; display: grid; gap: 4px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--surface-3), #fff); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; border: 1px solid var(--border-strong); color: var(--text-2); }
.user-card .who { min-width: 0; flex: 1; line-height: 1.25; }
.user-card .who b { display: block; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .who span { font-size: 12px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.appbar { display: flex; align-items: center; gap: 10px; padding: 0 2px 12px; }
.appbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all .18s; text-decoration: none; box-shadow: var(--shadow-sm); flex: none; }
.notif { position: relative; }
.notif-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 340px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; animation: pop .2s var(--ease); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; }
.notif-sub { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3, var(--text-2)); padding: 10px 8px 4px; }
.notif-row { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; border-radius: 10px; border: 0; background: none; text-align: left; color: var(--text); text-decoration: none; cursor: pointer; font: inherit; }
.notif-row:hover { background: var(--surface-2); }
.notif-row > span:last-child { display: grid; min-width: 0; }
.notif-row b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.notif-ico svg { width: 16px; height: 16px; }
.notif-ico.late { background: var(--danger-bg, #FDECEC); color: var(--danger, #B42318); }
.notif-empty { display: flex; gap: 8px; align-items: center; padding: 14px 8px; color: var(--text-2); }
.notif-empty svg { width: 16px; height: 16px; }
.notif-more { display: block; text-align: center; padding: 8px; font-size: 13px; color: var(--text-2); }
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.gsearch { position: relative; width: min(440px, 100%); }
.gsearch > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.gsearch .input { padding-left: 40px; padding-right: 46px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .85); box-shadow: var(--shadow-sm); border-color: var(--border); }
.gsearch kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 700 11px/1 var(--font-body); color: var(--faint); border: 1px solid var(--border-strong); border-radius: 6px; padding: 3px 6px; background: var(--surface); }
.gsearch .results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 380px; overflow: auto; animation: pop .2s var(--ease); }
.gsearch .res { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.gsearch .res:hover, .gsearch .res.sel { background: var(--surface-2); }
.gsearch .res .txt { min-width: 0; flex: 1; }
.gsearch .res b { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch .res span { font-size: 12px; color: var(--muted); }
.gsearch .none { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
#view { display: flex; flex-direction: column; flex: 1; min-height: 0; background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.topbar { display: flex; align-items: flex-end; gap: 12px; padding: 28px 30px 18px; flex-wrap: wrap; }
.page-title { font: 400 34px/1.1 var(--font-display); letter-spacing: -.028em; margin: 0; color: var(--text); }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.topbar .spacer { flex: 1; }
.content { flex: 1; overflow: auto; padding: 0 30px 30px; }
.content > * { animation: rise .5s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .06s; }
.content > *:nth-child(3) { animation-delay: .12s; }
.mobile-bar { display: none; }

/* ── Controles ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 700; font-size: 13px; white-space: nowrap; text-decoration: none;
  transition: transform .15s var(--ease), background .15s, border-color .15s, box-shadow .15s, filter .15s;
}
.btn:hover { border-color: rgba(20, 20, 30, .22); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 1px 2px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.14); }
.btn-primary:hover { background: var(--accent); border-color: transparent; filter: brightness(1.12); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: rgba(20, 20, 30, .05); color: var(--text); border-color: transparent; box-shadow: none; }
.btn-danger { color: var(--danger) !important; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.input, select.input, textarea.input {
  width: 100%; height: 40px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 13px; outline: none; transition: border-color .15s, box-shadow .15s; color: var(--text);
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; min-height: 90px; line-height: 1.55; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: rgba(20, 20, 30, .22); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
select.input { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2371717B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
select.input.input-sm { padding-right: 28px; background-position: right 9px center; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=color] { cursor: pointer; }
.search { position: relative; min-width: 240px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--faint); }
.search .input { padding-left: 36px; }
label.field { display: grid; gap: 7px; font-size: 13px; color: var(--text-2); font-weight: 600; }
label.field > span, .field > span { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* Chips y estados */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; text-decoration: none;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip svg { width: 13px; height: 13px; }
.chip-btn { cursor: pointer; transition: all .15s; }
.chip-btn:hover { border-color: var(--border-strong); color: var(--text); }
.chip-btn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.temp-templado { background: #FEF7DA; color: #A16207; border-color: transparent; }
.temp-caliente { background: #FFEBDD; color: #C2410C; border-color: transparent; }
.temp-casi_cierre { background: #FDE6EC; color: #BE123C; border-color: transparent; }
/* Filtros: apagados en blanco (con un punto de su color); encendidos, rellenos, con borde y ✓. Imposible confundirlos. */
.chip-btn { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.chip-btn.temp-templado { --tc: #E0A100; --tbg: #FDECB0; --tink: #6B4300; }
.chip-btn.temp-caliente { --tc: #EA580C; --tbg: #FED7BF; --tink: #7C2D12; }
.chip-btn.temp-casi_cierre { --tc: #E11D48; --tbg: #FCCFDA; --tink: #881337; }
.chip-btn[class*="temp-"] { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.chip-btn[class*="temp-"]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tc); flex: none; transition: all .15s; }
.chip-btn[class*="temp-"]:hover { border-color: var(--tc); color: var(--text); }
.chip-btn.on, .chip-btn[class*="temp-"].on { font-weight: 800; }
.chip-btn.on:not([class*="temp-"]) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 4px 12px -6px var(--accent); }
.chip-btn[class*="temp-"].on { background: var(--tbg); color: var(--tink); border-color: var(--tc); box-shadow: inset 0 0 0 1px var(--tc), 0 4px 12px -6px var(--tc); }
.chip-btn[class*="temp-"].on::before { width: 13px; height: 13px; border-radius: 0; background: var(--tink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
.filter-clear { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 4px 8px; border-radius: 99px; }
.filter-clear:hover { color: var(--danger); background: var(--danger-bg); }
.filter-clear svg { width: 13px; height: 13px; }
.page-sub b.filtering { color: var(--text); }
.overdue { color: var(--danger) !important; }
.delta { display: inline-flex; align-items: center; gap: 4px; height: 23px; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 800; }
.delta svg { width: 13px; height: 13px; }
.delta.up { background: var(--success-bg); color: var(--success); }
.delta.down { background: var(--danger-bg); color: var(--danger); }
.delta.flat { background: var(--surface-3); color: var(--muted); }

/* Colores de etapa: texto + fondo pastel */
[data-color="gray"]   { --c: #6B6B75; --cbg: #F0F0F3; }
[data-color="yellow"] { --c: #A16207; --cbg: #FEF6D6; }
[data-color="orange"] { --c: #C2410C; --cbg: #FFEDDF; }
[data-color="red"]    { --c: #C0262D; --cbg: #FDE8E8; }
[data-color="pink"]   { --c: #BE185D; --cbg: #FCE7F1; }
[data-color="purple"] { --c: #6D28D9; --cbg: #F1EBFE; }
[data-color="blue"]   { --c: #1D5FD1; --cbg: #E6EFFE; }
[data-color="teal"]   { --c: #0F766E; --cbg: #DDF5F1; }
[data-color="green"]  { --c: #15803D; --cbg: #E3F5E8; }
.stage-chip { background: var(--cbg, var(--surface-2)); color: var(--c, var(--text-2)); border-color: transparent; }
.stage-chip .label { color: inherit; }

/* Pestañas en cápsula (Virex) */
.pills { display: inline-flex; gap: 2px; padding: 4px; background: rgba(20, 20, 30, .05); border-radius: 13px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills a, .pills button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--muted); text-decoration: none; cursor: pointer; white-space: nowrap; transition: all .18s var(--ease); }
.pills a:hover, .pills button:hover { color: var(--text); }
.pills .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

/* ── Tarjetas y paneles ───────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { padding: 18px 20px 8px; display: flex; align-items: center; gap: 10px; }
.panel-head h3 { margin: 0; font: 600 17px/1.3 var(--font-display); letter-spacing: -.01em; }
.panel-head .n { margin-left: auto; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.panel-head > svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.panel-body { padding: 8px 12px 12px; }

/* KPI (Ordify + Virex) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; overflow: hidden; }
.kpi .l { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kpi .l svg { width: 15px; height: 15px; }
.kpi .v { font: 300 40px/1.05 var(--font-display); letter-spacing: -.035em; margin: 12px 0 10px; color: var(--text); }
.kpi .s { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi.key { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent)); border-color: transparent; }
.kpi.key .v, .kpi.key .l, .kpi.key .s, .kpi.key .l svg { color: var(--accent-ink); }
.kpi.key .s { opacity: .78; }
.kpi.key::after { content: ''; position: absolute; right: -50px; top: -50px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.2), transparent 70%); }
.kpi.key .delta { background: rgba(255,255,255,.16); color: var(--accent-ink); }

/* ── Tablero (pipeline) ───────────────────────────────── */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 30px 16px; }
.board { display: flex; gap: 12px; height: 100%; padding: 2px 2px 10px; align-items: stretch; overflow-x: auto; scroll-snap-type: x proximity; }
.board::-webkit-scrollbar { height: 10px; }
.board::-webkit-scrollbar-thumb { background: rgba(20, 20, 30, .14); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.board::-webkit-scrollbar-track { background: transparent; }
.col {
  flex: 0 0 272px; width: 272px; min-width: 0; display: flex; flex-direction: column; min-height: 0; max-height: 100%; scroll-snap-align: start;
  background: rgba(20, 20, 30, .03); border: 1px solid rgba(20, 20, 30, .045); border-radius: 18px; position: relative;
  transition: background .18s, box-shadow .18s, border-color .18s;
}
.col.drop { background: color-mix(in srgb, var(--c, var(--accent)) 8%, transparent); border-color: color-mix(in srgb, var(--c, var(--accent)) 35%, transparent); }
.col-head { display: flex; align-items: center; gap: 7px; padding: 14px 10px 8px 14px; min-height: 46px; }
.col-head .dot, .col-fold .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.col-head b { font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.col-head .n { font-size: 11.5px; font-weight: 800; color: var(--c, var(--muted)); background: var(--cbg, var(--surface-3)); padding: 1px 7px; border-radius: 99px; flex: none; font-variant-numeric: tabular-nums; }
.col-head .sum { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-btn { width: 26px; height: 26px; border: 0; background: none; border-radius: 8px; color: var(--faint); display: grid; place-items: center; cursor: pointer; flex: none; opacity: 0; transition: opacity .15s, background .15s; }
.col-head:hover .col-btn, .col-btn:focus-visible { opacity: 1; }
.col-btn:hover { background: rgba(20, 20, 30, .06); color: var(--text); }
.col-btn svg { width: 15px; height: 15px; }
.col-body { padding: 2px 8px 10px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; min-height: 40px; flex: 1; scrollbar-width: thin; }
.col-empty { border: 1.5px dashed rgba(20, 20, 30, .1); border-radius: 12px; padding: 14px; text-align: center; font-size: 12px; color: var(--faint); font-weight: 600; }
.col-add { display: flex; align-items: center; gap: 6px; justify-content: center; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 12.5px; padding: 8px; border-radius: 10px; cursor: pointer; }
.col-add:hover { background: rgba(20, 20, 30, .05); color: var(--text); }
.col-add svg { width: 14px; height: 14px; }
.col-more { border: 0; background: none; font-size: 12px; color: var(--muted); text-align: center; padding: 6px; cursor: pointer; font-weight: 700; border-radius: 10px; }
.col-more:hover { color: var(--text); background: rgba(20, 20, 30, .05); }
/* Columna plegada: tira vertical con nombre y número; también acepta tarjetas */
.col.folded { flex: 0 0 46px; width: 46px; cursor: pointer; }
.col-fold { border: 0; background: none; height: 100%; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0; cursor: pointer; color: var(--text-2); }
.col-fold b { writing-mode: vertical-rl; font-size: 13px; font-weight: 800; white-space: nowrap; letter-spacing: .01em; }
.col-fold .n { font-size: 11.5px; font-weight: 800; color: var(--c); background: var(--cbg); padding: 2px 6px; border-radius: 99px; }
.col.folded:hover { background: rgba(20, 20, 30, .055); }

.card {
  background: var(--surface); border: 1px solid rgba(20, 20, 30, .06); border-radius: 13px; padding: 10px 11px; cursor: grab;
  box-shadow: 0 1px 2px rgba(16, 16, 24, .05); display: flex; flex-direction: column; gap: 7px; min-width: 0;
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -12px rgba(16, 16, 24, .3); border-color: rgba(20, 20, 30, .12); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .35; transform: rotate(1.5deg); }
.card-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.card .avatar { width: 30px; height: 30px; font-size: 11px; font-weight: 800; border: 0; background: hsl(var(--h, 220) 70% 93%); color: hsl(var(--h, 220) 42% 34%); }
.card-who { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.card-who b { font-size: 13.5px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-who b svg.q { width: 13px; height: 13px; color: var(--success); vertical-align: -2px; margin-left: 4px; stroke-width: 2.6; }
.card-who span { font-size: 11.5px; color: var(--faint); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .val { font: 700 14px/1 var(--font-display); letter-spacing: -.01em; flex: none; color: var(--text); }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding-left: 39px; }
.card-tags .chip { height: 21px; font-size: 11px; padding: 0 7px; }
.card .fu { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; font-weight: 700; background: var(--surface-2); border-radius: 99px; padding: 2px 8px 2px 6px; }
.card .fu.overdue { color: var(--danger); background: var(--danger-bg); }
.card .fu svg { width: 12px; height: 12px; }
.card-last { font-size: 11.5px; color: var(--muted); padding-left: 39px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.drop-marker { height: 3px; border-radius: 3px; background: var(--c, var(--accent)); margin: -2px 4px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--accent)) 20%, transparent); }

/* Cabecera del pipeline en una sola línea */
.pl-top { align-items: center; padding-bottom: 14px; }
.pl-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pl-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-tools .search { min-width: 0; width: 190px; }
.pl-content { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 18px; }
.pl-content > .board { flex: 1; min-height: 0; }

/* ── Tablas (Ordify) ──────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; max-height: 100%; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.grid th, .grid td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.grid th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; font-weight: 700; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; cursor: pointer; user-select: none; }
.grid th:hover { color: var(--text); }
.grid th.sorted { color: var(--text); }
.grid tbody tr { cursor: pointer; transition: background .12s; }
.grid tbody tr:hover { background: var(--surface-2); }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid td.name { font-weight: 800; position: sticky; left: 0; background: var(--surface); }
.grid tbody tr:hover td.name { background: var(--surface-2); }
.grid td svg { width: 16px; height: 16px; vertical-align: middle; }
.grid td select.cell-select { height: 28px; border: 0; border-radius: 99px; padding: 0 26px 0 11px; cursor: pointer; font-weight: 700; font-size: 12px; max-width: 180px; appearance: none;
  background: var(--cbg, var(--surface-2)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none' stroke='%2371717B' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m2.5 4 2.5 2.5L7.5 4'/%3E%3C/svg%3E") no-repeat right 9px center; color: var(--c, var(--text-2)); }
.grid td select.cell-select.temp-templado { --cbg: #FEF7DA; --c: #A16207; }
.grid td select.cell-select.temp-caliente { --cbg: #FFEBDD; --c: #C2410C; }
.grid td select.cell-select.temp-casi_cierre { --cbg: #FDE6EC; --c: #BE123C; }
.grid td.num { text-align: right; }
.grid td a { text-decoration: none; }
.grid td a:hover { text-decoration: underline; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; font: 400 24px/1.2 var(--font-display); letter-spacing: -.02em; color: var(--text); margin-bottom: 6px; }

/* ── Hoy ───────────────────────────────────────────────── */
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.task:hover { background: var(--surface-2); }
.task .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); flex: none; color: var(--text-2); }
.task .ico.overdue { background: var(--danger-bg); border-color: transparent; }
.task .ico svg { width: 16px; height: 16px; }
.task .txt { flex: 1; min-width: 0; }
.task .txt b { display: block; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .txt span { font-size: 12.5px; color: var(--muted); }
.task .acts { display: flex; gap: 2px; }

/* ── Panel de métricas ─────────────────────────────────── */
.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.bars { display: grid; gap: 12px; padding: 12px 20px 20px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 72px; gap: 12px; align-items: center; font-size: 13px; font-weight: 700; }
.bar-row .track { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--c, var(--accent)); border-radius: 99px; transition: width .9s var(--ease); }
.bar-row .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.spark { padding: 6px 20px 18px; }
.spark svg { width: 100%; height: 210px; display: block; overflow: visible; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

/* ── Ficha (drawer) ───────────────────────────────────── */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(18, 18, 26, .28); backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15); z-index: 40; animation: fade .25s ease; }
/* La ficha se abre centrada sobre el fondo desenfocado */
.drawer {
  position: fixed; inset: 0; margin: auto; z-index: 41; width: min(780px, calc(100vw - 48px)); height: min(880px, calc(100vh - 48px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 2px 8px rgba(16, 16, 24, .06), 0 40px 100px -30px rgba(16, 16, 24, .45);
  animation: card-in .38s var(--ease);
}
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.975); } }
.drawer-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.drawer-head .top { display: flex; align-items: flex-start; gap: 10px; }
.drawer-head .name-input { font: 400 30px/1.15 var(--font-display); letter-spacing: -.028em; background: transparent; border: 0; outline: 0; padding: 0; flex: 1; min-width: 0; color: var(--text); }
.drawer-head .name-input:focus { box-shadow: 0 2px 0 var(--accent); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px 40px; display: grid; gap: 24px; align-content: start; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.deal-bar { display: grid; grid-template-columns: 1.4fr 1fr .8fr; gap: 8px; margin-top: 14px; }
.section-t { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.next-step { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.next-step.due { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-bg); }
.logger { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: grid; gap: 10px; }
.logger textarea.input { background: var(--surface); }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; padding: 3px; background: rgba(20,20,30,.05); border-radius: 11px; width: fit-content; max-width: 100%; }
.tab { padding: 6px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 12.5px; border: 0; background: none; display: inline-flex; gap: 6px; align-items: center; }
.tab svg { width: 14px; height: 14px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.timeline { position: relative; display: grid; gap: 2px; }
.timeline::before { content: ''; position: absolute; left: 16px; top: 10px; bottom: 10px; width: 1px; background: var(--border-strong); }
.tl { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 8px 0; position: relative; }
.tl .ico { width: 33px; height: 33px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border-strong); display: grid; place-items: center; z-index: 1; color: var(--text-2); }
.tl .ico svg { width: 15px; height: 15px; }
.tl[data-type="stage"] .ico { background: var(--info-bg); color: var(--info); border-color: transparent; }
.tl[data-type="form"] .ico { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.tl[data-type="call"] .ico { background: #FFEDDF; color: #C2410C; border-color: transparent; }
.tl[data-type="whatsapp"] .ico { background: #E3F5E8; color: #15803D; border-color: transparent; }
.tl[data-type="email"] .ico, .tl[data-type="email_open"] .ico, .tl[data-type="email_click"] .ico { background: #F1EBFE; color: #6D28D9; border-color: transparent; }
.tl[data-type="meeting"] .ico { background: #DDF5F1; color: #0F766E; border-color: transparent; }
.tl[data-type="automation"] .ico { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tl[data-type="unsubscribe"] .ico { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.tl .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl .head b { font-weight: 800; font-size: 13.5px; }
.tl .head time { font-size: 12px; color: var(--muted); }
.tl .body { white-space: pre-wrap; color: var(--text-2); font-size: 13.5px; margin-top: 3px; word-break: break-word; }
.tl .tools { opacity: 0; transition: opacity .15s; margin-left: auto; display: flex; gap: 2px; }
.tl:hover .tools { opacity: 1; }
.props { display: grid; grid-template-columns: 160px 1fr; gap: 2px 12px; align-items: center; }
.props .k { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.props .input { background: transparent; border-color: transparent; height: 34px; padding: 0 9px; }
.props .input:hover { background: var(--surface-2); }
.props .input:focus { background: var(--surface); border-color: var(--accent); }
.props textarea.input { height: auto; padding: 7px 9px; min-height: 60px; }

/* ── Modal, toast, login ──────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 20, 30, .25); backdrop-filter: blur(3px); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal { width: min(540px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px; animation: pop .3s var(--ease); max-height: 100%; overflow: auto; }
.modal h2 { font: 400 26px/1.2 var(--font-display); letter-spacing: -.022em; margin: 0 0 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); font-weight: 700; font-size: 13px; display: flex; gap: 9px; align-items: center; }
.toast.err { background: var(--danger); }
.toast.ok::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; }

.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); animation: rise .6s var(--ease); }
.auth-card .brand { justify-content: center; margin-bottom: 18px; }
.auth-card .brand img { height: 40px; }
.auth-card h1 { font: 300 46px/1.05 var(--font-display); letter-spacing: -.04em; text-align: center; margin: 0 0 10px; }
.auth-card h1 em { font-style: normal; font-weight: 700; }
.auth-card p.lead { text-align: center; color: var(--muted); margin: 0 0 26px; }
.auth-card form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-lg); }
.auth-card .err { color: var(--danger); font-size: 13px; min-height: 18px; font-weight: 600; }
.auth-card .btn { height: 44px; }

/* ── Ajustes ───────────────────────────────────────────── */
.settings { display: grid; gap: 16px; max-width: 980px; }
.settings .panel-body { padding: 12px 20px 20px; }
.stage-row, .field-row { display: grid; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stage-row { grid-template-columns: 1fr 140px 150px auto; }
.field-row { grid-template-columns: 1fr 150px 1fr auto; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #16161B; border-radius: var(--radius-sm); padding: 14px; overflow: auto; white-space: pre; color: #E4E4E7; }
.keybox { font-family: ui-monospace, Menlo, monospace; background: var(--warn-bg); border: 1px dashed var(--warn); padding: 11px 13px; border-radius: var(--radius-sm); word-break: break-all; }
.log { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); max-height: 160px; overflow: auto; white-space: pre-wrap; }
.brand-preview { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; }
.brand-preview .sample { font: 400 28px/1 var(--font-display); letter-spacing: -.025em; }

/* ── Email: editor ─────────────────────────────────────── */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.preview-col { position: sticky; top: 0; }
.preview-col iframe { width: 100%; height: calc(100vh - 230px); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; }
.help { line-height: 1.75; }
.title-input { font: 400 34px/1.1 var(--font-display); letter-spacing: -.028em; background: transparent; border: 0; outline: 0; color: var(--text); width: 100%; padding: 0; }
.title-input:focus { box-shadow: 0 2px 0 var(--accent); }

/* ── Automatizaciones ─────────────────────────────────── */
.auto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.auto-card { display: grid; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-decoration: none; box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s; }
.auto-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.auto-card h3 { margin: 0; font: 500 21px/1.25 var(--font-display); letter-spacing: -.015em; }
.auto-card svg { width: 14px; height: 14px; vertical-align: -2px; }
.auto-stats { display: flex; gap: 22px; margin-top: 4px; }
.auto-stats div { display: grid; }
.auto-stats b { font: 300 30px/1 var(--font-display); letter-spacing: -.025em; }
.auto-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; margin-top: 4px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.s-active { background: var(--success-bg); color: var(--success); }
.status-pill.s-paused { background: var(--warn-bg); color: var(--warn); }
.recipe { display: flex; gap: 14px; align-items: flex-start; text-align: left; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 15px; cursor: pointer; transition: all .18s var(--ease); }
.recipe:hover { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.recipe svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.recipe b { display: block; font-weight: 800; }
.recipe small { color: var(--muted); font-size: 13px; }

.flow-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.flow { display: flex; flex-direction: column; align-items: center; padding: 16px 0 40px; background-image: radial-gradient(rgba(20,20,30,.12) 1px, transparent 1px); background-size: 18px 18px; border-radius: var(--radius); }
.node { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.node-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.node-head b { font-weight: 800; }
.node-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.node-ico svg { width: 16px; height: 16px; }
.node-num { font: 600 15px/1 var(--font-display); color: var(--faint); width: 16px; text-align: center; }
.node-tools { margin-left: auto; display: flex; gap: 2px; opacity: .45; transition: opacity .15s; }
.node:hover .node-tools { opacity: 1; }
.node-body { padding: 12px 14px; display: grid; gap: 8px; }
.node-body a { color: var(--text); font-weight: 700; }
.node-stats { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 700; }
.node-stats span:nth-child(2) { color: var(--success); }
.node-trigger { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.node-trigger .node-ico { background: var(--accent); color: var(--accent-ink); }
.node-email .node-ico { background: #F1EBFE; color: #6D28D9; }
.node-wait .node-ico { background: #FEF6D6; color: #A16207; }
.node-condition .node-ico { background: #E6EFFE; color: #1D5FD1; }
.node-stage .node-ico { background: #DDF5F1; color: #0F766E; }
.node-followup .node-ico { background: #FFEDDF; color: #C2410C; }
.node-end { width: auto; padding: 9px 18px; border-radius: 99px; color: var(--muted); display: flex; gap: 8px; align-items: center; font-weight: 700; }
.node-end svg { width: 16px; height: 16px; }
.flow-line { position: relative; height: 46px; width: 2px; background: repeating-linear-gradient(to bottom, var(--border-strong) 0 5px, transparent 5px 9px); display: grid; place-items: center; }
.flow-add { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: all .18s var(--ease); padding: 0; box-shadow: var(--shadow-sm); }
.flow-add svg { width: 14px; height: 14px; }
.flow-add:hover { background: var(--accent); color: var(--accent-ink); border-color: transparent; transform: scale(1.15); }
.add-menu { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-lg); display: grid; min-width: 240px; animation: pop .2s var(--ease); }
.add-menu button { display: flex; gap: 10px; align-items: center; background: none; border: 0; padding: 9px 10px; border-radius: 9px; cursor: pointer; text-align: left; font-weight: 700; }
.add-menu button:hover:not([disabled]) { background: var(--surface-2); }
.add-menu button[disabled] { opacity: .45; cursor: default; }
.add-menu svg { width: 16px; height: 16px; }
.flow-side { display: grid; gap: 16px; position: sticky; top: 0; }
.run-row { display: grid; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.run-row:hover { background: var(--surface-2); }

/* ── Ficha: email y automatizaciones ──────────────────── */
.mini-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.mini-row:last-child { border-bottom: 0; }
.mini-row a { font-weight: 700; text-decoration: none; }
.mail-flags { display: inline-flex; gap: 8px; margin-left: 6px; font-weight: 700; }
.dns-row { display: grid; grid-template-columns: 90px 1fr; gap: 10px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.warn-box { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 9px 12px; display: grid; gap: 3px; font-weight: 600; }
.ok-dot { color: var(--success); font-weight: 700; } .bad-dot { color: var(--danger); font-weight: 700; } .warn-dot { color: var(--warn); font-weight: 700; }
.ses-box { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-top: 12px; background: var(--surface-2); }
.ses-box .log { margin-top: 8px; color: var(--success); }
.dom { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
table.dns { margin-top: 8px; font-size: 12px; background: var(--surface); border-radius: var(--radius-sm); }
table.dns td, table.dns th { white-space: normal; word-break: break-all; max-width: none; padding: 9px 10px; }
code.copy { cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; font-size: 11.5px; }
code.copy:hover { border-color: var(--accent); }
.paused-banner { background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); border-radius: var(--radius-sm); padding: 11px 14px; display: flex; gap: 10px; align-items: center; font-weight: 700; }
.mini-row svg, .small svg { width: 14px; height: 14px; flex: none; }

/* ── Móvil ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .sidebar { position: fixed; inset: 8px auto 8px 8px; width: min(290px, 86vw); z-index: 50; transform: translateX(-110%); transition: transform .35s var(--ease); background: rgba(255,255,255,.97); }
  .shell.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .shell.menu-open .main::after { content: ''; position: fixed; inset: 0; background: rgba(20,20,30,.2); z-index: 45; }
  .appbar { padding: 10px 12px; }
  .appbar .hide-m { display: none; }
  .gsearch { flex: 1; }
  .gsearch kbd { display: none; }
  #view { border-radius: 0; border-left: 0; border-right: 0; }
  .topbar { padding: 18px 16px 12px; }
  .page-title { font-size: 28px; }
  .content { padding: 0 16px 20px; }
  .filters { padding: 0 16px 12px; }
  .search { min-width: 0; flex: 1; }
  .charts { grid-template-columns: 1fr; }
  .grid-2, .deal-bar, .next-step { grid-template-columns: 1fr; }
  .props { grid-template-columns: 1fr; }
  .props .k { margin-top: 8px; }
  .stage-row, .field-row { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 50px; }
  .col { flex-basis: 82vw; }
  .col.folded { flex-basis: 46px; }
  .pl-tools, .pl-tools .search { width: 100%; }
  .pl-filters { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .col-btn { opacity: 1; }
  .flow-layout, .editor-grid { grid-template-columns: 1fr; }
  .flow-side, .preview-col { position: static; }
  .drawer { width: 100vw; height: 100%; border-radius: 0; border: 0; }
  .kpi .v { font-size: 30px; margin: 8px 0 6px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis .kpi.key:first-child { grid-column: span 2; }
  .kpi { padding: 13px 14px; }
  .kpi .s { font-size: 11.5px; }
  .appbar .spacer { display: none; }
  .gsearch .input { padding-right: 12px; }
}
@media (min-width: 961px) { .mobile-only { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.task-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.task-sub .chip { height: 20px; font-size: 11px; padding: 0 7px; }
.task-sub > span:last-child { font-size: 12.5px; color: var(--muted); }

/* ── Reuniones (agenda tipo Calendly / GHL) ───────────────── */
.link-inline { color: var(--text-2); font-weight: 700; text-decoration: none; border-bottom: 1px dashed var(--border-strong); }
.link-inline:hover { color: var(--text); border-color: var(--text); }
#mt-sub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.connect-hero {
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; margin-bottom: 16px; padding: 22px 24px;
  background: linear-gradient(120deg, var(--surface), color-mix(in srgb, var(--accent) 5%, var(--surface))); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); animation: rise .5s var(--ease);
}
.ch-art { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.ch-art svg { width: 26px; height: 26px; }
.ch-plus { color: var(--faint); font-weight: 800; }
.ch-txt h2 { font: 600 20px var(--font-display); margin: 0 0 4px; letter-spacing: -.01em; }
.ch-txt p { margin: 0; color: var(--muted); max-width: 640px; }
.gbtn {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border-radius: 100px; border: 1px solid #DADCE0; background: #fff;
  color: #3C4043; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s;
}
.gbtn:hover:not(:disabled) { background: #F8F9FA; box-shadow: 0 1px 3px rgba(60,64,67,.2); }
.gbtn:disabled { opacity: .5; cursor: not-allowed; }
.gbtn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.ag-head { flex-wrap: wrap; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.ag-head .spacer { flex: 1; }
.wk-label { font: 600 15px var(--font-display); margin-left: 6px; }

/* Semana */
.wk { --h: 52px; padding: 0 12px 12px 0; }
.wk-head { display: grid; grid-template-columns: 56px repeat(7, 1fr); position: sticky; top: 0; z-index: 2; background: var(--surface); }
.wk-day { text-align: center; padding: 10px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wk-day span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.wk-day b { font: 600 20px var(--font-display); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.wk-day.today b { background: var(--accent); color: var(--accent-ink); }
.wk-scroll { max-height: 600px; overflow-y: auto; border-top: 1px solid var(--border); }
.wk-body { display: grid; grid-template-columns: 56px repeat(7, 1fr); position: relative; }
.wk-hours div { position: relative; }
.wk-hours span { position: absolute; top: -8px; right: 10px; font-size: 11px; color: var(--faint); font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-hours div:first-child span { display: none; }
.wk-col { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px); }
.wk-col.today { background-color: color-mix(in srgb, var(--accent) 3%, transparent); }
.wk-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--danger); z-index: 3; }
.wk-now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.wk-ev {
  position: absolute; left: 3px; right: 4px; border: 0; border-left: 3px solid var(--c, var(--accent)); background: var(--cbg, var(--accent-soft)); color: var(--c, var(--text));
  border-radius: 8px; padding: 4px 7px; text-align: left; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 1px; z-index: 1;
  transition: transform .15s var(--ease), box-shadow .15s; font: inherit;
}
.wk-ev:hover { transform: translateY(-1px); box-shadow: var(--shadow); z-index: 2; }
.wk-ev b { font-size: 12.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.wk-ev .wk-t { font-weight: 600; color: var(--c); margin-right: 2px; }
.wk-ev span { font-size: 11.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.wk-ev.s-cancelled { opacity: .55; text-decoration: line-through; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface-3) 6px 12px); border-left-color: var(--faint); }
.wk-ev.s-no_show { border-left-color: var(--danger); }
.wk-ev.s-completed { opacity: .8; }
.wk-empty { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 14px; border-top: 1px solid var(--border); }
.wk-empty svg { width: 16px; height: 16px; }

/* Lista */
.bk-list { padding: 8px 20px 20px; display: grid; gap: 18px; }
.bk-day .section-t { margin-bottom: 8px; }
.bk-row {
  display: grid; grid-template-columns: 4px 74px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 11px 12px 11px 0;
  border-radius: 12px; cursor: pointer; transition: background .15s;
}
.bk-row:hover { background: var(--surface-2); }
.bk-bar { align-self: stretch; border-radius: 4px; background: var(--c, var(--accent)); }
.bk-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.bk-time b { font-size: 15px; }
.bk-time span { font-size: 12px; color: var(--faint); font-weight: 600; }
.bk-who { display: flex; flex-direction: column; min-width: 0; }
.bk-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-who span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-acts { display: flex; gap: 4px; }
.bk-facts { display: grid; gap: 9px; margin: 8px 0 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.bk-facts > div { display: flex; gap: 9px; align-items: flex-start; line-height: 1.45; }
.bk-facts svg { width: 16px; height: 16px; color: var(--muted); margin-top: 2px; flex: none; }
.bk-facts a { color: var(--text); }

/* Tipos de reunión */
.share-card { margin-bottom: 16px; }
.share-main { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; flex-wrap: wrap; }
.share-url { font: 600 17px var(--font-display); color: var(--text); text-decoration: none; }
.share-url:hover { text-decoration: underline; }
.et-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.et-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; font: inherit; text-align: left;
}
.et-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--c, var(--accent)); }
.et-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.et-card.off { opacity: .6; }
.et-card.off::before { background: var(--faint); }
.et-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.et-top b { font: 600 18px/1.25 var(--font-display); letter-spacing: -.01em; }
.et-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.et-meta svg { width: 15px; height: 15px; }
.et-link { font-size: 12.5px; color: var(--faint); text-decoration: none; font-family: ui-monospace, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.et-link:hover { color: var(--text); }
.et-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.et-acts .spacer { flex: 1; }
.et-new { align-items: center; justify-content: center; text-align: center; min-height: 190px; border-style: dashed; border-width: 1.5px; background: transparent; box-shadow: none; cursor: pointer; color: var(--text-2); }
.et-new::before { display: none; }
.et-new svg { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--surface-3); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--surface-3); border: 1px solid var(--border-strong); cursor: pointer; transition: background .2s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.slug-input { width: auto; flex: 1; min-width: 120px; max-width: 260px; font-family: ui-monospace, Menlo, monospace; }
.loc-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.loc-opt { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1.5px solid var(--border-strong); border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 13.5px; transition: border-color .15s, background .15s; }
.loc-opt svg { width: 18px; height: 18px; color: var(--muted); }
.loc-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.loc-opt.on svg { color: var(--text); }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.q-row { display: grid; grid-template-columns: 1fr 150px auto auto; gap: 8px; align-items: center; padding: 10px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); }
.q-row .q-opts { grid-column: 1 / -1; }

/* Disponibilidad */
.avail-layout { display: grid; gap: 16px; max-width: 900px; }
.av-week { display: grid; gap: 4px; }
.av-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.av-row:last-child { border-bottom: 0; }
.av-row.off .av-day b { color: var(--faint); }
.av-day { display: flex; align-items: center; gap: 10px; padding-top: 6px; cursor: pointer; }
.av-ranges { display: flex; flex-direction: column; gap: 6px; }
.av-range { display: flex; align-items: center; gap: 6px; }
.av-range .input { width: 112px; font-variant-numeric: tabular-nums; }
.av-tools { display: flex; gap: 2px; }
.av-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); gap: 12px; }
.conn-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; }
.cal-list { gap: 8px; padding: 4px 0; }
.cal-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Ficha y Hoy */
.mt-row { display: grid; grid-template-columns: 4px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px 9px 0; border-radius: 10px; }
.mt-row .bk-bar { min-height: 34px; }
.mt-row b { display: block; }
.mt-row .small { color: var(--muted); }

@media (max-width: 960px) {
  .connect-hero { grid-template-columns: 1fr; gap: 14px; }
  .ch-art { justify-self: start; }
  .bk-row { grid-template-columns: 4px 60px minmax(0, 1fr) auto; }
  .bk-row .bk-acts { display: none; }
  .bk-list { padding: 4px 12px 16px; }
  .av-row { grid-template-columns: 1fr auto; }
  .av-ranges { grid-column: 1 / -1; grid-row: 2; }
  .loc-opts { grid-template-columns: 1fr; }
  .q-row { grid-template-columns: 1fr auto; }
  .wk-scroll { max-height: 70vh; }
  .wk { overflow-x: auto; }
  .wk-head, .wk-body { min-width: 640px; }
}

/* ── WhatsApp (bandeja tipo GHL, plantillas, bot) ─────────── */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wa-shell { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 210px); min-height: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.wa-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.wa-list-head { padding: 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--border); }
.wa-list-head .search { min-width: 0; }
.wa-filters { width: 100%; }
.wa-filters button { flex: 1; padding: 6px 8px; }
.wa-filters .count { background: var(--danger); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; }
.wa-items { overflow-y: auto; flex: 1; }
.wa-item { display: flex; gap: 11px; padding: 11px 14px; text-decoration: none; border-bottom: 1px solid var(--border); transition: background .12s; align-items: center; }
.wa-item:hover { background: var(--surface-2); }
.wa-item.on { background: var(--accent-soft); }
.wa-item .avatar { width: 40px; height: 40px; flex: none; }
.wa-item-txt { flex: 1; min-width: 0; }
.wa-item .row1, .wa-item .row2 { display: flex; align-items: center; gap: 6px; }
.wa-item .row1 b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.wa-item time { font-size: 11.5px; color: var(--faint); flex: none; }
.wa-item.unread time { color: #1DA851; font-weight: 700; }
.wa-item .pv { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
.wa-item.unread .pv { color: var(--text); font-weight: 600; }
.wa-item .count { background: #25D366; color: #fff; border-radius: 10px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.tag { font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); letter-spacing: .02em; flex: none; }
.tag-red { background: var(--danger-bg); color: var(--danger); }

.wa-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #EFEAE2; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 18px 18px; }
.wa-empty { margin: auto; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 360px; padding: 20px; }
.wa-empty svg { width: 42px; height: 42px; color: #25D366; }
.wa-empty b { color: var(--text); font: 600 18px var(--font-display); }
.wa-chat-head { display: flex; align-items: center; gap: 11px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.wa-chat-head .who { display: flex; flex-direction: column; min-width: 0; }
.wa-chat-head .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat-head .who span { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wa-chat-head .spacer { flex: 1; }
.wa-back { display: none; }
.bot-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); font-weight: 700; }
.wa-banner { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--danger-bg); color: var(--danger); font-size: 13px; border-bottom: 1px solid color-mix(in srgb, var(--danger) 20%, transparent); }
.wa-banner svg { width: 16px; height: 16px; flex: none; }
.wa-banner span { flex: 1; }
.wa-banner.gray { background: var(--surface-2); color: var(--muted); }
.wa-msgs { flex: 1; overflow-y: auto; padding: 16px 6% 10px; display: flex; flex-direction: column; gap: 4px; }
.wa-day { text-align: center; margin: 10px 0; }
.wa-day span { background: rgba(255,255,255,.9); color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.wa-msg { max-width: min(78%, 560px); padding: 6px 9px 4px; border-radius: 10px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: 14.2px; line-height: 1.42; position: relative; align-self: flex-start; word-wrap: break-word; animation: pop .2s var(--ease); }
.wa-msg.out { align-self: flex-end; background: #D9FDD3; }
.wa-msg.out.s-bot { background: #E7F3FF; }
.wa-msg.out.s-automation { background: #F3ECFF; }
.wa-msg.failed { background: #FDECEC; }
.wa-who { font-size: 11px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.wa-text { white-space: pre-wrap; }
.wa-text a { color: #027EB5; }
.wa-meta { font-size: 11px; color: #667781; text-align: right; margin-top: 2px; display: flex; justify-content: flex-end; gap: 4px; align-items: center; }
.tk { font-size: 12px; letter-spacing: -3px; }
.tk.read { color: #34B7F1; }
.tk.fail { color: var(--danger); letter-spacing: 0; cursor: help; }
.wa-err { font-size: 12px; color: var(--danger); margin-top: 4px; font-weight: 600; }
.wa-img { max-width: 280px; max-height: 320px; border-radius: 7px; display: block; margin-bottom: 4px; }
.wa-msg audio { max-width: 260px; height: 36px; }
.wa-transcript { font-size: 12.5px; color: var(--text-2); font-style: italic; margin-top: 4px; }
.wa-doc { display: inline-flex; gap: 6px; align-items: center; color: var(--text); font-weight: 700; padding: 6px 0; }
.wa-doc svg { width: 18px; height: 18px; }
.wa-btn { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,.07); text-align: center; color: #027EB5; font-weight: 700; font-size: 13.5px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.wa-btn svg { width: 14px; height: 14px; }
.wa-composer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 10px 12px; }
.wa-input { display: flex; gap: 8px; align-items: flex-end; }
.wa-input textarea { resize: none; min-height: 42px; max-height: 160px; border-radius: 21px; padding: 10px 16px; }
.wa-input .btn-icon { width: 42px; height: 42px; flex: none; border-radius: 50%; }
.wa-hint { font-size: 11.5px; color: var(--faint); margin: 6px 4px 0; }
.wa-closed { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.wa-closed svg { width: 18px; height: 18px; color: var(--warn); flex: none; }
.wa-closed span { flex: 1; }
.wa-preview { background: #EFEAE2; border-radius: 14px; padding: 14px; margin-top: 14px; display: flex; flex-direction: column; }
.wa-preview .wa-msg { align-self: flex-end; max-width: 100%; animation: none; }
.wa-preview.small-prev { padding: 10px; margin: 4px 0; }
.wa-preview.small-prev .wa-msg { font-size: 13px; max-width: 100%; align-self: stretch; }
.wa-preview.phone { min-height: 220px; margin: 0; }
.wa-tpl-mini { font-size: 12.5px; color: var(--text-2); background: #D9FDD3; border-radius: 8px; padding: 7px 9px; white-space: pre-wrap; }
.tool-chip { align-self: center; font-size: 11.5px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.85); border-radius: 8px; padding: 3px 9px; margin: 2px 0; }
.wa-msg.typing { display: flex; gap: 4px; padding: 10px 12px; }
.wa-msg.typing span { width: 6px; height: 6px; border-radius: 50%; background: #9AA6AC; animation: pulse 1s infinite; }
.wa-msg.typing span:nth-child(2) { animation-delay: .15s; } .wa-msg.typing span:nth-child(3) { animation-delay: .3s; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tpl-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.modal.modal-wide { width: min(860px, 100%); }
.tpl-editor { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; }
.tpl-side { position: sticky; top: 0; align-self: start; }

.bot-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.bot-layout > * { min-width: 0; }
.paused-banner svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 1320px) { .bot-layout { grid-template-columns: 1fr; } .bot-test { position: static; } }
.bot-test { position: sticky; top: 12px; display: flex; flex-direction: column; overflow: hidden; }
.bot-test .test-msgs { height: 460px; background: #EFEAE2; padding: 14px; flex: none; }
.goal-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.goal-opt { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1.5px solid var(--border-strong); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.goal-opt b { font-size: 13.5px; }
.goal-opt span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.goal-opt.on { border-color: var(--accent); background: var(--accent-soft); }

.connect-wa { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 22px 24px; flex-wrap: wrap; background: linear-gradient(120deg, var(--surface), #EFFBF2); }
.cw-txt { flex: 1; min-width: 260px; }
.cw-txt h2 { font: 600 20px var(--font-display); margin: 0 0 4px; }
.cw-txt p { margin: 0; color: var(--muted); max-width: 620px; }
.fbbtn { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; border: 0; border-radius: 100px; background: #1877F2; color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; }
.fbbtn:hover:not(:disabled) { filter: brightness(1.07); }
.fbbtn:disabled { opacity: .45; cursor: not-allowed; }

.wa-mini { display: flex; flex-direction: column; gap: 4px; background: #EFEAE2; border-radius: 12px; padding: 10px; }
.wa-mini .wa-msg { font-size: 13px; max-width: 90%; animation: none; }

@media (max-width: 960px) {
  .wa-shell { grid-template-columns: 1fr; height: calc(100vh - 170px); border-radius: 14px; }
  .wa-shell .wa-chat { display: none; }
  .wa-shell.has-chat .wa-list { display: none; }
  .wa-shell.has-chat .wa-chat { display: flex; }
  .wa-back { display: inline-flex; }
  .wa-msgs { padding: 12px 10px; }
  .wa-msg { max-width: 88%; }
  .bot-toggle .small { display: none; }
  .bot-layout, .tpl-editor { grid-template-columns: 1fr; }
  .bot-test { position: static; }
  .goal-opts { grid-template-columns: 1fr; }
}

/* ── Formación (videoteca tipo Vimeo) ─────────────────────── */
.ac-sec { margin-bottom: 30px; border-radius: var(--radius); transition: background .15s, box-shadow .15s; }
.ac-sec.drop-on, .ac-empty.drop-on { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.ac-head { display: flex; align-items: flex-end; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.ac-head h2 { font: 600 21px var(--font-display); margin: 0; letter-spacing: -.01em; }
.ac-head p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; max-width: 640px; }
.ac-head .spacer { flex: 1; }
.ac-prog { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ac-prog .bar { width: 110px; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .3s var(--ease); }
.ac-drophint { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 22px; text-align: center; color: var(--faint); font-size: 13.5px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.vcard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; min-width: 0; position: relative; }
.vcard.dragging { opacity: .4; }
.vthumb { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #16161B center / cover no-repeat; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s; }
.vcard:hover .vthumb { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.vthumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.35), transparent 45%); pointer-events: none; }
.vph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.4); }
.vph svg { width: 40px; height: 40px; }
.vcard:not(.busy) .vthumb::before { content: ''; position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; z-index: 1; opacity: 0; transform: scale(.8);
  background: rgba(255,255,255,.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23141418' d='M8 5.5v13l11-6.5z'/%3E%3C/svg%3E") 56% 50% / 22px no-repeat; transition: all .2s var(--ease); }
.vcard:hover .vthumb::before { opacity: 1; transform: none; }
.vdur, .vsrc { position: absolute; bottom: 8px; right: 8px; z-index: 2; background: rgba(0,0,0,.72); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.vsrc { right: auto; left: 8px; }
.vdone { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; }
.vdone svg { width: 15px; height: 15px; stroke-width: 3; }
.vprog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.3); z-index: 2; }
.vprog i { display: block; height: 100%; background: #E5484D; }
.vup { position: absolute; inset: 0; z-index: 3; background: rgba(16,16,22,.78); color: #fff; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 16px; font-size: 12px; }
.vup b { font: 700 20px var(--font-display); }
.vup .bar { background: rgba(255,255,255,.2); }
.vup .bar i { background: #fff; }
.vinfo { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.vinfo b { font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vinfo span { font-size: 12.5px; color: var(--muted); }
.vstall { display: flex; gap: 6px; }
.ac-empty { text-align: center; padding: 60px 24px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; }
.ac-empty-ico { width: 72px; height: 72px; border-radius: 22px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.ac-empty-ico svg { width: 30px; height: 30px; fill: currentColor; }
.ac-empty h2 { font: 600 24px var(--font-display); margin: 6px 0 0; }
.ac-empty p { color: var(--muted); max-width: 520px; margin: 0 0 8px; }

.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--text); }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.vp-next { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.7); color: #fff; text-align: center; z-index: 3; }
.vp-next > div { display: flex; flex-direction: column; gap: 10px; max-width: 80%; }
.vp-next b { font: 600 20px var(--font-display); }
.watch-bar { display: flex; align-items: center; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.watch-bar .spacer { flex: 1; }
.watch-title { font: 600 26px/1.2 var(--font-display); margin: 4px 0 6px; letter-spacing: -.015em; }
.watch-meta { color: var(--muted); font-size: 13.5px; }
.watch-meta a { color: var(--text-2); }
.watch-desc { margin-top: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; white-space: pre-wrap; line-height: 1.6; color: var(--text-2); }
.watch-desc a { color: #027EB5; font-weight: 700; text-decoration: none; }
.watch-side { position: sticky; top: 12px; max-height: calc(100vh - 140px); display: flex; flex-direction: column; overflow: hidden; }
.playlist { overflow-y: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.pl-item { display: grid; grid-template-columns: 22px 104px 1fr; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 11px; text-decoration: none; color: inherit; }
.pl-item:hover { background: var(--surface-2); }
.pl-item.on { background: var(--accent-soft); }
.pl-n { font-size: 12px; font-weight: 800; color: var(--faint); text-align: center; display: grid; place-items: center; }
.pl-n svg { width: 15px; height: 15px; color: var(--success); stroke-width: 3; }
.pl-thumb { aspect-ratio: 16 / 9; border-radius: 8px; background: #16161B center / cover; position: relative; }
.pl-thumb i { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.75); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.pl-t { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.upload-tray { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 14px; display: grid; gap: 10px; animation: pop .3s var(--ease); }
.upload-tray > b { display: flex; align-items: center; gap: 8px; }
.upload-tray > b svg { width: 18px; height: 18px; }
.ut-row { display: grid; gap: 4px; }
.ut-row span { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ut-row small { color: var(--muted); }
.page-title { display: inline-block; vertical-align: middle; }
.page-title + .help-btn { margin: 0 0 0 12px; vertical-align: middle; }
.help-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 9px; margin: 6px 0 2px; border: 0; border-radius: 100px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 12.5px; cursor: pointer; animation: pop .35s var(--ease); }
.help-btn svg { width: 13px; height: 13px; fill: currentColor; }
.help-btn:hover { filter: brightness(1.08); }
.help-fab { position: fixed; right: 22px; bottom: 22px; z-index: 35; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px; border: 0; border-radius: 100px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; box-shadow: var(--shadow-lg); cursor: pointer; animation: pop .35s var(--ease); }
.help-fab svg { width: 18px; height: 18px; fill: currentColor; }
.help-fab:hover { filter: brightness(1.08); }

@media (max-width: 1100px) { .watch { grid-template-columns: 1fr; } .watch-side { position: static; max-height: none; } }
@media (max-width: 960px) {
  .vgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .watch-title { font-size: 22px; }
  .upload-tray { left: 12px; right: 12px; width: auto; bottom: 12px; }
  .help-fab { right: 14px; bottom: 14px; }
}

/* ── Tabla editable (estilo Notion / Airtable) ───────────── */
.grid.editable tbody tr { cursor: default; }
.grid.editable td:not(.name) { position: relative; }
.grid.editable td.ed { cursor: text; transition: background .12s, box-shadow .12s; }
.grid.editable td.ed:hover { box-shadow: inset 0 0 0 1px var(--border-strong); background: var(--surface); }
.grid.editable td.ed.check-cell { cursor: pointer; }
.grid.editable td.editing { padding: 0; box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); overflow: visible; z-index: 3; }
.grid.editable td.has-pop { padding: 12px 14px; }
.cell-input { width: 100%; min-width: 120px; height: 44px; border: 0; outline: 0; padding: 0 14px; font: inherit; color: var(--text); background: transparent; }
select.cell-input { cursor: pointer; }
.cell-input.long { position: absolute; left: 0; top: 0; width: max(100%, 320px); height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; z-index: 4;
  background: var(--surface); border-radius: 0 0 12px 12px; box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg); line-height: 1.5; white-space: pre-wrap; }
.cell-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 6; width: 280px; display: grid; gap: 8px; padding: 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); white-space: normal; animation: pop .2s var(--ease); cursor: default; }
.cell-pop .btn { justify-self: start; }
.grid .ph { color: var(--faint); font-weight: 500; }
.grid.editable td.ed:hover .ph { color: var(--muted); }
.grid td.name .nm { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.open-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; font-size: 11px; font-weight: 800; color: var(--text-2); cursor: pointer;
  opacity: 0; transition: opacity .12s; box-shadow: var(--shadow-sm); }
.open-btn svg { width: 12px !important; height: 12px !important; }
.grid tr:hover .open-btn { opacity: 1; }
.open-btn:hover { color: var(--text); border-color: var(--text); }
.cell-acts { display: inline-flex; gap: 2px; margin-left: 6px; opacity: 0; transition: opacity .12s; vertical-align: middle; }
.grid tr:hover .cell-acts { opacity: 1; }
.cell-acts a { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); }
.cell-acts a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.cell-acts svg { width: 13px !important; height: 13px !important; }
.cb { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--surface); vertical-align: middle; transition: all .12s; }
.cb.on { background: var(--success); border-color: var(--success); color: #fff; }
.cb svg { width: 12px !important; height: 12px !important; stroke-width: 3; }
.grid td.saved { animation: cell-saved 1.2s ease; }
.grid td.failed { animation: cell-failed 1.2s ease; }
@keyframes cell-saved { 0%, 40% { background: var(--success-bg); } }
@keyframes cell-failed { 0%, 40% { background: var(--danger-bg); } }
.grid tfoot td { border-bottom: 0; padding: 4px 6px; }
.add-row { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.add-row:hover { background: var(--surface-2); color: var(--text); }
.add-row svg { width: 14px; height: 14px; }
/* La columna del nombre queda fija por encima al desplazar en horizontal; la cabecera, por encima de todo */
.grid.editable td.name { z-index: 2; box-shadow: 1px 0 0 var(--border); }
.grid.editable th { z-index: 4; }
.grid.editable td.editing { z-index: 3; }

/* ── Histórico de cambios ──────────────────────────────── */
.hist-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.hist-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.hist-filters select.input { width: auto; max-width: 260px; }
.hist-filters .search { min-width: 180px; }
.hist-contact { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px; }
.hist-contact svg { width: 16px; height: 16px; }
.hist-day { margin-bottom: 20px; }
.hist-day .section-t { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text-2); }
.hist-rows { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.hist-row { display: grid; grid-template-columns: 46px 30px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; line-height: 1.55; }
.hist-row:last-child { border-bottom: 0; }
.hist-row:hover { background: var(--surface-2); }
.hist-row time { color: var(--faint); font-size: 12px; font-weight: 700; padding-top: 4px; font-variant-numeric: tabular-nums; }
.hist-row .avatar { width: 28px; height: 28px; font-size: 10.5px; }
.hist-row .avatar.auto, .hist-person .avatar.auto { background: var(--surface-3); border-color: transparent; color: var(--muted); }
.hist-row .avatar.auto svg, .hist-person .avatar.auto svg { width: 14px; height: 14px; }
.hist-row .avatar.a-bot, .hist-row .avatar.a-whatsapp { background: #DCF8E6; color: #128C7E; }
.hist-row .avatar.a-automation { background: #F1EBFE; color: #6D28D9; }
.hist-row .avatar.a-booking { background: #E6EFFE; color: #1D5FD1; }
.hist-row .avatar.a-form { background: #FEF3E2; color: #B45309; }
.hist-txt { min-width: 0; padding-top: 3px; color: var(--text-2); }
.hist-txt .who { color: var(--text); }
.hist-txt b { color: var(--text); font-weight: 700; }
.hist-lead { color: var(--text); font-weight: 700; text-decoration: none; border-bottom: 1px dashed var(--border-strong); }
.hist-lead:hover { border-color: var(--text); }
.hist-lead.gone { text-decoration: line-through; color: var(--muted); border: 0; }
.hv { display: inline; padding: 1px 7px; border-radius: 6px; font-weight: 600; font-size: 12.5px; word-break: break-word; }
.hv.old { background: var(--surface-3); color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.hv.new { background: var(--success-bg); color: var(--success); }
.hv.plain { background: var(--surface-2); color: var(--text-2); }
.hist-row.del .hist-txt { color: var(--danger); }
.hist-row .arrow { color: var(--faint); margin: 0 2px; }
.hist-rows.compact .hist-row { grid-template-columns: 40px 26px minmax(0, 1fr); padding: 8px 10px; font-size: 12.5px; }
.hist-rows.compact .hist-row .avatar { width: 24px; height: 24px; font-size: 9.5px; }
.hist-side { position: sticky; top: 12px; overflow: hidden; }
.hist-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 16px 14px; }
.hist-kpis div { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; }
.hist-kpis b { display: block; font: 600 22px var(--font-display); }
.hist-kpis span { font-size: 11.5px; color: var(--muted); }
.hist-people { display: grid; gap: 2px; padding: 0 8px 10px; }
.hist-person { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border: 0; background: none; border-radius: 12px; cursor: pointer; text-align: left; font: inherit; }
.hist-person:hover { background: var(--surface-2); }
.hist-person.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.hist-person .avatar { width: 32px; height: 32px; }
.hp-txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.hp-txt b { font-size: 13.5px; }
.hp-txt span { font-size: 11.5px; color: var(--muted); }
.hp-txt .bar { height: 4px; }
#c-changes summary::-webkit-details-marker { display: none; }
#c-changes summary svg { width: 14px; height: 14px; }
@media (max-width: 1100px) { .hist-layout { grid-template-columns: 1fr; } .hist-side { position: static; order: -1; } }
@media (max-width: 640px) { .hist-row { grid-template-columns: 40px 26px minmax(0, 1fr); padding: 9px 10px; } }

/* ── Captación ─────────────────────────────────────────── */
:root { --c-blue: #3E7BFA; --c-teal: #12A594; --c-green: #30A46C; --c-yellow: #E5B000; --c-orange: #F07A1A; --c-red: #E5484D; --c-pink: #E93D82; --c-purple: #8E4EC6; --c-gray: #A3A3AD; }
.aq-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.aq-setup { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.aq-step { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1.5px dashed var(--border-strong); background: var(--surface); border-radius: 14px; cursor: pointer; text-align: left; font: inherit; transition: border-color .15s; }
.aq-step:hover { border-color: var(--accent); }
.aq-step > svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.aq-step span { display: flex; flex-direction: column; }
.aq-step small { color: var(--muted); font-size: 12px; }
.aq-step.ok { border-style: solid; border-color: transparent; background: var(--success-bg); }
.aq-step.ok > svg { color: var(--success); }
.aq-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.aq-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.funnel { padding: 6px 20px 18px; display: grid; gap: 10px; }
.f-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; }
.f-head span { font-weight: 800; font-variant-numeric: tabular-nums; }
.f-head em { font-style: normal; font-weight: 700; color: var(--success); background: var(--success-bg); border-radius: 6px; padding: 0 6px; font-size: 12px; margin-left: 4px; }
.f-head small { color: var(--muted); font-weight: 600; }
.f-bar { height: 12px; background: var(--surface-3); border-radius: 8px; overflow: hidden; margin-top: 5px; }
.f-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 65%, white)); transition: width .6s var(--ease); }
.sp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sp-kpis div { background: var(--surface-2); border-radius: 12px; padding: 12px 10px; text-align: center; }
.sp-kpis b { display: block; font: 600 22px var(--font-display); }
.sp-kpis span { font-size: 11.5px; color: var(--muted); }
.sp-kpis .warn { background: var(--warn-bg); }
.sp-kpis .warn b { color: var(--warn); }
.sp-users { margin-top: 12px; }
.sp-users th, .sp-users td { padding: 8px 10px; }
.aq-trend { padding: 4px 20px 6px; }
.aq-trend svg { width: 100%; height: 200px; display: block; overflow: visible; }
.aq-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 20px 16px; font-size: 12px; font-weight: 600; color: var(--muted); }
.aq-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); }
.aq-legend [data-color="blue"] i { background: var(--c-blue); } .aq-legend [data-color="teal"] i { background: var(--c-teal); } .aq-legend [data-color="green"] i { background: var(--c-green); }
.aq-legend [data-color="yellow"] i { background: var(--c-yellow); } .aq-legend [data-color="orange"] i { background: var(--c-orange); } .aq-legend [data-color="red"] i { background: var(--c-red); }
.aq-legend [data-color="pink"] i { background: var(--c-pink); } .aq-legend [data-color="purple"] i { background: var(--c-purple); } .aq-legend [data-color="gray"] i { background: var(--c-gray); }
.aq-table { margin: 0 12px 12px; border: 1px solid var(--border); border-radius: 12px; }
.aq-table th.num { text-align: right; }
.aq-table td .faint { font-size: 11.5px; margin-left: 2px; }
.aq-table .ok-cell { color: var(--success); font-weight: 800; }
.aq-total td { background: var(--surface-2); font-weight: 800; border-top: 1px solid var(--border-strong); }
.capi-events { display: grid; gap: 8px; }
.capi-ev { display: grid; grid-template-columns: auto 1fr 170px; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.capi-ev span { display: flex; flex-direction: column; }
.capi-ev small { color: var(--muted); font-size: 12px; }
.capi-log th, .capi-log td { padding: 8px 10px; }
.org-touch { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; }
@media (max-width: 1100px) { .aq-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .aq-setup { grid-template-columns: 1fr; } .sp-kpis { grid-template-columns: 1fr 1fr; } .capi-ev { grid-template-columns: auto 1fr; } .capi-ev .input { grid-column: 1 / -1; } }

/* ── Productos ─────────────────────────────────────────── */
.empty-hero { text-align: center; padding: 60px 20px; max-width: 560px; margin: 0 auto; }
.empty-hero .eh-ico { width: 64px; height: 64px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; margin: 0 auto 16px; }
.empty-hero .eh-ico svg { width: 28px; height: 28px; color: var(--text-2); }
.empty-hero h2 { font: 400 28px/1.15 var(--font-display); letter-spacing: -.025em; margin: 0 0 8px; }
.empty-hero p { color: var(--muted); margin: 0 0 20px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.prod-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.prod-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c, var(--accent)); }
.prod-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.prod-card.off { opacity: .6; }
.pc-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pc-cat { text-transform: uppercase; letter-spacing: .06em; }
.pc-bill { margin-left: auto; background: var(--cbg); color: var(--c); padding: 2px 8px; border-radius: 99px; }
.pc-name { font: 600 18px/1.25 var(--font-display); letter-spacing: -.01em; }
.pc-price { font: 400 30px/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pc-price small { font: 700 12px var(--font-body); color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.pc-desc { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }
.pc-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.pc-stats .pend b { color: var(--warn); }
.pc-tpl { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: var(--text-2); }
.pc-tpl svg { width: 14px; height: 14px; }
.prod-add { align-items: center; justify-content: center; text-align: center; border-style: dashed; border-width: 1.5px; border-color: var(--border-strong); background: transparent; box-shadow: none; min-height: 200px; color: var(--muted); }
.prod-add::before { display: none; }
.prod-add svg { width: 26px; height: 26px; }
.prod-add b { color: var(--text); font-size: 15px; }
.prod-add span { font-size: 12.5px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches i { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); transition: transform .15s; }
.swatches input:checked + i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); transform: scale(1.05); }
.pu-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.pu-name i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.grid td select.pu-st, .pu-row select.pu-st { height: 28px; font-size: 12px; }
.pu-total { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.pu-total > span { color: var(--muted); font-weight: 700; }
.pu-total b { font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.pu-total small { grid-column: 1 / -1; color: var(--muted); text-align: right; }

/* Ficha: productos y contratos */
.ltv { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--success); background: var(--success-bg); padding: 2px 9px; border-radius: 99px; font-weight: 800; }
.pu-list, .ct-list { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.pu-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.pu-row.off { opacity: .55; }
.pu-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.pu-main { all: unset; cursor: pointer; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pu-main b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pu-main:hover b { text-decoration: underline; }
.pu-row select.pu-st { border-radius: 99px; border: 0; padding: 0 26px 0 10px; font-weight: 800; appearance: none; cursor: pointer; background-color: var(--cbg); color: var(--c);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none' stroke='%2371717B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 4 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.ct-row { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .15s; }
.ct-row:hover { border-color: var(--border-strong); }
.ct-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--cbg, var(--surface-2)); color: var(--c, var(--text-2)); flex: none; }
.ct-ico svg { width: 17px; height: 17px; }
.ct-ico.big { width: 46px; height: 46px; border-radius: 14px; }
.ct-ico.big svg { width: 22px; height: 22px; }
.ct-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct-main b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Contratos: lista, firmas y detalle */
.ct-doc { display: inline-flex; align-items: center; gap: 8px; }
.ct-doc svg { width: 16px; height: 16px; color: var(--muted); }
.sig-dots { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sig-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px dashed var(--border-strong); }
.sig-dots i.signed { background: var(--success); border: 0; }
.sig-dots i.opened { border: 1.5px solid var(--info); }
.sig-dots i.declined { background: var(--danger); border: 0; }
.sig-dots span { margin-left: 4px; }
.modal:has(.ct-new), .modal:has(.ct-detail) { width: min(660px, 100%); }
.modal:has(.ct-edit) { width: min(860px, 100%); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; border: 1px solid var(--border); }
.seg button { all: unset; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.drop-mini { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: 14px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--text-2); background: var(--surface-2); }
.drop-mini:hover { border-color: var(--accent); }
.callout { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 600; }
.callout a { color: inherit; }
.nc-signer { display: grid; grid-template-columns: 24px 1fr 1.2fr auto; gap: 8px; align-items: center; }
.nc-n { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.nc-more summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; gap: 8px; align-items: center; list-style: none; }
.nc-more summary svg { width: 15px; height: 15px; }
.ctd-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.ctd-head h2 { font-size: 22px; }
.ctd-signers { display: grid; gap: 8px; }
.ctd-signer { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; }
.ctd-signer .sg-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; color: var(--muted); flex: none; }
.ctd-signer.signed .sg-dot { background: var(--success); color: #fff; }
.ctd-signer.declined .sg-dot { background: var(--danger); color: #fff; }
.ctd-signer.opened .sg-dot { box-shadow: inset 0 0 0 2px var(--info); color: var(--info); }
.ctd-signer .sg-dot svg { width: 16px; height: 16px; stroke-width: 2.4; }
.sg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ctd-ev { display: grid; gap: 2px; max-height: 280px; overflow: auto; padding-right: 4px; }
.ctd-ev .ev { display: flex; gap: 10px; padding: 6px 0; font-size: 13px; }
.ctd-ev .ev > div { display: flex; flex-direction: column; }
.ev-ico { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--muted); }
.ev-ico svg { width: 14px; height: 14px; }

/* Plantillas y editor */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tpl-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s; min-height: 150px; }
.tpl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tpl-card b { font: 600 17px/1.25 var(--font-display); }
.tpl-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; margin-bottom: 6px; }
.tpl-ico svg { width: 20px; height: 20px; }
.tpl-add { border: 1.5px dashed var(--border-strong); background: transparent; box-shadow: none; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.tpl-add svg { width: 22px; height: 22px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 700; }
.back-link svg { width: 14px; height: 14px; }
.title-input { display: block; border: 0; background: transparent; font: 400 32px/1.15 var(--font-display); letter-spacing: -.028em; color: var(--text); padding: 2px 0; margin-top: 4px; width: min(560px, 70vw); outline: none; border-bottom: 1.5px dashed transparent; }
.title-input:hover, .title-input:focus { border-bottom-color: var(--border-strong); }
.te-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; align-items: start; }
.te-side { position: sticky; top: 0; display: grid; gap: 12px; }
.te-side .panel-body { padding: 4px 14px 14px; }
.te-list { display: grid; gap: 3px; max-height: 42vh; overflow: auto; }
.te-group { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 8px 0 2px; }
.te-item { all: unset; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.te-item:hover { background: var(--surface-2); }
.te-item code { font-size: 11px; color: var(--muted); }
.te-item svg { width: 14px; height: 14px; }
.ed-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.ed-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.ed-bar i { width: 1px; background: var(--border-strong); margin: 4px 6px; }
.ed-btn { all: unset; cursor: pointer; min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; color: var(--text-2); padding: 0 4px; }
.ed-btn:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.ed { padding: 40px 52px; min-height: 60vh; outline: none; font-size: 15px; line-height: 1.7; color: #26262C; }
.modal .ed { min-height: 46vh; max-height: 56vh; overflow: auto; padding: 26px 32px; }
.ed h1, .ed h2 { font: 700 21px/1.3 var(--font-display); margin: 20px 0 8px; color: var(--text); }
.ed h1 { font-size: 26px; }
.ed h3 { font: 700 16px/1.3 var(--font-display); margin: 16px 0 6px; }
.ed p { margin: 0 0 10px; }
.ed ul, .ed ol { margin: 0 0 10px; padding-left: 22px; }
.tvar, .tfield { display: inline-block; padding: 0 7px; border-radius: 6px; font-size: .9em; font-weight: 700; line-height: 1.55; user-select: all; }
.tvar { background: var(--info-bg); color: var(--info); }
.tvar::before { content: '{ '; opacity: .5; } .tvar::after { content: ' }'; opacity: .5; }
.tfield { background: #FFF4CC; color: #8A6A00; border: 1px dashed #E7C76A; }
.tfield::before { content: '✎ '; }
@media (max-width: 1000px) { .te-layout { grid-template-columns: 1fr; } .te-side { position: static; } .ed { padding: 26px 22px; } }
@media (max-width: 640px) { .nc-signer { grid-template-columns: 24px 1fr auto; } .nc-signer input[data-k="email"] { grid-column: 2 / 3; } }
.section-t > svg, summary.section-t svg { width: 14px; height: 14px; flex: none; }
.chip-xs { height: 20px; padding: 0 8px; font-size: 11px; vertical-align: 1px; margin-left: 4px; }
.ctd-signer { flex-wrap: wrap; }
.ctd-signer .sg-main { flex: 1 1 220px; }
.ctd-signer > .row { margin-left: auto; }
.ctd-ev .ev > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .ctd-signer > .row { margin-left: 44px; } }
@media (max-width: 640px) { .title-input { width: 100%; font-size: 25px; } }

/* ── Equipo comercial ──────────────────────────────────── */
.pdot { --h: 210; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 10px; font-weight: 800; letter-spacing: -.02em;
  background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 45% 32%); border: 1.5px solid var(--surface); box-shadow: 0 0 0 1px hsl(var(--h) 40% 80%); vertical-align: middle; }
.pdot.none { background: var(--surface-2); color: var(--faint); box-shadow: 0 0 0 1px var(--border-strong); }
.pdot.big { width: 40px; height: 40px; font-size: 14px; }
.owner-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 2px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; }
.owner-pick:hover { border-color: var(--border-strong); }
.owner-pick .pdot { width: 20px; height: 20px; font-size: 9px; }
.owner-pick select { all: unset; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-2); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-owner { margin-left: auto; }
.card-owner .pdot { width: 20px; height: 20px; font-size: 9px; }
select.on-filter { border-color: var(--accent); background-color: var(--accent-soft); font-weight: 700; }
.grid td select.owner-sel { font-weight: 600; }
.nav-item .count.late { background: var(--danger); color: #fff; }
.nav-item .count.info { background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); } /* informativo, no es un aviso */

/* Tareas */
.tk-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.tk-list { display: grid; gap: 4px; grid-template-columns: minmax(0, 1fr); }
.tkr { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; transition: background .12s, opacity .3s; }
.tkr:hover { background: var(--surface-2); }
.tk-check { all: unset; cursor: pointer; width: 20px; height: 20px; border-radius: 7px; border: 1.8px solid var(--border-strong); display: grid; place-items: center; flex: none; color: transparent; transition: all .15s; }
.tk-check svg { width: 13px; height: 13px; stroke-width: 3; }
.tk-check:hover { border-color: var(--success); color: var(--success); }
.tkr.done .tk-check { background: var(--success); border-color: var(--success); color: #fff; }
.tkr.done .tk-main b { text-decoration: line-through; color: var(--muted); }
.tkr.flash-done { opacity: .4; }
.tk-main { all: unset; cursor: pointer; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tk-main b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-main > span { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); }
.tk-due, .tk-lead { display: inline-flex; align-items: center; gap: 4px; }
.tk-due svg, .tk-lead svg { width: 12px; height: 12px; }
.tkr.late .tk-due { color: var(--danger); font-weight: 700; }
.tk-lead:hover { color: var(--text); text-decoration: underline; }
.tk-add { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; margin-top: 8px; }
.tk-add select { width: auto; }
.tk-done summary { cursor: pointer; margin-top: 8px; }
.tk-group.late .panel-head h3 { color: var(--danger); }

/* Rendimiento */
.tm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.tm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; display: grid; gap: 12px; position: relative; }
.tm-card.crown { border-color: color-mix(in srgb, #E5B000 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, #E5B000 14%, transparent), var(--shadow-sm); }
.tm-who { display: flex; align-items: center; gap: 10px; }
.tm-who > div { display: flex; flex-direction: column; min-width: 0; }
.tm-big span { font: 400 30px/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tm-big small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.tm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tm-stats > div { background: var(--surface-2); border-radius: 10px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; }
.tm-stats b { font-size: 14px; font-variant-numeric: tabular-nums; }
.tm-stats span { font-size: 11px; color: var(--muted); }
.tm-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.tm-bar i { display: block; height: 100%; background: var(--success); border-radius: 6px; }
.spd.good { color: var(--success); } .spd.mid { color: var(--warn); } .spd.bad { color: var(--danger); }
.tm-grid td.top { background: color-mix(in srgb, #E5B000 10%, transparent); font-weight: 800; }
.tm-grid th { cursor: pointer; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.mode-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1.5px solid var(--border-strong); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card.on { border-color: var(--accent); background: var(--accent-soft); }
.mc-ico { width: 32px; height: 32px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; margin-bottom: 4px; box-shadow: var(--shadow-sm); }
.mc-ico svg { width: 16px; height: 16px; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 20px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--success); box-shadow: none; }
.switch input:checked + i::after { transform: translateX(16px); }
.me-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.me-row:last-child { border-bottom: 0; }
.me-row > span { display: flex; flex-direction: column; }
@media (max-width: 640px) { .tk-add { grid-template-columns: 1fr auto; } .tk-add input { grid-column: 1 / -1; } .tm-stats { grid-template-columns: repeat(2, 1fr); } }
.nav-item #tk-count:not(.late) { background: var(--surface-3); color: var(--text-2); }
.settings > * { min-width: 0; }

/* ── Tipos de reunión: equipo, disponibilidad y preguntas ── */
.unit-in { display: inline-flex; gap: 6px; align-items: center; }
.unit-in input { width: 84px; }
.unit-in select { width: auto; }
.av-rows { display: grid; gap: 2px; margin-top: 12px; }
.av-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.av-row:last-child { border-bottom: 0; }
.av-row > div:first-child { display: flex; flex-direction: column; min-width: 180px; flex: 1; }
.av-row > div:first-child b { font-size: 13.5px; }
.av-row > div:first-child span { font-size: 12px; color: var(--muted); }
.win-opts { display: grid; gap: 8px; }
.win-opts label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.rr-hosts { display: grid; gap: 6px; }
.rr-host { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; opacity: .6; }
.rr-host.on { opacity: 1; border-color: var(--border-strong); background: var(--surface-2); }
.rr-host select { width: auto; }
.rr-name { font-weight: 700; font-size: 13.5px; }
.rr-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.rr-mode { display: flex; gap: 10px; padding: 12px; border: 1.5px solid var(--border-strong); border-radius: 12px; cursor: pointer; }
.rr-mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rr-mode span { display: flex; flex-direction: column; gap: 2px; }
.rr-mode small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.q-fixed { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 12px; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.q-fixed span { display: inline-flex; align-items: center; gap: 6px; }
.q-fixed svg { width: 14px; height: 14px; }
.q-list { display: grid; gap: 8px; margin-top: 8px; }
.q-card { display: grid; gap: 7px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); }
.q-card.off { opacity: .55; }
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-head .spacer { flex: 1; }
.q-opts { display: grid; gap: 5px; padding-left: 4px; }
.q-opt { display: flex; align-items: center; gap: 8px; }
.q-mark { width: 14px; height: 14px; border: 1.8px solid var(--border-strong); flex: none; border-radius: 50%; }
.q-mark.checkboxes { border-radius: 4px; }
.q-mark.select { border-radius: 3px; width: 10px; height: 2px; border: 0; background: var(--faint); }
.q-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.q-add .chip svg { width: 13px; height: 13px; }
@media (max-width: 640px) { .rr-modes { grid-template-columns: 1fr; } }
.rr-host > label.row { flex: 1 0 200px; flex-wrap: nowrap; }
.rr-host > label.row .rr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-host select { flex: 1 1 140px; }
/* Casillas con texto largo: el texto se queda al lado de la casilla */
label.row:has(> input[type=checkbox]) { flex-wrap: nowrap; align-items: flex-start; }
label.row:has(> input[type=checkbox]) > input { margin-top: 2px; flex: none; }

/* Tuerca de columnas de la tabla */
.grid th.col-gear, .grid td.col-gear { position: sticky; right: 0; width: 44px; min-width: 44px; padding: 0 6px; background: var(--surface); z-index: 3; box-shadow: -1px 0 0 var(--border); }
.grid thead th.col-gear { z-index: 5; cursor: default; }
.gear-btn { all: unset; cursor: pointer; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.gear-btn:hover { background: var(--surface-2); color: var(--text); }
.gear-btn svg { width: 17px; height: 17px; }
#t-cols svg { width: 15px; height: 15px; }
.modal:has(.colpick) { width: min(520px, 100%); }
.cp-list { max-height: 56vh; overflow: auto; margin-top: 12px; display: grid; gap: 14px; padding-right: 2px; }
.cp-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 4px 2px; }
.cp-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 10px; }
.cp-item:hover { background: var(--surface-2); }
.cp-item label { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cp-item label span { overflow: hidden; text-overflow: ellipsis; }
.cp-item.on label span:first-of-type { color: var(--text); }
.cp-move { display: inline-flex; }
.cp-tag { font-size: 10.5px; font-weight: 800; color: var(--info); background: var(--info-bg); border-radius: 99px; padding: 1px 7px; flex: none; }
.grid th { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Bandeja única ─────────────────────────────────────── */
.ib-content { padding-bottom: 16px; display: flex; flex-direction: column; min-height: 0; }
.ib { display: grid; grid-template-columns: 340px minmax(0, 1fr) 290px; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; height: calc(100vh - 190px); min-height: 520px; }
.ib-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.ib-chs { display: flex; gap: 4px; padding: 10px 10px 6px; overflow-x: auto; scrollbar-width: none; }
.ib-chs::-webkit-scrollbar { display: none; }
.ib-ch { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; border: 1px solid var(--border); }
.ib-ch svg { width: 14px; height: 14px; color: var(--chc, currentColor); }
.ib-ch.on { background: var(--text); color: #fff; border-color: transparent; }
.ib-ch.on svg { color: #fff; }
.ib-ch i { font-style: normal; font-size: 10.5px; background: var(--danger); color: #fff; border-radius: 99px; padding: 0 6px; }
.ib-ch:not(:has(i)) span, .ib-ch span { display: inline; }
.ib-filters { display: flex; gap: 6px; padding: 4px 10px 10px; border-bottom: 1px solid var(--border); align-items: center; }
.ib-filters .on-arch { background: var(--accent-soft); color: var(--text); }
.ib-items { flex: 1; overflow: auto; }
.ib-item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 10px; padding: 11px 12px; width: 100%; border-bottom: 1px solid var(--border); }
.ib-item:hover { background: var(--surface-2); }
.ib-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ib-av { --h: 210; position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 800; background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 45% 30%); }
.ib-av.sm { width: 34px; height: 34px; font-size: 12px; }
.ib-av.lg { width: 64px; height: 64px; font-size: 20px; }
.ib-badge { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--chc); color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.ib-badge svg { width: 11px; height: 11px; }
.ib-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ib-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ib-row b { flex: 1; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-row time { font-size: 11.5px; color: var(--faint); flex: none; }
.ib-prev { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-item.unread b, .ib-item.unread .ib-prev { color: var(--text); font-weight: 800; }
.ib-unread { font-style: normal; flex: none; min-width: 18px; height: 18px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; display: inline-grid; place-items: center; padding: 0 5px; }
.ib-flag { font-size: 10.5px; font-weight: 800; color: var(--danger); background: var(--danger-bg); border-radius: 99px; padding: 1px 7px; flex: none; }
.ib-none { padding: 30px 18px; color: var(--muted); font-size: 13px; text-align: center; }
.ib-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-2); }
.ib-empty { margin: auto; text-align: center; display: grid; gap: 6px; max-width: 320px; color: var(--muted); font-size: 13px; padding: 20px; }
.ib-empty svg { width: 34px; height: 34px; margin: 0 auto 6px; color: var(--faint); }
.ib-empty b { color: var(--text); font-size: 16px; }
.ib-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ib-head .spacer { flex: 1; }
.ib-who { display: flex; flex-direction: column; min-width: 0; }
.ib-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-who svg { width: 13px; height: 13px; vertical-align: -2px; }
.ib-back { display: none; }
.ib-msgs { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.ib-day { text-align: center; margin: 8px 0 4px; }
.ib-day span { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 2px 10px; }
.ib-b { max-width: min(78%, 560px); padding: 8px 11px 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); align-self: flex-start; box-shadow: var(--shadow-sm); }
.ib-b.out { align-self: flex-end; background: #DCF8C6; border-color: transparent; }
.ib-b.out.s-bot, .ib-b.out.s-automation { background: #E8F0FE; }
.ib-b-who { font-size: 11px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.ib-b-t { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.ib-b-m { font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 2px; }
.ib-img { max-width: 260px; max-height: 260px; border-radius: 10px; display: block; margin-bottom: 4px; }
.ib-att { font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.ib-att svg { width: 14px; height: 14px; }
.ib-sys { align-self: center; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; justify-content: center; font-size: 12px; color: var(--text-2); background: var(--info-bg); border-radius: 12px; padding: 6px 12px; max-width: 90%; }
.ib-sys svg { width: 13px; height: 13px; color: var(--info); }
.ib-mail { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; max-width: min(92%, 680px); align-self: flex-start; box-shadow: var(--shadow-sm); }
.ib-mail.out { align-self: flex-end; border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.ib-mail-h { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ib-mail-s { font-weight: 800; font-size: 14px; margin: 4px 0 6px; }
.ib-mail-b { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.ib-mail-f { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 12px; }
.ib-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ib-compose { padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--border); display: grid; gap: 8px; }
.ib-send { display: flex; gap: 8px; align-items: flex-end; }
.ib-send textarea { flex: 1; min-height: 44px; max-height: 220px; resize: none; }
.ib-send .btn { height: 44px; width: 48px; padding: 0; }
.ib-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 8px 10px; }
.ib-warn svg { width: 14px; height: 14px; }
.ib-side { border-left: 1px solid var(--border); overflow: auto; }
.ib-card { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 22px 16px; }
.ib-name { font: 600 18px/1.2 var(--font-display); }
.ib-facts { display: grid; gap: 6px; width: 100%; text-align: left; font-size: 13px; }
.ib-facts > div { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ib-facts svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.ib-facts span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-others { width: 100%; text-align: left; border-top: 1px solid var(--border); padding-top: 10px; }
.ib-other { all: unset; cursor: pointer; display: flex; gap: 8px; align-items: center; width: 100%; padding: 6px 8px; border-radius: 9px; font-size: 13px; font-weight: 600; box-sizing: border-box; }
.ib-other:hover { background: var(--surface-2); }
.ib-other .faint { margin-left: auto; }
.ib-other svg { width: 15px; height: 15px; }
.modal:has(.ib-orig) { width: min(820px, 100%); }
.ib-orig iframe { width: 100%; height: 60vh; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.th-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; text-decoration: none; color: inherit; }
.th-row:hover { border-color: var(--border-strong); }
.th-row > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.th-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.th-main b, .th-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.ch-grid { grid-template-columns: 1fr 1fr; max-width: 1100px; }
.ch-grid .ch-wide { grid-column: 1 / -1; }
.ch-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--chc); color: #fff; }
.ch-ico svg { width: 15px; height: 15px; }
.chip.ch-ok { background: var(--success-bg); color: var(--success); border-color: transparent; }
.ch-acc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; }
.ch-acc .spacer { flex: 1; }
@media (max-width: 1250px) { .ib { grid-template-columns: 320px minmax(0, 1fr); } .ib-side { display: none; } }
@media (max-width: 860px) {
  .ib { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .ib.has-sel .ib-list { display: none; }
  .ib:not(.has-sel) .ib-thread { display: none; }
  .ib-back { display: inline-grid; }
  .ch-grid { grid-template-columns: 1fr; }
  .ib-top .btn-primary span { display: none; }
}

/* ── Subcuentas en marca blanca (vista de agencia) ─────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.txt-red { color: var(--danger); }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-off { opacity: .55; text-decoration: line-through; text-decoration-color: var(--faint); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; font-size: 13.5px; align-items: baseline; }
.kv > span { color: var(--muted); font-weight: 600; }
.kv a { color: var(--text); overflow-wrap: anywhere; }
.copy-line { display: flex; gap: 8px; margin: 4px 0 6px; }
.copy-line .input { font-size: 12.5px; color: var(--text-2); }
.color-pick { width: 46px; height: 40px; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); padding: 3px; flex: none; }

.sa-tools { display: flex; gap: 10px; margin: 4px 0 14px; }
.sa-search { width: min(360px, 100%); }
.sa-search .input { padding-right: 14px; }
.sa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.sa-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.sa-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); }
.sa-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sa-card.off { background: var(--surface-2); }
.sa-card.off .sa-top, .sa-card.off .sa-stats { opacity: .6; }
.sa-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sa-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font: 700 15px/1 var(--font-display); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.sa-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 12px; background: var(--surface-2); padding: 5px; flex: none; border: 1px solid var(--border); }
.sa-name { min-width: 0; flex: 1; line-height: 1.3; }
.sa-name b { display: block; font: 600 16.5px/1.25 var(--font-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-name span { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-name span svg { width: 13px; height: 13px; flex: none; }
.sa-name i { font-style: normal; color: var(--warn); }
.sa-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-block: 1px solid var(--border); }
.sa-stats span { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.sa-stats b { display: block; font: 300 26px/1.1 var(--font-display); letter-spacing: -.03em; color: var(--text); }
.sa-stats i { font-style: normal; color: var(--faint); }
.sa-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sa-foot .spacer { flex: 1; }
.sa-head { align-items: center; }
.sa-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sa-title .sa-mark, .sa-title .sa-logo { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; }
.sa-user { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sa-user .who { flex: 1; min-width: 160px; line-height: 1.3; }
.sa-user .who b { display: block; }
.sa-user .who span { font-size: 12.5px; color: var(--muted); }
.sa-done { text-align: center; }
.sa-done .eh-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--success-bg); color: var(--success); display: grid; place-items: center; margin: 4px auto 14px; }
.sa-done .eh-ico svg { width: 26px; height: 26px; }
.sa-done .actions { justify-content: center; }
.sn-card { cursor: default; }
.sn-card .chip b { color: var(--text); }

.plan-ed { display: grid; gap: 14px; }
.plan-presets, .pills-start { justify-self: start; }
.plan-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.plan-mod { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.plan-mod:has(input:checked) { background: var(--surface); border-color: var(--accent-line); }
.plan-mod .faint { margin-left: auto; font-weight: 700; }
.usage { display: grid; gap: 6px; }
.usage-l { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.usage-l span { color: var(--muted); font-weight: 600; }
.usage-bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.usage-bar i { display: block; height: 100%; border-radius: 8px; background: var(--accent); transition: width .5s var(--ease); }
.usage-bar.warn i { background: var(--warn); }
.usage-bar.full i { background: var(--danger); }
.dom-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.dom-steps code { font-size: 12.5px; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }

/* Selector de cuentas y barra «dentro como agencia» */
.ws-wrap { position: relative; }
.workspace.switchable { cursor: pointer; }
.workspace.switchable:hover { border-color: var(--border-strong); }
.ws-chev { margin-left: auto; color: var(--faint); display: grid; place-items: center; }
.ws-chev svg { width: 15px; height: 15px; }
.ws-menu { position: absolute; top: calc(100% - 2px); left: 0; right: 0; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .2s var(--ease); min-width: 250px; }
.ws-search { position: relative; margin-bottom: 4px; }
.ws-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); }
.ws-search .input { height: 36px; padding-left: 34px; font-size: 13px; }
#ws-list { max-height: 320px; overflow: auto; }
.ws-item { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.ws-item:hover { background: var(--surface-2); }
.ws-item.on { background: var(--accent-soft); }
.ws-item img { width: 28px; height: 28px; object-fit: contain; border-radius: 8px; }
.ws-item .avatar { width: 28px; height: 28px; font-size: 11px; }
.ws-item .ws-n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-item .ws-n i { font-style: normal; color: var(--danger); font-size: 11.5px; }
.ws-item > svg { width: 15px; height: 15px; color: var(--text-2); }
.ws-item .chip { height: 21px; font-size: 10.5px; padding: 0 7px; }
.ws-menu .none { padding: 12px; text-align: center; color: var(--muted); font-size: 13px; }
.ws-manage { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 9px 8px 5px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--text-2); text-decoration: none; }
.ws-manage svg { width: 15px; height: 15px; }
.agency-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 30px 0; padding: 9px 10px 9px 14px; border-radius: 14px; background: var(--text); color: #fff; font-size: 13.5px; box-shadow: var(--shadow); }
.agency-bar > svg { width: 17px; height: 17px; opacity: .8; }
.agency-bar span { flex: 1; min-width: 180px; }
.agency-bar .ab-link { color: rgba(255,255,255,.75); font-weight: 600; font-size: 13px; }
.agency-bar .btn { background: #fff; color: var(--text); border-color: transparent; }

/* Acceso: invitación y contraseña olvidada */
.auth-link { all: unset; justify-self: center; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.auth-link:hover { color: var(--text); }
.auth-ok { display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--text-2); }
.auth-ok svg { width: 30px; height: 30px; color: var(--success); }
.auth-ok p { margin: 0; line-height: 1.55; }
/* Verificación en dos pasos: código del login y «Tu cuenta» (cifras tabulares de la fuente de la marca, nada de monoespaciadas) */
.tf-code { font: 600 20px/1 var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: .16em; text-align: center; }
.tf-code::placeholder { letter-spacing: .16em; }
.uc-me { all: unset; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; border-radius: 10px; }
.uc-me:hover .who b { color: var(--accent); }
.uc-me:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
#tf .err { color: var(--danger); font-size: 13px; font-weight: 600; line-height: 1.45; }
#tf .err:empty { display: none; }
.tf-me { display: flex; align-items: center; gap: 12px; margin: -4px 0 16px; }
.tf-me b { display: block; }
.tf-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface-2); }
.tf-box p { margin: 10px 0 0; line-height: 1.5; }
.tf-head { display: flex; align-items: center; gap: 8px; }
.tf-head > svg { width: 18px; height: 18px; flex: none; }
.tf-head .chip { margin-left: auto; }
.chip.tf-on { background: var(--success-bg); color: var(--success); border-color: transparent; }
.tf-warn { color: var(--warn); font-weight: 600; }
.modal .actions .spacer { flex: 1; }
.tf-steps { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); }
.tf-qr { width: 200px; margin: 0 auto; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; }
.tf-qr svg { display: block; width: 100%; height: auto; }
.tf-alt { text-align: center; margin: 8px 0 0; }
.tf-manual { margin-top: 10px; }
.tf-manual summary { cursor: pointer; font-weight: 700; color: var(--text-2); }
.tf-key { font: 700 15px/1.5 var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: .08em; padding: 10px 12px; margin: 8px 0 6px; border-radius: var(--radius-sm); background: var(--surface-2); word-break: break-all; user-select: all; }
.tf-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; padding: 14px; border-radius: var(--radius); background: var(--warn-bg); border: 1px dashed var(--warn); }
.tf-codes span { font: 700 15px/1.4 var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: .06em; text-align: center; color: var(--text); user-select: all; }

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: 1fr; }
  .agency-bar { margin: 10px 16px 0; }
  .sa-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .sa-head .sa-title .page-title { font-size: 26px; }
}

/* ── Grabador (pantalla + cámara + micro, tipo Loom) ──────────── */
.rec-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rec-top h2 { margin: 0; }
.rec-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
/* Maqueta 16:9 con la burbuja donde saldrá (diámetro y márgenes en % del ancho, igual que en el vídeo) */
.rec-stage { --d: 15.19%; --mx: 2.25%; --my: 4%; position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; color: rgba(255,255,255,.5);
  background: radial-gradient(120% 90% at 50% 30%, #2B2B33, #111115 72%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.rec-stage[data-size="s"] { --d: 11.25%; }
.rec-stage[data-size="l"] { --d: 20.25%; }
.rec-screen { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.rec-screen svg { width: 34px; height: 34px; opacity: .7; }
.rec-bubble { position: absolute; left: var(--mx); bottom: var(--my); width: var(--d); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #000;
  box-shadow: 0 0 0 2px rgba(255,255,255,.92), 0 10px 26px rgba(0,0,0,.5); transition: all .28s var(--ease); }
.rec-stage[data-pos^="t"] .rec-bubble { bottom: auto; top: var(--my); }
.rec-stage[data-pos$="r"] .rec-bubble { left: auto; right: var(--mx); }
.rec-bubble video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.rec-stage[data-mode="screen"] .rec-bubble { opacity: 0; transform: scale(.6); }
.rec-stage[data-mode="camera"] .rec-bubble { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.rec-stage[data-mode="camera"] .rec-screen { display: none; }
.rec-msg { position: absolute; inset: 0; display: grid; place-content: center; padding: 22px; text-align: center; background: rgba(14,14,18,.88); color: #fff; font-size: 13px; line-height: 1.5; }
.rec-opts { display: grid; gap: 12px; }
.rec-modes { display: flex; width: 100%; }
.rec-modes button { flex: 1; justify-content: center; padding: 7px 4px; font-size: 12.5px; white-space: nowrap; }
.rec-opts .pills button { padding: 6px 11px; }
.rec-meter { display: block; height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin-top: 2px; }
.rec-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--success); transition: width .08s linear; }
.rec-tip { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; }

/* Panel flotante mientras se graba (oscuro, como los controles de grabación de siempre) */
.rec-panel { position: fixed; left: 18px; bottom: 18px; z-index: 80; width: 280px; overflow: hidden; border-radius: 18px; background: #141418; color: #fff;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06); animation: pop .3s var(--ease); }
.rec-mini { display: block; width: 100%; height: auto; background: #000; }
.rec-panel.no-mini .rec-mini { display: none; }
.rec-body { display: grid; gap: 10px; padding: 12px 14px 14px; }
.rec-row { display: flex; align-items: center; gap: 9px; }
.rec-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(217,45,53,.25); animation: recPulse 1.4s ease-in-out infinite; }
.rec-dot.paused { background: #F5B300; box-shadow: none; animation: none; }
.rec-time { font: 700 22px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.rec-state { margin-left: auto; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.6); }
.rec-sub { font-size: 12px; color: rgba(255,255,255,.62); }
.rec-sub.warn { color: #FFB86B; }
.rec-count { padding: 6px 0 0; text-align: center; font: 800 54px/1 var(--font-display); }
.rec-actions { display: flex; gap: 8px; }
.rec-actions .btn { flex: 1; justify-content: center; background: rgba(255,255,255,.09); color: #fff; border-color: transparent; }
.rec-actions .btn:hover { background: rgba(255,255,255,.16); }
.rec-actions .btn.btn-stop { background: var(--danger); }
.rec-actions .btn.btn-stop:hover { background: var(--danger); filter: brightness(1.1); }
.rec-actions .btn.btn-icon { flex: none; }
.rec-actions .btn svg { width: 14px; height: 14px; }
.rec-panel .bar { background: rgba(255,255,255,.14); }
.rec-panel .bar i { background: #fff; }
.rec-spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; animation: recSpin .8s linear infinite; }
@keyframes recPulse { 50% { opacity: .45; } }
@keyframes recSpin { to { transform: rotate(360deg); } }
.rec-done { text-align: center; }
.rec-done-ico { display: grid; place-items: center; width: 52px; height: 52px; margin: 4px auto 10px; border-radius: 50%; background: var(--success-bg); color: var(--success); }
.rec-done-ico svg { width: 26px; height: 26px; }
.rec-link { display: block; margin: 6px 0 8px; padding: 9px 11px; word-break: break-all; text-align: left; }
.rec-done .actions { justify-content: center; }
@media (max-width: 760px) {
  .rec-grid { grid-template-columns: 1fr; }
  .rec-panel { left: 12px; right: 12px; width: auto; }
}

/* ── VSL (tipo Vidalytics): lista, analítica, diseño, test A/B y ficha ──────── */
.tabs a.tab { text-decoration: none; }
.vsl-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.vsl-note svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--muted); }
.vsl-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; text-align: center; transition: border-color .2s; }
.vsl-drop:hover { border-color: var(--accent-line); }
.vsl-drop svg { width: 22px; height: 22px; color: var(--muted); }
.vsl-drop small { color: var(--muted); font-weight: 500; }
.vsl-media { display: grid; gap: 8px; max-height: 50vh; overflow: auto; margin: 6px 0; }
.vsl-mrow { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.vsl-mthumb { width: 86px; aspect-ratio: 16/9; flex: none; border-radius: 8px; background: #16161B center/cover; }
.vsl-chart { position: relative; padding: 4px 16px 6px; }
.vsl-svg { display: block; width: 100%; height: auto; overflow: visible; }
.vsl-svg text { font: 600 11px var(--font-body); fill: var(--faint); }
.vsl-svg .g { stroke: var(--border); stroke-width: 1; }
.vsl-svg .a { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.vsl-svg .l { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
.vsl-svg .cta { stroke: var(--success); stroke-width: 1.5; stroke-dasharray: 4 4; }
.vsl-svg .ctat { fill: var(--success); font-weight: 700; }
.vsl-tip { position: absolute; z-index: 2; pointer-events: none; padding: 6px 10px; border-radius: 9px; background: var(--text); color: #fff; font-size: 12.5px; white-space: nowrap; box-shadow: var(--shadow); }
.vsl-cross { position: absolute; top: 18px; bottom: 36px; width: 1px; margin-left: 16px; background: var(--text-2); opacity: .35; pointer-events: none; }
.vsl-drops { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 4px 20px 18px; }
.vsl-table td, .vsl-table th { white-space: nowrap; }
.vsl-daily { padding: 0 16px 14px; }
.vsl-daily .b { fill: color-mix(in srgb, var(--accent) 70%, transparent); }
.vsl-daily .ld { fill: var(--success); }
.vsl-design { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.vsl-form { padding: 18px 20px; display: grid; gap: 16px; }
.vsl-f { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: start; }
.vsl-f > span { font-size: 12.5px; font-weight: 700; color: var(--text-2); padding-top: 7px; }
.vsl-f > div { display: grid; gap: 6px; }
.vsl-f small { font-size: 12px; }
.vsl-f input[type="color"] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); }
.vsl-prev { position: sticky; top: 16px; }
.vsl-prev-box { border-radius: var(--radius); background: #0A0A0A; padding: 22px; min-height: 120px; color: #bbb; }
.vsl-cta-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.2fr) auto auto; gap: 6px; align-items: center; }
.vsl-ab tr.off td { opacity: .55; }
.vsl-lab { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 13px; }
.vsl-watch { display: grid; gap: 6px; }
.vsl-map { display: flex; gap: 1px; height: 10px; border-radius: 3px; overflow: hidden; }
.vsl-map i { flex: 1; background: var(--accent); }
@media (max-width: 1280px) {
  .vsl-design { grid-template-columns: 1fr; }
  .vsl-prev { position: static; order: -1; max-width: 720px; }
}
@media (max-width: 760px) { .vsl-cta-row { grid-template-columns: 64px 1fr; } }

/* ── Facturas (VERI*FACTU) ─────────────────────────────── */
.iv-callout { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.iv-callout svg { width: 16px; height: 16px; flex: none; }
.iv-callout > span { flex: 1; min-width: 220px; }
.iv-bad { background: var(--danger-bg); color: var(--danger); }
.iv-grid td.num, .iv-grid th.num, .iv-mini .num { text-align: right; font-variant-numeric: tabular-nums; }
.iv-grid tr.iv-off td { opacity: .5; text-decoration: line-through; text-decoration-color: var(--faint); }
.iv-grid .chip-xs, .iv-series .chip-xs { height: 20px; font-size: 10.5px; padding: 0 7px; }
.iv-editor, .iv-view { display: flex; flex-direction: column; gap: 16px; }
.iv-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.iv-bottom { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.iv-view .iv-top { grid-template-columns: minmax(0, 1fr) 230px; }
.iv-pick { display: flex; gap: 8px; align-items: center; }
.iv-pick .input { flex: 1; }
.iv-lines { display: flex; flex-direction: column; gap: 6px; }
.iv-line { display: grid; grid-template-columns: minmax(180px, 1fr) 76px 104px 70px 150px 104px 34px; gap: 8px; align-items: start; }
.iv-line textarea { resize: none; min-height: 38px; overflow: hidden; line-height: 1.4; }
.iv-line .num { text-align: right; }
.iv-line-h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 4px; }
.iv-amt { padding-top: 10px; font-variant-numeric: tabular-nums; }
.iv-tot { padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; }
.iv-tr { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.iv-tr b { font-variant-numeric: tabular-nums; color: var(--text); }
.iv-tr .input-sm { width: auto; display: inline-block; margin-left: 6px; }
.iv-big { border-top: 1px solid var(--border); padding-top: 10px; font-size: 15px; font-weight: 700; color: var(--text); }
.iv-big b { font: 700 20px/1.1 var(--font-display); letter-spacing: -.02em; }
.iv-tot-inline { padding: 14px 0 0; max-width: 340px; margin-left: auto; }
.iv-sum { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.iv-parties { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.iv-parties > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.iv-parties b { font-size: 15px; }
.iv-parties a { color: var(--text-2); font-weight: 700; display: inline-flex; gap: 5px; align-items: center; margin-top: 4px; }
.iv-parties a svg { width: 14px; height: 14px; }
.iv-dates { flex-direction: row !important; gap: 22px !important; }
.iv-dates > span { display: flex; flex-direction: column; gap: 3px; }
label.field > span.iv-ophint { font-weight: 500; color: var(--text-2); margin-top: -2px; }
label.field > span.iv-ophint.is-err { color: var(--danger); }
.iv-mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.iv-mini th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 6px; border-bottom: 1px solid var(--border-strong); }
.iv-mini td { padding: 9px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.iv-qr-card .panel-body { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.iv-qr { width: 150px; height: 150px; }
.iv-qr svg { width: 100%; height: 100%; display: block; }
.iv-qr-card a { color: var(--text-2); font-weight: 700; display: inline-flex; gap: 5px; align-items: center; }
.iv-qr-card a svg { width: 13px; height: 13px; }
.iv-qr-card .stack { width: 100%; }
.iv-recs { display: flex; flex-direction: column; }
.iv-rec { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 8px; border-bottom: 1px solid var(--border); }
.iv-rec:last-child { border-bottom: 0; }
.iv-rec > div { display: flex; flex-direction: column; gap: 4px; }
.iv-rec-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.iv-seq { font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 7px 0; text-align: center; }
.iv-cert { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--success-bg); color: var(--success); }
.iv-cert.warn { background: var(--warn-bg); color: var(--warn); }
.iv-cert > svg { width: 20px; height: 20px; flex: none; }
.iv-cert > div { flex: 1; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.iv-series { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.iv-series > span:first-of-type { flex: 1; }
a.iv-crow { text-decoration: none; color: inherit; }
@media (max-width: 1100px) { .iv-top, .iv-bottom, .iv-view .iv-top { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .iv-line { grid-template-columns: 1fr 1fr 1fr; }
  .iv-line textarea { grid-column: 1 / -1; }
  .iv-line select { grid-column: span 2; }
  .iv-line-h { display: none; }
}

/* ── Gastos ─────────────────────────────────────────────── */
#ex.ex-drop { outline: 2px dashed var(--accent-line); outline-offset: -8px; border-radius: var(--radius); background: var(--accent-soft); }
.ex-tray-h { display: flex; flex-direction: column; gap: 2px; }
.ex-up-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; font-size: 13px; }
.ex-up-row > svg { width: 16px; height: 16px; color: var(--muted); }
.ex-up-row.ok > svg { color: var(--success); } .ex-up-row.err > svg { color: var(--danger); }
.ex-up-row > .small { grid-column: 2; }
.ex-up-row > .btn { grid-row: 1 / span 2; grid-column: 3; }
.ex-up-n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-cats .panel-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 18px; padding: 14px 18px; }
.ex-cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; border: 0; background: none; padding: 6px 4px; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; color: var(--text-2); }
.ex-cat:hover, .ex-cat.on { background: var(--surface-2); }
.ex-cat span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-cat b { font-size: 13px; font-variant-numeric: tabular-nums; }
.ex-cat i { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--accent); opacity: .75; }
.ex-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); gap: 16px; align-items: start; }
.ex-doc { position: sticky; top: 12px; height: calc(100vh - 160px); min-height: 420px; overflow: hidden; display: flex; }
.ex-doc iframe { border: 0; width: 100%; height: 100%; }
.ex-doc > a { display: flex; width: 100%; height: 100%; align-items: flex-start; justify-content: center; overflow: auto; background: var(--surface-2); }
.ex-doc img { max-width: 100%; height: auto; display: block; }
.ex-nodoc { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; padding: 30px; color: var(--text-2); }
.ex-nodoc svg { width: 30px; height: 30px; color: var(--muted); }
.ex-form { min-width: 0; }
.ex-ai[data-color="green"] { background: var(--success-bg); color: var(--success); }
.ex-ai[data-color="red"] { background: var(--danger-bg); color: var(--danger); }
.ex-bd { display: grid; grid-template-columns: minmax(0, 1.2fr) 96px minmax(0, 1fr) 34px; gap: 8px; align-items: center; margin-bottom: 6px; }
.ex-bd .num { text-align: right; }
.ex-bd-h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
@media (max-width: 1100px) { .ex-layout { grid-template-columns: 1fr; } .ex-doc { position: static; height: 60vh; } }

/* ── Bancos ─────────────────────────────────────────────── */
.bk-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.bk-acc { text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: border-color .15s; }
.bk-acc.on { border-color: var(--c, var(--accent)); box-shadow: 0 0 0 1px var(--c, var(--accent)), var(--shadow); }
.bk-acc-top { display: flex; align-items: center; gap: 8px; }
.bk-acc-top .pc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.bk-acc-top .gear-btn svg { width: 15px; height: 15px; color: var(--muted); }
.bk-bal { font: 300 30px/1.1 var(--font-display); letter-spacing: -.03em; }
.bk-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.bk-row { display: grid; grid-template-columns: 70px minmax(180px, 1fr) 110px minmax(0, 560px); gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.bk-row:last-child { border-bottom: 0; }
.bk-row.done { background: var(--surface-2); }
.bk-date { color: var(--muted); font-size: 13px; }
.bk-concept { min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-amt { text-align: right; font-variant-numeric: tabular-nums; }
.bk-amt.pos { color: var(--success); } .bk-amt.neg { color: var(--text); }
.bk-act { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.bk-act { min-width: 0; }
.bk-act .btn { min-width: 0; white-space: nowrap; flex: none; }
.bk-act .btn[data-take] { flex: 0 1 auto; max-width: 300px; overflow: hidden; }
.bk-act .btn svg { flex: none; }
.bk-lab { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bk-found { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; margin: 10px 0; }
.bk-found-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.bk-found-row:hover { border-color: var(--border-strong); }
.bk-found-row > span { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 900px) { .bk-row { grid-template-columns: 64px minmax(0, 1fr) auto; } .bk-act { grid-column: 1 / -1; justify-content: flex-start; } }

/* ── Impuestos ──────────────────────────────────────────── */
.tx-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 16px; }
.tx-sum > span:first-child { font-weight: 700; color: var(--muted); font-size: 13px; }
.tx-sum b { font: 300 32px/1.1 var(--font-display); letter-spacing: -.03em; }
.tx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.tx-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.tx-head { display: flex; gap: 12px; align-items: center; }
.tx-head > div { display: flex; flex-direction: column; }
.tx-model { font: 700 15px/1 var(--font-display); background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 9px 10px; min-width: 50px; text-align: center; }
.tx-res { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tx-res b { font: 300 28px/1.1 var(--font-display); letter-spacing: -.03em; }
.tx-meta .chip svg { width: 12px; height: 12px; }
.tx-note { margin: 0; }
.tx-warn { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--warn); display: flex; flex-direction: column; gap: 3px; }
.tx-prev { gap: 8px; align-items: center; color: var(--text-2); }
.tx-boxes { border-top: 1px solid var(--border); padding-top: 8px; }
.tx-boxes summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.tx-boxes summary svg { width: 15px; height: 15px; }
.tx-boxes summary .btn { margin-left: auto; }
.tx-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.tx-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tx-table tr:last-child td { border-bottom: 0; }
.tx-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-table td.mono { color: var(--muted); width: 48px; }
.iv-tray-list { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.iv-orig { overflow: hidden; flex-shrink: 0; }
.iv-editor > *, .iv-view > * { flex-shrink: 0; }
.iv-orig summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 14px 18px; font-weight: 700; }
.iv-orig summary svg { width: 16px; height: 16px; color: var(--muted); }
.iv-orig iframe { width: 100%; height: 620px; border: 0; border-top: 1px solid var(--border); display: block; background: var(--surface-2); }
.iv-mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; }
.iv-mode:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.iv-mode > span { display: flex; flex-direction: column; gap: 3px; }
.iv-mode input { margin-top: 4px; }
.st-panel { padding: 16px 18px; }
.st-steps { display: flex; align-items: flex-start; gap: 10px; }
.st-step { flex: 1; display: flex; gap: 10px; min-width: 0; opacity: .6; }
.st-step.current, .st-step.done { opacity: 1; }
.st-step > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-step .btn { align-self: flex-start; margin-top: 6px; }
.st-n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2); }
.st-step.current .st-n { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.st-step.done .st-n { background: var(--success-bg); color: var(--success); border-color: transparent; }
.st-n svg { width: 15px; height: 15px; }
.st-line { flex: 0 0 24px; height: 1px; background: var(--border-strong); margin-top: 14px; }
.st-link { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.st-link svg { width: 14px; height: 14px; }
@media (max-width: 760px) { .st-steps { flex-direction: column; } .st-line { display: none; } }
.iv-paylink { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.iv-paylink > svg { width: 15px; height: 15px; flex: none; }
.iv-paylink > span { flex: 1; min-width: 180px; }
.bk-conn { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--success); }
.bk-conn.bad { color: var(--danger); }
.bk-conn svg { width: 13px; height: 13px; }
.bk-row.prop { background: color-mix(in srgb, var(--info-bg) 55%, transparent); }
.bk-prop { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 380px; padding: 3px 3px 3px 12px; border-radius: 100px; background: var(--surface); border: 1px solid var(--border); }
.bk-prop .bk-lab { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.bk-prop .btn { padding-inline: 8px; }
.bk-conn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.ob-steps { display: grid; gap: 8px; padding-left: 18px; margin: 4px 0 12px; }
.ob-url { font-size: 12px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); word-break: break-all; }
.cb-list { max-height: 360px; overflow-y: auto; margin-top: 10px; }
.cb-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; background: #fff; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.cb-list .bk-found-row > svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.cb-list .bk-found-row > span.row { flex-direction: row; align-items: center; }
.ex-mail { margin-bottom: 16px; }
.ex-mail-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; flex-wrap: wrap; }
.ex-mail-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.ex-mail-ico svg { width: 17px; height: 17px; }
.ex-mail-txt { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ex-mail-addr { font-weight: 700; font-size: 14px; padding: 7px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); user-select: all; word-break: break-all; }
.ex-mail-list { border-top: 1px solid var(--border); padding: 10px 18px 14px; display: grid; gap: 8px; }
.ex-mail-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.ex-mail-who { display: flex; flex-direction: column; min-width: 0; }
.ex-mail-who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-when { align-items: center; flex-wrap: wrap; gap: 8px; }
.vf-when .input { width: auto; }

/* ── Etiquetas de facturas y gastos ───────────────────── */
/* Colores de las series de los gráficos (orden validado para daltonismo sobre blanco) */
:root { --s-blue: #2a78d6; --s-orange: #eb6834; --s-teal: #1baf7a; --s-yellow: #eda100; --s-pink: #e87ba4; --s-green: #008300; --s-purple: #6250d6; --s-red: #e34948; --s-gray: #c3c3cb; }
.tag-chip { gap: 5px; }
.tag-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tag-line { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag-line .chip-xs { margin-left: 0; }
.tag-field { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 36px; }
.tag-pop { position: absolute; z-index: 60; width: 270px; padding: 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); }
.tag-pop-list { display: grid; gap: 2px; max-height: 240px; overflow-y: auto; margin-bottom: 8px; }
.tag-opt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 9px; cursor: pointer; }
.tag-opt:hover { background: var(--surface-2); }
.tag-opt.off { opacity: .45; cursor: default; }
.tag-opt .chip { gap: 6px; }
.tag-opt .chip .dot, .tag-row .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-pop-new { display: flex; gap: 6px; }
.tag-pop-new .input { flex: 1; min-width: 0; }
.tag-pop-manage { width: 100%; justify-content: flex-start; margin-top: 6px; }
.tag-admin { display: grid; gap: 8px; margin: 14px 0; max-height: 50vh; overflow-y: auto; }
.tag-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 70px 34px; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.tag-row-main { display: grid; gap: 6px; }
.tag-use { line-height: 1.3; text-align: right; }
.tag-swatch { position: relative; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.tag-swatch i { width: 14px; height: 14px; border-radius: 50%; }
.tag-swatch select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tag-swatch[data-color="blue"] i { background: var(--s-blue); } .tag-swatch[data-color="orange"] i { background: var(--s-orange); }
.tag-swatch[data-color="teal"] i { background: var(--s-teal); } .tag-swatch[data-color="yellow"] i { background: var(--s-yellow); }
.tag-swatch[data-color="pink"] i { background: var(--s-pink); } .tag-swatch[data-color="green"] i { background: var(--s-green); }
.tag-swatch[data-color="purple"] i { background: var(--s-purple); } .tag-swatch[data-color="red"] i { background: var(--s-red); }
.tag-admin-new { display: flex; gap: 8px; }
.tag-admin-new .input { flex: 1; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 13px; }
.bulk-bar .input { width: auto; }
.bulk-bar[hidden] { display: none; }
.grid th.pick-col, .grid td.pick-col { width: 34px; padding-right: 0; }
.pick-col input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }
.iv-tagrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 2px; }

/* ── Analítica contable ───────────────────────────────── */
.an-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.an-filters .input { width: auto; }
.an.an-busy > * { opacity: .55; transition: opacity .2s; }
.an-panel { margin-bottom: 16px; }
.an-panel .panel-head .spacer { flex: 1; }
.an-chart { padding: 4px 16px 10px; }
.an-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.an-gridl { stroke: var(--border); stroke-width: 1; }
.an-base { stroke: var(--border-strong); stroke-width: 1; }
.an-ax { fill: var(--muted); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.an-hit { fill: transparent; }
.an-col { outline: none; }
.an-col:hover .an-hit, .an-col:focus-visible .an-hit { fill: rgba(20, 20, 30, .04); }
.an-col.dim path { opacity: .3; }
.an-line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.an-line.prev { stroke: var(--faint); }
.an-area { fill: var(--text); opacity: .05; }
.an-dot { fill: var(--text); stroke: var(--surface); stroke-width: 2; }
.an-end { fill: var(--text); font-size: 12px; font-weight: 800; }
.an-pt { outline: none; }
.an-cross { stroke: var(--border-strong); stroke-width: 1; opacity: 0; }
.an-pt:hover .an-cross, .an-pt:focus-visible .an-cross { opacity: 1; }
.an-seg { fill: none; cursor: default; outline: none; transition: stroke-width .15s var(--ease); }
.an-seg:hover, .an-seg:focus-visible { stroke-width: 26px; }
.an-donut { width: 100%; max-width: 190px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.an-dn-v { fill: var(--text); font: 400 19px var(--font-display); letter-spacing: -.02em; }
.an-dn-l { fill: var(--muted); font-size: 11px; font-weight: 600; }
.an-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.an-grid2 > .an-panel { margin-bottom: 16px; }
.an-split { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: center; padding: 6px 20px 8px; }
.an-split-v { grid-template-columns: 170px minmax(0, 1fr); }
.an-pie { padding: 6px 0; }
.an-table { margin: 0; }
.an-table .grid { font-size: 13px; }
.an-table tr.an-on td { background: var(--accent-soft); }
.an-rows { display: grid; gap: 10px; }
.an-rows-pad { padding: 8px 20px 14px; }
.an-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) 88px 52px; gap: 12px; align-items: center; font-size: 13px; }
.an-row .track { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.an-row .fill { height: 100%; border-radius: 0 4px 4px 0; transition: width .9s var(--ease); }
.an-row .num { text-align: right; }
.an-rows-pad .an-row { grid-template-columns: minmax(0, 1.7fr) minmax(60px, 1fr) 88px 52px; outline: none; border-radius: 8px; }
.an-rows-pad .an-row:hover, .an-rows-pad .an-row:focus-visible { background: var(--surface-2); box-shadow: 0 0 0 6px var(--surface-2); }
/* Junto a un quesito, la lista hace de leyenda: sin barra, para que quepa el nombre */
.an-split-v .an-row { grid-template-columns: minmax(0, 1fr) auto 50px; }
.an-split-v .an-row .track { display: none; }
.an-split-v .an-key { white-space: normal; line-height: 1.3; }
.an-table .an-key { white-space: normal; }
.an-table td:first-child { white-space: normal; max-width: none; min-width: 190px; }
.an-table td:first-child .chip { margin: 2px 0 0; }
.an-key { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-key i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.an-key a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.an-key a:hover { text-decoration: underline; }
.an-foot { padding: 0 20px 16px; margin: 4px 0 0; }
.an-foot a { font-weight: 700; color: var(--text); }
.an-late { color: var(--danger); font-weight: 700; }
.an-empty { display: flex; gap: 14px; align-items: flex-start; }
.an-empty > svg { width: 22px; height: 22px; flex: none; color: var(--muted); margin-top: 2px; }
.an-empty p { margin: 4px 0 12px; max-width: 640px; }
.an-tip { position: fixed; z-index: 80; pointer-events: none; min-width: 170px; padding: 10px 12px; border-radius: 12px; background: var(--text); color: #fff; font-size: 12px; box-shadow: var(--shadow-lg); }
.an-tip > b { display: block; margin-bottom: 6px; font-size: 12px; }
.an-tip-r { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; line-height: 1.7; }
.an-tip-r i { width: 9px; height: 9px; border-radius: 3px; }
.an-tip-r b { font-variant-numeric: tabular-nums; }
.an-dso { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.an-dso b { font: 300 30px/1.1 var(--font-display); letter-spacing: -.03em; }
.an-buckets { display: grid; gap: 6px; }
.an-bucket { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 28px; gap: 10px; align-items: center; font-size: 13px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.an-bucket.zero { opacity: .5; }
.an-st { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #fff; }
.an-st svg { width: 13px; height: 13px; }
.an-st-ok .an-st { background: #0ca30c; } .an-st-warn .an-st { background: #fab219; color: #3a2800; }
.an-st-serious .an-st { background: #ec835a; } .an-st-crit .an-st { background: #d03b3b; }
.an-overdue { display: grid; gap: 4px; margin-top: 4px; }
.an-od { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; font-size: 13px; }
.an-od:hover { background: var(--surface-2); }
.an-od span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .an-grid2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .an-split, .an-split-v { grid-template-columns: 1fr; }
  .an-row, .an-rows-pad .an-row { grid-template-columns: minmax(0, 1fr) 80px 44px; }
  .an-row .track { display: none; }
  .an-filters { width: 100%; }
  .tag-row { grid-template-columns: 34px minmax(0, 1fr) 34px; } .tag-use { display: none; }
}
.bk-kind-sel { width: auto; max-width: 170px; }
.bk-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.bk-kind { display: inline-flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.bk-kind b { font-variant-numeric: tabular-nums; }
.bk-kind.key { background: var(--accent-soft); border-color: var(--accent-line); }
a.kpi { color: inherit; text-decoration: none; } a.kpi:hover { border-color: var(--border-strong); }
.range-pick { gap: 6px; } .range-pick .input { width: auto; }
/* ── Presentado por la gestoría ── */
.tx-review { margin-bottom: 16px; }
.tx-review .panel-head h3 { margin: 0; }
.tx-point { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); display: grid; gap: 2px; }
.tx-ask { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.tx-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border: 1.5px dashed var(--border-strong); border-radius: 14px; cursor: pointer; text-align: center; }
.tx-drop:hover { background: var(--surface-2); }
.tx-drop > svg { width: 22px; height: 22px; color: var(--muted); }
.tf-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto 34px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
/* ── Selector de fechas de un botón ── */
.rp-btn { gap: 6px; }
.rp-btn svg:last-child { width: 13px; height: 13px; opacity: .6; }
.rp-pop { position: absolute; z-index: 60; display: grid; grid-template-columns: 150px auto; gap: 14px; padding: 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); }
.rp-presets { display: grid; gap: 2px; align-content: start; border-right: 1px solid var(--border); padding-right: 10px; }
.rp-presets button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.rp-presets button:hover { background: var(--surface-2); }
.rp-presets button.on { background: var(--accent-soft); font-weight: 700; }
.rp-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rp-months { display: grid; grid-template-columns: repeat(2, 224px); gap: 18px; }
.rp-mt { display: block; text-align: center; font-size: 13px; margin-bottom: 6px; }
.rp-grid { display: grid; grid-template-columns: repeat(7, 32px); row-gap: 2px; }
.rp-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); padding: 4px 0; }
.rp-d { height: 32px; border: 0; background: none; font-size: 13px; cursor: pointer; border-radius: 9px; font-variant-numeric: tabular-nums; }
.rp-d:hover { background: var(--surface-3); }
.rp-d.today { font-weight: 800; color: var(--accent-ink-strong, var(--text)); text-decoration: underline; text-underline-offset: 3px; }
.rp-d.in { background: var(--accent-soft); border-radius: 0; }
.rp-d.edge { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.rp-d.lo { border-radius: 9px 0 0 9px; }
.rp-d.hi { border-radius: 0 9px 9px 0; }
@media (max-width: 760px) {
  .rp-pop { grid-template-columns: 1fr; left: 12px !important; right: 12px; }
  .rp-presets { grid-template-columns: repeat(2, 1fr); border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 8px; }
  .rp-months { grid-template-columns: 224px; } .rp-month + .rp-month { display: none; }
}

/* ── «Hoy»: panel por bloques ─────────────────────────── */
.td-kpis .td-kpi { text-align: left; cursor: pointer; font: inherit; color: inherit; text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.td-kpis .td-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.td-kpi.alert { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.td-go { position: absolute; right: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); opacity: 0; transition: opacity .2s; }
.td-go svg { width: 14px; height: 14px; }
.td-kpi:hover .td-go { opacity: 1; }
.kpi.key .td-go { background: rgba(255, 255, 255, .2); }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.bento > * { animation: rise .5s var(--ease) both; }
.bento > *:nth-child(2) { animation-delay: .05s; } .bento > *:nth-child(3) { animation-delay: .1s; } .bento > *:nth-child(4) { animation-delay: .15s; }
.bento > *:nth-child(5) { animation-delay: .2s; } .bento > *:nth-child(6) { animation-delay: .25s; }
.b-meet { grid-column: span 5; } .b-bill { grid-column: span 7; }
.b-wa { grid-column: span 4; } .b-tasks { grid-column: span 4; } .b-follow { grid-column: span 4; }
.b-vsl { grid-column: span 12; }
.b-tasks > .panel { height: 100%; }
.b-card { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.b-card .panel-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.b-card .panel-head h3 svg { width: 17px; height: 17px; }
.b-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 16px; color: var(--muted); font-size: 13px; }
.b-empty svg { width: 22px; height: 22px; opacity: .6; }
.b-list { display: grid; padding: 4px 10px 12px; }
.b-foot { display: flex; align-items: center; gap: 6px; padding: 0 20px 14px; margin: 0; color: var(--warn); }
.b-foot svg { width: 14px; height: 14px; }
.b-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.b-eyebrow svg { width: 14px; height: 14px; }

/* Reuniones: línea de tiempo */
.b-timeline { position: relative; padding: 4px 12px 14px; }
.b-timeline::before { content: ''; position: absolute; left: 73px; top: 14px; bottom: 22px; width: 2px; background: var(--surface-3); border-radius: 2px; }
.b-slot { display: grid; grid-template-columns: 50px 14px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.b-time { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.b-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); position: relative; z-index: 1; }
.b-slot.live .b-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.b-slot.past { opacity: .55; }

/* Facturación: tarjeta oscura */
.b-bill { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 22%, #1C1C21) 0%, #141418 60%); color: #fff; border-color: transparent; padding: 20px 22px 16px; overflow: hidden; }
.b-bill-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.b-bill .b-eyebrow { color: rgba(255, 255, 255, .7); }
.b-big { font: 300 52px/1.05 var(--font-display); letter-spacing: -.035em; margin: 10px 0 10px; font-variant-numeric: normal; }
.b-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; color: rgba(255, 255, 255, .65); }
.b-chips .delta.up { background: rgba(48, 164, 108, .22); color: #7EE2A8; } .b-chips .delta.down { background: rgba(229, 72, 77, .22); color: #FF9A9E; } .b-chips .delta.flat { background: rgba(255, 255, 255, .12); color: #fff; }
.b-bill-btn { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .16); }
.b-bill-btn:hover { background: rgba(255, 255, 255, .18); }
.b-chart { margin: 14px -4px 6px; }
.b-spark { width: 100%; height: 120px; display: block; overflow: visible; }
.b-spark .b-prev { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 2; stroke-linejoin: round; }
.b-spark .b-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.b-spark .b-area { fill: var(--accent); opacity: .14; }
.b-spark .b-end { fill: var(--accent); stroke: #141418; stroke-width: 2; }
.b-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.b-bill .b-legend { color: rgba(255, 255, 255, .6); }
.b-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.b-legend i.cur { background: var(--accent); } .b-legend i.prev { background: rgba(255, 255, 255, .35); }

/* WhatsApp */
.b-badge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: #25D366; color: #fff; }
.b-conv { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; color: inherit; text-decoration: none; }
.b-conv:hover { background: var(--surface-2); }
.b-conv .avatar { width: 36px; height: 36px; font-size: 12px; }
.b-conv-txt { display: grid; min-width: 0; }
.b-conv-txt b, .b-conv-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-conv-txt span { font-size: 12px; color: var(--muted); }
.b-conv.unread .b-conv-txt span { color: var(--text-2); font-weight: 600; }
.b-conv-meta { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: var(--faint); }
.b-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #25D366; color: #fff; font-weight: 800; display: grid; place-items: center; }

/* Seguimientos */
.b-fu { display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.b-when { font-size: 12px; font-weight: 800; text-transform: capitalize; padding: 4px 8px; border-radius: 9px; background: var(--surface-2); text-align: center; }
.b-when.now { background: var(--accent); color: var(--accent-ink); }

/* VSL */
.b-vsl-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: center; padding: 4px 20px 18px; }
.b-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.b-stats div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.b-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.b-stats b { font: 300 30px/1.1 var(--font-display); letter-spacing: -.03em; }
.b-stats em { font-style: normal; font-size: 11px; color: var(--faint); }
.b-vchart svg { width: 100%; height: 96px; display: block; overflow: visible; }
.b-vchart .b-v { fill: var(--surface-3); } .b-vchart .b-p { fill: var(--accent); }
.b-vchart .b-ax { fill: var(--muted); font-size: 11px; font-weight: 600; text-transform: capitalize; }
.b-vchart .b-legend { margin-top: 6px; } .b-legend i.v { background: var(--surface-3); height: 8px; width: 8px; } .b-legend i.p { background: var(--accent); height: 8px; width: 8px; }

/* Cola de leads (uno a uno) */
.qm-head { display: flex; align-items: center; justify-content: space-between; }
.qm-bar { height: 4px; border-radius: 4px; background: var(--surface-3); margin: 10px 0 16px; overflow: hidden; }
.qm-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s var(--ease); }
.qm-card { display: flex; gap: 14px; align-items: flex-start; }
.qm-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qm-av { width: 48px; height: 48px; font-size: 15px; flex: none; }
.qm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.qm-hist { display: grid; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); max-height: 210px; overflow: auto; }
.qm-h b { font-size: 13px; }
.qm-h p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.qm-log { display: grid; gap: 8px; margin-bottom: 12px; }
.qm-log textarea { resize: vertical; min-height: 64px; }
.qm-done { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft, var(--surface-2)); display: grid; gap: 6px; }
.qm-done summary { cursor: pointer; list-style: none; }
.qm-done summary::-webkit-details-marker { display: none; }
.qm-done[open] summary { margin-bottom: 4px; }
.qm-done-full { max-height: 52vh; overflow: auto; background: none; padding: 0; gap: 10px; }
.qm-done-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.qm-done-row[data-goto] { cursor: pointer; }
.qm-done-row[data-goto]:hover { border-color: var(--text-3, var(--border)); }
.qm-done-row p { margin: 2px 0 4px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.qm-done-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qm-done-ico { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); }
.qm-done-ico svg { width: 15px; height: 15px; }
.qm-done-next { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.qm-done-next svg { width: 13px; height: 13px; }
.qm-mine { display: grid; gap: 6px; margin-top: 14px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--accent); }
.qm-mine svg { width: 14px; height: 14px; vertical-align: -2px; }
.qm-rescue { display: grid; gap: 8px; margin: -4px 0 14px; padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--border); }
.qm-rs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qm-rs-head svg { width: 14px; height: 14px; vertical-align: -2px; }
.qm-rs-lines { margin: 2px 0; padding: 0; list-style: none; counter-reset: rs; display: grid; gap: 4px; }
.qm-rs-lines li { counter-increment: rs; display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.4; padding: 5px 8px; border-radius: 8px; cursor: pointer; background: var(--surface-2); }
.qm-rs-lines li::before { content: counter(rs); flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--surface); border: 1px solid var(--border); }
.qm-rs-lines li.next { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.qm-rs-lines li.ok { color: var(--text-2); }
.qm-rs-lines li.ok::before { content: '✓'; background: var(--accent); border-color: var(--accent); color: #111; }
.qm-rs-ed { display: grid; gap: 6px; }
.qm-rs-ed textarea { resize: vertical; font-size: 13px; }
.qm-next { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }

@media (max-width: 1100px) {
  .b-meet, .b-bill { grid-column: span 12; }
  .b-wa, .b-tasks, .b-follow { grid-column: span 6; }
  .b-follow { grid-column: span 12; }
  .b-vsl-body { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .bento > * { grid-column: span 12 !important; }
  .b-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-big { font-size: 40px; }
}

/* Publicidad: calculadoras de escalado por cliente */
.ad-new { display: flex; gap: 10px; padding: 14px; margin-bottom: 16px; }
.ad-new .input { flex: 1; }
.ad-frame-wrap { padding-top: 0; }
.ad-frame { display: block; width: 100%; height: calc(100vh - 170px); min-height: 640px; border: 0; border-radius: 20px; background: #000; }
@media (max-width: 640px) { .ad-new { flex-direction: column; } .ad-frame { height: calc(100vh - 120px); border-radius: 14px; } }
.ad-back { display: flex; width: fit-content; margin-bottom: 4px; }

/* Asistente de facturación (Facturas → Asistente) */
.ba-chat { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow: auto; margin: 6px 0 12px; }
.ba-chat:empty { display: none; }
.ba-msg { max-width: 88%; }
.ba-msg p { margin: 0; line-height: 1.45; }
.ba-msg.me { align-self: flex-end; background: var(--text); color: var(--surface); padding: 8px 13px; border-radius: 14px 14px 4px 14px; font-size: 14px; }
.ba-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); padding: 9px 13px; border-radius: 14px 14px 14px 4px; font-size: 14px; }
.ba-msg.err { color: var(--danger); }
.ba-msg:has(.ba-card) { max-width: 100%; width: 100%; }
.ba-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ba-card { display: grid; gap: 6px; }
.ba-card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.ba-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.ba-total { font-size: 16px; padding-top: 6px; border-top: 1px solid var(--border); }
.ba-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ba-input { display: flex; gap: 8px; align-items: center; }
.ba-input .input { flex: 1; }
.ba-mic.on { background: var(--danger); border-color: var(--danger); color: #fff; animation: ba-pulse 1.2s ease-in-out infinite; }
@keyframes ba-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .35); } 50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } }

/* Editor de facturas: formulario a la izquierda y vista previa del PDF a la derecha */
.ed-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 0.9fr); gap: 18px; align-items: start; }
.ed-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ed-split .iv-top, .ed-split .iv-bottom { grid-template-columns: 1fr; }
.ed-pv { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; height: calc(100vh - 110px); min-height: 520px; }
.ed-pv-head { display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.ed-pv iframe, .iv-design-pv iframe { flex: 1; width: 100%; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
@media (max-width: 1180px) { .ed-split { grid-template-columns: 1fr; } .ed-pv { position: static; height: 80vh; } }
/* Ajustes → Diseño de la factura */
.iv-design { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.iv-design-pv { display: flex; height: 560px; }
.iv-sw { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; }
.iv-logo img { height: 44px; max-width: 160px; object-fit: contain; display: block; }
@media (max-width: 900px) { .iv-design { grid-template-columns: 1fr; } }

/* Justificantes (gastos y facturas) */
.ev-list { display: grid; gap: 8px; }
.ev-item { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px 10px; background: var(--surface-2); }
.ev-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ev-note { margin: 2px 0 4px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.ev-file { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.ev-add textarea { resize: vertical; min-height: 56px; }
.ev-file span { white-space: nowrap; }

/* Bancos: ver el documento antes de conciliar */
.bk-pv { height: min(70vh, 760px); display: flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.bk-pv iframe { flex: 1; border: 0; background: #fff; }
.bk-pv img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.bk-pv .empty { margin: auto; }
.bk-found-line { display: flex; gap: 6px; align-items: center; }
.bk-found-line .bk-found-row { flex: 1; }

/* Cabeceras que ordenan (Clientes y proveedores) */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover, .th-sort.on { color: var(--text); }
.th-arrow { display: inline-block; width: 12px; margin-left: 4px; font-size: 9px; }
.bk-search { width: 100%; margin: 4px 0 12px; }
.bk-search .input { width: 100%; }
.bk-why { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; flex-wrap: wrap; }
.bk-none { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.bk-none > div { display: flex; flex-direction: column; gap: 3px; }

/* Facturas recurrentes */
.rec-cta .panel-body { align-items: center; gap: 12px; padding: 14px 18px; }
.rec-cta .panel-body > span:not(.spacer) { display: flex; flex-direction: column; gap: 2px; }
.rec-cta.on { border-color: var(--accent); }
.rec-off td { opacity: .55; }
tr[data-r] { cursor: pointer; }
.rec-lines { display: grid; gap: 6px; }
.rec-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 120px 150px 32px; gap: 6px; align-items: center; }
.rec-head { padding: 0 2px; }
.rec-total { font-size: 20px; padding-top: 6px; }
@media (max-width: 700px) { .rec-line { grid-template-columns: 1fr 60px 90px; } .rec-line select, .rec-line [data-rm] { grid-column: span 1; } }
.rec-cta .panel-body > svg { width: 20px; height: 20px; flex: none; color: var(--muted); }

/* Bancos: repartir un ingreso entre facturas */
.sp-list { display: grid; gap: 14px; max-height: 52vh; overflow: auto; margin-bottom: 4px; }
.sp-group { display: grid; gap: 6px; }
.sp-gh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px; flex-wrap: wrap; }
.sp-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 130px 32px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.sp-row.on { border-color: var(--text); background: var(--surface); }
.sp-inv { display: flex; flex-direction: column; min-width: 0; }
.sp-pend { display: flex; flex-direction: column; align-items: flex-end; }
.sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px 0; border-top: 1px solid var(--border); margin-top: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .sp-row { grid-template-columns: 22px 1fr 110px; } .sp-pend, .sp-row [data-pv] { display: none; } }
.bk-none > svg { width: 22px; height: 22px; flex: none; color: var(--faint); margin-top: 2px; }
.sp-inv .chip { align-self: flex-start; margin: 2px 0; }

/* Asistente de dominio propio */
.dom-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.dom-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink, #fff); font-weight: 700; font-size: 13px; }
.dom-recs { display: grid; gap: 8px; }
.dom-rec { display: grid; grid-template-columns: 70px minmax(90px, 1fr) minmax(140px, 2fr) auto; gap: 10px; align-items: end; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.dom-rec > div { display: flex; flex-direction: column; gap: 2px; position: relative; }
.dom-rec > div .btn { position: absolute; right: -6px; bottom: -4px; }
.dom-rec b { font-size: 14px; padding-right: 28px; }
.dom-val { word-break: break-all; }
.dom-prov { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; line-height: 1.55; }
.dom-prov summary { cursor: pointer; }
.dom-progress { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.dom-progress li.pending { color: var(--faint); }
.dom-progress li span { display: inline-block; width: 16px; font-weight: 800; }
.dom-live { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.dom-live > svg { color: var(--success); flex: none; margin-top: 2px; }
@media (max-width: 640px) { .dom-rec { grid-template-columns: 1fr 1fr; } }
button.nav-item { border: 0; background: none; width: 100%; font: inherit; text-align: left; cursor: pointer; }

/* Publicidad: tabla de seguimiento por campaña y mes (dentro del CRM) */
.adt-wrap { max-height: none; }
table.adt { font-size: 13px; }
.adt th, .adt td { padding: 9px 12px; max-width: none; }
.adt tbody tr { cursor: default; }
.adt th.adt-calc, .adt td.adt-calc { background: var(--surface-2); }
.adt .chip { font-variant-numeric: tabular-nums; }
.adt td.adt-name, .adt th.adt-name { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 230px; max-width: 320px; }
.adt th.adt-name { background: var(--surface-2); z-index: 3; }
.adt-camp td { border-top: 1px solid var(--border); font-weight: 700; }
.adt-cwrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.adt-cname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.adt-chev svg { transition: transform .15s; }
.adt-chev.open svg { transform: rotate(90deg); }
.adt-month td.adt-name { padding-left: 46px; font-weight: 600; color: var(--muted); }
.adt-add td { padding: 4px 12px 10px 40px; }
.adt-input { width: 96px; height: 30px; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 0 8px; text-align: right; font: inherit; font-variant-numeric: tabular-nums; color: var(--text); }
.adt-input:hover { border-color: var(--border); background: var(--surface-2); }
.adt-input:focus { outline: none; border-color: var(--text); background: var(--surface); }
.adt-input[readonly] { color: var(--text); pointer-events: none; }
.adt-cname-in, .adt-mes-in { width: 100%; text-align: left; font-weight: 700; }
.adt tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 800; border-top: 1px solid var(--border); }
@media (max-width: 640px) { .adt td.adt-name, .adt th.adt-name { min-width: 150px; max-width: 170px; } .adt-month td.adt-name { padding-left: 30px; } }
