:root {
  --bg: #05060e;
  --sidebar: #040a1f;
  --panel: #0b1130;
  --panel-2: #0e1838;
  --line: rgba(110, 231, 255, 0.14);
  --line-strong: rgba(110, 231, 255, 0.32);
  --cyan: #00d2ff;
  --green: #22c55e;
  --amber: #facc15;
  --violet: #a78bfa;
  --red: #f87171;
  --text: #e2e8f0;
  --muted: #7c8ba3;
  --est-nuevo: #00d2ff;
  --est-contactado: #facc15;
  --est-cotizado: #a78bfa;
  --est-ganado: #22c55e;
  --est-perdido: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(0, 210, 255, 0.12), transparent 60%),
    radial-gradient(700px 400px at 0% 110%, rgba(59, 49, 240, 0.15), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
}
.hidden { display: none !important; }

.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; z-index: 50; }
.gate__card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 20px; padding: 34px 30px; text-align: center; }
.gate__mark { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, var(--cyan), #3b31f0); color: #030712; font-weight: 900; font-size: 24px; letter-spacing: .08em; display: grid; place-items: center; margin: 0 auto 16px; }
.gate h1 { font-size: 17px; letter-spacing: .14em; color: #fff; text-transform: uppercase; }
.gate h1 span { color: var(--cyan); }
.gate p { color: var(--muted); margin: 12px 0 22px; line-height: 1.6; }
.gate__btn { display: inline-block; background: var(--cyan); color: #030712; font-weight: 800; text-decoration: none; border-radius: 12px; padding: 12px 22px; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.gate__btn:hover { filter: brightness(1.1); }

.app { display: grid; grid-template-columns: 235px 1fr; grid-template-rows: 56px 1fr; grid-template-areas: "top top" "side main"; height: 100vh; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(3, 6, 14, 0.92); }
.brand { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 1.6s ease-in-out infinite; }
.dot.off { background: var(--red); box-shadow: 0 0 12px var(--red); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
h1 { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); font-weight: 800; }
h1 span { color: var(--muted); }
.status { font-family: 'Consolas', monospace; font-size: 10px; color: var(--muted); }
.status.ok { color: var(--green); }
.status.err { color: var(--red); }
.topstats { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.topstats b { font-size: 17px; color: #fff; display: block; }
.topstats small { font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.logout { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 7px 12px; border-radius: 9px; cursor: pointer; font-family: inherit; font-size: 11px; }
.logout:hover { color: var(--cyan); border-color: var(--line-strong); }

.side { grid-area: side; background: var(--sidebar); border-right: 1px solid var(--line); padding: 12px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.nav-title { font-size: 8.5px; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; padding: 13px 10px 6px; border-top: 1px solid var(--line); margin-top: 6px; }
.side .nav { display: block; width: 100%; text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); font-family: inherit; font-size: 11.5px; cursor: pointer; transition: background .12s, border-color .12s; }
.side .nav:hover { background: rgba(0, 210, 255, 0.07); }
.side .nav.active { background: rgba(0, 210, 255, 0.12); border-color: var(--line-strong); color: var(--cyan); }
.side-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 7px; }
.side-footer a, .side-footer button { font-family: inherit; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; background: var(--panel); padding: 8px 10px; text-decoration: none; cursor: pointer; text-align: center; }
.side-footer a:hover, .side-footer button:hover { color: var(--cyan); border-color: var(--line-strong); }

main { grid-area: main; display: flex; flex-direction: column; overflow: hidden; }
.toolbar { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
input[type="search"] { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 10px 14px; border-radius: 12px; outline: none; font-family: inherit; font-size: 12.5px; }
.chip-new { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-strong); color: var(--cyan); background: transparent; cursor: pointer; font-family: inherit; }
.chip-new:hover { background: rgba(0, 210, 255, 0.1); }

.board { display: none; overflow-x: auto; gap: 12px; padding: 14px; flex: 1; }
.board.active { display: flex; }
.col { flex: 1 1 0; min-width: 220px; display: flex; flex-direction: column; background: rgba(11, 17, 48, 0.55); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.col h3 { font-size: 9.5px; letter-spacing: .18em; padding: 11px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); }
.col h3 b { font-family: 'Consolas', monospace; }
.col.nuevo h3 { color: var(--est-nuevo); } .col.contactado h3 { color: var(--est-contactado); }
.col.cotizado h3 { color: var(--est-cotizado); } .col.ganado h3 { color: var(--est-ganado); } .col.perdido h3 { color: var(--est-perdido); }
.col-body { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.wcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; cursor: pointer; }
.wcard:hover { border-color: var(--line-strong); }
.type-tag { font-size: 8.5px; font-family: 'Consolas', monospace; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.wcard b { font-size: 12px; color: #fff; display: block; margin-top: 6px; }
.wcard-contact { font-family: 'Consolas', monospace; font-size: 9.5px; color: var(--muted); margin-top: 4px; word-break: break-all; line-height: 1.5; }
.wcard-actions { display: flex; gap: 6px; margin-top: 8px; }
.wcard-actions a { flex: 1; text-align: center; font-size: 10px; padding: 4px 6px; border-radius: 7px; border: 1px solid var(--line); background: rgba(0, 210, 255, 0.05); color: var(--cyan); text-decoration: none; }
.wcard-actions a:hover { border-color: var(--line-strong); }

.byapp { flex: 1; overflow-y: auto; display: none; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 14px; align-content: start; }
.byapp.active { display: grid; }
.bycard { background: linear-gradient(165deg, var(--panel), #080d24); border: 1px solid var(--line); border-radius: 16px; padding: 13px; }
.bycard h4 { font-size: 13px; color: #fff; }
.byarea, .bymeta { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }
.plan-pills { display: flex; gap: 5px; margin: 10px 0; flex-wrap: wrap; }
.plan-pill { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; border-radius: 6px; padding: 3px 9px; border: 1px solid; cursor: default; }
.plan-free { color: #94a3b8; border-color: rgba(148,163,184,.4); background: rgba(148,163,184,.08); }
.plan-premium { color: var(--amber); border-color: rgba(250,204,21,.4); background: rgba(250,204,21,.08); }
.plan-pro { color: var(--violet); border-color: rgba(167,139,250,.45); background: rgba(167,139,250,.09); }
.plan-enterprise { color: var(--green); border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.09); }
.pill-btn { cursor: pointer; }
.pill-btn:hover { filter: brightness(1.3); }
.plan-table { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; display: grid; gap: 5px; }
.plan-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 6px; align-items: center; font-size: 10.5px; padding: 5px 6px; border-radius: 8px; background: rgba(255,255,255,.02); }
.plan-row .em { color: var(--muted); font-family: 'Consolas', monospace; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-row .plan-tag { cursor: pointer; }
.roles { font-family: 'Consolas', monospace; font-size: 9.5px; color: var(--muted); }

.tabla-wrap { flex: 1; overflow: auto; padding: 0 14px 14px; display: none; }
.tabla-wrap.active { display: block; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
thead th { position: sticky; top: 0; background: #070d26; color: var(--muted); text-align: left; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; padding: 10px; border-bottom: 1px solid var(--line); }
tbody td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: rgba(0, 210, 255, 0.04); }
.est-chip { font-size: 9px; padding: 3px 8px; border-radius: 6px; border: 1px solid; text-transform: uppercase; letter-spacing: .08em; }
.est-nuevo { color: var(--est-nuevo); border-color: rgba(0,210,255,.4); } .est-contactado { color: var(--est-contactado); border-color: rgba(250,204,21,.4); }
.est-cotizado { color: var(--est-cotizado); border-color: rgba(167,139,250,.4); } .est-ganado { color: var(--est-ganado); border-color: rgba(34,197,94,.4); }
.est-perdido { color: var(--est-perdido); border-color: rgba(248,113,113,.4); }
.atender { cursor: pointer; color: var(--cyan); background: none; border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 10px; font-size: 10px; }
.empty { text-align: center; color: var(--muted); padding: 80px 20px; }

.drawer { position: fixed; top: 56px; right: 0; bottom: 0; width: 420px; max-width: 96vw; background: #070d26; border-left: 1px solid var(--line-strong); z-index: 40; transform: translateX(105%); transition: transform .28s ease; display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.drawer-head b { color: #fff; font-size: 13px; }
.close-x { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; }
.drawer-body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.kv { display: grid; grid-template-columns: 108px 1fr; gap: 5px 10px; font-size: 11px; }
.kv dt { color: var(--muted); font-size: 8.5px; text-transform: uppercase; letter-spacing: .1em; padding-top: 2px; }
.kv dd { font-family: 'Consolas', monospace; word-break: break-all; font-size: 10.5px; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.actions a, .actions button { text-decoration: none; color: var(--cyan); border: 1px solid var(--line-strong); background: rgba(0, 210, 255, 0.06); border-radius: 9px; padding: 8px 12px; cursor: pointer; font-family: inherit; font-size: 11px; }
.pipeline { display: flex; gap: 5px; flex-wrap: wrap; margin: 10px 0 4px; }
.pipeline button { font-size: 9px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; font-family: inherit; letter-spacing: .08em; text-transform: uppercase; }
.pipeline button.on-nuevo, .pipeline button.on-ganado { color: var(--green); border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.09); }
.pipeline button.on-contactado, .pipeline button.on-cotizado { color: var(--amber); border-color: rgba(250,204,21,.4); background: rgba(250,204,21,.06); }
.pipeline button.on-perdido { color: var(--red); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.06); }
.drawer-section { border: 0; margin: 0; padding: 10px 2px 2px; }
textarea#noteInput { width: 100%; min-height: 74px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--text); font-family: inherit; font-size: 12px; outline: none; resize: vertical; }
.sync-line { font-size: 9px; color: var(--muted); font-family: 'Consolas', monospace; min-height: 14px; margin: 8px 0; }
.drawer-foot { display: flex; gap: 8px; margin-top: 8px; }
.drawer-foot button { flex: 1; border: 1px solid var(--line-strong); background: rgba(0, 210, 255, 0.08); color: var(--cyan); border-radius: 9px; padding: 10px; cursor: pointer; font-family: inherit; font-size: 11px; }

#toast { position: fixed; bottom: 16px; left: 50%; transform: translate(-50%, 16px); opacity: 0; background: #0a1630; border: 1px solid var(--line-strong); color: var(--cyan); padding: 9px 18px; border-radius: 12px; font-size: 11px; z-index: 60; pointer-events: none; transition: all .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  body { overflow: auto; height: auto; }
  .app { height: auto; min-height: 100vh; grid-template-columns: 1fr; grid-template-rows: 56px auto 1fr; grid-template-areas: "top" "side" "main"; }
  .side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .nav { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; font-size: 10px; }
  .nav-title { display: none; }
  .side-footer { flex: 0 0 auto; display: flex; border-top: 0; margin: 0; padding: 0 6px; align-items: center; gap: 8px; }
  .board { display: none; flex-direction: column; min-height: calc(100vh - 200px); }
  .byapp.active { grid-template-columns: 1fr; min-height: calc(100vh - 200px); }
  .col { min-width: 0; }
  table { display: block; }
  thead { display: none; }
  tbody { display: grid; gap: 8px; }
  tbody tr { display: block; background: var(--panel); border-radius: 10px; padding: 8px 10px; border: 1px solid var(--line); }
  tbody td { display: block; border: 0; padding: 2px 0; }
}


/* ===== SOPORTE CAME webmail ===== */
.came-board.active { display: flex; flex-direction: column; gap: 10px; padding: 14px; flex: 1; overflow: auto; }
.came-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.came-folders { display: flex; gap: 6px; flex-wrap: wrap; }
.came-tab { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 9px; padding: 8px 12px; cursor: pointer; font-family: inherit; font-size: 11px; }
.came-tab:hover { border-color: var(--line-strong); }
.came-tab.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 210, 255, 0.08); }
.came-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.came-table th { position: sticky; top: 0; background: #070d26; z-index: 1; }
.came-row-unread td { font-weight: 700; color: #fff; }
.came-row-archived td, .came-row-spam td, .came-row-trash td { opacity: 0.55; }
.came-row { cursor: pointer; }
.came-row:hover td { background: rgba(0, 210, 255, 0.05); }
.came-star { color: #FFD933; }
.came-primary { border-color: var(--cyan) !important; color: var(--cyan) !important; background: rgba(0, 210, 255, 0.18) !important; }
.came-auto { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.came-auto-toggle { display: flex; align-items: center; gap: 10px; font-size: 11px; cursor: pointer; }
.came-auto-subject, .came-auto-body { width: 100%; background: #080d24; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px 10px; font-family: inherit; font-size: 11px; outline: none; }
.came-auto-body { resize: vertical; min-height: 44px; }
.came-body { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 11px; color: var(--text); max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }

/* DESARROLLO SW — panel especial y aparte (tabla came_sw_request) */
.desw-board .came-folder .desw-num, .desw-board .came-tab span { color: var(--cyan); font-family: var(--pq-font-mono), monospace; font-size: 11px; margin-left: 4px; }
.desw-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid #2E2E3C; color: #C9CAD3; background: #14141D; }
.desw-pill--nueva { border-color: #FFD933; color: #FFD933; background: rgba(255, 217, 51, 0.08); }
.desw-pill--contactada { border-color: #22D3EE; color: #22D3EE; background: rgba(34, 211, 238, 0.08); }
.desw-pill--en_desarrollo { border-color: #A78BFA; color: #A78BFA; background: rgba(167, 139, 250, 0.10); }
.desw-pill--completada { border-color: #34D399; color: #34D399; background: rgba(52, 211, 153, 0.10); }
.desw-pill--descartada { border-color: #F87171; color: #F87171; background: rgba(248, 113, 113, 0.10); }
.desw-row td { vertical-align: middle; }
.desw-board .came-body { white-space: pre-wrap; }
#deswPipeline button.primary { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 210, 255, 0.12); }
.is-disabled { opacity: 0.45; pointer-events: none; }

/* CUENTAS DE CORREO INSTITUCIONALES + ENVIO MASIVO */
.board-title { margin: 0; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); font-weight: 800; }
.came-note { margin: 0; font-size: 11px; line-height: 1.55; color: var(--muted); max-width: 860px; }
.came-note b { color: var(--text); }
.came-select { background: #080d24; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px 10px; font-family: inherit; font-size: 11px; outline: none; max-width: 280px; }
.came-field-input { background: #080d24; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px 10px; font-family: inherit; font-size: 11px; outline: none; }
.came-mailbox-tag { display: block; font-size: 9px; color: var(--muted); letter-spacing: 0.05em; }
.cuentas-form { display: flex; gap: 8px; flex-wrap: wrap; }
.cuentas-form .came-field-input[type="email"] { min-width: 240px; flex: 1; }
.cuentas-primary { color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.cuentas-del { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 10px; cursor: pointer; font-family: inherit; }
.cuentas-del:hover { border-color: #F87171; color: #F87171; }
.masivo-grid { display: flex; flex-direction: column; gap: 6px; max-width: 720px; }
.masivo-label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.masivo-area { width: 100%; background: #080d24; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px 10px; font-family: inherit; font-size: 11px; outline: none; resize: vertical; }
.masivo-log { display: flex; flex-direction: column; gap: 3px; font-size: 10px; font-family: Consolas, monospace; max-height: 240px; overflow: auto; }
.masivo-line { padding: 2px 6px; border-radius: 6px; }
.masivo-ok { color: #34D399; }
.masivo-err { color: #F87171; }

/* BORRADORES (correos programados) */
.drafts-board .drafts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 60vh; }
.drafts-board .drafts-list-wrap { display: flex; flex-direction: column; gap: 10px; }
.drafts-table tbody tr { cursor: pointer; }
.drafts-table tbody tr.is-active td { background: rgba(0, 210, 255, 0.09); outline: 1px solid rgba(0, 210, 255, 0.35); }
.drafts-editor { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.draft-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; border: 1px solid var(--line); color: var(--muted); }
.draft-status--draft { border-color: #A78BFA; color: #A78BFA; background: rgba(167, 139, 250, 0.10); }
.draft-status--scheduled { border-color: #22D3EE; color: #22D3EE; background: rgba(34, 211, 238, 0.10); }
.draft-status--sent { border-color: #34D399; color: #34D399; background: rgba(52, 211, 153, 0.10); }
.draft-status--failed { border-color: #F87171; color: #F87171; background: rgba(248, 113, 113, 0.10); }
.draft-badge { display: inline-block; background: #14141D; border: 1px solid #2E2E3C; padding: 3px 9px; border-radius: 999px; font-size: 10px; margin-left: 6px; }
.draft-mailbox { display: inline-block; margin-left: 6px; color: var(--muted); font-size: 9px; }

/* BORRADORES — adjuntos: imágenes que hicimos / subidas comprimidas */
.attach-box { display: flex; flex-direction: column; gap: 6px; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; }
.attach-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.attach-gallery { flex: 1 1 190px; min-width: 150px; }
.attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attach-item { display: flex; gap: 8px; align-items: center; font-size: 10px; color: var(--muted); }
.attach-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #080d24; }
.attach-name { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-tag { font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: #A78BFA; border: 1px solid #2E2E3C; border-radius: 999px; padding: 1px 7px; }
.attach-remove { margin-left: auto; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 8px; }
.attach-remove:hover { color: #F87171; border-color: #F87171; }
.attach-badge { display: inline-block; margin-left: 6px; font-size: 9px; color: #22D3EE; }

/* WASAP — CRM de WhatsApp integrado */
.wasap-statsbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.wasap-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 118px; }
.wasap-stat__n { display: block; font-size: 24px; font-weight: 700; color: #22D3EE; font-family: 'Consolas', monospace; }
.wasap-stat__l { display: block; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.wasap-funnel { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.wstage-pill { display: inline-flex; align-items: center; gap: 6px; background: #0B1130; color: #9AD5FF; border: 1px solid #23365e; border-radius: 999px; padding: 3px 12px; font-size: 9.5px; letter-spacing: .04em; cursor: pointer; }
.wstage-pill span { color: #22D3EE; font-weight: 700; }
.wstage-pill:hover { border-color: #22D3EE; }
.wstage-pill.is-on { background: #082640; border-color: #22D3EE; color: #C9F0FF; box-shadow: 0 0 12px rgba(34,211,238,.25); }
.wasap-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr); gap: 14px; min-height: 58vh; }
.wasap-list-wrap { display: flex; flex-direction: column; }
.wasap-list { display: flex; flex-direction: column; gap: 8px; }
.wcard { display: grid; grid-template-columns: 44px 1fr; gap: 10px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--text); }
.wcard:hover { border-color: #23365e; }
.wcard.is-active { background: rgba(0, 210, 255, 0.09); border-color: rgba(0, 210, 255, 0.4); }
.wcard__avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #8B8B9C; display: grid; place-items: center; font-weight: 700; font-size: 16px; background: #0B1130; color: #E6EFFF; }
.wcard__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wcard__top { display: flex; align-items: baseline; gap: 8px; }
.wcard__name { font-size: 11px; font-weight: 700; color: #EAF6FF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcard__time { margin-left: auto; font-size: 9px; color: var(--muted); font-family: Consolas, monospace; white-space: nowrap; }
.wcard__preview { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-media { color: #A78BFA; font-style: italic; }
.wcard__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.wtag { font-size: 8.5px; letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); white-space: nowrap; }
.wtag--stage { border-color: #23365e; color: #9AD5FF; }
.wpill { font-size: 8.5px; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.wpill--pend { background: rgba(248, 113, 113, 0.15); color: #FCA5A5; border: 1px solid #F87171; }
.wpill--test { background: rgba(139, 139, 156, 0.15); color: #A5A5B5; border: 1px solid #3A3A46; }
.wpill--group { background: rgba(167, 139, 250, 0.15); color: #C4B5FD; border: 1px solid #A78BFA; }
.wasap-peer { font-size: 13px; color: #EAF6FF; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.wasap-peer__meta { font-size: 9.5px; color: var(--muted); margin-top: 4px; font-family: Consolas, monospace; }
.wasap-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.wasap-msgs { flex: 1; min-height: 180px; max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; background: #070D22; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.wasap-bubble { max-width: 82%; border-radius: 10px; padding: 8px 10px; font-size: 10.5px; line-height: 1.45; }
.wasap-bubble--in { align-self: flex-start; background: #101B3E; border: 1px solid #23365e; border-bottom-left-radius: 2px; color: #DCE8FF; }
.wasap-bubble--out { align-self: flex-end; background: rgba(0, 210, 255, 0.13); border: 1px solid rgba(0, 210, 255, 0.35); border-bottom-right-radius: 2px; color: #C9F6FF; }
.wasap-bubble__meta { display: flex; gap: 8px; align-items: baseline; font-size: 8.5px; color: var(--muted); margin-bottom: 3px; }
.wasap-bubble__body { white-space: pre-wrap; word-break: break-word; }
.wfail { color: #FCA5A5; border: 1px solid #F87171; border-radius: 4px; padding: 0 4px; font-size: 8px; }
/* WASAP — color de intención por clase (CSP sin style= inline) */
.wink-invest { border-color: #22D3EE; } .wtag--invest { border-color: #22D3EE; color: #22D3EE; }
.wink-compra  { border-color: #34D399; } .wtag--compra  { border-color: #34D399; color: #34D399; }
.wink-demo    { border-color: #A78BFA; } .wtag--demo    { border-color: #A78BFA; color: #A78BFA; }
.wink-soporte { border-color: #F5C15C; } .wtag--soporte { border-color: #F5C15C; color: #F5C15C; }
.wink-optout  { border-color: #F87171; } .wtag--optout  { border-color: #F87171; color: #F87171; }
.wink-otro    { border-color: #8B8B9C; } .wtag--otro    { border-color: #8B8B9C; color: #8B8B9C; }

/* LECTOR A PANTALLA COMPLETA — lectura amplia del correo */
.reader-overlay { position: fixed; inset: 0; z-index: 900; display: flex; align-items: stretch; justify-content: center; background: rgba(4, 8, 24, 0.86); backdrop-filter: blur(6px); }
.reader-overlay[hidden] { display: none !important; }
.reader-shell { display: flex; flex-direction: column; width: 100%; max-width: 860px; margin: auto; background: #0B1230; border: 1px solid #23365e; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(0, 210, 255, 0.10) inset; max-height: 100vh; }
.reader-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #23365e; background: linear-gradient(180deg, #101B3E, #0B1230); }
.reader-counters { display: flex; align-items: baseline; gap: 10px; font-family: Consolas, monospace; font-size: 12px; }
#readerIndex { color: #22D3EE; font-weight: 700; }
.reader-sep { color: #23365e; }
.reader-status { text-transform: uppercase; letter-spacing: .1em; font-size: 9px; padding: 2px 12px; border-radius: 999px; border: 1px solid #23365e; color: #8B8B9C; }
.reader-status--draft { border-color: #A78BFA; color: #A78BFA; background: rgba(167, 139, 250, .12); }
.reader-status--scheduled { border-color: #22D3EE; color: #22D3EE; background: rgba(34, 211, 238, .12); }
.reader-status--sent { border-color: #34D399; color: #34D399; background: rgba(52, 211, 153, .12); }
.reader-status--failed { border-color: #F87171; color: #F87171; background: rgba(248, 113, 113, .12); }
.reader-actions { display: flex; gap: 8px; align-items: center; }
.reader-close { background: none; border: 1px solid transparent; color: #8B8B9C; font-size: 20px; cursor: pointer; padding: 2px 10px; border-radius: 8px; }
.reader-close:hover { color: #fff; border-color: #F87171; }
.reader-body { flex: 1; overflow-y: auto; padding: 28px 40px 32px; }
.reader-subject { font-size: 22px; line-height: 1.3; color: #EAF6FF; margin: 0 0 18px; font-weight: 700; }
.reader-meta { display: flex; flex-direction: column; gap: 4px; border: 1px solid #1E2B52; border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; background: #070D22; }
.reader-meta__row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; font-size: 12px; }
.reader-meta__label { text-transform: uppercase; letter-spacing: .08em; font-size: 8px; color: var(--muted); padding-top: 2px; }
.reader-meta__val { color: #DCE8FF; word-break: break-all; font-family: Consolas, monospace; font-size: 11px; }
.reader-article { font-size: 14px; line-height: 1.72; color: #E6EFFF; white-space: pre-wrap; word-break: break-word; background: transparent; border: none; padding: 0; }
.reader-article p { margin: 0 0 12px; }
.reader-link { color: #22D3EE; text-decoration: underline; text-underline-offset: 3px; }
.reader-link:hover { color: #8CE9FF; }
.reader-attachments { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; border-top: 1px solid #1E2B52; padding-top: 14px; }
.reader-att { margin: 0; text-align: center; }
.reader-att img { width: 260px; max-width: 100%; height: 150px; object-fit: contain; background: #070D22; border: 1px solid #23365e; border-radius: 8px; }
.reader-att figcaption { font-size: 9px; color: var(--muted); margin-top: 4px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid #23365e; background: #0B1230; }
.reader-nav { min-width: 128px; }
.reader-nav[disabled] { opacity: .35; cursor: not-allowed; }
.reader-foot__hint { font-size: 9px; color: var(--muted); font-family: Consolas, monospace; letter-spacing: .05em; }
@media (max-width: 720px) {
  .reader-shell { max-width: 100%; border-radius: 0; }
  .reader-body { padding: 20px 18px 24px; }
  .reader-subject { font-size: 18px; }
  .reader-foot__hint { display: none; }
}
