/* ============================================================
   Central WhatsApp — Design System (dark premium)
   Acetns: verde WhatsApp #25d366 · azul #0088ff
   ============================================================ */

:root {
  --bg-app: #0b141a;
  --bg-sidebar: #111b21;
  --bg-header: #202c33;
  --bg-hover: #2a3942;
  --bg-input: #2a3942;
  --bg-modal: #111b21;
  --bg-toast: #233138;
  --bubble-in: #202c33;
  --bubble-out: #005c4b;
  --bubble-out-hover: #046a56;
  --accent: #25d366;
  --accent-strong: #00a884;
  --accent-soft: rgba(37, 211, 102, .14);
  --blue: #0088ff;
  --blue-bright: #53bdeb;
  --danger: #f15c6d;
  --danger-soft: rgba(241, 92, 109, .14);
  --amber: #ffd279;
  --text: #e9edef;
  --text-dim: #8696a0;
  --text-faint: #667781;
  --border: rgba(134, 150, 160, .16);
  --border-strong: rgba(134, 150, 160, .3);
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, .3);
  --radius: 12px;
  --radius-bubble: 10px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Outfit", "Inter", system-ui, sans-serif;
  --ease-spring: cubic-bezier(.2, .9, .25, 1.2);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-app);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
}

[hidden] { display: none !important; }

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

::placeholder { color: var(--text-faint); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #374045; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #46545b; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ Botões ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s ease, transform .1s ease, border-color .15s ease;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-accent:hover { background: rgba(37, 211, 102, .22); }
.btn-block { width: 100%; }
.btn-small { padding: 6px 12px; font-size: 13px; border-radius: 7px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn-danger:hover { color: var(--danger); }
.icon-btn-send { color: var(--accent); }
.icon-btn-send:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn-send:disabled { color: var(--text-faint); background: transparent; cursor: not-allowed; }

/* ============ Campos ============ */
.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: .02em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.field-input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14.5px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, .15);
}
.field-error, .login-error {
  margin: 2px 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
}

/* ============ Login ============ */
.login-view {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(0, 168, 132, .22), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(0, 136, 255, .12), transparent 55%),
    var(--bg-app);
  overflow: hidden;
  z-index: 50;
}
.login-bubbles::before, .login-bubbles::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .5;
}
.login-bubbles::before {
  width: 320px; height: 320px;
  left: -90px; top: -60px;
  background: radial-gradient(circle at 35% 35%, rgba(37, 211, 102, .25), transparent 65%);
}
.login-bubbles::after {
  width: 420px; height: 420px;
  right: -140px; bottom: -160px;
  background: radial-gradient(circle at 60% 60%, rgba(0, 136, 255, .18), transparent 65%);
}
.login-card {
  position: relative;
  width: min(400px, calc(100vw - 40px));
  padding: 38px 34px 30px;
  background: rgba(17, 27, 33, .88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: card-in .5s var(--ease-out);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.login-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.login-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .01em;
}
.login-sub {
  margin: 0 0 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}
.login-hint {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
}
.login-hint code {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11.5px;
}

/* ============ Shell do app ============ */
.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ============ Sidebar ============ */
.sidebar {
  width: 360px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-header);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .02em;
}
.sidebar-actions { display: flex; gap: 2px; }
.sidebar-actions .icon-btn { width: 36px; height: 36px; }
.sidebar-actions .icon-btn svg { width: 19px; height: 19px; }

.sidebar-search {
  position: relative;
  padding: 8px 12px;
  background: var(--bg-header);
}
.sidebar-search .search-ico {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}
.sidebar-search input {
  width: 100%;
  padding: 8px 12px 8px 42px;
  border: none;
  border-radius: 9px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.sidebar-search input:focus { box-shadow: 0 0 0 2px rgba(37, 211, 102, .25); }

.contact-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  flex: 1;
}
.contact-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .13s ease;
  animation: item-in .25s var(--ease-out) backwards;
}
@keyframes item-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}
.contact-item:hover { background: var(--bg-hover); }
.contact-item.active { background: var(--bg-hover); }
.contact-item.active .contact-name { color: var(--accent); }

.avatar {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  background: var(--accent-strong);
  user-select: none;
}
.contact-main { flex: 1; min-width: 0; }
.contact-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.contact-name {
  font-weight: 600;
  font-size: 15.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-time { font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }
.contact-time.unread { color: var(--accent); font-weight: 600; }
.contact-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.contact-preview {
  font-size: 13.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unread-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #06251a;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.window-pill-mini {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: .02em;
}
.window-pill-mini.open { background: var(--accent-soft); color: var(--accent); }
.window-pill-mini.closed { background: var(--danger-soft); color: var(--danger); }
.window-pill-mini svg { width: 10px; height: 10px; }

.sidebar-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* ============ Chat ============ */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(0, 168, 132, .05), transparent 60%),
    var(--bg-app);
}
.chat-placeholder {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-dim);
}
.chat-placeholder-inner h2 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.chat-placeholder-note { font-size: 13px; color: var(--text-faint); }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}
.chat-header-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-name { font-weight: 600; font-size: 16px; }
.chat-sub { font-size: 12.5px; color: var(--text-dim); }

.window-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background .3s ease, color .3s ease;
}
.window-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.window-pill.open { background: var(--accent-soft); color: var(--accent); }
.window-pill.open .dot { animation: pulse 2s infinite; }
.window-pill.warn { background: rgba(255, 210, 121, .14); color: var(--amber); }
.window-pill.closed { background: var(--danger-soft); color: var(--danger); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.8); }
}

/* Mensagens */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 8% 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.msg {
  max-width: min(65%, 520px);
  padding: 7px 10px 6px;
  border-radius: var(--radius-bubble);
  position: relative;
  font-size: 14.5px;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: msg-in .22s var(--ease-spring) backwards;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.msg.in { align-self: flex-start; background: var(--bubble-in); }
.msg.out { align-self: flex-end; background: var(--bubble-out); }
.msg.out:hover { background: var(--bubble-out-hover); }
.msg.in { border-top-left-radius: 3px; }
.msg.out { border-top-right-radius: 3px; }
.msg-day {
  align-self: center;
  margin: 12px 0 6px;
  padding: 5px 14px;
  border-radius: 8px;
  background: var(--bg-header);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
}
.msg-meta {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 -3px 10px;
  font-size: 11px;
  color: rgba(233, 237, 239, .55);
  user-select: none;
}
.msg.in .msg-meta { color: var(--text-faint); }
.ticks { font-size: 12px; letter-spacing: -2.5px; margin-right: 2px; }
.ticks.sent, .ticks.delivered { color: rgba(233, 237, 239, .55); }
.ticks.read { color: var(--blue-bright); }
.msg-failed {
  color: var(--danger);
  font-size: 11.5px;
  display: block;
  margin-top: 3px;
}
.msg-type-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--blue-bright);
  background: rgba(0, 136, 255, .12);
  padding: 2px 7px;
  border-radius: 5px;
  margin-bottom: 5px;
}

/* Mídia inline */
.msg-media { display: block; }
.msg-media img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  display: block;
  cursor: zoom-in;
  transition: filter .15s ease;
}
.msg-media img:hover { filter: brightness(1.08); }
.msg-media video { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; }
.msg-media audio { width: 260px; max-width: 100%; height: 40px; display: block; margin: 2px 0; }
.doc-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 230px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .25);
  text-decoration: none;
  color: var(--text);
  transition: background .15s ease;
}
.doc-card:hover { background: rgba(0, 0, 0, .4); }
.doc-card svg { width: 30px; height: 30px; color: var(--danger); flex-shrink: 0; }
.doc-name {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.doc-hint { font-size: 11.5px; color: var(--text-dim); }
.media-broken {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .25);
  color: var(--text-dim);
  font-size: 13px;
}

.load-more {
  align-self: center;
  margin: 4px 0 10px;
  padding: 6px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--bg-header);
  color: var(--text-dim);
  font-size: 12.5px;
  transition: background .15s ease, color .15s ease;
}
.load-more:hover { background: var(--bg-hover); color: var(--text); }

/* Composer */
.composer {
  padding: 10px 18px 14px;
  background: var(--bg-header);
  border-top: 1px solid var(--border);
}
.composer-row { display: flex; align-items: flex-end; gap: 10px; }
.message-input {
  flex: 1;
  resize: none;
  max-height: 130px;
  padding: 12px 15px;
  border: none;
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  outline: none;
  transition: box-shadow .15s ease;
}
.message-input:focus { box-shadow: 0 0 0 2px rgba(37, 211, 102, .3); }
.message-input:disabled { opacity: .45; cursor: not-allowed; }

.composer-template-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
}
.composer-template-hint svg { flex-shrink: 0; }
.composer-template-hint span { flex: 1; }

/* ============ Modais ============ */
dialog.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: none;
  max-height: none;
}
dialog.modal::backdrop {
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(3px);
}
.modal-card {
  width: min(480px, calc(100vw - 32px));
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 24px 20px;
  border-radius: 16px;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
  animation: card-in .3s var(--ease-out);
}
.modal-card-wide { width: min(760px, calc(100vw - 32px)); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}
.modal-desc {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* Templates modal */
.template-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  min-height: 320px;
}
.template-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  overflow-y: auto;
  max-height: 46vh;
}
.template-item {
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .13s ease, border-color .13s ease;
}
.template-item:hover { background: var(--bg-hover); }
.template-item.active { background: var(--bg-hover); border-color: var(--border-strong); }
.template-item-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.template-item-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.template-empty { text-align: center; color: var(--text-dim); font-size: 13.5px; margin-top: 22px; }
.template-detail {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg-app);
  overflow-y: auto;
  max-height: 50vh;
}
.template-detail-empty { color: var(--text-faint); text-align: center; margin-top: 120px; }
.tpl-status {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: 5px;
}
.tpl-status.approved { background: var(--accent-soft); color: var(--accent); }
.tpl-status.pending { background: rgba(255, 210, 121, .14); color: var(--amber); }
.tpl-status.rejected { background: var(--danger-soft); color: var(--danger); }
.tpl-preview {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius-bubble);
  border-top-left-radius: 3px;
  background: var(--bubble-in);
  font-size: 14.5px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.tpl-lang { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.settings-grid .field { margin-bottom: 12px; }
.settings-test {
  margin: 4px 0 0;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 13.5px;
}
.settings-test.ok { background: var(--accent-soft); color: var(--accent); }
.settings-test.fail { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 560px) { .settings-grid { grid-template-columns: 1fr; } }

/* Toasts */
.toasts {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--bg-toast);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  animation: toast-in .25s var(--ease-spring);
}
.toast.error { border-color: rgba(241, 92, 109, .5); color: var(--danger); }
.toast.success { border-color: rgba(37, 211, 102, .5); color: var(--accent); }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: all .3s ease; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.95); }
  to { opacity: 1; transform: none; }
}

/* Responsivo */
@media (max-width: 860px) {
  .sidebar { width: 100%; min-width: 0; }
  .app.chat-open .sidebar { display: none; }
  .app:not(.chat-open) .chat { display: none; }
  .messages { padding: 16px 4% 10px; }
  .msg { max-width: 82%; }
  .template-body { grid-template-columns: 1fr; }
  .template-detail { max-height: 34vh; }
}

/* Acessibilidade: movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============ Disparos em massa (broadcast) ============ */
.broadcast-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.broadcast-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 10px;
}
.broadcast-tab {
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.broadcast-tab:hover { color: var(--text); }
.broadcast-tab.active { background: var(--bg-hover); color: var(--text); }

.broadcast-body {
  flex: 1;
  overflow-y: auto;
  padding: 26px 8% 40px;
}
.broadcast-form {
  max-width: 560px;
  margin: 0 auto;
}
select.field-input {
  appearance: none;
  cursor: pointer;
}
select.field-input:disabled { opacity: .5; cursor: not-allowed; }

.bcast-source {
  display: flex;
  gap: 10px;
  margin: 4px 0 14px;
}
.bcast-radio {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color .15s ease, background .15s ease;
}
.bcast-radio:hover { background: var(--bg-hover); }
.bcast-radio input { accent-color: var(--accent); }
.bcast-radio:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.bcast-radio em { font-style: normal; color: var(--text-dim); font-size: 12.5px; }

.bcast-numbers {
  resize: vertical;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
}
.bcast-count {
  margin: 6px 2px 0;
  font-size: 12.5px;
  color: var(--text-dim);
}
.bcast-count strong { color: var(--accent); }

/* cards do histórico */
.broadcast-card {
  max-width: 720px;
  margin: 0 auto 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-sidebar);
  animation: item-in .25s var(--ease-out) backwards;
}
.bcast-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.bcast-card-title {
  font-weight: 600;
  font-size: 15.5px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.bcast-card-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcast-status {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 6px;
  flex-shrink: 0;
}
.bcast-status.running { background: rgba(0, 136, 255, .14); color: var(--blue); }
.bcast-status.paused  { background: rgba(255, 210, 121, .14); color: var(--amber); }
.bcast-status.done    { background: var(--accent-soft); color: var(--accent); }
.bcast-status.canceled { background: var(--danger-soft); color: var(--danger); }

.bcast-progress {
  display: flex;
  height: 8px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-input);
  margin-bottom: 8px;
}
.bcast-progress i { display: block; height: 100%; transition: width .4s ease; }
.bcast-progress .p-pending    { background: #374045; }
.bcast-progress .p-sent       { background: var(--blue); }
.bcast-progress .p-delivered  { background: var(--accent-strong); }
.bcast-progress .p-read       { background: var(--accent); }
.bcast-progress .p-failed     { background: var(--danger); }

.bcast-stats {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.bcast-stats b { color: var(--text); font-weight: 600; }

.bcast-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bcast-card-actions .btn { padding: 6px 14px; font-size: 13px; }
.bcast-failed-toggle {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 12.5px;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bcast-failed-list {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  font-size: 12.5px;
  max-height: 180px;
  overflow-y: auto;
}
.bcast-failed-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  color: var(--text);
}
.bcast-failed-list .err { color: var(--danger); text-align: right; }

#broadcast-empty { max-width: 720px; margin: 40px auto 0; }

@media (max-width: 860px) {
  .broadcast-body { padding: 18px 4% 30px; }
  .broadcast-card { padding: 13px 14px; }
}
