/* ==========================================================================
   Producto · Confirmaciones por email y WhatsApp
   Usa solo los tokens de estilos.css (claro y oscuro).
   ========================================================================== */

/* Avisos de la portada */
.alist { display: grid; gap: 8px; margin: 0 0 24px; }
.alist .notice { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.alist .notice:hover { text-decoration: underline; }

/* Filas con botón (próximos envíos, actividad) */
.rowbtn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rowbtn:hover { background: var(--hover); }
.rowbtn .cell2 { min-width: 0; }

/* Canal y estado de entrega */
.chn { display: inline-flex; align-items: center; height: 24px; padding-inline: 8px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 13px; line-height: 18px; color: var(--text-2); background: var(--bg); white-space: nowrap; }
.chn-whatsapp { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.mst { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 18px; color: var(--text-2); white-space: nowrap; }
.mst.leido { color: var(--link); font-weight: 500; }
.mst.fail { color: var(--danger); font-weight: 500; }
.reply { display: inline-flex; padding: 2px 8px; border-radius: 999px; background: var(--subtle); border: 1px solid var(--line); font-size: 13px; line-height: 18px; color: var(--text); }

/* Vista previa: teléfono y email */
.phone { max-width: 340px; border: 1px solid var(--line-strong); border-radius: 18px; overflow: hidden; background: var(--subtle); box-shadow: var(--shadow-sm); }
.phone-top { display: flex; flex-direction: column; padding: 10px 14px; background: var(--accent); color: var(--on-accent); font-weight: 500; font-size: 14px; }
.phone-top small { font-weight: 400; font-size: 13px; opacity: 0.9; }
.phone-chat { display: flex; flex-direction: column; gap: 6px; padding: 14px; min-height: 120px; }
.bubble { align-self: flex-start; max-width: 88%; padding: 8px 10px 6px; border-radius: 10px 10px 10px 2px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 14px; line-height: 20px; white-space: normal; overflow-wrap: anywhere; }
.phone .bubble, .conv .bubble.out { align-self: flex-end; border-radius: 10px 10px 2px 10px; background: var(--accent-soft); border-color: var(--accent-line); }
.bubble.sms { background: var(--bg); border-color: var(--line-strong); }
.bubble.in { align-self: flex-start; border-radius: 10px 10px 10px 2px; background: var(--bg); }
.bmeta { display: block; margin-top: 4px; text-align: right; font-size: 13px; line-height: 16px; color: var(--text-2); white-space: nowrap; }
.bmeta .rd { color: var(--link); font-weight: 600; }
.qr { display: grid; gap: 4px; align-self: flex-end; width: 88%; }
.qr span { display: block; padding: 6px 8px; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--bg); color: var(--link); text-align: center; font-size: 14px; font-weight: 500; }
.mail { border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--bg); max-width: 560px; }
.mail-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--thead); }
.mail-body { padding: 14px; font-size: 14px; line-height: 21px; color: var(--text); overflow-wrap: anywhere; }

/* Conversación en la ficha del mensaje */
.conv { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--subtle); }
.conv .qr { width: 70%; }
.sysmsg { align-self: center; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; line-height: 18px; color: var(--text-2); }

/* Chips de variables del editor de plantillas */
.chips.vars { margin-top: 6px; }
.chips.vars .chip { height: 30px; padding-inline: 8px; font-family: var(--mono); font-size: 13px; cursor: pointer; }
.chips.vars .chip:hover { border-color: var(--accent-line); color: var(--text); }

/* Reglas: línea de tiempo por evento */
.rtimeline { list-style: none; margin: 0 0 28px; padding: 0 0 0 22px; position: relative; display: grid; gap: 12px; }
.rtimeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.rtimeline li { position: relative; }
.rdot { position: absolute; left: -22px; top: 18px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--bg); }
.rtimeline li.on .rdot { border-color: var(--accent); background: var(--accent); }
.rcard { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); box-shadow: var(--shadow-sm); }
.rtimeline li:not(.on) .rcard { background: var(--thead); }
.rhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.rhead .small { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.rfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Interruptor accesible */
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span[aria-hidden] { width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 0.15s var(--ease); }
.switch span[aria-hidden]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.15s var(--ease); }
.switch input:checked + span[aria-hidden] { background: var(--accent); }
.switch input:checked + span[aria-hidden]::after { transform: translateX(16px); }
.switch input:focus-visible + span[aria-hidden] { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + span[aria-hidden] { opacity: 0.5; }

/* Canales */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ccard { display: flex; flex-direction: column; gap: 14px; }
.ccard header { display: flex; align-items: center; gap: 10px; }
.ccard h2 { margin: 0; flex: 1; font-size: 16px; font-weight: 600; }
.ccard p { margin: 0; }
.ccard .actions { margin-top: auto; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks li { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.checks li.ko { color: var(--danger); }

@media (max-width: 700px) {
  .phone, .qr { max-width: 100%; }
  .conv .qr { width: 100%; }
  .rfoot { flex-direction: column; align-items: flex-start; }
}
