:root {
  /* ---- marca ---- */
  --accent: #2F7DFF;
  --accent-dark: #1F66DB;          /* hover do azul */
  --accent-tint: #EAF2FF;
  /* ---- neutros (tema claro) ---- */
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #EEF2F8;
  --border: #E4E8F1;
  --border-strong: #D3D9E8;
  --text: #171C2C;
  --text-secondary: #5B6472;
  --muted: #97A0B0;
  --input-bg: #F4F6FB;
  /* ---- status (uso exclusivo pra estado) ---- */
  --ok: #1E9E5A;     --ok-tint: #E3F6EC;
  --warn: #B7860B;   --warn-tint: #FFF4D1;
  --danger: #E5484D; --danger-tint: #FDEBEC;
  --violet: #7B5EA7;
  /* ---- extras ---- */
  --grid-line: transparent;
  --grid-dot: #DDE3F0;
  --mark-bg: #FFE9A8;
  --badge-mix: 100%;
  --scrim: rgba(16, 25, 46, 0.45);
  --login-glow: #EAF0FE;
  /* ---- barra lateral ---- */
  --sidebar-bg: linear-gradient(180deg, #10192E 0%, #1B2850 100%);
  --sidebar-border: transparent;
  --nav-fg: #8791AB;
  --nav-fg-hover: #D3DAEC;
  --nav-hover-bg: rgba(255,255,255,0.07);
  --nav-active-bg: rgba(47, 125, 255, 0.20);
  --nav-active-fg: #7FB0FF;
  --nav-active-ring: rgba(127, 176, 255, 0.35);
  /* ---- tipografia ---- */
  --font-display: 'Unbounded', 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* ---- forma ---- */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(16, 25, 46, 0.06);
  --shadow-md: 0 6px 18px rgba(16, 25, 46, 0.09);
  --shadow-lg: 0 16px 40px rgba(16, 25, 46, 0.16);
  color-scheme: light;
}

/* ================= TEMA ESCURO — "sala de operações" ================= */
[data-theme="dark"] {
  --bg: #0E1316;
  --card: #161D21;
  --surface: #161D21;
  --surface-2: #1B242A;
  --border: #212B31;
  --border-strong: #2A353C;
  --text: #E7EEF1;
  --text-secondary: #8FA1AA;
  --muted: #5C6E77;
  --input-bg: #161D21;

  --accent: #2F7DFF;
  --accent-dark: #4C8FFF;          /* hover */
  --accent-tint: #12294F;

  --ok: #35D07F;     --ok-tint: #103322;
  --warn: #F2C94C;   --warn-tint: #3A310F;
  --danger: #FF5D5D; --danger-tint: #3A1414;
  --violet: #B48CFF;

  --grid-line: #0B0F12;
  --grid-dot: #1B242A;
  --mark-bg: #4A3F12;
  --badge-mix: 62%;
  --scrim: rgba(0, 0, 0, 0.62);
  --login-glow: #12294F;

  --sidebar-bg: #161D21;
  --sidebar-border: #212B31;
  --nav-fg: #8FA1AA;
  --nav-fg-hover: #E7EEF1;
  --nav-hover-bg: #1B242A;
  --nav-active-bg: #12294F;
  --nav-active-fg: #4C8FFF;
  --nav-active-ring: transparent;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  font-size: 14px;
}

h1, h2 {
  font-family: var(--font-body);
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 700;
}
/* Unbounded só nos títulos de página e de modal — o único ponto de personalidade forte */
h1, .kanban-modal h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }

input, textarea, select { background: var(--input-bg); color: var(--text); }
input, textarea, select { border-color: var(--border-strong) !important; }
::placeholder { color: var(--muted); opacity: 1; }
.mono { font-family: var(--font-mono); }

button {
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
}
button:active { transform: scale(0.97); }
input, textarea, select {
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.app {
  display: none;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Login ---------- */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, var(--login-glow) 0%, var(--bg) 60%);
}

.login-box {
  width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-lg);
}

.login-box h1 {
  font-size: 26px;
  margin-bottom: 8px;
  text-align: center;
}

.login-box label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-box input {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 15px;
  background: var(--bg);
}

.login-box button {
  margin-top: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent-solid);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 6px 16px rgba(47, 125, 255, 0.38);
}
.login-box button:hover { background: var(--accent-solid-hover); transform: translateY(-1px); }

.login-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin: 0;
  font-weight: 600;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 92px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
}

.logo-placeholder {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  margin-bottom: 34px;
  box-shadow: var(--shadow-sm);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-btn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--nav-fg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-fg-hover);
}
.nav-btn.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-fg);
  box-shadow: inset 0 0 0 1.5px var(--nav-active-ring);
}

/* ---------- Content shell ---------- */
.content {
  flex-grow: 1;
  min-width: 0;
  position: relative;
}

.view {
  display: none;
  height: 100%;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.view-header {
  height: 84px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  background: var(--card);
}
.view-header h1 { font-size: 22px; }

/* ---------- Inbox / Clientes shared list layout ---------- */
#view-inbox.active { flex-direction: row; }
#view-clientes.active { flex-direction: row; }

.conv-list {
  width: 380px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.conv-list-header {
  padding: 26px 22px 16px 22px;
}
.conv-list-header h1 { font-size: 23px; }

#conv-list-items {
  overflow-y: auto;
  flex-grow: 1;
  padding: 6px 12px 18px 12px;
}

.conv-item {
  display: flex;
  gap: 13px;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 4px;
  position: relative;
}

.unread-dot {
  position: absolute;
  right: 12px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.conv-item:hover { background: var(--surface-2); }
.conv-item.selected {
  background: var(--accent-tint);
  box-shadow: inset 3px 0 0 var(--accent);
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  background: var(--accent-solid);
  box-shadow: none;
}

.conv-item-body { flex-grow: 1; min-width: 0; }

.conv-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.conv-name { font-weight: 700; font-size: 15px; }
.conv-time { font-size: 12px; color: var(--muted); font-weight: 600; }

.conv-preview {
  font-size: 13.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

.badge {
  display: inline-block;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ---------- Chat panel ---------- */
.chat-panel {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.chat-empty {
  margin: auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.conv-side-panel {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
}

.side-panel-icons {
  height: 84px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.side-panel-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.side-panel-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.side-panel-icon-btn.active {
  background: var(--accent-solid);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 5px 14px rgba(47, 125, 255, 0.35);
}

.side-panel-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  font-size: 14px;
}
.side-panel-content h2 { font-size: 16px !important; }

.stage-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 3px;
}
.stage-option:hover { background: var(--bg); }
.stage-option.current { background: var(--accent-tint); }
.stage-option .check {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.stage-option.current .check {
  width: 19px;
  height: 19px;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip.active {
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

/* ---------- Chat header ---------- */
.chat-header {
  height: 84px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 32px;
  background: var(--card);
  position: relative;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tag-group {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 6px 7px 6px 12px;
}

.tag-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tag-chip-row:empty::before {
  content: 'Sem etiquetas';
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.tag-toggle-btn {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.tag-toggle-btn:hover { background: var(--accent-solid); color: #fff; }

.tags-popover {
  position: absolute;
  top: 76px;
  right: 24px;
  width: 280px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 20;
  font-size: 13px;
}

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bubble {
  max-width: 440px;
  padding: 13px 17px;
  font-size: 15px;
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
}

.bubble.in {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px 18px 18px 18px;
}

.bubble.out {
  align-self: flex-end;
  background: var(--accent-solid);
  color: #fff;
  border-radius: 18px 4px 18px 18px;
}

.chat-input {
  height: 84px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 26px;
}

.chat-input input {
  flex-grow: 1;
  padding: 13px 17px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 15px;
}

.chat-input button {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent-solid);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(47, 125, 255, 0.32);
}
.chat-input button:hover { background: var(--accent-solid-hover); transform: translateY(-1px); }

.chat-input #chat-attach-btn,
.chat-input #chat-mic-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.chat-input #chat-attach-btn:hover,
.chat-input #chat-mic-btn:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  transform: none;
}

/* ---------- Kanban ---------- */
.kanban-board {
  flex-grow: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;         /* a tela do funil fica parada; só a lista de cards de cada etapa rola */
  padding: 20px 26px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 272px;
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

/* Cada etapa é um bloco próprio: o cliente enxerga claramente quem está em qual etapa */
.kanban-col {
  width: 272px;
  flex-shrink: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--surface) 70%, var(--bg, var(--surface-2)));
  border: 1px solid var(--border);
  border-top: 3px solid var(--stage, var(--accent));   /* faixa colorida da etapa */
  border-radius: 14px;
  padding: 14px 10px 0 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 14px 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.kanban-col-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.kanban-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-2);
  padding: 3px 10px;
  border-radius: 20px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 2px 20px 2px;
}

.kanban-cards.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
}

.kanban-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.kanban-modal {
  width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}
.kanban-modal label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 16px;
  margin-bottom: 6px;
}
.kanban-modal select,
.kanban-modal input,
.kanban-modal textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 14px;
}
.kanban-modal textarea { min-height: 90px; }

.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }

.kanban-card.dragging { opacity: 0.4; }

.kanban-card-name { font-weight: 700; font-size: 14.5px; }

.kanban-card-device {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.kanban-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

/* ---------- WhatsApp connection ---------- */
.wa-box {
  padding: 44px;
  max-width: 440px;
}

.wa-status {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
}

.wa-status.connected { color: var(--ok); }
.wa-status.pending { color: var(--warn); }

.wa-box img {
  width: 270px;
  height: 270px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* ---------- Pill tabs (Follow-ups / Configurações) ---------- */
.fu-tab, .cfg-tab {
  padding: 9px 17px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
}
.fu-tab:hover, .cfg-tab:hover { border-color: var(--accent); }
.fu-tab.active, .cfg-tab.active {
  background: var(--accent-tint);
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Dashboard ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 34px;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.dash-card:hover { box-shadow: var(--shadow-md); }
.dash-card .num {
  font-family: var(--font-body);
  letter-spacing: -0.02em;
  font-size: 32px;
  font-weight: 700;
}
.dash-card .label {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 5px;
  font-weight: 600;
}

/* ================= Status (verde / amarelo / vermelho — só pra estado) ================= */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.warn  { background: var(--warn);   box-shadow: 0 0 0 3px var(--warn-tint); }
.status-dot.alert { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.status-dot.ok    { background: var(--ok);     box-shadow: 0 0 0 3px var(--ok-tint); }

.kanban-card.status-alert { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.kanban-card.status-warn  { border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.t-warn  { color: var(--warn) !important; }
.t-alert { color: var(--danger) !important; }

/* contador "leitura de instrumento" */
.counter-line {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 6px;
  letter-spacing: 0;
}
.counter-line .alert { color: var(--danger); font-weight: 600; }

/* botão de tema */
.theme-toggle { margin-top: auto; }
.theme-toggle + .nav-btn { margin-top: 8px; }

/* hierarquia: só o botão principal é sólido e saturado; o resto é "ghost" */
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* no escuro, sombras de brilho azul ficam discretas */
[data-theme="dark"] .login-box button,
[data-theme="dark"] .chat-input button,
[data-theme="dark"] .side-panel-icon-btn.active { box-shadow: none; }
[data-theme="dark"] .kanban-card:hover { transform: none; }

/* ================= Status da conversa: aguardando / concluído ================= */
.seg-row { display: flex; flex-wrap: nowrap; gap: 5px; margin-top: 12px; }
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.seg-btn:hover { border-color: var(--accent); }
.seg-btn.active { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }
.seg-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-secondary);
}
.seg-btn.active .seg-count { background: var(--accent-solid); color: #fff; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-pill.low        { color: var(--text-secondary); background: var(--surface-2); }
.status-pill.warn       { color: var(--warn);   background: var(--warn-tint); }
.status-pill.alert      { color: var(--danger); background: var(--danger-tint); }
.status-pill.done-won   { color: var(--ok);     background: var(--ok-tint); }
.status-pill.done-lost  { color: var(--text-secondary); background: var(--surface-2); }
.status-pill.low::before, .status-pill.warn::before, .status-pill.alert::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.counter-line .warn  { color: var(--warn);   font-weight: 600; }
.counter-line .low   { color: var(--text);   font-weight: 600; }


/* ---------- Período + métricas do Kanban ---------- */
.period-bar { display:flex; align-items:center; gap:10px; margin-top:16px; font-size:13px; color:var(--text-secondary); }
.period-bar select, .period-bar input[type=date] {
  padding:7px 10px; border-radius:8px; border:1.5px solid var(--border);
  background:var(--surface); color:var(--text); font-size:13px; font-weight:600;
}
.metrics-row { display:flex; gap:12px; margin-top:12px; flex-wrap:wrap; }
.metric-card { min-width:150px; padding:12px 18px; }
.metric-sub { font-size:11.5px; color:var(--muted); margin-top:2px; }

/* ---------- Switch "Em follow up" ---------- */
.fu-switch-row { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:18px; padding-top:16px; border-top:1px solid var(--border); }
.switch { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.switch input { opacity:0; width:0; height:0; }
.switch .slider { position:absolute; inset:0; background:var(--border-strong); border-radius:24px; cursor:pointer; transition:.2s; }
.switch .slider::before { content:''; position:absolute; height:18px; width:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; }
.switch input:checked + .slider { background: var(--accent-solid); }
.switch input:checked + .slider::before { transform:translateX(20px); }

/* ---------- Cadência de follow-up ---------- */
.fu-mode { padding:9px 17px; border-radius:var(--radius-sm); border:1.5px solid var(--border); background:var(--card); font-size:13.5px; font-weight:700; color:var(--text-secondary); }
.fu-mode:hover { border-color:var(--accent); }
.fu-mode.active { background:var(--accent-tint); color:var(--accent); border-color:var(--accent); }
.fu-hint { padding:12px 28px 0; font-size:12.5px; color:var(--muted); }
#followup-board { flex:1; }
.fu-empty { border:1.5px dashed var(--border); border-radius:var(--radius-md); padding:18px; text-align:center; color:var(--muted); font-size:13px; }
.fu-card.late { border-color:var(--danger); }
.fu-due { margin-top:10px; font-size:12.5px; font-weight:700; color:var(--text-secondary); }
.fu-due.late { color:var(--danger); }
.fu-due.soon { color:var(--warn); }
.fu-replied { margin-top:6px; font-size:12.5px; font-weight:700; color:var(--ok); }
.fu-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.fu-btn { padding:6px 10px; border-radius:7px; border:1px solid var(--border); background:var(--surface); color:var(--text); font-size:12px; font-weight:600; }
.fu-btn:hover { border-color:var(--accent); }
.fu-btn.primary { background: var(--accent-solid); border-color:var(--accent); color:#fff; }
.fu-btn:disabled { opacity:.5; }
.nav-btn { position:relative; }
.nav-badge { position:absolute; top:2px; right:2px; min-width:16px; height:16px; padding:0 4px; border-radius:8px; background:var(--danger); color:#fff; font-size:10px; font-weight:800; display:flex; align-items:center; justify-content:center; }

/* Aviso discreto: WhatsApp desconectado */
.nav-dot { position:absolute; top:6px; right:6px; width:8px; height:8px; border-radius:50%; background:var(--danger); box-shadow:0 0 0 2px var(--surface); }
#wa-alert { position:fixed; top:12px; left:50%; transform:translateX(-50%); z-index:60; display:flex; align-items:center; gap:8px; padding:6px 6px 6px 12px; border-radius:999px; background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow-sm); font-size:12.5px; font-weight:600; color:var(--text-secondary); max-width:calc(100vw - 32px); white-space:nowrap; }
#wa-alert .wa-alert-dot { width:7px; height:7px; border-radius:50%; background:var(--danger); flex-shrink:0; }
#wa-alert .wa-alert-go { border:none; background:none; color:var(--accent); font-size:12.5px; font-weight:700; padding:2px 4px; cursor:pointer; }
#wa-alert .wa-alert-x { border:none; background:none; color:var(--muted); font-size:15px; line-height:1; padding:2px 6px; cursor:pointer; }


/* ---------- Conexão WhatsApp ---------- */
.wa-card { max-width:620px; background:var(--card); border:1px solid var(--border); border-radius:var(--radius-md); padding:22px; box-shadow:var(--shadow-sm); }
.wa-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.wa-card-head .wa-status { margin:0; }
.wa-btn { padding:8px 14px; border-radius:9px; border:1.5px solid var(--accent); background:var(--accent-tint); color:var(--accent); font-size:13px; font-weight:700; }
.wa-btn:disabled { opacity:.6; }
.wa-card-body { display:flex; gap:26px; align-items:center; flex-wrap:wrap; }
.wa-qr-slot { width:240px; height:240px; display:flex; align-items:center; justify-content:center; background:#fff; border-radius:14px; border:1px solid var(--border); text-align:center; padding:8px; box-sizing:border-box; }
.wa-qr-slot img { width:100%; height:100%; object-fit:contain; }
.wa-qr-loading { color:#6b7280; font-size:13px; line-height:1.5; }
.wa-steps { margin:0; padding-left:20px; font-size:14px; line-height:2; color:var(--text-secondary); }
.wa-steps b { color:var(--text); }
.wa-note { margin:18px 0 0; font-size:12.5px; color:var(--muted); }


/* ---------- Tela de importação do WhatsApp ---------- */
#wa-sync-overlay { position:fixed; inset:0; background:var(--bg); z-index:200; display:flex; align-items:center; justify-content:center; padding:16px; }
.sync-card { width:100%; max-width:460px; background:var(--card); border:1px solid var(--border); border-radius:var(--radius-md); padding:28px; box-shadow:var(--shadow-md); }
.sync-title { font-family:var(--font-display); font-weight:700; font-size:19px; }
.sync-sub { margin:8px 0 18px; font-size:13.5px; color:var(--text-secondary); line-height:1.5; }
.sync-bar { height:10px; border-radius:6px; background:var(--surface-2); overflow:hidden; }
.sync-bar-fill { height:100%; width:0; background: var(--accent-solid); border-radius:6px; transition:width .4s; }
.sync-bar-fill.indeterminate { width:35%; animation:sync-slide 1.3s ease-in-out infinite; }
@keyframes sync-slide { 0% { margin-left:-35%; } 100% { margin-left:100%; } }
.sync-percent { height:18px; margin-top:6px; text-align:right; font-size:12.5px; font-weight:700; color:var(--accent); }
.sync-steps { list-style:none; margin:14px 0 0; padding:0; display:flex; flex-direction:column; gap:10px; font-size:13.5px; color:var(--muted); }
.sync-steps li { display:flex; align-items:center; gap:10px; }
.sync-steps li em { font-style:normal; color:var(--text-secondary); }
.sync-ico { width:22px; height:22px; border-radius:50%; border:1.5px solid var(--border-strong); display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; flex-shrink:0; }
.sync-steps li.active { color:var(--text); font-weight:700; }
.sync-steps li.active .sync-ico { border-color:var(--accent); color:var(--accent); }
.sync-steps li.done { color:var(--text-secondary); }
.sync-steps li.done .sync-ico { background:var(--ok); border-color:var(--ok); color:#fff; }
.sync-foot { margin-top:20px; font-size:12px; color:var(--muted); line-height:1.5; }

.wa-days { display:grid; grid-template-columns:repeat(auto-fill,minmax(72px,1fr)); gap:6px; margin-top:12px; max-width:620px; }
.wa-day { display:flex; flex-direction:column; align-items:center; padding:6px 4px; border-radius:8px; border:1px solid var(--border); background:var(--surface); font-size:11.5px; color:var(--text-secondary); }
.wa-day b { font-size:14px; color:var(--text); }
.wa-day.empty b { color:var(--muted); font-weight:500; }

.sync-eta { margin:-6px 0 16px; font-size:13px; font-weight:700; color:var(--accent); }


/* ---------- Configurações: navegação e cabeçalho ---------- */
.cfg-header { justify-content: space-between; }
.cfg-account { margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.admin-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 11px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff; font-size: 13.5px; font-weight: 800;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); cursor: pointer;
}
.admin-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cfg-nav { display: flex; gap: 10px; padding: 16px 32px; background: var(--card); border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }
.cfg-nav .cfg-tab {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; font-size: 14px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-secondary); font-weight: 700;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.cfg-nav .cfg-tab:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.cfg-nav .cfg-tab.active {
  background: var(--accent-solid); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}
.cfg-content { padding: 28px 32px; overflow-y: auto; max-width: 760px; width: 100%; box-sizing: border-box; }

/* ---------- Painel Admin ---------- */
.admin-body { flex: 1; min-height: 0; display: flex; }
.admin-side { width: 330px; flex-shrink: 0; border-right: 1px solid var(--border); background: var(--card); padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.admin-new { padding: 12px; border-radius: 11px; border: none; background: var(--accent-solid); color: #fff; font-weight: 800; font-size: 14px; cursor: pointer; }
.acc-card { padding: 14px 16px; border-radius: 13px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; margin-bottom: 10px; }
.acc-card:hover { border-color: var(--accent); }
.acc-card.selected { border-color: var(--accent); background: var(--accent-tint); }
.acc-name { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-meta { margin-top: 6px; font-size: 12.5px; color: var(--text-secondary); }
.pill { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 20px; background: var(--surface-2); color: var(--text-secondary); }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.off { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.pill.here { background: var(--accent-solid); color: #fff; }
.admin-detail { flex: 1; min-width: 0; padding: 28px 32px; overflow-y: auto; }
.admin-empty { color: var(--muted); font-size: 14px; padding: 40px 0; text-align: center; }
.admin-detail h2 { font-size: 20px; margin: 0; }
.admin-sect { margin-top: 26px; }
.admin-sect h3 { font-size: 14px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.stat-box { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); }
.stat-box b { display: block; font-size: 20px; }
.stat-box span { font-size: 12px; color: var(--text-secondary); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.form-row input, .form-row select, .inp { padding: 10px 12px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; flex: 1; min-width: 160px; box-sizing: border-box; }
.btn-primary { padding: 10px 16px; border-radius: 9px; border: none; background: var(--accent-solid); color: #fff; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.btn-ghost { padding: 10px 16px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.err-text { color: var(--danger); font-size: 13px; margin: 6px 0 0; }
.adm-user { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:12px 0; border-bottom:1px solid var(--border); }

/* ---------- Aviso "você está em outra conta" ---------- */
#account-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 160; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 18px; border-radius: 30px; background: var(--accent-solid); color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
#account-bar button { padding: 6px 12px; border-radius: 20px; border: none; background: #fff; color: var(--accent); font-weight: 800; font-size: 12.5px; cursor: pointer; }

/* Valor em orçamento por etapa do funil */
.kanban-col-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 6px 12px 6px;
  margin-top: -6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.kanban-col-total b { font-size: 14px; font-weight: 800; color: var(--accent); letter-spacing: -.01em; }
.kanban-col-total b.zero { color: var(--muted); font-weight: 600; }
.kanban-col-total small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.kanban-col .kanban-col-add {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-secondary); font-size: 17px; line-height: 1; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.kanban-col .kanban-col-add:hover { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }
.kanban-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  flex: 1; min-height: 140px; color: var(--muted); text-align: center; font-size: 13px; font-weight: 600;
}
.kanban-empty svg { opacity: .7; margin-bottom: 4px; }
.kanban-empty small { font-size: 12px; font-weight: 500; opacity: .8; }
.kv-eye {
  margin-left: auto;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.kv-eye:hover { background: var(--surface-2); }
.kv-eye svg { width: 18px; height: 18px; }

.kanban-cards > * { flex-shrink: 0; }

.kanban-col .kanban-col-header { min-height: 58px; align-items: flex-start; padding-bottom: 10px; }

/* ---- Gravação de áudio ---- */
.chat-input.recording > :not(.rec-bar) { display: none !important; }
.rec-bar { display: flex; align-items: center; gap: 12px; width: 100%; }
.rec-bar .rec-btn { box-shadow: none; }
.rec-bar .rec-cancel { background: var(--surface-2); color: var(--danger); }
.rec-bar .rec-cancel:hover { background: var(--surface-2); filter: brightness(1.1); }
.rec-bar .rec-pause { background: var(--surface-2); color: var(--text); }
.rec-bar .rec-pause:hover { background: var(--surface-2); filter: brightness(1.1); }
.rec-bar .rec-send:disabled { opacity: .5; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--danger); flex-shrink: 0; animation: recPulse 1s ease-in-out infinite; }
.rec-bar.is-paused .rec-dot { animation: none; opacity: .4; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 16px; min-width: 42px; }
.rec-status { font-size: 13px; color: var(--text-secondary); flex-shrink: 0; }
.rec-preview { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
.rec-preview audio { height: 36px; max-width: 100%; }
@keyframes recPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .45; } }
.sending-bubble { display: inline-flex; align-items: center; gap: 8px; opacity: .85; }
.send-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: sendSpin .7s linear infinite; }
@keyframes sendSpin { to { transform: rotate(360deg); } }
.rec-bar.is-paused .rec-status { display: none; }
.rec-preview { min-width: 0; }
.rec-bar.is-paused .rec-preview { min-width: 150px; }
.rec-preview audio { width: 100%; }

/* ---- Player de áudio ---- */
.wa-audio { display: flex; align-items: center; gap: 12px; min-width: 240px; padding: 2px 2px; }
.wa-audio audio { display: none; }
.wa-play {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: none; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  background: #fff; color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform .12s;
}
.wa-play:hover { transform: scale(1.06); }
.wa-audio.in .wa-play { background: var(--accent-solid); color: #fff; }
.wa-play .ic-pause, .wa-play .wa-spin { display: none; }
.wa-audio.is-playing .ic-play { display: none; }
.wa-audio.is-playing .ic-pause { display: block; }
.wa-audio.is-loading .ic-play, .wa-audio.is-loading .ic-pause { display: none; }
.wa-audio.is-loading .wa-spin { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: sendSpin .7s linear infinite; }
.wa-body { flex: 1; min-width: 0; }
.wa-wave { display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.wa-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: .38; transition: opacity .15s, transform .15s; }
.wa-wave i.on { opacity: 1; }
.wa-audio.in .wa-wave i.on { color: var(--accent); }
.wa-audio.is-playing .wa-wave i.on { animation: waBar .9s ease-in-out infinite; animation-delay: calc(var(--i) * -55ms); }
@keyframes waBar { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.62); } }
.wa-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; font-size: 11.5px; font-weight: 700; opacity: .9; font-variant-numeric: tabular-nums; }
.chat-messages .wa-speed, .wa-speed {
  border: none; border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 800; cursor: pointer;
  background: rgba(255,255,255,.22); color: inherit;
}
.wa-audio.in .wa-speed { background: var(--surface-2); color: var(--text-secondary); }

.ad-badge { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-tint); border-radius: 8px; padding: 2px 8px; margin-top: 6px; }
.badge.ad-badge { margin-top: 0; }

/* ---- Dashboard: filtros, abas e funil visual ---- */
.dash-filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:14px; }
.dash-chip { padding:7px 13px; border-radius:999px; border:1px solid var(--border); background:var(--surface, transparent); color:var(--text-secondary); font-size:13px; cursor:pointer; }
.dash-chip.active { background: var(--accent-solid); border-color:var(--accent); color:#fff; font-weight:600; }
.dash-custom { display:inline-flex; gap:6px; align-items:center; font-size:13px; color:var(--text-secondary); }
.dash-custom input { padding:6px 8px; border-radius:8px; border:1px solid var(--border); }
.dash-tabs { display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:20px; overflow-x:auto; }
.dash-tab { padding:10px 14px; background:none; border:none; border-bottom:2px solid transparent; color:var(--text-secondary); font-size:14px; cursor:pointer; white-space:nowrap; }
.dash-tab.active { color:var(--text); border-bottom-color:var(--accent); font-weight:600; }
.dash-h { font-size:15px; margin:18px 0 10px; }
.dash-line { padding:10px 0; border-bottom:1px solid var(--border); font-size:14px; }
.dash-line small { color:var(--muted); }
.fn-wrap { max-width:760px; margin:0 auto 20px; }
.fn-row { display:flex; align-items:center; gap:16px; margin-bottom:3px; }
.fn-stage { flex:1; display:flex; justify-content:center; min-width:0; }
.fn-seg { height:58px; display:flex; flex-direction:column; align-items:center; justify-content:center; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.35); transition:width .4s; overflow:hidden; padding:0 12px; box-sizing:border-box; }
.fn-name { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.fn-val { font-size:17px; font-weight:700; }
.fn-side { width:150px; flex-shrink:0; font-size:13px; }
.fn-side b { display:block; font-size:16px; }
.fn-side small { color:var(--muted); }
.fn-lost { max-width:760px; margin:0 auto 12px; }
.fn-lost h3 { font-size:14px; margin:0 0 8px; color:var(--danger); }
.fn-lost-item { display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--border); border-radius:10px; margin-bottom:6px; font-size:14px; }
.fn-lost-item span { width:12px; height:12px; border-radius:3px; }
.fn-lost-item b { margin-left:auto; }
.fn-lost-item small { color:var(--muted); min-width:90px; text-align:right; }
.fn-note { max-width:760px; margin:10px auto 0; font-size:12px; color:var(--muted); }
@media (max-width:600px) { .fn-side { width:96px; } .fn-side small { display:none; } }

/* ---- Configurações: editor de etapas do Kanban ---- */
.stg-row { display:flex; align-items:center; gap:8px; padding:8px 0; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.stg-move { display:flex; flex-direction:column; gap:2px; }
.stg-move .fu-btn { padding:0 8px; line-height:18px; }
.stg-color { width:38px; height:34px; padding:0; border:1px solid var(--border); border-radius:8px; background:none; cursor:pointer; }
.stg-name { flex:1; min-width:160px; padding:8px 10px; border-radius:8px; border:1px solid var(--border); }
.stg-row select { padding:8px; border-radius:8px; border:1px solid var(--border); }
.fu-btn.danger { color:var(--danger); }
.stg-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); display:flex; align-items:center; justify-content:center; z-index:9999; }
.stg-dialog { background:var(--bg, #fff); color:var(--text); padding:22px; border-radius:14px; max-width:420px; width:calc(100% - 32px); }
.stg-dialog select { width:100%; padding:9px; border-radius:8px; border:1px solid var(--border); }

/* ---- Pop-up de alerta (ações sem volta) ---- */
.danger-overlay { position:fixed; inset:0; background:rgba(15,10,10,.6); backdrop-filter:blur(2px); display:flex; align-items:center; justify-content:center; z-index:10000; animation:dgfade .15s; }
.danger-dialog { width:calc(100% - 32px); max-width:440px; background:var(--bg,#fff); color:var(--text); border-radius:16px; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.45); border:1px solid #dc2626; animation:dgpop .18s; }
.danger-head { display:flex; align-items:center; gap:12px; padding:16px 20px; background:linear-gradient(135deg,#dc2626,#b91c1c); color:#fff; }
.danger-head h3 { margin:0; font-size:17px; }
.danger-body { padding:18px 20px 6px; font-size:14px; line-height:1.5; }
.danger-body p { margin:0 0 12px; }
.danger-warn { background:#fef3c7; color:#78350f; border:1px solid #f59e0b; border-left-width:5px; border-radius:10px; padding:11px 13px; font-size:13px; }
.danger-actions { display:flex; justify-content:flex-end; gap:10px; padding:16px 20px 20px; }
.danger-confirm { background:#dc2626; color:#fff; border:0; border-radius:8px; padding:10px 16px; font-weight:700; cursor:pointer; }
.danger-confirm:hover { background:#b91c1c; }
@keyframes dgfade { from{opacity:0} to{opacity:1} }
@keyframes dgpop { from{transform:scale(.94);opacity:0} to{transform:none;opacity:1} }

/* ---- Clientes ---- */
.cli-search { margin-top:12px; width:100%; box-sizing:border-box; padding:9px 12px; border-radius:8px; border:1px solid var(--border); }
.cli-filters { display:flex; gap:6px; margin-top:8px; }
.cli-filters select { flex:1; min-width:0; padding:7px 6px; border-radius:8px; border:1px solid var(--border); font-size:12.5px; }
.cli-newform { display:flex; flex-direction:column; gap:8px; padding:0 20px 16px; }
.cli-newform input, .cli-editform input, .cli-editform textarea { padding:9px 12px; border-radius:8px; border:1px solid var(--border); font-size:14px; width:100%; box-sizing:border-box; }
.cli-empty { padding:16px; color:var(--muted); font-size:14px; }
.cli-badges { display:flex; flex-wrap:wrap; gap:4px; margin-top:5px; }
.cli-head { display:flex; align-items:center; gap:16px; padding:20px 28px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.avatar-lg { width:60px; height:60px; font-size:20px; flex-shrink:0; }
.cli-name { font-size:20px; font-weight:700; }
.cli-actions { display:flex; gap:8px; flex-wrap:wrap; }
.cli-body { padding:20px 28px; overflow-y:auto; flex:1; }
.cli-tag { display:inline-flex; align-items:center; gap:5px; margin:0 6px 6px 0; }
.cli-x { cursor:pointer; font-weight:700; }
.cli-data { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; font-size:14px; }
.cli-data span { display:block; font-size:12px; color:var(--muted); }
.cli-conv { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.cli-conv-val { font-weight:700; white-space:nowrap; }
.cli-editform { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:20px; padding:16px; background:var(--bg); border-radius:12px; border:1px solid var(--border); }
.cli-editform label { font-size:13px; color:var(--text-secondary); display:flex; flex-direction:column; gap:4px; }
@media (max-width:700px) { .cli-editform { grid-template-columns:1fr; } .cli-head, .cli-body { padding-left:16px; padding-right:16px; } }
#clientes-list-items { overflow-y: auto; flex: 1 1 0; min-height: 0; padding: 6px 12px 18px 12px; }
#view-clientes .conv-list { min-height: 0; }
#cliente-profile { min-height: 0; }
.cli-body { min-height: 0; }
.cli-obs { width:100%; box-sizing:border-box; min-height:120px; padding:12px; border-radius:10px; border:1px solid var(--border); background:var(--card); color:var(--text); font:inherit; font-size:14px; resize:vertical; }
.cli-obs:focus { outline:none; border-color:var(--accent); }
.me-prefix { font-weight:700; color:var(--accent); }

/* ---- Coluna "Aguardando resposta" do Kanban ---- */
.kanban-col-wait { background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.wait-actions { display:flex; gap:6px; margin-top:10px; }
.wait-actions .btn-primary { width:auto; flex:1; padding:7px 10px; font-size:12.5px; }
.wait-actions .fu-btn { flex:1; font-size:12px; }


/* ---- Origem obrigatória (piscando) ---- */
@keyframes origemPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(224,161,0,.0); border-color: #E0A100; } 50% { box-shadow: 0 0 0 5px rgba(224,161,0,.35); border-color: #FFC83D; } }
@keyframes origemFade { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
#chat-tag-toggle-btn.origem-blink { animation: origemPulse 1s ease-in-out infinite; border-color: #E0A100 !important; color: #E0A100 !important; }
.origem-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.origem-title.origem-blink-text { color: #E0A100; animation: origemFade 1s ease-in-out infinite; }
.badge.origem-pend { background: rgba(224,161,0,.16); color: #E0A100; border: 1px solid rgba(224,161,0,.5); }

/* ---- Follow-up arrastável ---- */
.fu-card { cursor: grab; }
.fu-card.dragging { opacity: .5; }

/* ---- Logo da empresa ---- */
.logo-placeholder.has-logo { background-size: cover; background-position: center; background-repeat: no-repeat; border: none; }
.logo-cfg { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.logo-cfg-preview { width: 84px; height: 84px; border-radius: 14px; border: 1.5px dashed var(--border-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.logo-cfg-preview img { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================================
   LAYOUT NOVO — vale nos DOIS temas (claro e escuro). Só as cores mudam.
   ===================================================================== */
:root { --font-display: 'Poppins', 'Plus Jakarta Sans', sans-serif; }

/* títulos: Poppins, firme e sem exagero */
h1, .kanban-modal h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.025em; }
.view-header { background: transparent; border-bottom-color: transparent; }
.view-header h1 { font-size: 26px; }

/* menu lateral com ícone + nome */
.nav-label { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar { width: 224px; align-items: stretch; padding: 22px 14px 18px; }
.logo-placeholder { margin: 0 0 26px 8px; width: 40px; height: 40px; }
.sidebar nav { gap: 2px; }
.nav-btn { width: 100%; height: 42px; justify-content: flex-start; gap: 12px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 500; text-align: left; }
.nav-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-btn.active { font-weight: 600; box-shadow: none; }
.nav-btn:active { transform: none; }
.nav-push { margin-top: auto; }
.nav-badge { top: 50%; right: 10px; transform: translateY(-50%); }
.nav-dot { top: 50%; right: 14px; transform: translateY(-50%); box-shadow: none; }

/* aviso de WhatsApp: fica no rodapé do menu (não cobre o cabeçalho das telas) */
@media (min-width: 1101px) {
  #wa-alert { top: auto; bottom: 122px; left: 12px; transform: none; width: 200px; max-width: 200px; box-shadow: none; background: rgba(229, 72, 77, 0.16); border-color: transparent; color: #F4C7C9; border-radius: 10px; padding: 0 2px 0 12px; gap: 7px; height: 38px; font-size: 12.5px; font-weight: 500; cursor: pointer; overflow: hidden; }
  #wa-alert .wa-alert-go { display: none; } /* a linha inteira já leva para a tela do WhatsApp */
  #wa-alert .wa-alert-x { display: none; }  /* discreto; some sozinho ao reconectar */
}
@media (max-width: 1100px) { /* tela pequena: menu volta a ser só ícones */
  .sidebar { width: 76px; align-items: center; padding: 22px 0; }
  .logo-placeholder { margin: 0 0 26px 0; }
  .nav-btn { width: 48px; justify-content: center; padding: 0; }
  .nav-label { display: none; }
  .nav-badge { top: 2px; right: 2px; transform: none; }
  .nav-dot { top: 6px; right: 6px; transform: none; }
}

/* listas (Conversas / Clientes) */
.conv-item { padding: 12px; border-radius: 12px; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.selected { background: var(--accent-tint); box-shadow: none; }
.conv-name { font-weight: 600; }
.badge { font-weight: 600; }

/* avatares redondos com cor fixa por contato (as cores ficam em cada tema, abaixo) */
.avatar, .avatar-lg { border-radius: 50%; font-weight: 600; font-size: 13px; }
.avatar-lg { font-size: 19px; }

/* campos e botões mais leves */
.chat-input input { background: var(--input-bg); border-radius: 999px; padding: 12px 18px; }
.cli-search { border-radius: 999px; padding: 9px 14px; }
.login-box button, .chat-input button { box-shadow: none; }

/* funil */
.kanban-col { border-color: transparent; border-top: 3px solid var(--stage, var(--accent)); box-shadow: none; }
.kanban-card:hover { transform: none; }
.dash-card, .stat-box { box-shadow: none; }

/* =====================================================================
   CORES DO TEMA CLARO — cinza-azulado (nada de branco puro) + menu azul-marinho
   ===================================================================== */
[data-theme="light"] {
  --accent: #2F6FE0;
  --accent-dark: #2459BF;
  --accent-tint: #DCE6F7;
  --bg: #E6EAF0;
  --card: #F3F5F8;
  --surface: #F3F5F8;
  --surface-2: #E1E6ED;
  --border: #D6DCE5;
  --border-strong: #C8D0DC;
  --text: #1A2233;
  --text-secondary: #4E5A6D;
  --muted: #828DA0;
  --input-bg: #EDF0F4;
  --grid-dot: #DCE1E9;
  --login-glow: #D5DFF0;
  --sidebar-bg: linear-gradient(180deg, #10192E 0%, #1B2850 100%);
  --sidebar-border: transparent;
  --nav-fg: #9AA4BF;
  --nav-fg-hover: #E3E8F4;
  --nav-hover-bg: rgba(255, 255, 255, 0.07);
  --nav-active-bg: rgba(47, 125, 255, 0.22);
  --nav-active-fg: #FFFFFF;
  --nav-active-ring: transparent;
  --shadow-sm: 0 1px 2px rgba(17, 19, 24, 0.04);
  --shadow-md: 0 4px 14px rgba(17, 19, 24, 0.06);
  --shadow-lg: 0 14px 36px rgba(17, 19, 24, 0.10);
}
[data-theme="light"] .avatar, [data-theme="light"] .avatar-lg { background: #E3E7EE; color: #3F4553; }
[data-theme="light"] .av-0 { background: #FDEEDC; color: #9A5B13; }
[data-theme="light"] .av-1 { background: #FCE7EF; color: #A23A62; }
[data-theme="light"] .av-2 { background: #E7F0FE; color: #2F5DA8; }
[data-theme="light"] .av-3 { background: #E5F5EC; color: #2E7A4E; }
[data-theme="light"] .av-4 { background: #F0EAFD; color: #6A47B0; }
[data-theme="light"] .av-5 { background: #FFF5D6; color: #8A6A0A; }
[data-theme="light"] .kanban-col { background: #DDE2EA; }
[data-theme="light"] .kanban-card { box-shadow: var(--shadow-sm); }

/* =====================================================================
   CORES DO TEMA ESCURO — mesmo layout, avatares em tons suaves sobre o escuro
   ===================================================================== */
[data-theme="dark"] .avatar, [data-theme="dark"] .avatar-lg { background: #222C33; color: #C9D3D9; }
[data-theme="dark"] .av-0 { background: rgba(242, 153, 74, 0.18); color: #F4B37A; }
[data-theme="dark"] .av-1 { background: rgba(236, 104, 150, 0.18); color: #F19BBA; }
[data-theme="dark"] .av-2 { background: rgba(76, 143, 255, 0.20); color: #8DB6FF; }
[data-theme="dark"] .av-3 { background: rgba(53, 208, 127, 0.16); color: #7FDCAA; }
[data-theme="dark"] .av-4 { background: rgba(180, 140, 255, 0.18); color: #C7AEFF; }
[data-theme="dark"] .av-5 { background: rgba(242, 201, 76, 0.16); color: #EBCB6E; }

/* =====================================================================
   REVISÃO VISUAL (20/11/2026) — contraste, foco, tamanhos, celular
   Layout sem prefixo de tema; cores dentro de cada tema (mais abaixo).
   ===================================================================== */

/* azul sólido dos botões (texto branco com contraste 5,2:1) — igual nos dois temas */
:root { --accent-solid: #2563EB; --accent-solid-hover: #1D4ED8; }

/* ---- foco visível para quem navega pelo teclado ---- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
input:focus, textarea:focus, select:focus, .cli-obs:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---- respeita "reduzir movimento" do sistema ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---- ícones SVG no lugar de emojis ---- */
.ico { display: inline-block; vertical-align: -2px; flex-shrink: 0; }
.badge .ico, .status-pill .ico, .ad-badge .ico { vertical-align: -2px; }
.stage-option .check .ico { vertical-align: 0; }

/* ---- números e contadores na fonte do sistema (nada de fonte de código) ---- */
.counter-line, .seg-count { font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.counter-line { font-size: 12.5px; }

/* ---- texto mínimo de 12px ---- */
.metric-sub, .conv-time, .badge, .status-pill, .seg-count, .ad-badge, .wa-meta, .wa-speed,
.kanban-col-total small, .pill, .wa-day, .sync-ico, .stage-option .check { font-size: 12px; }
.nav-badge { font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; background: #D93036; }

/* ---- alvos de clique maiores ---- */
.kanban-col .kanban-col-add { width: 32px; height: 32px; }
.wa-speed, .chat-messages .wa-speed { min-height: 22px; padding: 3px 10px; }
.icon-hit { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; }
.icon-hit:hover { background: var(--surface-2) !important; }

/* ---- logo: iniciais da empresa quando não há imagem ---- */
.logo-placeholder { display: flex; align-items: center; justify-content: center; border: none; box-shadow: none; font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.logo-placeholder.has-logo { font-size: 0; }

/* ---- Painel Admin no mesmo estilo dos outros botões (sem gradiente) ---- */
.admin-btn { background: var(--accent-solid); box-shadow: none; }
.admin-btn:hover { background: var(--accent-solid-hover); filter: none; }
.cfg-nav .cfg-tab.active { box-shadow: none; }

/* ---- filtros de Clientes sem texto cortado ---- */
.cli-filters { flex-wrap: wrap; }
.cli-filters select { flex: 1 1 96px; padding: 7px 8px; font-size: 13px; }

/* ---- Conversas: filtros podem quebrar linha ---- */
.seg-row { flex-wrap: wrap; }

/* ---- Chat: barra de ações se adapta à largura (sem quebrar texto, sem rolagem lateral) ---- */
.chat-panel { container-type: inline-size; }
.chat-toolbar { min-width: 0; }
.chat-toolbar .ct-btn { white-space: nowrap; flex-shrink: 0; }
.chat-toolbar .ct-keep { flex-shrink: 1; min-width: 0; }
.chat-toolbar .ct-keep span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.chat-header-right { min-width: 0; flex-shrink: 1; }
.chat-messages { overflow-x: hidden; }
.bubble { max-width: min(440px, 85%); overflow-wrap: anywhere; }
.bubble img, .bubble video { max-width: 100% !important; }
.wa-audio { min-width: 0; width: 240px; max-width: 100%; }
@container (max-width: 720px) {
  .chat-toolbar { padding: 0 16px !important; gap: 6px !important; }
  .chat-toolbar .ct-btn:not(.ct-keep) .ct-label { display: none; }
  .chat-toolbar .ct-btn:not(.ct-keep) { padding: 7px 9px !important; }
  .chat-header { padding: 0 16px; gap: 10px; }
  .chat-messages { padding: 20px 16px; }
  .chat-input { padding: 0 14px; gap: 8px; }
}
@container (max-width: 520px) {
  .chat-header-right > .badge { display: none; }
  .chat-toolbar .ct-keep span { max-width: 130px; }
}

/* ---- aviso de WhatsApp em telas menores: não cobre mais o título ---- */
@media (min-width: 701px) and (max-width: 1100px) {
  #wa-alert { top: auto; bottom: 96px; left: 88px; transform: none; }
}

/* botão voltar: só aparece no celular */
.mobile-back { display: none; }

/* =================== CELULAR (até 700px) =================== */
@media (max-width: 700px) {
  #wa-alert { display: none !important; } /* o ponto vermelho no ícone do WhatsApp já avisa */
  .sidebar { width: 60px; padding: 16px 0; }
  .nav-btn { width: 44px; height: 44px; }
  .logo-placeholder { width: 36px; height: 36px; margin: 0 0 18px 0; font-size: 13px; }

  .view-header { padding: 0 16px; height: 68px; }
  .view-header h1 { font-size: 22px; }
  #dashboard-content { padding: 14px !important; }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-card { padding: 14px; }

  /* Conversas e Clientes: lista e detalhe em telas separadas */
  #view-inbox .conv-list, #view-clientes .conv-list { width: 100%; border-right: none; }
  .conv-list-header { padding: 18px 14px 12px; }
  #view-inbox:not(.detail-open) #chat-panel,
  #view-clientes:not(.detail-open) #cliente-profile { display: none; }
  #view-inbox.detail-open .conv-list,
  #view-clientes.detail-open .conv-list { display: none; }
  #view-inbox #conv-side-panel { display: none !important; }
  .mobile-back { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; margin-left: -6px; border: none; border-radius: 9px; background: transparent; color: var(--text); }
  .chat-header { height: 68px; padding: 0 10px; }
  .cli-head { padding: 14px; }

  /* Funil: cabeçalho e métricas compactos */
  #view-kanban > div:first-child { padding: 16px !important; }
  #view-kanban > div:first-child > div:first-child { flex-wrap: wrap; gap: 10px; }
  .metrics-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { min-width: 0; padding: 10px 12px; }
  .metric-card .num { font-size: 18px !important; }
  .kanban-col { width: 240px; }

  .cfg-nav { padding: 12px 16px; }
  .cfg-content, .admin-detail { padding: 18px 16px; }
}

/* =================== CORES: TEMA CLARO =================== */
[data-theme="light"] {
  --accent: #2459C9;        /* texto/links azuis: 5,7:1 no cartão */
  --muted: #58647A;         /* texto secundário: 4,5:1 até sobre as colunas do funil */
  --ok: #157A45;
  --warn: #8A6100;
  --danger: #C42B30;
}
[data-theme="light"] .badge.origem-pend { background: #FFF1CC; color: #7A5200; border-color: #E0B44C; }
[data-theme="light"] .logo-placeholder:not(.has-logo) { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }

/* =================== CORES: TEMA ESCURO =================== */
[data-theme="dark"] {
  --accent: #5B95FF;        /* texto/links azuis: 6:1 no cartão escuro */
  --text-secondary: #A3B3BB;
  --muted: #8193A0;         /* 5:1 no cartão escuro */
}
[data-theme="dark"] .logo-placeholder:not(.has-logo) { background: #12294F; color: #8DB6FF; }

/* ---- ajustes finos do chat em telas bem estreitas (conferido no Playwright) ---- */
.chat-input input { min-width: 0; }
.dash-tabs { scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
@container (max-width: 480px) {
  .chat-header > div[style*="flex-grow"] { min-width: 0; }
  #chat-contact-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #chat-tag-label { display: none; }
  #chat-budget-btn span { display: none; }
  .chat-toolbar .ct-keep span { max-width: 80px; }
  .chat-input button { width: 40px; height: 40px; }
}
/* velocidade do áudio: vence a regra antiga mais específica; fundo escuro no balão azul (contraste do "1x") */
.chat-messages .wa-speed { font-size: 12px; min-height: 24px; padding: 3px 10px; }
.wa-audio:not(.in) .wa-speed { background: rgba(0, 0, 0, 0.28); color: #fff; }
/* =====================================================================
   TELAS REPAGINADAS (20/11/2026): Configurações, WhatsApp, Follow-ups
   Layout sem prefixo de tema; usa só variáveis de cor (valem nos 2 temas).
   ===================================================================== */

/* ---------- peças comuns ---------- */
.inp { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--border-strong); background: var(--input-bg); color: var(--text); font: inherit; font-size: 14px; min-width: 0; }
textarea.inp { resize: vertical; line-height: 1.5; }
.btn-primary, .btn-ghost, .btn-danger-outline, .btn-dashed { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; white-space: nowrap; }
.btn-primary:hover:not(:disabled) { background: var(--accent-solid-hover); }
.btn-primary:disabled, .btn-ghost:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-danger-text { color: var(--danger) !important; }
.btn-danger-text:hover:not(:disabled) { border-color: var(--danger) !important; }
.btn-danger-outline { padding: 10px 16px; border-radius: 9px; border: 1.5px solid var(--danger); background: transparent; color: var(--danger); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.btn-danger-outline:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-dashed { margin-top: 10px; padding: 9px 14px; border-radius: 10px; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--accent); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.btn-dashed:hover { border-color: var(--accent); background: var(--accent-tint); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; flex-shrink: 0; padding: 0; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.t-ok { color: var(--ok); }
.t-accent { color: var(--accent); }

/* ---------- Configurações: estrutura ---------- */
#view-config.active { overflow: hidden; }
.cfg-body { flex: 1; min-height: 0; display: flex; }
.cfg-nav { flex-direction: column; flex-wrap: nowrap; gap: 4px; width: 250px; flex-shrink: 0; padding: 20px 14px; border-bottom: none; border-right: 1px solid var(--border); background: transparent; overflow-y: auto; }
.cfg-nav .cfg-tab { justify-content: flex-start; gap: 12px; padding: 10px 12px; border: none; border-radius: 12px; background: transparent; text-align: left; color: var(--text-secondary); }
.cfg-nav .cfg-tab:hover { transform: none; background: var(--surface-2); color: var(--text); }
.cfg-nav .cfg-tab.active { background: var(--accent-tint); color: var(--accent); }
.cfg-nav .cfg-tab svg { flex-shrink: 0; }
.cfg-tab-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.cfg-tab-text b { font-size: 14px; font-weight: 600; }
.cfg-tab-text small { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.cfg-nav .cfg-tab.active .cfg-tab-text small { color: var(--accent); opacity: .8; }
.cfg-content { flex: 1; min-width: 0; max-width: none; padding: 28px 36px 60px; overflow-y: auto; }
.cfg-page { max-width: 860px; display: flex; flex-direction: column; gap: 18px; }
.cfg-page-head h2 { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.cfg-page-head p { margin: 4px 0 0; font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

.cfg-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cfg-card-head { padding: 18px 22px 0; }
.cfg-card-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cfg-card-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.cfg-card-body { padding: 16px 22px 20px; }
.cfg-card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px 22px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cfg-count { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); }

.cfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.cfg-span2 { grid-column: 1 / -1; }
.cfg-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cfg-label { font-size: 13px; font-weight: 600; color: var(--text); }
.cfg-help { font-size: 12px; color: var(--muted); line-height: 1.45; }
.cfg-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.cfg-note.warn { background: var(--warn-tint); color: var(--warn); }
.cfg-note .ico { margin-top: 2px; }
.cfg-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px; color: var(--muted); text-align: center; font-size: 14px; }
.cfg-empty p { margin: 0; }

/* aviso "Salvo" / erro ao lado do botão */
.cfg-flash { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .2s; color: var(--text-secondary); }
.cfg-flash.show { opacity: 1; }
.cfg-flash.ok { color: var(--ok); }
.cfg-flash.err { color: var(--danger); }
.cfg-card-foot .cfg-flash { margin-right: auto; }

/* números de resumo (Equipe, Meta, Follow-ups) */
.cfg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.cfg-stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; }
.cfg-stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.cfg-stat span { font-size: 13px; color: var(--text-secondary); }
.cfg-stat.is-late { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.cfg-stat.is-late b { color: var(--danger); }

/* bolinha de cor clicável (input color escondido dentro) */
.swatch { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--c); flex-shrink: 0; cursor: pointer; box-shadow: inset 0 0 0 2px color-mix(in srgb, #000 12%, transparent); }
.swatch.small { width: 28px; height: 28px; }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: none; padding: 0; }
.swatch:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Empresa ---------- */
.logo-up { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.logo-up-preview { width: 96px; height: 96px; border-radius: 22px; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent); font-family: var(--font-display); font-size: 30px; font-weight: 600; border: 1px solid var(--border); }
.logo-up-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-up-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }

/* ---------- Equipe ---------- */
.team-list { display: flex; flex-direction: column; }
.team-row { border-bottom: 1px solid var(--border); padding: 12px 0; }
.team-row:last-child { border-bottom: none; }
.team-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.team-row .avatar { width: 40px; height: 40px; font-size: 13px; }
.team-main { flex: 1; min-width: 160px; }
.team-name { display: flex; align-items: center; gap: 8px; }
.team-name strong { font-size: 14.5px; }
.team-email { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.team-row.is-off .team-main, .team-row.is-off .avatar { opacity: .55; }
.role-pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); white-space: nowrap; }
.role-pill.role-admin, .role-pill.role-superadmin { background: var(--accent-tint); color: var(--accent); }
.state-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); min-width: 84px; }
.state-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.state-label.on::before { background: var(--ok); }
.team-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.team-actions .fu-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; font-size: 13px; }
.user-edit { margin-top: 14px; padding: 16px; border-radius: 12px; background: var(--surface-2); }

/* ---------- Funil / Kanban ---------- */
.stg-preview { display: flex; gap: 0; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.stg-prev-seg { flex: 1 0 104px; min-width: 104px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 18px 0 22px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: var(--text); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); margin-right: -6px; border-top: 3px solid var(--c); }
.stg-prev-seg:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; border-radius: 8px 0 0 8px; }
.stg-prev-seg span { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.tp-item { flex: 1 1 170px; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.tp-item b { display: block; font-size: 13px; }
.tp-item small { font-size: 12px; color: var(--text-secondary); }
.tp-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.tp-dot.tp-and { background: var(--accent); }
.tp-dot.tp-win { background: var(--ok); }
.tp-dot.tp-lost { background: var(--danger); }
.stg-list { display: flex; flex-direction: column; gap: 8px; }
.stg-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.stg-item:hover { border-color: var(--border-strong); }
.stg-pos { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--text-secondary); flex-shrink: 0; }
.stg-item .stg-move { display: flex; flex-direction: row; gap: 4px; }
.stg-item .stg-move .icon-btn { width: 30px; height: 30px; }
.stg-item .stg-name { flex: 1 1 180px; width: auto; }
.stg-item .stg-tipo { flex: 0 0 190px; width: 190px; font-weight: 600; }
.stg-tipo.tp-win { color: var(--ok); }
.stg-tipo.tp-lost { color: var(--danger); }
.stg-flash { min-width: 62px; }
.stg-new { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stg-new #stg-new-name { flex: 1 1 200px; width: auto; }
.stg-new select { flex: 0 0 190px; width: 190px; }

/* ---------- Etiquetas ---------- */
.tag-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tag-x { width: 24px; height: 24px; border-radius: 50%; border: none; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: .7; padding: 0; }
.tag-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 15%, transparent); }
.tag-lock { display: inline-flex; opacity: .6; padding-right: 4px; }
.tag-new { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto; gap: 16px; align-items: start; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 42px; }
.pal { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--c); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 2px color-mix(in srgb, #000 12%, transparent); }
.pal.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
#tag-preview { min-height: 42px; display: flex; align-items: center; }

/* ---------- Respostas rápidas ---------- */
.qr-item { border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: var(--surface); }
.qr-item:last-child { margin-bottom: 0; }
.qr-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.qr-head .qr-title { flex: 1; font-weight: 700; }
.qr-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qr-foot .qr-count { margin-right: auto; font-variant-numeric: tabular-nums; }
.qr-foot .btn-ghost, .qr-foot .btn-primary { min-height: 34px; padding: 6px 14px; }
.qr-new { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }
.qr-new-fields { display: flex; flex-direction: column; gap: 14px; }
.qr-preview { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--bg); background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.2px); background-size: 18px 18px; }
.qr-bubble { align-self: flex-end; max-width: 92%; padding: 10px 14px; border-radius: 16px 4px 16px 16px; background: var(--accent-solid); color: #fff; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Meta Ads ---------- */
#meta-form { display: flex; flex-direction: column; gap: 18px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.toggle-row b { display: block; font-size: 14px; }
.toggle-row small { display: block; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.meta-rules { display: flex; flex-direction: column; gap: 8px; }
.meta-rule { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.meta-rule .mr-stage { flex: 1 1 160px; width: auto; }
.meta-rule .mr-event { flex: 1.4 1 200px; width: auto; }
.mr-arrow { color: var(--muted); font-weight: 700; }
.mr-val { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.ev-list { display: flex; flex-direction: column; }
.ev-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ev-row:last-child { border-bottom: none; }
.ev-main { flex: 1; min-width: 0; }
.ev-msg { color: var(--text-secondary); overflow-wrap: anywhere; }
.ev-when { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.ev-pill { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; min-width: 72px; text-align: center; }
.ev-pill.ok { background: var(--ok-tint); color: var(--ok); }
.ev-pill.info { background: var(--accent-tint); color: var(--accent); }
.ev-pill.err { background: var(--danger-tint); color: var(--danger); }
.ev-pill.muted { background: var(--surface-2); color: var(--text-secondary); }

/* ---------- WhatsApp ---------- */
.wa-box { max-width: none; padding: 8px 32px 40px; flex: 1; min-height: 0; overflow-y: auto; }
.wa-page { max-width: 1000px; display: flex; flex-direction: column; gap: 18px; }
.wa-hero { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.wa-hero-head { display: flex; align-items: center; gap: 16px; padding: 22px 24px; flex-wrap: wrap; }
.wa-hero-ico { width: 54px; height: 54px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wa-hero-ico.off { background: var(--warn-tint); color: var(--warn); }
.wa-hero-ico.on { background: var(--ok-tint); color: var(--ok); }
.wa-hero-text { flex: 1; min-width: 220px; }
.wa-hero-text h2 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.wa-hero-text p { margin: 4px 0 0; font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.state-pill.ok { background: var(--ok-tint); color: var(--ok); }
.state-pill.warn { background: var(--warn-tint); color: var(--warn); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: liveDot 1.6s ease-in-out infinite; }
@keyframes liveDot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.wa-connect { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 6px 24px 24px; }
.wa-stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wa-stepper li { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; position: relative; }
.wa-stepper li:not(:last-child)::after { content: ''; position: absolute; left: 15px; top: 44px; bottom: -6px; width: 2px; background: var(--border); }
.wa-stepper .n { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--accent-tint); color: var(--accent); font-weight: 700; font-size: 14px; }
.wa-stepper b { display: block; font-size: 14.5px; }
.wa-stepper small { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.wa-qr-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: 18px; background: var(--surface-2); text-align: center; }
.wa-qr-card .wa-qr-slot { width: 248px; height: 248px; border: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.wa-qr-card .wa-qr-slot img, .wa-box .wa-qr-slot img { width: 100%; height: 100%; border: none; border-radius: 6px; }
.wa-qr-card .cfg-help { max-width: 240px; }
.wa-hero-foot { display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 55%, transparent); font-size: 13px; color: var(--text-secondary); }
.wa-sync { padding: 4px 24px 22px; }
.wa-sync-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.wa-sync-head b { font-size: 14px; }
.wa-sync-head span { font-size: 13px; color: var(--text-secondary); }
.wa-bars { display: flex; gap: 6px; align-items: flex-end; height: 120px; padding: 10px 12px 0; border-radius: 12px; background: var(--surface-2); }
.wa-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.wa-bar i { display: block; width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; background: var(--accent); }
.wa-bar.empty i { background: var(--border-strong); }
.wa-bar span { font-size: 11.5px; color: var(--muted); padding-bottom: 6px; font-variant-numeric: tabular-nums; }
.wa-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.wa-action { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--border); }
.wa-action h3 { margin: 4px 0 0; font-size: 15px; }
.wa-action p { margin: 0 0 6px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.wa-action-ico { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent); }
.wa-diag { height: 220px; font-family: var(--font-mono); font-size: 12px; }
.danger-zone { display: flex; align-items: center; gap: 18px; justify-content: space-between; flex-wrap: wrap; padding: 18px 22px; border-radius: var(--radius-lg); border: 1.5px solid color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 5%, var(--card)); }
.dz-text { flex: 1; min-width: 240px; }
.dz-text h3 { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 15px; color: var(--danger); }
.dz-text p { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ---------- Follow-ups ---------- */
.fu-hint { padding: 4px 28px 0; display: flex; flex-direction: column; gap: 14px; }
.fu-timeline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius-md); background: var(--card); border: 1px solid var(--border); }
.fu-tl-step { display: flex; align-items: center; gap: 10px; }
.fu-tl-step b { display: block; font-size: 13px; color: var(--text); }
.fu-tl-step small { display: block; font-size: 12px; color: var(--text-secondary); }
.fu-tl-dot { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.fu-tl-line { flex: 1 1 24px; min-width: 16px; height: 2px; background: var(--border-strong); }
.fu-stats .cfg-stat { padding: 10px 14px; }
.fu-stats .cfg-stat b { font-size: 20px; }
.fu-col-sub { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.fu-card { display: flex; flex-direction: column; gap: 10px; }
.fu-card.late { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.fu-card-top { display: flex; gap: 10px; align-items: center; }
.fu-card-who { min-width: 0; }
.fu-card-who .badge { margin-top: 4px; }
.fu-progress { display: flex; align-items: center; gap: 5px; }
.fu-pip { width: 22px; height: 5px; border-radius: 3px; background: var(--border-strong); }
.fu-pip.done { background: var(--ok); }
.fu-pip.now { background: var(--accent); }
.fu-progress small { margin-left: 6px; font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.fu-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--text-secondary); }
.fu-chip.late { background: var(--danger-tint); color: var(--danger); }
.fu-chip.soon { background: var(--warn-tint); color: var(--warn); }
.fu-chip.ok { background: var(--ok-tint); color: var(--ok); }
.fu-done { width: 100%; min-height: 38px; padding: 8px 12px; font-size: 13px; }
.fu-links { display: flex; gap: 4px; flex-wrap: wrap; }
.fu-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 8px; border: none; border-radius: 8px; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; }
.fu-link:hover { background: var(--accent-tint); }
.fu-link.muted { color: var(--text-secondary); }
.fu-link.muted:hover { background: var(--surface-2); color: var(--danger); }
#followup-modes .fu-mode, #followup-tabs .fu-tab { min-height: 38px; }
#followup-tabs .fu-tab { padding: 8px 16px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); color: var(--text-secondary); font-weight: 700; font-size: 13.5px; }
#followup-tabs .fu-tab.active { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
#followups-list { padding: 18px 28px 40px !important; }
.rem-list { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.rem-item { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--card); border: 1px solid var(--border); flex-wrap: wrap; }
.rem-item.late { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.rem-date { width: 52px; height: 56px; border-radius: 12px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent); }
.rem-item.late .rem-date { background: var(--danger-tint); color: var(--danger); }
.rem-date b { font-size: 20px; line-height: 1; }
.rem-date span { font-size: 12px; font-weight: 700; text-transform: uppercase; margin-top: 3px; }
.rem-main { flex: 1; min-width: 200px; }
.rem-title { font-weight: 700; font-size: 14.5px; }
.rem-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.rem-late { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); font-weight: 700; margin-left: 4px; }
.rem-actions { display: flex; gap: 8px; }
.rem-actions .btn-primary, .rem-actions .btn-ghost { min-height: 36px; padding: 7px 14px; font-size: 13px; }
.rem-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 520px; margin: 30px auto; padding: 30px; text-align: center; color: var(--muted); border: 1.5px dashed var(--border); border-radius: var(--radius-lg); }
.rem-empty b { color: var(--text); font-size: 15px; }
.rem-empty span { font-size: 13px; }

/* ---------- Funil: botão de WhatsApp do card maior e mais fácil de clicar ---------- */
.kanban-wa-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border-radius: 10px; border: none; background: var(--ok-tint); color: var(--ok); font-size: 12.5px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.kanban-wa-btn:hover { background: color-mix(in srgb, var(--ok) 22%, transparent); }

/* ---------- telas menores ---------- */
@media (max-width: 900px) {
  .cfg-body { flex-direction: column; }
  .cfg-nav { flex-direction: row; width: auto; padding: 10px 16px; border-right: none; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .cfg-nav .cfg-tab { flex-shrink: 0; padding: 8px 12px; }
  .cfg-tab-text small { display: none; }
  .cfg-content { padding: 18px 16px 40px; }
  .wa-connect { grid-template-columns: 1fr; }
  .wa-qr-card { justify-self: center; }
  .tag-new, .qr-new { grid-template-columns: 1fr; }
  .fu-tl-line { display: none; }
}
@media (max-width: 700px) {
  .cfg-grid { grid-template-columns: 1fr; }
  .cfg-card-head { padding: 16px 16px 0; }
  .cfg-card-body { padding: 14px 16px 16px; }
  .cfg-card-foot { padding: 12px 16px; }
  .stg-item .stg-tipo, .stg-new select { flex: 1 1 100%; width: 100%; }
  .team-actions { margin-left: 52px; }
  .wa-box { padding: 8px 14px 30px; }
  .wa-hero-head, .wa-connect, .wa-sync { padding-left: 16px; padding-right: 16px; }
  .wa-qr-card .wa-qr-slot { width: 220px; height: 220px; }
  .fu-hint { padding: 4px 14px 0; }
  #followups-list { padding: 14px !important; }
  .rem-actions { width: 100%; }
  .rem-actions > * { flex: 1; }
}

/* ajustes após conferência no navegador */
.cfg-field .inp { flex: 0 0 auto; }
.fu-done { white-space: normal; }
.stg-preview { flex-wrap: wrap; row-gap: 6px; overflow: visible; padding-bottom: 0; }
.stg-prev-seg { flex: 1 1 auto; min-width: 0; }@media (max-width: 700px) { .cfg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* =====================================================================
   SIMPLIFICAÇÃO PARA QUEM NÃO É DO RAMO (20/11/2026)
   Menos números de uma vez, nomes no lugar de ícones, avançado escondido.
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* "Ver mais" (o que é avançado fica fechado) */
details.adv, details.dash-more { border-radius: var(--radius-lg); }
details.adv > summary, details.dash-more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 8px 4px; font-size: 14px; font-weight: 600; color: var(--text-secondary); user-select: none; }
details.adv > summary::-webkit-details-marker, details.dash-more > summary::-webkit-details-marker { display: none; }
details.adv > summary::before, details.dash-more > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details[open].adv > summary::before, details[open].dash-more > summary::before { transform: rotate(45deg); }
details.adv > summary:hover, details.dash-more > summary:hover { color: var(--accent); }
.adv-body { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
details.dash-more { margin: 4px 0 6px; }
details.dash-more .dash-grid { margin-top: 8px; }

/* Início */
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.dash-top .dash-tabs { border-bottom: none; margin-bottom: 0; }
.dash-top .dash-filters { margin-bottom: 0; }
.dash-period { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.dash-period select { width: auto; min-height: 38px; padding: 7px 12px; font-weight: 600; }
.dash-custom .inp { width: auto; padding: 7px 10px; }
.dash-custom .btn-primary { min-height: 36px; padding: 6px 14px; }
.dash-main { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.dash-big { padding: 18px 20px; }
.dash-big .label { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }
.dash-big .num { font-size: 34px; }
.dash-big .metric-sub { margin-top: 4px; font-size: 13px; }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; margin-top: 8px; }

/* Chat: abas do painel lateral com nome (antes eram só ícones) */
.side-panel-icons { gap: 6px; padding: 0 12px; }
.side-panel-icon-btn { width: auto; flex: 1; gap: 6px; padding: 0 8px; font-size: 12.5px; font-weight: 700; }
.side-panel-icon-btn span { white-space: nowrap; }

/* Retornos */
.fu-explain { margin: 0; font-size: 14px; color: var(--text-secondary); }
.fu-links { display: flex; gap: 6px; align-items: center; }
.fu-links .fu-done { flex: 1; width: auto; min-height: 34px; padding: 6px 10px; }
.fu-links .icon-btn { width: 34px; height: 34px; }

/* WhatsApp: ação principal numa linha */
.wa-action-row { flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
.wa-action-text { flex: 1; min-width: 220px; }
.wa-action-text p { margin: 2px 0 0; }

@media (max-width: 700px) {
  .dash-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-big { padding: 14px; }
  .dash-big .num { font-size: 26px; }
  .dash-top { flex-direction: column; align-items: stretch; }
}.fu-card { position: relative; }
.fu-card .fu-card-top { padding-right: 30px; }
.fu-remove { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.fu-remove:hover { background: var(--surface-2); color: var(--danger); }
/* ===== NÃO LIDAS (23/11/2026): número de mensagens sem ler, como no WhatsApp ===== */
.unread-count {
  position: absolute;
  right: 12px;
  bottom: 14px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent-solid);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.conv-item.has-unread .conv-item-body { padding-right: 28px; }
.conv-item.has-unread .conv-preview { color: var(--text); font-weight: 600; }
.conv-item.has-unread .conv-time:not(.t-alert):not(.t-warn) { color: var(--accent); font-weight: 600; }

/* ===== FOLLOW-UP COM IA (24/11/2026) ===== */
.fu-ia { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--accent-tint); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.fu-ia-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.fu-ia-text { width: 100%; min-height: 72px; resize: vertical; font-size: 13.5px; line-height: 1.45; background: var(--card); cursor: text; }
.fu-ia-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fu-ia-actions button { padding: 6px 10px; font-size: 12.5px; min-height: 32px; display: inline-flex; align-items: center; gap: 5px; }
.fu-ia-empty { background: transparent; border-style: dashed; border-color: var(--border); padding: 8px; }
.fu-ia-obs { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; display: flex; gap: 6px; align-items: flex-start; }
.fu-ia-obs .ico { flex: 0 0 auto; margin-top: 2px; }
.fu-ia-write { align-self: flex-start; padding: 6px 10px; font-size: 12.5px; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.fu-ia .cfg-flash:empty { display: none; }

.ia-modos { display: grid; gap: 8px; }
.ia-modo { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; }
.ia-modo input { margin-top: 3px; accent-color: var(--accent-solid); }
.ia-modo b { display: block; font-size: 14px; }
.ia-modo small { display: block; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.45; }
.ia-modo.active { border-color: var(--accent); background: var(--accent-tint); }
.ia-alert { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--warn); font-weight: 600; }
.ia-ex-list { display: flex; flex-direction: column; gap: 10px; }
.ia-ex { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ia-ex-top { display: flex; align-items: center; gap: 8px; }
.ia-ex-top .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.ia-ex-tag { font-size: 12px; color: var(--muted); }
.ia-ex p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
/* Teste da IA (superadmin) */
.ia-t-out { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.ia-t-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.ia-t-bubble { align-self: flex-start; max-width: 520px; padding: 9px 12px; border-radius: 10px 10px 10px 2px; background: color-mix(in srgb, var(--ok) 16%, var(--card)); font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.ia-t-why { margin: 0; font-size: 13px; line-height: 1.5; }
.ia-t-out .cfg-help { margin: 0; }
.ia-pb { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--accent-tint); font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.ia-pb > b { display: flex; align-items: center; gap: 6px; color: var(--accent); margin-bottom: 4px; }
.ia-pb ul { margin: 6px 0; padding-left: 18px; }
.ia-pb li { margin: 3px 0; }
.badge.fu-teste { background: var(--warn-tint); color: var(--warn); margin-right: 4px; }
.ia-testes-lista { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; line-height: 1.6; }
/* "Respire um pouco" (pausa de envio rápido) */
.fu-pausa-ov { position: fixed; inset: 0; z-index: 1000; background: rgba(8, 14, 28, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.fu-pausa-box { position: relative; width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 26px 24px 20px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.fu-pausa-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: none; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fu-pausa-x:hover { background: var(--surface-2); color: var(--text); }
.fu-pausa-ico { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--warn-tint); color: var(--warn); }
.fu-pausa-box.longa .fu-pausa-ico { background: var(--danger-tint); color: var(--danger); }
.fu-pausa-box h3 { margin: 0 0 6px; font-size: 18px; }
.fu-pausa-box p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.fu-pausa-num { margin: 16px 0 10px; display: flex; flex-direction: column; align-items: center; }
.fu-pausa-num b { font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--warn); }
.fu-pausa-box.longa .fu-pausa-num b { color: var(--danger); }
.fu-pausa-num small { font-size: 12px; color: var(--muted); margin-top: 4px; }
.fu-pausa-box .fu-pausa-obs { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.fu-pausa-ok { width: 100%; }
/* Configurações: alteração não salva */
.cfg-card.cfg-sujo { border-color: color-mix(in srgb, var(--warn) 70%, var(--border)); box-shadow: 0 0 0 3px var(--warn-tint); }
.cfg-sujo-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--warn-tint); color: var(--warn); font-size: 12px; font-weight: 700; white-space: nowrap; }
.cfg-sair-btns { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.cfg-sair-btns button { flex: 1; min-width: 140px; }
/* Follow-up com IA: conta sem o plano Premium */
.ia-premium { text-align: center; padding: 18px 10px 8px; max-width: 520px; margin: 0 auto; }
.ia-premium-ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent); }
.ia-premium h3 { margin: 0 0 8px; font-size: 18px; }
.ia-premium p { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--text-secondary); }

/* Lembrete do Premium (plano Base) */
.upsell-mini { position: relative; margin-top: 10px; padding: 12px 34px 12px 14px; border-radius: 10px; background: var(--accent-tint); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.45; }
.upsell-mini b { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13.5px; }
.upsell-mini span { color: var(--text-secondary); }
.upsell-mini .upsell-go { align-self: flex-start; margin-top: 6px; padding: 7px 12px; font-size: 12.5px; }
.upsell-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: none; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.upsell-x:hover { background: var(--surface-2); color: var(--text); }
.fu-upsell { position: relative; flex: 0 0 240px; align-self: flex-start; margin-left: 4px; padding: 22px 18px 18px; border-radius: var(--radius-lg, 14px); border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent-tint) 60%, var(--card)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fu-upsell-ico { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent); }
.fu-upsell b { font-size: 15px; line-height: 1.35; }
.fu-upsell p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.fu-upsell .upsell-go { width: 100%; margin-top: 6px; }
@media (max-width: 900px) { .fu-upsell { flex-basis: auto; width: 100%; margin: 0; } }

/* Aviso do Premium na chave "Em follow-up": mesmo visual do banner do Premium (azul-marinho em degradê) */
.upsell-mini {
  position: relative; margin-top: 12px; padding: 16px 16px 16px; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; gap: 6px; color: #fff; text-align: left;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent-solid) 55%, transparent) 0%, transparent 60%), linear-gradient(135deg, #10192E 0%, #1B2850 100%);
  box-shadow: 0 10px 26px rgba(16, 25, 46, .28);
  animation: upsellEntra .35s ease-out both;
}
.upsell-mini::after {
  content: ""; position: absolute; right: -40px; bottom: -50px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 187, 255, .22) 0%, transparent 70%); pointer-events: none;
}
.upsell-mini-top { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; padding-right: 24px; }
.upsell-mini-ico {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.upsell-mini-tag { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #9DBBFF; }
.upsell-mini .upsell-mini-t { display: block; font-family: "Poppins", sans-serif; font-size: 15px; line-height: 1.35; color: #fff; }
.upsell-mini .upsell-mini-d { font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .78); }
.upsell-mini .upsell-go {
  position: relative; z-index: 1; align-self: stretch; margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 14px; border: none; border-radius: 10px; background: #fff; color: #10192E; font-weight: 700; font-size: 13.5px; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.upsell-mini .upsell-go:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.upsell-mini .upsell-go:focus-visible { outline: 2px solid #9DBBFF; outline-offset: 2px; }
.upsell-mini .upsell-x { top: 10px; right: 10px; color: rgba(255, 255, 255, .7); z-index: 1; }
.upsell-mini .upsell-x:hover { background: rgba(255, 255, 255, .12); color: #fff; }
@keyframes upsellEntra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .upsell-mini { animation: none; } .upsell-mini .upsell-go { transition: none; } }
.upsell-mini .upsell-mini-tag { color: #9DBBFF; white-space: nowrap; letter-spacing: .04em; }
.upsell-mini .upsell-mini-ico { color: #fff; }
.upsell-mini .upsell-mini-top { padding-right: 30px; }

/* "Ver mensagens anteriores" no topo da conversa (26/11/2026) */
.older-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px auto 14px; max-width: 420px; text-align: center; }
.older-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.older-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.older-btn:disabled { cursor: default; opacity: .75; }
.older-btn .ico { vertical-align: -2px; }
.older-msg { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* =================== CONVERSAS: abas, filtros em lista, seleção (26/11/2026) =================== */
/* 3 pontinhos */
.inbox-more-wrap { position: relative; }
.inbox-more-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 9px; border: none; background: none; color: var(--text-secondary); cursor: pointer; }
.inbox-more-btn:hover { background: var(--surface-2); }
.inbox-more-menu { position: absolute; top: 38px; right: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 20; }
.inbox-more-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; min-height: 40px; border: none; border-radius: 8px; background: none; color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.inbox-more-menu button:hover { background: var(--accent-tint); color: var(--accent); }

/* abas Atendendo / Arquivados */
.inbox-tabs { display: flex; gap: 4px; margin-top: 12px; border-bottom: 1px solid var(--border); }
.inbox-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 6px; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.inbox-tab:hover { color: var(--text); }
.inbox-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.inbox-tab.active .seg-count { background: var(--accent-solid); color: #fff; }

/* filtros lado a lado: situação + etapa */
.inbox-filters { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.status-dd { position: relative; }
.dd-trigger { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--text); box-shadow: var(--shadow-sm); cursor: pointer; }
.dd-menu { position: absolute; top: 46px; left: 0; width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 15; }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 38px; padding: 8px 10px; border: none; border-radius: 9px; background: transparent; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.dd-opt:hover { background: var(--surface-2); }
.dd-opt.active { font-weight: 700; color: var(--accent); background: var(--accent-tint); }
#stage-filter-trigger { min-height: 38px; padding: 8px 14px !important; }

/* barra do modo seleção */
.inbox-select-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 6px 6px 4px; border-radius: 12px; background: var(--accent-tint); }
.inbox-select-bar[hidden] { display: none; }
.sel-x { width: 34px; height: 34px; flex-shrink: 0; border: none; border-radius: 9px; background: none; color: var(--text-secondary); font-size: 20px; line-height: 1; cursor: pointer; }
.sel-x:hover { background: var(--surface); }
.sel-n { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-btn { min-height: 34px; padding: 6px 11px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sel-btn.sel-go { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.sel-btn:disabled { opacity: .5; cursor: default; }

/* conversa no modo seleção */
.conv-item { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.conv-check { width: 22px; height: 22px; flex-shrink: 0; align-self: center; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--border-strong); color: #fff; }
.conv-item.checked { background: var(--accent-tint); }
.conv-item.checked .conv-check { background: var(--accent-solid); border-color: var(--accent-solid); }

/* menu lateral só com ícones na tela de Conversas; os nomes voltam ao passar o mouse (por cima, sem empurrar a tela) */
@media (min-width: 1101px) {
  .app.nav-compact .sidebar { width: 76px; position: relative; z-index: 40; overflow: hidden; transition: width .18s ease, margin-right .18s ease, box-shadow .18s ease; }
  .app.nav-compact .sidebar:hover, .app.nav-compact .sidebar:has(:focus-visible) { width: 224px; margin-right: -148px; box-shadow: 10px 0 28px rgba(0, 0, 0, .22); }
  .app.nav-compact .sidebar:not(:hover):not(:has(:focus-visible)) .nav-label { display: none; }
  .app.nav-compact .sidebar:not(:hover):not(:has(:focus-visible)) .nav-btn { width: 48px; justify-content: center; padding: 0; }
  .app.nav-compact .sidebar:not(:hover):not(:has(:focus-visible)) .nav-badge { top: 2px; right: 2px; transform: none; }
  .app.nav-compact .sidebar:not(:hover):not(:has(:focus-visible)) .nav-dot { top: 6px; right: 6px; transform: none; }
  .app.nav-compact .sidebar:not(:hover):not(:has(:focus-visible)) .logo-placeholder { margin-left: 4px; }
  .app.nav-compact #wa-alert { display: none !important; } /* o ponto vermelho no ícone do WhatsApp já avisa */
}
@media (prefers-reduced-motion: reduce) { .app.nav-compact .sidebar { transition: none; } }

/* =====================================================================
   INÍCIO REPAGINADO (26/11/2026) — vale nos dois temas (cores pelas variáveis)
   ===================================================================== */
.dk { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.dk-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.dk-hero h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; color: var(--text); }
.dk-hero p { margin: 4px 0 0; font-size: 14px; color: var(--text-secondary); }
.dk-hero .dash-filters { margin: 0; }

/* abas em "pílula" */
.dk-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--text) 5%, transparent); border: 1px solid var(--border); align-self: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dk-tabs::-webkit-scrollbar { display: none; }
.dk-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 16px; border: 0; border-radius: 9px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.dk-tab:hover { color: var(--text); }
.dk-tab.active { background: var(--card); color: var(--accent); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

/* cartões */
.dk-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.dk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.dk-kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.dk-kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--tone); opacity: .07; pointer-events: none; }
.dk-kpi-head { display: flex; align-items: center; gap: 10px; }
.dk-ico { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
.dk-kpi-label { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.dk-kpi-num { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.1; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dk-kpi-foot { min-height: 22px; display: flex; align-items: center; }
.tone-blue { --tone: var(--accent); }
.tone-violet { --tone: var(--violet); }
.tone-green { --tone: var(--ok); }
.tone-amber { --tone: var(--warn); }
.dk-sub { font-size: 13px; color: var(--text-secondary); }
.dk-delta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.dk-delta em { font-style: normal; font-weight: 500; opacity: .85; }
.dk-delta.up { color: var(--ok); background: var(--ok-tint); }
.dk-delta.down { color: var(--danger); background: var(--danger-tint); }
.dk-delta.eq { color: var(--text-secondary); background: color-mix(in srgb, var(--text) 7%, transparent); font-weight: 600; }

/* painéis */
.dk-row { display: grid; gap: 14px; grid-template-columns: 1fr; }
.dk-row-main { grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); }
.dk-row-half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dk-panel { padding: 18px 20px 20px; min-width: 0; }
.dk-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.dk-panel-head h2 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--text); }
.dk-panel-head span { font-size: 13px; color: var(--text-secondary); text-align: right; }
.dk-panel-foot { display: flex; align-items: center; gap: 7px; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.dk-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* gráfico de colunas */
.dk-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -6px 0 14px; font-size: 13px; color: var(--text-secondary); }
.dk-legend span { display: inline-flex; align-items: center; gap: 7px; }
.dk-legend b { color: var(--text); }
.dk-legend i, .dk-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.b-novos { background: var(--accent); }
.b-vendas { background: var(--ok); }
.dk-chart-panel { display: flex; flex-direction: column; }
.dk-chart { display: flex; gap: 8px; height: 210px; flex: 1 1 auto; min-height: 210px; }
.dk-grid { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 22px; font-size: 11.5px; line-height: 1; color: var(--muted); text-align: right; min-width: 18px; font-variant-numeric: tabular-nums; }
.dk-cols { flex: 1; display: flex; align-items: stretch; min-width: 0; position: relative;
  background: linear-gradient(var(--border), var(--border)) 0 0 / 100% 1px no-repeat,
              linear-gradient(var(--border), var(--border)) 0 calc(50% - 11px) / 100% 1px no-repeat,
              linear-gradient(var(--border-strong), var(--border-strong)) 0 calc(100% - 22px) / 100% 1px no-repeat; }
.dk-col { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; outline: none; border-radius: 6px; }
.dk-col:hover, .dk-col:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); }
.dk-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 1px; }
.dk-bars i { width: 100%; max-width: 12px; border-radius: 4px 4px 0 0; transition: height .35s ease; }
.dk-x { height: 22px; line-height: 22px; font-size: 11.5px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; }
.dk-tip { display: none; position: absolute; bottom: calc(100% - 10px); left: 50%; transform: translateX(-50%); z-index: 5; min-width: 170px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md); font-size: 12.5px; color: var(--text-secondary); pointer-events: none; }
.dk-tip b { display: block; margin-bottom: 6px; color: var(--text); text-transform: capitalize; }
.dk-tip span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.dk-col:hover .dk-tip, .dk-col:focus-visible .dk-tip { display: block; }
.dk-col:first-child .dk-tip, .dk-col:nth-child(2) .dk-tip { left: 0; transform: none; }
.dk-col:last-child .dk-tip, .dk-col:nth-last-child(2) .dk-tip { left: auto; right: 0; transform: none; }

/* onde estão os clientes */
.dk-stack { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.dk-stack i { min-width: 4px; }
.dk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dk-list li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.dk-list li:last-child { border-bottom: 0; }
.dk-list .dk-name { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-list b { font-variant-numeric: tabular-nums; color: var(--text); }
.dk-list small { width: 40px; text-align: right; color: var(--text-secondary); font-size: 12.5px; }
.dk-list li.zero .dk-name, .dk-list li.zero b { color: var(--muted); font-weight: 500; }
.dk-list li.zero .dk-dot { opacity: .45; }
/* sem gráfico (Hoje/Ontem) o painel ocupa a largura toda: lista em 2 colunas */
@media (min-width: 761px) {
  .dk-row:not(.dk-row-main) .dk-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .dk-row:not(.dk-row-main) .dk-list li:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}

/* de onde vieram */
.dk-hbar { margin-bottom: 14px; }
.dk-hbar-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 14px; color: var(--text); }
.dk-hbar-top > span { display: inline-flex; align-items: center; gap: 8px; }
.dk-hbar-top small { font-weight: 500; color: var(--text-secondary); margin-left: 4px; }
.dk-track { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 7%, transparent); overflow: hidden; }
.dk-track i { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }

/* resultado das negociações */
.dk-result { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.dk-ring { --p: 0; width: 138px; height: 138px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), color-mix(in srgb, var(--danger) 55%, transparent) 0); }
.dk-ring.off { background: color-mix(in srgb, var(--text) 8%, transparent); }
.dk-ring > div { width: 108px; height: 108px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 10px; }
.dk-ring b { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--text); line-height: 1.1; }
.dk-ring span { font-size: 12px; color: var(--text-secondary); }
.dk-result-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 190px; }
.dk-result-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-secondary); }
.dk-result-list li:last-child { border-bottom: 0; }
.dk-result-list b { color: var(--text); font-variant-numeric: tabular-nums; }
.dk-result-list li.ok b { color: var(--ok); }
.dk-result-list li.bad b { color: var(--danger); }

/* funil em barras horizontais */
.dk-fn { display: flex; flex-direction: column; gap: 10px; }
.dk-fn-row { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr) 150px; align-items: center; gap: 16px; }
.dk-fn-label { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--text); min-width: 0; }
.dk-fn-row.first .dk-fn-label { font-weight: 700; }
.dk-fn-track { position: relative; height: 34px; border-radius: 9px; background: color-mix(in srgb, var(--text) 5%, transparent); overflow: hidden; display: flex; align-items: center; }
.dk-fn-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9px; opacity: .9; transition: width .45s ease; }
.dk-fn-track span { position: relative; margin-left: 10px; font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; background: var(--card); padding: 2px 8px; border-radius: 6px; box-shadow: var(--shadow-sm); }
.dk-fn-side b { display: block; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.dk-fn-side small { font-size: 12px; color: var(--text-secondary); }
.dk-fn-row.zero .dk-fn-label, .dk-fn-row.zero .dk-fn-side b { color: var(--muted); }
/* funil desenhado (Funil, Valores e Anúncios) */
.dk-funnel { display: flex; flex-direction: column; gap: 4px; max-width: 900px; margin: 0 auto; }
.dk-fz-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px; align-items: center; gap: 18px; }
.dk-fz-stage { min-width: 0; }
.dk-fz-seg { height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); box-sizing: border-box; transition: filter .15s; }
.dk-fz-row:hover .dk-fz-seg { filter: brightness(1.08); }
.dk-fz-name { font-size: 13.5px; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-fz-val { font-family: var(--font-display); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.dk-fz-row.zero .dk-fz-seg { opacity: .55; }
[data-theme="light"] .dk-fz-row.zero .dk-fz-seg { opacity: .72; }
.dk-fz-row.zero .dk-fn-side b { color: var(--muted); }
.dk-funnel.vazio .dk-fz-row.zero .dk-fz-seg { opacity: .8; } /* tudo zerado: o funil continua bonito */
.dk-fz-hint { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--accent-tint); color: var(--text-secondary); font-size: 13px; line-height: 1.45; }
.dk-fz-hint .ico { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.dk-lost-wrap { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.dk-lost-wrap h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.dk-lost { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--danger-tint); font-size: 14px; color: var(--text); margin-bottom: 6px; }
.dk-lost.zero { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text-secondary); }
.dk-lost b { margin-left: auto; font-variant-numeric: tabular-nums; }
.dk-lost small { min-width: 86px; text-align: right; color: var(--text-secondary); }

/* vazio */
.dk-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 16px; color: var(--text-secondary); }
.dk-empty-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--accent); background: var(--accent-tint); margin-bottom: 6px; }
.dk-empty strong { color: var(--text); font-size: 15px; }
.dk-empty p { margin: 0; max-width: 380px; font-size: 13.5px; line-height: 1.5; }
.dk > .dk-empty { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); }

@media (max-width: 1100px) {
  .dk-row-main { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .dk-row-half { grid-template-columns: 1fr; }
  .dk-fn-row { grid-template-columns: minmax(0, 1fr) 64px; gap: 6px 12px; }
  .dk-fn-label { grid-column: 1 / -1; }
  .dk-fn-side small { display: none; }
  .dk-fz-row { grid-template-columns: minmax(0, 1fr) 52px; gap: 8px; }
  .dk-fz-seg { height: 52px; }
  .dk-fz-name { font-size: 12px; }
  .dk-fz-val { font-size: 16px; }
}
@media (max-width: 700px) {
  #dashboard-content { padding: 16px !important; }
  .dk { gap: 14px; }
  .dk-hero { flex-direction: column; align-items: stretch; }
  .dk-hero h2 { font-size: 19px; }
  .dk-hero .dash-period { width: 100%; }
  .dk-hero .dash-period select { flex: 1; }
  .dk-tabs { align-self: stretch; }
  .dk-tab { flex: 1; justify-content: center; padding: 8px 6px; font-size: 13px; }
  .dk-tab .ico { display: none; }
  .dk-kpi-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dk-kpi { padding: 14px; gap: 8px; }
  .dk-kpi-num { font-size: 24px; }
  .dk-kpi-label { font-size: 13px; }
  .dk-ico { width: 30px; height: 30px; }
  .dk-delta em { display: none; }
  .dk-panel { padding: 16px; }
  .dk-panel-head { flex-wrap: wrap; gap: 2px 10px; }
  .dk-panel-head span { text-align: left; }
  .dk-chart { height: 180px; min-height: 180px; }
  .dk-ring { width: 118px; height: 118px; }
  .dk-ring > div { width: 92px; height: 92px; }
}
@media (prefers-reduced-motion: reduce) { .dk-bars i, .dk-track i, .dk-fn-track i { transition: none; } }

/* =====================================================================
   BOTÃO RÁPIDO DE ARQUIVAR embaixo da foto (lista de Conversas, 27/11/2026)
   ===================================================================== */
.conv-av-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.conv-arch-btn { width: 30px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.conv-item:hover .conv-arch-btn, .conv-item.selected .conv-arch-btn { color: var(--text-secondary); }
.conv-arch-btn:hover, .conv-arch-btn:focus-visible { color: var(--accent); background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.conv-arch-btn:disabled { opacity: .5; cursor: default; }
.conv-item.saindo { opacity: .45; transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { .conv-arch-btn, .conv-item.saindo { transition: none; } }

/* =====================================================================
   PRÉVIA AO PARAR O MOUSE na conversa ("espiar", 27/11/2026) — só leitura, minimalista
   ===================================================================== */
.conv-previa { position: fixed; z-index: 60; width: 300px; max-height: min(420px, calc(100vh - 16px)); overflow: hidden; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateX(-4px); pointer-events: none; transition: opacity .14s ease, transform .14s ease; visibility: hidden; }
.conv-previa.show { opacity: 1; transform: none; visibility: visible; }
.cp-head { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px 9px; border-bottom: 1px solid var(--border); }
.cp-head b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-head span { font-size: 12px; color: var(--accent); font-weight: 600; }
.cp-ctx { padding: 8px 14px 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-ctx span { font-weight: 600; }
.cp-mais { padding: 6px 14px 0; font-size: 12px; color: var(--muted); }
.cp-list { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 12px; overflow: hidden; }
.cp-msg { align-self: flex-start; max-width: 92%; padding: 7px 10px 5px; border-radius: 4px 12px 12px 12px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.cp-msg.out { align-self: flex-end; border-radius: 12px 4px 12px 12px; background: var(--accent-tint); }
.cp-msg p { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--text); white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cp-msg time { display: block; margin-top: 2px; text-align: right; font-size: 11.5px; color: var(--muted); }
.cp-media { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); }
.cp-foot { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .conv-previa { transition: none; transform: none; } }

/* Configurações: chaves seguidas no mesmo cartão ganham respiro e uma linha entre elas */
#config-content .toggle-row + .toggle-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ===== DATA E HORA DAS MENSAGENS (30/11/2026) ===== */
.msg-hora {
  display: block;
  text-align: right;
  font-size: 12px;
  line-height: 1;
  margin: 6px -6px -5px 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.bubble.out .msg-hora { color: rgba(255, 255, 255, .78); }
.msg-dia {
  align-self: center;
  position: sticky;
  top: -20px;
  z-index: 2;
  margin: 6px 0 2px;
}
.msg-dia span {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, var(--muted));
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ---------- LOGIN COM A LOGO DO CRM ATOS (30/11/2026) ---------- */
.login-screen { padding: 16px; box-sizing: border-box; }
.login-box { width: 100%; max-width: 400px; overflow: hidden; box-sizing: border-box; }
.login-marca {
  margin: -44px -40px 6px;
  padding: 30px 32px 26px;
  background: linear-gradient(135deg, #10192E 0%, #1B2850 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(91, 149, 255, 0.18);
}
.login-marca img { display: block; width: 100%; max-width: 270px; height: auto; }
.login-boasvindas { text-align: center; }
.login-boasvindas h1 {
  font-family: 'Poppins', var(--font, sans-serif);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
}
.login-boasvindas p { margin: 0; font-size: 14px; color: var(--muted); }
@media (max-width: 440px) {
  .login-box { padding: 36px 24px; }
  .login-marca { margin: -36px -24px 4px; padding: 26px 22px 22px; }
}

/* ===== FIGURINHAS (30/11/2026) ===== */
/* figurinha no chat: pequena e sem balão, igual ao WhatsApp */
.bubble.is-sticker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
}
.bubble.is-sticker .fig-img {
  display: block;
  width: 130px;
  height: 130px;
  object-fit: contain;
}
.bubble.is-sticker .msg-hora {
  display: table;
  margin: 4px 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}
.chat-input #chat-fig-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  box-shadow: none;
  color: var(--text-secondary, var(--muted));
}
.chat-input #chat-fig-btn:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  transform: none;
}
.fig-painel {
  position: fixed;
  z-index: 60;
  max-height: min(380px, 60vh);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.fig-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.fig-criar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.fig-criar:hover { background: var(--accent-tint); border-color: var(--accent); }
.fig-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
  padding: 10px;
  overflow-y: auto;
}
.fig-item {
  aspect-ratio: 1;
  padding: 4px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.fig-item:hover, .fig-item:focus-visible { background: var(--accent-tint); }
.fig-item img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fig-vazio {
  grid-column: 1 / -1;
  padding: 18px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 700px) {
  .bubble.is-sticker .fig-img { width: 110px; height: 110px; }
  .chat-input #chat-fig-btn { display: none; }
}

/* ============== TRANSCRIÇÃO DE ÁUDIO (30/11/2026) ============== */
/* Embaixo do áudio: botão "Transcrever" ou o texto recolhido em 2 linhas ("Ver mais"). Usa a cor do próprio balão. */
.transc-btn {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 4px 10px; min-height: 28px;
  border-radius: 99px; border: 1px solid currentColor; background: transparent; color: inherit;
  font-size: 12px; font-weight: 600; opacity: .72; cursor: pointer;
}
.transc-btn:hover { opacity: 1; }
.transc-btn:disabled { cursor: default; opacity: .6; }
.transc-spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: transc-gira .8s linear infinite; }
@keyframes transc-gira { to { transform: rotate(360deg); } }
.transc { margin-top: 6px; padding: 6px 9px; border-radius: 8px; background: color-mix(in srgb, currentColor 9%, transparent); max-width: 260px; }
.transc-txt { margin: 0; font-size: 12.5px; line-height: 1.45; font-style: italic; opacity: .9; }
.transc.longo:not(.aberta) .transc-txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.transc-mais { border: none; background: none; padding: 2px 0 0; color: inherit; font-size: 12px; font-weight: 700; opacity: .8; cursor: pointer; text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .transc-spin { animation: none; } }

/* ===== FOLLOW-UPS: próximo envio da IA + aba "Histórico da IA" (02/12/2026) ===== */
.fu-chip.ia { background: var(--accent-tint); color: var(--accent); }
.fu-proximo { display: flex; align-items: center; gap: 12px; margin: 12px 28px 0; padding: 12px 16px; border-radius: 12px; background: var(--accent-tint); color: var(--text); font-size: 13.5px; }
.fu-proximo[hidden] { display: none; }
.fu-prox-ico { color: var(--accent); display: inline-flex; flex-shrink: 0; }
.fu-prox-txt small { display: block; margin-top: 3px; font-size: 12px; color: var(--text-secondary); }
.fu-prox-tempo { font-weight: 800; color: var(--accent); margin-left: 4px; font-variant-numeric: tabular-nums; }
.fu-chip [data-ate] { font-variant-numeric: tabular-nums; }
.fu-hist { padding: 18px 28px 28px; overflow-y: auto; }
.fu-hist-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fu-hist-top h2 { font-family: 'Poppins', sans-serif; font-size: 18px; margin: 0; }
.fu-hist-top p { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }
.fu-hist-per { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.fu-hist-per button { border: none; background: none; padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--text-secondary); cursor: pointer; min-height: 34px; }
.fu-hist-per button.ativo { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.fu-hist-nums { display: flex; gap: 12px; margin: 16px 0 4px; flex-wrap: wrap; }
.fu-hist-nums > div { flex: 1; min-width: 140px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }
.fu-hist-nums b { display: block; font-family: 'Poppins', sans-serif; font-size: 22px; }
.fu-hist-nums span { font-size: 12.5px; color: var(--text-secondary); }
.fu-hist-lista { margin-top: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.fu-hist-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.fu-hist-item + .fu-hist-item { border-top: 1px solid var(--border); }
.fu-hist-meio { flex: 1; min-width: 0; }
.fu-hist-linha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fu-hist-linha small { font-size: 12px; color: var(--text-secondary); }
.fu-hist-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.fu-hist-tag.ok { background: var(--ok-tint); color: var(--ok); }
.fu-hist-tag.erro { background: var(--danger-tint); color: var(--danger); }
.fu-hist-msg { margin: 5px 0 0; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.fu-hist-ver { flex-shrink: 0; }
.fu-hist-vazio { padding: 28px 4px; color: var(--text-secondary); font-size: 14px; }
@media (max-width: 700px) {
  .fu-proximo { margin: 10px 14px 0; }
  .fu-hist { padding: 14px; }
  .fu-hist-item { flex-wrap: wrap; }
  .fu-hist-ver { width: 100%; padding-left: 50px; }
}
.fu-ia-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--violet, var(--accent)); background: color-mix(in srgb, var(--violet, var(--accent)) 14%, transparent); border-radius: 8px; padding: 2px 8px; }
.kanban-card .fu-ia-badge { margin-top: 6px; }
/* Funil: anúncio e follow-up com IA só como ícones ao lado do nome (02/12/2026) */
.kc-nome { display: flex; align-items: center; gap: 6px; }
.kc-icos { display: inline-flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.kc-ico { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px; cursor: default; }
.kc-ad { color: var(--accent); background: var(--accent-tint); }
.kc-ia { color: var(--violet, var(--accent)); background: color-mix(in srgb, var(--violet, var(--accent)) 14%, transparent); }

/* ---------- "VER NO FUNIL": destaque do último cliente aberto (2 s forte, depois some) ---------- */
.kanban-card.kc-destaque { animation: kcDestaque 3.2s ease-out; position: relative; z-index: 1; }
@keyframes kcDestaque {
  0%, 62% {
    background: color-mix(in srgb, var(--accent) 18%, var(--surface));
    box-shadow: 0 0 0 2.5px var(--accent), 0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent);
  }
}

/* ===== VER FOTO DENTRO DO CRM (janela com X, Esc e setas) ===== */
.bubble a.foto-abrir { display: block; cursor: zoom-in; }
.fv-fundo {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(8, 12, 24, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 64px 72px 32px;
  animation: fv-entra .15s ease-out;
}
@keyframes fv-entra { from { opacity: 0; } to { opacity: 1; } }
.fv-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  background: rgba(255, 255, 255, .04);
}
.fv-img.fv-erro { min-width: 240px; min-height: 160px; }
.fv-topo {
  position: absolute; top: 0; left: 0; right: 0; height: 56px;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 0 14px;
}
.fv-conta { margin-right: auto; color: rgba(255, 255, 255, .75); font-size: 13px; padding-left: 6px; }
.fv-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; min-width: 40px; padding: 0 10px; justify-content: center;
  border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .10); color: #fff;
  font-size: 13px; text-decoration: none;
}
.fv-btn:hover { background: rgba(255, 255, 255, .20); }
.fv-fechar { width: 40px; padding: 0; }
.fv-seta {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .10); color: #fff;
}
.fv-seta:hover { background: rgba(255, 255, 255, .22); }
.fv-seta[hidden] { display: none; }
.fv-ant { left: 14px; }
.fv-prox { right: 14px; }
@media (max-width: 700px) {
  .fv-fundo { padding: 60px 8px 16px; }
  .fv-seta { width: 40px; height: 40px; background: rgba(0, 0, 0, .45); }
  .fv-ant { left: 6px; } .fv-prox { right: 6px; }
  .fv-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fv-fundo { animation: none; } }
