/* SIEM Chat — hoja de estilos única
   Tipografía: Plus Jakarta Sans. Cada sección tiene su color (--accent). */
:root {
  --bg: #F5F6FA; --surface: #FFFFFF; --surface-2: #F8FAFC; --border: #E5E8EF; --border-2: #D7DCE5;
  --text: #0F172A; --text-2: #334155; --muted: #64748B;
  --side: #0B1220; --side-2: #121B2E; --side-text: #B6C0D3;
  --accent: #2563EB; --ok: #16A34A; --warn: #D97706; --bad: #DC2626;
  --radius: 12px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.06);
  --bubble-in: #FFFFFF; --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
[data-theme="dark"] {
  --bg: #0B1020; --surface: #121a2c; --surface-2: #0f1626; --border: #222c42; --border-2: #2d3954;
  --text: #E7ECF5; --text-2: #C3CCDB; --muted: #8A96AD; --bubble-in: #19233a;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; display: flex; }
a { color: inherit; text-decoration: none; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; border: 1px solid var(--border); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.ic { flex-shrink: 0; }

/* ---------- Barra lateral ---------- */
.sidebar { width: 248px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; flex-shrink: 0; height: 100vh; position: sticky; top: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; color: #fff; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-txt b { font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
.brand-txt b i, .brand-i { font-style: normal; background: linear-gradient(90deg, #22C55E, #0EA5E9 60%, #818CF8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-txt small { color: var(--side-text); font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(14,165,233,.35)); }
.logo-dot { width: 26px; height: 26px; border-radius: 8px; background: conic-gradient(from 210deg, #2563EB, #7C3AED, #DB2777, #EA580C, #16A34A, #2563EB); display: inline-block; box-shadow: inset 0 0 0 5px rgba(255,255,255,.18); }
nav { flex: 1; overflow-y: auto; padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s; }
.nav-item .nav-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.active { background: color-mix(in srgb, var(--c) 22%, var(--side)); color: #fff; }
.nav-item.active .nav-ic { background: var(--c); color: #fff; }
.nav-item .pill { margin-left: auto; }
.side-foot { border-top: 1px solid #1c2740; padding: 12px; display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.me b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--side-text); font-size: 11.5px; }
.side-foot .icon-btn { color: var(--side-text); }

/* ---------- Estructura principal ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.topbar { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.page-title { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.title-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.content { flex: 1; overflow-y: auto; padding: 24px; }
body[data-page="inbox"] .content { padding: 0; overflow: hidden; }
.only-mobile { display: none; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-h h3 { flex: 1; }
.card-b { padding: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0,1fr); }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

.btn { font: inherit; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; transition: filter .15s, background .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 9px; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: #F59E0B; }

input, select, textarea { font: inherit; font-weight: 500; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 9px 12px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { resize: vertical; min-height: 80px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span2 { grid-column: span 2; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }

.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); white-space: nowrap; }
.pill.red { background: var(--bad); color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.u0 { color: var(--ok); } .u1 { color: #0EA5E9; } .u2 { color: var(--warn); } .u3 { color: var(--bad); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 12.5px; flex-shrink: 0; background: #94A3B8; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .ic { width: 40px; height: 40px; color: var(--accent); opacity: .6; margin-bottom: 8px; }

.stat { padding: 18px; border-top: 3px solid var(--accent); }
.stat small { color: var(--muted); font-weight: 600; font-size: 12px; }
.stat b { display: block; font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; font-size: 12px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex-direction: row; font-weight: 600; }
.switch input { display: none; }
.switch span { width: 36px; height: 20px; border-radius: 999px; background: var(--border-2); position: relative; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch em { font-style: normal; font-size: 12.5px; color: var(--muted); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; transition: transform .25s; z-index: 99; box-shadow: var(--shadow); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--bad); color: #fff; }
.modal { position: fixed; inset: 0; background: rgba(2,6,23,.55); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); border-radius: 16px; width: min(640px, 100%); max-height: 90vh; overflow-y: auto; padding: 24px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-box h3 { margin-bottom: 16px; font-size: 17px; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.ok-box, .err-box, .info-box { padding: 12px 14px; border-radius: 10px; margin: 10px 0; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.ok-box { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.err-box { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.info-box { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text-2); font-weight: 500; }

/* ---------- Login / instalador ---------- */
.auth-page { align-items: center; justify-content: center; background: radial-gradient(circle at 20% 10%, #1e3a8a 0, transparent 40%), radial-gradient(circle at 80% 90%, #7C3AED 0, transparent 35%), #0B1220; padding: 24px; overflow-y: auto; }
.auth-card { background: var(--surface); width: min(400px, 100%); padding: 32px; border-radius: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.35); margin: auto; }
.auth-card.wide { width: min(720px, 100%); }
.brand-lg { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.brand-lg small { font-size: 13px; color: var(--muted); font-weight: 600; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks .ok { color: var(--ok); } .checks .bad { color: var(--bad); }

/* ---------- Bandeja ---------- */
.inbox { display: grid; grid-template-columns: 210px 340px minmax(0,1fr) 320px; height: 100%; }
.inbox > div { min-height: 0; }
.folders { border-right: 1px solid var(--border); padding: 14px 10px; overflow-y: auto; background: var(--surface); }
.folder { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 13px; }
.folder:hover { background: var(--surface-2); }
.folder.active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.folder .n { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.folder-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 14px 10px 6px; }
.convs { border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--surface); }
.convs-h { padding: 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 12.5px; padding: 6px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.conv-list { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; }
.conv:hover { background: var(--surface-2); }
.conv.active { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.conv.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.conv .meta { flex: 1; min-width: 0; }
.conv .row1 { display: flex; gap: 6px; align-items: center; }
.conv .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.conv .time { font-size: 11.5px; color: var(--muted); }
.conv .prev { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv .row3 { display: flex; gap: 6px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.conv .unread { background: var(--accent); color: #fff; min-width: 20px; height: 20px; border-radius: 999px; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.chan-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chat { display: flex; flex-direction: column; background: var(--bg); }
.chat-h { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.chat-h .who { flex: 1; min-width: 90px; }
.chat-h .who b, .chat-h .who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-h .who small { color: var(--muted); }
.chat-h select { width: auto; max-width: 160px; height: 34px; padding: 0 10px; }
.msgs { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; background-image: radial-gradient(color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.day { align-self: center; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface); padding: 3px 10px; border-radius: 999px; margin: 10px 0; border: 1px solid var(--border); }
.bubble { max-width: min(72%, 560px); padding: 9px 12px 6px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(15,23,42,.06); }
.bubble.in { background: var(--bubble-in); align-self: flex-start; border-top-left-radius: 4px; border: 1px solid var(--border); }
.bubble.out { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); align-self: flex-end; border-top-right-radius: 4px; }
.bubble.out.bot { background: color-mix(in srgb, #7C3AED 12%, var(--surface)); }
.bubble.note { background: #FEF3C7; color: #78350F; align-self: flex-end; border: 1px dashed #F59E0B; }
.bubble .ft { display: flex; justify-content: flex-end; gap: 6px; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.bubble .ft .read { color: #0EA5E9; }
.bubble .ft .failed { color: var(--bad); }
.bubble img, .bubble video { max-width: 260px; border-radius: 10px; display: block; margin-bottom: 4px; }
.bubble audio { max-width: 260px; }
.sysmsg { align-self: center; font-size: 12px; color: var(--muted); text-align: center; max-width: 80%; }
.composer { background: var(--surface); border-top: 1px solid var(--border); padding: 10px 14px; }
.composer .tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.composer .tabs button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 12.5px; padding: 5px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.composer .tabs button.active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.composer .tabs button[data-mode="note"].active { background: #FEF3C7; color: #92400E; }
.composer .box { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 160px; resize: none; }
.composer .warn { font-size: 12.5px; color: var(--warn); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.qr-pop { position: absolute; bottom: 100%; left: 14px; right: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; }
.qr-pop div { padding: 8px 12px; cursor: pointer; }
.qr-pop div:hover, .qr-pop div.sel { background: var(--surface-2); }
.qr-pop b { color: var(--accent); margin-right: 8px; }
.side-panel { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.sp-sec { padding: 16px; border-bottom: 1px solid var(--border); }
.sp-sec h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.ai-card { border: 1px solid color-mix(in srgb, #4F46E5 30%, var(--border)); background: color-mix(in srgb, #4F46E5 6%, var(--surface)); border-radius: 12px; padding: 12px; }
.ai-card p { margin: 0 0 8px; line-height: 1.5; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; font-size: 13px; align-items: center; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.kv select, .kv input { padding: 5px 8px; height: 30px; font-size: 12.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: #fff; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; opacity: .8; }
.note-item { background: #FFFBEB; border: 1px solid #FDE68A; color: #78350F; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 8px; }
.note-item small { display: block; opacity: .7; margin-top: 4px; }
.chat-empty { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kcol { width: 280px; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.kcol-h { padding: 12px 14px; display: flex; align-items: center; gap: 8px; font-weight: 700; border-top: 4px solid var(--c); border-radius: 14px 14px 0 0; }
.kcol-h .sum { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.kcards { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); }
.kcard b { display: block; }
.kcard small { color: var(--muted); }
.kcard.dragging { opacity: .5; }
.kcards.over { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 10px; }

/* ---------- Flujos ---------- */
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px; background: var(--surface); }
.step-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 700; }
.step-h .num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; }
.step-h .sp { flex: 1; }
.opt-row { display: grid; grid-template-columns: 1fr 180px 34px; gap: 6px; margin-top: 6px; }

/* ---------- Barras de analítica ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 80px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar-row .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.spark div { flex: 1; background: color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 5px 5px 0 0; min-height: 2px; position: relative; }
.spark div:hover::after { content: attr(data-l); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 11px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.spark-x { display: flex; gap: 4px; font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.spark-x span { flex: 1; text-align: center; }

/* ---------- Responsive ---------- */
#folderSel { display: none; }
@media (max-width: 1560px) { .inbox { grid-template-columns: 320px minmax(0,1fr) 300px; } .folders { display: none; } #folderSel { display: block; } }
@media (max-width: 1080px) { .inbox { grid-template-columns: 300px minmax(0,1fr); } .side-panel { display: none; } .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 760px) {
  .sidebar { position: fixed; left: -260px; z-index: 40; transition: left .2s; }
  .sidebar.open { left: 0; }
  .only-mobile { display: inline-grid; }
  .content { padding: 16px; }
  .topbar { padding: 0 12px; }
  .switch em { display: none; }
  .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-chat .convs { display: none; }
  .inbox:not(.has-chat) .chat { display: none; }
  .bar-row { grid-template-columns: 100px 1fr 60px; }
}

/* Tarjeta de anuncio (Click to WhatsApp) */
.ad-card{border:1px solid var(--border);border-radius:12px;overflow:hidden;background:var(--surface)}
.ad-card img{display:block;width:100%;max-height:160px;object-fit:cover}
.ad-card>div{padding:10px 12px;font-size:13px}
.ad-card p{margin:4px 0 6px;color:var(--muted)}
.ad-card .kv{margin-top:6px}
label.check { display: flex; gap: 8px; align-items: center; flex-direction: row; font-weight: 500; }
.kcol-h .auto-btn { width: 26px; height: 26px; font-size: 13px; opacity: .45; } .kcol-h .auto-btn.on { opacity: 1; background: #FEF3C7; }
label.check input[type=checkbox] { width: 18px; height: 18px; flex: none; padding: 0; margin: 0; border: 0; box-shadow: none; accent-color: var(--accent, #2563EB); }

/* =====================================================================
   Fondos de marca (estilo "escritorio" con paneles flotantes)
   Colores WaChat: verde #22C55E · cielo #0EA5E9 · índigo #6366F1 · noche #0B1530
   Se activa con <html data-wall="aurora|oceano|selva|noche">; "clásico" = sin fondo.
   ===================================================================== */
html[data-wall="aurora"] { --wall: radial-gradient(1200px 700px at 85% 110%, rgba(34,197,94,.75), transparent 60%), radial-gradient(900px 600px at 10% -10%, rgba(99,102,241,.95), transparent 60%), linear-gradient(128deg, #1E1B4B 0%, #3730A3 24%, #0369A1 55%, #0EA5E9 72%, #16A34A 100%); }
html[data-wall="oceano"] { --wall: radial-gradient(1000px 600px at 90% 0%, rgba(14,165,233,.7), transparent 60%), radial-gradient(800px 600px at 0% 100%, rgba(99,102,241,.55), transparent 60%), linear-gradient(160deg, #0B1530 0%, #0C4A6E 55%, #0284C7 100%); }
html[data-wall="selva"] { --wall: radial-gradient(1000px 700px at 100% 100%, rgba(163,230,53,.45), transparent 55%), radial-gradient(900px 600px at 0% 0%, rgba(14,165,233,.45), transparent 60%), linear-gradient(140deg, #052E2B 0%, #065F46 45%, #16A34A 85%); }
html[data-wall="noche"] { --wall: radial-gradient(800px 500px at 15% 10%, rgba(99,102,241,.45), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(34,197,94,.3), transparent 60%), radial-gradient(600px 400px at 70% 20%, rgba(14,165,233,.25), transparent 60%), #070B1A; }

html[data-wall] body:not(.auth-page) { background: var(--wall); background-attachment: fixed; }
/* Brillo diagonal muy sutil, como el de la burbuja del logo */
html[data-wall] body:not(.auth-page)::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.07) 44%, transparent 52%); }

html[data-wall] .sidebar { background: rgba(6, 11, 30, .52); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%); border-right: 1px solid rgba(255,255,255,.08); --side-text: #D5DEEE; }
html[data-wall] .nav-item:hover { background: rgba(255,255,255,.08); }
html[data-wall] .nav-item.active { background: rgba(255,255,255,.14); box-shadow: inset 3px 0 0 var(--c); }
html[data-wall] .side-foot { border-top-color: rgba(255,255,255,.1); }

html[data-wall] .topbar { background: transparent; border-bottom: 0; color: #fff; }
html[data-wall] .page-title { text-shadow: 0 1px 12px rgba(0,0,0,.25); }
html[data-wall] .title-ic { background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(8px); }
html[data-wall] .topbar .icon-btn { color: rgba(255,255,255,.85); }
html[data-wall] .topbar .icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
html[data-wall] .switch em { color: rgba(255,255,255,.9); }
html[data-wall] .switch span { background: rgba(255,255,255,.3); }

html[data-wall] .content { padding-top: 6px; }
/* Texto suelto sobre el fondo */
html[data-wall] .content > p.muted, html[data-wall] .content > .toolbar > .muted, html[data-wall] .content > .toolbar > p.muted, html[data-wall] .content > .toolbar > .grow.muted { color: rgba(255,255,255,.88); }
html[data-wall] .content > .toolbar a.badge, html[data-wall] .content > form.toolbar .muted { color: rgba(255,255,255,.9); }
html[data-wall] .content > .info-box { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.18); }
html[data-wall] .content > .info-box .ic, html[data-wall] .content > .info-box b { color: #fff; }
html[data-wall] .card { border-color: transparent; border-radius: 16px; box-shadow: 0 10px 30px rgba(3,7,30,.18); }
html[data-wall] .toolbar .btn:not(.primary) { border-color: transparent; box-shadow: 0 2px 8px rgba(3,7,30,.12); }

/* Bandeja: paneles flotantes */
html[data-wall] body[data-page="inbox"] .content { padding: 0 16px 16px; }
html[data-wall] .inbox { gap: 10px; }
html[data-wall] .inbox > .folders, html[data-wall] .inbox > .convs, html[data-wall] .inbox > .chat, html[data-wall] .inbox > .side-panel { border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(3,7,30,.2); }
html[data-wall] .chat { background: var(--surface-2); }

/* Embudos: columnas de vidrio y etapas en flecha */
html[data-wall] .kcol { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(14px); border-radius: 14px; }
html[data-wall] .kcol-h { border-top: 0; margin: 8px 8px 0; padding: 9px 26px 9px 14px; border-radius: 8px 0 0 8px; background: var(--c); color: #fff; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
html[data-wall] .kcol-h .chan-dot { display: none; }
html[data-wall] .kcol-h .pill.cnt { background: rgba(255,255,255,.25); color: #fff; }
html[data-wall] .kcol-h .sum { color: rgba(255,255,255,.9); }
html[data-wall] .kcol-h .auto-btn { color: #fff; opacity: .7; }
html[data-wall] .kcol-h .auto-btn.on { background: rgba(255,255,255,.3); opacity: 1; }
html[data-wall] .kcard { border: 0; border-radius: 12px; box-shadow: 0 4px 14px rgba(3,7,30,.14); }
html[data-wall] .kcards.over { background: rgba(255,255,255,.2); }

/* Selector de fondo */
.wall-pick { position: relative; }
.wall-pop { position: absolute; right: 0; top: 44px; z-index: 50; background: var(--surface); color: var(--text); border-radius: 14px; box-shadow: 0 18px 50px rgba(3,7,30,.3); padding: 12px; width: 260px; }
.wall-pop[hidden] { display: none; }
.wall-pop p { margin: 0 0 10px; font-weight: 700; font-size: 13px; }
.wall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wall-grid button { border: 2px solid transparent; border-radius: 10px; height: 56px; cursor: pointer; padding: 0; position: relative; overflow: hidden; font: inherit; }
.wall-grid button span { position: absolute; left: 6px; bottom: 4px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.wall-grid button.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--surface) inset; }
.wall-grid button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) { html[data-wall] .sidebar { background: rgba(6, 11, 30, .92); } }
@media (prefers-reduced-transparency: reduce) { html[data-wall] .sidebar, html[data-wall] .kcol { backdrop-filter: none; background: rgba(6,11,30,.9); } }
.wall-sw-aurora { background: linear-gradient(128deg, #1E1B4B, #3730A3 30%, #0EA5E9 70%, #16A34A); }
.wall-sw-oceano { background: linear-gradient(160deg, #0B1530, #0C4A6E 55%, #0284C7); }
.wall-sw-selva { background: linear-gradient(140deg, #052E2B, #065F46 45%, #16A34A); }
.wall-sw-noche { background: radial-gradient(circle at 20% 20%, rgba(99,102,241,.6), transparent 60%), #070B1A; }
.wall-sw-clasico { background: linear-gradient(90deg, #0B1220 30%, #F5F6FA 30%); }
.wall-sw-clasico span { color: #0B1220 !important; text-shadow: none !important; left: auto !important; right: 6px; }
html[data-wall] .card { overflow: clip; }
html[data-wall] .kcol-h { white-space: nowrap; min-width: 0; }
html[data-wall] .kcol-h .sum { flex-shrink: 0; }
.kcol-h { min-width: 0; }
.kcol-h .kname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Pestañas sobre el fondo (Ajustes, periodos de Analíticas, embudos): vidrio + activa en blanco */
html[data-wall] .content > .toolbar > a.btn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.22); box-shadow: none; backdrop-filter: blur(10px); }
html[data-wall] .content > .toolbar > a.btn:hover { background: rgba(255,255,255,.24); }
html[data-wall] .content > .toolbar > a.btn.primary { background: #fff; color: var(--accent); border-color: #fff; box-shadow: 0 4px 14px rgba(3,7,30,.18); }

/* Gráficos con el degradado de la marca */
.spark div { background: linear-gradient(180deg, #0EA5E9, #22C55E); opacity: .9; }
.bar-row .fill { background: linear-gradient(90deg, #22C55E, #0EA5E9); }

/* ---------- Ingreso ---------- */
.auth-page { background: radial-gradient(1200px 700px at 85% 110%, rgba(34,197,94,.75), transparent 60%), radial-gradient(900px 600px at 10% -10%, rgba(99,102,241,.95), transparent 60%), linear-gradient(128deg, #1E1B4B 0%, #3730A3 24%, #0369A1 55%, #0EA5E9 72%, #16A34A 100%); position: relative; }
.auth-page::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.08) 44%, transparent 52%); }
.auth-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: center; width: min(1040px, 100%); margin: auto; }
.auth-pitch { color: #fff; }
.auth-pitch h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; font-weight: 800; letter-spacing: -.035em; margin: 0 0 18px; max-width: 14ch; text-wrap: balance; }
.auth-pitch p { font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.86); margin: 0 0 26px; max-width: 46ch; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.auth-pitch li { display: flex; gap: 10px; align-items: center; font-weight: 600; color: rgba(255,255,255,.92); }
.auth-pitch li i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.16); font-style: normal; font-size: 13px; }
.auth-page .auth-card { margin: 0; box-shadow: 0 30px 80px rgba(3,7,30,.35); }
.auth-page .auth-card .btn.primary { background: linear-gradient(90deg, #16A34A, #0EA5E9); border: 0; height: 44px; font-size: 14.5px; }
.auth-foot { position: fixed; left: 0; right: 0; bottom: 14px; text-align: center; color: rgba(255,255,255,.7); font-size: 12px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; gap: 24px; } .auth-pitch ul { display: none; } .auth-pitch h1 { font-size: 28px; } .auth-pitch p { margin-bottom: 0; } }

/* ---------- Ajustes para celular ---------- */
@media (max-width: 760px) {
  .topbar { height: 56px; gap: 8px; }
  .page-title { font-size: 17px; gap: 10px; }
  .title-ic { width: 32px; height: 32px; }
  .top-actions { gap: 4px; }
  html[data-wall] .content { padding: 4px 12px 16px; }
  html[data-wall] body[data-page="inbox"] .content { padding: 0 8px 8px; }

  /* Menú lateral como cajón con fondo oscuro detrás */
  .sidebar.open { box-shadow: 0 0 0 100vmax rgba(3,7,30,.5); }

  /* Barras de herramientas: buscadores a todo el ancho, botones en fila */
  .content > form.toolbar > input, .content > form.toolbar > select { flex: 1 1 100%; }
  .content > .toolbar .btn { flex: 0 0 auto; }
  .content > .toolbar > .grow:not(.muted) { display: none; }
  /* Pestañas (Ajustes, Analíticas): una sola fila deslizable */
  .content > .toolbar:has(> a.btn + a.btn) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px; }
  .content > .toolbar:has(> a.btn + a.btn)::-webkit-scrollbar { display: none; }

  /* Tablas: se deslizan dentro de su tarjeta */
  .card { overflow-x: auto !important; }
  .card > .tbl { min-width: 620px; }
  .card-b { overflow-wrap: anywhere; }
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat { padding: 14px; } .stat b { font-size: 22px; }

  /* Embudos: una columna por pantalla, deslizando con imán */
  .kanban { scroll-snap-type: x mandatory; margin: 0 -12px; padding: 0 12px 10px; }
  .kcol { width: 84vw; scroll-snap-align: center; max-height: calc(100vh - 230px); }

  /* Chat: nombre arriba, asignación y acciones en una segunda fila */
  .chat-h { height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 6px 8px; }
  .chat-h .who { flex: 1 1 0; min-width: 120px; }
  .chat-h select { order: 5; flex: 1 1 140px; height: 32px; }
  .chat-h .icon-btn { order: 6; width: 34px; height: 34px; }
  .chat-h #backBtn { order: 0; width: 28px; }
  .msgs { padding: 14px 12px; }
  .bubble { max-width: 86%; }
  .composer { padding: 8px 10px; }
  .composer .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .composer .tabs button { white-space: nowrap; }

  .modal { padding: 0; place-items: end center; }
  .modal-box { width: 100%; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; max-height: 92vh; }

  /* Ingreso: título corto y el formulario a la vista */
  .auth-page { padding: 20px 16px; flex-direction: column; }
  .auth-wrap { width: 100%; }
  .auth-page .auth-card { width: 100%; }
  .auth-pitch h1 { font-size: 26px; margin-bottom: 0; max-width: none; }
  .auth-pitch p, .auth-pitch ul { display: none; }
  .auth-wrap { gap: 18px; align-content: center; min-height: calc(100vh - 80px); }
  .auth-card { padding: 24px 20px; }
  .auth-foot { position: static; margin-top: 16px; }
}
.grid.split { grid-template-columns: minmax(0,1fr) var(--side-w, 320px); }
html[data-wall] .content > a.muted { color: rgba(255,255,255,.9); }
@media (max-width: 900px) { .grid.split { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 760px) { .opt-row { grid-template-columns: 1fr; gap: 6px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); } .opt-row > .icon-btn { justify-self: end; } }
/* Código y etiquetas sueltas sobre el fondo */
html[data-wall] .content > .toolbar code, html[data-wall] .content > .info-box code, html[data-wall] .content > p code { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.25); }
html[data-wall] .content > .toolbar > label { color: rgba(255,255,255,.92); }
@media (max-width: 760px) {
  .content > .toolbar > p, .content > .toolbar > label { flex: 1 1 100%; }
  .content > .toolbar > label select { width: 100%; }
  .card-h { flex-wrap: wrap; }
  .card-h h3 { flex: 1 1 100%; }
  .card-h select { flex: 1 1 0; min-width: 0; }
}

/* =====================================================================
   Tareas
   ===================================================================== */
.pill.amber { background: #F59E0B; color: #fff; }
.task-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 12px; min-height: 120px; }
html[data-wall] .tcol { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.22); backdrop-filter: blur(14px); }
.tcol h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 2px 4px 12px; }
html[data-wall] .tcol h3 { color: #fff; }
.tdot { width: 10px; height: 10px; border-radius: 50%; background: var(--d); box-shadow: 0 0 0 3px color-mix(in srgb, var(--d) 25%, transparent); }
.tlist { display: flex; flex-direction: column; gap: 8px; }
.tempty { margin: 6px 4px; font-size: 12.5px; }
html[data-wall] .tempty { color: rgba(255,255,255,.8); }
.tcard { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: 12px; padding: 10px 8px 10px 12px; box-shadow: 0 2px 10px rgba(3,7,30,.08); border: 1px solid var(--border); border-left: 3px solid #0EA5E9; transition: opacity .25s, transform .25s; }
.tcard.late { border-left-color: #EF4444; }
.tcard.today { border-left-color: #F59E0B; }
.tcard.done { border-left-color: #22C55E; opacity: .75; }
.tcard.done b { text-decoration: line-through; color: var(--muted); }
.tcard.leaving { opacity: 0; transform: translateX(8px); }
.tcard .tbody { flex: 1; min-width: 0; }
.tcard b { display: block; font-size: 13.5px; line-height: 1.35; }
.tcard small { color: var(--muted); font-size: 12px; }
.tcard small a { color: var(--accent); font-weight: 600; }
.tcard p { margin: 6px 0 0; font-size: 12.5px; color: var(--text-2); white-space: pre-wrap; }
.tcard .icon-btn { width: 28px; height: 28px; flex: none; }
.late-tag { color: #DC2626; font-weight: 700; }
.tcheck { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--border-2); background: var(--surface); cursor: pointer; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; margin-top: 1px; padding: 0; }
.tcheck:hover { border-color: #22C55E; background: color-mix(in srgb, #22C55E 15%, var(--surface)); }
.tcard.done .tcheck { background: #22C55E; border-color: #22C55E; }
.tcheck:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ctasks { display: flex; flex-direction: column; gap: 6px; }
.ctasks .tcard { box-shadow: none; padding: 8px 6px 8px 10px; }
.sp-sec h4 .btn.sm { text-transform: none; letter-spacing: 0; height: 26px; }
.quick-due { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }

/* Historial */
.timeline { display: flex; flex-direction: column; position: relative; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { display: flex; gap: 10px; position: relative; padding: 5px 0; }
.tl-ic { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: grid; place-items: center; font-size: 13px; z-index: 1; }
.tl-item p { margin: 3px 0 0; font-size: 13px; line-height: 1.4; }
.tl-item small { color: var(--muted); font-size: 11.5px; }
.timeline.mini .tl-item p { font-size: 12.5px; }
.k-stage .tl-ic { border-color: #6366F1; } .k-task .tl-ic { border-color: #F59E0B; } .k-done .tl-ic { border-color: #22C55E; } .k-ad .tl-ic, .k-form .tl-ic { border-color: #0EA5E9; }
.modal-box .timeline { max-height: 65vh; overflow-y: auto; }

/* =====================================================================
   Chat interno
   ===================================================================== */
body[data-page="teamchat"] .content { padding: 0; overflow: hidden; }
html[data-wall] body[data-page="teamchat"] .content { padding: 0 16px 16px; }
.tc { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 10px; height: 100%; }
.tc-rooms, .tc-main { background: var(--surface); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; box-shadow: 0 10px 30px rgba(3,7,30,.18); }
.tc-rooms { overflow-y: auto; }
.tc-rooms-h { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.tc-rooms-h input { flex: 1; }
.tc-people-h { padding: 14px 14px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tc-list { display: flex; flex-direction: column; padding: 0 6px; }
.tc-item { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 12px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.tc-item:hover { background: var(--surface-2); }
.tc-item.active { background: color-mix(in srgb, #0EA5E9 12%, var(--surface)); }
.tc-item .avatar { position: relative; flex: none; }
.tc-item .avatar .on, .tc-head .avatar .on { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22C55E; border: 2px solid var(--surface); }
.tc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-txt b, .tc-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-txt small { color: var(--muted); font-size: 12px; }
.tc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tc-meta small { color: var(--muted); font-size: 11px; }
.tc-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tc-head .who { flex: 1; min-width: 0; } .tc-head .who b, .tc-head .who small { display: block; } .tc-head .who small { color: var(--muted); font-size: 12px; }
.tc-msgs { background-color: var(--surface-2); }
.tc-author { display: block; font-size: 12px; margin-bottom: 2px; }
.tc-sys { align-self: center; background: color-mix(in srgb, #6366F1 10%, var(--surface)); border: 1px solid color-mix(in srgb, #6366F1 25%, transparent); max-width: 88%; }
.tc-contact { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 3px 8px; border-radius: 8px; margin-right: 6px; }
.tc .composer .box textarea { flex: 1; resize: none; min-height: 40px; }
.tc-main > .chat-empty { flex: 1; }
.group-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; max-height: 40vh; overflow-y: auto; }

@media (max-width: 1100px) { .task-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .task-board { grid-template-columns: 1fr; }
  .tc { grid-template-columns: 1fr; }
  .tc.has-room .tc-rooms { display: none; }
  .tc:not(.has-room) .tc-main { display: none; }
  html[data-wall] body[data-page="teamchat"] .content { padding: 0 8px 8px; }
  .group-people { grid-template-columns: 1fr; }
}
.pill[hidden] { display: none !important; }
[hidden] { display: none !important; } .tcol h3 [data-n]:empty { display: none; }
/* Adjuntos del chat interno */
.tc-clip { cursor: pointer; flex: none; }
.tc-up { font-size: 12.5px; color: var(--muted); padding: 0 4px 6px; }
.tc-main.drop { outline: 3px dashed #0EA5E9; outline-offset: -8px; }
.tc-img { display: block; margin: 2px 0 4px; }
.tc-img img { display: block; max-width: min(320px, 100%); max-height: 280px; border-radius: 10px; object-fit: cover; }
.tc-vid { display: block; max-width: min(360px, 100%); border-radius: 10px; margin: 2px 0 4px; }
.bubble audio { max-width: 100%; margin: 2px 0 4px; }
.tc-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0 4px; border-radius: 10px; background: color-mix(in srgb, var(--text) 6%, transparent); color: inherit; text-decoration: none; min-width: 200px; max-width: 320px; }
.tc-file:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.tc-file b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.tc-file small { color: var(--muted); font-size: 11.5px; }
.tc-fic { width: 38px; height: 44px; flex: none; border-radius: 6px; background: linear-gradient(160deg, #0EA5E9, #6366F1); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.mem-list { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow-y: auto; }
.mem { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.mem > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; font-weight: 600; font-size: 13.5px; }
.mem small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.tc-head #tcSound { font-size: 16px; }
/* Contador del chat interno bien visible */
.nav-item .pill[data-badge="chat"] { background: #EF4444; color: #fff; min-width: 22px; justify-content: center; box-shadow: 0 0 0 3px rgba(239,68,68,.25); animation: pillPulse 1.6s ease-in-out infinite; }
@keyframes pillPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.55); } 50% { box-shadow: 0 0 0 7px rgba(239,68,68,0); } }
@media (prefers-reduced-motion: reduce) { .nav-item .pill[data-badge="chat"] { animation: none; } }
/* Alertas emergentes */
#chatAlerts { position: fixed; top: 76px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.chat-alert { pointer-events: auto; display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 18px 50px rgba(3,7,30,.35); border-left: 4px solid #0EA5E9; animation: caIn .35s cubic-bezier(.2,.9,.3,1.2); transition: opacity .5s, transform .5s; }
.chat-alert.direct { border-left-color: #EF4444; }
.chat-alert.out { opacity: 0; transform: translateX(30px); }
.chat-alert .avatar { flex: none; }
.ca-body { flex: 1; min-width: 0; }
.ca-body b { display: block; font-size: 14px; }
.ca-body b small { font-weight: 500; color: var(--muted); }
.ca-body p { margin: 4px 0 10px; font-size: 13.5px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ca-actions { display: flex; gap: 6px; }
@keyframes caIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
@media (max-width: 760px) { #chatAlerts { top: 64px; left: 12px; right: 12px; width: auto; } }

/* Chat interno: opciones de mensaje, «Visto por» y borrados */
.tc-msgs .bubble { position: relative; padding-right: 30px; }
.tc-msgs .bubble.tc-sys { padding-right: 12px; }
.tc-more { position: absolute; top: 2px; right: 4px; border: 0; background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--muted); border-radius: 6px; width: 24px; height: 20px; line-height: 1; font-size: 15px; cursor: pointer; opacity: 0; transition: opacity .12s; }
.tc-msgs .bubble:hover .tc-more, .tc-more:focus-visible { opacity: 1; }
@media (hover: none) { .tc-more { opacity: .55; } }
.tc-menu { position: fixed; z-index: 1200; min-width: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); padding: 4px; display: grid; }
.tc-menu button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 7px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.tc-menu button:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tc-menu button.danger { color: var(--bad); }
.tc-seen { font-weight: 600; letter-spacing: .01em; cursor: default; }
.tc-seen.read { color: #0EA5E9; }
.bubble.tc-del { opacity: .75; }
.bubble.tc-del i { color: var(--muted); }
.bubble.tc-del-admin { border: 1px dashed var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--surface)); }
.bubble.tc-del-admin > div:not(.tc-deltag):not(.ft) { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.tc-deltag { font-size: 11px; font-weight: 600; color: var(--bad); margin-bottom: 4px; }
.seen-h { margin: 12px 0 6px; font-size: 13px; }

/* Invitaciones de usuario */
.invite-box { display: flex; gap: 8px; align-items: center; }
.invite-box input { flex: 1; min-width: 0; font-size: 12.5px; }
.hint-box { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.btn.wa { background: #25D366; border-color: #25D366; color: #fff; }
.btn.wa:hover { background: #1EBE5A; }
.row-actions { white-space: nowrap; }
.row-actions { text-align: right; padding-left: 4px !important; }
.row-actions .icon-btn { width: 30px; height: 30px; }
.tbl-scroll { overflow-x: auto; }
.tbl .badge { white-space: nowrap; }

/* Recordatorios */
.kind-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.kind-pick label { flex: 1; min-width: 110px; }
.kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.kind-pick span { display: block; text-align: center; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.kind-pick input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); }
.kind-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.mail-opt { font-size: 13.5px; }
.mail-opt small { font-size: 12px; }
.chat-alert.reminder { border-left-color: #F59E0B; background: color-mix(in srgb, #F59E0B 7%, var(--surface)); animation: caIn .35s cubic-bezier(.2,.9,.3,1.2), remindPulse 1.6s ease-in-out .4s 3; }
.chat-alert.reminder .ca-actions { flex-wrap: wrap; }
@keyframes remindPulse { 50% { box-shadow: 0 18px 50px rgba(3,7,30,.35), 0 0 0 6px color-mix(in srgb, #F59E0B 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .chat-alert.reminder { animation: none; } }

/* Embudo por defecto */
.pipe-default { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; margin: -4px 0 12px; color: var(--muted); }
.pipe-default label { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; color: inherit; }
html[data-wall] .content > .pipe-default { color: rgba(255,255,255,.92); }
.pipe-default select { width: auto; padding: 5px 8px; font-size: 13px; }
.pipe-default select { margin: 0 !important; }

/* Calendario de tareas */
.toolbar .seg { flex: none; }
.toolbar .seg button { padding: 6px 12px; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.cal-main, .cal-agenda { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; }
.cal-h { display: flex; align-items: center; gap: 6px; margin: 0 2px 10px; }
.cal-h h3 { margin: 0 4px; font-size: 16px; min-width: 150px; text-align: center; }
.cal-h .icon-btn { font-size: 20px; line-height: 1; }
.cal-hint { color: var(--muted); font-size: 11.5px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow span { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; padding: 2px 0 4px; }
.cal-day { position: relative; min-height: 96px; padding: 5px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; cursor: pointer; overflow: hidden; transition: border-color .12s, background .12s; }
.cal-day:hover { border-color: var(--border); }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-day.wkend { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.cal-day.other { opacity: .45; }
.cal-day.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.cal-day.drop { border: 2px dashed var(--accent); }
.cal-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; font-size: 12px; font-weight: 700; border-radius: 11px; }
.cal-day.today .cal-n { background: var(--accent); color: #fff; }
.cal-count { display: none; }
.cal-chips { display: grid; gap: 3px; margin-top: 3px; }
.cal-chip { display: flex; align-items: center; gap: 3px; font-size: 11px; line-height: 1.25; padding: 3px 5px; border-radius: 6px; background: color-mix(in srgb, #0EA5E9 14%, var(--surface)); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; }
.cal-chip b { font-weight: 700; flex: none; }
.cal-chip i { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.cal-chip.late { background: color-mix(in srgb, #EF4444 16%, var(--surface)); }
.cal-chip.done { background: color-mix(in srgb, #22C55E 14%, var(--surface)); text-decoration: line-through; color: var(--muted); cursor: pointer; }
.cal-chip.dragging { opacity: .4; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-agenda { position: sticky; top: 12px; }
.cal-ag-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-ag-h small { display: block; color: var(--muted); font-size: 12px; }
.cal-agenda .tlist { display: grid; gap: 8px; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } .cal-agenda { position: static; } }
@media (max-width: 760px) {
  .cal-hint { display: none; }
  .cal-main { padding: 8px; }
  .cal-day { min-height: 52px; padding: 3px; text-align: center; }
  .cal-chips, .cal-more { display: none; }
  .cal-count { display: block; margin: 2px auto 0; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); font-size: 0; }
  .cal-h h3 { min-width: 0; font-size: 15px; }
}

/* Embudo en lista */
.pipe-list { padding: 0; overflow: hidden; }
.pl-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid var(--border); }
.pl-tools input[type=search] { flex: 1 1 220px; max-width: 320px; }
.pl-tools select { width: auto; }
.pl-tbl th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.pl-tbl th[aria-sort=ascending]::after { content: ' ▲'; font-size: 9px; }
.pl-tbl th[aria-sort=descending]::after { content: ' ▼'; font-size: 9px; }
.pl-who { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.pl-who small { flex-basis: 100%; color: var(--muted); }
.pl-stage { width: auto; min-width: 150px; padding: 5px 8px; font-size: 13px; font-weight: 600; border-left: 4px solid var(--sc, #64748B); }
.pl-agent { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pl-agent i { width: 8px; height: 8px; border-radius: 50%; }
.pl-last { display: grid; max-width: 280px; }
.pl-last span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.pl-last small { color: var(--muted); }
.pl-wait { color: #F59E0B; font-size: 10px; }
.pl-tbl td { vertical-align: middle; }
.pl-tbl td.num { white-space: nowrap; }

/* Multicanal */
.avatar { position: relative; }
.kind-dot { position: absolute; right: -3px; bottom: -3px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; border: 2px solid var(--surface); color: #fff; font: 700 8.5px/12px system-ui, sans-serif; font-style: normal; text-align: center; }
.transcript { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 7%, transparent); font-size: 12.5px; line-height: 1.4; white-space: pre-wrap; }

/* Ajustes: Canales e Integraciones */
.hub { display: grid; gap: 8px; max-width: 980px; }
.hub-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.hub-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateX(2px); }
.hub-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hub-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c); font: 800 13px/1 system-ui, sans-serif; }
.hub-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hub-txt b { font-size: 15px; }
.hub-txt small { color: var(--muted); font-size: 12.5px; }
.hub-go { color: var(--muted); font-size: 22px; line-height: 1; }
.hub-back { display: flex; align-items: baseline; gap: 14px; margin: 0 0 14px; }
.hub-back a { color: rgba(255,255,255,.9); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.hub-back h2 { margin: 0; font-size: 20px; color: #fff; }
html:not([data-wall]) .hub-back a, html:not([data-wall]) .hub-back h2 { color: var(--text); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.code-sample { width: 100%; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; white-space: pre-wrap; overflow-x: auto; margin: 6px 0; }
.api-doc td { font-size: 12.5px; vertical-align: top; }
.ev-pick { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; display: grid; gap: 6px; }
.ev-pick legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.ok-txt { color: var(--ok); }
.err-txt { color: var(--bad); }
@media (max-width: 640px) { .hub-row { flex-wrap: wrap; } .hub-txt { flex-basis: calc(100% - 60px); } .hub-row .badge { margin-left: 54px; } .hub-go { display: none; } }

/* Identificadores */
.acct-ids { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.acct-ids small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.acct-ids b { font-size: 17px; font-variant-numeric: tabular-nums; }
.copyable { cursor: copy; border-bottom: 1px dashed color-mix(in srgb, var(--muted) 60%, transparent); }
.copyable:hover { color: var(--accent); }
.id-list { margin-top: 12px; display: grid; gap: 6px; text-align: left; }
.id-list > div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 12.5px; }
.id-list small { color: var(--muted); white-space: nowrap; }
.id-list code { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; background: none; padding: 0; }

/* Google Sheets (OAuth) */
.gs-card { overflow: hidden; }
.gs-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.gs-head p { margin: 4px 0 0; font-size: 13px; max-width: 520px; }
.gs-acts { display: grid; gap: 8px; justify-items: stretch; min-width: 220px; text-align: center; }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.g-ic { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #4285F4; font: 800 14px/22px system-ui, sans-serif; text-align: center; }
.btn.danger-txt { color: var(--bad); }
.gs-link { font-size: 12.5px; word-break: break-all; }
.info-box.ok-box { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.info-box.err-box { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }

/* ---------- Flujos: lista con carpetas ---------- */
.fl-crumbs { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.fl-crumbs a { color: var(--muted); font-weight: 600; } .fl-crumbs a.on { color: var(--text); font-weight: 700; }
.fl-search input { width: 200px; }
.fl-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fl-folder { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
.fl-folder:hover { border-color: #7C3AED; box-shadow: var(--shadow); }
.fl-folder svg { color: #7C3AED; flex-shrink: 0; }
.fl-folder .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-folder .icon-btn.sm { width: 26px; height: 26px; }
.fl-name { font-weight: 700; } .fl-name:hover { color: #7C3AED; }
.fl-tbl .badge { margin-left: 6px; }

/* ---------- Flujos: lienzo ---------- */
.fc-top { display: flex; align-items: center; gap: 10px; margin: -6px 0 12px; flex-wrap: wrap; }
.fc-back { color: var(--muted); font-weight: 600; white-space: nowrap; } .fc-back:hover { color: var(--text); }
.fc-sep { color: var(--border-2); }
.fc-name { font-size: 17px; font-weight: 800; border: 1px solid transparent; background: transparent; padding: 5px 8px; border-radius: 8px; min-width: 200px; width: min(420px, 40vw); color: var(--text); }
.fc-name:hover, .fc-name:focus { border-color: var(--border-2); background: var(--surface); outline: none; }
.fc-active small { color: var(--muted); font-weight: 600; }
.fc-top .grow { flex: 1; }
.fc-wrap { position: relative; height: calc(100vh - 168px); min-height: 460px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; cursor: grab; user-select: none;
  background-color: var(--surface-2); background-image: radial-gradient(circle, var(--border-2) 1px, transparent 1.2px); background-size: 22px 22px; }
.fc-wrap.panning { cursor: grabbing; }
.fc-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.fc-svg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.fc-svg .fce { fill: none; stroke-width: 2.2; pointer-events: stroke; cursor: pointer; opacity: .85; }
.fc-svg .fce:hover, .fc-svg .fce.sel { stroke-width: 4; opacity: 1; }
.fc-svg .fce.tmp { stroke-dasharray: 6 5; pointer-events: none; }
.fc-svg .fce-del { pointer-events: all; cursor: pointer; } .fc-svg .fce-del circle { fill: #DC2626; } .fc-svg .fce-del text { fill: #fff; font-size: 12px; font-weight: 700; }
.fcn { position: absolute; background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; box-shadow: 0 2px 8px rgba(15,23,42,.08); cursor: move; font-size: 12.5px; }
.fcn:hover { border-color: var(--c); }
.fcn.sel { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent), 0 6px 18px rgba(15,23,42,.12); }
.fcn.drop { border-color: #16A34A; box-shadow: 0 0 0 4px rgba(22,163,74,.25); }
.fcn-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); border-radius: 11px 11px 0 0; background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.fcn-h b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcn-ic { width: 22px; height: 22px; border-radius: 6px; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.fcn-b { padding: 9px 12px; color: var(--text-2); line-height: 1.45; word-break: break-word; }
.fcn-b:empty { display: none; }
.fcn-txt { white-space: pre-line; }
.fcn-img { font-weight: 600; margin-bottom: 4px; }
.fcn-tag { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.fcn-rule, .fcn-act { padding: 3px 0; border-bottom: 1px dashed var(--border); } .fcn-rule:last-child, .fcn-act:last-child { border-bottom: 0; }
.fcn-rule i { color: var(--muted); }
.fcn-ports { border-top: 1px solid var(--border); padding: 4px 0; }
.fcn-ports:empty { display: none; }
.fcn-port { position: relative; display: flex; justify-content: flex-end; align-items: center; padding: 4px 22px 4px 12px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.fcn-port span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcn-out { position: absolute; right: -7px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%; background: #64748B; border: 2.5px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2); cursor: crosshair; }
.fcn-port.g .fcn-out { background: #16A34A; } .fcn-port.r .fcn-out { background: #DC2626; } .fcn-port.r { color: #B91C1C; }
.fcn-out:hover { transform: scale(1.35); }
.fcn-in { position: absolute; left: -7px; top: 15px; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--c); }
.fc-tools { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 4px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 5px; box-shadow: var(--shadow); cursor: default; }
.fc-tools .icon-btn { font-size: 17px; color: var(--text-2); }
.fc-mini { position: absolute; right: 14px; bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); cursor: pointer; }
.fc-hint { position: absolute; left: 14px; top: 12px; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; transition: opacity .6s; pointer-events: none; }
.fc-hint.fade { opacity: 0; }
.fc-addmenu { position: absolute; z-index: 6; width: 290px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.18); padding: 6px; cursor: default; }
.fc-addmenu button { display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--text); font: inherit; }
.fc-addmenu button:hover { background: var(--surface-2); }
.fc-addmenu button span { grid-row: span 2; width: 30px; height: 30px; border-radius: 8px; background: var(--c); color: #fff; display: grid; place-items: center; }
.fc-addmenu small { color: var(--muted); font-size: 11.5px; }
.fc-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 370px; max-width: 100%; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(15,23,42,.08); display: flex; flex-direction: column; cursor: default; user-select: text; z-index: 5; }
.fcp-h { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.fcp-h > span:first-child { width: 26px; height: 26px; border-radius: 7px; background: var(--c); color: #fff; display: grid; place-items: center; }
.fcp-h .grow { flex: 1; }
.fcp-b { padding: 14px; overflow-y: auto; display: grid; gap: 12px; align-content: start; flex: 1; }
.fcp-b > div { display: grid; gap: 10px; }
.fcp-row { display: flex; gap: 6px; align-items: center; } .fcp-row > input, .fcp-row > select { flex: 1; min-width: 0; }
.fcp-sub { font-weight: 700; font-size: 12.5px; margin-top: 4px; }
.fcp-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: grid; gap: 8px; background: var(--surface-2); }
.fcp-rule { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; padding: 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.fcp-rule > input { grid-column: 1 / 3; }
.fcp-vars { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -4px; }
.fcp-vars button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 6px; font-size: 11px; padding: 2px 6px; cursor: pointer; color: var(--text-2); font-family: inherit; }
.fcp-vars button:hover { border-color: var(--accent); color: var(--accent); }
.fcp-note { font-size: 12px; margin: 0; }
@media (max-width: 760px) { .fc-panel { width: 100%; } .fc-mini { display: none; } .fc-name { width: 100%; } }
/* Switches dentro de tarjetas / barras blancas cuando hay fondo de pantalla */
html[data-wall] .card .switch span, html[data-wall] .fc-top .switch span, html[data-wall] .modal .switch span, html[data-wall] .sp-sec .switch span { background: var(--border-2); }
html[data-wall] .switch input:checked + span { background: var(--ok); }
.fc-top { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px 6px 14px; margin: -8px 0 12px; box-shadow: var(--shadow); }
.fc-top .icon-btn { font-size: 17px; color: var(--text-2); }
html[data-wall] .fl-crumbs, html[data-wall] .fl-crumbs a { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
html[data-wall] .fl-crumbs a:not(.on) { opacity: .8; }
html[data-wall] .fl-hint-txt { color: rgba(255,255,255,.88); }
.kv-dates dd { font-size: 12.5px; }
.warn-badge { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.fc-state { color: var(--muted); font-size: 12px; white-space: nowrap; }
.fc-testlist { display: grid; gap: 6px; margin-top: 10px; max-height: 320px; overflow-y: auto; }
.fc-testlist button { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.fc-testlist button:hover { border-color: var(--accent); }

/* 2.4.0 · editor de flujos: contenidos del mensaje */
.fcp-items{display:flex;flex-direction:column;gap:10px;margin-bottom:10px}
.fcp-item{border:1px solid var(--line,#E2E8F0);border-radius:10px;background:var(--bg2,#F8FAFC);overflow:hidden}
.fcp-item-h{display:flex;align-items:center;gap:4px;padding:6px 8px;border-bottom:1px solid var(--line,#E2E8F0);font-size:13px}
.fcp-item-h .icon-btn{width:24px;height:24px;font-size:12px}
.fcp-item-b{padding:8px;display:flex;flex-direction:column;gap:6px}
.fcp-item-b textarea,.fcp-item-b input,.fcp-item-b select{width:100%}
.fcp-btn{border:1px dashed var(--line,#CBD5E1);border-radius:8px;padding:6px;display:flex;flex-direction:column;gap:4px;margin-bottom:6px;background:var(--bg,#fff)}
.fcp-next{display:inline-flex;gap:2px;margin-left:auto}
.fcp-next .icon-btn{width:26px;height:26px;font-size:13px}
.fcp-act{display:flex;flex-direction:column;gap:6px}
.fcp-act input,.fcp-act select,.fcp-act textarea{width:100%}
.fcn-sep{height:1px;background:var(--line,#E2E8F0);margin:6px 0}
.fcn-media{font-size:12.5px;padding:4px 6px;border-radius:6px;background:var(--bg2,#F1F5F9)}
.fcn-link{font-size:12px;color:#2563EB;margin-top:3px}
.fcn.fcn-note{background:#FEF9C3;border-color:#FDE047}
.fcn.fcn-note .fcn-h{background:transparent}

/* 2.4.1 · barra de cada bloque + vista previa */
.fcn-tb { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 14px rgba(15,23,42,.12); opacity: 0; pointer-events: none; transition: opacity .12s; white-space: nowrap; cursor: default; }
.fcn-tb::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.fcn:hover .fcn-tb, .fcn.sel .fcn-tb { opacity: 1; pointer-events: auto; }
.fcn-tb button { position: relative; width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; border-radius: 7px; color: var(--text); cursor: pointer; }
.fcn-tb button:hover { background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.fcn-tb button.on { color: #16A34A; }
.fcn-tb button.danger:hover { background: #FEE2E2; color: #DC2626; }
.fcn-tb button:hover::before { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #475569; color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 5; }
.warn-box { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.wp-phone { background: #EFEAE2; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; margin: 10px 0; }
.wp-b { align-self: flex-start; max-width: 85%; background: #fff; color: #111B21; border-radius: 0 10px 10px 10px; padding: 7px 9px; font-size: 14px; line-height: 1.4; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.wp-b img { display: block; max-width: 100%; border-radius: 7px; margin-bottom: 5px; }
.wp-media { background: #E9EDEF; border-radius: 7px; padding: 16px 10px; text-align: center; color: #54656F; font-size: 13px; margin-bottom: 4px; }
.wp-btns { margin: 7px -9px -7px; border-top: 1px solid #E9EDEF; }
.wp-btns div { text-align: center; color: #027EB5; padding: 8px; font-size: 14px; border-bottom: 1px solid #E9EDEF; }
.wp-btns div:last-child { border-bottom: 0; }
.wp-list { margin-top: 8px; border-top: 1px dashed #D1D7DB; padding-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.wp-list small { display: block; color: #667781; }
.wp-var { background: #DCF8C6; border-radius: 4px; padding: 0 3px; font-size: 13px; }
.wp-sys { align-self: center; background: #FFF5C4; color: #54656F; font-size: 12px; border-radius: 7px; padding: 4px 10px; text-align: center; max-width: 90%; }
.wp-sys .fcn-act, .wp-sys .fcn-rule, .wp-sys div { display: block; }
.wp-typing { align-self: flex-start; background: #fff; border-radius: 10px; padding: 8px 12px; display: flex; gap: 3px; align-items: center; }
.wp-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9AA6AC; animation: wpdot 1s infinite; }
.wp-typing i:nth-child(2) { animation-delay: .15s } .wp-typing i:nth-child(3) { animation-delay: .3s }
@keyframes wpdot { 0%,60%,100% { opacity: .3 } 30% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .wp-typing i { animation: none } }
.wp-car { display: flex; gap: 6px; overflow-x: auto; }
.wp-car .wp-b { min-width: 180px; }
.wp-mail { background: #fff; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.fcn-firsttag { margin-left: auto; flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: #fff; background: #16A34A; border-radius: 999px; padding: 2px 8px; }
.fcn.fcn-first { border-color: #16A34A; }
.fcn.fcn-start { border-style: dashed; }
.fcn-firsttag { background: #16A34A; }
.fc-nostart { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 6; background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; border-radius: 10px; padding: 8px 14px; font-size: 13px; box-shadow: 0 4px 14px rgba(15,23,42,.1); max-width: 90%; }
.opt-ed { display: flex; flex-direction: column; gap: 6px; }
.opt-ed-h { font-weight: 600; font-size: 13.5px; display: flex; flex-direction: column; gap: 2px; }
.opt-ed-h small { font-weight: 400; }
.opt-ed-h kbd { font: inherit; font-size: 11px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; }
.opt-ed-rows { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; padding: 2px; }
.opt-ed-row { display: flex; align-items: center; gap: 6px; }
.opt-ed-row input { flex: 1; }
.opt-ed-n { width: 20px; text-align: right; font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.ok-badge { background: #DCFCE7; color: #166534; }
.cp-card { margin-bottom: 14px; }
/* Diálogos propios */
.ui-dlg { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.45); opacity: 0; transition: opacity .12s; }
.ui-dlg.in { opacity: 1; } .ui-dlg.out { opacity: 0; }
.ui-dlg-box { width: min(440px, 100%); background: var(--surface); color: var(--text); border-radius: 16px; padding: 22px 22px 18px; box-shadow: 0 20px 50px rgba(15,23,42,.3); transform: translateY(6px) scale(.98); transition: transform .12s; display: flex; flex-direction: column; gap: 10px; }
.ui-dlg.in .ui-dlg-box { transform: none; }
.ui-dlg-box h3 { margin: 0; font-size: 17px; }
.ui-dlg-box p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.ui-dlg-box .ui-dlg-in { width: 100%; }
.ui-dlg-box .modal-actions { margin-top: 6px; }
.btn.dlg-danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.btn.dlg-danger:hover { background: #B91C1C; }
@media (prefers-reduced-motion: reduce) { .ui-dlg, .ui-dlg-box { transition: none; } }
/* Contactos por número de la empresa */
.chan-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.chan-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13px; }
.chan-chip i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chan-chip span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.chan-chip:hover { border-color: var(--primary, #7C3AED); }
.chan-chip.on { border-color: var(--primary, #7C3AED); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #7C3AED) 25%, transparent); }
.chan-chip:focus-visible { outline: 2px solid var(--primary, #7C3AED); outline-offset: 2px; }
/* Panel de inicios (info.siem.pe) */
.ini-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 320px; overflow: auto; }
.ini-card { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ini-card div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ini-card b { font-size: 13px; }
.ini-card small { color: var(--text-2); font-size: 12px; }
.entries { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.entries b { font-size: 12.5px; }
.entry { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 5px 8px; border-radius: 8px; background: color-mix(in srgb, var(--ok, #16A34A) 8%, transparent); }
.entry.re { background: color-mix(in srgb, var(--warn, #D97706) 10%, transparent); }
.entry span:first-child { color: var(--text-2); font-variant-numeric: tabular-nums; }
.entry span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry small { grid-column: 2; color: var(--text-2); }
/* Analíticas › Asesores: tiempo de respuesta por periodo */
.rt-chart { display: flex; align-items: flex-end; gap: 4px; height: 240px; padding-top: 18px; overflow-x: auto; }
.rt-col { flex: 1 0 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; padding-bottom: 34px; }
.rt-bar { width: 70%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: #16A34A; min-height: 0; }
.rt-bar.u2 { background: #D97706; } .rt-bar.u3 { background: #DC2626; }
.rt-v { font-size: 10.5px; color: var(--text-2); white-space: nowrap; margin-bottom: 3px; }
.rt-x { position: absolute; bottom: 14px; font-size: 10.5px; color: var(--text-2); white-space: nowrap; }
.rt-r { position: absolute; bottom: 0; font-size: 10.5px; font-weight: 700; color: #fff; background: #DC2626; border-radius: 999px; padding: 0 6px; }
/* Mapa de calor día × hora */
.mini-stat { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.mini-stat small { color: var(--text-2); } .mini-stat b { font-size: 22px; } .mini-stat em { font-style: normal; font-size: 12px; color: var(--text-2); }
.mini-stat.bad b { color: #DC2626; }
.hm-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; }
.hm-t { display: block; font-size: 13px; margin-bottom: 6px; }
.hm-grid { display: grid; grid-template-columns: 34px repeat(24, minmax(14px, 1fr)); gap: 2px; font-size: 10px; }
.hm-h { color: var(--text-2); text-align: left; }
.hm-d { color: var(--text-2); align-self: center; }
.hm-c { aspect-ratio: 1; border-radius: 3px; display: grid; place-items: center; font-size: 9px; color: #fff; background: var(--border); outline: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
@media (max-width: 640px) { .hm-wrap { grid-template-columns: 1fr; } }
/* Agente IA */
.aia-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.aia-mode { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; }
.aia-mode.static { cursor: default; background: color-mix(in srgb, var(--border) 25%, transparent); }
.aia-mode input[type=checkbox] { margin-top: 3px; }
.aia-mode span { display: flex; flex-direction: column; gap: 3px; } .aia-mode small { color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.aia-fields { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.aia-docs, .aia-media { display: flex; flex-direction: column; gap: 8px; }
.aia-doc, .aia-m { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.aia-doc > div, .aia-mi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aia-doc small, .aia-mi small { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.aia-doc.off, .aia-m.off { opacity: .55; }
.aia-prev { width: 120px; flex-shrink: 0; display: grid; place-items: center; }
.aia-prev img, .aia-prev video { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; }
.aia-prev audio { width: 120px; }
.aia-prev span { font-size: 12px; text-align: center; word-break: break-all; }
.aia-up { border: 1px dashed var(--border); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.wp-b.wp-me { align-self: flex-end; background: #D9FDD3; border-radius: 10px 0 10px 10px; }
@media (max-width: 640px) { .aia-m { flex-wrap: wrap; } }
.ai-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ai-toggle.on { background: #10A37F; border-color: #10A37F; color: #fff; }
.ai-badge { background: color-mix(in srgb, #10A37F 15%, transparent); color: #0B7A5F; }

/* Flujos 2.7.1: menú de contenido estilo Telenet */
.fcp-addbox { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 16px; margin: 10px 0; border: 1.5px dashed var(--border-2); border-radius: 10px; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; cursor: pointer; }
.fcp-addbox:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }
.fcp-ghost { border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; padding: 4px 0; cursor: pointer; }
.fcp-quick-top { margin: 4px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.fcp-pick { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.fcp-pick::after { content: '▾'; float: right; color: var(--muted); }
.fc-menu { position: fixed; z-index: 3100; min-width: 230px; max-width: 340px; max-height: 70vh; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(15,23,42,.16); }
.fcm-q { width: 100%; box-sizing: border-box; margin: 0 0 6px; padding: 7px 9px; border: 1px solid var(--border-2); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text); }
.fcm-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.fcm-i svg { flex: none; color: var(--muted); }
.fcm-i span { flex: 1; }
.fcm-i i { font-style: normal; color: var(--muted); }
.fcm-i em { font-style: normal; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 0 6px; }
.fcm-i:hover, .fcm-i.open { background: var(--surface-2); }
.fcm-i.soon { opacity: .55; }
.fcn-dash { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 0; padding: 12px 8px; border: 1.5px dashed var(--border-2); border-radius: 10px; text-align: center; }
.fcn-dash span { color: var(--text-2); font-size: 12.5px; }

/* Condición estilo Telenet */
.cnd-group { padding: 4px 0 10px; }
.cnd-q { font-weight: 600; font-size: 13.5px; margin: 6px 0 8px; }
.cnd-q a { font-weight: 400; color: var(--accent); text-decoration: none; }
.cnd-q a:hover { text-decoration: underline; }
.cnd-rule { display: flex; align-items: center; gap: 6px; margin: 6px 0; padding: 4px 4px 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.cnd-txt { flex: 1; border: 0; background: none; padding: 4px 0; text-align: left; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.cnd-new { display: block; width: 100%; margin: 4px 0 6px; padding: 14px; border: 0; border-top: 1px solid var(--border); background: none; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.cnd-new:hover { color: var(--accent); }
.cnd-box { width: min(780px, 100%); padding: 20px; }
.cnd-bar { display: grid; grid-template-columns: minmax(150px, 1.1fr) 170px minmax(180px, 1.6fr); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 2px 8px rgba(15,23,42,.06); }
.cnd-bar > * { border: 0; border-right: 1px solid var(--border); background: transparent; font: inherit; font-size: 14px; color: var(--text); padding: 10px 14px; min-width: 0; }
.cnd-bar > *:last-child { border-right: 0; }
.cnd-src { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-radius: 999px 0 0 999px; }
.cnd-src::after, .cnd-multi::after { content: ' ▾'; color: var(--muted); }
.cnd-val { padding: 0 !important; display: flex; }
.cnd-val .cnd-in { flex: 1; width: 100%; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text); padding: 10px 14px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cnd-val input.cnd-in { cursor: text; }
.cnd-two { display: flex; flex-direction: column; flex: 1; }
.cnd-two .cnd-in { padding: 5px 14px !important; }
.cnd-foot { display: flex; justify-content: space-between; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--border); }
.cnd-pick { position: fixed; z-index: 3200; display: flex; flex-direction: column; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 32px rgba(15,23,42,.2); }
.cnd-list { overflow: auto; flex: 1; }
.cnd-all { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-bottom: 6px; }
.cnd-all button { border: 0; background: var(--surface-2); padding: 8px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.cnd-gh { padding: 10px 10px 4px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.cnd-gh:first-child { border-top: 0; }
.cnd-it { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px 6px 18px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text); text-align: left; cursor: pointer; border-radius: 4px; }
.cnd-it:hover { background: var(--surface-2); }
.cnd-it.on { background: var(--accent); color: #fff; }
@media (max-width: 640px) { .cnd-bar { grid-template-columns: 1fr; border-radius: 12px; } .cnd-bar > * { border-right: 0; border-bottom: 1px solid var(--border); } .cnd-src { border-radius: 12px 12px 0 0; } }
.cnd-it input[type=checkbox] { width: 16px !important; height: 16px; flex: none; margin: 0; padding: 0; accent-color: var(--accent); }

/* Esperar / Dividir / Correo / Página de inicio (2.8.1) */
.fcp-inline { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.fcp-check { display: flex !important; flex-direction: row !important; justify-content: flex-start !important; text-align: left; align-items: center; gap: 8px; margin: 10px 0 6px; font-weight: 400; color: var(--text-2); }
.fcp-check input { width: 18px !important; flex: none; height: 18px; margin: 0; accent-color: #111; }
.fcp-split { padding: 10px 0; border-bottom: 1px solid var(--border); }
.fcp-split input[type=range] { flex: 1; accent-color: var(--accent); }
.fcp-vname { border: 0 !important; padding: 2px 0 !important; font-weight: 600; background: transparent !important; }
.fcp-sum { text-align: center; font-size: 13px; margin: 10px 0 4px; }
.fcp-sum.ok { color: #15803d; } .fcp-sum.bad { color: #b91c1c; font-weight: 600; }
.fcp-big { font-size: 16px !important; font-weight: 600; }
.fcp-imgbox { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; min-height: 120px; margin: 8px 0; padding: 12px; border: 1.5px dashed var(--border-2); border-radius: 12px; color: var(--muted); position: relative; text-align: center; }
.fcp-imgbox img { max-width: 100%; max-height: 220px; border-radius: 8px; }
.fcp-imgbox > span { font-size: 26px; width: 100%; }
.fcp-imgbox .icon-btn { position: absolute; top: 6px; right: 6px; background: var(--surface); }
.fcp-link { display: flex; gap: 6px; margin: 6px 0 2px; }
.fcp-link input { flex: 1; min-width: 0; font-size: 12px; }
.fcn-mail > div { font-size: 12px; padding: 2px 0; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcn-mail .fcn-btn { margin-top: 6px; background: #111; color: #fff; text-align: center; border-radius: 6px; padding: 6px; border: 0; }
.switch-row { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-weight: 400; }
.switch-row input { width: 18px !important; height: 18px; flex: none; }
.sp-more { margin-top: 8px; } .sp-more summary { cursor: pointer; color: var(--accent); font-size: 13px; padding: 4px 0; }
