/* ============================================================
   BC CRM · Barrionuevo & Asociados Abogados
   Paleta e indicaciones tomadas del diseño provisto por el cliente.
   ============================================================ */

:root {
    --dark: #151212;         /* fondo tarjetas / header / sidebar */
    --dark-border: #666363;  /* trazo de tarjetas oscuras */
    --input-bg: #565555;     /* fondo inputs (con 70% opacidad) */
    --input-text: #c0bcbc;   /* texto/placeholder de inputs */
    --btn-light-bg: #f3f1f1; /* fondo botón claro (INGRESAR) */
    --btn-light-text: #151212;
    --accent: #7a1f24;       /* rojo guinda institucional (acentos, activo, enviar) */
    --accent-dark: #5e1519;
    --accent-soft: #f6e7e8;  /* fondo tag suave sobre blanco */
    --panel: #ffffff;
    --panel-alt: #f6f5f4;
    --line: #e6e3e2;
    --text: #1c1a1a;
    --muted: #8a8585;
    --success: #2f7d4f;
    --success-soft: #e3f3e8;
    --warn: #8a8585;
    --warn-soft: #ececec;

    --font-brand: 'Century Schoolbook', 'PT Serif', Georgia, 'Times New Roman', serif;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-ui);
    background: var(--panel-alt);
    color: var(--text);
}

/* ==================== LOGIN ==================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #0c0a0a url('/img/login-bg.jpg') center center / cover no-repeat;
    position: relative;
}
.login-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(10,9,9,.55) 0%, rgba(10,9,9,.72) 55%, rgba(10,9,9,.85) 100%);
    backdrop-filter: blur(1px);
}
.login-card {
    position: relative;
    z-index: 1;
    background: var(--dark);
    border: 1px solid var(--dark-border);
    padding: 40px 40px 32px;
    border-radius: 18px;
    width: 340px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    text-align: center;
}
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
}
.login-logo .bc {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 26px;
    color: #fff;
    border: 1.5px solid #fff;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.login-logo .name {
    text-align: left;
    line-height: 1.15;
}
.login-logo .name b {
    font-family: var(--font-brand);
    color: #fff;
    font-size: 14px;
    letter-spacing: .3px;
    display: block;
}
.login-logo .name span {
    font-family: var(--font-brand);
    color: var(--input-text);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.login-card h1 {
    font-family: var(--font-brand);
    font-weight: 400;
    color: #fff;
    font-size: 20px;
    margin: 0 0 26px;
}
.login-card label {
    display: block;
    text-align: left;
    font-family: var(--font-brand);
    color: var(--input-text);
    font-size: 12px;
    margin: 0 0 6px;
}
.login-card input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.5);
    background: rgba(86, 85, 85, 0.7);
    color: var(--input-text);
    font-family: var(--font-brand);
    font-size: 14px;
    outline: none;
}
.login-card input::placeholder { color: var(--input-text); opacity: .8; }
.login-card input:focus { border-color: #fff; }
.login-card button {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--dark-border);
    border-radius: 22px;
    background: var(--btn-light-bg);
    color: var(--btn-light-text);
    font-family: var(--font-brand);
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 14px;
    cursor: pointer;
}
.login-card button:hover { background: #e4e1e1; }
.error-msg { color: #e5a3a3; font-size: 12px; margin-top: 12px; min-height: 16px; font-family: var(--font-ui); }

/* ==================== APP SHELL ==================== */
.app { display: flex; flex-direction: column; height: 100vh; }

.topbar {
    height: 60px;
    background: var(--dark);
    border-bottom: 1px solid var(--dark-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
    gap: 16px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand .bc {
    font-family: var(--font-brand); font-weight: 700; color: #fff; font-size: 16px;
    border: 1.5px solid #fff; border-radius: 50%; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
}
.topbar .brand .name { font-family: var(--font-brand); color: #fff; font-size: 13px; letter-spacing: .3px; }
.topbar .brand .name small { display:block; color: var(--input-text); font-size: 9px; letter-spacing: 1.5px; }
.badge-online {
    display: flex; align-items: center; gap: 6px;
    background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
    letter-spacing: .5px; padding: 5px 12px; border-radius: 14px;
}
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 12px; font-family: var(--font-ui); }
.user-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #3ecf6e; flex-shrink: 0; }
.user-chip b { letter-spacing: 1px; }
.topbar-actions { display: flex; gap: 10px; }
.topbar-actions button {
    background: transparent; border: 1px solid var(--dark-border); color: #fff;
    padding: 7px 14px; border-radius: 14px; font-size: 11px; letter-spacing: .5px;
    cursor: pointer; font-family: var(--font-ui);
}
.topbar-actions button:hover { background: rgba(255,255,255,.08); }
.topbar-actions button.logout { border-color: var(--accent); color: #f3b9bc; }

.body-row { flex: 1; display: flex; min-height: 0; }

/* ---- Sidebar ---- */
.sidebar {
    width: 240px; background: var(--dark); flex-shrink: 0;
    display: flex; flex-direction: column; overflow-y: auto;
    padding: 14px 10px;
}
.side-section-title {
    font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: 1.5px;
    color: #fff; background: rgba(255,255,255,.06); border-radius: 8px;
    padding: 9px 12px; margin: 10px 0 6px; cursor: default;
}
.side-search {
    width: 100%; padding: 8px 10px; margin: 4px 0 10px; border-radius: 8px;
    border: 1px solid var(--dark-border); background: rgba(255,255,255,.05);
    color: #fff; font-size: 11px; font-family: var(--font-ui);
}
.side-search::placeholder { color: #8f8a8a; }
.side-filter-label { font-size: 10px; color: #8f8a8a; letter-spacing: .5px; margin: 2px 2px 4px; font-family: var(--font-ui); }
.side-select {
    width: 100%; padding: 7px 10px; margin-bottom: 10px; border-radius: 8px;
    border: 1px solid var(--dark-border); background: rgba(255,255,255,.05);
    color: #fff; font-size: 11px; font-family: var(--font-ui);
}
.side-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
    color: #d8d4d4; font-family: var(--font-ui); border-left: 3px solid transparent;
    margin-bottom: 2px;
}
.side-item:hover { background: rgba(255,255,255,.06); }
.side-item.active { background: rgba(122,31,36,.25); border-left-color: var(--accent); color: #fff; font-weight: 600; }
.side-item .count {
    background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
    padding: 1px 7px; border-radius: 10px; min-width: 18px; text-align: center;
}
.side-item.sub { padding-left: 20px; font-size: 11.5px; letter-spacing: .3px; }

/* ---- Main / list / chat ---- */
.main { flex: 1; display: flex; min-width: 0; background: var(--panel); }

.list-panel { width: 320px; border-right: 1px solid var(--line); display: flex; flex-direction: column; flex-shrink: 0; background: var(--panel); }
.list-header {
    padding: 14px 16px; border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center;
}
.list-header span { font-weight: 700; font-size: 13px; letter-spacing: .5px; text-transform: uppercase; color: var(--text); }
.btn-add {
    width: 26px; height: 26px; border-radius: 50%; border: none;
    background: var(--accent); color: #fff; font-size: 16px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.list-body { flex: 1; overflow-y: auto; }

.conv-item {
    padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
    border-left: 3px solid transparent; position: relative;
}
.conv-item:hover { background: var(--panel-alt); }
.conv-item.selected { background: var(--accent-soft); border-left-color: var(--accent); }
.conv-item.unread { background: #fbeff0; }
.conv-item.unread .conv-name { font-weight: 800; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; }
.conv-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.conv-time { font-size: 10.5px; color: var(--muted); flex-shrink: 0; margin-left: 6px; }
.conv-preview { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.tag { font-size: 9.5px; font-weight: 700; letter-spacing: .3px; padding: 2px 8px; border-radius: 8px; text-transform: uppercase; }
.tag-gestor { background: var(--dark); color: #fff; }
.tag-date { background: var(--warn-soft); color: var(--muted); font-weight: 600; }
.tag-localizado { background: var(--success-soft); color: var(--success); }
.tag-cancelado { background: #f1eded; color: #8a8585; }
.tag-no_localizado { background: #fdf1e0; color: #a06a1a; }
.tag-importante { background: #fff2cc; color: #8a6d00; }

.content-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.empty-state { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }

.chat-header {
    padding: 14px 20px; border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center; background: var(--panel);
}
.chat-header .who h3 { margin: 0; font-size: 15px; font-family: var(--font-brand); }
.chat-header .who .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 10px; align-items: center; }
.chat-header-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
    background: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px; color: var(--muted);
}
.icon-btn:hover { background: var(--panel-alt); }
.icon-btn.fav.active { color: #e0a500; border-color: #e0a500; }
.icon-btn.danger { background: var(--accent); color: #fff; border-color: var(--accent); }

.chat-body { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; background: var(--panel-alt); }
.msg { position: relative; max-width: 58%; padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.4; }
.msg-entrante { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-saliente-bot { align-self: flex-end; background: #ece3e3; border-bottom-right-radius: 4px; }
.msg-saliente-operador { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg-meta { font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right; }
.msg-saliente-operador .msg-meta { color: rgba(255,255,255,.75); }
.msg img { max-width: 220px; border-radius: 8px; display: block; margin-bottom: 4px; }

/* ---- Acciones por mensaje: citar / reaccionar ---- */
.msg-actions {
    position: absolute; top: -13px; display: flex; gap: 2px; opacity: 0;
    transition: opacity .15s; background: var(--panel); border: 1px solid var(--line);
    border-radius: 10px; padding: 1px; z-index: 2;
}
.msg-entrante .msg-actions { left: 4px; }
.msg-saliente-bot .msg-actions, .msg-saliente-operador .msg-actions { right: 4px; }
.msg:hover .msg-actions { opacity: 1; }
.msg-action-btn {
    border: none; background: transparent; cursor: pointer; font-size: 12px;
    padding: 3px 5px; border-radius: 8px; line-height: 1; color: var(--text);
}
.msg-action-btn:hover { background: var(--panel-alt); }

/* ---- Cita (responder como WhatsApp) ---- */
.msg-quote {
    border-left: 3px solid rgba(0,0,0,.2); background: rgba(0,0,0,.05);
    padding: 4px 8px; border-radius: 6px; font-size: 11px; margin-bottom: 6px; opacity: .85;
}
.msg-saliente-operador .msg-quote { border-left-color: rgba(255,255,255,.6); background: rgba(255,255,255,.15); }

/* ---- Reacciones ---- */
.msg-reactions {
    position: absolute; bottom: -10px; display: flex; gap: 2px; background: var(--panel);
    border: 1px solid var(--line); border-radius: 10px; padding: 1px 4px; font-size: 12px; z-index: 1;
}
.msg-entrante .msg-reactions { left: 8px; }
.msg-saliente-bot .msg-reactions, .msg-saliente-operador .msg-reactions { right: 8px; }

/* ---- Barra "citando a..." sobre el composer ---- */
.reply-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 16px; background: var(--panel-alt); border-top: 1px solid var(--line); font-size: 12px;
}
.reply-bar-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ---- Paleta de emojis (reacción y composer) ---- */
.emoji-palette {
    position: fixed; z-index: 999; background: var(--panel); border: 1px solid var(--line);
    border-radius: 10px; padding: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.18);
    display: flex; flex-wrap: wrap; gap: 2px; max-width: 220px;
}
.emoji-palette-grid { max-width: 260px; }
.emoji-palette button {
    border: none; background: transparent; cursor: pointer; font-size: 18px;
    padding: 4px; border-radius: 6px; line-height: 1;
}
.emoji-palette button:hover { background: var(--panel-alt); }
.emoji-palette button.quitar { font-size: 13px; color: var(--muted); }

.composer { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; background: var(--panel); align-items: center; }
.composer textarea {
    flex: 1; resize: none; border: 1px solid var(--line); border-radius: 20px; padding: 10px 16px;
    font-family: var(--font-ui); font-size: 13px; max-height: 100px;
}
.composer button {
    padding: 0 22px; height: 40px; border: none; border-radius: 20px;
    background: var(--accent); color: #fff; cursor: pointer; font-weight: 700;
    letter-spacing: .5px; font-size: 12px;
}
.composer button:hover { background: var(--accent-dark); }
.composer button:disabled { opacity: .5; cursor: default; }
.composer input[type=file] { display: none; }
.composer label.attach { display:flex; align-items:center; cursor:pointer; font-size:18px; padding: 0 4px; color: var(--muted); }
.composer button.attach {
    height: auto; padding: 0 4px; background: transparent; border: none; cursor: pointer;
    font-size: 18px; color: var(--muted); font-weight: normal;
}
.composer button.attach:hover { background: transparent; opacity: .7; }

/* ---- Aside: datos del cliente ---- */
.aside { width: 270px; border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; flex-shrink: 0; }
.aside-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.aside-header h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text); }
.aside-close { border: none; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.aside-body { padding: 16px 18px; }
.aside .field { margin-bottom: 14px; }
.aside label { display: block; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.aside .value { font-size: 13.5px; color: var(--text); font-weight: 600; }
.aside select, .aside input {
    width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
    font-family: var(--font-ui);
}
.toggle-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; }
.aside hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---- Vistas de sección (estadísticas / plantillas / tickets / citas / alertas / gestores) ---- */
.section-view { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.toolbar {
    padding: 16px 20px; display: flex; gap: 10px; align-items: center;
    border-bottom: 1px solid var(--line); background: var(--panel);
}
.toolbar strong { font-family: var(--font-brand); font-size: 15px; text-transform: uppercase; letter-spacing: .5px; }
.toolbar input, .toolbar select {
    padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: var(--font-ui);
}
.table-wrap { padding: 20px; overflow: auto; flex: 1; }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 8px; overflow: hidden; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; text-align: left; }
table.data th { background: var(--panel-alt); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 14px; border: none; cursor: pointer; background: var(--accent); color: #fff; font-weight: 600; }
.btn-sm.danger { background: #a33; }
.btn-sm.secondary { background: var(--panel-alt); color: var(--text); border: 1px solid var(--line); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; padding: 20px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stat-card .n { font-size: 28px; font-weight: 800; color: var(--dark); font-family: var(--font-brand); }
.stat-card .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.empty-note { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }

.toast-container { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 999; }
.toast { background: var(--dark); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.toast.error { background: #a33; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; padding: 22px; border-radius: 14px; width: 340px; }
.modal h3 { margin-top: 0; font-family: var(--font-brand); }
.modal label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.modal input, .modal select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--font-ui); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ==================== ENVÍOS MASIVOS ==================== */
.envios-tabs { display: flex; gap: 6px; margin-left: 20px; }
.envios-tab {
    padding: 6px 14px; border-radius: 14px; border: 1px solid var(--line);
    background: var(--panel); color: var(--muted); font-size: 11.5px; font-weight: 700;
    cursor: pointer; font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .4px;
}
.envios-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.envios-numeros { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px 0; }
.numero-card {
    display: flex; align-items: center; gap: 10px; background: var(--panel-alt);
    border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 230px;
}
.quality-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.q-verde   { background: var(--success); }
.q-amarillo{ background: #c9a227; }
.q-rojo    { background: #a33; }
.q-gris    { background: #b7b2b2; }
.numero-nombre { font-size: 13px; font-weight: 700; color: var(--text); }
.numero-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.envios-body { padding: 20px; overflow: auto; flex: 1; }
.envios-form { max-width: 580px; display: flex; flex-direction: column; }
.envios-form label { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 14px 0 5px; }
.envios-form label:first-child { margin-top: 0; }
.envios-form input, .envios-form select {
    width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
    font-family: var(--font-ui); font-size: 13px; background: var(--panel);
}
.plantilla-preview {
    background: var(--panel-alt); border: 1px solid var(--line); border-radius: 8px;
    padding: 10px 12px; margin-top: 8px; font-size: 13px; white-space: pre-wrap;
}
.var-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.var-tag { font-family: monospace; font-size: 12px; color: var(--accent); font-weight: 700; width: 36px; flex-shrink: 0; }
.var-row select, .var-row input { flex: 1; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }

.envios-filtros { display: flex; gap: 8px; align-items: center; }
.envios-filtros select, .envios-filtros input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.envios-filtros .btn-sm { flex: none; white-space: nowrap; }
.envios-preview { margin-top: 10px; font-size: 12px; color: var(--muted); }
.preview-total { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.preview-muestra { margin: 0; padding-left: 18px; }

.campanas-list { display: flex; flex-direction: column; gap: 10px; }
.campana-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer; }
.campana-card:hover { border-color: var(--accent); }
.campana-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.campana-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.progress-bar { height: 7px; background: var(--panel-alt); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }

.tandas-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.tanda-row { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tanda-head { display: flex; align-items: center; gap: 10px; }
.tanda-head strong { font-family: var(--font-brand); }
.tanda-head .btn-sm { margin-left: auto; }

/* ---- Vista previa del mensaje, estilo WhatsApp ---- */
.wa-preview-wrap {
    background: #e9dfd2; border-radius: 10px; padding: 18px 16px; margin: 10px 0 4px;
    display: flex; justify-content: flex-end;
}
.wa-preview-empty { color: var(--muted); font-size: 12px; text-align: center; width: 100%; padding: 10px 0; }
.wa-bubble { background: #fff; border-radius: 10px 2px 10px 10px; padding: 10px 12px 8px; max-width: 310px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-bubble-text { font-size: 13.5px; line-height: 1.4; color: #111; white-space: pre-wrap; }
.wa-bubble-text .var-placeholder { background: #fff2cc; color: #8a6d00; border-radius: 3px; padding: 0 3px; font-weight: 600; }
.wa-bubble-time { font-size: 10px; color: #8696a0; text-align: right; margin-top: 4px; }
.wa-bubble-buttons { margin-top: 2px; }
.wa-bubble-button {
    text-align: center; color: #00a5f4; font-size: 13px; font-weight: 600;
    padding: 9px 4px; border-top: 1px solid #ece9e4; margin-top: 2px;
}

/* ---- Origen de destinatarios: base del CRM vs. Excel ---- */
.origen-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.origen-tab {
    padding: 6px 14px; border-radius: 14px; border: 1px solid var(--line);
    background: var(--panel); color: var(--muted); font-size: 11.5px; font-weight: 700;
    cursor: pointer; font-family: var(--font-ui);
}
.origen-tab.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.excel-upload-box { display: flex; flex-direction: column; gap: 8px; }
.excel-hint { font-size: 11px; color: var(--muted); }
.excel-preview { font-size: 12px; color: var(--muted); }

.campos-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .campos-dos { grid-template-columns: 1fr; } }
