/* ──────────────────────────────────────────────────────────
   Design system — Atendimento Cine Foto Vaz
   Token-based, theming-ready, full dark-mode support
   ────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --cfv-navy:      #0d9488;
  --cfv-navy-700:  #0f766e;
  --cfv-navy-900:  #115e59;
  --cfv-navy-50:   #ecfdf8;

  /* Neutrals */
  --cfv-ink:       #0a0e1a;
  --cfv-ink-2:     #4a5566;
  --cfv-ink-3:     #7a8597;
  --cfv-line:      #e5e7eb;
  --cfv-line-2:    #eef0f3;
  --cfv-bg:        #ffffff;
  --cfv-bg-soft:   #f7f7f8;
  --cfv-bg-2:      #fafbfc;
  --cfv-surface:   #ffffff;

  /* Status */
  --cfv-red:       #C41E2E;
  --cfv-green:     #10b981;
  --cfv-yellow:    #f59e0b;
  --cfv-blue:      #3b82f6;

  /* Geometry */
  --cfv-radius:    12px;
  --cfv-radius-sm: 8px;
  --cfv-radius-lg: 16px;

  /* Shadows */
  --cfv-shadow-xs: 0 1px 2px rgba(10,14,26,.05);
  --cfv-shadow-sm: 0 1px 2px rgba(10,14,26,.04), 0 0 0 1px rgba(10,14,26,.05);
  --cfv-shadow:    0 10px 30px -12px rgba(55,48,163,.18), 0 2px 6px rgba(55,48,163,.05);
  --cfv-shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);
  --cfv-shadow-lg: 0 12px 40px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.06);

  /* Typography */
  --cfv-font:      'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Easing */
  --cfv-ease:      cubic-bezier(.4, 0, .2, 1);
  --cfv-ease-out:  cubic-bezier(.16, 1, .3, 1);

  /* Bubbles */
  --at-bubble-me-bg:         var(--cfv-navy);
  --at-bubble-me-color:      #ffffff;
  --at-bubble-other-bg:      #ffffff;
  --at-bubble-other-color:   var(--cfv-ink);
  --at-bubble-deleted-bg:    #f3f4f6;
  --at-bubble-deleted-color: #9ca3af;
  --at-bubble-me-shadow:     0 1px 3px rgba(55,48,163,.20);
  --at-bubble-other-shadow:  0 1px 2px rgba(0,0,0,.06);
}

/* ── Dark mode ───────────────────────────────────────────── */
body.at-dark {
  --cfv-bg:      #111b21;
  --cfv-bg-soft: #0d1418;
  --cfv-bg-2:    #1a262e;
  --cfv-surface: #202c33;
  --cfv-ink:     #e9edef;
  --cfv-ink-2:   #aebac1;
  --cfv-ink-3:   #8696a0;
  --cfv-line:    #2a373f;
  --cfv-line-2:  #1f2c33;
  --cfv-navy-50: #1f2a4a;

  --at-bubble-me-bg:         #005c4b;
  --at-bubble-me-color:      #e9edef;
  --at-bubble-other-bg:      #202c33;
  --at-bubble-other-color:   #e9edef;
  --at-bubble-deleted-bg:    #2a3942;
  --at-bubble-deleted-color: #667781;
  --at-bubble-me-shadow:     0 1px 3px rgba(0,0,0,.35);
  --at-bubble-other-shadow:  0 1px 2px rgba(0,0,0,.25);

  --cfv-shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.03);
  --cfv-shadow:    0 10px 30px -12px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);
  --cfv-shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --cfv-shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}

/* Cards & generic white surfaces follow theme */
body.at-dark .at-card,
body.at-dark .adm-card,
body.at-dark .at-cfg-card,
body.at-dark .at-login__card { background: var(--cfv-surface); border-color: var(--cfv-line); }

body.at-dark .at-emoji-picker,
body.at-dark .at-filt-menu,
body.at-dark .at-msg-menu,
body.at-dark .at-forward-modal,
body.at-dark .at-orc-modal,
body.at-dark .at-rr-popup,
body.at-dark .at-tags-panel,
body.at-dark .at-transfer-menu,
body.at-dark .at-tooltip,
body.at-dark .at-toast { background: var(--cfv-surface); border-color: var(--cfv-line); color: var(--cfv-ink); }

body.at-dark .at-emoji-cat-btn { color: var(--cfv-ink-2); }
body.at-dark .at-emoji-cat-btn:hover,
body.at-dark .at-emoji-cat-btn.active { background: var(--cfv-bg-2); }
body.at-dark .at-emoji-grid-btn:hover,
body.at-dark .at-emoji-btn:hover { background: var(--cfv-bg-2); }

body.at-dark .at-field input,
body.at-dark .at-field textarea,
body.at-dark .at-field select {
  background: var(--cfv-bg-2); color: var(--cfv-ink); border-color: var(--cfv-line);
}
body.at-dark .at-field input::placeholder,
body.at-dark .at-field textarea::placeholder { color: var(--cfv-ink-3); }

body.at-dark .at-filt-drop,
body.at-dark .at-filt-btn { background: var(--cfv-surface); border-color: var(--cfv-line); color: var(--cfv-ink-2); }

body.at-dark .at-agent-status-bar { background: var(--cfv-surface); border-color: var(--cfv-line); }

/* Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--cfv-font);
  color: var(--cfv-ink);
  background: var(--cfv-bg-soft);
  -webkit-font-smoothing: antialiased;
  transition: background .25s var(--cfv-ease), color .25s var(--cfv-ease);
}

/* ── Login ───────────────────────────────────────────────── */
.at-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* HorizonMetaAPI: fundo escuro esverdeado, combinando com a logo */
  background: radial-gradient(120% 90% at 50% 0%, #0f4c3a 0%, #0b2a2f 45%, #08141c 100%);
}
.at-login__header {
  padding: 44px 32px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.at-login__logo-wrap {
  border-radius: 16px;
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 2px;
}
.at-login__logo {
  height: 64px; display: block; object-fit: contain;
}
.at-login__brand-name {
  font-size: 22px; font-weight: 800; color: white; text-align: center; letter-spacing: -.3px;
}
.at-login__brand-sub {
  font-size: 11px; color: rgba(255,255,255,.45); text-transform: uppercase;
  letter-spacing: .16em; text-align: center;
}
.at-login__body {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  padding: 20px 16px 40px;
}
.at-login__card {
  background: white; border-radius: 20px; width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28); overflow: hidden;
}
.at-login__card-head { padding: 32px 32px 20px; border-bottom: 1px solid var(--cfv-line); }
.at-login__tag {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--cfv-navy); background: var(--cfv-navy-50);
  padding: 3px 10px; border-radius: 20px; margin-bottom: 12px;
}
.at-login__card-head h1 { font-size: 22px; font-weight: 800; color: var(--cfv-ink); margin-bottom: 6px; }
.at-login__card-head p  { font-size: 13px; color: var(--cfv-ink-3); }
.at-login__card-body { padding: 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.at-login__card-foot { padding: 0 32px 28px; }

.at-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--cfv-ink-2); margin-bottom: 6px; }
.at-field input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--cfv-line);
  border-radius: var(--cfv-radius-sm); font-size: 14px; font-family: var(--cfv-font);
  color: var(--cfv-ink); outline: none; transition: border-color .15s, box-shadow .15s;
  background: var(--cfv-bg);
}
.at-field input:focus { border-color: var(--cfv-navy); box-shadow: 0 0 0 3px rgba(55,48,163,.12); }

.at-color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.at-color-swatch {
  width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; transition: transform .15s, border-color .15s; outline: none;
}
.at-color-swatch:hover  { transform: scale(1.1); }
.at-color-swatch.active { border-color: var(--cfv-ink); transform: scale(1.15); }

.at-error {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--cfv-red);
  font-size: 13px; padding: 10px 14px; border-radius: var(--cfv-radius-sm);
}
body.at-dark .at-error { background: rgba(196,30,46,.12); border-color: rgba(196,30,46,.3); }

/* ── Botões ─────────────────────────────────────────────── */
.at-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border-radius: var(--cfv-radius-sm); font-size: 14px;
  font-weight: 700; font-family: var(--cfv-font); border: none; cursor: pointer;
  transition: opacity .15s, transform .1s, background .15s;
}
.at-btn:hover:not(:disabled)  { opacity: .88; }
.at-btn:active:not(:disabled) { transform: scale(.97); }
.at-btn:disabled              { opacity: .45; cursor: not-allowed; }
.at-btn--primary { background: var(--cfv-navy); color: white; width: 100%; }
.at-btn--danger  { background: #dc2626; color: white; }
.at-btn--ghost   { background: transparent; color: var(--cfv-ink-3); border: 1.5px solid var(--cfv-line); }

/* ── Layout ─────────────────────────────────────────────── */
.at-body { min-height: 100vh; min-height: 100dvh; }
.at-wrap {
  display: flex; flex-direction: row;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}

/* ── Sidebar — elegant, smooth, polished ─────────────────── */
.at-sidebar {
  width: 232px;
  background: linear-gradient(180deg, var(--cfv-navy) 0%, var(--cfv-navy-900) 100%);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
  position: relative;
}

.at-sidebar::-webkit-scrollbar { width: 0; }

.at-sidebar__logo {
  padding: 18px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.at-sidebar__logo-wrap {
  border-radius: 12px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
}
.at-sidebar__logo-img { height: 52px; display: block; object-fit: contain; }
.at-sidebar__logo-sub {
  font-size: 10px; color: rgba(255,255,255,.42);
  text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
}

/* Thin separator between logo block and nav */
.at-sidebar__divider {
  height: 1px;
  margin: 4px 16px 8px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
}

/* Agent avatar with subtle glow ring */
.at-sidebar__agent {
  padding: 6px 16px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.at-sidebar__agent-avatar {
  position: relative;
  flex-shrink: 0;
}
.at-sidebar__agent-avatar::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--at-agent-color, #fff) 0%, transparent 70%);
  opacity: .35;
  filter: blur(6px);
  z-index: 0;
  animation: at-glow 3.5s ease-in-out infinite;
}
.at-sidebar__agent-avatar > * {
  position: relative; z-index: 1;
  box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 0 14px var(--at-agent-color, rgba(255,255,255,.4));
}
@keyframes at-glow {
  0%, 100% { opacity: .25; }
  50%      { opacity: .5; }
}

.at-sidebar__agent-info { flex: 1; min-width: 0; }
.at-sidebar__agent-name {
  font-size: 13px; font-weight: 600; color: white;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -.01em;
}
.at-sidebar__agent-role {
  font-size: 10px; color: rgba(255,255,255,.45);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  margin-top: 1px;
}
.at-sidebar__agent-status {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.1);
}
.at-sidebar__agent-foto-wrap {
  position: relative; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
}
.at-sidebar__agent-foto-wrap--clickable { cursor: pointer; }
.at-sidebar__agent-foto-wrap--clickable:hover > div:first-child { opacity: .85; }
.at-sidebar__agent-foto-badge {
  position: absolute; bottom: -1px; right: -1px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #25d366; border: 2px solid var(--cfv-sidebar-bg, #1e2235);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; transition: transform .15s, background .15s;
}
.at-sidebar__agent-foto-wrap--clickable:hover .at-sidebar__agent-foto-badge {
  background: #16a34a; transform: scale(1.15);
}

/* Navigation */
.at-nav { flex: 1; padding: 4px 10px 10px; }
.at-nav-section {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
  color: rgba(255,255,255,.32); padding: 14px 12px 6px;
}
.at-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  color: rgba(255,255,255,.62); font-size: 13.5px; font-weight: 500;
  border: none; background: none; width: 100%; cursor: pointer;
  font-family: var(--cfv-font); text-decoration: none; text-align: left;
  position: relative;
  transition: background .22s cubic-bezier(.4,0,.2,1),
              color .22s cubic-bezier(.4,0,.2,1),
              transform .15s cubic-bezier(.4,0,.2,1);
}
.at-nav-item > svg { transition: transform .22s cubic-bezier(.4,0,.2,1); flex-shrink: 0; }
.at-nav-item:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.92); }
.at-nav-item:hover > svg { transform: scale(1.08); }
.at-nav-item.active {
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.10) 100%);
  color: white; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 1px 6px rgba(0,0,0,.15);
}
.at-nav-item.active > svg { transform: scale(1.05); }

.at-nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: #ef4444; color: white; border-radius: 10px;
  padding: 1px 6px; line-height: 16px; flex-shrink: 0; min-width: 18px; text-align: center;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
}
.at-nav-badge--warn { background: var(--cfv-yellow); box-shadow: 0 2px 6px rgba(245,158,11,.4); border-radius: 4px; }
.at-nav-badge--err  { background: #ef4444; border-radius: 4px; }

.at-sidebar__footer {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 6px;
}

/* Discreet logout button */
.at-sidebar__logout {
  width: 100%; padding: 7px 12px; border-radius: 8px;
  border: 1px solid transparent; background: transparent;
  color: rgba(255,255,255,.4); font-size: 12px; font-weight: 500;
  font-family: var(--cfv-font); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .18s, color .18s, border-color .18s;
}
.at-sidebar__logout:hover {
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.82);
  border-color: rgba(255,255,255,.08);
}

/* Agent online status bar (bottom of sidebar) */
.at-agent-status-bar {
  padding: 6px 14px;
  display: flex; gap: 4px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.06);
}
.at-agent-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.4);
}

/* ── Main content ───────────────────────────────────────── */
.at-main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}

/* ── Cards ─────────────────────────────────────────────── */
.at-card,
.adm-card,
.at-cfg-card {
  background: var(--cfv-surface);
  border-radius: var(--cfv-radius);
  box-shadow: var(--cfv-shadow-sm);
  border: 1px solid var(--cfv-line-2);
  overflow: hidden;
}
.at-cfg-card { overflow: visible; }
.at-cfg-card > *:first-child { border-radius: var(--cfv-radius) var(--cfv-radius) 0 0; overflow: hidden; }
.at-cfg-card > *:last-child  { border-radius: 0 0 var(--cfv-radius) var(--cfv-radius); overflow: hidden; }
.at-cfg-card > *:first-child:last-child { border-radius: var(--cfv-radius); }

.at-cfg-card__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--cfv-line);
  font-size: 13.5px; font-weight: 700; color: var(--cfv-ink);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  letter-spacing: -.01em;
}
.at-cfg-card__head--rich {
  align-items: flex-start; padding: 16px 18px; gap: 12px;
}
.at-cfg-card__head-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--cfv-navy-50); color: var(--cfv-navy);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.at-cfg-card__head-text { flex: 1; min-width: 0; }
.at-cfg-card__head-title { font-size: 14px; font-weight: 700; color: var(--cfv-ink); letter-spacing: -.01em; }
.at-cfg-card__head-sub   { font-size: 12px; color: var(--cfv-ink-3); margin-top: 2px; font-weight: 500; }

.at-cfg-card__body { padding: 18px 20px; overflow: visible; }
/* Cartões NÃO encolhem dentro da coluna .at-cfg: encolhiam pra caber na tela e, com o
   overflow do cartão, a lista era CORTADA em vez de a página rolar (Usuários mostrava 5 de
   20, sem barra de rolagem — 27/09). Quem rola é o .at-cfg. */
.at-cfg > * { flex-shrink: 0; }

/* ── Settings module ─────────────────────────────────────── */
.at-cfg {
  flex: 1; min-height: 0;
  overflow-y: scroll;
  padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
  background: var(--cfv-bg-soft);
  scrollbar-width: auto;
  scrollbar-color: var(--cfv-line) transparent;
}
.at-cfg::-webkit-scrollbar { width: 8px; }
.at-cfg::-webkit-scrollbar-track { background: var(--cfv-line-2); border-radius: 4px; }
.at-cfg::-webkit-scrollbar-thumb { background: #9ca3af; border-radius: 4px; }
.at-cfg::-webkit-scrollbar-thumb:hover { background: #6b7280; }

.at-module-wrap {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  background: var(--cfv-bg-soft);
  scrollbar-width: thin;
  scrollbar-color: var(--cfv-line) transparent;
}
.at-module-wrap::-webkit-scrollbar { width: 8px; }
.at-module-wrap::-webkit-scrollbar-thumb { background: #9ca3af; border-radius: 4px; }
.at-module-wrap::-webkit-scrollbar-thumb:hover { background: #6b7280; }

.at-module-header {
  padding: 24px 24px 20px;
  background: var(--cfv-surface);
  border-bottom: 1px solid var(--cfv-line-2);
  flex-shrink: 0;
}
.at-module-header h2 { font-size: 20px; font-weight: 800; color: var(--cfv-ink); margin: 0; letter-spacing: -.02em; }

.at-module-body {
  flex: 1; padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
}

.at-cfg__title { font-size: 22px; font-weight: 800; color: var(--cfv-ink); margin-bottom: 4px; letter-spacing: -.02em; }
.at-cfg__sub   { font-size: 13.5px; color: var(--cfv-ink-3); }

/* Larger toggles (48x26) */
.at-toggle {
  position: relative; display: inline-block;
  width: 48px; height: 26px;
  cursor: pointer; flex-shrink: 0;
}
.at-toggle input { display: none; }
.at-toggle__track {
  position: absolute; inset: 0;
  background: #d1d5db; border-radius: 999px;
  transition: background .25s var(--cfv-ease);
}
.at-toggle__thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.04);
  transition: transform .25s var(--cfv-ease);
}
.at-toggle input:checked ~ .at-toggle__track { background: var(--cfv-navy); }
.at-toggle input:checked ~ .at-toggle__thumb { transform: translateX(22px); }
body.at-dark .at-toggle__track { background: #374151; }

/* Alternating-row table */
.at-table-row {
  display: grid; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--cfv-line-2);
  font-size: 13px;
}
.at-table-row:nth-child(even) { background: var(--cfv-bg-2); }
.at-table-row:last-child { border-bottom: none; }

/* Aparência section */
.at-appearance {
  display: flex; flex-direction: column; gap: 22px;
}
.at-appearance__group-title {
  font-size: 12px; font-weight: 700; color: var(--cfv-ink-2);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px;
}
.at-theme-swatches {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.at-theme-swatch {
  width: 44px; height: 44px; border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer; outline: none; padding: 0;
  position: relative;
  transition: transform .18s var(--cfv-ease-out), box-shadow .18s, border-color .18s;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.at-theme-swatch:hover    { transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.at-theme-swatch.active   { border-color: var(--cfv-ink); transform: scale(1.08); }
.at-theme-swatch.active::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px; font-weight: 800;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.at-theme-custom {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 8px; border: 1.5px dashed var(--cfv-line);
  border-radius: 12px;
}
.at-theme-custom input[type=color] {
  width: 36px; height: 36px; border: none; padding: 0;
  background: transparent; cursor: pointer; border-radius: 8px;
}
.at-theme-custom span { font-size: 12px; color: var(--cfv-ink-3); font-weight: 600; }

.at-wp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px;
}
.at-wp-swatch {
  position: relative;
  height: 70px;
  border-radius: 12px;
  cursor: pointer;
  border: 3px solid transparent;
  background-clip: padding-box;
  overflow: hidden;
  transition: transform .18s var(--cfv-ease-out), box-shadow .18s, border-color .18s;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.at-wp-swatch:hover   { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.at-wp-swatch.active  { border-color: var(--cfv-navy); }
.at-wp-swatch__label {
  position: absolute; bottom: 6px; left: 8px; right: 8px;
  font-size: 10px; font-weight: 700; color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.at-wp-swatch.active::after {
  content: '✓'; position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--cfv-navy);
  color: white; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.at-darkmode-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--cfv-bg-2);
  border-radius: 12px; border: 1px solid var(--cfv-line);
}
.at-darkmode-row__icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cfv-navy); color: white;
  transition: transform .4s var(--cfv-ease-out);
}
body.at-dark .at-darkmode-row__icon { background: #fbbf24; color: #422006; }
body.at-dark .at-darkmode-row__icon { transform: rotate(360deg); }
.at-darkmode-row__text { flex: 1; }
.at-darkmode-row__title { font-size: 14px; font-weight: 700; color: var(--cfv-ink); }
.at-darkmode-row__sub   { font-size: 12px; color: var(--cfv-ink-3); margin-top: 1px; }

/* ── Status dot ───────────────────────────────────────────── */
.at-status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes cfv-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .35; transform: scale(1.4); }
}
@keyframes cfv-spin { to { transform: rotate(360deg); } }
@keyframes at-wave {
  0%, 100% { transform: scaleY(.3); }
  50%       { transform: scaleY(1); }
}
@keyframes at-slide-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes at-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Scrollbar (global) ───────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--cfv-line) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--cfv-line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--cfv-ink-3); }

/* ── Mobile top bar ──────────────────────────────────────── */
.at-mobile-bar {
  display: none;
  align-items: center;
  padding: 6px 12px 2px;
  background: var(--cfv-navy);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  position: relative;
  min-height: 52px;
}
.at-mobile-bar__btn {
  width: 40px; height: 40px; border: none;
  background: rgba(255,255,255,.15); border-radius: 10px;
  color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.at-mobile-bar__logo-wrap {
  border-radius: 10px; padding: 4px 10px;
  display: inline-flex; align-items: center;
  position: absolute; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}
.at-mobile-bar__logo { height: 38px; display: block; object-fit: contain; }

/* Sidebar overlay (mobile) */
.at-sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 98;
  backdrop-filter: blur(2px);
}
.at-sidebar-overlay--show { display: block; animation: at-fade-in .18s var(--cfv-ease-out); }

/* Back-to-conversations button (mobile) */
.at-back-btn {
  display: none;
  align-items: center; gap: 5px;
  padding: 8px 12px;
  border: 1.5px solid var(--cfv-line);
  background: var(--cfv-bg-2); border-radius: 9px;
  color: var(--cfv-navy); font-size: 13px; font-weight: 700;
  font-family: var(--cfv-font); cursor: pointer;
  white-space: nowrap; flex-shrink: 0; touch-action: manipulation;
  min-height: 40px;
}
.at-back-btn:hover { background: var(--cfv-navy-50); }

/* ── Conversation list — richer, polished ────────────────── */
.at-conv-panel { background: var(--cfv-bg); }

.at-conv-item {
  padding: 12px 16px 12px 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--cfv-line-2);
  transition: background .18s var(--cfv-ease), border-left-color .25s;
  position: relative;
  border-left: 4px solid transparent;
}
.at-conv-item:hover { background: var(--cfv-bg-2); }
.at-conv-item.is-selected {
  background: linear-gradient(135deg, var(--cfv-navy) 0%, var(--cfv-navy-700) 100%);
  color: white;
  border-left-color: rgba(255,255,255,.4);
}
.at-conv-item.is-selected .at-conv-item__name,
.at-conv-item.is-selected .at-conv-item__preview,
.at-conv-item.is-selected .at-conv-item__time { color: white; }
.at-conv-item.is-selected .at-conv-item__preview { opacity: .82; }
.at-conv-item.is-selected .at-conv-item__time { opacity: .68; }
.at-conv-item.is-closed { opacity: .65; background: var(--cfv-bg-2); }
.at-conv-item.is-closed.is-selected {
  background: linear-gradient(135deg, var(--cfv-navy) 0%, var(--cfv-navy-700) 100%);
  opacity: .85;
}
.at-conv-item.has-urgent { border-left-color: #ef4444; }

.at-conv-item__row {
  display: flex; align-items: flex-start; gap: 11px;
}
.at-conv-item__avatar { position: relative; flex-shrink: 0; }
.at-conv-item__status {
  position: absolute; bottom: 0; right: 0; width: 11px; height: 11px;
  border-radius: 50%; border: 2px solid var(--cfv-bg);
}
.at-conv-item.is-selected .at-conv-item__status { border-color: var(--cfv-navy); }
.at-conv-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.at-conv-item__head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.at-conv-item__name {
  font-weight: 600; font-size: 16px; color: var(--cfv-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; letter-spacing: -.01em;
}
.at-conv-item__time {
  font-size: 12px; color: var(--cfv-ink-3); flex-shrink: 0;
  font-weight: 500; font-variant-numeric: tabular-nums;
}
.at-conv-item__preview-row { display: flex; align-items: center; gap: 6px; }
.at-conv-item__preview {
  font-size: 14px; color: var(--cfv-ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; line-height: 1.35;
}
.at-conv-item__badges { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.at-conv-item__unread {
  background: #22c55e; color: white;
  border-radius: 999px;
  min-width: 21px; height: 21px; padding: 0 7px;
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(34,197,94,.35);
}
.at-conv-item.is-selected .at-conv-item__unread {
  background: white; color: var(--cfv-navy);
}
.at-conv-item__agent-pip {
  width: 16px; height: 16px; border-radius: 50%;
  color: white; font-size: 7px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1.5px var(--cfv-bg);
}
.at-conv-item.is-selected .at-conv-item__agent-pip { box-shadow: 0 0 0 1.5px var(--cfv-navy); }

.at-conv-item__agent-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px 1px 2px; border-radius: 99px;
  font-size: 10px; font-weight: 700; letter-spacing: .01em;
  background: rgba(107,114,128,.1);
  border: 1px solid rgba(107,114,128,.25);
  color: #6b7280;
  background: color-mix(in srgb, var(--ag-color) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--ag-color) 35%, transparent);
  color: var(--ag-color);
  flex-shrink: 0;
}
.at-conv-item.is-selected .at-conv-item__agent-tag {
  background: rgba(255,255,255,.18) !important;
  border-color: rgba(255,255,255,.35) !important;
  color: rgba(255,255,255,.95) !important;
}

.at-conv-item__tags {
  display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px;
}
.at-conv-item__tag {
  font-size: 9.5px; font-weight: 700; padding: 2px 7px;
  border-radius: 99px; letter-spacing: .02em;
  border: 1px solid; display: inline-flex; align-items: center;
}
.at-conv-item.is-selected .at-conv-item__tag {
  background: rgba(255,255,255,.15) !important;
  color: rgba(255,255,255,.95) !important;
  border-color: rgba(255,255,255,.3) !important;
}

/* ── Chat header — center action group, right icon-only ── */
.at-chat-header {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--cfv-line);
  background: var(--cfv-bg);
  flex-shrink: 0;
}
.at-chat-header__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}
.at-chat-header__main {
  display: flex; align-items: center; gap: 11px;
  flex: 1; min-width: 0;
}
.at-chat-header__info { flex: 1; min-width: 0; }
.at-chat-header__name-row {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.at-chat-header__name {
  font-weight: 700; font-size: 14.5px; color: var(--cfv-ink); letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; flex: 1;
}
.at-chat-header__name-row .at-status-chip { flex-shrink: 0; white-space: nowrap; }
.at-name-edit-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  border: none; background: transparent; cursor: pointer;
  color: var(--cfv-ink-3); padding: 0;
  opacity: 0; transition: opacity .15s, background .15s;
}
.at-chat-header__name-row:hover .at-name-edit-btn,
.at-name-edit-btn:focus { opacity: 1; }
.at-name-edit-btn:hover { background: var(--cfv-bg-2); color: var(--cfv-navy); }
.at-conv-kebab { display: none; }
.at-chat-header__meta {
  font-size: 11.5px; color: var(--cfv-ink-3);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 2px;
}
.at-chat-header__meta span { display: inline-flex; align-items: center; gap: 4px; }

.at-status-chip {
  font-size: 10px; font-weight: 700; padding: 3px 9px;
  border-radius: 99px; letter-spacing: .03em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid;
}
.at-status-chip__dot { width: 6px; height: 6px; border-radius: 50%; }
.at-status-chip--open       { background: rgba(34,197,94,.1);   color: #16a34a; border-color: rgba(34,197,94,.3); }
.at-status-chip--open       .at-status-chip__dot { background: #22c55e; }
.at-status-chip--inprogress { background: rgba(59,130,246,.1);  color: #2563eb; border-color: rgba(59,130,246,.3); }
.at-status-chip--inprogress .at-status-chip__dot { background: #3b82f6; }
.at-status-chip--closed     { background: rgba(156,163,175,.15);color: #6b7280; border-color: rgba(156,163,175,.4); }
.at-status-chip--closed     .at-status-chip__dot { background: #9ca3af; }

/* Pill-style button group (Assumir / Transferir / Encerrar / Reabrir) */
.at-action-pill-group {
  display: inline-flex;
  background: var(--cfv-bg-2);
  border: 1px solid var(--cfv-line);
  border-radius: 999px;
  padding: 3px;
  gap: 1px;
  flex-shrink: 0;
}
.at-action-pill {
  appearance: none; border: none; background: transparent;
  padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  color: var(--cfv-ink-2);
  font-family: var(--cfv-font);
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .15s, color .15s;
}
.at-action-pill:hover { background: var(--cfv-bg); color: var(--cfv-ink); }
.at-action-pill--primary { background: var(--cfv-navy); color: white; }
.at-action-pill--primary:hover { background: var(--cfv-navy-700); color: white; }
.at-action-pill--danger  { color: #dc2626; }
.at-action-pill--danger:hover  { background: #fef2f2; color: #b91c1c; }
body.at-dark .at-action-pill--danger:hover { background: rgba(220,38,38,.18); }

/* Icon-only header buttons with tooltip */
.at-icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid transparent; background: transparent;
  color: var(--cfv-ink-3); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
}
.at-icon-btn:hover {
  background: var(--cfv-bg-2); color: var(--cfv-navy); border-color: var(--cfv-line);
}
.at-icon-btn:active { transform: scale(.95); }
.at-icon-btn.active {
  background: var(--cfv-navy-50); color: var(--cfv-navy); border-color: var(--cfv-navy);
}
.at-icon-btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--cfv-ink); color: white;
  font-size: 11px; font-weight: 600; padding: 5px 9px;
  border-radius: 6px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  z-index: 600; pointer-events: none;
  animation: at-fade-in .15s var(--cfv-ease-out);
}
body.at-dark .at-icon-btn[data-tip]:hover::after { background: var(--cfv-bg-2); color: var(--cfv-ink); }

.at-icon-btn-group { display: flex; gap: 4px; flex-shrink: 0; }

/* Labels scrollable row below main header row */
.at-chat-header__tags {
  display: flex; gap: 6px;
  padding: 0 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}
.at-chat-header__tags::-webkit-scrollbar { display: none; }
.at-chat-header__tag {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid;
}
.at-chat-header__tag-remove {
  border: none; background: none; cursor: pointer;
  line-height: 1; padding: 0 0 0 2px; font-size: 12px;
  color: inherit; opacity: .65;
}
.at-chat-header__tag-remove:hover { opacity: 1; }
.at-chat-header__tag-add {
  width: 22px; height: 22px; border-radius: 99px;
  border: 1.5px dashed var(--cfv-line);
  background: transparent; color: var(--cfv-ink-3);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.at-chat-header__tag-add:hover { border-color: var(--cfv-navy); color: var(--cfv-navy); }

/* ── Message bubbles — polished ─────────────────────────── */
.at-msg-list {
  display: flex; flex-direction: column;
  padding: 16px 18px;
}
.at-msg-row {
  display: flex; align-items: center; gap: 4px;
  margin-top: 8px; /* gap between different senders */
}
.at-msg-row + .at-msg-row.is-same {
  margin-top: 2px;          /* tight gap for consecutive same-sender */
}
.at-msg-row--me { justify-content: flex-end; }

.at-bubble {
  max-width: 75%;
  padding: 10px 14px 8px;
  border-radius: 14px;
  font-size: 13.5px; line-height: 1.5;
  word-break: break-word;
  position: relative;
  transition: background .15s;
}
.at-bubble--me {
  background: var(--at-bubble-me-bg);
  color: var(--at-bubble-me-color);
  border-radius: 14px 4px 14px 14px;
  box-shadow: var(--at-bubble-me-shadow);
}
.at-bubble--other {
  background: var(--at-bubble-other-bg);
  color: var(--at-bubble-other-color);
  border-radius: 4px 14px 14px 14px;
  box-shadow: var(--at-bubble-other-shadow);
}
.at-bubble--deleted {
  background: var(--at-bubble-deleted-bg);
  color: var(--at-bubble-deleted-color);
  font-style: italic;
  box-shadow: none;
}
.at-bubble__meta {
  font-size: 10.5px; opacity: .65;
  text-align: right; margin-top: 3px;
  display: inline-flex; align-items: center; gap: 3px;
  float: right; margin-left: 8px;
}
.at-bubble__check {
  width: 11px; height: 11px; flex-shrink: 0;
}
.at-bubble__check--read { color: #34b7f1; }

.at-bubble img.at-msg-image {
  border-radius: 10px;
  display: block; max-width: 100%;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

/* Document message card */
.at-doc-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,.06);
  border-radius: 10px;
  text-decoration: none; color: inherit;
  min-width: 240px;
  transition: background .15s;
}
.at-bubble--me .at-doc-card { background: rgba(255,255,255,.14); }
.at-doc-card:hover { background: rgba(0,0,0,.10); }
.at-bubble--me .at-doc-card:hover { background: rgba(255,255,255,.22); }
.at-doc-card__icon {
  width: 38px; height: 38px; border-radius: 8px;
  background: #ef4444; color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.at-doc-card__info { flex: 1; min-width: 0; }
.at-doc-card__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-doc-card__sub { font-size: 10.5px; opacity: .75; margin-top: 1px; }

/* Audio player — compact, polished waveform */
.at-audio {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0;
  min-width: 220px;
}
.at-audio__btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.08);
  color: currentColor;
}
.at-bubble--me .at-audio__btn { background: rgba(255,255,255,.22); }
.at-audio__btn:hover { background: rgba(0,0,0,.16); }
.at-bubble--me .at-audio__btn:hover { background: rgba(255,255,255,.32); }
.at-audio__bar {
  flex: 1; height: 22px;
  display: flex; align-items: center; gap: 2px;
}
.at-audio__bar > i {
  display: block; flex: 1;
  background: currentColor; opacity: .35;
  border-radius: 2px;
  transition: opacity .2s, height .2s;
}
.at-audio__bar > i.played { opacity: .9; }
.at-audio__time {
  font-size: 11px; opacity: .7; min-width: 36px;
  font-variant-numeric: tabular-nums;
}

/* ── Chat input bar — elevated card feel ────────────────── */
.at-chat-input-bar {
  border-top: 1px solid var(--cfv-line);
  background: var(--cfv-bg);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 -2px 12px rgba(0,0,0,.04);
}
body.at-dark .at-chat-input-bar { box-shadow: 0 -2px 12px rgba(0,0,0,.2); }

.at-chat-input-bar textarea.at-input-textarea {
  flex: 1;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: 22px;
  border: 1px solid var(--cfv-line);
  background: var(--cfv-bg-2);
  color: var(--cfv-ink);
  font-size: 13.5px;
  resize: none;
  outline: none;
  line-height: 1.45;
  max-height: 120px;
  overflow-y: auto;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.at-chat-input-bar textarea.at-input-textarea:focus {
  border-color: var(--cfv-navy);
  box-shadow: 0 0 0 3px rgba(55,48,163,.12);
}

/* Round-square send button */
.at-send-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--cfv-navy);
  color: white;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(55,48,163,.25);
}
.at-send-btn:hover:not(:disabled) {
  background: var(--cfv-navy-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(55,48,163,.35);
}
.at-send-btn:active:not(:disabled) { transform: scale(.96); }
.at-send-btn:disabled { background: var(--cfv-line); cursor: not-allowed; box-shadow: none; }
.at-send-btn--mic { background: var(--cfv-navy); }
.at-send-btn--audio-go { background: #25d366; box-shadow: 0 2px 8px rgba(37,211,102,.3); }
.at-send-btn--audio-go:hover { background: #1ebe5b; box-shadow: 0 4px 12px rgba(37,211,102,.4); }

/* Toolbar icon buttons (desktop input row) */
.at-input-iconbtn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--cfv-line);
  background: var(--cfv-bg-2);
  color: var(--cfv-ink-3);
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s, transform .13s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.at-input-iconbtn:hover {
  background: var(--cfv-navy-50);
  color: var(--cfv-navy);
  border-color: rgba(55,48,163,.25);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(55,48,163,.12);
}
.at-input-iconbtn:active { transform: scale(.93) translateY(0); box-shadow: none; }
.at-input-iconbtn.active {
  background: var(--cfv-navy);
  color: white;
  border-color: var(--cfv-navy);
  box-shadow: 0 2px 8px rgba(55,48,163,.3);
}
.at-input-iconbtn--note.active { background: #f59e0b; color: white; border-color: #d97706; box-shadow: 0 2px 8px rgba(245,158,11,.3); }
.at-input-iconbtn--sign.active { background: var(--cfv-navy); color: white; border-color: var(--cfv-navy); }
.at-input-iconbtn--uploading { color: var(--cfv-navy); border-color: rgba(55,48,163,.3); background: var(--cfv-navy-50); }
.at-input-iconbtn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* Upload progress bar */
.at-upload-progress {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--cfv-navy-50);
  border-radius: 10px;
  flex: 1;
  border: 1px solid rgba(55,48,163,.15);
}
.at-upload-progress__icon {
  position: relative; flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.at-upload-progress__spinner {
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(55,48,163,.15);
  border-top-color: var(--cfv-navy);
  animation: at-spin 1s linear infinite;
}
.at-upload-progress__body { flex: 1; min-width: 0; }
.at-upload-progress__filename {
  font-size: 12px; font-weight: 600; color: var(--cfv-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}
.at-upload-progress__size { font-weight: 400; color: var(--cfv-ink-3); }
.at-upload-progress__bar-wrap {
  height: 4px; border-radius: 4px;
  background: rgba(55,48,163,.12);
  overflow: hidden; margin-bottom: 4px;
}
.at-upload-progress__bar {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--cfv-navy), #6366f1);
  transition: width .3s ease;
  min-width: 6px;
}
.at-upload-progress__pct {
  font-size: 10px; color: var(--cfv-navy); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@keyframes at-spin { to { transform: rotate(360deg); } }
@keyframes at-loading-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@keyframes at-shimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Audio recording — pulsing red dot + waveform animation */
.at-rec-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
}
.at-rec-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #ef4444; flex-shrink: 0;
  animation: cfv-pulse 1s infinite;
  box-shadow: 0 0 0 4px rgba(239,68,68,.18);
}
.at-rec-time {
  font-size: 15px; color: #ef4444; font-weight: 700;
  font-variant-numeric: tabular-nums; min-width: 42px;
}
.at-rec-wave {
  flex: 1; height: 28px;
  display: flex; align-items: center; gap: 3px;
}
.at-rec-wave > i {
  display: block; flex: 1;
  background: #ef4444; border-radius: 2px;
  height: 18px;
  animation: at-wave 1.1s ease-in-out infinite;
  transform-origin: center;
}
.at-rec-wave > i:nth-child(1)  { animation-delay: 0s;    }
.at-rec-wave > i:nth-child(2)  { animation-delay: .08s;  }
.at-rec-wave > i:nth-child(3)  { animation-delay: .16s;  }
.at-rec-wave > i:nth-child(4)  { animation-delay: .24s;  }
.at-rec-wave > i:nth-child(5)  { animation-delay: .32s;  }
.at-rec-wave > i:nth-child(6)  { animation-delay: .40s;  }
.at-rec-wave > i:nth-child(7)  { animation-delay: .48s;  }
.at-rec-wave > i:nth-child(8)  { animation-delay: .56s;  }
.at-rec-wave > i:nth-child(9)  { animation-delay: .64s;  }
.at-rec-wave > i:nth-child(10) { animation-delay: .72s;  }
.at-rec-wave > i:nth-child(11) { animation-delay: .80s;  }
.at-rec-wave > i:nth-child(12) { animation-delay: .88s;  }
.at-rec-cancel {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid #fca5a5; background: #fef2f2;
  color: #ef4444; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.at-rec-cancel:hover { background: #fee2e2; }

/* ── Quick replies popup (smooth slide-up + search) ─────── */
.at-rr-popup {
  position: absolute; bottom: calc(100% + 6px);
  left: 14px; right: 14px;
  z-index: 200;
  background: var(--cfv-bg);
  border: 1px solid var(--cfv-line);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.06);
  max-height: 280px;
  overflow: hidden;
  animation: at-slide-up .22s var(--cfv-ease-out);
  display: flex; flex-direction: column;
}
.at-rr-popup__search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--cfv-line-2);
  display: flex; align-items: center; gap: 8px;
}
.at-rr-popup__search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 13px; font-family: var(--cfv-font); color: var(--cfv-ink);
}
.at-rr-popup__list {
  flex: 1; overflow-y: auto;
}
.at-rr-popup__item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  display: flex; gap: 12px; align-items: center;
  border-bottom: 1px solid var(--cfv-line-2);
  transition: background .12s;
}
.at-rr-popup__item:last-child { border-bottom: none; }
.at-rr-popup__item:hover { background: var(--cfv-navy-50); }
body.at-dark .at-rr-popup__item:hover { background: var(--cfv-bg-2); }
.at-rr-popup__shortcut {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  background: var(--cfv-navy);
  color: white;
  min-width: 60px; text-align: center;
  flex-shrink: 0;
}
.at-rr-popup__text {
  color: var(--cfv-ink-2); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
}
.at-rr-popup__empty {
  padding: 24px; text-align: center;
  color: var(--cfv-ink-3); font-size: 12.5px;
}

/* ── Empty states — illustrated, motivational ───────────── */
.at-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 40px; text-align: center;
  color: var(--cfv-ink-3);
}
.at-empty__title { font-size: 17px; font-weight: 700; color: var(--cfv-ink); letter-spacing: -.01em; }
.at-empty__sub   { font-size: 13.5px; max-width: 360px; line-height: 1.5; }
.at-empty__art   { width: 160px; height: 160px; opacity: .9; }
.at-empty__wa-icon { width: 80px; height: 80px; opacity: .7; }

/* ── Emoji Picker ───────────────────────────────────────── */
.at-emoji-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 10px;
  z-index: 300;
  background: var(--cfv-bg);
  border: 1px solid var(--cfv-line);
  border-radius: 14px;
  box-shadow: 0 8px 36px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.07);
  width: 308px;
  overflow: hidden;
  animation: at-filt-appear .14s ease;
}
.at-emoji-cats {
  display: flex; overflow-x: auto;
  scrollbar-width: none;
  padding: 5px 6px;
  border-bottom: 1px solid var(--cfv-line);
  gap: 2px;
}
.at-emoji-cats::-webkit-scrollbar { display: none; }
.at-emoji-cat-btn {
  flex: none; width: 34px; height: 30px;
  border-radius: 8px; border: none; cursor: pointer;
  background: transparent; transition: background .12s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.at-emoji-cat-btn:hover  { background: var(--cfv-bg-2); }
.at-emoji-cat-btn.active { background: var(--cfv-navy-50); }
.at-emoji-cat-btn img    { width: 20px; height: 20px; pointer-events: none; }
.at-emoji-cat-label {
  padding: 5px 10px 2px; font-size: 10px; font-weight: 700;
  color: var(--cfv-ink-3); letter-spacing: .07em; text-transform: uppercase;
}
.at-emoji-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px;
  padding: 4px 6px 10px;
  max-height: 224px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--cfv-line) transparent;
}
.at-emoji-grid::-webkit-scrollbar { width: 4px; }
.at-emoji-grid::-webkit-scrollbar-thumb { background: var(--cfv-line); border-radius: 4px; }
.at-emoji-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 3px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s; aspect-ratio: 1; line-height: 1;
}
.at-emoji-btn:hover  { background: var(--cfv-bg-2); }
.at-emoji-btn:active { background: var(--cfv-navy-50); transform: scale(.9); }
.at-emoji-btn img    { width: 24px; height: 24px; pointer-events: none; display: block; }

/* desktop: mostra botões individuais, oculta + */
.at-input-desktop-btns { display: contents; }
.at-input-plus-btn { display: none; }
.at-plus-tray { display: none; }

@media (max-width: 768px) {
  /* oculta botões individuais no mobile */
  .at-input-desktop-btns { display: none; }
  .at-input-plus-btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    flex-shrink: 0; cursor: pointer;
    font-family: var(--cfv-font);
    transition: background .12s, border-color .12s, color .12s;
  }
  .at-plus-tray {
    display: flex; flex-direction: column;
    border-top: 1px solid var(--cfv-line);
    background: var(--cfv-bg);
    animation: at-filt-appear .14s ease;
  }
  .at-plus-opts-row {
    display: flex; gap: 8px; padding: 10px 14px;
    overflow-x: auto; scrollbar-width: none;
  }
  .at-plus-opts-row::-webkit-scrollbar { display: none; }
  .at-plus-opt {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 10px 14px; border-radius: 12px;
    border: 1.5px solid var(--cfv-line); background: var(--cfv-bg);
    cursor: pointer; font-family: var(--cfv-font);
    font-size: 11px; font-weight: 600; color: var(--cfv-ink-2);
    flex-shrink: 0; min-width: 64px;
    transition: background .12s, border-color .12s, color .12s;
    min-height: 64px;
  }
  .at-plus-opt:hover, .at-plus-opt.active {
    background: var(--cfv-navy-50);
    border-color: var(--cfv-navy);
    color: var(--cfv-navy);
  }
  .at-plus-opt:disabled { opacity: .45; }
  .at-plus-opt__icon { display: flex; align-items: center; justify-content: center; line-height: 1; }
  .at-plus-tray .at-emoji-picker {
    position: relative !important;
    bottom: auto !important; left: auto !important; right: auto !important;
    width: 100% !important; border-radius: 0 !important;
    border-left: none !important; border-right: none !important;
    border-top: 1px solid var(--cfv-line) !important;
    border-bottom: none !important;
    box-shadow: none !important;
    max-height: 260px; overflow-y: auto;
  }
  .at-plus-tray .at-emoji-grid { max-height: 190px !important; }
}

/* ── Filtros de conversa ────────────────────────────────── */
/* chips (mobile) */
.at-filt-bar {
  display: none;
  gap: 5px;
  padding: 8px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--cfv-line);
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.at-filt-bar::-webkit-scrollbar { display: none; }
.at-filt-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  border: 1.5px solid var(--cfv-line);
  color: var(--cfv-ink-3); background: transparent;
  transition: background .15s, color .15s, border-color .15s;
  font-family: var(--cfv-font);
  flex-shrink: 0; user-select: none; line-height: 1;
  min-height: 32px;
}
.at-filt-chip:hover  { border-color: var(--cfv-navy); color: var(--cfv-navy); background: var(--cfv-navy-50); }
.at-filt-chip.active { background: var(--cfv-navy); color: #fff; border-color: var(--cfv-navy); }
.at-filt-chip.active .at-filt-count { background: rgba(255,255,255,.2); color: #fff; }

/* dropdown (desktop) */
.at-filt-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--cfv-line);
  flex-shrink: 0;
}
.at-filt-header__title {
  font-size: 10.5px; font-weight: 700; color: var(--cfv-ink-3);
  letter-spacing: .1em; text-transform: uppercase;
}
.at-filt-dropdown { position: relative; }
.at-filt-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  border: 1.5px solid var(--cfv-line); background: var(--cfv-bg);
  color: var(--cfv-ink-2); font-size: 11.5px; font-weight: 600;
  cursor: pointer; font-family: var(--cfv-font);
  transition: border-color .12s, background .12s, color .12s;
  line-height: 1;
}
.at-filt-btn:hover, .at-filt-btn.open {
  border-color: var(--cfv-navy); color: var(--cfv-navy); background: var(--cfv-navy-50);
}
.at-filt-count {
  font-size: 9.5px; font-weight: 700; padding: 2px 6px;
  border-radius: 99px; background: var(--cfv-line);
  color: var(--cfv-ink-3); line-height: 1.4;
  transition: background .12s, color .12s;
}
.at-filt-btn:hover .at-filt-count,
.at-filt-btn.open .at-filt-count {
  background: #d4d8f8; color: var(--cfv-navy);
}
.at-filt-count--alert { background: #22c55e !important; color: #fff !important; }
.at-filt-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--cfv-bg);
  border: 1px solid var(--cfv-line);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,.16), 0 1px 4px rgba(0,0,0,.06);
  z-index: 50; min-width: 200px; overflow: hidden;
  animation: at-slide-up .15s var(--cfv-ease-out);
}
@keyframes at-filt-appear {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.at-filt-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px;
  border: none; background: transparent; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--cfv-ink-2);
  font-family: var(--cfv-font); text-align: left;
  transition: background .12s;
}
.at-filt-opt:not(:last-child) { border-bottom: 1px solid var(--cfv-line-2); }
.at-filt-opt:hover { background: var(--cfv-bg-2); }
.at-filt-opt.active { font-weight: 700; color: var(--cfv-navy); background: var(--cfv-navy-50); }
.at-filt-opt__label { flex: 1; }
.at-filt-opt .at-filt-count { background: var(--cfv-line); color: var(--cfv-ink-3); }
.at-filt-opt.active .at-filt-count { background: #d4d8f8; color: var(--cfv-navy); }

/* ── Chat backgrounds ───────────────────────────────────── */
.at-whatsapp-bg { background-color: #efeae2; }
body.at-dark .at-whatsapp-bg { background-color: #0d1418; }

/* Chat background variants (controlled via React state) */
.at-chat-bg-default  {
  background-color: #efeae2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cg fill='%23c8b89a' fill-opacity='0.15'%3E%3Cpath d='M20 18c0-1.1.9-2 2-2h4a2 2 0 110 4h-1v2h-1v-2h-2a2 2 0 01-2-2zm1.5 0a.5.5 0 00.5.5h4a.5.5 0 000-1h-4a.5.5 0 00-.5.5zM25 21v1h-2v-1h2zM70 68c0-1.1.9-2 2-2h4a2 2 0 110 4h-1v2h-1v-2h-2a2 2 0 01-2-2zm1.5 0a.5.5 0 00.5.5h4a.5.5 0 000-1h-4a.5.5 0 00-.5.5zM75 71v1h-2v-1h2zM48 45a8 8 0 100 16 8 8 0 000-16zm-5.6 4.4a7 7 0 019.1-.7l-9.8 9.8a7 7 0 01.7-9.1zm1.2 10.3l9.8-9.8a7 7 0 01-9.8 9.8zM15 55a5 5 0 100 10 5 5 0 000-10zm-3.5 3.5a4 4 0 015.2-.4l-5.6 5.6a4 4 0 01.4-5.2zm.9 6.2l5.6-5.6a4 4 0 01-5.6 5.6zM80 20a5 5 0 100 10 5 5 0 000-10zm-3.5 3.5a4 4 0 015.2-.4l-5.6 5.6a4 4 0 01.4-5.2zm.9 6.2l5.6-5.6a4 4 0 01-5.6 5.6z'/%3E%3C/g%3E%3C/svg%3E");
}
.at-chat-bg-white    { background-color: #ffffff; }
.at-chat-bg-gray     { background-color: #f1f5f9; }
.at-chat-bg-deep     { background-color: #0f172a; }
.at-chat-bg-emerald  { background-color: #052e16; }
.at-chat-bg-grad1    { background: linear-gradient(135deg, #667eea, #764ba2); }
.at-chat-bg-grad2    { background: linear-gradient(135deg, #f093fb, #f5576c); }
.at-chat-bg-grad3    { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.at-chat-bg-grad4    { background: linear-gradient(135deg, #fa709a, #fee140); }

body.at-dark .at-chat-bg-default,
body.at-dark .at-chat-bg-white,
body.at-dark .at-chat-bg-gray { background-color: #0d1418; }

/* ── Metrics module — KPI cards w/ colored borders ─────── */
.at-kpi-card {
  background: var(--cfv-surface);
  border-radius: var(--cfv-radius);
  border: 1px solid var(--cfv-line-2);
  border-left-width: 4px;
  border-left-style: solid;
  box-shadow: var(--cfv-shadow-sm);
  padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative;
  overflow: hidden;
}
.at-kpi-card__body { flex: 1; }
.at-kpi-card__label {
  font-size: 11px; font-weight: 700;
  color: var(--cfv-ink-3); text-transform: uppercase; letter-spacing: .07em;
}
.at-kpi-card__value {
  font-size: 28px; font-weight: 800;
  color: var(--cfv-ink); margin-top: 6px;
  letter-spacing: -.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.at-kpi-card__icon {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  opacity: .85;
}

/* Period filter segmented control */
.at-period-filter {
  display: inline-flex;
  background: var(--cfv-bg-2);
  border: 1px solid var(--cfv-line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.at-period-filter button {
  appearance: none; border: none; background: transparent;
  padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
  color: var(--cfv-ink-2); font-family: var(--cfv-font);
  transition: background .15s, color .15s;
}
.at-period-filter button:hover { color: var(--cfv-ink); }
.at-period-filter button.active {
  background: var(--cfv-navy); color: white;
  box-shadow: 0 2px 6px rgba(55,48,163,.3);
}

/* Bar chart — rounded ends */
.at-bar-chart-row { display: flex; align-items: center; gap: 10px; }
.at-bar-chart-row__label { font-size: 11.5px; color: var(--cfv-ink-2); min-width: 84px; font-weight: 600; }
.at-bar-chart-row__bar {
  flex: 1; height: 16px;
  background: var(--cfv-line-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.at-bar-chart-row__fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--cfv-navy), var(--cfv-navy-700));
  transition: width .6s var(--cfv-ease-out);
}
.at-bar-chart-row__val {
  font-size: 11.5px; color: var(--cfv-ink); font-weight: 700;
  min-width: 40px; text-align: right; font-variant-numeric: tabular-nums;
}

/* Satisfaction stars */
.at-sat-row { display: flex; align-items: center; gap: 10px; }
.at-sat-row__stars { display: inline-flex; gap: 2px; min-width: 100px; color: var(--cfv-yellow); }

/* ── Toasts ─────────────────────────────────────────────── */
@keyframes at-toast-in {
  from { opacity: 0; transform: translateX(30px) scale(.96); }
  to   { opacity: 1; transform: translateX(0)    scale(1);   }
}
.at-toast {
  background: var(--cfv-surface);
  border: 1px solid var(--cfv-line);
  border-left: 3px solid var(--cfv-navy);
  border-radius: 12px;
  padding: 11px 12px;
  box-shadow: var(--cfv-shadow-lg);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  animation: at-toast-in .22s cubic-bezier(.34,1.56,.64,1);
  transition: filter .12s;
}
.at-toast:hover { filter: brightness(1.04); }
.at-toast__nome {
  font-weight: 700; font-size: 13px; color: var(--cfv-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.at-toast__msg {
  font-size: 12px; color: var(--cfv-ink-2);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.at-toast__close {
  background: none; border: none; cursor: pointer;
  color: var(--cfv-ink-3); font-size: 20px; line-height: 1;
  padding: 0 2px; flex-shrink: 0; opacity: .6;
  transition: opacity .12s;
}
.at-toast__close:hover { opacity: 1; }

/* ── Modals (generic full-screen on mobile) ─────────────── */
.at-modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  animation: at-fade-in .18s var(--cfv-ease-out);
}
.at-modal {
  background: var(--cfv-surface);
  border: 1px solid var(--cfv-line);
  border-radius: 14px;
  box-shadow: var(--cfv-shadow-lg);
  display: flex; flex-direction: column;
  max-height: 80vh; max-width: 90vw;
  overflow: hidden;
  animation: at-slide-up .22s var(--cfv-ease-out);
}
.at-modal__head {
  padding: 16px 18px; border-bottom: 1px solid var(--cfv-line);
  font-weight: 700; font-size: 15px; color: var(--cfv-ink);
  display: flex; align-items: center; gap: 8px;
}
.at-modal__close {
  margin-left: auto; width: 30px; height: 30px;
  border: none; background: var(--cfv-bg-2); cursor: pointer;
  color: var(--cfv-ink-3); border-radius: 8px;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.at-modal__close:hover { background: var(--cfv-line); color: var(--cfv-ink); }

/* ── Mobile responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  /* Filter chips on mobile */
  .at-filt-bar    { display: flex !important; }
  .at-filt-header { display: none !important; }

  /* Prevent iOS auto-zoom */
  input, textarea, select { font-size: 16px !important; }

  .at-mobile-bar { display: flex; }

  /* Sidebar slide-in drawer */
  .at-sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    width: 272px !important; z-index: 100;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .at-sidebar--open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,.4);
  }

  /* Hide online agents bar on mobile to save space */
  .at-agent-status-bar { display: none; }

  /* Conv panel: full width, hidden when chat selected */
  .at-conv-panel { width: 100% !important; border-right: none !important; }
  .at-conv-panel--hidden { display: none !important; }

  /* Notificações: no celular o aparelho já toca sozinho (app nativo / push do
     sistema). O botão só levava o vendedor a tocar sem querer — fica só no PC. */
  .at-push-btn { display: none !important; }

  /* Header mobile: linha única — voltar(ícone) | avatar | nome | kebab */
  .at-conv-actions { display: none !important; }
  .at-conv-kebab   { display: flex !important; }
  .at-back-btn     { display: inline-flex !important;
                     padding: 6px 8px; min-width: 34px; justify-content: center; }
  .at-back-btn__txt        { display: none; }
  .at-chat-header__top     { padding: 7px 8px; gap: 6px; }
  .at-chat-header__meta    { font-size: 11px; }
  .at-status-chip          { display: none; }
  .at-chat-header__tags    { padding: 0 8px 6px; }

  /* Settings padding */
  .at-cfg { padding: 14px; gap: 14px; }
  .at-cfg-card__body { padding: 14px 16px; }
  .at-cfg-card__head { padding: 14px 16px; }

  /* Safe-area on chat input */
  .at-conv-panel > div:last-child { padding-bottom: env(safe-area-inset-bottom, 12px); }
  .at-chat-input-bar { padding-bottom: env(safe-area-inset-bottom, 0px); }

  /* Touch targets ≥44px */
  .at-input-iconbtn,
  .at-send-btn,
  .at-back-btn,
  .at-icon-btn { min-width: 44px; min-height: 44px; }

  /* Theme + wallpaper swatches: 3-col grid */
  .at-theme-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .at-theme-swatch { width: 100%; height: 60px; }
  .at-wp-grid { grid-template-columns: repeat(3, 1fr); }

  /* KPI cards single column */
  .at-kpi-grid { grid-template-columns: 1fr !important; }

  /* Products & contacts single column on mobile */
  .at-prod-grid { grid-template-columns: 1fr !important; }

  /* Quick replies popup as bottom sheet */
  .at-rr-popup {
    position: fixed !important;
    bottom: 0 !important; left: 0 !important; right: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    max-height: 60vh !important;
    animation: at-slide-up .26s var(--cfv-ease-out);
  }
  .at-rr-popup::before {
    content: ''; display: block;
    width: 40px; height: 4px;
    background: var(--cfv-line);
    border-radius: 2px;
    margin: 8px auto 0;
  }

  /* Modals full-screen */
  .at-modal { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; border-radius: 0; }
  .at-modal--fullscreen { border-radius: 0; width: 100vw; height: 100vh; }

  /* Toasts at top */
  .at-toast-stack {
    bottom: auto !important; top: 60px !important;
    right: 12px !important; left: 12px !important;
    width: auto !important;
  }
  .at-toast { padding: 10px 12px; }

  /* Pill button group scrolls horizontally */
  .at-action-pill-group { overflow-x: auto; max-width: 100%; }
  .at-icon-btn-group { flex-shrink: 0; }
}


/* ════════════════════════════════════════════════════════════
   DARK MODE — comprehensive audit + new surface tokens
   ════════════════════════════════════════════════════════════ */
:root {
  /* Surface aliases (used by toasts, transfer menus, etc) */
  --cfv-surface:   #ffffff;
  --cfv-surface-2: #f9fafb;
  --cfv-navy-tint: rgba(55, 48, 163, 0.08);
  --cfv-ink-overlay: rgba(10, 14, 26, 0.04);
}

body.at-dark {
  --cfv-surface:    #1e293b;
  --cfv-surface-2:  #162032;
  --cfv-navy-tint:  rgba(99, 102, 241, 0.18);
  --cfv-ink-overlay: rgba(255, 255, 255, 0.06);

  --cfv-shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.3);
  --cfv-shadow:     0 8px 24px rgba(0,0,0,0.5);
  --cfv-shadow-md:  0 4px 16px rgba(0,0,0,0.45);
  --cfv-shadow-lg:  0 16px 48px rgba(0,0,0,0.6);
}

/* Cards / panels using hardcoded white */
body.at-dark .at-card,
body.at-dark .adm-card,
body.at-dark .at-cfg-card,
body.at-dark .at-login__card,
body.at-dark .at-kpi-card,
body.at-dark .at-modal,
body.at-dark .at-funil-card,
body.at-dark .at-camp-row {
  background: var(--cfv-surface);
  border-color: var(--cfv-line);
  color: var(--cfv-ink);
}

/* Card headers and inner sections */
body.at-dark .at-cfg-card__head { border-color: var(--cfv-line); color: var(--cfv-ink); }
body.at-dark .at-cfg-card__head-icon { background: var(--cfv-navy-tint); color: #a5b4fc; }
body.at-dark .at-cfg-card__head-title { color: var(--cfv-ink); }
body.at-dark .at-cfg-card__head-sub { color: var(--cfv-ink-3); }

/* Chat area + header */
body.at-dark .at-chat-header { background: var(--cfv-surface); border-color: var(--cfv-line); }
body.at-dark .at-chat-header__name { color: var(--cfv-ink); }
body.at-dark .at-chat-header__meta { color: var(--cfv-ink-3); }
body.at-dark .at-action-pill-group { background: var(--cfv-surface-2); border-color: var(--cfv-line); }
body.at-dark .at-action-pill { color: var(--cfv-ink-2); }
body.at-dark .at-action-pill:hover { background: var(--cfv-bg-2); color: var(--cfv-ink); }
body.at-dark .at-action-pill--danger:hover { background: rgba(220,38,38,.2); }
body.at-dark .at-icon-btn { color: var(--cfv-ink-3); }
body.at-dark .at-icon-btn:hover { background: var(--cfv-ink-overlay); color: #a5b4fc; border-color: var(--cfv-line); }

/* Conversation list */
body.at-dark .at-conv-panel { background: var(--cfv-bg); }
body.at-dark .at-conv-item { border-bottom-color: var(--cfv-line); }
body.at-dark .at-conv-item__name { color: var(--cfv-ink); }
body.at-dark .at-conv-item__preview { color: var(--cfv-ink-3); }
body.at-dark .at-conv-item__time { color: var(--cfv-ink-3); }
body.at-dark .at-conv-item:hover { background: var(--cfv-ink-overlay); }
body.at-dark .at-conv-item.is-selected {
  background: linear-gradient(135deg, var(--cfv-navy) 0%, #1e1b4b 100%);
  color: white;
}
body.at-dark .at-conv-item__status { border-color: var(--cfv-bg); }
body.at-dark .at-conv-item.is-selected .at-conv-item__status { border-color: var(--cfv-navy); }
body.at-dark .at-conv-item.is-closed { background: var(--cfv-surface-2); }

/* Empty state */
body.at-dark .at-empty__title { color: var(--cfv-ink); }
body.at-dark .at-empty__sub { color: var(--cfv-ink-3); }

/* Note interna bubble in dark mode */
body.at-dark .at-note-bubble {
  background: #2d2a1e !important;
  border-color: #4a3e22 !important;
  color: #fef3c7 !important;
}

/* Input bar */
body.at-dark .at-chat-input-bar { background: var(--cfv-surface); border-color: var(--cfv-line); }
body.at-dark .at-chat-input-bar textarea.at-input-textarea {
  background: var(--cfv-bg-2); color: var(--cfv-ink); border-color: var(--cfv-line);
}
body.at-dark .at-chat-input-bar textarea.at-input-textarea:focus {
  border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129,140,248,.18);
}
body.at-dark .at-input-iconbtn { color: var(--cfv-ink-3); background: var(--cfv-bg-2); border-color: var(--cfv-line); }
body.at-dark .at-input-iconbtn:hover { background: var(--cfv-ink-overlay); color: #a5b4fc; border-color: rgba(163,153,255,.3); box-shadow: 0 3px 8px rgba(99,102,241,.15); }
body.at-dark .at-input-iconbtn.active { background: var(--cfv-navy); color: white; border-color: var(--cfv-navy); }
body.at-dark .at-upload-progress { background: rgba(55,48,163,.15); border-color: rgba(99,102,241,.25); }
body.at-dark .at-upload-progress__filename { color: var(--cfv-ink); }
body.at-dark .at-upload-progress__bar-wrap { background: rgba(99,102,241,.15); }

/* Quick replies popup */
body.at-dark .at-rr-popup { background: var(--cfv-surface); border-color: var(--cfv-line); }
body.at-dark .at-rr-popup__search { border-bottom-color: var(--cfv-line); }
body.at-dark .at-rr-popup__search input { color: var(--cfv-ink); }
body.at-dark .at-rr-popup__item { border-bottom-color: var(--cfv-line); color: var(--cfv-ink); }
body.at-dark .at-rr-popup__item:hover { background: var(--cfv-ink-overlay); }
body.at-dark .at-rr-popup__text { color: var(--cfv-ink-2); }
body.at-dark .at-rr-popup__empty { color: var(--cfv-ink-3); }

/* Dropdowns + tag panels */
body.at-dark .at-filt-menu,
body.at-dark .at-transfer-menu,
body.at-dark .at-tags-panel,
body.at-dark .at-msg-menu { background: var(--cfv-surface); border-color: var(--cfv-line); color: var(--cfv-ink); }
body.at-dark .at-filt-btn { background: var(--cfv-surface); border-color: var(--cfv-line); color: var(--cfv-ink-2); }
body.at-dark .at-filt-btn:hover, body.at-dark .at-filt-btn.open { background: var(--cfv-navy-tint); color: #a5b4fc; border-color: #6366f1; }
body.at-dark .at-filt-opt { color: var(--cfv-ink-2); }
body.at-dark .at-filt-opt:hover { background: var(--cfv-ink-overlay); }
body.at-dark .at-filt-opt.active { background: var(--cfv-navy-tint); color: #a5b4fc; }
body.at-dark .at-filt-count { background: var(--cfv-bg-2); color: var(--cfv-ink-3); }

/* Modals */
body.at-dark .at-modal { background: var(--cfv-surface); border-color: var(--cfv-line); }
body.at-dark .at-modal__head { background: var(--cfv-surface); border-color: var(--cfv-line); color: var(--cfv-ink); }
body.at-dark .at-modal__close { background: var(--cfv-bg-2); color: var(--cfv-ink-3); }
body.at-dark .at-modal__close:hover { background: var(--cfv-line); color: var(--cfv-ink); }

/* Toasts */
body.at-dark .at-toast { background: var(--cfv-surface); border-color: var(--cfv-line); color: var(--cfv-ink); }
body.at-dark .at-toast__nome { color: var(--cfv-ink); }
body.at-dark .at-toast__msg { color: var(--cfv-ink-2); }

/* Aparência section */
body.at-dark .at-darkmode-row { background: var(--cfv-bg-2); border-color: var(--cfv-line); }
body.at-dark .at-darkmode-row__title { color: var(--cfv-ink); }
body.at-dark .at-darkmode-row__sub { color: var(--cfv-ink-3); }

/* KPI cards */
body.at-dark .at-kpi-card { background: var(--cfv-surface); border-color: var(--cfv-line); }
body.at-dark .at-kpi-card__value { color: var(--cfv-ink); }
body.at-dark .at-kpi-card__label { color: var(--cfv-ink-3); }

/* Toggle */
body.at-dark .at-toggle__track { background: #374151; }
body.at-dark .at-toggle input:checked ~ .at-toggle__track { background: #6366f1; }

/* Login in dark */
body.at-dark .at-login { background: radial-gradient(120% 90% at 50% 0%, #0f4c3a 0%, #0b2a2f 45%, #08141c 100%); }
body.at-dark .at-login__card { background: var(--cfv-surface); border: 1px solid var(--cfv-line); }
body.at-dark .at-login__card-head { border-color: var(--cfv-line); }
body.at-dark .at-login__card-head h1 { color: var(--cfv-ink); }
body.at-dark .at-login__card-head p { color: var(--cfv-ink-3); }
body.at-dark .at-login__tag { background: var(--cfv-navy-tint); color: #a5b4fc; }
body.at-dark .at-field input { background: var(--cfv-bg-2); color: var(--cfv-ink); border-color: var(--cfv-line); }
body.at-dark .at-field input::placeholder { color: var(--cfv-ink-3); }

/* Tables + alternating rows */
body.at-dark .at-table-row { border-bottom-color: var(--cfv-line); color: var(--cfv-ink); }
body.at-dark .at-table-row:nth-child(even) { background: var(--cfv-bg-2); }

/* Search inputs in conv panel */
body.at-dark .at-conv-panel input[placeholder*="Buscar"],
body.at-dark .at-conv-panel input[placeholder*="conversa"] {
  background: var(--cfv-bg-2) !important;
  color: var(--cfv-ink) !important;
  border-color: var(--cfv-line) !important;
}

/* Agent status bar inside sidebar */
.at-agent-status-bar { background: rgba(0,0,0,.18); border-top: 1px solid rgba(255,255,255,.06); }
body.at-dark .at-agent-status-bar { background: rgba(0,0,0,.3); }

/* ════════════════════════════════════════════════════════════
   CHANNEL BADGES on conversation avatar
   ════════════════════════════════════════════════════════════ */
.at-channel-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 7.5px; font-weight: 800; color: white;
  letter-spacing: 0;
  border: 1.5px solid var(--cfv-bg);
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  flex-shrink: 0;
}
.at-channel-badge--wa { background: #25d366; }
.at-channel-badge--ig { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045); }
.at-channel-badge--fb { background: #1877f2; }

/* Channel pill in chat header */
.at-channel-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid;
}
.at-channel-pill__dot { width: 6px; height: 6px; border-radius: 50%; }
.at-channel-pill--wa { background: rgba(37,211,102,.12); color: #15803d; border-color: rgba(37,211,102,.4); }
.at-channel-pill--wa .at-channel-pill__dot { background: #25d366; }
.at-channel-pill--ig { background: rgba(189,71,255,.12); color: #7e22ce; border-color: rgba(189,71,255,.4); }
.at-channel-pill--ig .at-channel-pill__dot { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045); }
.at-channel-pill--fb { background: rgba(24,119,242,.12); color: #1d4ed8; border-color: rgba(24,119,242,.4); }
.at-channel-pill--fb .at-channel-pill__dot { background: #1877f2; }
body.at-dark .at-channel-pill--wa { background: rgba(37,211,102,.18); color: #4ade80; }
body.at-dark .at-channel-pill--ig { background: rgba(189,71,255,.22); color: #d8b4fe; }
body.at-dark .at-channel-pill--fb { background: rgba(24,119,242,.22); color: #93c5fd; }

/* ════════════════════════════════════════════════════════════
   FUNIL DE VENDAS — Kanban
   ════════════════════════════════════════════════════════════ */
.at-funil {
  flex: 1; min-height: 0; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  background: var(--cfv-bg-soft);
  overflow: hidden;
}
.at-funil__board {
  flex: 1;
  display: flex; gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.at-funil__col {
  flex: 0 0 300px;
  min-width: 280px;
  max-width: 320px;
  background: var(--cfv-bg-2);
  border-radius: 14px;
  display: flex; flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--cfv-line);
}
body.at-dark .at-funil__col { background: var(--cfv-surface-2); border-color: var(--cfv-line); }
.at-funil__col-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--cfv-line);
  background: var(--cfv-bg);
}
body.at-dark .at-funil__col-head { background: var(--cfv-surface); }
.at-funil__col-title {
  font-size: 12.5px; font-weight: 700;
  color: var(--cfv-ink);
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; gap: 8px;
}
.at-funil__col-count {
  font-size: 11px; font-weight: 700;
  background: var(--cfv-line); color: var(--cfv-ink-2);
  padding: 1px 7px; border-radius: 99px;
  margin-left: auto;
}
.at-funil__col-value {
  font-size: 13px; font-weight: 600;
  color: var(--cfv-ink-2); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.at-funil__col--won .at-funil__col-head {
  background: #ecfdf5; border-bottom-color: #a7f3d0;
}
.at-funil__col--won .at-funil__col-title { color: #047857; }
body.at-dark .at-funil__col--won .at-funil__col-head { background: #064e3b; border-bottom-color: #065f46; }
body.at-dark .at-funil__col--won .at-funil__col-title { color: #6ee7b7; }

.at-funil__col--lost .at-funil__col-head {
  background: #fef2f2; border-bottom-color: #fecaca;
}
.at-funil__col--lost .at-funil__col-title { color: #b91c1c; }
body.at-dark .at-funil__col--lost .at-funil__col-head { background: #7f1d1d; border-bottom-color: #991b1b; }
body.at-dark .at-funil__col--lost .at-funil__col-title { color: #fca5a5; }

.at-funil__list {
  flex: 1; padding: 10px;
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto;
}
.at-funil-card {
  background: var(--cfv-bg);
  border: 1px solid var(--cfv-line);
  border-radius: 12px;
  padding: 12px 13px;
  cursor: grab;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s var(--cfv-ease-out), box-shadow .15s, border-color .15s, opacity .15s;
  box-shadow: var(--cfv-shadow-xs);
  user-select: none;
}
.at-funil-card:active { cursor: grabbing; }
.at-funil-card.is-dragging { opacity: .3; transform: scale(.97); box-shadow: none; }
.at-funil-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  border-color: var(--cfv-navy);
}
body.at-dark .at-funil-card { background: var(--cfv-surface); border-color: var(--cfv-line); }
body.at-dark .at-funil-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.4); border-color: #6366f1; }
.at-funil-card__name { font-weight: 700; font-size: 13.5px; color: var(--cfv-ink); }
.at-funil-card__value {
  font-size: 16px; font-weight: 800; color: var(--cfv-navy);
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
body.at-dark .at-funil-card__value { color: #a5b4fc; }
.at-funil-card__foot {
  display: flex; align-items: center; gap: 8px;
}
.at-funil-card__agent {
  width: 22px; height: 22px; border-radius: 50%;
  color: white; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.at-funil-card__days {
  font-size: 11px; color: var(--cfv-ink-3); font-weight: 600;
  margin-left: auto;
}

/* Side panel */
.at-funil-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 96vw;
  background: var(--cfv-bg);
  border-left: 1px solid var(--cfv-line);
  box-shadow: var(--cfv-shadow-lg);
  z-index: 800;
  display: flex; flex-direction: column;
  animation: at-slide-left .26s var(--cfv-ease-out);
}
@keyframes at-slide-left {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
body.at-dark .at-funil-panel { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-funil-panel__head {
  padding: 16px 18px; border-bottom: 1px solid var(--cfv-line);
  display: flex; align-items: center; gap: 10px;
}
.at-funil-panel__title { flex: 1; font-size: 16px; font-weight: 700; color: var(--cfv-ink); }
.at-funil-panel__body { flex: 1; overflow-y: auto; padding: 18px; }
.at-funil-panel__meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-bottom: 18px;
}
.at-funil-panel__meta-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--cfv-ink-3); margin-bottom: 3px;
}
.at-funil-panel__meta-value { font-size: 13.5px; font-weight: 600; color: var(--cfv-ink); }
.at-funil-panel__section-title {
  font-size: 11px; font-weight: 700; color: var(--cfv-ink-3);
  text-transform: uppercase; letter-spacing: .07em;
  margin: 18px 0 8px;
}
.at-funil-panel__history-item {
  padding: 10px 0; border-bottom: 1px solid var(--cfv-line-2);
  display: flex; gap: 10px; align-items: flex-start;
}
.at-funil-panel__history-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--cfv-navy);
  flex-shrink: 0; margin-top: 5px;
}
.at-funil-panel__history-text { flex: 1; font-size: 12.5px; color: var(--cfv-ink-2); }
.at-funil-panel__history-date { font-size: 10.5px; color: var(--cfv-ink-3); margin-top: 2px; }
.at-funil-panel__notes {
  width: 100%; min-height: 110px;
  border: 1px solid var(--cfv-line); border-radius: 10px;
  padding: 10px 12px; font-family: var(--cfv-font); font-size: 13px;
  color: var(--cfv-ink); background: var(--cfv-bg-2);
  outline: none; resize: vertical;
}
.at-funil-panel__notes:focus { border-color: var(--cfv-navy); }

/* ════════════════════════════════════════════════════════════
   CAMPANHAS
   ════════════════════════════════════════════════════════════ */
.at-camp { flex: 1; min-height: 0; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 18px; background: var(--cfv-bg-soft); }

.at-camp__list { display: flex; flex-direction: column; gap: 10px; }
.at-camp-row {
  background: var(--cfv-bg);
  border: 1px solid var(--cfv-line);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto auto auto;
  gap: 16px;
  align-items: center;
  transition: box-shadow .15s;
}
.at-camp-row:hover { box-shadow: var(--cfv-shadow-md); }
.at-camp-row__name { font-weight: 700; font-size: 14px; color: var(--cfv-ink); }
.at-camp-row__sub { font-size: 12px; color: var(--cfv-ink-3); margin-top: 2px; }
.at-camp-stats {
  display: flex; gap: 6px;
}
.at-camp-stat {
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 4px;
}
.at-camp-stat--sent       { background: rgba(99,102,241,.12); color: #4338ca; }
.at-camp-stat--delivered  { background: rgba(34,197,94,.12);  color: #15803d; }
.at-camp-stat--read       { background: rgba(59,130,246,.12); color: #1d4ed8; }
body.at-dark .at-camp-stat--sent       { background: rgba(129,140,248,.2); color: #c7d2fe; }
body.at-dark .at-camp-stat--delivered  { background: rgba(74,222,128,.2);  color: #86efac; }
body.at-dark .at-camp-stat--read       { background: rgba(147,197,253,.2); color: #bfdbfe; }

/* Campaign wizard */
.at-camp-wiz {
  background: var(--cfv-bg);
  border-radius: 14px;
  width: 720px; max-width: 96vw; max-height: 92vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
body.at-dark .at-camp-wiz { background: var(--cfv-surface); }
.at-camp-wiz__steps {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--cfv-line);
}
.at-camp-wiz__step {
  flex: 1; height: 6px; border-radius: 99px;
  background: var(--cfv-line); transition: background .25s;
}
.at-camp-wiz__step.is-active   { background: var(--cfv-navy); }
.at-camp-wiz__step.is-done     { background: var(--cfv-green); }
.at-camp-wiz__body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.at-camp-wiz__foot {
  display: flex; gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--cfv-line);
}
.at-camp-wiz__h {
  font-size: 18px; font-weight: 800; color: var(--cfv-ink);
  letter-spacing: -.01em; margin-bottom: 4px;
}
.at-camp-wiz__sub {
  font-size: 13px; color: var(--cfv-ink-3); margin-bottom: 18px;
}
.at-camp-wiz__channel-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
}
.at-camp-wiz__channel-card {
  background: var(--cfv-bg-2);
  border: 2px solid var(--cfv-line);
  border-radius: 12px;
  padding: 18px 14px;
  cursor: pointer; text-align: center;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  transition: border-color .15s, transform .12s, background .15s;
}
.at-camp-wiz__channel-card:hover { transform: translateY(-2px); }
.at-camp-wiz__channel-card.is-active { border-color: var(--cfv-navy); background: var(--cfv-navy-50); }
body.at-dark .at-camp-wiz__channel-card { background: var(--cfv-bg-2); border-color: var(--cfv-line); color: var(--cfv-ink); }
body.at-dark .at-camp-wiz__channel-card.is-active { border-color: #818cf8; background: var(--cfv-navy-tint); }
.at-camp-wiz__channel-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.at-camp-wiz__channel-name { font-size: 13.5px; font-weight: 700; color: var(--cfv-ink); }
.at-camp-wiz__channel-sub { font-size: 11.5px; color: var(--cfv-ink-3); line-height: 1.4; }

.at-camp-wiz__audience-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.at-camp-wiz__audience-chip {
  padding: 7px 14px; border-radius: 99px;
  border: 1.5px solid var(--cfv-line);
  background: var(--cfv-bg);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--cfv-ink-2);
  transition: background .15s, border-color .15s, color .15s;
}
.at-camp-wiz__audience-chip.is-active {
  background: var(--cfv-navy); color: white; border-color: var(--cfv-navy);
}
body.at-dark .at-camp-wiz__audience-chip { background: var(--cfv-bg-2); border-color: var(--cfv-line); color: var(--cfv-ink-2); }

.at-camp-wiz__compose {
  display: grid; grid-template-columns: 1fr 280px; gap: 18px;
}
@media (max-width: 768px) {
  .at-camp-wiz__compose { grid-template-columns: 1fr; }
}
.at-camp-wiz__preview {
  background: #efeae2;
  border-radius: 12px;
  padding: 18px;
  display: flex; align-items: flex-start;
  min-height: 200px;
}
.at-camp-wiz__preview-bubble {
  background: white; padding: 10px 14px;
  border-radius: 4px 14px 14px 14px;
  font-size: 13.5px; line-height: 1.5;
  max-width: 100%; word-break: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  color: #111;
}

/* ════════════════════════════════════════════════════════════
   SETTINGS CHANNEL CARDS — Instagram, Facebook, Meta API
   ════════════════════════════════════════════════════════════ */
.at-channel-card-head {
  padding: 16px 18px; color: white;
  display: flex; align-items: center; gap: 12px;
}
.at-channel-card-head--ig { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045); }
.at-channel-card-head--fb { background: #1877f2; }
.at-channel-card-head--meta { background: linear-gradient(135deg, #1877f2, #25d366); }
.at-channel-card-head__icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.at-channel-card-head__title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.at-channel-card-head__sub { font-size: 12px; opacity: .9; margin-top: 1px; }
.at-channel-card-head__status {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 99px;
  background: rgba(0,0,0,.18);
}
.at-channel-card-head__status-dot { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; }

.at-form-row {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.at-form-row label {
  font-size: 12px; font-weight: 700; color: var(--cfv-ink-2);
  letter-spacing: .01em;
}
.at-form-row__input-wrap {
  display: flex; align-items: center; gap: 6px;
}
.at-form-row input, .at-form-row select {
  flex: 1; padding: 10px 12px;
  border: 1.5px solid var(--cfv-line);
  border-radius: 10px; background: var(--cfv-bg);
  color: var(--cfv-ink); font-family: var(--cfv-font); font-size: 13.5px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.at-form-row input:focus, .at-form-row select:focus {
  border-color: var(--cfv-navy); box-shadow: 0 0 0 3px rgba(55,48,163,.12);
}
body.at-dark .at-form-row input,
body.at-dark .at-form-row select { background: var(--cfv-bg-2); color: var(--cfv-ink); border-color: var(--cfv-line); }
.at-form-row__btn {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1.5px solid var(--cfv-line);
  background: var(--cfv-bg-2);
  color: var(--cfv-ink-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.at-form-row__btn:hover { background: var(--cfv-navy-50); color: var(--cfv-navy); border-color: var(--cfv-navy); }
body.at-dark .at-form-row__btn { background: var(--cfv-bg-2); border-color: var(--cfv-line); color: var(--cfv-ink-3); }
body.at-dark .at-form-row__btn:hover { background: var(--cfv-navy-tint); color: #a5b4fc; border-color: #6366f1; }
.at-form-row input[readonly] { background: var(--cfv-bg-2); color: var(--cfv-ink-2); font-family: monospace; font-size: 12px; }

/* Meta API toggle */
.at-api-toggle {
  display: inline-flex;
  background: var(--cfv-bg-2);
  border: 1.5px solid var(--cfv-line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 18px;
}
.at-api-toggle button {
  appearance: none; border: none; background: transparent;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  border-radius: 999px; cursor: pointer;
  color: var(--cfv-ink-2); font-family: var(--cfv-font);
  transition: background .15s, color .15s;
}
.at-api-toggle button.active {
  background: var(--cfv-navy); color: white;
  box-shadow: 0 2px 6px rgba(55,48,163,.3);
}

/* Templates table */
.at-tpl-table {
  border: 1px solid var(--cfv-line); border-radius: 12px; overflow: hidden;
}
.at-tpl-table__row {
  display: grid; grid-template-columns: 1fr 120px 120px auto;
  gap: 12px; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--cfv-line-2);
  font-size: 13px;
}
.at-tpl-table__row:last-child { border-bottom: none; }
.at-tpl-table__row:nth-child(even) { background: var(--cfv-bg-2); }
.at-tpl-table__row--head {
  background: var(--cfv-bg-2) !important;
  font-size: 11px; font-weight: 700; color: var(--cfv-ink-3);
  text-transform: uppercase; letter-spacing: .07em;
}
body.at-dark .at-tpl-table { border-color: var(--cfv-line); }
body.at-dark .at-tpl-table__row { border-bottom-color: var(--cfv-line); color: var(--cfv-ink); }
body.at-dark .at-tpl-table__row:nth-child(even),
body.at-dark .at-tpl-table__row--head { background: var(--cfv-bg-2); }

.at-tpl-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
}
.at-tpl-status--ok    { background: rgba(34,197,94,.12); color: #15803d; }
.at-tpl-status--wait  { background: rgba(245,158,11,.15); color: #b45309; }

/* ── Orçamentos — linha da lista ─────────────────────────── */
.at-orc-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 16px; flex-wrap: nowrap;
}
.at-orc-item__icon {
  width: 38px; height: 38px; border-radius: 8px;
  background: #eef2ff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.at-orc-item__info {
  flex: 1; min-width: 0; cursor: pointer;
}
.at-orc-item__actions {
  display: flex; gap: 6px; align-items: center; flex-shrink: 0;
}

/* Mobile responsive — new modules */
@media (max-width: 768px) {
  .at-funil { padding: 12px; }
  .at-funil__board { gap: 10px; padding-bottom: 12px; }
  .at-funil__col { flex: 0 0 260px; min-width: 240px; }
  .at-funil-panel {
    width: 100vw; max-width: 100vw; left: 0;
    border-radius: 16px 16px 0 0; border-left: none;
    border-top: 1px solid var(--cfv-line);
    bottom: 0; top: auto; height: 80vh;
    animation: at-slide-up .26s var(--cfv-ease-out);
  }
  @keyframes at-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .at-funil__col-title { font-size: 11px; }
  .at-funil__col-value { font-size: 11.5px; }
  .at-funil-card { padding: 10px 12px; }
  .at-funil-card__name { font-size: 12.5px; }
  .at-funil-panel__head { flex-wrap: wrap; gap: 8px; }
  .at-funil-panel__head .at-funil-panel__title { width: 100%; order: -1; }
  .at-cfg__title { font-size: 16px !important; }
  .at-cfg__sub { font-size: 11.5px !important; }

  .at-camp { padding: 14px; gap: 12px; }
  .at-camp-row { grid-template-columns: 1fr; gap: 10px; }
  .at-camp-row__name { font-size: 13.5px; }

  .at-camp-wiz { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .at-camp-wiz__body { padding: 16px; }
  .at-camp-wiz__channel-grid { grid-template-columns: 1fr; }

  .at-form-row__input-wrap { flex-wrap: wrap; }
}

/* Telas muito pequenas — iPhone SE/5 (≤ 390px) */
@media (max-width: 390px) {
  /* Funil */
  .at-funil { padding: 8px; gap: 10px; }
  .at-funil__board { gap: 8px; }
  .at-funil__col { flex: 0 0 240px; min-width: 220px; }
  .at-funil__col-head { padding: 8px 10px; }
  .at-funil-card { padding: 9px 10px; gap: 6px; }
  .at-funil-card__name { font-size: 12px; }
  .at-funil-card__value { font-size: 11px; }
  .at-funil-card__foot { gap: 4px; }

  /* Orçamentos — empilha ações abaixo do nome */
  .at-orc-item { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .at-orc-item__icon { width: 30px; height: 30px; font-size: 15px; border-radius: 6px; }
  .at-orc-item__info { flex: 1; min-width: 0; }
  .at-orc-item__actions {
    width: 100%; justify-content: flex-end;
    border-top: 1px solid var(--cfv-line-2);
    padding-top: 8px; margin-top: 2px;
  }
}


/* ════════════════════════════════════════════════════════════
   LOGO CUSTOMIZATION
   ════════════════════════════════════════════════════════════ */
@keyframes at-logo-fade {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}
.at-logo-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.at-logo-section {
  display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.at-logo-section__label { font-size: 12px; font-weight: 600; color: var(--cfv-ink-2); }
.at-logo-section__source { font-size: 11px; color: var(--cfv-ink-3); }
.at-logo-preview {
  background: var(--cfv-bg-2);
  border: 1.5px dashed var(--cfv-line);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  transition: border-color .15s;
}
.at-logo-preview:hover { border-color: var(--cfv-navy); }
.at-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.at-logo-preview__empty { font-size: 11px; color: var(--cfv-ink-3); text-align: center; padding: 8px; }
.at-logo-btn-row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.at-logo-btn {
  font-size: 12px; font-weight: 600;
  padding: 7px 12px; border-radius: 6px;
  border: 1.5px solid var(--cfv-line);
  background: var(--cfv-bg); color: var(--cfv-ink-2);
  cursor: pointer; font-family: var(--cfv-font);
  transition: border-color .15s, color .15s, background .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.at-logo-btn:hover { border-color: var(--cfv-navy); color: var(--cfv-navy); }
.at-logo-btn--danger:hover { border-color: var(--cfv-red); color: var(--cfv-red); }
body.at-dark .at-logo-preview { background: var(--cfv-surface); border-color: var(--cfv-line); }
body.at-dark .at-logo-btn { background: var(--cfv-surface); border-color: var(--cfv-line); color: var(--cfv-ink-2); }
body.at-dark .at-logo-btn:hover { border-color: #818cf8; color: #a5b4fc; }
@media (max-width: 768px) {
  .at-logo-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   GENERIC SLIDE-IN RIGHT PANEL (used by Contatos, Cobrança, etc)
   ════════════════════════════════════════════════════════════ */
.at-slide-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 440px; max-width: 96vw;
  background: var(--cfv-bg);
  border-left: 1px solid var(--cfv-line);
  box-shadow: var(--cfv-shadow-lg);
  z-index: 800;
  display: flex; flex-direction: column;
  animation: at-slide-left .26s var(--cfv-ease-out);
}
body.at-dark .at-slide-panel { background: var(--cfv-surface); }
.at-slide-panel__head {
  padding: 16px 18px; border-bottom: 1px solid var(--cfv-line);
  display: flex; align-items: center; gap: 12px;
  background: var(--cfv-bg);
}
body.at-dark .at-slide-panel__head { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-slide-panel__body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.at-slide-panel__title { flex: 1; font-size: 16px; font-weight: 700; color: var(--cfv-ink); }
@media (max-width: 768px) {
  .at-slide-panel { width: 100vw; max-width: 100vw; }
}

/* ════════════════════════════════════════════════════════════
   TAB BAR (used by Cobrança)
   ════════════════════════════════════════════════════════════ */
.at-tabbar {
  display: flex; gap: 4px; flex-shrink: 0;
  border-bottom: 1px solid var(--cfv-line);
  overflow-x: auto; scrollbar-width: none;
  background: var(--cfv-bg-soft);
}
.at-tabbar::-webkit-scrollbar { display: none; }
.at-tabbar__tab {
  appearance: none; border: none; background: transparent;
  padding: 10px 16px; font-size: 13.5px; font-weight: 600;
  color: var(--cfv-ink-3); cursor: pointer;
  font-family: var(--cfv-font); white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.at-tabbar__tab:hover { color: var(--cfv-ink-2); }
.at-tabbar__tab.is-active { color: var(--cfv-navy); border-bottom-color: var(--cfv-navy); }
body.at-dark .at-tabbar { background: var(--cfv-bg); }
body.at-dark .at-tabbar__tab.is-active { color: #a5b4fc; border-bottom-color: #818cf8; }
@media (max-width: 768px) {
  .at-tabbar { gap: 0; }
  .at-tabbar__tab { flex: 1 0 auto; min-width: 110px; }
}

/* ════════════════════════════════════════════════════════════
   COBRANÇA — billing module
   ════════════════════════════════════════════════════════════ */
.at-cob { flex: 1; min-height: 0; overflow: hidden; padding: 24px 24px 0;
  background: var(--cfv-bg-soft); display: flex; flex-direction: column; gap: 18px; }
.at-cob__body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 0 24px;
  display: flex; flex-direction: column; gap: 18px;
  scrollbar-width: thin; scrollbar-color: var(--cfv-line) transparent; }
.at-cob__body::-webkit-scrollbar { width: 6px; }
.at-cob__body::-webkit-scrollbar-thumb { background: var(--cfv-line); border-radius: 3px; }

.at-cob-kpi-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
@media (max-width: 1024px) {
  .at-cob-kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .at-cob-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.at-cob-kpi {
  background: var(--cfv-bg); border: 1px solid var(--cfv-line-2);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--cfv-shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.at-cob-kpi[style*="cursor:pointer"]:hover,
.at-cob-kpi[style*="cursor: pointer"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0,0,0,.10);
}
.at-cob-kpi--active { border-color: var(--cfv-navy) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--cfv-navy) 20%, transparent); }
body.at-dark .at-cob-kpi { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-cob-kpi__label {
  font-size: 10.5px; font-weight: 700;
  color: var(--cfv-ink-3); text-transform: uppercase; letter-spacing: .07em;
}
.at-cob-kpi__value {
  font-size: 22px; font-weight: 800; color: var(--cfv-ink);
  letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums;
}
.at-cob-kpi__trend {
  font-size: 11px; font-weight: 700; color: var(--cfv-ink-3);
  display: inline-flex; align-items: center; gap: 3px;
}
.at-cob-kpi__trend--up   { color: #16a34a; }
.at-cob-kpi__trend--down { color: #dc2626; }
.at-cob-kpi--danger .at-cob-kpi__value { color: #dc2626; }
.at-cob-kpi--warn   .at-cob-kpi__value { color: #b45309; }
.at-cob-kpi--ok     .at-cob-kpi__value { color: #16a34a; }
.at-cob-kpi__dot-pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; animation: cfv-pulse 1.2s infinite;
}

/* Filter bar */
.at-cob-filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 10px 0;
}

/* Bill table */
.at-bill-table {
  background: var(--cfv-bg); border: 1px solid var(--cfv-line);
  border-radius: 12px; overflow: hidden;
}
body.at-dark .at-bill-table { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-bill-row {
  display: grid;
  grid-template-columns: 28px minmax(140px, 1.4fr) minmax(140px, 1.6fr) 110px 100px 110px 90px 90px;
  gap: 10px; align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--cfv-line-2);
  font-size: 13px; color: var(--cfv-ink-2);
  position: relative;
}
body.at-dark .at-bill-row { border-bottom-color: var(--cfv-line); color: var(--cfv-ink-2); }
.at-bill-row:last-child { border-bottom: none; }
.at-bill-row--head {
  background: var(--cfv-bg-2);
  font-size: 11px; font-weight: 700;
  color: var(--cfv-ink-3); text-transform: uppercase; letter-spacing: .06em;
}
.at-bill-row--overdue7  { border-left: 3px solid #ef4444; }
.at-bill-row__name { font-weight: 600; color: var(--cfv-ink); display: flex; gap: 8px; align-items: center; }
.at-bill-row__val  { font-weight: 800; color: var(--cfv-navy); font-variant-numeric: tabular-nums; }
body.at-dark .at-bill-row__val { color: #a5b4fc; }

.at-status-bill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .03em;
}
.at-status-bill--open   { background: rgba(245,158,11,.16); color: #b45309; }
.at-status-bill--paid   { background: rgba(34,197,94,.15);  color: #15803d; }
.at-status-bill--late   { background: rgba(239,68,68,.16);  color: #b91c1c; }
.at-status-bill--cancel { background: rgba(156,163,175,.18); color: #6b7280; }
body.at-dark .at-status-bill--open   { background: rgba(245,158,11,.22); color: #fcd34d; }
body.at-dark .at-status-bill--paid   { background: rgba(34,197,94,.22);  color: #86efac; }
body.at-dark .at-status-bill--late   { background: rgba(239,68,68,.22);  color: #fca5a5; }
body.at-dark .at-status-bill--cancel { background: rgba(156,163,175,.22); color: #9ca3af; }

.at-risk-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
}
.at-risk-chip--low  { background: rgba(34,197,94,.15);  color: #15803d; }
.at-risk-chip--mid  { background: rgba(245,158,11,.18); color: #b45309; }
.at-risk-chip--high { background: rgba(239,68,68,.16);  color: #b91c1c; }
body.at-dark .at-risk-chip--low  { background: rgba(34,197,94,.22);  color: #86efac; }
body.at-dark .at-risk-chip--mid  { background: rgba(245,158,11,.22); color: #fcd34d; }
body.at-dark .at-risk-chip--high { background: rgba(239,68,68,.22);  color: #fca5a5; }

/* Donut chart wrapper */
.at-donut-wrap { display: flex; align-items: center; gap: 18px; }
.at-donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
.at-donut-center__big { font-size: 22px; font-weight: 800; color: var(--cfv-ink); }
.at-donut-center__lbl { font-size: 10px; font-weight: 700; color: var(--cfv-ink-3); text-transform: uppercase; letter-spacing: .07em; }

.at-donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.at-donut-legend__row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cfv-ink-2); }
.at-donut-legend__sw { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* Bill alerts */
.at-alert-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid; box-shadow: var(--cfv-shadow-xs);
}
.at-alert-card__icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: white;
}
.at-alert-card__body { flex: 1; min-width: 0; }
.at-alert-card__title { font-size: 13.5px; font-weight: 700; color: var(--cfv-ink); }
.at-alert-card__sub { font-size: 12px; color: var(--cfv-ink-3); margin-top: 2px; }
.at-alert-card__count {
  font-size: 12px; font-weight: 700; padding: 3px 9px;
  border-radius: 99px; background: var(--cfv-bg); color: var(--cfv-ink); flex-shrink: 0;
}
.at-alert-card--red  { background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.3); }
.at-alert-card--red  .at-alert-card__icon { background: #ef4444; }
.at-alert-card--amber{ background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.32); }
.at-alert-card--amber .at-alert-card__icon { background: #f59e0b; }
.at-alert-card--navy { background: var(--cfv-navy-50); border-color: rgba(55,48,163,.22); }
.at-alert-card--navy .at-alert-card__icon { background: var(--cfv-navy); }
body.at-dark .at-alert-card--red  { background: rgba(239,68,68,.14); }
body.at-dark .at-alert-card--amber{ background: rgba(245,158,11,.14); }
body.at-dark .at-alert-card--navy { background: var(--cfv-navy-tint); }

/* WhatsApp preview bubble */
.at-wa-preview {
  background: #efeae2; border-radius: 12px; padding: 16px;
}
body.at-dark .at-wa-preview { background: #0d1418; }
.at-wa-preview__bubble {
  background: var(--cfv-navy);
  color: white;
  padding: 12px 14px;
  border-radius: 4px 14px 14px 14px;
  font-size: 13.5px; line-height: 1.55;
  white-space: pre-wrap;
  max-width: 100%; word-break: break-word;
  box-shadow: 0 1px 3px rgba(55,48,163,.25);
}

/* Bulk action bar */
.at-bulk-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--cfv-navy); color: white;
  box-shadow: 0 4px 16px rgba(55,48,163,.3);
}
.at-bulk-bar__count { font-weight: 700; font-size: 13.5px; }

/* Mobile bill cards */
@media (max-width: 768px) {
  .at-cob { padding: 14px 14px 0; }
  .at-bill-row { grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; }
  .at-bill-row--head { display: none; }
  .at-bill-row__name { order: -1; }
  .at-bulk-bar { position: sticky; top: 0; z-index: 100; border-radius: 0; margin: 0 -14px; }
}

/* Recurring chip */
.at-recur-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  background: var(--cfv-navy-50); color: var(--cfv-navy);
}
body.at-dark .at-recur-chip { background: var(--cfv-navy-tint); color: #a5b4fc; }

/* Days remaining chip (used in upcoming list) */
.at-days-chip {
  font-size: 10.5px; font-weight: 700; padding: 3px 9px;
  border-radius: 99px;
}
.at-days-chip--ok    { background: rgba(34,197,94,.16);  color: #15803d; }
.at-days-chip--warn  { background: rgba(245,158,11,.18); color: #b45309; }
.at-days-chip--late  { background: rgba(239,68,68,.18);  color: #b91c1c; }
body.at-dark .at-days-chip--ok   { background: rgba(34,197,94,.22);  color: #86efac; }
body.at-dark .at-days-chip--warn { background: rgba(245,158,11,.22); color: #fcd34d; }
body.at-dark .at-days-chip--late { background: rgba(239,68,68,.22);  color: #fca5a5; }

/* Timeline (Histórico tab) */
.at-timeline { display: flex; flex-direction: column; gap: 0; }
.at-timeline__date-sep {
  font-size: 11px; font-weight: 700; color: var(--cfv-ink-3);
  text-transform: uppercase; letter-spacing: .08em;
  margin: 16px 0 8px;
  padding-bottom: 4px; border-bottom: 1px solid var(--cfv-line-2);
}
.at-timeline__item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
}
.at-timeline__icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.at-timeline__body { flex: 1; min-width: 0; }
.at-timeline__head { font-size: 13px; font-weight: 600; color: var(--cfv-ink); }
.at-timeline__sub  { font-size: 11.5px; color: var(--cfv-ink-3); margin-top: 2px; }

/* ════════════════════════════════════════════════════════════
   AGENDAMENTOS — calendar module
   ════════════════════════════════════════════════════════════ */
.at-ag { flex: 1; min-height: 0; overflow-y: auto; padding: 24px;
  background: var(--cfv-bg-soft); display: flex; flex-direction: column; gap: 16px; }
.at-ag__grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 16px;
  flex: 1; min-height: 0;
}
@media (max-width: 1024px) {
  .at-ag__grid { grid-template-columns: 1fr; }
}
.at-cal {
  background: var(--cfv-bg); border: 1px solid var(--cfv-line);
  border-radius: 14px; padding: 18px; box-shadow: var(--cfv-shadow-sm);
}
body.at-dark .at-cal { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-cal__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.at-cal__title { flex: 1; font-size: 17px; font-weight: 800; color: var(--cfv-ink); letter-spacing: -.01em; }
.at-cal__nav {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--cfv-line); background: var(--cfv-bg-2);
  cursor: pointer; color: var(--cfv-ink-2);
  display: flex; align-items: center; justify-content: center;
}
.at-cal__nav:hover { background: var(--cfv-navy-50); color: var(--cfv-navy); border-color: var(--cfv-navy); }
.at-cal__weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 6px;
}
.at-cal__weekday {
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--cfv-ink-3); text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 0;
}
.at-cal__days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.at-cal__day {
  aspect-ratio: 1;
  border: 1px solid var(--cfv-line-2);
  border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; padding: 6px 4px;
  font-size: 13px; color: var(--cfv-ink); cursor: pointer;
  background: var(--cfv-bg);
  transition: background .15s, border-color .15s;
}
body.at-dark .at-cal__day { background: var(--cfv-bg-2); border-color: var(--cfv-line); }
.at-cal__day:hover { background: var(--cfv-navy-50); }
body.at-dark .at-cal__day:hover { background: var(--cfv-navy-tint); }
.at-cal__day--out    { color: var(--cfv-ink-3); background: transparent; }
.at-cal__day--today  { border-color: var(--cfv-navy); font-weight: 800; color: var(--cfv-navy); }
body.at-dark .at-cal__day--today { color: #a5b4fc; border-color: #818cf8; }
.at-cal__day--active { background: var(--cfv-navy); color: white; border-color: var(--cfv-navy); }
.at-cal__day--active:hover { background: var(--cfv-navy-700); }
.at-cal__day-dots { display: flex; gap: 2px; margin-top: 'auto'; padding-top: 4px; }
.at-cal__day-dot {
  width: 5px; height: 5px; border-radius: 50%;
}

.at-ag-list {
  background: var(--cfv-bg); border: 1px solid var(--cfv-line);
  border-radius: 14px; padding: 14px; box-shadow: var(--cfv-shadow-sm);
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
}
body.at-dark .at-ag-list { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-ag-list__head {
  font-size: 13px; font-weight: 700; color: var(--cfv-ink-2);
  margin-bottom: 4px;
}
.at-ag-card {
  background: var(--cfv-bg-2); border-radius: 10px;
  padding: 12px 14px; border-left: 3px solid var(--cfv-navy);
}
body.at-dark .at-ag-card { background: var(--cfv-bg-2); }
.at-ag-card--confirmed { border-left-color: #16a34a; }
.at-ag-card--pending   { border-left-color: #f59e0b; }
.at-ag-card--cancelled { border-left-color: #ef4444; opacity: .65; }
.at-ag-card__title { font-size: 13.5px; font-weight: 700; color: var(--cfv-ink); }
.at-ag-card__service { font-size: 12px; color: var(--cfv-ink-2); margin-top: 2px; }
.at-ag-card__foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* Floating + button */
.at-fab {
  position: fixed; bottom: 28px; right: 28px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--cfv-navy); color: white;
  border: none; cursor: pointer; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(55,48,163,.4);
  transition: transform .15s, box-shadow .15s;
}
.at-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 30px rgba(55,48,163,.5); }
.at-fab:active { transform: scale(.95); }
@media (max-width: 768px) {
  .at-fab { bottom: 18px; right: 18px; width: 52px; height: 52px; }
  .at-cal { padding: 12px; }
  .at-cal__day { font-size: 12px; padding: 4px 2px; }
}

/* ════════════════════════════════════════════════════════════
   RELATÓRIOS
   ════════════════════════════════════════════════════════════ */
.at-rel { flex: 1; min-height: 0; overflow-y: auto; padding: 24px;
  background: var(--cfv-bg-soft); display: flex; flex-direction: column; gap: 18px; }
.at-rel-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
@media (max-width: 768px) { .at-rel-grid { grid-template-columns: 1fr; } }
.at-rel-card {
  background: var(--cfv-bg); border: 1px solid var(--cfv-line-2);
  border-radius: 12px; padding: 18px;
  box-shadow: var(--cfv-shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
}
body.at-dark .at-rel-card { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-rel-card__head { display: flex; align-items: flex-start; gap: 12px; }
.at-rel-card__icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.at-rel-card__title { font-size: 14.5px; font-weight: 800; color: var(--cfv-ink); letter-spacing: -.01em; }
.at-rel-card__desc  { font-size: 12.5px; color: var(--cfv-ink-3); margin-top: 4px; line-height: 1.45; }
.at-rel-card__actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.at-rel-card__period {
  flex: 1; padding: 7px 10px; border: 1.5px solid var(--cfv-line);
  border-radius: 8px; font-family: var(--cfv-font); font-size: 12.5px;
  background: var(--cfv-bg); color: var(--cfv-ink); cursor: pointer;
  min-width: 140px;
}
body.at-dark .at-rel-card__period { background: var(--cfv-bg-2); color: var(--cfv-ink); border-color: var(--cfv-line); }

/* ════════════════════════════════════════════════════════════
   BASE DE CONHECIMENTO
   ════════════════════════════════════════════════════════════ */
.at-base { flex: 1; min-height: 0; overflow-y: auto; padding: 24px;
  background: var(--cfv-bg-soft); display: flex; flex-direction: column; gap: 14px; }
.at-base__grid {
  display: grid; grid-template-columns: 240px 1fr; gap: 16px;
}
@media (max-width: 768px) { .at-base__grid { grid-template-columns: 1fr; } }
.at-base__cats {
  background: var(--cfv-bg); border: 1px solid var(--cfv-line);
  border-radius: 12px; padding: 12px; box-shadow: var(--cfv-shadow-sm);
}
body.at-dark .at-base__cats { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-base__cat {
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--cfv-ink-2);
  display: flex; align-items: center; gap: 8px;
  transition: background .12s, color .12s;
}
.at-base__cat:hover { background: var(--cfv-bg-2); color: var(--cfv-ink); }
.at-base__cat.is-active { background: var(--cfv-navy-50); color: var(--cfv-navy); font-weight: 700; }
body.at-dark .at-base__cat.is-active { background: var(--cfv-navy-tint); color: #a5b4fc; }
.at-base__sub { padding: 4px 12px 4px 28px; font-size: 12px; color: var(--cfv-ink-3); cursor: pointer; }
.at-base__sub:hover { color: var(--cfv-navy); }
.at-base__articles {
  display: flex; flex-direction: column; gap: 10px;
}
.at-base-article {
  background: var(--cfv-bg); border: 1px solid var(--cfv-line);
  border-radius: 12px; padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
body.at-dark .at-base-article { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-base-article:hover { box-shadow: var(--cfv-shadow-md); transform: translateY(-1px); }
.at-base-article__title { font-size: 14.5px; font-weight: 800; color: var(--cfv-ink); letter-spacing: -.01em; }
.at-base-article__meta { font-size: 11.5px; color: var(--cfv-ink-3); margin: 4px 0 8px; display: flex; gap: 8px; }
.at-base-article__preview { font-size: 13px; color: var(--cfv-ink-2); line-height: 1.5; }
@media (max-width: 768px) {
  .at-base__cats { display: flex; overflow-x: auto; gap: 6px; padding: 8px; }
  .at-base__cat { white-space: nowrap; flex-shrink: 0; }
  .at-base__sub { display: none; }
}

/* ════════════════════════════════════════════════════════════
   FINANCEIRO
   ════════════════════════════════════════════════════════════ */
.at-fin { flex: 1; min-height: 0; overflow-y: auto; padding: 24px;
  background: var(--cfv-bg-soft); display: flex; flex-direction: column; gap: 16px; }
.at-fin-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
@media (max-width: 1024px) { .at-fin-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .at-fin-kpis { grid-template-columns: 1fr; } }
.at-fin-panels {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px;
}
@media (max-width: 1024px) { .at-fin-panels { grid-template-columns: 1fr; } }
.at-fin-bar-wrap {
  display: flex; align-items: flex-end; gap: 12px;
  height: 200px; padding: 12px;
}
.at-fin-bar {
  flex: 1; min-width: 18px;
  background: linear-gradient(180deg, var(--cfv-navy), var(--cfv-navy-700));
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: height .5s var(--cfv-ease-out);
}
.at-fin-bar__lbl {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 600; color: var(--cfv-ink-3);
  white-space: nowrap;
}
.at-fin-bar__val {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 700; color: var(--cfv-ink);
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════
   SATISFAÇÃO (NPS)
   ════════════════════════════════════════════════════════════ */
.at-sat { flex: 1; min-height: 0; overflow-y: auto; padding: 24px;
  background: var(--cfv-bg-soft); display: flex; flex-direction: column; gap: 18px; }
.at-sat-top {
  display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: center;
}
@media (max-width: 768px) { .at-sat-top { grid-template-columns: 1fr; } }
.at-sat-gauge-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px; background: var(--cfv-bg); border-radius: 14px;
  border: 1px solid var(--cfv-line); box-shadow: var(--cfv-shadow-sm);
}
body.at-dark .at-sat-gauge-wrap { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-sat-gauge__val { font-size: 36px; font-weight: 800; color: var(--cfv-ink); line-height: 1; }
.at-sat-gauge__lbl { font-size: 11.5px; color: var(--cfv-ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.at-sat-pills {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (max-width: 768px) { .at-sat-pills { grid-template-columns: 1fr; } }
.at-sat-pill {
  background: var(--cfv-bg); border: 1px solid var(--cfv-line);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--cfv-shadow-sm);
  border-top: 4px solid;
}
body.at-dark .at-sat-pill { background: var(--cfv-surface); border-color: var(--cfv-line); }
.at-sat-pill__lbl { font-size: 11.5px; font-weight: 700; color: var(--cfv-ink-3); text-transform: uppercase; letter-spacing: .06em; }
.at-sat-pill__val { font-size: 24px; font-weight: 800; color: var(--cfv-ink); margin-top: 4px; }
.at-sat-pill--up   { border-top-color: #16a34a; }
.at-sat-pill--mid  { border-top-color: #f59e0b; }
.at-sat-pill--down { border-top-color: #ef4444; }

.at-sat-resp {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--cfv-line-2);
}
body.at-dark .at-sat-resp { border-bottom-color: var(--cfv-line); }
.at-sat-resp__stars { display: inline-flex; gap: 2px; }
.at-sat-resp__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.at-sat-resp__name { font-size: 13.5px; font-weight: 700; color: var(--cfv-ink); }
.at-sat-resp__meta { font-size: 11.5px; color: var(--cfv-ink-3); }
.at-sat-resp__comment { font-size: 13px; color: var(--cfv-ink-2); margin-top: 4px; line-height: 1.5; }

/* ════════════════════════════════════════════════════════════
   ENHANCED FUNIL CARDS (mini photo + stage dots + quick actions)
   ════════════════════════════════════════════════════════════ */
.at-funil-card__media {
  width: 100%; height: 56px; border-radius: 8px;
  background: linear-gradient(135deg, var(--cfv-navy-50), #e0e7ff);
  display: flex; align-items: center; justify-content: center;
  color: var(--cfv-navy); flex-shrink: 0;
}
body.at-dark .at-funil-card__media { background: var(--cfv-navy-tint); color: #a5b4fc; }
.at-funil-card__stages {
  display: flex; gap: 3px; align-items: center;
}
.at-funil-card__stage-dot {
  width: 8px; height: 4px; border-radius: 2px;
  background: var(--cfv-line);
}
.at-funil-card__stage-dot.is-active { background: var(--cfv-navy); }
.at-funil-card__quick {
  display: none;
  gap: 4px; padding-top: 6px;
  border-top: 1px solid var(--cfv-line-2);
}
.at-funil-card:hover .at-funil-card__quick { display: flex; }
body.at-dark .at-funil-card__quick { border-top-color: var(--cfv-line); }

/* Campanha sparkline + pulsing scheduled */
.at-camp-spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.at-camp-spark > i {
  display: block; width: 4px;
  background: var(--cfv-navy); border-radius: 1px;
}
@keyframes cfv-pulse-soft {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}
.at-camp-status-pulse { animation: cfv-pulse-soft 1.8s ease-in-out infinite; }

/* ── Agent attending pill (chat header) ── */
.at-agent-attending-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px 2px 3px; border-radius: 20px;
  background: rgba(107,114,128,.12);
  border: 1px solid rgba(107,114,128,.3);
  background: color-mix(in srgb, var(--pill-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill-color) 40%, transparent);
  color: var(--pill-color); font-size: 11px; font-weight: 600;
  white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
body.at-dark .at-agent-attending-pill {
  background: rgba(107,114,128,.2);
  background: color-mix(in srgb, var(--pill-color) 20%, transparent);
}

/* ── System event message (inline in chat) ── */
.at-system-event {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 16px; flex-shrink: 0;
}
.at-system-event__line {
  flex: 1; height: 1px;
  background: var(--cfv-line);
}
.at-system-event__text {
  font-size: 10.5px; font-weight: 600; color: var(--cfv-ink-3);
  white-space: nowrap; padding: 0 2px;
  letter-spacing: .01em;
}

/* ── Typing indicator dots animation ── */
@keyframes atTypingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Search highlight ── */
mark.at-search-hl {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Message highlight (search navigation) ── */
@keyframes atMsgHighlight {
  0%   { background: rgba(253, 224, 71, 0.55); }
  70%  { background: rgba(253, 224, 71, 0.35); }
  100% { background: transparent; }
}
.at-msg-highlight {
  animation: atMsgHighlight 2.5s ease forwards;
  border-radius: 8px;
}

/* ── Chat Interno (CI) ──────────────────────────────────────── */
@keyframes ci-spin { to { transform: rotate(360deg); } }
@keyframes ci-fadein { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

.ci { display:flex; height:100%; overflow:hidden; background:var(--cfv-bg); }

/* botão voltar — oculto no desktop */
.ci-back-btn { display:none; background:none; border:none; cursor:pointer; color:var(--cfv-navy); padding:4px; border-radius:8px; flex-shrink:0; align-items:center; justify-content:center; transition:background .12s; }
.ci-back-btn:hover { background:var(--cfv-bg-soft); }

/* sidebar */
.ci-sb { width:256px; border-right:1px solid var(--cfv-line); display:flex; flex-direction:column; flex-shrink:0; background:var(--cfv-bg-soft); overflow:hidden; }
.ci-sb__top { padding:14px 12px 10px; border-bottom:1px solid var(--cfv-line); flex-shrink:0; }
.ci-sb__title { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; gap:6px; }
.ci-sb__search { position:relative; }
.ci-sb__search-ic { position:absolute; left:9px; top:50%; transform:translateY(-50%); color:var(--cfv-ink-3); pointer-events:none; }
.ci-sb__search-input { width:100%; box-sizing:border-box; border:1.5px solid var(--cfv-line); border-radius:20px; padding:6px 10px 6px 28px; font-size:12px; background:var(--cfv-bg); color:var(--cfv-ink); outline:none; transition:border-color .15s; }
.ci-sb__search-input:focus { border-color:var(--cfv-navy); }
.ci-rooms { flex:1; overflow-y:auto; padding:6px 0 16px; }
.ci-rooms::-webkit-scrollbar { width:3px; }
.ci-rooms::-webkit-scrollbar-thumb { background:var(--cfv-line); border-radius:2px; }
.ci-section { padding:10px 12px 4px; display:flex; align-items:center; justify-content:space-between; }
.ci-section span { font-size:10px; font-weight:800; color:var(--cfv-ink-3); letter-spacing:.6px; text-transform:uppercase; }
.ci-section__add { background:none; border:none; cursor:pointer; color:var(--cfv-navy); width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; padding:0; line-height:1; transition:background .12s; }
.ci-section__add:hover { background:rgba(3,105,161,.1); }
.ci-room { display:flex; align-items:center; gap:9px; width:calc(100% - 16px); margin:1px 8px; padding:7px 8px; border:none; border-radius:9px; background:none; cursor:pointer; text-align:left; color:var(--cfv-ink); transition:background .1s; }
.ci-room:hover { background:rgba(0,0,0,.05); }
.ci-room.is-active { background:rgba(3,105,161,.12); color:var(--cfv-navy); }
body.at-dark .ci-room:hover { background:rgba(255,255,255,.06); }
body.at-dark .ci-room.is-active { background:rgba(3,105,161,.2); }
.ci-room__hash-wrap { width:26px; height:26px; border-radius:8px; background:var(--cfv-line); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:background .1s; }
.ci-room.is-active .ci-room__hash-wrap { background:rgba(3,105,161,.18); }
.ci-room__hash { font-size:14px; color:var(--cfv-ink-3); font-weight:700; }
.ci-room.is-active .ci-room__hash { color:var(--cfv-navy); }
.ci-room__info { flex:1; min-width:0; }
.ci-room__name { font-size:13px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ci-room.is-active .ci-room__name, .ci-room.has-unread .ci-room__name { font-weight:700; }
.ci-room__prev { font-size:11px; color:var(--cfv-ink-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }
.ci-room__badge { background:#ef4444; color:#fff; border-radius:20px; padding:0 6px; font-size:10.5px; font-weight:700; min-width:18px; text-align:center; flex-shrink:0; line-height:18px; display:inline-block; }
.ci-room__badge--total { background:#ef4444; border-radius:20px; color:#fff; padding:1px 8px; font-size:11px; font-weight:700; }
.ci-avatar-wrap { position:relative; flex-shrink:0; }

/* main pane */
.ci-pane { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.ci-pane__empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; color:var(--cfv-ink-3); padding:40px; }
.ci-header { padding:12px 20px; border-bottom:1px solid var(--cfv-line); display:flex; align-items:center; gap:12px; background:var(--cfv-surface); flex-shrink:0; box-shadow:0 1px 0 var(--cfv-line); }
.ci-header__canal-icon { width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg,#0369a1,#0ea5e9); color:#fff; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:800; flex-shrink:0; }
.ci-header__info { flex:1; min-width:0; }
.ci-header__name { font-weight:700; font-size:15px; color:var(--cfv-ink); }
.ci-header__desc { font-size:11.5px; color:var(--cfv-ink-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }

/* messages — fundo suave agradável aos olhos */
.ci-msgs { flex:1; overflow-y:auto; padding:12px 20px 16px; display:flex; flex-direction:column; background:#f0f4f8; }
.ci-msgs::-webkit-scrollbar { width:5px; }
.ci-msgs::-webkit-scrollbar-thumb { background:rgba(3,105,161,.2); border-radius:3px; }
.ci-load-more { align-self:center; background:#fff; border:1px solid var(--cfv-line); border-radius:20px; padding:5px 18px; cursor:pointer; font-size:12px; color:var(--cfv-ink-2); margin-bottom:14px; display:flex; align-items:center; gap:6px; transition:all .12s; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.ci-load-more:hover:not(:disabled) { background:var(--cfv-line); }
.ci-load-more:disabled { opacity:.6; cursor:default; }
.ci-date-sep { display:flex; align-items:center; gap:10px; margin:14px 0 10px; }
.ci-date-sep__line { flex:1; height:1px; background:rgba(3,105,161,.15); }
.ci-date-sep__label { font-size:10.5px; font-weight:700; color:var(--cfv-ink-3); white-space:nowrap; background:#fff; padding:2px 10px; border:1px solid var(--cfv-line); border-radius:20px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.ci-sys-msg { text-align:center; font-size:11px; color:var(--cfv-ink-3); font-style:italic; margin:8px 0; background:#fff; border-radius:20px; padding:3px 14px; align-self:center; border:1px solid var(--cfv-line); box-shadow:0 1px 3px rgba(0,0,0,.05); }
.ci-grp { display:flex; gap:10px; position:relative; align-items:flex-start; }
.ci-grp--me { flex-direction:row-reverse; }
.ci-grp__avatar { width:34px; flex-shrink:0; }
.ci-grp__avatar--hidden { visibility:hidden; }
.ci-grp__body { flex:1; min-width:0; max-width:74%; }
.ci-grp--me .ci-grp__body { display:flex; flex-direction:column; align-items:flex-end; }
.ci-grp__meta { display:flex; align-items:baseline; gap:7px; margin-bottom:3px; }
.ci-grp__name { font-size:12.5px; font-weight:700; }
.ci-grp__time { font-size:10px; color:var(--cfv-ink-3); }
.ci-bubble { position:relative; background:#fff; color:var(--cfv-ink); border-radius:4px 14px 14px 14px; padding:8px 12px 5px; box-shadow:0 1px 3px rgba(0,0,0,.07); word-break:break-word; font-size:13.5px; line-height:1.45; max-width:100%; min-width:0; display:inline-block; text-align:left; border:1px solid var(--cfv-line); flex-shrink:1; }
.ci-bubble--me { background:var(--cfv-navy); color:#fff; border-radius:14px 4px 14px 14px; box-shadow:0 2px 6px rgba(3,105,161,.28); border-color:transparent; }
.ci-bubble--first { border-radius:14px 14px 14px 4px; }
.ci-bubble--me.ci-bubble--first { border-radius:14px 14px 4px 14px; }
.ci-bubble__reply-quote { background:rgba(0,0,0,.07); border-left:3px solid var(--cfv-navy); border-radius:6px; padding:4px 8px; margin-bottom:6px; font-size:11.5px; color:var(--cfv-ink-2); }
.ci-bubble--me .ci-bubble__reply-quote { background:rgba(255,255,255,.15); border-left-color:rgba(255,255,255,.6); color:rgba(255,255,255,.8); }
.ci-bubble__reply-author { font-weight:700; margin-right:4px; }
.ci-bubble__image { display:block; max-width:240px; max-height:200px; border-radius:8px; cursor:pointer; margin-bottom:4px; }
.ci-bubble__file { display:flex; align-items:center; gap:8px; padding:7px 10px; background:rgba(0,0,0,.06); border-radius:8px; text-decoration:none; color:inherit; margin-bottom:4px; }
.ci-bubble--me .ci-bubble__file { background:rgba(255,255,255,.15); }
.ci-bubble__file-icon { font-size:22px; flex-shrink:0; }
.ci-bubble__file-name { font-size:12px; max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ci-bubble__text { white-space:pre-wrap; }
.ci-bubble__ts { font-size:9.5px; opacity:.5; margin-top:4px; text-align:right; }
.ci-reactions { display:flex; flex-wrap:wrap; gap:3px; margin-top:4px; animation:ci-fadein .18s ease; }
.ci-grp--me .ci-reactions { justify-content:flex-end; }
.ci-rchip { display:flex; align-items:center; gap:3px; background:#fff; border:1.5px solid var(--cfv-line); border-radius:20px; padding:2px 8px; cursor:pointer; font-size:13px; transition:all .12s; line-height:1; }
.ci-rchip:hover { border-color:var(--cfv-navy); transform:scale(1.06); }
.ci-rchip.is-mine { background:rgba(3,105,161,.1); border-color:rgba(3,105,161,.4); }
.ci-rchip__count { font-size:11px; color:var(--cfv-ink-2); font-weight:700; }
.ci-actions { display:flex; gap:3px; flex-shrink:0; align-self:center; opacity:0; pointer-events:none; transition:opacity .12s; z-index:20; }
.ci-grp:hover .ci-actions, .ci-grp--active .ci-actions { opacity:1; pointer-events:all; }
.ci-act-btn { background:#fff; border:1px solid var(--cfv-line); border-radius:8px; width:28px; height:28px; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 6px rgba(0,0,0,.1); transition:all .12s; color:var(--cfv-ink-2); }
.ci-act-btn:hover { background:var(--cfv-bg-soft); border-color:var(--cfv-navy); color:var(--cfv-navy); transform:translateY(-1px); }
.ci-act-btn--del:hover { border-color:#ef4444; color:#ef4444; }
.ci-epicker { position:absolute; background:var(--cfv-surface); border:1px solid var(--cfv-line); border-radius:14px; padding:10px; box-shadow:var(--cfv-shadow-md); display:grid; grid-template-columns:repeat(6,1fr); gap:2px; width:216px; z-index:200; top:32px; animation:ci-fadein .15s ease; }
.ci-epicker:not(.ci-epicker--me) { right:0; left:auto; }
.ci-epicker--me { left:0; right:auto; }
.ci-epicker button { background:none; border:none; cursor:pointer; font-size:19px; padding:4px; border-radius:8px; line-height:1; transition:background .1s; }
.ci-epicker button:hover { background:var(--cfv-bg-soft); transform:scale(1.1); }

/* reply bar */
.ci-reply-bar { padding:7px 16px; background:rgba(3,105,161,.05); border-top:1.5px solid rgba(3,105,161,.2); display:flex; align-items:center; gap:10px; flex-shrink:0; animation:ci-fadein .15s ease; }
.ci-reply-bar__accent { width:3px; height:34px; background:var(--cfv-navy); border-radius:2px; flex-shrink:0; }
.ci-reply-bar__info { flex:1; min-width:0; }
.ci-reply-bar__author { font-size:11px; font-weight:700; color:var(--cfv-navy); }
.ci-reply-bar__text { font-size:11.5px; color:var(--cfv-ink-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ci-reply-bar__close { background:none; border:none; cursor:pointer; color:var(--cfv-ink-3); display:flex; align-items:center; padding:4px; border-radius:6px; transition:all .12s; }
.ci-reply-bar__close:hover { background:var(--cfv-line); color:var(--cfv-ink); }

/* input area */
.ci-input-area { padding:10px 16px 12px; border-top:1px solid var(--cfv-line); background:var(--cfv-surface); flex-shrink:0; }
.ci-input-row { display:flex; align-items:flex-end; gap:6px; background:var(--cfv-bg); border:1.5px solid var(--cfv-line); border-radius:14px; padding:5px 6px 5px 10px; transition:border-color .15s, box-shadow .15s; }
.ci-input-row:focus-within { border-color:var(--cfv-navy); box-shadow:0 0 0 3px rgba(3,105,161,.1); }
.ci-textarea { flex:1; border:none; background:transparent; color:var(--cfv-ink); font-size:13.5px; font-family:inherit; resize:none; outline:none; line-height:1.45; min-height:24px; max-height:120px; padding:4px 2px; overflow-y:auto; }
.ci-textarea::placeholder { color:var(--cfv-ink-3); }
.ci-icon-btn { background:none; border:none; cursor:pointer; color:var(--cfv-ink-3); width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; transition:all .12s; flex-shrink:0; }
.ci-icon-btn:hover { background:var(--cfv-bg-soft); color:var(--cfv-navy); }
.ci-icon-btn:disabled { opacity:.4; cursor:default; }
.ci-send-btn { background:var(--cfv-navy); color:#fff; border:none; border-radius:10px; width:34px; height:34px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .15s; flex-shrink:0; }
.ci-send-btn:hover:not(.ci-send-btn--disabled) { background:var(--cfv-navy-700); transform:scale(1.06); box-shadow:0 2px 8px rgba(3,105,161,.4); }
.ci-send-btn--disabled { opacity:.35; cursor:default; }
.ci-input-hint { font-size:10.5px; color:var(--cfv-ink-3); margin-top:5px; padding-left:4px; }

/* modals */
.ci-modal { position:absolute; background:var(--cfv-surface); border:1px solid var(--cfv-line); border-radius:14px; padding:14px; box-shadow:var(--cfv-shadow-md); z-index:100; width:240px; animation:ci-fadein .15s ease; }
.ci-modal__title { font-size:13px; font-weight:700; color:var(--cfv-ink); margin-bottom:10px; }
.ci-modal__input { width:100%; box-sizing:border-box; border:1.5px solid var(--cfv-line); border-radius:8px; padding:7px 10px; font-size:12.5px; background:var(--cfv-bg); color:var(--cfv-ink); outline:none; margin-bottom:7px; transition:border-color .15s; font-family:inherit; }
.ci-modal__input:focus { border-color:var(--cfv-navy); }
.ci-modal__err { color:#ef4444; font-size:11px; margin-bottom:6px; }
.ci-modal__btns { display:flex; gap:6px; }
.ci-modal__btn { flex:1; border:none; border-radius:8px; padding:7px 0; cursor:pointer; font-size:12.5px; font-weight:600; transition:all .12s; }
.ci-modal__btn--ok { background:var(--cfv-navy); color:#fff; }
.ci-modal__btn--ok:hover:not(:disabled) { background:var(--cfv-navy-700); }
.ci-modal__btn--ok:disabled { opacity:.5; cursor:default; }
.ci-modal__btn--cancel { background:var(--cfv-line); color:var(--cfv-ink); }
.ci-modal__btn--cancel:hover { background:var(--cfv-line-2); }
.ci-user-list { max-height:160px; overflow-y:auto; margin-bottom:8px; }
.ci-user-list::-webkit-scrollbar { width:3px; }
.ci-user-list::-webkit-scrollbar-thumb { background:var(--cfv-line); border-radius:2px; }
.ci-user-item { display:flex; align-items:center; gap:9px; padding:6px 4px; border-radius:8px; cursor:pointer; border:none; background:none; width:100%; color:var(--cfv-ink); transition:background .1s; }
.ci-user-item:hover { background:var(--cfv-bg-soft); }

/* dark mode */
body.at-dark .ci-sb { background:var(--cfv-surface); }
body.at-dark .ci-msgs { background:#0d1418; }
body.at-dark .ci-bubble { background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.07); }
body.at-dark .ci-bubble--me { background:#0c4a6e; border-color:transparent; }
body.at-dark .ci-rchip { background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.1); }
body.at-dark .ci-rchip.is-mine { background:rgba(3,105,161,.2); }
body.at-dark .ci-act-btn { background:var(--cfv-surface); }
body.at-dark .ci-epicker { background:var(--cfv-surface); }
body.at-dark .ci-modal { background:var(--cfv-surface); }
body.at-dark .ci-input-row { background:rgba(255,255,255,.04); }
body.at-dark .ci-room__hash-wrap { background:rgba(255,255,255,.08); }
body.at-dark .ci-load-more { background:rgba(255,255,255,.04); }
body.at-dark .ci-date-sep__label { background:var(--cfv-surface); }
body.at-dark .ci-sys-msg { background:var(--cfv-surface); }
body.at-dark .ci-act-btn { background:var(--cfv-surface); }

/* ── Chat Interno — layout mobile ─────────────────────── */
@media (max-width: 640px) {
  .ci-back-btn { display:flex; }
  .ci-pane { display:none; }
  .ci-sb { width:100%; }
  .ci--pane-active .ci-sb { display:none; }
  .ci--pane-active .ci-pane { display:flex; }
  .ci-grp__body { max-width:calc(100% - 50px); }
  .ci-bubble__image { max-width:180px; }
  .ci-msgs { padding:10px 12px 12px; }
  .ci-input-area { padding:8px 10px 10px; }
  .ci-sb__top { padding:10px 12px 8px; }
}

/* ── Trava de overflow horizontal (mobile): conversa fica na largura da tela, sem "arrastar pros lados" ── */
html, body { max-width: 100%; overflow-x: clip; overscroll-behavior-x: none; }
#root { max-width: 100vw; overflow-x: clip; }
.at-main, .at-chat-area, .at-module-wrap, .at-conv-panel { max-width: 100%; overflow-x: clip; }
.at-chat-area, .at-msg-list, .at-module-wrap { overscroll-behavior-x: none; }
/* CAUSA do overflow: balão é item flex e um texto longo sem espaço (ex.: código PIX) não encolhe
   sem min-width:0 → estoura a largura. min-width:0 + quebra forçada resolve. */
.at-msg-list { min-width: 0; max-width: 100%; overflow-x: clip; }
.at-msg-row  { min-width: 0; max-width: 100%; }
.at-bubble   { min-width: 0; max-width: 78%; overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; }
.at-bubble *, .at-bubble pre, .at-bubble code { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; }
.at-bubble img.at-msg-image, .at-bubble video, .at-bubble a { max-width: 100%; }

/* Mensagem = "estática": não selecionar texto (evita o menu nativo do iOS copiar/pesquisar/traduzir no long-press) */
.at-msg-bubble, .at-msg-bubble * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* App "nativo" no celular: NADA é selecionável (sem menu nativo copiar/pesquisar/traduzir),
   EXCETO os campos de digitar (input/textarea). Desktop mantém seleção normal. */
@media (max-width: 768px) {
  .at-body, .at-body * {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
  }
  .at-body input, .at-body textarea, .at-body [contenteditable="true"], .at-body [contenteditable=""] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
  }
}

/* Trava o scroll/balanço VERTICAL da página no mobile (rubber-band do iOS).
   A página em si NÃO rola/balança — só os containers internos (mensagens, listas) rolam. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.at-body { height: 100dvh; max-height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.at-wrap { height: 100dvh; max-height: 100dvh; overflow: hidden; }
/* containers internos: não propagam o scroll pra página (evita o balanço) */
.at-module-wrap, .at-conv-panel, .at-sidebar { overscroll-behavior: contain; }

/* Pulso do avatar na tela de "cliente chamando" (toque persistente) */
@keyframes atpulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0    rgba(22,163,74,.55); }
  70%  { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(22,163,74,0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0    rgba(22,163,74,0); }
}

/* ── Cabeçalho da conversa mais baixo no celular ───────────────────────────────
   O topo estava comendo altura demais numa tela pequena, e altura ali é espaço a
   menos pra ver mensagem. Encolhe avatar, respiro e fontes, e esconde o telefone
   (que é redundante — o nome já está logo acima e o número aparece no painel do
   contato). A linha de baixo continua existindo pro tempo de janela e pra quem
   está atendendo, que são informações que mudam decisão. */
@media (max-width: 768px) {
  .at-chat-header__top   { padding: 5px 8px; gap: 6px; }
  .at-chat-header__avatar { width: 32px !important; height: 32px !important; }
  .at-chat-header__avatar span { font-size: 12px !important; }
  .at-chat-header__meta  { font-size: 10.5px; gap: 6px; margin-top: 1px; }
  .at-chat-header__meta > span:first-child { display: none; }   /* telefone */
  .at-chat-header__tags  { padding: 0 8px 4px; }
  .at-agent-attending-pill { padding: 1px 6px 1px 2px; font-size: 10px; }
}

/* ── Cabeçalho em DUAS linhas ──────────────────────────────────────────────────
   Linha 1: avatar + nome + lápis/telefone + lupa + menu — todos alinhados entre si.
   Linha 2: telefone, tempo de janela, quem atende, etiquetas e o "+", ocupando a
   LARGURA INTEIRA. Antes essa linha vivia espremida dentro do bloco do nome, ao
   lado dos botões, então quebrava cedo e empurrava a altura do cabeçalho pra cima. */
.at-chat-header__top  { align-items: center; }
.at-chat-header__meta {
  padding: 0 14px 7px;
  margin-top: -2px;
  row-gap: 4px;
}
@media (max-width: 768px) {
  .at-chat-header__meta { padding: 0 8px 5px; }
}
