:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07130f;
  --bg-2: #0d1f18;
  --card: rgba(255, 255, 255, .075);
  --card-strong: rgba(255, 255, 255, .115);
  --card-solid: rgba(8, 22, 16, .76);
  --card-grad-a: rgba(255,255,255,.11);
  --card-grad-b: rgba(255,255,255,.045);
  --text: #f4fbf7;
  --muted: #9bb9ac;
  --soft: #d9fbe9;
  --line: rgba(255, 255, 255, .13);
  --line-strong: rgba(255, 255, 255, .22);
  --accent: #25d366;
  --accent-2: #10b981;
  --accent-3: #38bdf8;
  --danger: #fb7185;
  --warn: #f59e0b;
  --shadow: 0 28px 90px rgba(0, 0, 0, .38);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --tap: 46px;
  --label: #c8f5dc;
  --input-bg: rgba(0, 0, 0, .22);
  --input-bg-focus: rgba(0, 0, 0, .30);
  --placeholder: rgba(217, 251, 233, .42);
  --btn-ghost-bg: rgba(255,255,255,.075);
  --btn-ghost-color: #e8fff2;
  --sidebar-bg: rgba(4, 12, 9, .88);
  --side-link: #cfe8db;
  --side-hover: rgba(255,255,255,.05);
  --top-bg: rgba(6, 16, 12, .72);
  --grid-a: rgba(255,255,255,.035);
  --grid-b: rgba(255,255,255,.026);
  --body-a: rgba(37, 211, 102, .34);
  --body-b: rgba(56, 189, 248, .20);
  --body-c: rgba(16, 185, 129, .14);
  --body-grad: linear-gradient(135deg, #06100c 0%, #091912 48%, #07130f 100%);
  --shine: rgba(255,255,255,.55);
  --table-hover: rgba(255,255,255,.03);
  --wa-chrome: #1f2c34;
  --spin-legend-bg: rgba(0,0,0,.18);
  --spin-legend-border: rgba(37,211,102,.22);
  --spin-code-bg: rgba(37,211,102,.1);
  --spin-code: #b7ffd4;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3faf6;
  --bg-2: #e8f5ee;
  --card: rgba(255, 255, 255, .82);
  --card-strong: rgba(255, 255, 255, .95);
  --card-solid: rgba(255, 255, 255, .88);
  --card-grad-a: rgba(255,255,255,.95);
  --card-grad-b: rgba(232, 245, 238, .65);
  --text: #0f1f18;
  --muted: #5a7366;
  --soft: #163528;
  --line: rgba(15, 40, 28, .12);
  --line-strong: rgba(15, 40, 28, .22);
  --accent: #16a34a;
  --accent-2: #059669;
  --accent-3: #0284c7;
  --danger: #e11d48;
  --warn: #d97706;
  --shadow: 0 22px 60px rgba(15, 40, 28, .12);
  --label: #1a5c3a;
  --input-bg: rgba(255, 255, 255, .92);
  --input-bg-focus: #ffffff;
  --placeholder: rgba(26, 60, 44, .42);
  --btn-ghost-bg: rgba(15, 40, 28, .05);
  --btn-ghost-color: #163528;
  --sidebar-bg: rgba(255, 255, 255, .92);
  --side-link: #244336;
  --side-hover: rgba(22, 163, 74, .08);
  --top-bg: rgba(255, 255, 255, .86);
  --grid-a: rgba(15, 40, 28, .045);
  --grid-b: rgba(15, 40, 28, .03);
  --body-a: rgba(37, 211, 102, .18);
  --body-b: rgba(56, 189, 248, .12);
  --body-c: rgba(16, 185, 129, .10);
  --body-grad: linear-gradient(135deg, #f7fcf9 0%, #eef8f2 48%, #f3faf6 100%);
  --shine: rgba(255,255,255,.9);
  --table-hover: rgba(22, 163, 74, .05);
  --wa-chrome: #e9edef;
  --spin-legend-bg: rgba(255,255,255,.72);
  --spin-legend-border: rgba(22,163,74,.28);
  --spin-code-bg: rgba(22,163,74,.1);
  --spin-code: #166534;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% -8%, var(--body-a), transparent 32rem),
    radial-gradient(circle at 92% 4%, var(--body-b), transparent 28rem),
    radial-gradient(circle at 50% 115%, var(--body-c), transparent 34rem),
    var(--body-grad);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .2s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-a) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-b) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 78%);
}

a { color: inherit; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box, .card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, var(--card-grad-a), var(--card-grad-b)),
    var(--card-solid);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(138%);
}

.login-box::before, .card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--shine), transparent);
}

.login-box {
  width: min(430px, 94vw);
  padding: 30px;
}

.card {
  padding: clamp(18px, 2.6vw, 30px);
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: #052e1a;
  font-weight: 950;
  letter-spacing: -.08em;
  background: linear-gradient(135deg, #8fffc4, var(--accent) 48%, var(--accent-3));
  box-shadow: 0 18px 42px rgba(37, 211, 102, .25);
}

h1, h2 {
  margin: 0;
  line-height: .98;
  letter-spacing: -.045em;
  color: var(--text);
}

h1 { font-size: clamp(1.9rem, 7vw, 2.55rem); }
h2 { font-size: clamp(1.35rem, 4.5vw, 2rem); }

.login-box p, .hint, .muted {
  color: var(--muted);
  line-height: 1.5;
}

.muted, .hint { font-size: .9rem; }
.hint { margin: 8px 0 0; }

label {
  display: block;
  margin: 14px 0 7px;
  color: var(--label);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

input, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  outline: 0;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input::placeholder, textarea::placeholder { color: var(--placeholder); }

input:focus, textarea:focus {
  border-color: rgba(37, 211, 102, .74);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 4px rgba(37, 211, 102, .13), 0 16px 34px rgba(0,0,0,.12);
}

.btn, button[type="submit"] {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 17px;
  font: inherit;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}

button[type="submit"], .btn.primary {
  color: #052e1a;
  background: linear-gradient(135deg, #b7ffd4, var(--accent) 42%, #10b981);
  box-shadow: 0 16px 36px rgba(37, 211, 102, .28);
}

.btn.ghost {
  background: var(--btn-ghost-bg);
  border: 1px solid var(--line);
  color: var(--btn-ghost-color);
}

.btn.danger {
  color: #fff1f2;
  background: linear-gradient(135deg, rgba(244,63,94,.38), rgba(190,18,60,.28));
  border: 1px solid rgba(251,113,133,.44);
}

.btn:hover, button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .26);
}

.btn:active, button[type="submit"]:active { transform: translateY(0) scale(.99); }
.btn:disabled, button:disabled { opacity: .55; cursor: wait; transform: none; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--top-bg);
  backdrop-filter: blur(22px) saturate(140%);
}

.top strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.top .muted { display: block; margin-top: 2px; font-size: .78rem; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.wrap {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 46px;
  display: grid;
  gap: 18px;
}

.wrap.narrow { width: min(700px, calc(100% - 28px)); }

.wrap::before {
  content: "Envio inteligente via WhatsApp";
  display: block;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(37, 211, 102, .26);
  border-radius: 999px;
  background: rgba(37, 211, 102, .10);
  color: #bbf7d0;
  font-size: .73rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.075);
  color: #d9fbe9;
  font-size: .76rem;
  font-weight: 950;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148,163,184,.12);
}

.badge.ok { color: #bbf7d0; border-color: rgba(34,197,94,.32); background: rgba(34,197,94,.12); }
.badge.ok::before {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.22), 0 0 10px rgba(34,197,94,.85);
  animation: badge-glow-green 1.6s ease-in-out infinite;
}
.badge.warn { color: #fde68a; border-color: rgba(245,158,11,.32); background: rgba(245,158,11,.12); }
.badge.warn::before { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.16); }
.badge.off { color: #fecaca; border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.12); }
.badge.off::before {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.2), 0 0 8px rgba(239,68,68,.7);
  animation: badge-blink-red .85s ease-in-out infinite;
}

@keyframes badge-glow-green {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 3px rgba(34,197,94,.18), 0 0 6px rgba(34,197,94,.55);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(34,197,94,.28), 0 0 14px rgba(34,197,94,.95);
  }
}

@keyframes badge-blink-red {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 3px rgba(239,68,68,.2), 0 0 6px rgba(239,68,68,.55);
  }
  50% {
    opacity: .35;
    transform: scale(.92);
    box-shadow: 0 0 0 5px rgba(239,68,68,.12), 0 0 2px rgba(239,68,68,.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge.ok::before,
  .badge.off::before { animation: none; }
}

.lista { display: grid; gap: 10px; }

.camp {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.18);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.camp:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 211, 102, .30);
  background: rgba(37, 211, 102, .065);
}

.camp strong { display: block; margin-bottom: 4px; font-size: 1rem; }

.alert, .erro {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  border: 1px solid transparent;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.4;
}

.alert.ok { background: rgba(34,197,94,.13); border-color: rgba(34,197,94,.28); color: #bbf7d0; }
.alert.erro, .erro { background: rgba(244,63,94,.13); border-color: rgba(251,113,133,.28); color: #fecdd3; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  color: #cdeedf;
  font-size: .9rem;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 650;
}

.check input {
  width: 19px;
  height: 19px;
  min-height: 19px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.qr { margin-top: 18px; text-align: center; }
.qr img { max-width: 300px; width: 100%; border-radius: 22px; background: #fff; padding: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.28); }

code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid rgba(34,197,94,.20);
  border-radius: 8px;
  background: rgba(34,197,94,.08);
  color: #bbf7d0;
  word-break: break-all;
}

.dropzone {
  position: relative;
  min-height: 156px;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  border: 1.5px dashed rgba(187, 247, 208, .38);
  border-radius: 22px;
  background:
    radial-gradient(circle at center, rgba(37,211,102,.16), transparent 70%),
    rgba(0,0,0,.20);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.dropzone::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 16px;
  background: rgba(37,211,102,.15);
  color: #bbf7d0;
  font-size: 1.8rem;
  font-weight: 300;
}

.dropzone:hover, .dropzone.dragover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(37,211,102,.12);
}

.dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  font-size: 0;
}

.dropzone-copy {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .9rem;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.dropzone-copy strong { color: var(--text); font-size: 1.02rem; }

.img-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.thumb-n {
  position: absolute;
  left: 7px;
  bottom: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.68);
  color: #fff;
  font-size: .72rem;
  font-weight: 950;
}

.send-bar {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(37,211,102,.17);
  border-radius: 22px;
  background: rgba(37,211,102,.06);
}

.btn-send {
  min-width: 220px;
  padding: 15px 24px;
  font-size: 1.02rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #fff;
  border-radius: 14px;
  padding: 4px;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
.login-logo {
  display: block;
  width: min(220px, 70%);
  height: auto;
  margin: 0 auto 14px;
  background: #fff;
  border-radius: 18px;
  padding: 12px 16px;
}
.login-box h1 { text-align: center; }
.login-box > p { text-align: center; margin-top: 6px; }

.hero-campanha {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  min-height: clamp(180px, 28vw, 280px);
  box-shadow: var(--shadow);
  background: #0a1624;
}
.hero-campanha > img {
  display: block;
  width: 100%;
  height: clamp(180px, 28vw, 280px);
  object-fit: cover;
  object-position: center;
}
.hero-campanha-copy {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(16px, 3vw, 28px);
  background: linear-gradient(180deg, transparent, rgba(4, 12, 24, .88) 42%, rgba(4, 12, 24, .96));
}
.hero-campanha-copy .eyebrow {
  margin: 0 0 6px;
  color: #f5a623;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-campanha-copy h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  color: #fff;
}
.hero-campanha-copy p {
  margin: 0;
  max-width: 40rem;
  color: rgba(255,255,255,.82);
  font-size: .95rem;
  line-height: 1.45;
}

.grupo-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.16);
}
.grupo-box select {
  margin-top: 10px;
}
select {
  width: 100%;
  min-height: var(--tap);
  padding: 13px 44px 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background-color: var(--input-bg);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--text);
  font: inherit;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
select:hover:not(:disabled) {
  border-color: var(--line-strong);
  background-color: var(--input-bg-focus);
}
select:focus {
  border-color: rgba(37, 211, 102, .74);
  background-color: var(--input-bg-focus);
  box-shadow: 0 0 0 4px rgba(37, 211, 102, .13), 0 16px 34px rgba(0,0,0,.12);
}
select:disabled {
  opacity: .55;
  cursor: not-allowed;
}
select option {
  background: var(--bg-2);
  color: var(--text);
}

.contatos-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.contato-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.18);
}
.contato-item strong {
  display: block;
  margin-bottom: 2px;
}
.contato-item .btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
}

/* ??? Layout tipo app (inspirado em pain?is de disparo) ??? */
.app-body { min-height: 100vh; }
.app-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 10px;
}
.sidebar-brand img {
  width: 148px;
  height: 44px;
  object-fit: contain;
  object-position: left center;
  background: #fff;
  border-radius: 10px;
  padding: 2px 4px;
  flex-shrink: 0;
}
.sidebar-brand strong { display: block; font-size: .95rem; }
.sidebar-brand span { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }
/* Logo já traz o nome — evita texto duplicado ao lado */
.sidebar-brand > div { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--side-link);
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: .92rem;
}
.side-link:hover { background: var(--side-hover); }
.side-link.active {
  color: #052e1a;
  background: linear-gradient(135deg, #b7ffd4, var(--accent));
  box-shadow: 0 10px 28px rgba(37,211,102,.22);
}
.side-ico {
  width: 22px;
  text-align: center;
  opacity: .9;
  font-size: .95rem;
}
.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.side-user {
  padding: 4px 12px;
  color: var(--muted);
  font-size: .78rem;
}
.app-main {
  min-width: 0;
  padding: 22px clamp(16px, 2.5vw, 28px) 40px;
}
.app-body .wrap {
  width: min(1120px, 100%);
  margin: 0;
}
.app-body .wrap::before { display: none; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.page-head h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3.2vw, 2.05rem);
}
.page-head .sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .95rem;
}
.page-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 6px;
}
.section-title h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -.03em;
}
.disparo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.wa-preview {
  position: sticky;
  top: 18px;
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  background: #111b21;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.wa-preview-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  background: #1f2c34;
}
.wa-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #25d366;
  color: #052e1a;
  font-weight: 900;
}
.wa-preview-top strong { display: block; font-size: .9rem; color: #e9edef; }
.wa-preview-top span { display: block; font-size: .72rem; color: #8696a0; }
.wa-preview-body {
  min-height: 360px;
  padding: 14px;
  background:
    radial-gradient(circle at 20% 10%, rgba(37,211,102,.08), transparent 40%),
    #0b141a;
}
.wa-bubble {
  max-width: 92%;
  margin-left: auto;
  padding: 8px 10px 6px;
  border-radius: 10px 10px 4px 10px;
  background: #005c4b;
  color: #e9edef;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .86rem;
  line-height: 1.4;
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.wa-bubble strong { font-weight: 700; color: #fff; }
.wa-bubble em { font-style: italic; }
.wa-bubble s { text-decoration: line-through; opacity: .92; }
.wa-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82em;
  background: rgba(0,0,0,.22);
  padding: .05em .28em;
  border-radius: 4px;
}
.wa-bubble code.wa-pre {
  display: block;
  padding: .45em .55em;
  margin: .2em 0;
  white-space: pre-wrap;
}
.wa-bubble.empty {
  margin: 48px auto 0;
  background: transparent;
  color: #8696a0;
  text-align: center;
  box-shadow: none;
  max-width: 80%;
}
.wa-bubble img {
  display: block;
  width: 100%;
  border-radius: 8px;
  margin-bottom: 6px;
}
.wa-bubble video {
  display: block;
  width: 100%;
  max-height: 220px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: #000;
}
.wa-time {
  display: block;
  text-align: right;
  font-size: .65rem;
  color: rgba(233,237,239,.65);
  margin-top: 4px;
}
.dropzone-video {
  margin-top: 4px;
}
.video-preview {
  margin-top: 12px;
}
.video-thumb {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.22);
}
.video-thumb video {
  width: 100%;
  max-height: 240px;
  border-radius: 12px;
  background: #000;
}
.video-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.video-meta strong {
  font-size: .9rem;
  color: var(--text);
  word-break: break-all;
}
.video-meta span {
  font-size: .78rem;
  color: var(--muted);
}
.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.18);
}
.metric .lbl {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.metric .val {
  margin-top: 6px;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -.03em;
}
.mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 4px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.22);
}
.mode-tab {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.mode-tab.active {
  color: #052e1a;
  background: linear-gradient(135deg, #b7ffd4, var(--accent));
}
.grupos-check-list {
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px;
}
.grupo-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.16);
  cursor: pointer;
}
.grupo-check:hover { border-color: var(--line-strong); }
.grupo-check input { width: auto; min-height: 0; accent-color: var(--accent); }
.grupo-check span { flex: 1; font-size: .92rem; }
.grupo-check .muted { font-size: .78rem; }
.login-foot {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: .78rem;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(187,247,208,.22); border-radius: 999px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.12); }

@media (max-width: 1100px) {
  .disparo-grid { grid-template-columns: 1fr; }
  .wa-preview { position: static; max-width: 320px; margin: 0 auto; }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-brand { padding: 0; }
  .sidebar-brand span { display: none; }
  .sidebar-nav {
    flex: 1 1 100%;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
  }
  .side-link { white-space: nowrap; padding: 9px 12px; font-size: .84rem; }
  .sidebar-foot { flex-direction: row; align-items: center; border: 0; padding: 0; margin-left: auto; }
  .side-user { display: none; }
  .top { align-items: flex-start; flex-direction: column; padding: 14px; }
  .top-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .top-actions .badge { grid-column: 1 / -1; justify-content: center; }
  .grid-2, .grid-3, .metric-row { grid-template-columns: 1fr; }
  .camp { align-items: stretch; flex-direction: column; }
  .camp .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .camp .btn { width: 100%; }
  .img-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .btn-send { width: 100%; }
  .page-head { flex-direction: column; }
  .hero-campanha-copy h1 { font-size: 1.35rem; }
}

@media (max-width: 520px) {
  .login-box, .card { border-radius: 22px; padding: 18px; }
  .wrap { width: min(100% - 20px, 1180px); margin-top: 14px; }
  .app-body .wrap { width: 100%; }
  .top-actions { grid-template-columns: 1fr; }
  .camp .row { grid-template-columns: 1fr; }
  .img-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* UI/UX refresh - /envio */
body::after {
  content: "";
  position: fixed;
  inset: auto -18rem -22rem auto;
  width: 42rem;
  height: 42rem;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(37, 211, 102, .18), transparent 66%);
  filter: blur(2px);
  opacity: .85;
}

.login-box, .card, .page-head, .metric, .wa-preview, .contato-item, .grupo-box, .grupos-check-list {
  isolation: isolate;
}

.login-box {
  width: min(460px, 94vw);
  padding: clamp(24px, 4vw, 36px);
}

.login-box button[type="submit"] {
  width: 100%;
  margin-top: 8px;
}

.login-box::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 12%, rgba(37,211,102,.18), transparent 34%),
    radial-gradient(circle at 82% 4%, rgba(56,189,248,.14), transparent 28%);
}

.login-logo {
  box-shadow: 0 18px 42px rgba(0,0,0,.24), 0 0 0 1px rgba(255,255,255,.08);
}

.app-main {
  position: relative;
}

.page-head {
  position: relative;
  margin-bottom: 16px;
  padding: clamp(18px, 2.8vw, 26px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255,255,255,.105), rgba(255,255,255,.042)),
    radial-gradient(circle at 78% 18%, rgba(37,211,102,.18), transparent 28rem),
    rgba(7,19,15,.72);
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
  overflow: hidden;
}

.page-head::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(187,247,208,.62), transparent);
}

.page-head::after {
  display: none;
}

.page-head > * {
  position: relative;
  z-index: 1;
}

.page-head h1 {
  max-width: 14ch;
  font-size: clamp(1.9rem, 5vw, 3rem);
}

.page-head .sub {
  max-width: 48rem;
  color: #c7f4dc;
}

.card {
  box-shadow: 0 22px 70px rgba(0,0,0,.24);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.card:hover {
  border-color: rgba(187,247,208,.22);
  box-shadow: 0 28px 86px rgba(0,0,0,.30);
}

.section-title h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-title h2::before {
  content: "";
  width: 9px;
  height: 22px;
  border-radius: 99px;
  background: linear-gradient(180deg, #b7ffd4, var(--accent));
  box-shadow: 0 0 20px rgba(37,211,102,.34);
}

.metric {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035)),
    rgba(0,0,0,.16);
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto -30% -80% 35%;
  height: 120%;
  border-radius: 50%;
  background: rgba(37,211,102,.12);
}

input, textarea, select {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

#mensagem {
  min-height: 168px;
  border-radius: 28px 28px 8px 28px;
  border: 1px solid rgba(37,211,102,.48);
  background:
    linear-gradient(135deg, rgba(232,255,242,.98), rgba(207,250,224,.96)),
    #dcfce7;
  color: #052e1a;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.55;
  box-shadow: 0 18px 46px rgba(37,211,102,.16), inset 0 1px 0 rgba(255,255,255,.78);
}

#mensagem::placeholder {
  color: rgba(5,46,26,.52);
}

#mensagem:focus {
  border-color: #25d366;
  background: #ecfff4;
  box-shadow: 0 0 0 5px rgba(37,211,102,.18), 0 24px 60px rgba(37,211,102,.20);
}

#numeros, #tema, #resultado {
  border-radius: 20px;
}

.btn, button[type="submit"], .mode-tab, .side-link, .contato-item, .grupo-check {
  -webkit-tap-highlight-color: transparent;
}

.btn.primary, button[type="submit"] {
  color: #032516;
  background: linear-gradient(135deg, #d8ffe8 0%, #25d366 44%, #09a96e 100%);
}

.btn.ghost:hover {
  background: rgba(255,255,255,.11);
  border-color: rgba(187,247,208,.26);
}

.dropzone {
  min-height: 176px;
  border-width: 2px;
  background:
    radial-gradient(circle at 50% 34%, rgba(37,211,102,.20), transparent 62%),
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.03)),
    rgba(0,0,0,.18);
}

.dropzone-copy strong {
  font-size: 1.08rem;
}

.send-bar {
  position: static;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(37,211,102,.17);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(37,211,102,.16), rgba(56,189,248,.07)),
    rgba(6,16,12,.88);
  backdrop-filter: blur(18px) saturate(132%);
  box-shadow: 0 20px 58px rgba(0,0,0,.28);
}

.wa-preview {
  max-width: 340px;
  border-radius: 34px;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.04)),
    #07130f;
}

.wa-preview::before {
  content: "";
  display: block;
  width: 76px;
  height: 5px;
  margin: 4px auto 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.24);
}

.wa-preview-top, .wa-preview-body {
  overflow: hidden;
}

.wa-preview-top {
  border-radius: 24px 24px 0 0;
}

.wa-preview-body {
  border-radius: 0 0 24px 24px;
  min-height: 390px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.025) 25%, transparent 25%) 0 0/28px 28px,
    radial-gradient(circle at 20% 10%, rgba(37,211,102,.10), transparent 40%),
    #0b141a;
}

.wa-bubble {
  border-radius: 18px 18px 5px 18px;
  background: linear-gradient(135deg, #0b7a64, #005c4b);
}

.contato-item, .grupo-check, .camp {
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)), rgba(0,0,0,.16);
}

.contato-item:hover, .grupo-check:hover {
  transform: translateY(-1px);
  border-color: rgba(37,211,102,.30);
}

.qr img {
  border: 10px solid #fff;
  padding: 0;
  box-shadow: 0 26px 70px rgba(0,0,0,.34), 0 0 0 1px rgba(37,211,102,.24);
}

@media (max-width: 920px) {
  .page-head::after { display: none; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn, .page-head-actions .badge { flex: 1; }
  .send-bar { position: static; }
  .wa-preview { max-width: min(360px, 100%); }
}

@media (max-width: 520px) {
  .page-head { padding: 18px; border-radius: 24px; }
  .page-head h1 { font-size: 2rem; }
  #mensagem { min-height: 144px; border-radius: 24px 24px 7px 24px; }
  .btn, button[type="submit"] { width: 100%; }
  .row .btn { flex: 1 1 100%; }
}

/* ??? CRM Pipeline ??? */
.crm-wrap { width: min(100%, 1400px) !important; }
.crm-wrap .metric-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.crm-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(200px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}
.crm-col {
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 280px);
}
.crm-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  border-top: 3px solid var(--col, var(--accent));
}
.crm-col-head strong { font-size: .88rem; }
.crm-col-head span {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  font-size: .75rem;
  font-weight: 800;
}
.crm-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  min-height: 120px;
  flex: 1;
}
.crm-col-body.drag-over {
  outline: 2px dashed rgba(37,211,102,.55);
  outline-offset: -4px;
  background: rgba(37,211,102,.06);
}
.crm-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  cursor: grab;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.crm-card:hover {
  border-color: rgba(37,211,102,.35);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
.crm-card.dragging { opacity: .45; cursor: grabbing; }
.crm-card strong { display: block; margin-bottom: 4px; font-size: .92rem; }
.crm-camp {
  margin-top: 6px;
  font-size: .72rem;
  color: #9bb9ac;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.crm-wa {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(37,211,102,.14);
  color: #bbf7d0;
}
.crm-note-dot { color: var(--warn); font-size: .85rem; }
.crm-empty {
  margin: 18px 8px;
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
}
.crm-dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  background:
    linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.045)),
    rgba(8, 22, 16, .96);
  color: var(--text);
  width: min(420px, 94vw);
  box-shadow: var(--shadow);
}
.crm-dialog::backdrop { background: rgba(0,0,0,.55); }
.crm-dialog form { padding: 22px; }
.crm-dialog h3 { margin: 0 0 8px; }

@media (max-width: 1100px) {
  .crm-wrap .metric-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .crm-board { grid-template-columns: repeat(6, minmax(220px, 1fr)); }
  .crm-col { max-height: 420px; }
  .crm-wrap .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ??? Dashboard ??? */
.dash-wrap { width: min(1180px, 100%) !important; }
.dash-filters { padding: 16px 18px; }
.dash-filter-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
  align-items: end;
}
.lbl-soft {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.period-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.22);
}
.period-tab {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.period-tab.active {
  color: #052e1a;
  background: linear-gradient(135deg, #b7ffd4, var(--accent));
}
.dash-block { display: grid; gap: 12px; }
.dash-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
}
.dash-block-title h2 {
  margin: 0;
  font-size: 1.15rem;
}
.dash-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(37,211,102,.14);
  color: var(--accent);
  font-weight: 900;
}
.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.dash-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.03)), rgba(0,0,0,.18);
}
.dash-card-lbl {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.dash-card-val {
  margin-top: 8px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -.04em;
  line-height: 1;
}
.dash-card-val.warn { color: var(--danger); }
.dash-card-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: .82rem;
}
.dash-card-sub.up { color: #86efac; }
.dash-card-sub.down { color: #fda4af; }
.dash-progress {
  margin-top: 12px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.dash-progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #86efac, var(--accent));
}
.dash-status-bar {
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.16);
}
.dash-status-lbl {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.dash-status-items {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}
.dash-status-items span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d9fbe9;
  font-size: .92rem;
}
.dash-status-items strong { color: #fff; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.blue { background: #38bdf8; }
.dot.yellow { background: #fbbf24; }
.dot.green { background: var(--accent); }
.dash-chart-card { min-height: 280px; }
.dash-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(36px, 1fr);
  gap: 8px;
  align-items: end;
  height: 220px;
  padding: 8px 4px 0;
}
.dash-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}
.dash-bar {
  width: 70%;
  max-width: 28px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #86efac, var(--accent));
  box-shadow: 0 8px 20px rgba(37,211,102,.22);
}
.dash-bar-col span {
  font-size: .68rem;
  color: var(--muted);
}
.dash-bar-col em {
  font-style: normal;
  font-size: .72rem;
  font-weight: 800;
  color: #bbf7d0;
}
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.dash-crm-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.dash-quick {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.dash-quick div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.14);
}
.dash-quick span { color: var(--muted); font-size: .88rem; }
.dash-quick strong { color: var(--accent); }
.dash-camps { display: grid; gap: 8px; margin-top: 8px; }
.dash-camp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.14);
}

@media (max-width: 1100px) {
  .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-filter-row { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .dash-grid-2 { grid-template-columns: 1fr; }
  .dash-cards { grid-template-columns: 1fr; }
}



/* ??? Hist?rico de Disparos ??? */
.hist-wrap { width: min(1180px, 100%) !important; }
.hist-filters { padding: 16px 18px; }
.hist-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.hist-filter-actions { padding-bottom: 2px; }
.hist-table-card { padding: 0; overflow: hidden; }
.hist-table-scroll { overflow-x: auto; }
.hist-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.hist-table th,
.hist-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: .92rem;
}
.hist-table th {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(0,0,0,.22);
  white-space: nowrap;
}
.hist-table tbody tr:hover { background: rgba(255,255,255,.03); }
.hist-id { font-size: .72rem; margin-top: 2px; }
.hist-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  white-space: nowrap;
}
.hist-pill.tipo {
  color: #bbf7d0;
  background: rgba(37,211,102,.16);
  border: 1px solid rgba(37,211,102,.28);
}
.hist-pill.status.ok {
  color: #86efac;
  background: rgba(37,211,102,.14);
}
.hist-pill.status.run {
  color: #fcd34d;
  background: rgba(245,158,11,.16);
}
.hist-pill.status.pause {
  color: #fde68a;
  background: rgba(234,179,8,.14);
}
.hist-pill.status.bad {
  color: #fda4af;
  background: rgba(251,113,133,.14);
}
.hist-pill.status.draft {
  color: #cbd5e1;
  background: rgba(148,163,184,.14);
}
.hist-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}
.hist-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.hist-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #86efac, var(--accent));
}
.hist-progress span {
  font-size: .78rem;
  font-weight: 800;
  color: #bbf7d0;
  min-width: 36px;
}
.hist-more {
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}
.hist-acoes-form { padding: 22px; }
.hist-acoes-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.hist-acoes-btns .btn { width: 100%; }
.hist-table-card .hint { padding: 0 16px 14px; }

.listas-acoes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.listas-acoes .btn {
  min-height: 36px;
  min-width: 36px;
  padding: 0 10px;
}
.listas-filter-row {
  grid-template-columns: 1fr 1.4fr auto;
}
.listas-dialog {
  width: min(520px, 96vw);
}
@media (max-width: 920px) {
  .listas-filter-row { grid-template-columns: 1fr; }
}

/* ??? Pick cards (conex?o + listas) ??? */
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.pick-card {
  position: relative;
  text-align: left;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)), rgba(0,0,0,.18);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.pick-card strong { display: block; margin-bottom: 4px; font-size: .95rem; }
.pick-card .muted { font-size: .78rem; }
.pick-card:hover:not(:disabled) {
  border-color: rgba(37,211,102,.4);
  transform: translateY(-1px);
}
.pick-card.selected {
  border-color: rgba(37,211,102,.7);
  box-shadow: 0 0 0 3px rgba(37,211,102,.14), 0 12px 28px rgba(0,0,0,.2);
  background: linear-gradient(145deg, rgba(37,211,102,.16), rgba(255,255,255,.04));
}
.pick-card.disabled,
.pick-card:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.pick-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 900;
  color: #052e1a;
  background: rgba(255,255,255,.12);
}
.pick-card.selected .pick-check {
  background: linear-gradient(135deg, #b7ffd4, var(--accent));
}
.conn-list {
  display: grid;
  gap: 14px;
}
.conn-card .conn-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.conn-card .conn-nome {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.conn-actions {
  flex-wrap: wrap;
  gap: 8px;
}
.disparo-avancado summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.disparo-avancado summary::-webkit-details-marker { display: none; }
.disparo-avancado[open] summary { margin-bottom: 8px; }

.spin-legend {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--spin-legend-border);
  border-radius: 14px;
  background: var(--spin-legend-bg);
}
.spin-legend-title {
  display: block;
  margin-bottom: 10px;
  font-size: .92rem;
  color: var(--soft);
}
.spin-legend-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}
.spin-legend-list code,
.spin-legend-ex code {
  font-size: .8em;
  color: var(--spin-code);
  background: var(--spin-code-bg);
  padding: .08em .35em;
  border-radius: 5px;
}
.spin-legend-ex {
  margin: 12px 0 0;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Toggle tema claro / escuro */
.theme-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--btn-ghost-bg);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  font-size: .82rem;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--line-strong); }
.theme-toggle .theme-ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #b7ffd4, var(--accent));
  color: #052e1a;
  font-size: .95rem;
}
.theme-toggle-login {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  width: auto;
  min-width: 132px;
}

[data-theme="light"] select,
[data-theme="light"] .mode-tab,
[data-theme="light"] .pick-card,
[data-theme="light"] .camp,
[data-theme="light"] .contato-item,
[data-theme="light"] .grupo-check,
[data-theme="light"] .grupos-check-list,
[data-theme="light"] .grupo-box,
[data-theme="light"] .dropzone,
[data-theme="light"] .metric,
[data-theme="light"] .page-head,
[data-theme="light"] .hist-table,
[data-theme="light"] .crm-col,
[data-theme="light"] .crm-card {
  color: var(--text);
}
[data-theme="light"] .hist-table tbody tr:hover {
  background: var(--table-hover);
}
[data-theme="light"] .wa-preview {
  box-shadow: 0 18px 40px rgba(15, 40, 28, .14);
}
[data-theme="light"] .wa-preview-top {
  background: #fff;
  color: #111b21;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
[data-theme="light"] .wa-preview-body {
  background: #efeae2;
}
[data-theme="light"] .badge {
  color: var(--text);
}
[data-theme="light"] body::after {
  background: radial-gradient(circle, rgba(22, 163, 74, .12), transparent 66%);
  opacity: .7;
}

/* ===== Ao vivo ===== */
.live-wrap .live-dot {
  display: inline-block;
  width: .55em;
  height: .55em;
  margin-right: .35rem;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239,68,68,.55);
  animation: livePulse 1.4s ease-out infinite;
  vertical-align: .05em;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,.55); }
  70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.live-toggle { margin: 0; gap: 8px; align-items: center; }
.live-metrics { margin-bottom: 18px; }
.live-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
  align-items: start;
}
.live-now-list { display: grid; gap: 12px; }
.live-now-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(0,0,0,.14);
}
[data-theme="light"] .live-now-card { background: rgba(255,255,255,.72); }
.live-now-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.live-passo {
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}
.live-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  margin: 10px 0 8px;
}
[data-theme="light"] .live-progress { background: rgba(15,40,28,.08); }
.live-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width .35s ease;
}
.live-log-card { min-height: 420px; }
.live-log {
  max-height: 560px;
  overflow: auto;
  display: grid;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
}
.live-log-line {
  display: grid;
  grid-template-columns: 74px 110px 1fr;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255,255,255,.03);
}
[data-theme="light"] .live-log-line { background: rgba(15,40,28,.03); }
.live-log-line .t { color: var(--muted); }
.live-log-line .tag { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.live-log-line.ok .tag { color: var(--accent-2); }
.live-log-line.warn .tag { color: var(--warn); }
.live-log-line.err .tag { color: var(--danger); }
.live-log-line.flash { animation: liveFlash .9s ease; }
@keyframes liveFlash {
  from { background: rgba(37,211,102,.18); }
  to { background: rgba(255,255,255,.03); }
}
@media (max-width: 960px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-log-line { grid-template-columns: 64px 1fr; }
  .live-log-line .tag { grid-column: 2; }
  .live-log-line .msg { grid-column: 1 / -1; }
}

.live-motivo {
  margin: 6px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: .9rem;
  line-height: 1.35;
  border: 1px solid rgba(245,158,11,.35);
  background: rgba(245,158,11,.12);
  color: var(--text);
}
.live-motivo.err {
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.12);
}
.live-now-card.is-paused {
  border-color: rgba(245,158,11,.4);
}
.live-log-line .msg strong { font-weight: 800; }

.live-tempos-card { margin-bottom: 18px; }
.live-tempos-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.live-tempos-grid label {
  display: block;
  font-size: .78rem;
  margin-bottom: 4px;
  color: var(--label);
}
.live-tempos-grid input {
  width: 100%;
}
@media (max-width: 900px) {
  .live-tempos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
