:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --brand: #2360c4;
  --brand-dark: #1f56af;
  --accent: var(--brand);
  --sidebar-color: var(--brand);
  --sidebar-color-dark: var(--brand-dark);
  --icon-color: var(--brand);
  --icon-hover-bg: color-mix(in srgb, var(--icon-color) 14%, #fff);
  --ok: #16a34a;
  --warn: #f59e0b;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, #fff);
  --brand-soft-2: color-mix(in srgb, var(--brand) 18%, #fff);
  --brand-tint: color-mix(in srgb, var(--brand) 22%, transparent);
  --brand-ring: color-mix(in srgb, var(--brand) 28%, transparent);
}
* { box-sizing: border-box; }
/* Barras de rolagem na cor do menu lateral (herdado por todos os elementos). */
html { scrollbar-color: var(--sidebar-color) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--sidebar-color) 0%, var(--sidebar-color-dark) 100%);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--sidebar-color-dark); }
body {
  margin: 0;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(160deg, #0b1224, #1a2744 50%, #0f172a);
  color: var(--text);
  min-height: 100vh;
  height: 100%;
  -webkit-font-smoothing: antialiased;
}
#app {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
.side {
  width: 210px;
  min-width: 210px;
  height: 100%;
  max-height: 100%;
  background: linear-gradient(180deg, var(--sidebar-color) 0%, var(--sidebar-color-dark) 100%);
  border-right: 0;
  box-shadow: 8px 0 28px rgba(20, 54, 108, .18);
  padding: 14px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  color: #fff;
  flex-shrink: 0;
  align-self: stretch;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 10px;
  flex: 0 0 auto;
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: 0 0 auto;
}
.brandtext b { display: block; font-size: .95rem; color: #fff; }
.brandtext small { display: block; color: rgba(255,255,255,.78); font-size: .72rem; margin-top: 2px; line-height: 1.3; }
.brandtext small.hidden { display: none; }
.settings-name-row { margin-top: 14px; }
.settings-name-row label { font-weight: 600; font-size: .9rem; }
.userbox:empty { display: none; padding: 0; border: none; }
.side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 4px 4px 8px;
}
.side nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: #fff;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 600;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.side nav button .navicon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.side nav button .navicon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}
.side nav button .navlabel { color: #fff; white-space: nowrap; }
.side nav button:hover {
  background: rgba(255,255,255,.10);
  transform: translateX(2px);
}
.side nav button.active {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.side nav button.nav-logout { margin-top: 6px; opacity: .92; font-weight: 500; }
.userbox {
  font-size: .75rem;
  color: rgba(255,255,255,.82);
  border-top: 1px solid rgba(255,255,255,.18);
  padding: 8px 8px 4px;
  line-height: 1.35;
}
.userbox b { color: #fff; }
.about-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(19,34,51,.48);
  backdrop-filter: blur(3px);
}
.about-modal.hidden { display: none; }
.about-card {
  position: relative;
  width: min(480px, 94vw);
  background: #fff;
  border: 1px solid #dfe7ef;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(14,36,61,.24);
  padding: 28px 30px 22px;
  text-align: center;
  color: #15344f;
}
.about-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #748494;
  font-size: 24px;
  cursor: pointer;
}
.about-close:hover { background: #eef3f8; color: #233b51; }
.about-logo-wrap { display: flex; justify-content: center; margin: 6px 0 16px; }
.about-logo-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--sidebar-color), var(--sidebar-color-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
}
.about-card h2 { margin: 0 0 16px; color: #15344f; }
.about-owner-text {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 16px;
  border-radius: 12px;
  background: #f6f9fc;
  border: 1px solid #e0e8f0;
}
.about-owner-text span { color: #66798a; }
.about-owner-text strong { font-size: 1.1rem; color: #1d3c59; }
.about-owner-text button {
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  padding: 3px 5px;
}
.about-owner-text button:hover { text-decoration: underline; }
.about-version {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e7edf3;
  color: #718292;
  font-size: .9rem;
}
.about-version b { color: var(--brand); }
main {
  flex: 1;
  padding: 18px 22px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  background: var(--main-bg, #f2f6fb);
}
.top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.top h1 { margin: 0; font-size: 1.4rem; }
.top p { margin: 4px 0 0; color: var(--muted); }
.panel {
  background: rgba(30, 41, 59, .85);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.card {
  background: rgba(15, 23, 42, .55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.card b { font-size: 1.4rem; display: block; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input, textarea, select {
  background: #0f172a;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}
button.primary, .btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}
button.soft {
  background: #334155;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
button.soft.danger,
button.danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
button.soft.danger:hover,
button.danger:hover {
  background: #fee2e2;
}
.hidden { display: none !important; }
.banner {
  background: #78350f;
  color: #ffedd5;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .9rem;
  flex: 0 0 auto;
  max-width: min(420px, 100%);
}
.impersonate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: none;
  width: auto;
  margin: 0 0 10px;
  border-radius: 14px;
  padding: 0;
  font-weight: 600;
  z-index: 5;
  border: 1px solid var(--brand-ring);
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--brand-soft-2) 100%);
  color: #1e3a5f;
}
.impersonate-bar.hidden {
  display: none !important;
}
.impersonate-bar .ops-impersonate-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
}
.impersonate-bar .ops-impersonate-inner strong {
  display: block;
  font-size: .92rem;
}
.impersonate-bar .ops-impersonate-inner span {
  display: block;
  margin-top: 2px;
  color: #4d6480;
  font-size: .82rem;
  font-weight: 500;
}
.impersonate-bar .soft {
  background: #ffedd5;
  color: #78350f;
  border: 0;
  font-weight: 700;
}
.impersonate-bar .primary {
  flex-shrink: 0;
}
.system-aviso-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: none;
  width: auto;
  margin: 0 0 10px;
  border-radius: 14px;
  padding: 0;
  font-weight: 600;
  z-index: 5;
  border: 1px solid #f0d48a;
  background: linear-gradient(135deg, #fff8e6 0%, #fff1cc 100%);
  color: #7a4e00;
}
.system-aviso-bar.hidden {
  display: none !important;
}
.system-aviso-bar .ops-impersonate-inner {
  width: 100%;
  padding: 12px 14px;
}
.system-aviso-bar .ops-impersonate-inner strong {
  display: block;
  font-size: .92rem;
}
.system-aviso-bar .ops-impersonate-inner span {
  display: block;
  margin-top: 2px;
  color: #8a6420;
  font-size: .82rem;
  font-weight: 500;
}
.ops-config-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .ops-config-grid { grid-template-columns: 1fr; }
}
.ops-config-hero {
  padding-bottom: 16px;
}
.ops-config-hero-inner {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .ops-config-hero-inner { grid-template-columns: 1fr; }
}
.ops-config-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2eaf3;
  border-radius: 14px;
  background: #f7fafc;
}
.ops-config-brand .logo-preview {
  width: 100%;
  height: 120px;
  border-radius: 14px;
  font-size: 2rem;
}
.ops-config-brand .ops-config-logo-actions {
  flex-direction: column;
  align-items: stretch;
}
.ops-config-brand .ops-config-logo-actions button {
  width: 100%;
}
.ops-config-brand .ops-help {
  margin: 0;
  line-height: 1.4;
}
.ops-config-page .ops-panel {
  width: 100%;
}
.ops-config-page .ops-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  width: 100%;
}
.ops-config-page .ops-config-hero .ops-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 1100px) {
  .ops-config-page .ops-form-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.ops-form-grid .field,
.ops-form--grid .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  min-width: 0;
  width: 100%;
}
.ops-form-grid .field label,
.ops-form--grid .field label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #3d5166;
}
.ops-form-grid .field input,
.ops-form-grid .field select,
.ops-form-grid .field textarea,
.ops-form--grid .field input,
.ops-form--grid .field select,
.ops-form--grid .field textarea,
.ops-config-page .field input,
.ops-config-page .field select,
.ops-config-page .field textarea {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  box-sizing: border-box;
}
.ops-form-grid .field textarea,
.ops-form--grid .field textarea,
.ops-config-page .field textarea {
  min-height: 96px;
  resize: vertical;
}
.ops-form--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  width: 100%;
}
.ops-form--grid .ops-form-actions,
.ops-form-grid .ops-form-actions {
  grid-column: 1 / -1;
}
@media (max-width: 700px) {
  .ops-form--grid,
  .ops-config-page .ops-form-grid {
    grid-template-columns: 1fr;
  }
}
.ops-panel--warn {
  border-color: #f0d48a;
  background: #fffdf6;
}
.ops-config-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ops-config-logo-actions .ops-help {
  flex: 1 1 100%;
  margin: 0;
}
.nav-back-imp {
  background: #78350f !important;
  color: #ffedd5 !important;
  margin-top: 8px;
}
main.dashboard-page-wrap .impersonate-bar:not(.hidden),
main.atendimentos-page .impersonate-bar:not(.hidden),
main.kanban-page-wrap .impersonate-bar:not(.hidden),
main.contacts-page-wrap .impersonate-bar:not(.hidden),
main.replies-page-wrap .impersonate-bar:not(.hidden),
main.campaigns-page-wrap .impersonate-bar:not(.hidden),
main.config-page-wrap .impersonate-bar:not(.hidden),
main.backup-page-wrap .impersonate-bar:not(.hidden),
main.tags-page-wrap .impersonate-bar:not(.hidden) {
  display: flex !important;
  margin: 10px 12px 0;
}
.list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15,23,42,.45);
  cursor: pointer;
}
.item:hover { border-color: var(--accent); }
.cols { display: grid; grid-template-columns: 280px 1fr; gap: 12px; }
.msg {
  display: flex;
  flex-direction: column;
  margin: 4px 0 10px;
  max-width: 78%;
}
.msg.me { align-self: flex-end; align-items: flex-end; margin-left: auto; }
.msg.them { align-self: flex-start; align-items: flex-start; }
.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: .92rem;
}
.msg.me .msg-bubble {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.them .msg-bubble {
  background: #334155;
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}
.msg-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.msg:hover .msg-actions { opacity: 1; }
.msg-time { color: var(--muted); font-size: .72rem; }
.msg-action-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: .72rem;
  cursor: pointer;
  padding: 2px 4px;
}
.msg-action-btn:hover { color: color-mix(in srgb, var(--brand) 55%, #fff); }
#toast {
  position: fixed; right: 16px; bottom: 16px;
  background: #022c22; color: #a7f3d0; padding: 10px 14px;
  border-radius: 10px; display: none;
  z-index: 10050;
  max-width: min(92vw, 360px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.login-wrap { max-width: 380px; margin: 40px auto; }

/* Troca de painel (admin/revenda/cliente): some o shell antigo até o novo tema aplicar */
html.ui-panel-switching #app {
  opacity: 0;
  pointer-events: none;
}

/* Loading imediato ao trocar de página (nav) — centralizado na área útil */
.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  flex: 1 1 auto;
  align-self: stretch;
  box-sizing: border-box;
  min-height: min(58vh, 520px);
  padding: 48px 20px;
  margin: 0;
  color: #5b6b7c;
  text-align: center;
}
.page-loading p {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
}
.page-loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-top-color: var(--brand);
  animation: page-loading-spin .7s linear infinite;
}
@keyframes page-loading-spin {
  to { transform: rotate(360deg); }
}
body.ops-mode .page-loading { color: #4a6075; }
/* #page em flex (Atendimentos etc.): loading ocupa toda a área e centra */
main.atendimentos-page #page > .page-loading,
main.dashboard-page-wrap #page > .page-loading,
main.kanban-page-wrap #page > .page-loading,
main.contacts-page-wrap #page > .page-loading,
main.campaigns-page-wrap #page > .page-loading,
main.replies-page-wrap #page > .page-loading,
main.tags-page-wrap #page > .page-loading,
main.backup-page-wrap #page > .page-loading,
body.ops-mode main > #page > .page-loading {
  width: 100%;
  height: 100%;
  min-height: calc(100dvh - 160px);
  flex: 1 1 auto;
}

/* Login / Cadastro — paridade Hotspot (tela cheia, sem sidebar) */
body.login-auth {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  height: auto !important;
  overflow-x: hidden;
  overflow-y: auto;
}
body.login-auth #app {
  display: block;
  height: auto !important;
  max-height: none !important;
  min-height: 100vh;
  overflow: visible;
  background: transparent;
}
body.login-auth #side,
body.login-auth .menu-toggle,
body.login-auth .nav-backdrop,
body.login-auth #ops-topbar,
body.login-auth .top,
body.login-auth #impersonate-banner,
body.login-auth #system-aviso-banner {
  display: none !important;
}
body.login-auth main,
body.login-auth main.login-page-wrap {
  min-height: 100vh;
  height: auto !important;
  max-height: none !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* #page no flex encolhia o card; força largura útil no desktop */
body.login-auth main > #page {
  width: 100% !important;
  max-width: 720px !important;
  margin: 0 auto;
  padding: 28px 20px;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.login-page {
  width: 100% !important;
  max-width: none !important;
  padding: 0;
  margin: 0 auto;
  box-sizing: border-box;
}
.login-card {
  width: 100% !important;
  max-width: none !important;
  background: #fff !important;
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 18px 50px rgba(30, 20, 60, .22);
  padding: 40px 48px !important;
  color: #24313d;
  box-sizing: border-box;
}
.login-brand {
  text-align: center;
  margin-bottom: 22px;
}
.login-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}
.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.login-title {
  margin: 0 0 6px;
  color: #667eea;
  font-weight: 700;
  font-size: 1.55rem;
}
.login-tagline {
  margin: 0;
  color: #6b7280;
  font-size: .95rem;
}
.login-card .field {
  margin-bottom: 14px;
}
.login-card .field label {
  display: block;
  margin-bottom: 6px;
  font-size: .9rem;
  font-weight: 600;
  color: #374151;
}
.login-card .field input {
  width: 100%;
  background: #fff !important;
  color: #24313d !important;
  -webkit-text-fill-color: #24313d;
  border: 1px solid #d1d5db !important;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .95rem;
  box-sizing: border-box;
}
.login-card .field input:focus {
  outline: none;
  border-color: #667eea !important;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, .25);
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
  font-size: .9rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
}
.login-remember input {
  width: 16px;
  height: 16px;
}
.login-card .login-submit {
  width: 100%;
  margin-top: 2px;
  min-height: 44px;
  font-size: 1rem;
  background: #667eea !important;
  border-color: #667eea !important;
  box-shadow: none;
}
.login-card .login-submit:hover {
  background: #5568d3 !important;
  border-color: #5568d3 !important;
  filter: none;
}
.login-links {
  text-align: center;
  margin-top: 12px;
}
.login-links a {
  color: #667eea;
  text-decoration: none;
  font-size: .92rem;
}
.login-links a:hover { text-decoration: underline; }
.login-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: .82rem;
  line-height: 1.45;
  white-space: pre-line;
}
.login-alert {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: .9rem;
}
.login-alert.ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.login-alert.bad {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.login-alert.warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.login-card .field .req { color: #dc2626; }
.login-card .field-help {
  display: block;
  margin-top: 4px;
  font-size: .78rem;
  color: #6b7280;
}
.signup-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 14px;
  font-size: .9rem;
  color: #374151;
  cursor: pointer;
}
.signup-terms input {
  margin-top: 3px;
  flex-shrink: 0;
}
.signup-terms a {
  color: #2563eb;
  text-decoration: none;
}
.signup-terms a:hover { text-decoration: underline; }
@media (min-width: 768px) {
  body.login-auth main > #page { max-width: 720px !important; }
}
@media (min-width: 1100px) {
  body.login-auth main > #page { max-width: 760px !important; }
}
.kanban { display: flex; gap: 10px; overflow-x: auto; }
.kanban .col { min-width: 200px; background: #f4f7fb; border-radius: 12px; padding: 8px; border: 1px solid #e4ebf3; }

.kb-page { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.kb-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: #fff;
  border: 1px solid #e4ebf3;
  border-radius: 12px;
  padding: 10px 12px;
}
.kb-tools input[type="text"],
.kb-tools input:not([type]) {
  flex: 1;
  min-width: 220px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  padding: 9px 10px;
}
.kb-tools input[type="color"] {
  width: 42px;
  height: 36px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
}
.kb-hint { margin: 0; color: #6b7c8d; font-size: .8rem; }
.kb-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  min-height: 420px;
}
.kb-col {
  min-width: 240px;
  max-width: 280px;
  background: #f5f7fb;
  border: 1px solid #e4ebf3;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}
.kb-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e4ebf3;
}
.kb-col-title { display: flex; align-items: center; gap: 8px; }
.kb-col-title b { font-size: .88rem; color: #2f445a; }
.kb-col-title small { color: #8a97a5; font-size: .72rem; }
.kb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--stage-color, var(--brand));
}
.kb-del-stage {
  border: 0;
  background: transparent;
  color: #9aa7b5;
  font-size: 1.1rem;
  cursor: pointer;
}
.kb-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 62vh; }
.kb-card {
  background: #fff;
  border: 1px solid #e1e8f1;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 1px 2px rgba(20,40,70,.04);
  cursor: grab;
  user-select: none;
  transition: box-shadow .15s, transform .15s, opacity .15s;
}
.kb-card:active { cursor: grabbing; }
.kb-card.kb-dragging {
  opacity: .45;
  transform: scale(.98);
  box-shadow: 0 8px 20px rgba(20,40,70,.16);
}
.kb-cards.kb-drop-hover {
  background: var(--brand-soft);
  outline: 2px dashed var(--brand);
  outline-offset: -4px;
  border-radius: 8px;
  min-height: 48px;
}
.kb-card-top { display: flex; justify-content: space-between; gap: 6px; }
.kb-card-top b { font-size: .84rem; color: #33404d; }
.kb-card-x { border: 0; background: transparent; color: #c45b5b; cursor: pointer; }
.kb-card small { display: block; margin-top: 4px; color: #7a8794; font-size: .72rem; line-height: 1.3; }
.kb-card-foot {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}
.kb-pill {
  background: color-mix(in srgb, var(--stage-color, var(--brand)) 18%, #fff);
  color: #33404d;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .68rem;
  font-weight: 700;
}
.kb-card-foot select {
  border: 1px solid #d7e0ea;
  border-radius: 7px;
  font-size: .7rem;
  padding: 3px 4px;
  max-width: 110px;
}
.kb-empty { color: #9aa7b5; font-size: .78rem; padding: 8px; text-align: center; }

.att-handoff {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e8;
  border: 1px solid #f0d58a;
}
.att-handoff b { display: block; color: #8a5a00; font-size: .82rem; margin-bottom: 4px; }
.att-handoff small { color: #7a6540; font-size: .72rem; line-height: 1.4; }

.flow-tab {
  border: 1px solid #d7e0ea;
  background: #f5f7fb;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: .8rem;
  color: #475768;
}
.flow-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.flow-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.status-tabs button.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}
.status-media-preview {
  min-height: 180px;
  border: 2px dashed #c5d1dc;
  border-radius: 12px;
  background: #f7f9fb;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  padding: 10px;
}
.status-media-preview:hover { border-color: var(--brand-ring); background: var(--brand-soft); }
.status-media-empty {
  color: #748390;
  font-size: .9rem;
  text-align: center;
}

.bot-page { display: flex; flex-direction: column; gap: 10px; min-height: calc(100vh - 120px); }
.bot-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.bot-top h2 { margin: 0 0 4px; font-size: 1.15rem; color: #1f3348; }
.bot-top p { margin: 0; color: #6b7c8d; font-size: .85rem; }
.bot-top-actions { display: flex; gap: 8px; }
.bot-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  min-height: 0;
  flex: 1;
}
.bot-sidebar {
  background: #fff;
  border: 1px solid #e4ebf3;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bot-sidebar h4 { margin: 0 0 4px; font-size: .72rem; letter-spacing: .04em; color: #8996a3; }
.bot-sidebar button {
  border: 1px solid #d7e0ea;
  background: #f7f9fc;
  border-radius: 10px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  font-size: .84rem;
  color: #33404d;
  display: flex;
  gap: 8px;
  align-items: center;
}
.bot-sidebar button:hover { background: #eef3f9; }
.bot-sidebar hr { border: 0; border-top: 1px solid #e8edf2; margin: 4px 0; }
.bot-new-flow { color: #b42318 !important; background: #fff5f5 !important; border-color: #f3c4c4 !important; }
.bot-work {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 560px;
  background: #fff;
  border: 1px solid #e4ebf3;
  border-radius: 14px;
  overflow: hidden;
}
.bot-work-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e8edf2;
  flex-wrap: wrap;
}
.bot-flows-list { display: flex; gap: 6px; flex-wrap: wrap; }
.bot-zoom-controls { display: flex; gap: 6px; align-items: center; }
.bot-zoom-percent {
  border: 1px solid #d7e0ea;
  background: #f7f9fc;
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 58px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  color: #475768;
}
.bot-free-canvas {
  position: relative;
  flex: 1;
  overflow: auto;
  background:
    radial-gradient(circle at 1px 1px, #d7dee8 1px, transparent 0) 0 0 / 22px 22px,
    #eef2f7;
  min-height: 520px;
}
.bot-canvas-inner { position: relative; min-width: 1600px; min-height: 1000px; }
.bot-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.bot-connector-path {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.2;
}
.bot-connector-path.inside-path { stroke: #16a34a; }
.bot-connector-path.outside-path { stroke: #dc2626; }
.bot-nodes-layer { position: absolute; inset: 0; z-index: 2; }
.bot-empty {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #6b7c8d;
}
.flow-settings-panel {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 5;
  width: min(920px, calc(100% - 32px));
  background: rgba(255,255,255,.96);
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 28px rgba(20,40,70,.08);
}
.flow-settings-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}
.flow-settings-row-simple {
  align-items: end;
}
.flow-settings-row-simple .field {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
}
.flow-settings-row-simple #save-flow-config {
  margin-left: auto;
}
.flow-settings-row .field { min-width: 140px; flex: 1; }
.flow-settings-row label {
  display: block;
  font-size: .65rem;
  font-weight: 700;
  color: #8996a3;
  margin-bottom: 3px;
}
.flow-settings-row input,
.flow-settings-row select {
  width: 100%;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: .82rem;
}
.mini-toggle {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: .78rem;
  color: #475768;
  white-space: nowrap;
  padding-bottom: 6px;
}
.free-start-node,
.free-flow-node {
  position: absolute;
  background: #fff;
  border: 1px solid #d5deea;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(20,40,70,.08);
  min-width: 220px;
  max-width: 300px;
  z-index: 3;
}
.free-start-node {
  background: linear-gradient(180deg, #ecfdf3, #fff);
  border-color: #86efac;
  min-width: 170px;
  padding: 10px 12px 12px;
}
.free-flow-node.dragging,
.free-start-node.dragging { opacity: .92; box-shadow: 0 16px 36px rgba(20,40,70,.18); z-index: 6; }
.start-drag-handle,
.drag-handle { cursor: grab; }
.start-drag-handle { display: flex; gap: 8px; align-items: center; }
.node-icon { font-size: 1.2rem; }
.free-node-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 6px;
  border-bottom: 1px solid #eef2f6;
}
.free-node-head b { font-size: .85rem; color: #2f445a; }
.free-node-head button {
  border: 0;
  background: transparent;
  color: #9aa7b5;
  cursor: pointer;
  font-size: 1rem;
}
.free-node-body { padding: 8px 12px 14px; }
.free-node-body textarea,
.free-node-body input,
.free-node-body select {
  width: 100%;
  border: 1px solid #e1e7ed;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: .8rem;
  margin-top: 4px;
  background: #fff !important;
  color: #24313d !important;
  -webkit-text-fill-color: #24313d;
  box-sizing: border-box;
}
.free-node-body textarea {
  resize: none !important;
  overflow-y: auto;
  min-height: 52px;
  max-height: 52px;
  line-height: 1.35;
  field-sizing: fixed;
}
.free-node-body small { color: #7a8794; font-size: .72rem; }

.free-flow-node.hours-node {
  min-width: 320px;
  max-width: 340px;
  width: 330px;
  border-top: 4px solid #8b5cf6;
}
.hours-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flow-hours-windows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flow-hours-window {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hours-window-label {
  font-size: .68rem;
  font-weight: 700;
  color: #6b4aa8;
  letter-spacing: .02em;
}
.flow-hours-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 0;
}
.flow-hours-row input[type="time"] {
  flex: 1;
  margin-top: 0 !important;
  min-width: 0;
}
.flow-days-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.flow-days-row label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid #e0e6ec;
  border-radius: 5px;
  padding: 4px 2px;
  font-size: .68rem;
  background: #fafbfd;
  color: #3c5369;
  margin: 0;
}
.flow-days-row input {
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: #8b5cf6;
}
.hours-special {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border: 1px solid #dce5ed;
  border-radius: 9px;
  background: #f9fbfd;
}
.hours-special-toggle,
.hours-special-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: .72rem;
  font-weight: 700;
  color: #3c5369;
}
.hours-special-toggle input {
  width: 15px !important;
  height: 15px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
}
.hours-special .hours-msg,
.free-flow-node.hours-node textarea.hours-msg {
  margin: 0 !important;
  min-height: 48px !important;
  max-height: 48px !important;
  height: 48px !important;
  resize: none !important;
  overflow-y: auto !important;
  background: #fff !important;
  color: #24313d !important;
  -webkit-text-fill-color: #24313d !important;
  border: 1px solid #d7e0ea !important;
  border-radius: 7px;
  font-size: .75rem !important;
  line-height: 1.35 !important;
  padding: 6px 8px !important;
}
.hours-hint {
  display: block;
  margin-top: 2px;
  color: #7a8794;
  font-size: .7rem;
}
.menu-opt-row {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 26px 30px;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  padding-right: 22px;
}
.menu-option-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  padding-right: 22px;
}
.menu-option-wrap > label {
  font-size: .68rem;
  color: #687887;
}
.menu-option-number {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
}
.menu-option-copy,
.menu-option-delete {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  display: grid;
  place-items: center;
  padding: 0;
}
.menu-option-copy {
  background: var(--brand-soft);
  color: var(--brand);
}
.menu-option-copy:hover { background: var(--brand-soft); }
.menu-option-delete {
  background: #fff;
  color: #7b8793;
}
.menu-option-delete:hover {
  background: #fff0f0;
  color: #c53030;
}
.menu-editor-title {
  font-size: .68rem;
  color: #687887;
  margin-bottom: 2px;
}
.menu-add-bottom {
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px dashed #b9c7d4;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--brand);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.menu-add-bottom span {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}
.menu-add-bottom:hover {
  background: var(--brand-soft);
  border-color: var(--brand-ring);
}
.menu-help {
  display: block;
  margin-top: 6px;
  font-size: .65rem;
  color: #71808e;
}
.free-flow-node.menu-node {
  width: 320px;
  overflow: visible !important;
}
.free-flow-node.menu-node .free-node-body {
  overflow: visible;
}
.menu-options-editor {
  overflow: visible;
}
.node-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.node-actions > button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}
.node-actions > button[data-step-copy] {
  color: var(--brand);
}
.node-actions > button[data-step-delete] {
  color: #9aa7b5;
}
.menu-option-connector {
  position: absolute !important;
  left: auto !important;
  right: -24px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 26px !important;
  height: 26px !important;
  font-size: 1.1rem !important;
  z-index: 5;
}
.menu-option-connector:hover,
.menu-option-connector.connector-selected {
  transform: translateY(-50%) scale(1.12) !important;
}
.connector {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 4;
  font-size: .85rem;
  line-height: 1;
  padding: 0;
}
.connector-left { left: -12px; top: 50%; transform: translateY(-50%); }
.connector-right { right: -12px; top: 42%; }
.connector-inside { top: 38%; border-color: #16a34a; color: #16a34a; }
.connector-outside { top: 62%; border-color: #dc2626; color: #dc2626; }
.connector span {
  position: absolute;
  right: 26px;
  font-size: .58rem;
  font-weight: 700;
  white-space: nowrap;
  background: #fff;
  padding: 1px 4px;
  border-radius: 4px;
}
.bot-connector-path.wire-ghost {
  stroke: var(--brand);
  stroke-dasharray: 6 4;
  fill: none;
  pointer-events: none;
  opacity: .85;
}
.connector { touch-action: none; }
.connector.connecting {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(71, 124, 240, .35);
}
.dash-grid .card b.dash-wa { font-size: .95rem; word-break: break-word; }
.edge-delete {
  position: absolute;
  z-index: 5;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  cursor: pointer;
  font-size: .75rem;
  line-height: 1;
}
@media (max-width: 900px) {
  .bot-layout { grid-template-columns: 1fr; }
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; font-size: .9rem; vertical-align: top; }
.table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  color: #3d5166;
}
.table th.sortable:hover { color: #1e3a5f; background: #f3f7fb; }
.table th.sorted { color: var(--brand); }
.contacts-table tbody tr { cursor: pointer; }
.contacts-table tbody tr:hover { background: #f7fafc; }
.table-wrap { overflow-x: auto; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: lowercase;
}
.badge.ok { background: rgba(22,163,74,.25); color: #86efac; }
.badge.warn { background: rgba(245,158,11,.25); color: #fcd34d; }
.badge.bad { background: rgba(220,38,38,.25); color: #fca5a5; }
.tabs .active-tab, button.active-tab {
  background: var(--brand-tint) !important;
  outline: 1px solid var(--accent);
}
code { font-size: .8rem; color: color-mix(in srgb, var(--brand) 55%, #fff); }
.muted { color: var(--muted); font-size: .85rem; }
.menu-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  line-height: 1;
  font-size: 1.25rem;
}
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 40;
}
/* ?? Atendimentos (layout SaaS profissional) ?? */
main.atendimentos-page {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #f2f6fb;
}
main.atendimentos-page .top,
main.atendimentos-page #impersonate-banner:empty {
  display: none;
}
main.atendimentos-page #impersonate-banner:not(.hidden) {
  display: block;
  margin: 8px 12px 0;
}
main.atendimentos-page #page {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.att-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.att-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid #e5ebf2;
  flex-shrink: 0;
}
.att-topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  color: #1f2937;
  font-weight: 700;
}
.att-topbar p {
  margin: 2px 0 0;
  font-size: .78rem;
  color: #6f7f8d;
}
.att-status-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.att-sync-btn {
  border: 1px solid #c5d0dc;
  background: #fff;
  color: #1f4b73;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}
.att-sync-btn:hover:not(:disabled) {
  background: #f3f7fb;
}
.att-sync-btn:disabled {
  opacity: .55;
  cursor: default;
}
.att-pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  background: #fff0f0;
  color: #b33333;
}
.att-pill-status.on {
  background: #dbf8e8;
  color: #087d4b;
}

.att-wrap {
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr) 280px;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #fff;
  color: #1e293b;
}

.att-queue,
.att-chat,
.att-detail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.att-queue {
  border-right: 1px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}
.att-detail {
  border-left: 1px solid #e2e8f0;
  background: #fff;
  overflow: auto;
}

.att-workspace {
  height: 56px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.att-workspace-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--brand);
}
.att-workspace-name strong {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: var(--brand);
}
.att-workspace-name small {
  display: block;
  font-size: .72rem;
  color: #8b98a6;
  font-weight: 500;
}
.att-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  border: 6px solid color-mix(in srgb, var(--brand) 28%, #fff);
  box-sizing: border-box;
  flex-shrink: 0;
}
.att-newchat {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--brand) 28%, transparent);
}
.att-search { padding: 0 12px 8px; }
.att-search input {
  width: 100%;
  border: 0;
  background: #f2f5f9;
  border-radius: 8px;
  padding: 10px 12px;
  color: #33404d;
  font-size: .85rem;
}
.att-search input:focus {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 22%, transparent);
}
.att-filter-bar {
  flex-shrink: 0;
  border-bottom: 1px solid #eef2f6;
}
.att-filter-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.att-filter-toggle:hover {
  background: #f8fafc;
}
.att-filter-toggle-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.att-filter-toggle-label {
  font-size: .72rem;
  font-weight: 800;
  color: #5a6b7a;
  text-transform: uppercase;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.att-filter-badge {
  color: var(--brand);
  font-size: .55rem;
  line-height: 1;
}
.att-filter-toggle-hint {
  font-size: .72rem;
  color: #8a98a5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-filter-toggle-arrow {
  color: #8a98a5;
  font-size: .85rem;
  transition: transform .15s ease;
  flex-shrink: 0;
}
.att-filter-toggle.open .att-filter-toggle-arrow {
  transform: rotate(180deg);
}
.att-filters {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 12px 10px;
  overflow: hidden;
}
.att-filters.hidden {
  display: none;
}
.att-filter-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.att-filter-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  color: #6b7c8a;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.2;
  white-space: nowrap;
}
.att-filters select,
.att-queue select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #dce3ea !important;
  background-color: #f7f9fc !important;
  color: #33404d !important;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 500;
  padding: 7px 26px 7px 9px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7c8a' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 10px 10px !important;
}
.att-filters select:focus {
  outline: none;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent);
}
.att-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid #e9eef4;
  flex-shrink: 0;
  background: #fff;
}
.att-tabs button {
  border: 0;
  background: #fff;
  padding: 10px 4px 8px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: #9aa7b3;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.att-tabs button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.att-cnt {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #edf2f6;
  color: #73808d;
  font-size: .68rem;
  font-weight: 700;
}
.att-tabs button.active .att-cnt {
  background: color-mix(in srgb, var(--brand) 16%, #fff);
  color: var(--brand);
}

.att-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
}
.att-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  padding: 9px 10px;
  margin: 2px 4px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  min-height: 58px;
}
.att-item:hover,
.att-item.active {
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  box-shadow: inset 3px 0 0 var(--brand);
}
.att-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .78rem;
  flex-shrink: 0;
  border: 2px solid color-mix(in srgb, var(--brand) 28%, #fff);
  overflow: hidden;
  background: color-mix(in srgb, var(--brand) 55%, #8aa0b8);
}
.att-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.att-item.active .att-avatar {
  border-color: var(--brand);
}
.att-item-tags .stage-badge {
  font-size: .65rem !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  max-width: 100%;
}
.att-mini-tag.att {
  background: color-mix(in srgb, var(--att-color, #16a34a) 22%, #fff);
  color: var(--att-color, #16a34a);
  border: 1px solid color-mix(in srgb, var(--att-color, #16a34a) 35%, #fff);
}
.att-tab-unread {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.att-tabs button { position: relative; }
.att-responsible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid #e8edf2;
  background: #f7f9fc;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.att-resp-copy {
  min-width: 0;
  flex: 1 1 120px;
}
.att-resp-copy span {
  display: block;
  font-size: .65rem;
  font-weight: 700;
  color: #8a97a5;
  letter-spacing: .04em;
}
.att-resp-copy b {
  font-size: .82rem;
  color: var(--brand);
}
.att-responsible select {
  border: 1px solid #d7e0ea !important;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff !important;
  color: #33404d !important;
  font-size: .8rem;
  min-width: 0;
  flex: 1 1 140px;
  max-width: 100%;
  box-sizing: border-box;
}
.att-resp-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 2 1 260px;
  min-width: 0;
}
.att-resp-selects select {
  flex: 1 1 92px;
  min-width: 92px;
  max-width: 100%;
}
.att-resp-editable {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  flex: 2 1 100%;
  width: 100%;
  align-items: end;
}
.att-tag-edit-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.att-tag-edit-slot label {
  font-size: .62rem;
  font-weight: 800;
  color: #8a97a5;
  letter-spacing: .04em;
}
.att-tag-edit-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.att-tag-edit-slot select {
  width: 100%;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: .8rem;
  background: #fff;
  color: #33404d;
}
.tags-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tags-intro {
  padding: 0 2px 4px;
  color: #5b6b7c;
  font-size: .88rem;
}
.tags-intro p { margin: 0; }
.att-tag-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.att-tag-slots-editable {
  gap: 10px;
}
@media (max-width: 900px) {
  .att-resp-editable {
    grid-template-columns: 1fr;
  }
}
.msg-menu-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  border: 0;
  background: transparent;
  color: #7a8794;
  cursor: pointer;
  opacity: 0;
  font-size: .95rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
}
.bubble:hover .msg-menu-btn { opacity: 1; }
.msg-menu-btn:hover { background: rgba(0,0,0,.06); }
.bubble { position: relative; }
.msg-menu {
  position: absolute;
  top: 24px;
  right: 4px;
  z-index: 20;
  min-width: 170px;
  background: #fff;
  border: 1px solid #d9e3ef;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(20,40,70,.16);
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.msg-menu-floating {
  position: fixed !important;
  top: 0;
  left: 0;
  right: auto !important;
  z-index: 99999;
  min-width: 190px;
  pointer-events: auto;
}
.msg-menu.hidden { display: none; }
.msg-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: .8rem;
  color: #33404d;
  width: 100%;
  pointer-events: auto;
  touch-action: manipulation;
}
.msg-menu button:hover { background: #eef3f9; }
.bubble.menu-open { z-index: 5; }
.msg-menu-btn { opacity: .55; }
.bubble:hover .msg-menu-btn,
.bubble.menu-open .msg-menu-btn { opacity: 1; }
.reply-preview {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 12px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
}
.reply-preview b { display: block; font-size: .72rem; color: var(--brand); }
.reply-preview small { font-size: .75rem; color: #5a6b7c; }
.reply-preview button {
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: #7a8794;
}
.react-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 8px 0;
}
.react-pick {
  border: 0;
  background: #f3f6fa;
  border-radius: 10px;
  font-size: 1.5rem;
  padding: 8px 10px;
  cursor: pointer;
}
.fwd-list { max-height: 360px; overflow: auto; border: 1px solid #e8edf2; border-radius: 10px; padding: 4px; }
.fwd-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}
.fwd-row-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.fwd-row-text b {
  font-size: .86rem;
  color: #243447;
  font-weight: 600;
}
.fwd-row small.muted { color: #8a97a6; font-size: .72rem; }
.fwd-row:hover { background: #f3f6fa; }
.fwd-row-disabled { opacity: .55; cursor: not-allowed; }
.fwd-row-disabled:hover { background: transparent; }
.att-item-main { min-width: 0; }
.att-item-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: baseline;
}
.att-item-row b {
  font-size: .82rem;
  color: #33404d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-time { font-size: .68rem; color: #82909d; flex-shrink: 0; }
.att-item-phone {
  font-size: .72rem;
  color: #6b7c8a;
  line-height: 1.2;
  margin-top: 1px;
}
.att-preview {
  font-size: .72rem;
  color: #8c98a4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.att-item-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
}
.att-item-tags .stage-badge,
.att-item-tags .att-mini-tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att-mini-tag {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}
.att-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 58px;
}
.att-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #4ba967;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.att-take, .att-wait {
  border: 0;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: .62rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .02em;
}
.att-take { background: #e1f5e8; color: #19824a; }
.att-wait { background: #fff3d8; color: #9b6c0a; }
.att-hide {
  border: 0;
  background: transparent;
  color: #b0bac4;
  font-size: .75rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.att-hide:hover { color: #dc2626; }

.att-take-chat, .att-wait-chat {
  border: 0;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}
.att-take-chat { background: #dff5e7; color: #177b47; }
.att-wait-chat { background: #fff2d6; color: #9a6908; }
.att-head-icon {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  opacity: .7;
}
.att-head-icon:hover { opacity: 1; }
.att-danger-btn {
  border: 0;
  background: #fff0f0;
  color: #b33333;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}

.att-empty-list, .att-empty, .att-no-msgs {
  height: 100%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #85929e;
  text-align: center;
  padding: 28px 16px;
  gap: 6px;
}
.att-empty-list b, .att-empty b { color: #5d6d7c; font-size: .95rem; }
.att-empty-list small, .att-empty small { color: #8b98a6; font-size: .82rem; }
.att-empty-icon, .att-empty-visual {
  font-size: 2rem;
  color: #b9c6d3;
  margin-bottom: 4px;
}

.att-chat { background: #f3f6fa; }
.att-chathead {
  min-height: 58px;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid #e9eef3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.att-back-btn {
  display: none;
  border: 0;
  background: #f1f5f9;
  color: #475569;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
}
.att-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.att-who-text { min-width: 0; }
.att-who-text b {
  display: block;
  font-size: .9rem;
  color: var(--brand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-who-text small { color: #778592; font-size: .75rem; }
.att-header-avatar {
  width: 40px;
  height: 40px;
  border-color: var(--brand);
}
.att-head-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

.att-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg, #f5efe7);
  min-height: 0;
}
/* Empurra bolhas para o rodapé quando há poucas msgs (evita “buraco” embaixo + scroll estranho). */
.att-msgs::before {
  content: '';
  flex: 1 1 auto;
  min-height: 0;
  pointer-events: none;
}
.bubble {
  max-width: min(72%, 520px);
  min-width: 72px;
  width: fit-content;
  box-sizing: border-box;
  padding: 8px 11px 6px;
  border-radius: 8px;
  margin: 5px 0;
  font-size: .86rem;
  line-height: 1.45;
  box-shadow: 0 2px 7px rgba(50, 80, 111, .08);
  color: #24313d;
}
.bubble.in { background: #fff; align-self: flex-start; border: 1px solid #e8edf2; }
.bubble.out {
  background: var(--bubble-out-bg, #d9ffc7) !important;
  align-self: flex-end;
  margin-left: auto;
  border: 1px solid color-mix(in srgb, var(--bubble-out-bg, #d9ffc7) 70%, #9bbb7a);
}
.bubble-pending { opacity: .75; }
.bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}
.bubble-text strong { font-weight: 700; }
.bubble-text em { font-style: italic; }
.bubble-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: .68rem;
  color: #73808d;
}
.bubble-ticks { color: #34b7f1; font-size: .7rem; letter-spacing: -1px; }

.att-composer-wrap {
  background: #fff;
  border-top: 1px solid #e8edf2;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}
.att-quickbar {
  padding: 6px 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
}
.quick-picker {
  position: relative;
  flex: 1;
  min-width: 0;
}
.quick-picker-trigger {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dce4eb;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  cursor: pointer;
  color: #304357;
  text-align: left;
  font: inherit;
}
.quick-picker-placeholder {
  color: #687887;
  font-size: .82rem;
}
.quick-picker-arrow {
  color: #8a98a5;
  font-size: .9rem;
  flex-shrink: 0;
}
.quick-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid #ccd8e2;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(35, 60, 88, .15);
  padding: 5px;
  z-index: 9999;
}
.quick-picker-menu.hidden { display: none; }
.quick-picker-option {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 0;
  background: #fff;
  border-radius: 7px;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.quick-picker-option:hover { background: #f3f7fb; }
.quick-picker-color {
  width: 5px;
  height: 38px;
  border-radius: 5px;
  background: var(--quick-color, var(--brand));
}
.quick-picker-copy { min-width: 0; }
.quick-picker-copy b {
  display: block;
  font-size: .82rem;
  color: #1f2f3f;
  margin-bottom: 3px;
}
.quick-picker-copy small {
  display: block;
  font-size: .76rem;
  color: #687887;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-picker-empty {
  padding: 12px;
  color: #7b8996;
  font-size: .78rem;
  text-align: center;
}
.quick-selected-line {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.quick-selected-color {
  width: 5px;
  height: 28px;
  border-radius: 5px;
  background: var(--quick-color, var(--brand));
}
.quick-selected-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
  color: #304357;
}
.quick-selected-copy b { font-size: .82rem; color: #1f2f3f; }
.quick-selected-copy small { color: #687887; }
.att-quick-use {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--icon-color);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.att-quick-use svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.att-quick-use:hover { background: var(--icon-hover-bg); }
.att-composer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 12px;
}
.att-composer textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  border: 0;
  background: #f4f6f9;
  border-radius: 10px;
  padding: 11px 12px;
  color: #33404d;
  font-size: .88rem;
}
.att-composer textarea:focus { outline: none; }
.att-tool {
  border: 0;
  background: transparent;
  color: var(--icon-color);
  cursor: pointer;
  opacity: .9;
  padding: 6px;
  line-height: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
}
.att-tool svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}
.att-tool:hover { opacity: 1; background: var(--icon-hover-bg); }
.att-tool:disabled { opacity: .35; cursor: default; }

.attachment-preview {
  margin: 6px 12px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f0f5fb;
  border: 1px solid #d7e3f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.attachment-preview.hidden { display: none; }
.attachment-preview-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.attachment-preview-main img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
}
.attachment-preview-main b { display: block; font-size: .82rem; color: #2f445a; }
.attachment-preview-main small { color: #6b7c8d; font-size: .72rem; }
.att-prev-icon { font-size: 1.4rem; }
.att-remove-att {
  border: 0;
  background: #ffe8e8;
  color: #b42318;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
}

.mic-bar {
  margin: 6px 12px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff1f1;
  border: 1px solid #f5c2c2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mic-bar.hidden { display: none; }
.mic-bar b { font-size: .82rem; color: #9b1c1c; }
.mic-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e11d48;
  animation: micPulse 1s infinite;
}
@keyframes micPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}
.mic-stop, .mic-cancel {
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
}
.mic-stop { background: #e11d48; color: #fff; }
.mic-cancel { background: #fff; border: 1px solid #e5b4b4; color: #7f1d1d; }

.att-prev-icon { font-size: 1.4rem; }
.emoji-popover {
  position: absolute;
  right: 12px;
  bottom: 64px;
  width: min(320px, calc(100% - 24px));
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(20, 40, 70, .18);
  z-index: 30;
  padding: 10px;
}
.emoji-popover.hidden { display: none; }
.emoji-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.emoji-pop-head b { font-size: .85rem; color: #33404d; }
.emoji-pop-head button {
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: #7a8794;
}
.emoji-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.emoji-tabs button {
  border: 0;
  background: #f3f6fa;
  border-radius: 8px;
  padding: 4px 7px;
  cursor: pointer;
}
.emoji-tabs button.active { background: var(--brand-soft); }
.emoji-group-title {
  font-size: .72rem;
  color: #7a8794;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.emoji-grid button {
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
}
.emoji-grid button:hover { background: #eef3f9; }

.bubble-media { margin-bottom: 6px; }
.bubble-media img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  display: block;
}
.bubble-media audio,
.bubble-media video {
  max-width: 260px;
  width: 100%;
  min-width: 220px;
  border-radius: 8px;
  display: block;
}
.bubble.has-media { min-width: 220px; }
.bubble-media-audio { min-width: 220px; }
.wa-audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 18px;
  background: #f3f6fa;
  border: 1px solid #e2e8f0;
}
.bubble.out .wa-audio-player {
  background: color-mix(in srgb, var(--bubble-out-bg, #d9ffc7) 70%, #fff);
  border-color: color-mix(in srgb, var(--bubble-out-bg, #d9ffc7) 55%, #9bbb7a);
}
.wa-audio-play {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.wa-audio-player.pending .wa-audio-play { background: #64748b; }
.wa-audio-player.error .wa-audio-play { background: #dc2626; }
.wa-audio-body { flex: 1; min-width: 0; }
.wa-audio-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
}
.wa-audio-wave span {
  width: 3px;
  border-radius: 99px;
  background: #94a3b8;
  display: inline-block;
}
.wa-audio-label {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: .72rem;
  font-weight: 600;
}
.wa-audio-mic { opacity: .55; font-size: .85rem; }
.wa-audio-native { display: none; }
.bubble-media-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .82rem;
  font-weight: 600;
  color: #3d5166;
  margin-bottom: 4px;
}
.media-load-btn { font-size: .78rem !important; padding: 4px 8px !important; }
.flow-days-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
  font-size: .72rem;
}
.flow-days-row label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border: 1px solid #e1e7ed;
  border-radius: 6px;
  background: #f8fafc;
}
.delay-row input { width: 90px !important; }
.tag-admin-list { list-style: none; padding: 0; margin: 0; }
.tag-admin-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.contact-tags-multi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ctag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: .78rem;
}
.ctag-chip input { margin: 0; }
.ctag-chip span {
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--att-color, #16a34a) 18%, #fff);
  color: var(--att-color, #16a34a);
  border: 1px solid color-mix(in srgb, var(--att-color, #16a34a) 30%, #fff);
}
.ctag-chip input:checked + span {
  background: var(--att-color, #16a34a);
  color: #fff;
  border-color: transparent;
}
.tag-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.12);
  flex-shrink: 0;
}
.camp-list { list-style: none; padding: 0; margin: 0; }
.camp-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.camp-status {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  background: #eef2f7;
  color: #475569;
}
.free-flow-node.delay-node .free-node-head { border-bottom-color: #fde68a; }
.free-flow-node.kanban-node .free-node-head { border-bottom-color: var(--brand-soft-2); }
.free-flow-node.absence-node .free-node-head { border-bottom-color: #fecaca; }

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(19, 34, 51, .48);
  backdrop-filter: blur(3px);
}
.app-modal.hidden { display: none; }
.app-modal-card {
  position: relative;
  width: min(480px, 96vw);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #dfe7ef;
  box-shadow: 0 24px 70px rgba(14, 36, 61, .24);
  padding: 22px 22px 16px;
}
.app-modal-card h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #1f3348;
}
.app-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 1.3rem;
  color: #748494;
  cursor: pointer;
}
.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.app-modal-actions .soft,
.app-modal-actions .primary {
  border: 0;
  border-radius: 9px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: .85rem;
}
.app-modal-actions .soft { background: #eef2f6; color: #425466; }
.app-modal-actions .primary { background: var(--brand); color: #fff; }
.app-modal-actions .primary.hidden { display: none; }
.schedule-form label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: .72rem;
  font-weight: 700;
  color: #8996a3;
  text-transform: uppercase;
}
.schedule-form textarea,
.schedule-form input[type="datetime-local"] {
  width: 100%;
  border: 1px solid #e1e7ed;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: .88rem;
  background: #fafbfd;
}
.schedule-contact {
  padding: 10px;
  border-radius: 10px;
  background: #f4f7fb;
  margin-bottom: 4px;
}
.schedule-contact b { display: block; color: #2f445a; }
.schedule-contact small { color: #4d74c4; }
.schedule-info {
  margin: 10px 0 0;
  font-size: .78rem;
  color: #5e6d82;
  line-height: 1.4;
}
.scheduled-list {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e8edf2;
}
.scheduled-list b { font-size: .8rem; color: #475768; }
.scheduled-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 8px;
}
.scheduled-row span { display: block; font-size: .78rem; font-weight: 600; color: #33404d; }
.scheduled-row small { display: block; font-size: .72rem; color: #6b7c8d; }
.scheduled-row button {
  border: 0;
  background: #ffe8e8;
  color: #b42318;
  border-radius: 7px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 600;
}

.att-send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--icon-color);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.att-send svg { width: 16px; height: 16px; fill: currentColor; display: block; margin-left: 2px; }
.att-send.sending { opacity: .65; pointer-events: none; }
.att-send:hover { background: color-mix(in srgb, var(--icon-color) 88%, #000); }

.att-detail-body { padding: 14px; }
.att-detail-body h3 { margin: 0 0 2px; font-size: .95rem; color: #475768; }
.att-detail-phone { color: #4d74c4; font-weight: 600; font-size: .82rem; }
.att-field { margin-top: 12px; }
.att-field label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  color: #8996a3;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: .03em;
}
.att-field input,
.att-field textarea,
.att-field select {
  width: 100%;
  border: 1px solid #e1e7ed;
  background: #fafbfd;
  color: #33404d;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .85rem;
}
.att-field textarea { resize: vertical; }

.att-outside {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  border: 1px solid #dbe5f3;
  background: #f8fbff;
}
.att-outside.enabled { border-color: #b7e4c7; background: #f3fbf6; }
.att-outside.disabled { border-color: #f5df9c; background: #fff8e8; }
.att-outside b { display: block; font-size: .82rem; color: #17365d; margin-bottom: 4px; }
.att-outside small { font-size: .72rem; color: #5e6d82; line-height: 1.4; }
.att-outside-tip {
  margin-top: 8px;
  padding: 10px 11px;
  border-radius: 8px;
  background: #fff8e8;
  border: 1px solid #f5df9c;
  color: #665018;
  font-size: .75rem;
  line-height: 1.4;
}
.att-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.att-switch input { opacity: 0; width: 0; height: 0; }
.att-switch span {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: .15s;
}
.att-switch span::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .15s;
}
.att-switch input:checked + span { background: #22c55e; }
.att-switch input:checked + span::after { transform: translateX(18px); }

.att-notes-box { margin-top: 14px; }
.att-notes-box > label {
  font-size: .7rem;
  font-weight: 700;
  color: #8996a3;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.att-note { font-size: .78rem; color: #5d6d7c; padding: 3px 0; }
.att-note.muted { color: #94a3b8; }
.att-note-row { display: flex; gap: 6px; margin-top: 8px; }
.att-note-row input {
  flex: 1;
  background: #fafbfd;
  border: 1px solid #e1e7ed;
  color: #33404d;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: .8rem;
}
.att-note-save {
  border: 0;
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: var(--brand);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}
.att-save-detail {
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: var(--icon-color);
  color: #fff;
  border-radius: 9px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: .85rem;
}
.att-save-detail:hover { filter: brightness(1.05); }

@media (max-width: 1200px) {
  .att-wrap { grid-template-columns: 300px 1fr 250px; }
}
@media (max-width: 1100px) {
  .att-wrap { grid-template-columns: 300px 1fr; }
  .att-detail { display: none; }
}

.item.selected { border-color: var(--accent); background: var(--brand-tint); }
@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
    background: rgba(255,255,255,.14) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.28) !important;
  }
  body.nav-open .nav-backdrop { display: block; }
  #app { flex-direction: row; }
  /* Drawer sob o topbar: hamburger fica no fluxo do topo (não fixed) */
  .ops-topbar {
    position: relative;
    z-index: 60;
  }
  .side {
    position: fixed;
    top: 60px; /* abaixo do ops-topbar (hamburger no fluxo) */
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  body.nav-open .side { transform: translateX(0); }
  /* Menu aberto: trava scroll do body; só o sidebar rola */
  html:has(body.nav-open) {
    overflow: hidden !important;
    overscroll-behavior: none;
  }
  body.nav-open,
  body.nav-open.app-scroll {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
    height: 100% !important;
    max-height: 100dvh !important;
  }
  body.nav-open #app,
  body.nav-open.app-scroll #app {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }
  body.nav-open main {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
  }
  body.nav-open .nav-backdrop {
    touch-action: none;
  }
  body.nav-open .side,
  body.nav-open.app-scroll .side,
  body.nav-open.ops-mode.app-scroll .side {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    height: calc(100dvh - 60px) !important;
    max-height: calc(100dvh - 60px) !important;
    min-height: 0 !important;
  }
  body.nav-open .side nav,
  body.nav-open.app-scroll .side nav,
  body.nav-open.ops-mode.app-scroll .side nav {
    overflow: visible !important;
    flex: 0 0 auto !important;
  }
  main { padding: 0; width: 100%; height: 100%; }
  main.atendimentos-page { padding: 0; height: 100%; }
  .cols { grid-template-columns: 1fr; }
  .att-wrap {
    grid-template-columns: 1fr;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  .att-queue {
    max-height: none;
    height: 100%;
    border-right: 0;
    display: flex;
  }
  .att-chat {
    display: none;
    min-height: 0;
    height: 100%;
  }
  body.att-show-chat .att-queue { display: none; }
  body.att-show-chat .att-chat { display: flex; }
  body.att-show-chat .att-back-btn { display: grid; place-items: center; }
  .att-detail { display: none !important; }
  .att-chathead { flex-wrap: wrap; padding: 8px 12px; }
  .att-head-actions { width: 100%; justify-content: flex-end; }
  .att-msgs { padding: 12px 14px; }
  .bubble { max-width: 88%; }
  .table { display: block; overflow-x: auto; }
}
@media (min-width: 901px) {
  .menu-toggle, .nav-backdrop { display: none !important; }
}

/* ===== Dashboard (paridade desktop / vídeo) ===== */
main.dashboard-page-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
}
/* Com chrome ops + scroll de página: não prender o topo/conteúdo */
body.ops-mode.app-scroll main.dashboard-page-wrap,
body.app-scroll main.dashboard-page-wrap {
  height: auto;
  min-height: 100%;
  overflow: visible;
}
main.dashboard-page-wrap .top { display: none; }
main.dashboard-page-wrap #impersonate-banner:empty { display: none; }
main.dashboard-page-wrap #page {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
body.ops-mode.app-scroll main.dashboard-page-wrap > #page,
body.app-scroll main.dashboard-page-wrap > #page {
  overflow: visible;
  min-height: 0;
}

.dashboard-page {
  padding: 0 0 24px;
  background:
    radial-gradient(circle at 15% -15%, rgba(69,132,235,.07), transparent 30%),
    #f4f7fb;
  min-height: 100%;
}
.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #e5ebf2;
  margin-bottom: 16px;
}
.dashboard-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.impersonate-top-btn {
  background: #78350f !important;
  color: #ffedd5 !important;
  border: 0 !important;
  font-weight: 700 !important;
  white-space: nowrap;
}
.dashboard-topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  color: #1f2937;
  font-weight: 700;
}
.dashboard-topbar p {
  margin: 2px 0 0;
  font-size: .78rem;
  color: #6f7f8d;
}

.dashboard-summary-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
  padding: 0 18px;
  margin-bottom: 16px;
}
.dashboard-summary-card {
  min-height: 92px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid #e1e8f0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31,55,80,.03), 0 8px 24px rgba(31,55,80,.045);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dashboard-summary-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand-ring) 28%, #fff);
  box-shadow: 0 2px 4px rgba(31,55,80,.04), 0 12px 30px rgba(31,55,80,.075);
}
.dashboard-summary-icon {
  width: 45px;
  height: 45px;
  min-width: 45px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--brand) 12%, #fff),
    color-mix(in srgb, var(--brand) 18%, #fff)
  );
  color: var(--brand);
}
.dashboard-summary-icon svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}
.dashboard-summary-copy { min-width: 0; }
.dashboard-summary-copy span {
  display: block;
  margin-bottom: 4px;
  color: #718297;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-summary-copy b {
  display: block;
  color: #183a5a;
  font-size: 24px;
  line-height: 1;
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 0 18px;
}
.dashboard-metric-card {
  min-height: 345px;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #e0e7ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28,53,78,.025), 0 10px 28px rgba(28,53,78,.045);
}
.dashboard-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px 10px;
}
.dashboard-card-copy { min-width: 0; }
.dashboard-card-kicker {
  display: block;
  margin-bottom: 5px;
  color: #7c94ac;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .7px;
}
.dashboard-card-head h3 {
  margin: 0;
  color: #193753;
  font-size: 17px;
  font-weight: 600;
}
.dashboard-card-head small {
  display: block;
  margin-top: 5px;
  color: #7b8998;
  font-size: 13px;
  font-weight: 400;
}
.dashboard-card-value {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}
.dashboard-card-value > strong {
  color: var(--brand);
  font-size: 29px;
  line-height: 1;
  font-weight: 600;
}
.dashboard-trend {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.dashboard-trend.up { color: #118553; background: #e7f8ef; }
.dashboard-trend.down { color: #c74b51; background: #fff0f1; }
.dashboard-trend.neutral { color: #748495; background: #f0f3f6; }
.dashboard-chart { height: 200px; padding: 4px 17px 0; }
.dashboard-chart-svg { width: 100%; height: 100%; overflow: visible; }
.dashboard-grid-line {
  stroke: #edf1f5;
  stroke-width: 1;
  stroke-dasharray: 4 7;
  vector-effect: non-scaling-stroke;
}
.dashboard-gradient-start {
  stop-color: var(--brand);
  stop-opacity: .26;
}
.dashboard-gradient-end {
  stop-color: var(--brand);
  stop-opacity: .015;
}
.dashboard-chart-area { stroke: none; }
.dashboard-chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 3px 4px color-mix(in srgb, var(--brand) 18%, transparent));
}
.dashboard-chart-point {
  fill: #fff;
  stroke: var(--brand);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.dashboard-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 2px 16px 16px;
}
.dashboard-days span {
  min-width: 0;
  padding: 7px 3px;
  text-align: center;
  border-radius: 9px;
}
.dashboard-days span.today {
  background: color-mix(in srgb, var(--brand) 10%, #fff);
}
.dashboard-days b {
  display: block;
  color: #7d8b99;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-days small {
  display: block;
  margin-top: 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1250px) {
  .dashboard-summary-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 12px 16px;
  }
  .dashboard-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px;
  }
  .dashboard-summary-card {
    min-height: 0;
    padding: 12px;
    align-items: flex-start;
    gap: 10px;
  }
  .dashboard-summary-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
  }
  .dashboard-summary-icon svg {
    width: 18px;
    height: 18px;
  }
  .dashboard-summary-copy span {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 12px;
    line-height: 1.3;
  }
  .dashboard-summary-copy b {
    margin-top: 4px;
    font-size: 22px;
  }
  /* 5º card: largura total no grid 2 colunas */
  .dashboard-summary-card:nth-child(5) {
    grid-column: 1 / -1;
  }
  .dashboard-topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 12px 8px;
  }
  .dashboard-card-head {
    padding: 14px 14px 8px;
    gap: 10px;
  }
  .dashboard-card-head h3 { font-size: 15px; }
  .dashboard-card-head small { font-size: 12px; }
  .dashboard-chart { height: 170px; padding: 4px 10px 0; }
  .dashboard-days {
    gap: 2px;
    padding: 2px 10px 12px;
  }
  .dashboard-days span { padding: 6px 2px; }
  .dashboard-days b {
    font-size: 10px;
    white-space: normal;
    line-height: 1.15;
    overflow: visible;
    text-overflow: unset;
  }
  .dashboard-days small { font-size: 11px; }
}

/* ===== Kanban (paridade desktop / v�deo) ===== */
main.kanban-page-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
}
main.kanban-page-wrap .top,
main.kanban-page-wrap #impersonate-banner:empty { display: none; }
main.kanban-page-wrap #page {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 15% -15%, rgba(69,132,235,.06), transparent 28%),
    #f4f7fb;
}

.kanban-page { padding-bottom: 20px; min-height: 100%; }
.kanban-tools {
  margin: 0 16px 12px !important;
  padding: 14px !important;
}
.kanban-tools-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.kanban-tools .search {
  flex: 1;
  min-width: 220px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .92rem;
  background: #fff;
  color: #1f3b57;
  -webkit-text-fill-color: #1f3b57;
}
.kanban-tools .color-picker {
  width: 52px;
  height: 40px;
  padding: 2px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #fff;
}
.kanban-tools small {
  display: block;
  color: #74818e;
  margin-top: 8px;
  font-size: .8rem;
}

.kanban-orphan {
  margin: 0 16px 12px !important;
  padding: 12px 14px !important;
}
.kanban-orphan-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.kanban-orphan-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e8eef5;
  color: #5a6b7c;
  font-size: .75rem;
  font-weight: 700;
  margin-left: 6px;
}
.kanban-orphan-drop {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
}
.kanban-orphan-drop .lead {
  width: 260px;
  margin-bottom: 0;
}

.kanban-scroll-top {
  width: calc(100% - 32px);
  height: 18px;
  margin: 4px 16px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
}
.kanban-scroll-top .kanban-scroll-spacer { height: 1px; }
.kanban-scroll-top.no-overflow {
  height: 0;
  margin-top: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.kanban {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  gap: 14px !important;
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: visible !important;
  padding: 0 16px 14px !important;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}
.kanban > .kcol {
  flex: 0 0 330px !important;
  width: 330px !important;
  min-width: 330px !important;
  max-width: 330px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background: #ebf0f4;
  border-radius: 11px;
  padding: 8px;
  border-top: 4px solid var(--stage-color, var(--brand)) !important;
}
.khead.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 2px 8px;
}
.stage-title-wrap {
  display: grid;
  grid-template-columns: 14px 1fr 36px;
  gap: 6px;
  align-items: center;
  min-width: 0;
  width: 100%;
}
.stage-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--stage-color, var(--brand));
  flex-shrink: 0;
}
.stage-name-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #dbe3ea;
  border-radius: 7px;
  padding: 7px 8px;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  /* Igual desktop: texto escuro (n�o herda --text claro do tema) */
  color: #1f2937 !important;
  -webkit-text-fill-color: #1f2937;
}
.stage-color-input {
  width: 34px;
  height: 30px;
  padding: 1px;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  background: #fff;
}
.ktools {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.ktools button {
  border: 0;
  background: #fff;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: #657482;
  font-size: 13px;
  line-height: 1;
}
.ktools button:hover { background: #eef3f8; color: #1f3b57; }
.stage-preview { padding: 4px 2px 10px; }
.stage-badge {
  display: inline-block;
  max-width: 100%;
  padding: 3px 7px !important;
  border-radius: 4px !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  font-size: 11px !important;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* fallback; a cor real vem do style inline (igual desktop) */
  background: var(--brand);
}
.kdrop {
  min-height: 180px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 2px;
}
.kdrop.kb-drop-hover {
  outline: 2px dashed var(--brand);
  outline-offset: 2px;
  background: #e8f1ff;
  border-radius: 8px;
}
.lead {
  background: #fff;
  border: 1px solid #dfe6eb;
  border-radius: 9px;
  padding: 9px;
  margin-bottom: 7px;
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 2px rgba(20,40,70,.03);
  transition: box-shadow .15s, opacity .15s, transform .15s;
}
.lead:active { cursor: grabbing; }
.lead.kb-dragging {
  opacity: .55;
  transform: scale(.98);
  box-shadow: 0 8px 20px rgba(20,40,70,.12);
}
.lead-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: flex-start;
}
.lead b {
  font-size: 13px;
  color: #243746;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead small {
  display: block;
  color: #7c8995;
  margin: 3px 0;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead .tags { margin-top: 6px; }
.lead-x {
  border: 0;
  background: transparent;
  color: #c45b5b;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.kanban,
.kanban-scroll-top { scrollbar-width: auto; scrollbar-color: auto; }
.kanban::-webkit-scrollbar,
.kanban-scroll-top::-webkit-scrollbar { height: 14px; }
.kanban::-webkit-scrollbar-track,
.kanban-scroll-top::-webkit-scrollbar-track {
  background: #e8eef5;
  border-radius: 10px;
}
.kanban::-webkit-scrollbar-thumb,
.kanban-scroll-top::-webkit-scrollbar-thumb {
  background: var(--sidebar-color);
  border-radius: 10px;
  border: 3px solid #e8eef5;
}

@media (max-width: 700px) {
  .kanban > .kcol {
    flex-basis: 300px !important;
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
  }
}

/* ===== Contatos (paridade desktop / v�deo) ===== */
main.contacts-page-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
}
main.contacts-page-wrap .top,
main.contacts-page-wrap #impersonate-banner:empty { display: none; }
main.contacts-page-wrap #page {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 15% -15%, rgba(69,132,235,.06), transparent 28%),
    #f4f7fb;
}

.contacts-page { padding-bottom: 24px; min-height: 100%; color: #243746; }

/* Contatos — tema claro (sem herdar .panel / .card escuros) */
main.contacts-page-wrap .contacts-panel {
  margin: 0 16px 16px !important;
  padding: 14px !important;
  background: #fff !important;
  border: 1px solid #e0e7ef !important;
  box-shadow: 0 1px 2px rgba(28,53,78,.025);
  color: #243746 !important;
}
main.contacts-page-wrap .contacts-topline > div:first-child > b {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a5f !important;
}
main.contacts-page-wrap .contacts-search-actions .search {
  background: #fff !important;
  border: 1px solid #d9e0e6 !important;
  color: #243746 !important;
}
main.contacts-page-wrap .contacts-search-actions .search::placeholder {
  color: #9aa7b5;
}
main.contacts-page-wrap .contacts-search-actions button.soft {
  background: #f0f4f8 !important;
  color: #33404d !important;
  border: 1px solid #d7e0ea !important;
}
main.contacts-page-wrap .contacts-cards > .contact-simple-card,
main.contacts-page-wrap .contact-simple-card {
  background: #fff !important;
  border: 1px solid #e0e6ec !important;
  color: #243746 !important;
  box-shadow: 0 1px 2px rgba(20,40,70,.03);
}
main.contacts-page-wrap .contact-simple-card b,
main.contacts-page-wrap .contact-simple-head > b {
  color: #243746 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}
main.contacts-page-wrap .contact-simple-data span {
  color: #80909e !important;
}
main.contacts-page-wrap .contact-simple-data strong {
  color: #26384a !important;
}
main.contacts-page-wrap .contact-actions .soft {
  background: #f0f4f8 !important;
  color: #33404d !important;
  border: 1px solid #d7e0ea !important;
}
main.contacts-page-wrap .contact-delete-btn {
  background: #fff5f5 !important;
  color: #c04545 !important;
  border: 1px solid #f0c9c9 !important;
}
main.contacts-page-wrap .contacts-page .empty {
  color: #7a8794 !important;
  background: #f8fafc !important;
}
.contacts-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.contacts-topline > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.contacts-topline > div:first-child > b {
  font-size: 13px;
  color: #1e3a5f !important;
}
#contacts-total-count {
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  text-align: center;
  background: #e9f4ff;
  color: #1879c9;
  font-size: 12px;
  font-weight: 800;
}
.contacts-search-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.contacts-search-actions .search {
  min-width: 200px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  padding: 9px 12px;
}
.contacts-cards.cards {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)) !important;
  gap: 12px !important;
  margin-top: 10px;
}
.contact-simple-card {
  position: relative;
  min-height: 178px;
  padding: 12px !important;
  padding-top: 38px !important;
  overflow: hidden;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e0e6ec;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20,40,70,.03);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.contact-simple-card:hover {
  transform: translateY(-1px);
  border-color: #cfe0f5;
  box-shadow: 0 8px 22px rgba(28,53,78,.08);
}
.contact-simple-card.is-selected {
  border-color: #7aa8e8;
  background: #f7fbff;
  box-shadow: 0 0 0 1px rgba(45,105,202,.12);
}
.contact-select-wrap {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.contact-select-wrap input {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #2d69ca;
}
.contacts-selection-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f7faff;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
}
.contacts-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 600;
  color: #243746;
  cursor: pointer;
}
.contacts-select-all-label input {
  width: 17px;
  height: 17px;
  accent-color: #2d69ca;
}
.contacts-selected-count {
  font-size: .84rem;
  color: #5f7384;
  font-weight: 600;
}
.contacts-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.contacts-bulk-actions .danger:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.contact-simple-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin-bottom: 12px;
}
.contact-simple-head > b {
  min-width: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  color: #243746 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-simple-data {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 88px;
}
.contact-simple-data > div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 7px;
  align-items: start;
  min-width: 0;
}
.contact-simple-data span {
  color: #80909e;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
}
.contact-simple-data strong {
  color: #26384a;
  font-size: 12px;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.contact-actions {
  margin-top: 12px;
  gap: 6px;
  flex-wrap: wrap;
}
.contact-actions .soft,
.contact-actions .danger {
  font-size: .78rem;
  padding: 7px 10px;
}
.contact-delete-btn {
  border: 1px solid #f0c9c9;
  background: #fff5f5;
  color: #c04545;
  border-radius: 8px;
  cursor: pointer;
}
.contact-delete-btn:hover { background: #ffe8e8; }
.contacts-page .empty {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: #7a8794;
  background: #f8fafc;
  border: 1px dashed #d7e0ea;
  border-radius: 12px;
}
.app-modal .field {
  margin-bottom: 12px;
}
.app-modal .field label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  color: #6a7b8c;
}
.app-modal .field label.perm-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: 0;
  color: #24313f;
  cursor: pointer;
}
.app-modal .field label.perm-check + label.perm-check {
  margin-top: 6px;
}
.app-modal .field label.perm-check:hover {
  background: #f5f8fb;
}
.app-modal .field label.perm-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--sidebar-color);
}
.app-modal .field .perm-note {
  display: block;
  margin-top: 8px;
  font-size: .78rem;
  color: #6a7b8c;
}
.app-modal .field input,
.app-modal .field select,
.app-modal .field textarea {
  width: 100%;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  padding: 10px 11px;
  font-size: .9rem;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .contacts-topline {
    align-items: flex-start;
    flex-direction: column;
  }
  .contacts-search-actions { width: 100%; }
  .contacts-search-actions .search { flex: 1; min-width: 0; width: 100%; }
  .contacts-bulk-actions { width: 100%; margin-left: 0; }
}

/* ===== Respostas r�pidas (paridade desktop / v�deo) ===== */
main.replies-page-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
}
main.replies-page-wrap .top,
main.replies-page-wrap #impersonate-banner:empty { display: none; }
main.replies-page-wrap #page {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 15% -15%, rgba(69,132,235,.06), transparent 28%),
    #f4f7fb;
}
.replies-page { padding-bottom: 24px; min-height: 100%; }
.replies-panel {
  margin: 0 16px 16px !important;
  padding: 16px 18px !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
  border-radius: 14px;
}
.replies-topline {
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.replies-topline .preview {
  margin-top: 4px;
  color: #71808d;
  font-size: .8rem;
}
.quick-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-manage-item {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #dce5ec;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
  min-height: 64px;
}
.quick-color-bar {
  width: 5px;
  height: 100%;
  min-height: 64px;
  background: var(--quick-color, var(--brand));
}
.quick-manage-content {
  min-width: 0;
  padding: 9px 0;
}
.quick-manage-content b {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
  color: #243746;
}
.quick-manage-content span {
  display: block;
  color: #667888;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-manage-actions {
  display: flex;
  gap: 6px;
  padding-right: 10px;
}
.quick-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.quick-color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.quick-color-dot.selected {
  border-color: #263747;
  box-shadow: inset 0 0 0 2px #fff;
}
.quick-color-picker input[type=color] {
  width: 34px;
  height: 30px;
  padding: 1px;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  background: #fff;
}
.quick-preview-box { margin: 12px 0 4px; }
.quick-preview-box > small {
  display: block;
  font-size: 9px;
  color: #82909c;
  margin-bottom: 5px;
  letter-spacing: .4px;
  font-weight: 700;
}
.quick-preview-item {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
}
.quick-preview-color {
  width: 6px;
  height: 42px;
  border-radius: 5px;
  background: var(--quick-color, var(--brand));
  flex-shrink: 0;
}
.quick-preview-item b {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #243746;
}
.quick-preview-item div span {
  display: block;
  font-size: 10px;
  color: #6c7b89;
  margin-top: 2px;
}
.field-help {
  display: block;
  margin-top: 6px;
  color: #82909c;
  font-size: .75rem;
}
.replies-page .empty {
  padding: 24px;
  text-align: center;
  color: #7a8794;
  background: #f8fafc;
  border: 1px dashed #d7e0ea;
  border-radius: 12px;
}

/* ===== Disparos (paridade desktop/video) ===== */
.campaign-page,.campaign-editor-page{padding:0 0 24px;min-height:100%}
.campaign-head,.campaign-editor-top{
  align-items:center;gap:15px;margin-bottom:12px
}
.campaign-head{display:flex;justify-content:space-between}
.campaign-head h2,.campaign-editor-top h2{margin:0;font-size:20px}
.campaign-head p,.campaign-editor-top p{margin:4px 0 0;color:#738291;font-size:11px}
.campaign-example{
  padding:10px 12px;margin-bottom:12px;border:1px solid #cfe0f5;background:#f3f8fe;
  border-radius:8px;color:#526b87;font-size:11px
}
.campaign-list{display:flex;flex-direction:column;gap:10px}
.campaign-card{padding:14px!important}
.campaign-card-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.campaign-card h3{margin:0 0 5px;font-size:15px}
.campaign-card-actions{display:flex;flex-wrap:wrap;gap:5px;justify-content:flex-end}
.campaign-status{display:inline-flex;border-radius:999px;padding:4px 8px;font-size:9px;font-weight:800}
.campaign-status-draft{background:#edf2f7;color:#526170}
.campaign-status-running{background:#dcf7e8;color:#087947}
.campaign-status-paused{background:#fff3d7;color:#9a6200}
.campaign-status-completed{background:#e6f0ff;color:#2862b8}
.campaign-status-cancelled{background:#ffe8e8;color:#b12c2c}
.campaign-metrics{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0 8px}
.campaign-metrics span{padding:6px 9px;border:1px solid #dce5ec;border-radius:7px;font-size:10px;color:#657586}
.campaign-metrics b{color:#245db5;font-size:12px}
.campaign-progress{height:7px;background:#edf1f5;border-radius:999px;overflow:hidden}
.campaign-progress span{display:block;height:100%;background:#32a46b;border-radius:999px}
.campaign-config-summary{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}
.campaign-config-summary span{font-size:9px;color:#697a8a;background:#f5f7f9;padding:4px 6px;border-radius:5px}
.campaign-next{font-size:9px;color:#51729a;margin-top:8px}
.campaign-error{font-size:9px;color:#b42318;background:#fff0f0;padding:6px;border-radius:6px;margin-top:7px}
.campaign-empty{padding:30px!important}
.campaign-editor-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(320px,.7fr);gap:14px}
.campaign-editor-main,.campaign-contact-panel{padding:14px!important}
.campaign-speed-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.input-suffix{display:grid;grid-template-columns:1fr auto;align-items:center;border:1px solid #d8e1e9;border-radius:7px;overflow:hidden}
.input-suffix input{border:0!important;border-radius:0!important}
.input-suffix span{padding:0 10px;color:#71808d;font-size:10px}
.campaign-example-box{display:flex;flex-direction:column;gap:4px;padding:10px;background:#f3f8fe;border:1px solid #d2e2f4;border-radius:8px;font-size:10px}
.campaign-contact-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}
.campaign-contact-head h3{margin:0;font-size:15px}
.campaign-contact-head small{color:#71808d}
.campaign-select-actions{display:flex;gap:5px}
.campaign-contact-list{max-height:570px;overflow:auto;margin-top:8px;border:1px solid #e0e7ed;border-radius:8px}
.campaign-contact-item{
  display:grid;grid-template-columns:auto 38px minmax(0,1fr);gap:8px;align-items:center;
  padding:9px;border-bottom:1px solid #e7edf2;cursor:pointer
}
.campaign-contact-item:last-child{border-bottom:0}
.campaign-contact-item:hover{background:#f7faff}
.campaign-contact-item input{width:17px;height:17px}
.campaign-contact-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#eaf2ff;color:#2d69ca;font-weight:700}
.campaign-contact-item b{display:block;font-size:11px}
.campaign-contact-item small{display:block;color:#788895;font-size:9px;margin-top:2px}
.campaign-contact-item span{display:inline-block;color:var(--brand);background:var(--brand-soft);padding:2px 5px;border-radius:4px;font-size:8px;margin-top:3px}
.campaign-attachments{display:flex;flex-direction:column;gap:6px;margin-bottom:7px}
.campaign-attachment-item{display:grid;grid-template-columns:28px 1fr auto;gap:7px;align-items:center;padding:7px;border:1px solid #dce5ec;border-radius:7px;background:#f9fbfd}
.campaign-attachment-item b{display:block;font-size:10px}
.campaign-attachment-item small{display:block;font-size:8px;color:#7d8b97}
.campaign-attachment-item button{width:26px;height:26px;padding:0}
.campaign-no-attachment{font-size:9px;color:#82909c;padding:7px;border:1px dashed #c7d1d9;border-radius:7px}
button.warn{background:#fff0c7!important;color:#8d5a00!important;border-color:#f1d58a!important}
@media(max-width:1100px){
  .campaign-editor-grid{grid-template-columns:1fr}
  .campaign-speed-grid{grid-template-columns:1fr}
}
.campaign-date-field,
.campaign-time-field { margin: 0; }
.campaign-date-field input { max-width: 100%; }
#campaign-mark-all{background:#1b8ee0!important}
.campaign-schedule-grid{
  display:grid;
  grid-template-columns:minmax(220px,1fr) minmax(180px,.65fr);
  gap:12px;
  align-items:end;
}
main.campaigns-page-wrap .field input::placeholder,
main.campaigns-page-wrap .field textarea::placeholder,
main.campaigns-page-wrap .search::placeholder {
  color: #9aa7b5;
}
.campaign-schedule-grid input[type="date"],
.campaign-schedule-grid input[type="time"] {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  font-size: .9rem;
}
.campaign-queue-info{
  margin-top:2px;
  padding:11px 13px;
  border:1px solid #cfe0f7;
  background:#eef6ff;
  border-radius:10px;
  color:#365978;
  font-size:12px;
  line-height:1.45;
}
.campaign-status-scheduled{
  background:#eaf2ff!important;
  color:#245bc5!important;
  border-color:#bfd3fa!important;
}
.campaign-status-scheduled::before{
  content:'?';
  margin-right:5px;
  color:#4381ee;
}
@media(max-width:760px){
  .campaign-schedule-grid{
    grid-template-columns:1fr;
  }
}
.campaign-status-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:5px;
}
.campaign-state-indicator{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 9px;
  border-radius:9px;
  font-weight:800!important;
  border:1px solid transparent;
}
.campaign-state-done{
  color:#087a43!important;
  background:#e7f8ef;
  border-color:#9fe0bd;
}
.campaign-state-running{
  color:#9a6700!important;
  background:#fff5cf;
  border-color:#f2d66f;
}
.campaign-state-stopped{
  color:#c62828!important;
  background:#ffeded;
  border-color:#efaaaa;
}
.campaign-state-queued{
  color:#205bc2!important;
  background:#eaf2ff;
  border-color:#b9d0fb;
}
.campaign-state-draft{
  color:#647485!important;
  background:#f0f3f6;
  border-color:#d5dde5;
}

/* Disparos — web SaaS (tema claro, sem .panel escuro) */
main.campaigns-page-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
  color: #243746;
}
main.campaigns-page-wrap .top,
main.campaigns-page-wrap #impersonate-banner:empty { display: none; }
main.campaigns-page-wrap #page {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 15% -15%, rgba(69,132,235,.06), transparent 28%),
    #f4f7fb;
  color: #243746;
}
.campaign-page,
.campaign-editor-page {
  padding: 0 0 24px;
  min-height: 100%;
  color: #243746;
}
main.campaigns-page-wrap .campaign-box {
  background: #fff !important;
  border: 1px solid #e0e7ef !important;
  border-radius: 14px;
  color: #243746 !important;
  box-shadow: 0 1px 2px rgba(28,53,78,.025);
}
.campaign-head,
.campaign-example,
.campaign-list {
  margin-left: 16px;
  margin-right: 16px;
}
.campaign-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px !important;
  margin-bottom: 12px;
}
.campaign-head h2,
.campaign-editor-top h2 {
  margin: 0;
  color: #1f2937 !important;
  font-size: 1.15rem;
  font-weight: 700;
}
.campaign-head p,
.campaign-editor-top p {
  margin: 4px 0 0;
  color: #71808d !important;
  font-size: .82rem;
  line-height: 1.45;
}
.campaign-editor-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 0 16px 14px;
  margin-bottom: 0;
}
.campaign-editor-top > div { min-width: 0; }
.campaign-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  gap: 14px;
  margin: 0 16px 16px;
  min-width: 0;
  align-items: start;
}
.campaign-editor-grid > * { min-width: 0; box-sizing: border-box; }
.campaign-editor-main,
.campaign-contact-panel {
  padding: 16px !important;
  display: flex;
  flex-direction: column;
  gap: 0;
}
main.campaigns-page-wrap .field {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 14px;
  min-width: 0;
}
main.campaigns-page-wrap .field > label {
  display: block;
  margin-bottom: 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #6a7b8c !important;
  text-transform: uppercase;
}
main.campaigns-page-wrap input,
main.campaigns-page-wrap textarea,
main.campaigns-page-wrap select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff !important;
  border: 1px solid #d9e0e6 !important;
  color: #243746 !important;
  border-radius: 8px;
  padding: 10px 11px;
  font-size: .9rem;
  font-family: inherit;
}
main.campaigns-page-wrap .field textarea {
  display: block;
  min-height: 160px;
  resize: vertical;
  line-height: 1.45;
}
main.campaigns-page-wrap .field small {
  display: block;
  margin-top: 5px;
  color: #71808d !important;
  font-size: .78rem;
  line-height: 1.4;
}
main.campaigns-page-wrap button.soft {
  background: #f0f4f8 !important;
  color: #33404d !important;
  border: 1px solid #d7e0ea !important;
}
main.campaigns-page-wrap .search {
  width: 100%;
  background: #fff !important;
  border: 1px solid #d9e0e6 !important;
  color: #243746 !important;
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 8px;
  box-sizing: border-box;
}
main.campaigns-page-wrap .input-suffix {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  background: #fff;
  border: 1px solid #d8e1e9;
  border-radius: 8px;
  overflow: hidden;
}
main.campaigns-page-wrap .input-suffix input {
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}
main.campaigns-page-wrap .input-suffix span {
  padding: 0 12px;
  color: #71808d;
  font-size: .82rem;
  white-space: nowrap;
}
.campaign-speed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.campaign-speed-grid .field { margin-bottom: 0; }
.campaign-schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  width: 100%;
}
.campaign-schedule-grid .field { margin-bottom: 0; }
.campaign-schedule-grid input[type="date"],
.campaign-schedule-grid input[type="time"] {
  min-height: 42px;
  font-size: .9rem;
}
.campaign-queue-info {
  margin: 4px 0 14px;
  padding: 11px 13px;
  border: 1px solid #cfe0f7;
  background: #eef6ff !important;
  border-radius: 10px;
  color: #365978 !important;
  font-size: .82rem;
  line-height: 1.45;
}
.campaign-example-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #f3f8fe !important;
  border: 1px solid #d2e2f4;
  border-radius: 8px;
  font-size: .82rem;
  color: #526b87 !important;
}
.campaign-example-box b { color: #365978; }
.campaign-card h3 { color: #243746 !important; }
.campaign-card .muted { color: #71808d !important; }
.campaign-contact-head h3 { color: #243746 !important; }
.campaign-contact-head small { color: #71808d !important; }
.campaign-contact-item b { color: #243746 !important; }
.campaign-no-attachment {
  color: #82909c !important;
  background: #f8fafc !important;
  border: 1px dashed #c7d1d9;
  border-radius: 7px;
  padding: 8px;
}
.campaign-empty {
  padding: 30px !important;
  text-align: center;
  color: #71808d !important;
}
@media (max-width: 760px) {
  .campaign-editor-top { grid-template-columns: 1fr; }
  .campaign-editor-top #campaign-save { width: 100%; }
  .campaign-schedule-grid,
  .campaign-speed-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .campaign-editor-grid { grid-template-columns: 1fr; }
}

/* ===== Configuracoes (paridade desktop/video) ===== */
.settings-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(310px,1fr));
  gap:14px;
  padding:16px;
}
.settings-card h3{
  margin:0 0 7px;
  font-size:17px;
}
.settings-card p{
  color:#6e7d8a;
  font-size:13px;
  line-height:1.45;
}
.logo-settings-row{
  display:flex;
  align-items:center;
  gap:14px;
  margin-top:14px;
}
.logo-preview{
  width:78px;
  height:78px;
  border-radius:18px;
  background:#1d5dcc;
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:800;
  font-size:28px;
  overflow:hidden;
}
.logo-preview img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.logo-settings-row>div:last-child{
  display:flex;
  flex-direction:column;
  gap:7px;
}
.saved-device{
  margin-top:14px;
  padding:12px;
  border:1px solid #dce5ec;
  border-radius:9px;
  background:#f8fafc;
  display:flex;
  flex-direction:column;
  gap:5px;
  font-size:13px;
}
.settings-note{
  font-size:11px!important;
}
.config-bot-toggle{
  margin:14px 0;
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:700;
  color:#32516e;
}
.config-bot-toggle{
  padding:12px 14px;
  border-radius:10px;
  background:#f2f4f7;
  border:1px solid #dfe5eb;
}
.config-bot-toggle:has(input:checked){
  background:#e7f8ee;
  border-color:#b7e6ca;
  color:#087a47;
}
.config-bot-toggle input{
  width:18px;
  height:18px;
}
.attendant-example{
  margin:10px 0 12px;
  padding:11px 12px;
  border:1px solid #dce5ec;
  border-radius:9px;
  background:#f6fbff;
  display:flex;
  flex-direction:column;
  gap:3px;
  font-size:12px;
}
.attendant-example small{
  color:#748391;
}
.attendant-example b{
  color:#20364d;
  font-size:13px;
}
.attendant-example span{
  color:#405467;
}
.chat-color-block{
  margin:12px 0 14px;
}
.chat-color-block label{
  display:block;
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.04em;
  color:#5a6d7e;
  margin-bottom:8px;
  text-transform:uppercase;
}
.chat-color-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.chat-color-row input[type=color]{
  width:44px;
  height:36px;
  padding:2px;
  border:1px solid #d9e0e6;
  border-radius:8px;
  background:#fff;
  cursor:pointer;
}
.chat-color-presets{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.chat-swatch{
  width:28px;
  height:28px;
  border-radius:50%;
  border:2px solid #d7e0ea;
  cursor:pointer;
  padding:0;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);
}
.chat-swatch.active{
  border-color:var(--brand);
  box-shadow:0 0 0 2px rgba(37,99,235,.25);
}
.chat-bubble-preview{
  margin-top:10px;
  padding:14px;
  border-radius:10px;
  background:var(--chat-bg,#f5efe7);
  border:1px solid #e5e0d6;
}
.chat-bubble-preview-msg{
  max-width:92%;
  margin-left:auto;
  padding:8px 11px;
  border-radius:8px;
  display:flex;
  flex-direction:column;
  gap:4px;
  box-shadow:0 1px 2px rgba(0,0,0,.08);
  color:#24313d;
  font-size:.86rem;
}
.chat-bubble-preview-msg b{font-size:.82rem}
.ui-palette-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(118px,1fr));
  gap:8px;
  margin:10px 0 14px;
}
.ui-palette-btn{
  border:1px solid #d7e0ea;
  border-radius:10px;
  background:#fff;
  padding:8px;
  cursor:pointer;
  text-align:left;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.ui-palette-btn:hover{border-color:#b8c9de;background:#f8fbff}
.ui-palette-btn.active{
  border-color:var(--brand);
  box-shadow:0 0 0 2px rgba(37,99,235,.18);
}
.ui-palette-strip{
  height:22px;
  border-radius:6px;
  background:linear-gradient(180deg,var(--preview-sidebar,var(--brand)),var(--preview-sidebar-dark,var(--brand)));
}
.ui-palette-icons{
  display:flex;
  gap:6px;
  align-items:center;
}
.ui-palette-icons span{
  width:18px;
  height:18px;
  border-radius:50%;
  background:var(--preview-icon,var(--brand));
  opacity:.92;
}
.ui-palette-btn small{
  font-size:.72rem;
  color:#5f7080;
  font-weight:700;
}
.ui-theme-preview{
  display:grid;
  grid-template-columns:72px 1fr;
  gap:10px;
  margin-top:12px;
  padding:12px;
  border:1px solid #e0e7ef;
  border-radius:10px;
  background:#f8fafc;
}
.ui-theme-preview-side{
  border-radius:8px;
  min-height:88px;
  background:linear-gradient(180deg,var(--preview-sidebar,var(--brand)),var(--preview-sidebar-dark,var(--brand)));
}
.ui-theme-preview-tools{
  display:flex;
  align-items:center;
  gap:8px;
  padding-top:8px;
}
.ui-theme-preview-tools svg{
  width:20px;
  height:20px;
  fill:var(--preview-icon,var(--brand));
}
.ui-theme-preview-send{
  width:28px;
  height:28px;
  border-radius:50%;
  background:var(--preview-icon,var(--brand));
  margin-left:auto;
}
.wa-session-current{
  display:flex;align-items:center;gap:10px;padding:11px 12px;margin:12px 0;
  background:#f8fafc;border:1px solid #dce5ec;border-radius:9px
}
.wa-session-current>div{display:flex;flex-direction:column;gap:3px}
.wa-session-current b{font-size:13px;color:#273b4e}
.wa-session-current small{font-size:10px;color:#748391}
.wa-session-indicator{width:13px;height:13px;border-radius:50%;flex:0 0 auto}
.wa-session-indicator.enabled{background:#16a765;box-shadow:0 0 0 5px #16a76518}
.wa-session-indicator.disabled{background:#a6b0ba;box-shadow:0 0 0 5px #77889914}
.wa-session-controls{display:flex;flex-direction:column;border:1px solid #e0e7ed;border-radius:9px;overflow:hidden}
.wa-setting-toggle{
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;
  padding:12px;background:#fff;border-bottom:1px solid #e8edf1
}
.wa-setting-toggle:last-child{border-bottom:0}
.wa-setting-toggle>div{display:flex;flex-direction:column;gap:3px}
.wa-setting-toggle b{font-size:12px;color:#2d4052}
.wa-setting-toggle small{font-size:10px;color:#7b8996}
.wa-setting-toggle input{width:40px;height:20px;cursor:pointer}
.wa-session-buttons{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}
.wa-session-buttons button{min-height:38px}
.wa-session-buttons .wa-new-qr{grid-column:1/-1;background:#e75b28!important;color:#fff!important}
.wa-session-help{
  margin-top:10px;padding:9px 10px;border-radius:8px;background:#f1f6fd;
  border:1px solid #d4e2f4;color:#5b6e82;font-size:10px;line-height:1.4
}
.config-bot-qr{
  margin-top:14px;
  padding:14px 12px;
  text-align:center;
  min-height:120px;
  border:1px dashed #c9d7e6;
  border-radius:12px;
  background:#f8fbfe;
}
.config-bot-qr.hidden{display:none!important}
.config-bot-qr img{
  width:260px;
  height:260px;
  max-width:100%;
  background:#fff;
  padding:8px;
  border-radius:8px;
  box-sizing:border-box;
}
.config-bot-qr p{margin:10px 0 0;color:#5b6e82}
.config-bot-qr .muted{color:#7b8996;font-size:12px;line-height:1.45}
@media(max-width:1200px){.whatsapp-session-card{grid-column:span 1}}

.sync-status-box{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:10px 0;
}
.sync-status-box>div{
  padding:9px;
  border:1px solid #dce5ed;
  border-radius:8px;
  background:#f8fafc;
}
.sync-status-box span{
  display:block;
  font-size:8px;
  color:#7b8996;
  margin-bottom:3px;
  text-transform:uppercase;
}
.sync-status-box b{
  display:block;
  font-size:10px;
  color:#324a61;
}
.sync-last-stats{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-bottom:9px;
}
.sync-last-stats span{
  padding:5px 7px;
  border-radius:6px;
  background:#edf6ff;
  color:#3e678c;
  font-size:8px;
}
@media(max-width:900px){
  .sync-status-box{grid-template-columns:1fr}
}

.status-history-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.status-delete-wa-btn,.status-replace-btn{
  border:0;border-radius:9px;padding:8px 10px;font-weight:700;cursor:pointer
}
.status-delete-wa-btn{background:#fff0f0;color:#c62828}
.status-delete-wa-btn:hover{background:#ffe1e1}
.status-replace-btn{background:var(--brand-soft);color:#2459c4}
.status-replace-btn:hover{background:#dfeaff}
.status-replacing{outline:2px solid var(--brand);box-shadow:0 0 0 5px rgba(79,125,243,.10)}

.queue-cleanup-card{grid-column:span 1}
.queue-cleanup-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}
.queue-cleanup-stats>div{border:1px solid #dbe5f3;border-radius:12px;padding:12px;background:#f8fbff;display:flex;align-items:center;justify-content:space-between}
.queue-cleanup-stats span{font-size:13px;font-weight:800;color:#5e6d82}
.queue-cleanup-stats b{font-size:22px;color:#17365d}
.queue-cleanup-actions{display:grid;gap:9px}
.queue-cleanup-actions button{width:100%;min-height:42px}
.queue-cleanup-actions .queue-attend-all{background:#16a34a;color:#fff;border:0;border-radius:8px;font-weight:700;cursor:pointer}
.queue-cleanup-actions .queue-attend-all:hover:not(:disabled){background:#15803d}
.queue-cleanup-actions .queue-attend-all:disabled{opacity:.55;cursor:not-allowed}
.queue-clear-all{font-weight:800}
.queue-cleanup-note{margin-top:12px;padding:11px 12px;border-radius:10px;background:#fff8e8;border:1px solid #f5df9c;color:#665018;font-size:13px;line-height:1.45}

/* Configurações — tema claro legível (não herdar .panel escuro) */
.settings-page { padding: 0; color: #1e293b; }
main.config-page-wrap {
  background: var(--main-bg, #f2f6fb) !important;
  color: #1e293b;
}
main.config-page-wrap .top { margin-bottom: 8px; }
main.config-page-wrap .top h1 { color: #0f172a; }
main.config-page-wrap .top p { color: #64748b !important; }

main.config-page-wrap .settings-card.panel,
main.config-page-wrap .panel.settings-card {
  padding: 16px 18px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  color: #1e293b !important;
  border-radius: 14px;
}
main.config-page-wrap .settings-card h3 {
  color: #0f172a !important;
  font-weight: 700;
  margin: 0 0 8px;
  font-size: 1.05rem;
}
main.config-page-wrap .settings-card p {
  color: #334155 !important;
  line-height: 1.5;
}
main.config-page-wrap .settings-card .settings-note,
main.config-page-wrap .settings-card small,
main.config-page-wrap .settings-card .muted {
  color: #475569 !important;
}
main.config-page-wrap .settings-card label {
  color: #334155 !important;
  font-weight: 600;
}
main.config-page-wrap .settings-card input:not([type="checkbox"]):not([type="color"]):not([type="file"]),
main.config-page-wrap .settings-card textarea,
main.config-page-wrap .settings-card select {
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
main.config-page-wrap .settings-card input::placeholder,
main.config-page-wrap .settings-card textarea::placeholder {
  color: #94a3b8 !important;
}
main.config-page-wrap .settings-card button.soft {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
main.config-page-wrap .settings-card button.primary {
  background: var(--brand) !important;
  color: #fff !important;
}
main.config-page-wrap .settings-card button.danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c !important;
}
main.config-page-wrap .settings-saas-card {
  border-style: dashed !important;
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
}
main.config-page-wrap .saved-device,
main.config-page-wrap .attendant-example,
main.config-page-wrap .sync-status-box,
main.config-page-wrap .wa-session-current,
main.config-page-wrap .wa-session-help,
main.config-page-wrap .config-bot-toggle {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}
main.config-page-wrap .wa-session-current b,
main.config-page-wrap .attendant-example b,
main.config-page-wrap .sync-status-box b {
  color: #0f172a !important;
}
main.config-page-wrap .wa-session-current small,
main.config-page-wrap .attendant-example small,
main.config-page-wrap .sync-status-box span {
  color: #64748b !important;
}
main.config-page-wrap .wa-session-controls {
  border-color: #e2e8f0 !important;
  background: #fff !important;
}
main.config-page-wrap .wa-setting-toggle {
  background: #fff !important;
  color: #1e293b !important;
  border-color: #e2e8f0 !important;
}
main.config-page-wrap .wa-setting-toggle b { color: #0f172a !important; }
main.config-page-wrap .wa-setting-toggle small { color: #64748b !important; }
main.config-page-wrap .ui-palette-btn {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}
main.config-page-wrap .ui-palette-btn small { color: #475569 !important; }
main.config-page-wrap .ui-palette-btn.active {
  border-color: var(--brand) !important;
  background: #eff6ff !important;
}
main.config-page-wrap .queue-cleanup-stats > div {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
main.config-page-wrap .queue-cleanup-stats span { color: #64748b !important; }
main.config-page-wrap .queue-cleanup-stats b { color: #0f172a !important; }
main.config-page-wrap .field label { color: #334155 !important; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ===== Avisos (paridade desktop/video) ===== */
.qtabs button{position:relative;overflow:visible!important}
.tab-unread-alert{
  position:absolute;
  right:4px;
  top:-10px;
  min-width:25px;
  height:25px;
  padding:0 6px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#ef2b2d;
  color:#fff;
  border:2px solid #fff;
  font-size:11px!important;
  font-weight:800;
  box-shadow:0 2px 7px #a4131340;
  z-index:6;
}
/* V5.8 - alertas das filas atualizados em tempo real */
.qtabs [data-f]{
  position:relative;
}
.qtabs .tab-unread-alert{
  transition:transform .12s ease, opacity .12s ease;
}
/* V5.9 - bloco Atendimento apenas entrega para humano */
.attendance-handoff-box{
  padding:10px;
  border:1px solid #cfe0f5;
  background:#f2f7fd;
  border-radius:8px;
}
.attendance-handoff-box b{
  display:block;
  margin-bottom:4px;
  font-size:11px;
  color:#2d5f9d;
}
.attendance-handoff-box small{
  display:block;
  font-size:9px;
  line-height:1.4;
  color:#6c7d8e;
}
/* V5.11 - estado terminal do fluxo: aguardando humano */
.handoff-waiting-alert{
  margin:10px 0;
  padding:10px;
  border:1px solid #f0d69a;
  border-radius:8px;
  background:#fff8e8;
}
.handoff-waiting-alert b{
  display:block;
  font-size:11px;
  color:#8b6105;
  margin-bottom:4px;
}
.handoff-waiting-alert small{
  display:block;
  font-size:9px;
  line-height:1.4;
  color:#7f7150;
}
.absence-box{
  display:grid;
  gap:11px;
}
.absence-status-line{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px 11px;
  border-radius:10px;
  border:1px solid #dfe7ef;
}
.absence-box.active .absence-status-line{
  background:#fff7e5;
  border-color:#f2cc7a;
}
.absence-box.inactive .absence-status-line{
  background:#f5f7f9;
}
.absence-status-dot{
  width:12px;
  height:12px;
  border-radius:50%;
  flex:0 0 12px;
  margin-top:3px;
  background:#9aa8b5;
}
.absence-box.active .absence-status-dot{
  background:#f59e0b;
  box-shadow:0 0 0 4px rgba(245,158,11,.14);
}
.absence-status-line>div{
  display:grid;
  gap:3px;
}
.absence-status-line b{
  font-size:12px;
}
.absence-status-line small{
  color:#657787;
  line-height:1.35;
}
.absence-label{
  font-size:11px;
  font-weight:800;
  color:#536779;
}
.absence-box textarea{
  min-height:115px!important;
  line-height:1.4!important;
}
.absence-help{
  padding:9px 10px;
  border-radius:9px;
  background:var(--brand-soft);
  color:#405a73;
  font-size:10px;
  line-height:1.45;
}
.bot-sidebar button[data-newstep="absence"] span{
  font-size:18px;
}

.hidden { display: none !important; }
.att-tabs button { overflow: visible !important; }
.handoff-waiting-alert { margin: 10px 0; }
.absence-toggle { margin-top: 4px; }

/* ===== Backup (paridade desktop/video) ===== */
.backup-page{
  padding:16px;
}
.backup-hero{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  margin-bottom:14px;
}
.backup-hero h2{
  margin:0;
  font-size:20px;
}
.backup-hero p{
  margin:5px 0 0;
  color:#71808d;
  font-size:12px;
}
.backup-stats{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.backup-stats span{
  border:1px solid #dce5ec;
  background:#f8fafc;
  padding:8px 11px;
  border-radius:8px;
  color:#607183;
  font-size:11px;
}
.backup-stats b{
  color:#2059bd;
  font-size:14px;
}
.backup-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:14px;
}
.backup-card{
  padding:18px!important;
}
.backup-icon{
  width:42px;
  height:42px;
  border-radius:10px;
  background:#eaf2ff;
  color:#2f6edb;
  display:grid;
  place-items:center;
  font-size:24px;
  font-weight:700;
  margin-bottom:10px;
}
.backup-card h3{
  margin:0 0 5px;
  font-size:17px;
}
.backup-card>p{
  margin:0 0 12px;
  color:#71808d;
  font-size:12px;
  line-height:1.45;
}
.backup-includes{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:12px 0;
  padding:11px;
  background:#f5fbf8;
  border:1px solid #d1eadc;
  border-radius:9px;
}
.backup-includes span{
  font-size:11px;
  color:#3b6850;
}
.backup-warning{
  background:#fff6ed;
  border:1px solid #f0d5ba;
  color:#85501c;
  padding:10px;
  border-radius:8px;
  font-size:11px;
  line-height:1.4;
  margin:12px 0;
}
.backup-main-btn{
  width:100%;
  min-height:42px;
  margin-top:8px;
}

main.backup-page-wrap .top { margin-bottom: 8px; }
.backup-page { padding: 0; }
.backup-card small { display: block; margin-top: 10px; color: #82909c; font-size: .75rem; }
@media (max-width: 900px) {
  .backup-hero { flex-direction: column; align-items: flex-start; }
}

/* ===== Tags Atendentes (paridade desktop/video) ===== */
.license-result{
  margin-top:14px;
  padding:12px 13px;
  border:1px solid #dbe4ed;
  border-radius:12px;
  background:#f5f8fb;
  color:#5b7084;
}
.license-result.ok{
  background:#ecf9f2;
  border-color:#c5e9d7;
  color:#157a4d;
  font-weight:700;
}
.attendant-tag{
  --att-color:#2563c7;
  display:inline-flex;
  align-items:center;
  gap:5px;
  margin:3px 4px 0 0;
  padding:4px 8px;
  border-radius:999px;
  background:color-mix(in srgb,var(--att-color) 13%,white);
  border:1px solid color-mix(in srgb,var(--att-color) 35%,white);
  color:var(--att-color);
  font-size:11px;
  font-weight:700;
  line-height:1;
}
.attendant-tag-dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--att-color);
}

.tags-page { padding: 0; }
main.tags-page-wrap .top { margin-bottom: 8px; }
.tags-panel { padding: 16px !important; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.panel-head h3 { margin: 0 0 4px; font-size: 1.15rem; }
.panel-head p { margin: 0; color: #71808d; font-size: .82rem; line-height: 1.45; }
.tags-example {
  margin-bottom: 14px;
  padding: 12px 13px;
  border: 1px solid #c5e9d7;
  border-radius: 12px;
  background: #ecf9f2;
  color: #157a4d;
  font-size: .85rem;
  line-height: 1.45;
}
.tags-example b { color: #0f5c38; }
.tag-color-dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.08);
}
.tags-table td.actions {
  white-space: nowrap;
}
.tags-table td.actions button { margin-right: 6px; }
.tags-empty {
  padding: 28px;
  text-align: center;
  color: #82909c;
  background: #f8fafc;
  border: 1px dashed #d7e0ea;
  border-radius: 12px;
}
@media (max-width: 720px) {
  .panel-head { flex-direction: column; }
  .panel-head .primary { width: 100%; }
}


/* ===== App shell padrão (admin / revenda / cliente) — paridade Hotspot ===== */
/* Scroll da página inteira (sidebar acompanha), igual Hotspot */
body.app-scroll,
body:has(main.ops-shell-wrap) {
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}
body.app-scroll #app,
#app:has(main.ops-shell-wrap) {
  height: auto;
  max-height: none;
  min-height: 100vh;
  overflow: visible;
  align-items: stretch;
}
body.app-scroll .side,
#app:has(main.ops-shell-wrap) .side {
  height: auto;
  max-height: none;
  min-height: 100%;
  overflow: visible;
  align-self: stretch;
}
body.app-scroll .side nav,
#app:has(main.ops-shell-wrap) .side nav {
  flex: 0 0 auto;
  overflow: visible;
  min-height: 0;
}
body.app-scroll main,
body.app-scroll main.ops-shell-wrap {
  height: auto;
  max-height: none;
  overflow: visible;
}

/* Shell fixo (legado) — sidebar NUNCA cria scroll próprio no menu */
body.fixed-shell {
  height: 100%;
  overflow: hidden;
}
body.fixed-shell #app {
  height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
body.fixed-shell .side {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
body.fixed-shell .side nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden; /* sem scrollbar no menu */
}
body.fixed-shell main {
  height: 100%;
  overflow: auto;
}

/* App-scroll: sidebar cresce com a página (sem barra no menu) */
body.app-scroll .side,
body.ops-mode.app-scroll .side {
  height: auto !important;
  max-height: none !important;
  min-height: 100vh;
  overflow: visible !important;
}
body.app-scroll .side nav,
body.ops-mode.app-scroll .side nav {
  flex: 0 0 auto !important;
  overflow: visible !important;
  min-height: 0;
}
/* Mobile drawer: sobrescreve app-scroll — menu fixo com scroll interno */
@media (max-width: 900px) {
  body.app-scroll .side,
  body.ops-mode.app-scroll .side {
    height: calc(100dvh - 60px) !important;
    max-height: calc(100dvh - 60px) !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
}

/* Atendimentos/bot/fluxos: chat preenche a viewport; menu sem scroll interno */
body.app-scroll.ops-mode main.atendimentos-page {
  height: auto;
  max-height: none;
  min-height: 100dvh;
  overflow: visible;
}
body.app-scroll.ops-mode main.atendimentos-page > #page {
  flex: 1 1 auto;
  min-height: calc(100dvh - 72px);
  height: calc(100dvh - 72px);
  max-height: none;
  overflow: hidden;
}

/* Sidebar: só logo (sem nome), como Hotspot */
body.ops-mode .brand {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px 12px 16px;
  margin: 0;
}
body.ops-mode .brandtext { display: none !important; }
body.ops-mode .brand .logo {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80px;
  min-width: 64px;
  min-height: 48px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  padding: 6px 10px;
}
body.ops-mode .brand .logo span {
  font-size: 1.6rem;
  line-height: 1;
}
body.ops-mode .brand .logo img {
  width: auto !important;
  height: auto !important;
  max-height: 72px;
  max-width: 170px;
  object-fit: contain;
  border-radius: 8px;
}
body.ops-mode .side nav button.nav-logout { display: none !important; }

/*
 * Topbar ops (Hotspot): faixa full-bleed em TODAS as páginas.
 * Não usa margem negativa — páginas com padding:0 no main (dashboard etc.)
 * quebravam o topo (ficava espremido). Em ops-mode o main zera padding e
 * o conteúdo abaixo recebe espaçamento próprio.
 */
body.ops-mode main {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}
.ops-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin: 0;
  padding: 14px 20px;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(
    90deg,
    var(--ops-topbar-color, var(--sidebar-color)) 0%,
    var(--ops-topbar-color-dark, var(--sidebar-color-dark)) 100%
  );
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
  min-height: 64px;
}
.ops-topbar.hidden { display: none !important; }
.ops-topbar-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  margin-left: auto;
}
.ops-topbar-imp {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .84rem;
  line-height: 1.3;
  white-space: nowrap;
}
.ops-topbar-imp strong { font-weight: 800; }
.ops-topbar-back {
  appearance: none;
  border: 0;
  background: #f59e0b;
  color: #1f2937;
  font-weight: 700;
  font-size: .84rem;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.ops-topbar-back:hover { filter: brightness(1.05); }
.ops-topbar-user {
  color: rgba(255,255,255,.95);
  font-size: .92rem;
  font-weight: 600;
  white-space: nowrap;
}
.ops-topbar-logout {
  appearance: none;
  border: 1px solid rgba(255,255,255,.8);
  background: transparent;
  color: #fff;
  font-weight: 650;
  font-size: .84rem;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.ops-topbar-logout:hover {
  background: rgba(255,255,255,.12);
}
body.ops-mode main > #impersonate-banner:not(.hidden),
body.ops-mode main > #system-aviso-banner:not(.hidden) {
  margin: 0 !important;
  border-radius: 0;
  flex: 0 0 auto;
}
body.ops-mode main > .top {
  padding: 16px 22px 0;
  margin: 0 0 8px;
  flex: 0 0 auto;
}
body.ops-mode main > #page {
  padding: 8px 22px 22px;
  flex: 1 1 auto;
  min-width: 0;
}
/* Páginas que já controlam o padding interno do #page */
body.ops-mode main.dashboard-page-wrap > #page,
body.ops-mode main.kanban-page-wrap > #page,
body.ops-mode main.contacts-page-wrap > #page,
body.ops-mode main.replies-page-wrap > #page,
body.ops-mode main.campaigns-page-wrap > #page,
body.ops-mode main.atendimentos-page > #page,
body.ops-mode main.tags-page-wrap > #page,
body.ops-mode main.backup-page-wrap > #page {
  padding: 0;
}
@media (max-width: 900px) {
  /* Uma linha: hamburger no topbar (fluxo) + título + ações */
  body.ops-mode .ops-topbar,
  .ops-topbar {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 10px 12px;
    position: relative;
    z-index: 60;
  }
  .ops-topbar-brand {
    font-size: .9rem;
    flex: 1 1 auto;
    min-width: 0;
  }
  .ops-topbar-actions {
    flex-wrap: nowrap;
    width: auto;
    max-width: none;
    gap: 6px;
    flex: 0 1 auto;
    justify-content: flex-end;
    min-width: 0;
  }
  /* No mobile o botão Voltar já indica o modo impersonate */
  .ops-topbar-imp { display: none; }
  .ops-topbar-user { display: none; }
  .ops-topbar-back,
  .ops-topbar-logout {
    padding: 7px 10px;
    font-size: .78rem;
  }
}
main.ops-shell-wrap {
  height: auto;
  max-height: none;
  min-height: 100vh;
  overflow: visible;
  background:
    radial-gradient(circle at 12% -10%, var(--brand-tint), transparent 34%),
    linear-gradient(180deg, #eef3f9 0%, #f5f8fc 48%, #eef2f7 100%);
  color: #17324f;
}
main.ops-shell-wrap .top {
  margin-bottom: 12px;
}
main.ops-shell-wrap .top h1 {
  color: #123053;
  font-weight: 760;
  letter-spacing: -.02em;
}
main.ops-shell-wrap .top p {
  color: #5f738a !important;
}
/* Painéis claros em admin/revenda (ops-shell) E em todas as páginas do cliente */
main.ops-shell-wrap .panel,
main.ops-shell-wrap .card,
body.ops-mode main .panel,
body.ops-mode main .card {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04);
}
main.ops-shell-wrap .card span,
main.ops-shell-wrap .panel b,
main.ops-shell-wrap .panel small,
body.ops-mode main .panel .preview,
body.ops-mode main .panel p,
body.ops-mode main .panel small,
body.ops-mode main .panel .muted {
  color: #475569 !important;
}
main.ops-shell-wrap .card b,
body.ops-mode main .panel > b,
body.ops-mode main .panel h3,
body.ops-mode main .replies-topline b {
  color: #0f172a !important;
}
main.ops-shell-wrap input,
main.ops-shell-wrap select,
main.ops-shell-wrap textarea,
body.ops-mode main .panel input:not([type="checkbox"]):not([type="color"]):not([type="file"]),
body.ops-mode main .panel select,
body.ops-mode main .panel textarea,
body.ops-mode main input:not([type="checkbox"]):not([type="color"]):not([type="file"]),
body.ops-mode main select,
body.ops-mode main textarea {
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
main.ops-shell-wrap input::placeholder,
main.ops-shell-wrap textarea::placeholder,
body.ops-mode main input::placeholder,
body.ops-mode main textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}
main.ops-shell-wrap button.soft,
body.ops-mode main button.soft {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
main.ops-shell-wrap button.primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(37,99,235,.25);
}
body.ops-mode main button.primary {
  background: var(--brand) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: none;
}
body.ops-mode main button.danger {
  background: #fff !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}
/* Respostas: reforço do painel claro */
main.replies-page-wrap .replies-panel {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}
main.replies-page-wrap .replies-topline .preview {
  color: #475569 !important;
}
main.ops-shell-wrap .table th,
main.ops-shell-wrap .table td {
  border-bottom-color: #e4edf6;
  color: #17324f;
}
main.ops-shell-wrap .table th {
  color: #5f738a;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
main.ops-shell-wrap .table small,
main.ops-shell-wrap .muted {
  color: #6d8196 !important;
}

.ops-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 24px;
  animation: opsIn .35s ease both;
}
@keyframes opsIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.ops-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}
button.ops-stat {
  appearance: none;
  border: 1px solid #c9d7e8;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
button.ops-stat:hover {
  border-color: #7aa2c7;
  box-shadow: 0 0 0 2px rgba(77, 125, 243, .12);
}
.ops-table tr.is-warn { background: #fff8e8; }
.ops-table tr.is-danger { background: #fdecec; }
.ops-table tr.is-deleted { opacity: .55; }
.ops-table tr.ops-row-summary {
  background: var(--brand-soft);
  font-weight: 600;
}
.ops-table .text-center { text-align: center; }
.ops-muted { color: #6d8196; }
.ops-clientes-page .ops-form-grid .field label { margin-bottom: 4px; }
.ops-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}
.ops-kpi {
  border-radius: 14px;
  padding: 16px 18px;
  color: #fff;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.ops-kpi span {
  display: block;
  font-size: .82rem;
  font-weight: 650;
  opacity: .92;
  line-height: 1.25;
}
.ops-kpi b {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.ops-kpi small {
  display: block;
  margin-top: 4px;
  font-size: .72rem;
  opacity: .82;
  line-height: 1.3;
}
.ops-kpi--primary { background: var(--brand); }
.ops-kpi--success { background: #16a34a; }
.ops-kpi--info { background: #0ea5e9; }
.ops-kpi--warn { background: #d97706; }
.ops-kpi--status-on { background: var(--brand); }
.ops-kpi--status-msg { background: #ea580c; }
.ops-kpi--status-off { background: #dc2626; }
.ops-kpi--status-err { background: #ca8a04; }

/* Relatórios: cards claros (sem faixa colorida sólida) + KPIs suaves */
.ops-reports-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 980px) {
  .ops-reports-grid { grid-template-columns: 1fr; }
}
.ops-report-card {
  padding: 0;
  overflow: hidden;
}
.ops-report-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 18px 16px;
  min-height: 100%;
}
.ops-report-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.ops-report-card-icon svg { display: block; }
.ops-report-card--msg .ops-report-card-icon {
  background: #e8f1ff;
  color: var(--brand);
}
.ops-report-card--camp .ops-report-card-icon {
  background: #e7f8ef;
  color: #15803d;
}
.ops-report-card--log .ops-report-card-icon {
  background: #fff4e5;
  color: #c2410c;
}
.ops-report-card-body h3 {
  margin: 0;
  color: #123053;
  font-size: 1.05rem;
  font-weight: 750;
}
.ops-report-card-body p {
  margin: 0;
  color: #667b91;
  font-size: .88rem;
  line-height: 1.45;
  flex: 1 1 auto;
}
.ops-report-card-body .primary {
  margin-top: 4px;
}
.ops-reports-section-title {
  margin: 0 0 12px;
  color: #123053;
  font-size: 1.05rem;
  font-weight: 750;
}
.ops-reports-page .ops-kpi {
  color: #123053;
  background: #fff;
  border: 1px solid #d9e3ef;
  box-shadow: 0 1px 2px rgba(20,54,108,.04);
}
.ops-reports-page .ops-kpi span {
  opacity: 1;
  color: #667b91;
  font-weight: 650;
}
.ops-reports-page .ops-kpi b {
  color: #123053;
}
.ops-reports-page .ops-kpi--primary { border-top: 3px solid var(--brand); }
.ops-reports-page .ops-kpi--success { border-top: 3px solid #16a34a; }
.ops-reports-page .ops-kpi--info { border-top: 3px solid #0ea5e9; }
.ops-reports-page .ops-kpi--warn { border-top: 3px solid #d97706; }
.ops-dash-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ops-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ops-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2eaf3;
  border-radius: 12px;
  background: #f8fafc;
}
.ops-list-item strong {
  display: block;
  color: #123053;
  font-size: .92rem;
}
.ops-list-item small {
  display: block;
  margin-top: 2px;
  color: #6d8196;
  font-size: .75rem;
}
.ops-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ops-chart-body {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.ops-chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  min-width: 28px;
  padding: 8px 0 22px;
  color: #6d8196;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ops-chart-plot {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ops-spark {
  width: 100%;
  height: 140px;
  display: block;
  color: var(--brand);
}
.ops-spark-grid {
  stroke: #d9e3ef;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.ops-spark-area {
  fill: color-mix(in srgb, var(--brand) 14%, transparent);
}
.ops-spark-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.ops-spark-dot {
  fill: var(--brand);
}
.ops-chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  color: #6d8196;
  font-size: .72rem;
  text-align: center;
}
.ops-chart-labels span {
  flex: 1;
  min-width: 0;
}
.ops-stat {
  background: #fff;
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(20,54,108,.04), 0 10px 24px rgba(20,54,108,.05);
}
.ops-stat span {
  display: block;
  color: #61768c;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .02em;
}
.ops-stat b {
  display: block;
  margin-top: 6px;
  color: #123053;
  font-size: 1.55rem;
  font-weight: 780;
  letter-spacing: -.03em;
}
.ops-panel {
  background: #fff;
  border: 1px solid #d9e3ef;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(20,54,108,.04), 0 12px 28px rgba(20,54,108,.05);
}
.ops-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ops-panel-head h3 {
  margin: 0;
  color: #123053;
  font-size: 1.05rem;
}
.ops-panel-head p {
  margin: 4px 0 0;
  color: #667b91;
  font-size: .82rem;
}

/* Faixa colorida no topo do painel — encosta nas bordas arredondadas */
.ops-panel.ops-panel--banner {
  padding: 0;
  overflow: hidden;
}
.ops-panel-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 18px 22px;
  border-radius: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand) 55%, var(--brand) 100%);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.12);
}
.ops-panel-banner--teal {
  background: linear-gradient(135deg, #0e7490 0%, #0891b2 55%, #06b6d4 100%);
}
.ops-panel-banner-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
}
.ops-panel-banner-icon svg { display: block; }
.ops-panel-banner-text { min-width: 0; }
.ops-panel-banner h3 {
  margin: 0;
  color: #fff !important;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -.01em;
}
.ops-panel-banner p {
  margin: 5px 0 0;
  color: rgba(255,255,255,.92) !important;
  font-size: .88rem;
  line-height: 1.35;
}
.ops-panel--banner > form,
.ops-panel--banner > .ops-panel-body {
  padding: 18px 20px 20px;
}
.ops-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ops-form-row input {
  flex: 1 1 160px;
  min-width: 140px;
  background: #fff;
  border: 1px solid #c9d7e8;
  color: #17324f;
  border-radius: 10px;
  padding: 10px 12px;
}
.ops-filter {
  min-width: 220px;
  background: #fff;
  border: 1px solid #c9d7e8;
  color: #17324f;
  border-radius: 10px;
  padding: 9px 12px;
}
.ops-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #e2eaf3;
  border-radius: 12px;
  background: #f8fafc;
}
.ops-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .75rem;
  font-weight: 650;
  color: #61768c;
}
.ops-filters select,
.ops-filters input {
  min-width: 180px;
  border: 1px solid #c9d7e8;
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: #123053;
}
.ops-filters-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ops-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ops-th-sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.ops-th-sort.active { color: var(--brand); }
.ops-page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.ops-filters--revendas {
  margin-bottom: 10px;
}
.ops-filters--revendas .ops-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding-bottom: 2px;
}
.ops-filters--revendas .ops-check input {
  min-width: auto;
  width: 16px;
  height: 16px;
}
.ops-result-meta {
  margin: 0 0 10px;
  color: #61768c;
  font-size: .84rem;
}
.ops-metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .82rem;
  color: #fff;
}
.ops-metric--cyan { background: #0891b2; }
.ops-metric--purple { background: #0f766e; }
.ops-metric--blue { background: var(--brand); }
.ops-metric--sky { background: #0284c7; }
.ops-metric--red { background: #dc2626; }
.ops-table--revendas tr.is-deleted { opacity: .55; }
.ops-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.ops-table-wrap { overflow-x: auto; }
.ops-table {
  width: 100%;
  border-collapse: collapse;
}
.ops-table th,
.ops-table td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid #e7eef6;
  vertical-align: top;
  color: #17324f;
  font-size: .9rem;
}
.ops-table th {
  color: #61768c;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .045em;
  font-weight: 700;
}
.ops-table b { color: #123053; }
.ops-table small { color: #6d8196; }
.ops-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ops-impersonate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--brand-ring);
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--brand-soft-2) 100%);
  color: #1e3a5f;
}
.ops-impersonate strong {
  display: block;
  font-size: .92rem;
}
.ops-impersonate span {
  display: block;
  margin-top: 2px;
  color: #4d6480;
  font-size: .82rem;
}
@media (max-width: 900px) {
  .ops-stats { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .ops-kpi-row { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .ops-dash-cols { grid-template-columns: 1fr; }
  .ops-panel-head { flex-direction: column; }
  .ops-filter { width: 100%; min-width: 0; }
}

/* Contraste reforçado no tema claro (admin/revenda) */
main.ops-shell-wrap .badge {
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: .01em;
}
main.ops-shell-wrap .badge.ok {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
main.ops-shell-wrap .badge.warn {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
main.ops-shell-wrap .badge.bad {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
main.ops-shell-wrap .ops-table th {
  color: #3f566e;
}
main.ops-shell-wrap .ops-table small,
main.ops-shell-wrap .ops-panel-head p,
main.ops-shell-wrap .ops-stat span {
  color: #4d6278;
}
main.ops-shell-wrap .ops-form-row input::placeholder,
main.ops-shell-wrap .ops-filter::placeholder,
main.ops-shell-wrap input::placeholder {
  color: #5b7088 !important;
}
main.ops-shell-wrap button.soft {
  background: #dce6f2;
  color: #1f3b57;
  border-color: #b9c9db;
  font-weight: 650;
}
main.ops-shell-wrap .ops-impersonate span {
  color: #334e6d;
}
main.ops-shell-wrap .top p {
  color: #4a6078 !important;
}

.ops-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
}
.ops-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #17324f;
  font-size: .9rem;
  cursor: pointer;
}
.ops-form-row select {
  background: #fff;
  border: 1px solid #c9d7e8;
  color: #17324f;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 140px;
}

.ops-form-panel { width: 100%; max-width: none; }
.ops-section-label {
  margin: 8px 0 0;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7f96;
}
.ops-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.ops-form-grid .field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.ops-form-grid .field label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #3d5166;
}
.ops-form-grid .field input,
.ops-form-grid .field select,
.ops-form-grid .field textarea {
  width: 100%;
  max-width: none;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d5dee8;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  box-sizing: border-box;
}
.ops-form-grid .field textarea { min-height: 110px; resize: vertical; }
.ops-form-span { grid-column: 1 / -1; }
.ops-help {
  color: #6b7f94;
  font-size: .78rem;
  line-height: 1.35;
}
.ops-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
}
@media (max-width: 720px) {
  .ops-form-grid { grid-template-columns: 1fr; }
}

.ops-perm-user {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.ops-perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ops-perm-card {
  border: 1px solid #d5dee8;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.ops-perm-card-head {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  padding: 10px 14px;
}
.ops-perm-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ops-perm-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ops-alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 12px 0 0;
  font-size: .92rem;
}
.ops-alert--info {
  background: #e8f1ff;
  color: var(--brand);
  border: 1px solid var(--brand-soft-2);
}
.ops-alert--warn {
  background: #fff7e6;
  color: #92400e;
  border: 1px solid #fde68a;
}
@media (max-width: 720px) {
  .ops-perm-grid { grid-template-columns: 1fr; }
}
.ops-consultor-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
}
.ops-consultor-search label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: #3d5166;
}
.ops-consultor-search input {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #d5dee8;
  border-radius: 8px;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
}
.ops-consultor-search .primary {
  min-height: 46px;
  padding: 0 22px;
}
.ops-consultor-empty {
  margin-top: 12px;
}
.ops-consultor-empty-inner {
  text-align: center;
  padding: 48px 16px;
}
.ops-consultor-empty-inner h3 {
  margin: 0 0 8px;
  color: #61768c;
  font-weight: 600;
}
.ops-consultor-card {
  margin-top: 12px;
  border: 1px solid var(--brand-ring);
}
.ops-consultor-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--brand);
  color: #fff;
  margin: -16px -16px 16px;
  padding: 12px 16px;
  border-radius: 10px 10px 0 0;
}
.ops-consultor-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.ops-consultor-cols h4 {
  margin: 0 0 10px;
  font-size: .95rem;
  color: var(--brand);
  border-bottom: 1px solid #e5edf5;
  padding-bottom: 6px;
}
.ops-consultor-cols h4:nth-of-type(1) { color: var(--brand); }
.ops-kv {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.ops-kv th {
  width: 130px;
  text-align: left;
  color: #61768c;
  font-weight: 600;
  padding: 5px 8px 5px 0;
  vertical-align: top;
}
.ops-kv td {
  padding: 5px 0;
  vertical-align: top;
}
.ops-consultor-direct {
  margin-top: 14px;
  padding: 12px;
  background: #f5f8fc;
  border-radius: 8px;
}
@media (max-width: 860px) {
  .ops-consultor-search { grid-template-columns: 1fr; }
  .ops-consultor-cols { grid-template-columns: 1fr; }
}

/* ===== Ops Backup (paridade Hotspot) ===== */
.ops-backup-page { display: flex; flex-direction: column; gap: 14px; }
.ops-backup-alert {
  padding: 12px 14px;
  border-radius: 10px;
  background: #eef6ff;
  border: 1px solid #bfd7f5;
  color: #1e3a5f;
  font-size: .92rem;
  line-height: 1.45;
}
.ops-backup-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ops-backup-card .ops-panel-head h3 { margin: 0; }
.ops-backup-card--db { border-top: 3px solid var(--brand); }
.ops-backup-card--dir { border-top: 3px solid #16a34a; }
.ops-backup-create { border-top: 3px solid #d97706; }
.ops-backup-kv p { margin: 0 0 8px; font-size: .92rem; color: #334155; }
.ops-backup-kv p:last-child { margin-bottom: 0; }
.ops-backup-kv code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: .8rem;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.ops-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}
.ops-badge.ok { background: #dcfce7; color: #166534; }
.ops-badge.bad { background: #fee2e2; color: #991b1b; }
.ops-backup-form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.ops-backup-form .field select { width: 100%; }
.ops-backup-progress {
  margin-top: 12px;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.ops-backup-progress-bar {
  padding: 10px 12px;
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  color: #0f172a;
  background: linear-gradient(90deg, var(--brand-soft-2), var(--brand), var(--brand-soft-2));
  background-size: 200% 100%;
  animation: opsBackupPulse 1.2s linear infinite;
}
@keyframes opsBackupPulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.ops-backup-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ops-backup-upload input[type=file] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}
.ops-backup-empty {
  text-align: center;
  padding: 36px 16px;
  color: #64748b;
}
.ops-backup-empty h3 { margin: 0 0 8px; color: #334155; }
@media (max-width: 860px) {
  .ops-backup-info-grid { grid-template-columns: 1fr; }
}

/* ===== Ops Tutoriais ===== */
.ops-tutoriais-page { display: flex; flex-direction: column; gap: 14px; }
.ops-tutoriais-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.ops-tutorial-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.ops-tutorial-card h4 { margin: 0; font-size: 1rem; color: #0f172a; }
.ops-tutorial-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .8rem;
  color: #64748b;
}
.ops-tutorial-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #0f172a;
}
.ops-tutorial-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.ops-tutoriais-cat .ops-panel-head h3 { margin: 0; }

/* ===== Ops Config (paridade Hotspot revenda/configuracoes) ===== */
.ops-config-hotspot-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}
.ops-config-hotspot-main,
.ops-config-hotspot-side { min-width: 0; }
.ops-config-page .ops-panel-head h3 { margin: 0; }
.ops-palette-card.is-active { box-shadow: 0 0 0 1px var(--brand); }
@media (max-width: 960px) {
  .ops-config-hotspot-row { grid-template-columns: 1fr; }
  #rp-paletas { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Domínio do cliente (automático) — admin Configurações */
.ops-panel--banner > .ops-dominios-body { padding: 16px 18px 18px; }
.ops-dominios-steps {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .92rem;
  color: #334155;
}
.ops-dominios-steps ol { margin: 8px 0 0; padding-left: 1.2rem; }
.ops-dominios-steps code {
  background: #fce7f3;
  color: #9d174d;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .85em;
}
.ops-dominios-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ops-dominios-form .mono,
.ops-dominios-item .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ops-dominios-msg {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: .9rem;
}
.ops-dominios-msg--success { background: #dcfce7; color: #166534; }
.ops-dominios-msg--danger { background: #fee2e2; color: #991b1b; }
.ops-dominios-msg--warning { background: #fef3c7; color: #92400e; }
.ops-dominios-msg--info { background: #e0f2fe; color: #075985; }
.ops-dominios-list-title {
  margin: 0 0 8px;
  font-size: .95rem;
  color: #64748b;
  font-weight: 600;
}
.ops-dominios-lista {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.ops-dominios-empty {
  padding: 22px 14px;
  text-align: center;
  color: #94a3b8;
  font-size: .92rem;
}
.ops-dominios-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid #eef2f7;
}
.ops-dominios-item:first-child { border-top: 0; }
.ops-dominios-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ops-dominios-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ops-dominios-hint {
  flex: 1 1 100%;
  display: block;
  margin-top: 2px;
  font-size: .82rem;
}
.ops-dominios-hint.warn { color: #b45309; }
.ops-dominios-hint.bad { color: #b91c1c; }
.ops-badge.warn { background: #fef3c7; color: #92400e; }
.ops-badge.info { background: #e0f2fe; color: #075985; }
.ops-badge.muted { background: #e2e8f0; color: #475569; }
