/* Panel de remarketing · estilos.
   Valores tomados del Figma "Scalboost v3 · Web actual", página CRM · Remarketing WhatsApp. */

@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0c0c0c;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.1);
  --line-3: rgba(255, 255, 255, 0.16);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.6);
  --text-3: rgba(255, 255, 255, 0.55);
  --muted: #86888a;
  --faint: #6a6c6e;
  --accent: #ff460d;
  --accent-2: #ff7a51;
  --green: #5fd39a;
  --pink: #ff6aa9;
  --amber: #ffb26b;
  --pill: 999px;
  --geist: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --inter: 'Inter', 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--geist); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1 { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ── Piezas comunes ── */
.logo { position: relative; display: block; flex: none; width: 36px; height: 36px; overflow: clip; }
.logo img { position: absolute; inset: 0 1.82% 1.82% 0; width: 98.18%; height: 98.18%; display: block; }

.kicker { font-family: var(--inter); font-weight: 500; font-size: 10px; line-height: 15px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-3); }

.btn-primary { height: 40px; padding: 0 20px; border: 0; border-radius: 11px; background: linear-gradient(to bottom, var(--accent-2), var(--accent)); color: #fff; font-weight: 600; font-size: 13px; line-height: 24px; white-space: nowrap; filter: drop-shadow(0 3.8px 5.7px rgba(255, 70, 13, 0.55)); }
.btn-primary:disabled { filter: none; opacity: 0.35; cursor: default; }

.pill { height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--pill); background: #171717; color: var(--text-2); font-weight: 500; font-size: 12px; line-height: 18px; white-space: nowrap; }
a.pill { display: inline-flex; align-items: center; text-decoration: none; }
.pill:hover { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.pill.is-on { background: #333; border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.pill-danger { color: var(--pink); border-color: rgba(255, 106, 169, 0.45); background: rgba(255, 106, 169, 0.1); }
.pill-danger:hover { color: var(--pink); border-color: var(--pink); }

.tag { display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: var(--pill); background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.7); font-family: var(--inter); font-weight: 500; font-size: 10px; line-height: 10px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; padding: 2px 6px; border: 1px solid; border-radius: var(--pill); font-family: var(--inter); font-weight: 500; font-size: 8.5px; line-height: 8.5px; letter-spacing: 0.85px; text-transform: uppercase; white-space: nowrap; }
.badge-green { color: var(--green); background: rgba(95, 211, 154, 0.1); border-color: rgba(95, 211, 154, 0.45); }
.badge-amber { color: var(--amber); background: rgba(255, 70, 13, 0.08); border-color: rgba(255, 122, 26, 0.4); }
.badge-gray { color: #9a9a9a; background: rgba(154, 154, 154, 0.1); border-color: rgba(154, 154, 154, 0.45); }
.badge-pink { color: var(--pink); background: rgba(255, 106, 169, 0.1); border-color: rgba(255, 106, 169, 0.45); }

.avatar { position: relative; flex: none; display: grid; place-items: center; overflow: clip; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface-2); color: #fff; font-weight: 500; }
.avatar::before { content: ''; position: absolute; left: 29%; top: -33%; width: 100%; height: 100%; border-radius: 50%; background: var(--tint, #3859d8); filter: blur(9px); opacity: 0.32; }
.avatar span { position: relative; }

/* ── Entrada ── */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 18px; background: rgba(20, 20, 20, 0.9); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5); }
.login-card h1 { margin-top: 8px; font-weight: 500; font-size: 22px; line-height: 27.5px; }
.login-card p { color: var(--muted); }
.login-card input { height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.form-error { min-height: 18px; color: var(--pink) !important; font-size: 12px; }

/* ── Estructura ── */
.app { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.glow { position: absolute; left: 50%; top: -60px; width: 720px; height: 340px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(255, 70, 13, 0.08), rgba(255, 70, 13, 0) 72%); filter: blur(50px); pointer-events: none; }

.topbar { position: relative; flex: none; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 16px 24px 12px; }
.topbar-left { display: flex; align-items: center; gap: 24px; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; font-family: var(--inter); font-weight: 500; font-size: 14px; line-height: 20px; color: var(--text-3); white-space: nowrap; }
.nav-link svg { flex: none; width: 16px; height: 16px; }
.nav-link.is-active, a.nav-link:hover { color: #fff; }
a.nav-link { text-decoration: none; }
.nav-count { min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: var(--pill); background: linear-gradient(to bottom, var(--accent-2), var(--accent)); color: #fff; font-weight: 600; font-size: 10px; line-height: 1; }
.nav-count:empty { display: none; }
.nav-button { padding: 0; border: 0; background: none; }
.nav-button:hover { color: #fff; }

.inbox { position: relative; flex: 1; min-height: 0; display: flex; }

/* ── Lista ── */
.list { flex: none; width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 4px 12px 0 24px; border-right: 1px solid var(--line); min-height: 0; }
.list-head h1 { padding-top: 10px; font-weight: 500; font-size: 22px; line-height: 27.5px; }
.list-head .sub { padding-top: 4px; color: var(--muted); line-height: 19.5px; }
.list-tools { display: flex; gap: 6px; }
.search { flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; }
.search input::placeholder { color: #8c8c95; }
.search:focus-within { border-color: rgba(255, 255, 255, 0.35); }
.select { flex: none; max-width: 132px; height: 36px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--pill); background: #171717; color: var(--text-2); font-weight: 500; font-size: 12px; line-height: 18px; white-space: nowrap; }
.chip.is-active { background: #333; border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.chip b { font-weight: 500; color: var(--accent-2); margin-left: 2px; }
.chip b:empty { display: none; }

.convs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 4px 16px 0; margin-right: -8px; padding-right: 8px; }
.conv { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; background: var(--surface); text-align: left; }
.conv:hover { border-color: var(--line-3); }
.conv.is-active { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.35); }
.conv .avatar { width: 40px; height: 40px; font-size: 16px; }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-top { display: flex; align-items: baseline; gap: 8px; }
.conv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; line-height: 21px; }
.conv-time { flex: none; color: var(--muted); font-size: 11px; }
.conv-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; line-height: 18px; }
.conv-preview.is-unread { color: rgba(255, 255, 255, 0.85); }
.conv-tags { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.unread { margin-left: auto; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; border-radius: var(--pill); background: linear-gradient(to bottom, var(--accent-2), var(--accent)); color: #fff; font-family: var(--inter); font-weight: 600; font-size: 10px; }
.empty { padding: 32px 12px; color: var(--muted); text-align: center; }

/* ── Conversación ── */
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.chat-empty { flex: 1; display: grid; place-content: center; gap: 8px; text-align: center; color: var(--muted); }
.chat-open { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 24px 12px; border-bottom: 1px solid var(--line); }
.chat-head .avatar { width: 44px; height: 44px; font-size: 17.6px; }
.chat-who { flex: 1; min-width: 0; }
.chat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; line-height: 21px; }
.chat-phone { color: var(--muted); font-size: 11px; line-height: 16.5px; }
.chat-actions { display: flex; gap: 6px; }
.icon-btn.is-shown { display: grid; place-items: center; flex: none; text-decoration: none; }
.icon-btn.is-plain { border: 0; background: none; }
.icon-btn.is-plain:hover { background: rgba(255, 255, 255, 0.06); }
.icon-btn { display: none; width: 32px; height: 32px; border: 1px solid var(--line-2); border-radius: var(--pill); background: #171717; color: var(--text-2); font-size: 18px; line-height: 1; }

.thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 20px 24px; }
.day { align-self: center; margin: 12px 0 8px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: var(--pill); background: rgba(255, 255, 255, 0.04); color: var(--muted); font-family: var(--inter); font-weight: 500; font-size: 10px; line-height: 10px; }
.msg { max-width: min(560px, 78%); display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.msg.in { align-self: flex-start; align-items: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface-2); font-size: 14px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.in .bubble { border-bottom-left-radius: 5px; }
.msg.out .bubble { border-bottom-right-radius: 5px; background: rgba(255, 70, 13, 0.1); border-color: rgba(255, 122, 81, 0.35); }
.bubble a { color: var(--amber); }
.bubble img { display: block; max-width: 280px; max-height: 340px; border-radius: 10px; }
.bubble img + .caption, .bubble audio + .caption { margin-top: 8px; }
.bubble audio { display: block; width: 270px; max-width: 100%; height: 36px; }
.bubble .file { color: var(--text-2); font-size: 12.5px; }
.meta { padding: 0 4px; color: var(--faint); font-size: 10px; line-height: 13px; }

.notice { flex: none; margin: 0 24px 10px; padding: 10px 12px; border: 1px solid rgba(255, 106, 169, 0.45); border-radius: 12px; background: rgba(255, 106, 169, 0.08); color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 12px; }
.notice span { flex: 1; }
.notice.is-warn { border-color: rgba(255, 122, 26, 0.4); background: rgba(255, 70, 13, 0.08); }

.composer { flex: none; margin: 0 24px 20px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 18px; background: rgba(20, 20, 20, 0.9); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5); }
.composer textarea { display: block; width: 100%; min-height: 54px; max-height: 180px; padding: 16px 16px 4px; border: 0; outline: 0; resize: none; background: none; font-size: 15px; line-height: 22px; }
.composer textarea::placeholder { color: #8c8c95; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 10px 16px; }
.hint { color: var(--muted); font-size: 11px; }
.hint.is-error { color: var(--pink); }

/* ── Datos del contacto ── */
.details { flex: none; width: 316px; padding: 4px 24px 20px 0; overflow-y: auto; }
.panel { display: flex; flex-direction: column; gap: 16px; padding: 16px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 18px; background: var(--surface); }
.panel-title { font-weight: 500; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { color: var(--muted); font-weight: 500; font-size: 11px; line-height: 16px; }
.field-box { min-height: 44px; display: flex; flex-direction: column; justify-content: center; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.field-value { font-weight: 500; font-size: 12.5px; line-height: 16px; overflow-wrap: anywhere; }
.field-sub { color: var(--faint); font-size: 10px; line-height: 13px; }
.field-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.panel-note { color: var(--muted); font-size: 12px; }

/* ── Páginas con barra lateral (Campañas, Segmentos, Contactos, Números) ── */
.view { position: relative; flex: 1; min-height: 0; overflow-y: auto; }
.view-page { min-height: 100%; display: flex; flex-direction: column; }
.page { flex: 1; display: flex; min-height: 100%; }
.sidebar { position: sticky; top: 0; align-self: flex-start; flex: none; width: 248px; height: calc(100vh - 64px); display: flex; flex-direction: column; gap: 16px; padding: 4px 12px 16px 24px; border-right: 1px solid var(--line); }
.sidebar-new { position: relative; flex: none; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; background: linear-gradient(to bottom, #2b2b2f, #1a1a1d); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16); filter: drop-shadow(0 6px 7px rgba(0, 0, 0, 0.5)); color: #fff; font-weight: 500; font-size: 13px; line-height: 19.5px; text-decoration: none; }
.sidebar-new:hover { border-color: rgba(255, 255, 255, 0.35); }
.sidebar-plus { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.sidebar-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }
.sidebar-title { padding: 0 8px 4px; color: var(--muted); font-weight: 500; font-size: 11px; line-height: 16.5px; }
.sidebar-item { flex: none; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 8px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13px; line-height: 19.5px; text-decoration: none; }
.sidebar-item:hover, .sidebar-item.is-active { background: rgba(255, 255, 255, 0.05); color: #fff; }
.sidebar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-xs { width: 22px; height: 22px; font-size: 8.8px; }

.content { flex: 1; min-width: 0; max-width: 1192px; padding: 32px 80px 56px; }
.heading h1 { padding-top: 10px; font-weight: 500; font-size: 22px; line-height: 27.5px; }
.heading .sub, .sub { padding-top: 4px; color: var(--muted); line-height: 19.5px; }
.heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.heading-actions { display: flex; align-items: center; gap: 6px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 16px; }
.toolbar.is-start { justify-content: flex-start; align-items: flex-start; }
.toolbar .chips { min-width: 0; }
.search.is-fixed { flex: none; width: 260px; }
.spacer { flex: 1; }
.text-btn { padding: 0; border: 0; background: none; color: var(--text-3); font-weight: 500; font-size: 12px; line-height: 24px; text-align: left; }
.text-btn:hover { color: #fff; }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 255, 255, 0.04); font-size: 13px; }
.input:focus { outline: 0; border-color: rgba(255, 255, 255, 0.35); }
.input:disabled { opacity: 0.45; }

/* Tarjetas */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 336px)); gap: 12px; }
.card { position: relative; height: 144px; display: flex; flex-direction: column; padding: 16px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; background: var(--surface); overflow: clip; }
.card.is-link { cursor: pointer; }
.card.is-link:hover { border-color: var(--line-3); }
.card.is-live::before { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent-2); filter: blur(26px); opacity: 0.16; pointer-events: none; }
.card-head { position: relative; display: flex; align-items: center; gap: 12px; }
.card .avatar, .row .avatar { width: 44px; height: 44px; font-size: 17.6px; }
.card-title { flex: 1; min-width: 0; }
.card-name { display: flex; align-items: center; gap: 6px; height: 21px; font-weight: 500; font-size: 14px; line-height: 21px; }
.card-name > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-name .badge { flex: none; }
.card-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; line-height: 16.5px; }
.dots { display: flex; align-items: center; gap: 2px; height: 20px; margin-top: 14px; opacity: 0.6; }
.dots i { flex: 1 1 7px; max-width: 7px; min-width: 1.5px; height: 6px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.15); }
.dots i.on { background: var(--accent-2); }
.card-chips { display: flex; align-items: center; gap: 6px; margin-top: auto; min-height: 20px; }
.stats-row { margin-top: 14px; flex-wrap: wrap; }
.card-trash { width: 32px; height: 32px; margin-right: -6px; border-radius: 50%; opacity: 0.45; }
.card-trash:hover { opacity: 1; }
.card-action { opacity: 0; line-height: 20px; }
.card-link { line-height: 20px; text-decoration: none; white-space: nowrap; }
.card-action { white-space: nowrap; }
.card:hover .card-action, .card:focus-within .card-action { opacity: 1; }
.round-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: linear-gradient(to bottom, var(--accent-2), var(--accent)); filter: drop-shadow(0 3px 5px rgba(255, 70, 13, 0.5)); opacity: 0.6; }
.round-btn:hover, .round-btn.is-lg { opacity: 1; }
.round-btn.is-lg { width: 40px; height: 40px; }
.pause-icon { display: block; width: 10px; height: 12px; border-left: 3px solid #fff; border-right: 3px solid #fff; }

/* Editor (Nueva campaña, Nuevo segmento) */
.editor { display: flex; align-items: flex-start; gap: 24px; margin-top: 20px; }
.editor-main { flex: 1; min-width: 0; max-width: 716px; display: flex; flex-direction: column; gap: 12px; }
.editor-side { flex: none; width: 292px; }
.editor-names { display: flex; gap: 8px; }
.text-card { border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 18px; background: rgba(20, 20, 20, 0.9); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.editor-text { display: block; width: 100%; min-height: 176px; padding: 16px; border: 0; outline: 0; resize: vertical; background: none; font-size: 15px; line-height: 24px; }
.editor-title { display: block; width: 100%; padding: 16px; border: 0; outline: 0; background: none; font-size: 15px; line-height: 24px; }
.editor-text::placeholder, .editor-title::placeholder { color: #8c8c95; }
.editor-text:disabled { color: rgba(255, 255, 255, 0.85); }
.text-card-foot { display: flex; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.image-pill { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--surface-2); }
.image-pill:disabled { cursor: default; }
.thumb { flex: none; width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.thumb.is-empty { background: linear-gradient(120deg, #131219 8%, #181628 52%, #111017 92%); border: 1px solid var(--line-2); }
.image-pill-text { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.image-pill-text span:first-child { font-weight: 500; font-size: 13px; line-height: 13px; }
.image-pill-text span:last-child { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; line-height: 10px; }
.section-label { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-weight: 500; font-size: 12px; line-height: 24px; }
.count-pill { padding: 2px 6px; border: 1px solid var(--line-2); border-radius: var(--pill); background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.5); font-weight: 400; font-size: 10px; line-height: 10px; }

.voice { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; background: var(--surface); }
button.voice.is-empty { height: 64px; align-items: center; justify-content: center; border-style: dashed; border-color: var(--line-3); color: var(--text-2); font-weight: 500; font-size: 12.5px; }
button.voice.is-empty:hover { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.voice-head { display: flex; align-items: center; gap: 12px; }
.voice-head .avatar { width: 34px; height: 34px; font-size: 13.6px; }
.voice-who { flex: 1; min-width: 0; }
.voice-name { font-weight: 500; font-size: 13px; line-height: 18px; }
.voice-file { color: var(--muted); font-size: 10px; line-height: 14px; }
.voice-player { display: flex; align-items: center; gap: 12px; }
.wave { flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; gap: 2px; }
.wave i { flex: 1; min-width: 2px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.16); }
.wave i.on { background: linear-gradient(to bottom, var(--accent-2), var(--accent)); }
.wave-time { flex: none; min-width: 76px; color: var(--muted); font-size: 11px; text-align: right; }

/* Panel derecho: campos, deslizadores e interruptores */
.panel-head { display: flex; align-items: center; gap: 8px; }
.rule { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--line); }
.picker { position: relative; }
.field-button { flex-direction: row; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; }
.field-button:disabled { cursor: default; opacity: 0.6; }
.field-button:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.35); }
.field-stack { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.field-stack .field-value, .field-stack .field-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-sub { color: var(--muted); }
.menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: 264px; overflow-y: auto; padding: 6px; border: 1px solid var(--line-3); border-radius: 12px; background: #1a1a1d; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6); }
.menu-item { width: 100%; display: flex; align-items: baseline; gap: 8px; padding: 8px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 12.5px; }
.menu-item:hover, .menu-item.is-on { background: rgba(255, 255, 255, 0.06); }
.menu-check { flex: none; width: 12px; color: var(--accent-2); }
.menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.menu-sub { flex: none; color: var(--faint); font-size: 10px; }
.menu-empty { padding: 8px; color: var(--muted); font-size: 12px; }

.slider { display: flex; flex-direction: column; }
.slider-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; line-height: 24px; }
.slider-label { color: rgba(255, 255, 255, 0.85); font-weight: 500; font-size: 12.5px; }
.slider-value { color: var(--muted); font-size: 11px; }
.slider-input { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; margin: 6px 0 0; background: transparent; cursor: pointer; }
.slider-input::-webkit-slider-runnable-track { height: 4px; border-radius: var(--pill); background: linear-gradient(to right, var(--accent-2), var(--accent)) 0 / var(--fill, 0%) 100% no-repeat, rgba(255, 255, 255, 0.12); }
.slider-input::-moz-range-track { height: 4px; border-radius: var(--pill); background: linear-gradient(to right, var(--accent-2), var(--accent)) 0 / var(--fill, 0%) 100% no-repeat, rgba(255, 255, 255, 0.12); }
.slider-input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 70, 13, 0.5); }
.slider-input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 70, 13, 0.5); }
.slider-input:disabled { opacity: 0.5; cursor: default; }
.slider-ends { display: flex; justify-content: space-between; color: var(--faint); font-size: 10px; line-height: 24px; }

.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; flex: none; width: 36px; height: 22px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.14); }
.toggle-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.toggle-input:checked + .toggle-track { background: linear-gradient(to right, var(--accent-2), var(--accent)); filter: drop-shadow(0 2px 4px rgba(255, 70, 13, 0.4)); }
.toggle-input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-input:focus-visible + .toggle-track { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.toggle-text { display: flex; flex-direction: column; }
.toggle-label { color: rgba(255, 255, 255, 0.85); font-weight: 500; font-size: 12.5px; line-height: 16px; }
.toggle-sub { color: var(--faint); font-size: 10px; line-height: 13px; }

/* Filas (Contactos, vista previa de un segmento) */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; background: var(--surface); }
.row-who { flex: none; width: 210px; min-width: 0; }
.row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; line-height: 21px; }
.row-phone { color: var(--muted); font-size: 11px; line-height: 16.5px; }
.row-tags { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.row-state { flex: none; width: 92px; display: flex; }
.row-none { color: var(--faint); font-size: 10px; white-space: nowrap; }
.more { display: flex; justify-content: center; margin-top: 16px; }

/* Ventanas y avisos */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.62); }
.modal { width: min(440px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 18px; background: #141414; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5); }
.modal.is-wide { width: min(640px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 0; }
.modal-title { font-weight: 500; font-size: 15px; line-height: 22px; }
.modal-sub { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 17px; }
.modal-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.modal-body.is-center { align-items: center; text-align: center; }
.modal-text { color: var(--text-2); font-size: 12.5px; line-height: 18px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 4px; }
.form-row { display: flex; flex-direction: column; gap: 4px; }
.facts { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text-2); font-size: 12.5px; line-height: 18px; }
.radios { display: flex; gap: 16px; }
.radio { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.radio input { accent-color: var(--accent); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 1px dashed var(--line-3); border-radius: 14px; background: var(--surface); color: var(--text-2); font-size: 12.5px; text-align: center; }
.drop strong { color: #fff; font-weight: 500; font-size: 13px; }
.drop:hover { border-color: rgba(255, 255, 255, 0.35); }
.qr { width: 264px; height: 264px; padding: 8px; border-radius: 12px; background: #fff; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; }
.media-tile { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 10px; text-align: left; }
.media-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.media-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tile.is-on, .media-row.is-on { border-color: var(--accent-2); }
.media-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.media-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line-2); border-radius: 12px; }
.media-row audio { flex: none; width: 280px; max-width: 60%; height: 36px; }
.media-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: min(520px, calc(100vw - 32px)); padding: 10px 14px; border: 1px solid var(--line-3); border-radius: 12px; background: #1f1f22; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5); font-size: 12.5px; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { border-color: rgba(255, 106, 169, 0.45); color: var(--pink); }

/* ── Alertas ── */
.nav-count.is-critical { background: linear-gradient(to bottom, #ff6aa9, #e0246f); }
.tag.is-alert { color: var(--pink); background: rgba(255, 106, 169, 0.1); border-color: rgba(255, 106, 169, 0.45); }
.tag.is-ok { color: var(--green); background: rgba(95, 211, 154, 0.1); border-color: rgba(95, 211, 154, 0.45); }
button.tag.is-link { cursor: pointer; }
button.tag.is-link:hover { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.panel-note.is-warn { color: var(--amber); }
.card-sub.is-bad { color: var(--pink); }

.health { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.health-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; background: var(--surface); color: var(--text-2); font-size: 12px; line-height: 18px; }
.health-item i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(95, 211, 154, 0.15); }
.health-item b { color: var(--muted); font-weight: 400; }
.health-item.is-bad { border-color: rgba(255, 106, 169, 0.45); color: #fff; }
.health-item.is-bad i { background: var(--pink); box-shadow: 0 0 0 3px rgba(255, 106, 169, 0.18); }
.health-item.is-bad b { color: var(--pink); }

.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; background: var(--surface); }
.alert.is-critical { border-color: rgba(255, 106, 169, 0.4); background: rgba(255, 106, 169, 0.05); }
.alert.is-closed { opacity: 0.75; }
.alert-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.alert-top { display: flex; align-items: center; gap: 8px; }
.alert-top .badge { flex: none; }
.alert-title { font-weight: 500; font-size: 14px; line-height: 21px; }
.alert-detail { color: var(--text-2); font-size: 12.5px; line-height: 18px; max-width: 72ch; }
.alert-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.alert-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.notify { max-width: 560px; margin-top: 28px; gap: 10px; }
.notify-row { display: flex; gap: 8px; }
.notify-row .input { flex: 1; }

/* ── Actividad ── */
.select.is-wide { max-width: 200px; }
.scope { margin: -4px 0 14px; }
.scope .chip b { margin-left: 8px; color: var(--text-2); font-size: 14px; }
.log { display: flex; flex-direction: column; }
.log-day { padding: 14px 0 6px; color: var(--muted); font-weight: 500; font-size: 11px; line-height: 16.5px; }
.log-day:first-child { padding-top: 0; }
.log-line { display: flex; align-items: flex-start; gap: 12px; padding: 9px 10px; border-top: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.log-line:hover, .log-line.is-open { background: rgba(255, 255, 255, 0.035); }
.log-time { flex: none; width: 58px; padding-top: 1px; color: var(--faint); font-family: var(--inter); font-size: 11px; line-height: 18px; font-variant-numeric: tabular-nums; }
.log-dot { flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.log-line.is-warn .log-dot { background: var(--amber); }
.log-line.is-error .log-dot { background: var(--pink); }
.log-body { flex: 1; min-width: 0; }
.log-text { color: rgba(255, 255, 255, 0.86); font-size: 12.5px; line-height: 19px; overflow-wrap: anywhere; }
.log-line.is-error .log-text { color: var(--pink); }
.log-detail { margin-top: 2px; color: var(--muted); font-size: 11.5px; line-height: 17px; overflow-wrap: anywhere; }
.log-refs { flex: none; max-width: 46%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.log-actor { flex: none; width: 62px; padding-top: 1px; color: var(--faint); font-size: 11px; line-height: 18px; text-align: right; }

/* ── Cuentas claras de una campaña ── */
.report { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; padding: 16px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 18px; background: var(--surface); }
.report-head { display: flex; align-items: center; gap: 12px; }
.report-head > div { flex: 1; min-width: 0; }
.report-head .text-btn { text-decoration: none; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
.count { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.count b { font-weight: 500; font-size: 20px; line-height: 26px; font-variant-numeric: tabular-nums; }
.count span { color: var(--muted); font-size: 11px; line-height: 15px; }
.count.is-zero b { color: var(--faint); }
.count.is-ok b { color: var(--green); }
.count.is-bad { border-color: rgba(255, 106, 169, 0.4); }
.count.is-bad b { color: var(--pink); }
.report-groups { display: flex; flex-direction: column; gap: 6px; }
.report-group { border: 1px solid var(--line); border-radius: 12px; }
.report-group summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.report-group summary::-webkit-details-marker { display: none; }
.report-group summary::before { content: '›'; flex: none; width: 10px; color: var(--muted); font-size: 16px; line-height: 16px; transition: transform 0.12s; }
.report-group[open] summary::before { transform: rotate(90deg); }
.report-title { flex: none; font-weight: 500; font-size: 13px; }
.report-note { min-width: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-rows { max-height: 320px; overflow-y: auto; border-top: 1px solid var(--line); }
.report-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.report-row + .report-row { border-top: 1px solid var(--line); }
.report-who { flex: none; width: 190px; min-width: 0; }
.report-who .row-name { font-size: 13px; line-height: 19px; }
.report-why { flex: 1; min-width: 0; color: var(--text-2); font-size: 12px; line-height: 17px; }

/* ── Agregar contactos a un segmento ── */
.textarea { width: 100%; min-height: 168px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 255, 255, 0.04); font-size: 13px; line-height: 20px; resize: vertical; font-variant-numeric: tabular-nums; }
.textarea:focus { outline: 0; border-color: rgba(255, 255, 255, 0.35); }
.textarea::placeholder { color: #77777f; }
.counts.is-four { grid-template-columns: repeat(4, 1fr); }
.include { display: flex; flex-direction: column; gap: 8px; }
.include-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Importar: revisión del archivo y filas rechazadas ── */
.import-check { display: flex; flex-direction: column; gap: 8px; }
.import-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.facts.is-small { font-size: 11.5px; line-height: 16px; color: var(--muted); }
.rejects { display: flex; flex-direction: column; gap: 8px; }
.rejects-head { display: flex; align-items: center; gap: 12px; }
.rejects-head .panel-note { flex: 1; }
.rejects-head .pill { flex: none; display: inline-flex; align-items: center; text-decoration: none; }
.rejects-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.rejects-row { display: flex; gap: 10px; padding: 7px 10px; font-size: 12px; line-height: 17px; }
.rejects-row + .rejects-row { border-top: 1px solid var(--line); }
.rejects-n { flex: none; width: 58px; color: var(--muted); }
.rejects-phone { flex: none; width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rejects-why { flex: 1; min-width: 0; color: var(--text-2); }
.rejects-list .panel-note { padding: 8px 10px; border-top: 1px solid var(--line); }

/* ── Pantallas angostas ── */
@media (max-width: 1240px) { .details { display: none; } .content { padding-left: 32px; padding-right: 32px; } }
@media (max-width: 1040px) { .editor { flex-direction: column; } .editor-side { width: 100%; max-width: 716px; } }
@media (max-width: 860px) {
  .topbar { gap: 14px; padding-left: 16px; padding-right: 16px; }
  .nav { gap: 14px; overflow-x: auto; scrollbar-width: none; }
  .topbar-left { min-width: 0; gap: 14px; }
  .topbar-right { flex: none; gap: 14px; }
  .sidebar { display: none; }
  .content { padding: 16px 16px 40px; }
  .row { flex-wrap: wrap; row-gap: 8px; }
  .row-who { width: auto; flex: 1; }
  .row-tags { flex-basis: 100%; order: 5; }
  .editor-names { flex-direction: column; }
  .alert { flex-direction: column; align-items: stretch; }
  .alert-actions { flex-wrap: wrap; }
  .log-line { flex-wrap: wrap; }
  .log-refs { max-width: none; flex-basis: 100%; justify-content: flex-start; padding-left: 77px; order: 5; }
  .log-actor { display: none; }
  .report-row { flex-wrap: wrap; }
  .report-why { flex-basis: 100%; order: 5; }
  .report-note, .report-group summary .spacer { display: none; }
  .report-group summary { flex-wrap: wrap; }
  .report-title { flex: 1 1 calc(100% - 30px); min-width: 0; }
  .report-group summary .pill { margin-left: 20px; }
  .toolbar { flex-wrap: wrap; }
  .search.is-fixed { width: 100%; }
  .select.is-wide { max-width: none; }
  .rejects-phone { width: 110px; }
  .counts.is-four { grid-template-columns: repeat(2, 1fr); }
  .list { width: 100%; border-right: 0; padding-right: 24px; }
  .chat { display: none; }
  .inbox.has-open .list { display: none; }
  .inbox.has-open .chat { display: flex; }
  .icon-btn.back { display: grid; place-items: center; }
  .chat-head, .thread { padding-left: 16px; padding-right: 16px; }
  .composer, .notice { margin-left: 16px; margin-right: 16px; }
}
