/* Estilos de las pantallas añadidas en la v0.2 (mismo lenguaje visual que la bandeja). */
a { color: inherit; }
.small { font-size: 12px; } .muted { color: var(--text-2); } .ok { color: var(--green); } .warn { color: #f2a23a; } .bad { color: var(--danger); }
.spacer { flex: 1; } .nowrap { white-space: nowrap; } .ellipsis { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.link-btn { color: var(--primary); font-weight: 600; font-size: 13px; text-decoration: none; }
.link-btn:hover, .link:hover { text-decoration: underline; }
.btn { text-decoration: none; background: transparent; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.btn.danger { color: var(--danger); border-color: rgba(239,68,68,.45); }
.btn.block { width: 100%; justify-content: center; height: 40px; }
.icon-btn.xs { width: 22px; height: 22px; } .icon-btn.xs svg { width: 13px; height: 13px; }
.demo-tag { font-size: 10px; font-weight: 800; color: #f2a23a; border: 1px solid #f2a23a; border-radius: 4px; padding: 0 4px; letter-spacing: .3px; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--chip); color: var(--text-2); white-space: nowrap; margin: 2px 2px 2px 0; }
.pill.ok { color: var(--green); background: rgba(34,197,94,.12); } .pill.warn { color: #f2a23a; background: rgba(242,162,58,.12); }
.pill.bad { color: var(--danger); background: rgba(239,68,68,.12); } .pill.demo { color: #f2a23a; background: rgba(242,162,58,.10); border: 1px dashed rgba(242,162,58,.5); }
.pill.mgr { color: #b78cf7; background: rgba(168,85,247,.12); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--chip); padding: 1px 5px; border-radius: 4px; }
.avatar.empty { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-3); }
.avatar .online.away { background: #f2a23a; }

/* ---------- Acceso ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--bg-chat); }
.login-card { width: min(460px, 100%); background: var(--bg); border: 1px solid var(--border-strong); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; margin-bottom: 18px; }
.login-brand img { width: 32px; height: 32px; }
.login h1 { font-size: 22px; margin: 0 0 4px; }
.login form { display: grid; gap: 12px; margin-top: 18px; }
.login label, .field { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; min-height: 36px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; }
input[type=checkbox] { min-height: 0; width: 16px; height: 16px; accent-color: var(--primary); }
.form-error { background: rgba(239,68,68,.12); color: #ff8a8a; border: 1px solid rgba(239,68,68,.35); padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; }
[data-theme="light"] .form-error { color: #b91c1c; }
.demo-users { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 6px; }
.demo-title { font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.demo-user { text-align: left; display: grid; gap: 1px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.demo-user:hover { background: var(--hover); border-color: var(--border-strong); }
.demo-user span { font-size: 12px; color: var(--text-2); }

/* ---------- Navegación ---------- */
.absence-pill { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: rgba(242,162,58,.12); color: #f2a23a; font-size: 12px; font-weight: 600; text-align: left; }
.absence-pill svg { width: 14px; height: 14px; }
.notif-list { max-height: 360px; overflow-y: auto; width: 320px; }
.notif { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.notif:hover { background: var(--hover); } .notif.unread { background: var(--primary-soft); } .notif small { color: var(--text-2); }
.notif-empty { text-align: center; padding: 24px 12px; color: var(--text-2); width: 300px; } .notif-empty svg { width: 28px; height: 28px; margin: 0 auto 8px; }
.popover .p-item.static { height: auto; padding: 8px 10px; cursor: default; } .popover .p-item.static:hover { background: none; }
.popover .p-empty { padding: 8px 10px; color: var(--text-2); font-size: 13px; }
.popover .tag-away { font-size: 11px; color: #f2a23a; margin-left: 4px; }
.err-list { margin: 0; padding: 4px 10px 6px 26px; font-size: 13px; color: #ff9a9a; max-width: 360px; display: grid; gap: 4px; }
[data-theme="light"] .err-list { color: #b91c1c; }
.err-list li.ok { color: var(--green); list-style: none; margin-left: -16px; display: flex; gap: 6px; align-items: center; }
.ni { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; } .ni svg { width: 15px; height: 15px; }
.ni.sm { width: 22px; height: 22px; } .ni.sm svg { width: 13px; height: 13px; }

/* ---------- Bandeja: añadidos ---------- */
.store-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px 4px; }
.store-head svg { width: 13px; height: 13px; }
.view-item.sub { padding-left: 14px; }
.view-item .wa-ico { color: var(--wa); width: 14px; height: 14px; }
.role-tag { font-size: 10px; font-weight: 700; color: #b78cf7; background: rgba(168,85,247,.12); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.ch-icon { position: relative; }
.ch-icon .chk { display: none; color: var(--text-2); }
.ch-icon .chk svg, .ch-icon .wa svg { width: 22px; height: 22px; }
.ch-icon .wa svg { width: 14px; height: 14px; }
.ch-icon .wa { display: grid; place-items: center; }
.conv:hover .ch-icon, .conv.selecting .ch-icon, .conv.checked .ch-icon { background: transparent; }
.conv:hover .ch-icon .wa, .conv.selecting .ch-icon .wa, .conv.checked .ch-icon .wa { display: none; }
.conv:hover .ch-icon .chk, .conv.selecting .ch-icon .chk, .conv.checked .ch-icon .chk { display: grid; }
.conv.checked { background: var(--primary-soft); }
.conv .consent-badge { height: 22px; }
.mini-chip { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: rgba(242,162,58,.14); color: #f2a23a; }
.mini-chip svg { width: 12px; height: 12px; }
.bulk-bar { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 4px 10px; font-size: 13px; }
.consent-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.consent-badge svg { width: 12px; height: 12px; }
.consent-badge.ok { color: var(--green); background: rgba(34,197,94,.12); }
.consent-badge.pending { color: var(--text-2); background: var(--chip); }
.consent-badge.bad { color: var(--danger); background: rgba(239,68,68,.12); }
.assign-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 4px; border: 1px solid var(--border-strong); border-radius: 16px; font-size: 13px; font-weight: 600; margin-right: 4px; color: var(--text); }
.assign-btn:hover { background: var(--hover); }
.assign-btn > svg { width: 16px; height: 16px; margin-left: 4px; color: var(--text-2); }
.chat-banners { padding: 0 20px; display: grid; gap: 8px; }
.chat-banners:empty { display: none; }
.chat-banners + .composer { padding-top: 8px; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: 13px; border: 1px solid var(--warn-border); background: var(--warn-bg); }
.banner svg { width: 16px; height: 16px; flex: none; }
.banner > span:first-of-type, .banner > span:nth-of-type(2) { flex: 1; }
.banner.auto { border-color: rgba(242,162,58,.45); background: rgba(242,162,58,.10); } .banner.auto > svg { color: #f2a23a; }
.banner.bad { border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.10); } .banner.bad > svg { color: var(--danger); }
.banner.info { border-color: var(--border-strong); background: var(--surface); } .banner.info > svg { color: var(--text-2); }
.banner .warn-ico { width: 18px; height: 18px; border-radius: 50%; background: #f2a23a; color: #1b1405; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.msg-row.is-tpl .bubble { min-width: 280px; }
.tpl-tag { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }
.tpl-tag svg { width: 12px; height: 12px; }
.tpl-header { font-weight: 700; margin-bottom: 4px; }
.tpl-footer { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.tpl-buttons { display: grid; gap: 4px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 6px; }
[data-theme="light"] .tpl-buttons { border-color: rgba(0,0,0,.08); }
.tpl-buttons span { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--primary); font-weight: 600; font-size: 13px; padding: 4px; }
.tpl-buttons svg { width: 14px; height: 14px; }
.btn-reply { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); font-weight: 700; text-transform: uppercase; margin-bottom: 2px; }
.btn-reply svg { width: 12px; height: 12px; }
.bubble-foot .author.auto { background: rgba(242,162,58,.14); color: #f2a23a; }
.bubble-foot .author svg { width: 12px; height: 12px; }
.err-line { color: var(--danger); font-size: 12px; margin-top: 4px; }
.chip-btn:disabled { opacity: .45; cursor: not-allowed; }
.i.big { width: 40px; height: 40px; margin: 0 auto 6px; }
.c-row.static { cursor: default; } .c-row.static:hover { background: none; }
.c-row .consent-badge { margin-right: 4px; }
.muted-chip { color: var(--text-2) !important; border-color: var(--border-strong) !important; }
.timeline { list-style: none; margin: 4px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--border-strong); display: grid; gap: 10px; }
.timeline li { position: relative; display: grid; gap: 2px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); border: 2px solid var(--bg); }
.timeline li.ev-granted::before { background: var(--green); } .timeline li.ev-revoked::before, .timeline li.ev-denied::before { background: var(--danger); }
.timeline li.ev-prior_optin_declared::before { background: var(--primary); }
.timeline small { color: var(--text-2); font-size: 12px; }
.timeline.big li { font-size: 14px; }
.timeline details { font-size: 12px; color: var(--text-2); } .timeline pre { white-space: pre-wrap; font-family: inherit; background: var(--surface); padding: 8px; border-radius: 8px; color: var(--text); }
.timeline .hash { display: flex; align-items: center; gap: 4px; font-family: ui-monospace, monospace; font-size: 11px; color: var(--text-3); }
.timeline .hash svg { width: 11px; height: 11px; }
.run-item small { display: block; }
.run-st { display: inline-flex; height: 20px; align-items: center; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 700; background: var(--chip); color: var(--text-2); white-space: nowrap; }
.run-st.st-waiting, .run-st.st-running { background: rgba(242,162,58,.14); color: #f2a23a; }
.run-st.st-completed { background: rgba(34,197,94,.12); color: var(--green); }
.run-st.st-stopped, .run-st.st-failed { background: rgba(239,68,68,.12); color: var(--danger); }
.attrs { margin: 0; }

/* ---------- Modales ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 40; padding: 16px; }
[data-theme="light"] .modal-back { background: rgba(20,22,40,.35); }
.modal { background: var(--bg); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 17px; } .modal-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.modal-body { padding: 16px 20px; overflow-y: auto; display: grid; gap: 12px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text); font-weight: 500; }
.check-line input { margin-top: 2px; flex: none; }
.check-line small { display: block; color: var(--text-2); }
.check-line.big { font-size: 14px; }
.seg-sm { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; width: max-content; }
.seg-sm button { height: 28px; padding: 0 12px; border-radius: 6px; font-size: 13px; color: var(--text-2); }
.seg-sm button.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.explain { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; display: grid; gap: 4px; }
.tpl-picker { display: grid; grid-template-columns: 300px 1fr; min-height: 380px; max-height: 60vh; }
.tpl-list { border-right: 1px solid var(--border); overflow-y: auto; padding: 8px; display: grid; gap: 4px; align-content: start; }
.tpl-item { text-align: left; padding: 10px; border-radius: 10px; border: 1px solid transparent; display: grid; gap: 4px; }
.tpl-item:hover { background: var(--hover); } .tpl-item.active { background: var(--surface); border-color: var(--primary); }
.tpl-item.blocked { opacity: .55; } .tpl-item small { color: var(--danger); font-size: 12px; }
.tpl-meta { display: flex; flex-wrap: wrap; gap: 2px; }
.tpl-prev { padding: 16px 20px; overflow-y: auto; display: grid; gap: 12px; align-content: start; background: var(--bg-chat); }
.prev-label { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
.wa-preview { max-width: 380px; display: grid; gap: 4px; }
.wa-bubble { background: var(--bubble-out); border-radius: 12px; border-top-left-radius: 4px; padding: 9px 12px 6px; font-size: 14px; line-height: 1.42; }
.wa-bubble .txt { white-space: pre-wrap; }
.wa-time { font-size: 11px; color: var(--text-2); text-align: right; margin-top: 2px; }
.wa-btn { background: var(--bubble-out); border-radius: 10px; padding: 9px; text-align: center; color: var(--primary); font-weight: 600; font-size: 14px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.wa-btn svg { width: 15px; height: 15px; }
.nc .grid2 { margin: 0; }

/* ---------- Páginas estándar ---------- */
.std-page { height: 100vh; overflow-y: auto; background: var(--bg); }
.std-inner { max-width: 1080px; margin: 0 auto; padding: 28px 32px 48px; }
.std-inner.wide { max-width: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; } .page-head p { margin: 0; font-size: 14px; }
.count-big { color: var(--text-2); font-weight: 500; margin-left: 4px; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; margin-bottom: 18px; }
.stat-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
.stat-k { font-size: 11.5px; font-weight: 700; color: var(--text-2); letter-spacing: .5px; margin-bottom: 6px; }
.stat-v { font-size: 26px; font-weight: 700; } .stat-v span { color: var(--text-2); font-size: 16px; font-weight: 600; }
.stat-card.info .small { color: var(--text-2); line-height: 1.5; }
.tabs { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; width: max-content; margin-bottom: 14px; }
.tabs button { height: 32px; padding: 0 14px; border-radius: 7px; color: var(--text-2); font-weight: 500; }
.tabs button.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: 13.5px; margin-bottom: 18px; }
.table th { text-align: left; font-weight: 600; color: var(--text-2); background: var(--surface); padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: var(--hover); } .table tr.sel td { background: var(--row-selected); }
.table td .avatar { vertical-align: middle; margin-right: 4px; }
.table .link { color: var(--primary); text-decoration: none; font-weight: 600; }
.log-row td { background: var(--bg-chat); }
.log { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.log li { display: grid; grid-template-columns: 140px 1fr; gap: 10px; } .log li span { color: var(--text-3); font-size: 12px; }
.log li.k-action { color: var(--green); } .log li.k-warn { color: #f2a23a; } .log li.k-error { color: var(--danger); }
.toggle { width: 40px; height: 22px; border-radius: 11px; background: #3e3f43; position: relative; transition: background .15s; }
[data-theme="light"] .toggle { background: #d2d3dc; }
.toggle span { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--green); } .toggle.on span { left: 21px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; font-size: 13.5px; line-height: 1.5; margin: 6px 0 16px; }
.callout > svg { width: 18px; height: 18px; color: var(--primary); flex: none; margin-top: 2px; }
.callout.muted-callout { color: var(--text-2); } .callout.muted-callout > svg { color: var(--text-3); }
.sh { font-size: 14px; font-weight: 700; margin: 20px 0 10px; display: flex; gap: 6px; align-items: center; } .sh svg { width: 16px; height: 16px; color: var(--text-2); }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; padding: 0 10px; flex: 1; max-width: 420px; }
.search-box svg { color: var(--text-2); } .search-box input { border: 0; background: transparent; flex: 1; padding: 0; }
.two-col { display: grid; grid-template-columns: 224px minmax(0, 1fr) auto; height: 100vh; }
.two-col .col-views { height: 100vh; overflow-y: auto; }
.drawer { width: 380px; border-left: 1px solid var(--border); background: var(--bg); height: 100vh; overflow-y: auto; }
.drawer-body { padding: 16px 18px; display: grid; gap: 8px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px; font-size: 13.5px; align-items: center; } .kv span { color: var(--text-2); }
.dh { font-size: 14px; margin: 14px 0 4px; }
.item.link { display: block; text-decoration: none; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.item.link small { display: block; color: var(--text-2); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 8px; }
.num-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); display: grid; gap: 12px; }
.num-title { display: flex; gap: 10px; align-items: center; }
.num-members { display: flex; flex-wrap: wrap; gap: 6px; }
.member { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 2px 8px 2px 2px; }
.member small { color: var(--text-2); }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.form-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: grid; gap: 14px; background: var(--surface); margin-bottom: 16px; }
.form-card input, .form-card textarea, .form-card select { background: var(--bg); }
.help { color: var(--text-2); font-size: 12.5px; line-height: 1.5; margin: 0; }
.checks { display: grid; gap: 6px; padding: 6px 0; }
.mini-preview { font-size: 12.5px; color: var(--text-2); background: var(--bg-chat); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; max-height: 160px; overflow-y: auto; }

/* ---------- Editor de plantillas ---------- */
.tpl-editor { display: grid; grid-template-columns: 1fr 400px; min-height: 0; overflow: hidden; flex: 1; }
.te-form { padding: 16px 20px; overflow-y: auto; display: grid; gap: 12px; align-content: start; max-height: 66vh; }
.te-prev { padding: 16px 20px; background: var(--bg-chat); border-left: 1px solid var(--border); overflow-y: auto; display: grid; gap: 12px; align-content: start; max-height: 66vh; }
.var-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; color: var(--text-2); }
.var-row .chip-btn { margin: 0; font-family: ui-monospace, monospace; font-size: 11.5px; height: 24px; }
.btn-edit { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.btn-edit input { flex: 1; } .btn-edit .cc { font-size: 12px; color: var(--text-2); width: 42px; } .btn-edit .cc.bad { color: var(--danger); font-weight: 700; }

/* ---------- Editor de automatizaciones ---------- */
.page-automations { position: relative; }
.flow-editor { position: relative; height: 100vh; overflow: hidden; background: var(--bg-chat); }
.flow-canvas { position: absolute; inset: 0; cursor: grab; background-image: radial-gradient(circle, var(--border-strong) 1.2px, transparent 1.3px); background-size: 22px 22px; }
.flow-canvas.panning { cursor: grabbing; }
.flow-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.flow-edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.flow-edges .edge { fill: none; stroke: var(--text-3); stroke-width: 2; }
.flow-edges .edge.pe-replied, .flow-edges .edge.pe-yes { stroke: var(--green); }
.flow-edges .edge.pe-timeout, .flow-edges .edge.pe-no, .flow-edges .edge.pe-blocked, .flow-edges .edge.pe-window_closed { stroke: #f2a23a; }
.flow-edges .edge.sel { stroke: var(--primary); stroke-width: 3; }
.flow-edges .edge.temp { stroke: var(--primary); stroke-dasharray: 6 5; }
.flow-edges .edge-hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; pointer-events: stroke; }
.flow-edges .arrow-head { fill: var(--text-3); }
.flow-edges .edge-del { cursor: pointer; } .flow-edges .edge-del circle { fill: var(--danger); } .flow-edges .edge-del path { stroke: #fff; stroke-width: 2; }
.fnode { position: absolute; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.25); cursor: default; }
[data-theme="light"] .fnode { box-shadow: 0 4px 18px rgba(20,22,40,.08); }
.fnode.sel { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), 0 4px 18px rgba(0,0,0,.25); }
.fnode.t-trigger { border-top: 3px solid var(--primary); }
.fn-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px 14px; cursor: move; }
.fn-title { font-weight: 700; font-size: 14px; flex: 1; line-height: 1.25; }
.fn-kind { font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: 5px; padding: 2px 6px; }
.fn-del { opacity: 0; } .fnode:hover .fn-del, .fnode.sel .fn-del { opacity: 1; }
.fn-body { padding: 0 14px 10px; display: grid; gap: 8px; }
.fn-body:empty { display: none; }
.nf label { display: block; font-size: 11.5px; color: var(--text-2); font-weight: 600; margin-bottom: 3px; }
.nf .nv { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; font-size: 13px; line-height: 1.4; }
.nf .nv.small { font-size: 12.5px; color: var(--text-2); max-height: 76px; overflow: hidden; }
.nf .nv.missing { color: #f2a23a; border-style: dashed; }
.fn-ports { border-top: 1px solid var(--border); padding: 6px 0; }
.fn-port { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 5px 22px 5px 14px; font-size: 12.5px; color: var(--text-2); font-weight: 600; text-align: right; }
.fn-port.p-replied span:first-child, .fn-port.p-yes span:first-child { color: var(--green); }
.fn-port.p-timeout span:first-child, .fn-port.p-no span:first-child, .fn-port.p-blocked span:first-child, .fn-port.p-window_closed span:first-child { color: #f2a23a; }
.out-port { position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text-3); cursor: crosshair; }
.out-port:hover, .out-port.on { border-color: var(--primary); } .out-port.on { background: var(--primary); }
.in-port { position: absolute; left: 50%; top: -7px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text-3); }
.port-add { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--primary); color: #fff; flex: none; }
.port-add svg { width: 12px; height: 12px; }
.flow-top { position: absolute; left: 240px; right: 16px; top: 14px; display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px 8px; box-shadow: var(--shadow); z-index: 5; }
.flow-name { border: 0; background: transparent; font-size: 15px; font-weight: 700; min-width: 220px; padding: 4px 6px; }
.flow-name:focus { background: var(--surface); }
.state-chip { height: 26px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-weight: 700; background: var(--chip); color: var(--text-2); }
.state-chip.on { background: rgba(34,197,94,.15); color: var(--green); }
.flow-opt { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.warn-chip { display: inline-flex; gap: 5px; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px; background: rgba(242,162,58,.14); color: #f2a23a; font-weight: 700; font-size: 12.5px; }
.warn-chip svg { width: 14px; height: 14px; }
.flow-palette { position: absolute; left: 14px; top: 14px; bottom: 14px; width: 212px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 12px; padding: 10px; overflow-y: auto; z-index: 5; box-shadow: var(--shadow); }
.pal-title { font-weight: 700; font-size: 14px; padding: 4px 6px 8px; }
.pal-group { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; padding: 10px 6px 4px; }
.pal-item { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 6px; border-radius: 8px; font-size: 13px; }
.pal-item:hover { background: var(--hover); }
.pal-tip { margin-top: 14px; padding: 10px; border-radius: 8px; background: var(--surface); font-size: 12px; color: var(--text-2); line-height: 1.45; }
.flow-zoom { position: absolute; left: 240px; bottom: 16px; display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px; padding: 3px; z-index: 5; }
.flow-panel { position: absolute; right: 16px; top: 72px; bottom: 16px; width: 340px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); z-index: 6; display: flex; flex-direction: column; }
.fp-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--border); }
.fp-body { padding: 14px; overflow-y: auto; display: grid; gap: 12px; align-content: start; flex: 1; }
.fp-foot { padding: 10px 14px; border-top: 1px solid var(--border); }

/* Ajustes tras la comparación visual (v0.2) */
.chat-title .row1 { min-width: 0; overflow: hidden; }
.chat-title .name { flex: 0 1 auto; min-width: 130px; }
.chat-title .row1 .label-chip, .chat-title .row1 .consent-badge { flex: none; }
.composer-left { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.composer-bar { gap: 8px; }
.composer-bar .btn { flex: none; }
.chip-btn { padding: 0 7px; margin-left: 2px; }
.chip-btn.ai { padding: 0 6px; }
@media (max-width: 1500px) { .chip-btn.ai .lbl { display: none; } }

/* ---------- Seguridad y recuperación de contraseña ---------- */
.login .forgot { display: block; margin: 12px auto 0; }
.form-ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.35); color: var(--text); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }
.demo-link { margin-top: 8px; } .demo-link a { color: var(--primary); }
.settings-sec .stat-row, .stat-row.four { grid-template-columns: repeat(4, 1fr); }
#sMain .stat-row { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 22px; } .stat b.bad { color: #ef4444; }
.check-list { display: grid; gap: 6px; margin-bottom: 18px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.check-item .ci-dot { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.check-item.ok .ci-dot { background: rgba(34,197,94,.18); color: #22c55e; }
.check-item.warn .ci-dot { background: rgba(245,158,11,.18); color: #f59e0b; }
.check-item.bad .ci-dot { background: rgba(239,68,68,.18); color: #ef4444; }
.sev { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--surface-2); }
.sev.warn { background: rgba(245,158,11,.18); color: #f59e0b; } .sev.bad { background: rgba(239,68,68,.18); color: #ef4444; }

/* ---------- Bienvenida, recorrido guiado y primeros pasos ---------- */
.ob-welcome { padding: 28px 28px 24px; text-align: left; }
.ob-welcome .ob-logo { width: 44px; height: 44px; margin-bottom: 12px; }
.ob-welcome h2 { font-size: 20px; margin: 0 0 6px; line-height: 1.3; }
.ob-welcome p { margin: 0 0 16px; }
.ob-role { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.5; }
.ob-role .i { flex: none; margin-top: 2px; color: var(--primary); }
.ob-role.demo { background: var(--warn-bg); border-color: var(--warn-border); }
.ob-role.demo .i { color: #f59e0b; }
.ob-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

#tour { position: fixed; inset: 0; z-index: 1000; }
.tour-block { position: absolute; inset: 0; }
.tour-hole { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58); outline: 2px solid var(--primary); transition: all .25s ease; pointer-events: none; }
.tour-card { position: fixed; width: 340px; max-width: calc(100vw - 16px); background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 16px 12px; transition: left .25s ease, top .25s ease; }
.tour-card h3 { margin: 4px 0 6px; font-size: 15.5px; }
.tour-card p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.tour-card p b { color: var(--text); }
.tour-foot { display: flex; align-items: center; gap: 8px; }
.tour-foot .spacer { flex: 1; }

.ob-list { position: fixed; right: 18px; bottom: 18px; z-index: 900; }
.ob-list.behind { z-index: 10; }
.ob-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: 22px; padding: 8px 14px 8px 10px; box-shadow: var(--shadow); font: inherit; font-size: 13px; cursor: pointer; }
.ob-pill:hover { border-color: var(--primary); }
.ob-ring { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-2) 0); }
.ob-list.open { width: 320px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }
.ob-head { display: flex; align-items: center; gap: 8px; }
.ob-head b { flex: 1; }
.ob-bar { height: 5px; background: var(--surface-2); border-radius: 4px; margin: 8px 0 10px; overflow: hidden; }
.ob-bar span { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.ob-items { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.ob-item { display: flex; gap: 10px; font-size: 13px; line-height: 1.4; }
.ob-item.done > div { color: var(--text-3); text-decoration: line-through; }
.ob-check { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.ob-item.done .ob-check { background: var(--green); border-color: var(--green); color: #fff; }
.ob-check .i { width: 12px; height: 12px; }
.ob-foot { display: flex; justify-content: space-between; margin-top: 12px; }

.help-page { height: 100%; overflow: auto; padding: 28px 36px 60px; }
.help-page .page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; max-width: 1040px; }
.help-page h1 { margin: 0 0 4px; font-size: 24px; }
.help-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; max-width: 1040px; }
.help-toc { position: sticky; top: 0; align-self: start; display: grid; gap: 2px; }
.help-toc a { color: var(--text-2); text-decoration: none; padding: 6px 10px; border-radius: 7px; font-size: 13.5px; }
.help-toc a:hover { background: var(--hover); color: var(--text); }
.help-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; margin-bottom: 14px; scroll-margin-top: 12px; }
.help-sec h2 { margin: 0 0 8px; font-size: 16px; }
.help-sec p, .help-sec li { font-size: 14px; line-height: 1.65; color: var(--text-2); margin: 0 0 8px; }
.help-sec b { color: var(--text); }
.help-sec ul { margin: 0; padding-left: 18px; }
@media (max-width: 900px) { .help-grid { grid-template-columns: 1fr; } .help-toc { position: static; } }
