/* DN CRM — paleta vinho + cinza + azul-bb. Tema dark padrão / claro toggle. */

:root {
  --vinho-50:  #fbf3f4;
  --vinho-100: #f4dee1;
  --vinho-200: #e7b9bf;
  --vinho-300: #d28b94;
  --vinho-400: #b75c69;
  --vinho-500: #993a48;
  --vinho-600: #7a1f2b;       /* PRIMÁRIA */
  --vinho-700: #621822;
  --vinho-800: #4a121b;
  --vinho-900: #310b13;

  --azul-bb-100: #eaf2fb;
  --azul-bb-200: #cfe0f3;
  --azul-bb-300: #a8c8e8;     /* ACCENT */
  --azul-bb-400: #7aaadb;
  --azul-bb-500: #4f8cce;

  --grey-25:  #fafafa;
  --grey-50:  #f5f5f5;
  --grey-100: #ececec;
  --grey-200: #d8d8d8;
  --grey-300: #b8b8b8;
  --grey-400: #8a8a8a;
  --grey-500: #6b6b6b;
  --grey-600: #4a4a4a;
  --grey-700: #2f2f2f;
  --grey-800: #1f1f1f;
  --grey-900: #141414;
  --grey-950: #0a0a0a;

  --green-500: #3f8c5b;
  --amber-500: #c08a3a;
  --red-500: #b94747;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow-2: 0 4px 14px rgba(0,0,0,.08);
  --shadow-3: 0 12px 32px rgba(0,0,0,.12);
}

/* DARK (padrão) */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg:           #0e0d10;
  --bg-elev:      #16151a;
  --bg-elev-2:    #1d1c22;
  --bg-hover:     #232128;
  --surface:      #16151a;
  --border:       #2a282f;
  --border-strong:#3a3741;
  --text:         #efeaee;
  --text-muted:   #a8a3ad;
  --text-dim:     #6f6976;
  --primary:      var(--vinho-500);
  --primary-hover:var(--vinho-400);
  --primary-fg:   #ffffff;
  --accent:       var(--azul-bb-300);
  --accent-soft:  rgba(168,200,232,.12);
  --vinho-soft:   rgba(153,58,72,.16);
  --header-bg:    rgba(20,18,24,.8);
}

/* LIGHT */
[data-theme="light"] {
  color-scheme: light;
  --bg:           #ffffff;
  --bg-elev:      #fbfafb;
  --bg-elev-2:    #f3f1f4;
  --bg-hover:     #efedf1;
  --surface:      #ffffff;
  --border:       #e6e3e8;
  --border-strong:#cdc8d1;
  --text:         #1a181c;
  --text-muted:   #5a5560;
  --text-dim:     #8a8590;
  --primary:      var(--vinho-600);
  --primary-hover:var(--vinho-700);
  --primary-fg:   #ffffff;
  --accent:       var(--azul-bb-500);
  --accent-soft:  rgba(79,140,206,.12);
  --vinho-soft:   rgba(122,31,43,.10);
  --header-bg:    rgba(255,255,255,.85);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
input, button, textarea, select { font: inherit; color: inherit; }

/* SVG icons inseridos via data-icon: tamanho garantido */
[data-icon] {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1em; height: 1em; line-height: 1; vertical-align: -0.15em;
  flex-shrink: 0; max-width: 1em; max-height: 1em;
}
[data-icon] > svg { width: 1em; height: 1em; max-width: 100%; max-height: 100%; display: block; }
img { max-width: 100%; height: auto; }

/* Wrappers maiores: feature da home e ícones do login lateral
   Aumentam font-size pra que [data-icon]:1em fique visível */
.dn-feature .ico { font-size: 20px; }
.dn-feature .ico [data-icon] { width: 20px; height: 20px; }
.dn-icowrap { font-size: 18px; }
.dn-icowrap [data-icon] { width: 18px; height: 18px; }
/* Topbar/sidebar ícones */
.dn-nav-link [data-icon],
.dn-btn [data-icon],
.dn-badge [data-icon],
.dn-tab [data-icon] { font-size: 14px; width: 1em; height: 1em; }
/* Hero pill icon */
.dn-hero .pill [data-icon] { width: 14px; height: 14px; }

/* ---------- Utility ---------- */
.dn-container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.dn-stack { display: flex; flex-direction: column; gap: 16px; }
.dn-row   { display: flex; align-items: center; gap: 12px; }
.dn-grow  { flex: 1; }
.dn-mono  { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }
.dn-muted { color: var(--text-muted); }
.dn-dim   { color: var(--text-dim); }
.dn-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-hidden { display: none !important; }

/* ---------- Card / surface ---------- */
.dn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.dn-card-pad { padding: 18px; }
.dn-divider { height: 1px; background: var(--border); margin: 12px 0; }

/* ---------- Buttons ---------- */
.dn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: 9px 14px; font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: all .15s ease;
  background: var(--bg-elev-2); color: var(--text);
  border-color: var(--border);
}
.dn-btn:hover { background: var(--bg-hover); }
.dn-btn-primary {
  background: var(--primary); color: var(--primary-fg); border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(122,31,43,.25);
}
.dn-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.dn-btn-ghost {
  background: transparent; border-color: transparent; color: var(--text-muted);
}
.dn-btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.dn-btn-danger { background: transparent; border-color: var(--red-500); color: var(--red-500); }
.dn-btn-danger:hover { background: rgba(185,71,71,.1); }
.dn-btn-sm { padding: 6px 10px; font-size: 12.5px; }
.dn-btn-lg { padding: 13px 22px; font-size: 15px; }
.dn-btn-icon { width: 36px; height: 36px; padding: 0; }
.dn-btn-block { width: 100%; }

/* ---------- Inputs ---------- */
.dn-field { display: flex; flex-direction: column; gap: 6px; }
.dn-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.dn-input, .dn-select, .dn-textarea {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.dn-input:focus, .dn-select:focus, .dn-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--vinho-soft);
}
.dn-textarea { min-height: 90px; resize: vertical; font-family: inherit; }

/* ---------- Badges ---------- */
.dn-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-elev-2); color: var(--text-muted); border: 1px solid var(--border);
}
.dn-badge-primary { background: var(--vinho-soft); color: var(--primary); border-color: var(--vinho-soft); }
.dn-badge-accent  { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.dn-badge-success { background: rgba(63,140,91,.14); color: var(--green-500); border-color: rgba(63,140,91,.2); }
.dn-badge-warn    { background: rgba(192,138,58,.14); color: var(--amber-500); border-color: rgba(192,138,58,.2); }
.dn-badge-danger  { background: rgba(185,71,71,.14); color: var(--red-500); border-color: rgba(185,71,71,.2); }

.dn-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dn-dot-hot   { background: #e2554b; box-shadow: 0 0 12px rgba(226,85,75,.6); }
.dn-dot-warm  { background: #c08a3a; }
.dn-dot-cold  { background: #5d8fb2; }

/* ---------- Avatar ---------- */
.dn-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg-elev-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--primary); font-size: 13px;
  border: 1px solid var(--border); flex-shrink: 0;
}
.dn-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.dn-avatar-lg { width: 44px; height: 44px; font-size: 14px; }

/* Avatar com foto + fallback iniciais */
.dn-avatar-wrap { position: relative; overflow: hidden; padding: 0; }
.dn-avatar-wrap img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%; display: block;
}
.dn-avatar-wrap .dn-avatar-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--primary);
}

/* ---------- App layout ---------- */
.dn-app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; transition: grid-template-columns .18s; }
[data-sidebar="collapsed"] .dn-app { grid-template-columns: 64px 1fr; }
.dn-sidebar {
  background: var(--bg-elev); border-right: 1px solid var(--border);
  padding: 14px 12px 0; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
  overflow: hidden;
}
.dn-sidebar > .dn-nav-scroll {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  margin: 0 -12px; padding: 0 12px;
}
.dn-sidebar > .dn-nav-footer {
  flex-shrink: 0; margin: 0 -12px; padding: 10px 12px 12px;
  background: var(--bg-elev); border-top: 1px solid var(--border);
}
[data-sidebar="collapsed"] .dn-sidebar { padding: 14px 8px; }
[data-sidebar="collapsed"] .dn-sidebar .sidebar-label,
[data-sidebar="collapsed"] .dn-sidebar .dn-nav-section,
[data-sidebar="collapsed"] .dn-sidebar-brand .name,
[data-sidebar="collapsed"] .dn-sidebar-brand .sub { display: none; }
[data-sidebar="collapsed"] .dn-nav-link { justify-content: center; padding: 10px 0; }
[data-sidebar="collapsed"] .dn-sidebar-brand { justify-content: center; }
.dn-sidebar-brand {
  display: flex; align-items: center; gap: 11px; padding: 4px 10px 16px;
  border-bottom: 1px solid var(--border); margin-bottom: 12px;
  text-decoration: none;
}
.dn-sidebar-brand:hover { text-decoration: none; }
.dn-brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: #0b0b0b; border: 1.5px solid var(--primary);
  display: grid; place-items: center;
  color: var(--primary); font-weight: 800; font-size: 16px; letter-spacing: -.5px;
  flex-shrink: 0; overflow: hidden;
}
.dn-brand-mark--img { background: var(--bg-elev); padding: 3px; }
.dn-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.dn-sidebar-brand .name {
  font-weight: 700; letter-spacing: -.01em; font-size: 15px;
  color: var(--text); line-height: 1.15;
}
.dn-sidebar-brand .sub {
  font-size: 10.5px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .12em; margin-top: 2px;
}

.dn-nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); padding: 12px 10px 4px; font-weight: 700; }
.dn-nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; color: var(--text-muted); font-weight: 500; cursor: pointer;
  border-left: 3px solid transparent; padding-left: 9px;
  transition: background .12s, color .12s, border-color .12s;
}
.dn-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.dn-nav-link:hover { background: var(--bg-hover); color: var(--text); }
.dn-nav-link:hover svg { opacity: 1; }
.dn-nav-link.active {
  background: var(--bg-elev-2, var(--bg-hover));
  color: var(--primary); font-weight: 600;
  border-left-color: var(--primary);
}
.dn-nav-link.active svg { color: var(--primary); opacity: 1; }
[data-sidebar="collapsed"] .dn-nav-link { border-left-color: transparent !important; padding-left: 0; }

.dn-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.dn-app-footer { margin-top: auto; }
.dn-topbar {
  height: 60px; padding: 0 24px; border-bottom: 1px solid var(--border);
  background: var(--header-bg); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 30;
}
.dn-topbar h1 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.dn-content { padding: 24px; }

/* ---------- Tabs ---------- */
.dn-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.dn-tab {
  padding: 10px 14px; color: var(--text-muted); font-weight: 600; font-size: 13px;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.dn-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Table ---------- */
.dn-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dn-table th { text-align: left; font-weight: 600; color: var(--text-muted);
  padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .04em; }
.dn-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dn-table tr:hover td { background: var(--bg-hover); }

/* ---------- Pipeline / Kanban ---------- */
.dn-kanban {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px;
  scroll-behavior: smooth;
}
.dn-column {
  flex: 0 0 300px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 220px);
}
.dn-column-head {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; position: sticky; top: 0;
  background: var(--bg-elev); border-radius: var(--radius) var(--radius) 0 0; z-index: 1;
}
.dn-column-head .name { font-weight: 700; font-size: 13.5px; flex: 1; }
.dn-column-head .count { color: var(--text-muted); font-size: 12px; }
.dn-column-head .total { color: var(--text-dim); font-size: 11.5px; margin-left: 4px; }
.dn-column-body {
  padding: 10px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1;
}

.dn-leadcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; cursor: grab;
  transition: all .12s ease; display: flex; flex-direction: column; gap: 8px;
}
.dn-leadcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.dn-leadcard.sortable-chosen { box-shadow: var(--shadow-3); }
.dn-leadcard .row1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dn-leadcard .name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.dn-leadcard .company { font-size: 11.5px; color: var(--text-muted); }
.dn-leadcard .value { font-weight: 700; color: var(--primary); font-size: 13px; }
.dn-leadcard .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted); }
.dn-leadcard .meta svg { width: 13px; height: 13px; }
.dn-leadcard .footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px;
}
.dn-leadcard .ai-pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.dn-leadcard .score-bar {
  height: 4px; background: var(--bg-elev-2); border-radius: 2px; overflow: hidden; flex: 1;
}
.dn-leadcard .score-bar > i {
  display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary));
}

/* ---------- Conversations / Chat ---------- */
.dn-chat { display: grid; grid-template-columns: 300px 1fr 280px; height: calc(100vh - 60px); overflow: hidden; }
@media (max-width: 1400px){ .dn-chat { grid-template-columns: 280px 1fr 260px; } }
@media (max-width: 1200px){ .dn-chat { grid-template-columns: 260px 1fr 240px; } }
.dn-chat-list { background: var(--bg-elev); border-right: 1px solid var(--border); overflow-y: auto; min-height: 0; }
.dn-conv-tabs { display: flex; border-bottom: 1px solid var(--border); }
.dn-conv-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 8px; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; transition: all .15s;
}
.dn-conv-tab:hover { color: var(--text); background: var(--bg-hover); }
.dn-conv-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.dn-conv-tab-count {
  font-size: 10.5px; padding: 1px 6px; border-radius: 999px;
  background: var(--border); color: var(--text-muted); font-weight: 700;
}
.dn-conv-tab.active .dn-conv-tab-count { background: var(--primary); color: var(--primary-fg); }
.dn-chat-item {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; cursor: pointer;
}
.dn-chat-item:hover { background: var(--bg-hover); }
.dn-chat-item.active { background: var(--vinho-soft); }
.dn-chat-item .preview { font-size: 12px; color: var(--text-muted); max-width: 200px; }

.dn-chat-window { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.dn-chat-head { height: 56px; flex-shrink: 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 16px; }

/* Nota fixa abaixo do header da conversa */
.dn-pinned-note {
  flex-shrink: 0;
  background: var(--vinho-soft);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--text);
}
.dn-pinned-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; background: transparent; border: 0; cursor: pointer;
  color: inherit; font: inherit; text-align: left;
}
.dn-pinned-toggle:hover { background: rgba(0,0,0,.04); }
[data-theme="dark"] .dn-pinned-toggle:hover { background: rgba(255,255,255,.04); }
.dn-pinned-toggle [data-icon="pin"] { color: var(--primary); flex-shrink: 0; }
.dn-pinned-label { font-weight: 700; letter-spacing: .2px; flex-shrink: 0; }
.dn-pinned-preview {
  flex: 1; min-width: 0; opacity: .85; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dn-pinned-chev {
  flex-shrink: 0; transition: transform .18s; opacity: .6;
  transform: rotate(90deg); /* expandido = pra baixo */
}
.dn-pinned-note.minimized .dn-pinned-chev { transform: rotate(0deg); /* minimizado = pra direita */ }
.dn-pinned-body {
  padding: 0 14px 10px;
  display: flex; flex-direction: column; gap: 6px;
  overflow: hidden; max-height: 300px; transition: max-height .2s, padding .2s, opacity .15s;
}
.dn-pinned-note.minimized .dn-pinned-body {
  max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; pointer-events: none;
}
.dn-pinned-note.empty:not(.minimized) .dn-pinned-preview::before {
  content: 'sem nota — clique pra anotar'; opacity: .55; font-style: italic;
}
.dn-pinned-note.empty .dn-pinned-preview { font-style: italic; }
#dn-pinned-textarea {
  width: 100%; min-height: 48px; max-height: 140px; resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 8px; font: inherit; color: var(--text); outline: none;
  transition: border-color .12s;
}
#dn-pinned-textarea:focus { border-color: var(--primary); }
.dn-pinned-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; opacity: .85;
}
.dn-pinned-status { min-height: 14px; }
.dn-chat-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; background:
  linear-gradient(180deg, var(--bg) 0%, var(--bg-elev) 100%); }
.dn-bubble { max-width: 65%; width: fit-content; min-width: 64px;
  padding: 9px 12px; border-radius: 12px; margin-bottom: 6px; font-size: 13.5px;
  word-wrap: break-word; overflow-wrap: break-word; }
.dn-bubble.in {
  background: var(--bg-elev); border: 1px solid var(--border); border-bottom-left-radius: 4px;
  margin-right: auto;
}
.dn-bubble.out {
  background: var(--primary); color: var(--primary-fg); border-bottom-right-radius: 4px;
  margin-left: auto;
}
.dn-bubble.pending { opacity: .55; }
.dn-bubble.failed { background: var(--red-500, #b33); color: #fff; }
.dn-bubble .polished-tag { display:inline-block; font-size:10px; opacity:.85; margin-left:6px; padding:1px 5px; border-radius:6px; background:rgba(255,255,255,.18); }
.dn-bubble .when {
  font-size: 10.5px; opacity: .7;
  float: right;
  margin: 8px 0 -2px 12px;
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.dn-bubble::after { content: ""; display: block; clear: both; }
.dn-bubble:hover .msg-menu-btn { opacity: .8 !important; }
.dn-bubble .msg-menu-btn { background: transparent; border: 0; color: inherit; opacity: 0; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.dn-bubble .msg-menu-btn:hover { background: rgba(0,0,0,.15) !important; opacity: 1 !important; }
.dn-tag-mini {
  font-size: 9.5px; padding: 1px 5px; border-radius: 6px;
  background: rgba(255,255,255,.18); font-weight: 600; letter-spacing: .3px;
}

/* Nome do remetente em mensagens de grupo */
.dn-msg-sender {
  font-size: 11.5px; font-weight: 700;
  color: var(--vinho-300);
  margin-bottom: 2px;
  display: flex; align-items: baseline; gap: 6px;
}
.dn-bubble.in .dn-msg-sender { color: var(--vinho-500); }
.dn-msg-sender .dn-dim { font-weight: 400; font-size: 10.5px; }

/* Sticker: sem contorno, sem fundo — imagem + hora em pill sobreposto */
.dn-bubble.sticker {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
  box-shadow: none !important;
  position: relative;
}
.dn-bubble.sticker img {
  background: transparent;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.35));
}
.dn-bubble.sticker .when {
  position: absolute !important;
  right: 6px; bottom: 6px;
  float: none !important;
  margin: 0 !important;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; line-height: 1.2;
  opacity: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  pointer-events: none;
}
.dn-bubble.sticker.out .when {
  background: var(--primary);
  color: var(--primary-fg);
}
.dn-bubble.sticker.in .when {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
}
.dn-bubble.sticker::after { content: none; }  /* desliga clearfix */
.dn-bubble.sticker .msg-menu-btn {
  background: rgba(0,0,0,.45) !important;
  color: #fff !important;
  border-radius: 50%;
}

/* Sticker em modo NOTA INTERNA: moldura vinho marcante pra ficar óbvio que é interno */
.dn-bubble.sticker.internal {
  background: var(--vinho-soft) !important;
  border: 2px dashed var(--primary) !important;
  padding: 10px 12px 8px !important;
  border-radius: 12px !important;
  border-bottom-right-radius: 4px !important;
  box-shadow: 0 1px 4px rgba(122,31,43,.15) !important;
  position: relative;
}
.dn-bubble.sticker.internal img {
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.18));
}
.dn-bubble.sticker.internal .when {
  position: static !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-top: 4px !important;
  font-size: 10px;
  display: flex !important;
  justify-content: flex-end;
}
.dn-bubble.sticker.internal::before {
  content: ''; position: absolute;
  top: -1px; left: -1px; right: -1px; height: 3px;
  background: linear-gradient(90deg, var(--primary), transparent);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
}

/* Reações ancoradas ao bubble (estilo WhatsApp) */
.dn-bubble { padding-bottom: 12px; }  /* sobra pro badge não vazar */
.dn-reactions {
  position: absolute; bottom: -10px;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 6px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border);
  font-size: 13px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  z-index: 1;
}
.dn-bubble.in .dn-reactions { right: 8px; }
.dn-bubble.out .dn-reactions { left: 8px; }
.dn-reactions .dn-reactions-count {
  font-size: 10.5px; color: var(--text-muted); font-weight: 600;
  margin-left: 2px;
}
.dn-reactions:hover { transform: scale(1.05); }

/* Picker de reação */
.dn-react-picker {
  position: fixed; z-index: 95;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 6px;
  display: flex; gap: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  animation: dn-pop-in .12s ease-out;
}
.dn-react-picker button {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 0; cursor: pointer;
  font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s, background .12s;
}
.dn-react-picker button:hover { background: var(--bg-hover); transform: scale(1.2); }

/* @mentions inline */
.dn-mention {
  display: inline-block;
  padding: 0 4px; border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.dn-bubble.out .dn-mention { background: rgba(255,255,255,.22); color: #fff; }

/* Status checks: cinza não-visualizado, vinho (vermelho) visualizado */
.dn-msg-status { display: inline-flex; width: 15px; height: 15px; align-items: center; }
.dn-msg-status svg { width: 100%; height: 100%; }
.dn-msg-status.pending,
.dn-msg-status.sent,
.dn-msg-status.delivered { color: rgba(255,255,255,.55); }
.dn-msg-status.read { color: var(--vinho-300); }
.dn-msg-status.failed { color: #ff6961; }
.dn-bubble.in .dn-msg-status { display: none; }

/* Pin marker no item da lista */
.dn-pin-mark {
  display: inline-flex; width: 11px; height: 11px;
  color: var(--accent); flex-shrink: 0;
}

/* Banner pra ativar notificações no inbox */
.dn-notif-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; margin: -10px -10px 8px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--primary) 14%, transparent),
    color-mix(in srgb, var(--primary) 6%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  font-size: 12.5px; color: var(--text);
  animation: dn-notif-slide .3s ease;
}
.dn-notif-banner [data-icon] { color: var(--primary); }
.dn-notif-banner .dn-notif-text { flex: 1; line-height: 1.4; }
@keyframes dn-notif-slide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Indicador de status do sino (notificações) */
#dn-bell-btn { position: relative; }
.dn-bell-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-500, #1aa67e);
  box-shadow: 0 0 0 2px var(--surface);
  animation: dn-bell-pulse 2.4s ease-in-out infinite;
}
@keyframes dn-bell-pulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* Transcrição de áudio — botão e bloco em tom vinho */
.dn-transcript-wrap { margin-top: 6px; display: block; }
.dn-transcribe-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--vinho-soft);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  cursor: pointer; transition: all .15s ease;
}
.dn-transcribe-btn:hover {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(122,31,43,.25);
}
.dn-transcribe-btn:disabled {
  opacity: .8; cursor: wait; transform: none; box-shadow: none;
}
.dn-tr-spin {
  display: inline-block; width: 10px; height: 10px;
  border: 2px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: dn-spin .7s linear infinite;
}
.dn-bubble.out .dn-tr-spin {
  border-color: rgba(255,255,255,.25);
  border-top-color: #fff;
}
.dn-bubble.out .dn-transcribe-btn {
  background: rgba(255,255,255,.14); color: #fff;
  border-color: rgba(255,255,255,.28);
}
.dn-bubble.out .dn-transcribe-btn:hover {
  background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.45);
}
.dn-transcript {
  margin-top: 4px; padding: 8px 11px 9px;
  background: var(--vinho-soft);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  font-size: 12.5px; line-height: 1.45;
  color: var(--text);
  animation: dn-tr-fade .25s ease;
}
.dn-bubble.out .dn-transcript {
  background: rgba(255,255,255,.10);
  border-left-color: rgba(255,255,255,.55);
  color: #fff;
}
@keyframes dn-tr-fade {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
.dn-transcript-head {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; color: var(--primary); margin-bottom: 3px;
  opacity: .9;
}
.dn-bubble.out .dn-transcript-head { color: rgba(255,255,255,.85); }
.dn-transcript-text {
  white-space: pre-wrap; word-wrap: break-word;
  font-style: italic; opacity: .92;
}

/* Player de áudio customizado (combina com tema) */
.dn-audio {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px;
  background: rgba(255,255,255,.10);
  border-radius: 999px;
  min-width: 220px;
  max-width: 280px;
  font-variant-numeric: tabular-nums;
}
.dn-bubble.in .dn-audio { background: rgba(255,255,255,.06); border: 1px solid var(--border); }
.dn-audio-play {
  flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--vinho-600);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; transition: transform .12s, background .15s;
}
.dn-audio-play:hover { background: var(--vinho-500); transform: scale(1.04); }
.dn-audio-play svg { width: 14px; height: 14px; }
.dn-audio-play[data-playing="1"] svg { width: 13px; height: 13px; }
.dn-audio-play[data-loading="1"] svg { animation: dn-spin 1s linear infinite; }
@keyframes dn-spin { to { transform: rotate(360deg); } }
.dn-audio-track {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.dn-audio-bar {
  position: relative; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,.18);
  cursor: pointer;
}
.dn-bubble.in .dn-audio-bar { background: rgba(255,255,255,.10); }
.dn-audio-fill {
  position: absolute; inset: 0;
  width: 0%; border-radius: 999px;
  background: var(--vinho-300);
  pointer-events: none;
  transition: width .08s linear;
}
.dn-audio-bar::after {
  content: ''; position: absolute;
  top: 50%; transform: translate(-50%, -50%);
  left: var(--dn-audio-pos, 0%);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--vinho-300);
  box-shadow: 0 0 0 2px rgba(0,0,0,.18);
  pointer-events: none;
}
.dn-audio-meta {
  display: flex; justify-content: space-between;
  font-size: 10.5px; opacity: .75;
}

/* Painel do lead (sidebar do inbox) */
.dn-lead-panel {
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 12.5px;
  overflow-y: auto;
  height: 100%;
}
.dn-lead-head { display: flex; gap: 10px; align-items: center; }
.dn-lead-id {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px; padding: 1px 6px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.dn-lead-id-mini {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px; padding: 0 4px; margin-left: 4px;
  border-radius: 4px; background: var(--bg-elev-2); color: var(--text-muted);
  font-weight: 500; letter-spacing: .2px;
  display: inline-block; vertical-align: middle;
}

/* Hint discreto "?" no balão quando lead tem msgs em múltiplas sessões.
   Hover/tap mostra o número via tooltip nativo (atributo title). */
.dn-bubble-via-hint {
  position: absolute; top: 4px; right: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 999px;
  opacity: .35; cursor: help;
  color: inherit;
  transition: opacity .15s ease;
}
.dn-bubble-via-hint:hover { opacity: .85; }
.dn-bubble.out .dn-bubble-via-hint { color: rgba(255,255,255,.9); }

/* Selector de canal/sessão na barra de envio */
.dn-channel-selector {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; background: var(--vinho-soft); color: var(--primary);
  border-radius: 999px; font-size: 11px; font-weight: 600;
}
.dn-channel-selector select {
  background: transparent; border: 0; color: inherit; font-weight: 600;
  font-size: 11px; cursor: pointer; outline: none;
}

.dn-lead-progress { margin-top: 12px; }
.dn-lead-progress-meta {
  display: flex; justify-content: space-between;
  font-size: 11.5px; opacity: .8; margin-bottom: 4px;
}
.dn-progress { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.dn-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--vinho-400)); transition: width .3s; }
.dn-progress.dn-progress-won > span { background: linear-gradient(90deg, var(--green-500), #2ea66b); }
.dn-progress.dn-progress-lost > span { background: linear-gradient(90deg, #b94444, #d36363); }

.dn-lead-actions {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 4px;
  margin-top: 8px;
}
.dn-lead-actions .dn-btn { padding: 4px 6px; gap: 3px; font-size: 11.5px; }
.dn-lead-actions-2 {
  grid-template-columns: 1fr 1fr; margin-top: 4px;
}
.dn-lead-actions-2 .dn-btn { font-size: 11px; padding: 4px 6px; }
.dn-lead-progress { margin-top: 8px; }
.dn-lead-progress-meta { font-size: 11px; }

/* Painel "Modo Bot/Humano + Resumo IA" no sider — compacto */
.dn-ai-panel { margin-top: 8px; padding: 8px 10px; background: var(--vinho-soft);
  border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.dn-ai-mode { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.dn-ai-mode-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dn-ai-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dn-ai-mode.bot .dn-ai-dot { background: #2dbe60; box-shadow: 0 0 0 2px rgba(45,190,96,.18); animation: dnPulse 2s ease-in-out infinite; }
.dn-ai-mode.human .dn-ai-dot { background: #c5961e; }
@keyframes dnPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.dn-ai-status { display: flex; align-items: center; gap: 6px; }
.dn-ai-status .dn-btn { font-size: 11px; padding: 3px 6px; flex-shrink: 0; }
.dn-ai-summary { border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 2px; }
.dn-ai-summary-head { display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; }
.dn-ai-summary-title { font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }
.dn-ai-summary-body { font-size: 12px; line-height: 1.4; color: var(--text); max-height: 160px;
  overflow-y: auto; margin-top: 6px; }
.dn-ai-panel.collapsed .dn-ai-summary-body { display: none; }
.dn-ai-panel.collapsed .dn-ai-summary { padding-top: 4px; margin-top: 0; }
.dn-ai-summary-toggle { font-size: 10px; opacity: .55; transition: transform .2s; }
.dn-ai-panel.collapsed .dn-ai-summary-toggle { transform: rotate(-90deg); }
.dn-btn-link { background: none; border: none; color: var(--primary); font-size: 10.5px; cursor: pointer;
  padding: 0; display: inline-flex; align-items: center; gap: 3px; }
.dn-btn-link:hover { text-decoration: underline; }

.dn-tabs {
  display: flex; gap: 2px; margin-top: 10px;
  border-bottom: 1px solid var(--border); font-size: 11.5px;
}
.dn-tab {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px 4px; font-size: 11.5px; color: var(--text-muted);
  border-bottom: 2px solid transparent; flex: 1;
  transition: color .15s, border-color .15s;
}
.dn-tab:hover { color: var(--text); }
.dn-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.dn-tab-pane { display: none; padding-top: 8px; }
.dn-tab-pane.active { display: block; animation: dn-fade-in .15s ease-out; }

.dn-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.dn-stat {
  padding: 10px; border-radius: 8px;
  background: var(--bg-elev-2, rgba(0,0,0,.10));
  border: 1px solid var(--border);
}
.dn-stat-num { font-size: 18px; font-weight: 700; line-height: 1.1; color: var(--accent); }
.dn-stat-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin-top: 4px; }

.dn-media-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.dn-media-thumb {
  position: relative; aspect-ratio: 1/1; overflow: hidden;
  border-radius: 6px; background: var(--bg-elev-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.dn-media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dn-media-thumb svg { width: 22px; height: 22px; }
.dn-media-thumb.video { background: rgba(0,0,0,.45); color: #fff; }
.dn-media-thumb.audio { background: var(--vinho-soft, rgba(122,31,43,.2)); color: var(--vinho-300); }
.dn-media-thumb.doc { background: var(--accent-soft); color: var(--accent); }

/* Picker de figurinhas */
/* Picker unificado: emoji + figurinhas com abas */
.dn-picker-pop {
  display: none; position: fixed; z-index: 90;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
  width: 320px; max-height: 380px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  animation: dn-pop-in .12s ease-out;
  flex-direction: column;
}
.dn-picker-pop.active { display: flex; }
.dn-picker-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 6px 0; border-bottom: 1px solid var(--border);
}
.dn-picker-tab {
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 5px;
  border-bottom: 2px solid transparent;
}
.dn-picker-tab:hover { color: var(--text); }
.dn-picker-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.dn-picker-close {
  background: transparent; border: 0; cursor: pointer; color: var(--text-muted);
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 4px;
}
.dn-picker-close:hover { background: var(--bg-hover); color: var(--text); }
.dn-picker-body { flex: 1; overflow-y: auto; }
.dn-picker-grid.emoji {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px;
}
.dn-picker-grid.emoji button {
  background: transparent; border: 0; cursor: pointer;
  font-size: 22px; padding: 4px; border-radius: 6px;
}
.dn-picker-grid.emoji button:hover { background: var(--bg-hover); }
.dn-picker-grid.stickers {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px;
}
.dn-picker-grid.stickers button {
  background: transparent; border: 1px solid transparent;
  border-radius: 8px; padding: 4px; cursor: pointer; aspect-ratio: 1/1;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, transform .12s, border-color .12s;
}
.dn-picker-grid.stickers button:hover { background: var(--bg-hover); border-color: var(--border); transform: scale(1.05); }
.dn-picker-grid.stickers img { width: 100%; height: 100%; object-fit: contain; }
.dn-picker-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Aliases pra compat com seletor antigo (sticker-grid no JS legado) */
#sticker-grid { display: contents; }
.dn-sticker-pop, .dn-emoji-pop { display: none !important; }

/* Modal de preview de mídia (imagem/vídeo/audio/doc antes de enviar) */
.dn-media-preview {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
}
.dn-media-preview-body {
  flex: 1; padding: 16px;
  background: rgba(0,0,0,.30);
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; max-height: 60vh; overflow: auto;
}
.dn-media-preview-body img,
.dn-media-preview-body video {
  max-width: 100%; max-height: 50vh; border-radius: 6px; display: block;
}
.dn-media-preview-body .dn-doc-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px; color: var(--text-muted);
}
.dn-media-preview-body .dn-doc-card svg { width: 56px; height: 56px; color: var(--accent); }
.dn-media-preview-foot {
  padding: 10px 14px; display: flex; gap: 8px; align-items: flex-end;
  border-top: 1px solid var(--border);
}
.dn-media-preview-foot textarea {
  flex: 1; resize: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; color: var(--text); font-size: 13.5px;
  min-height: 38px; max-height: 120px; outline: none;
}
.dn-media-preview-foot textarea:focus { border-color: var(--accent); }
.dn-media-preview-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px;
  border-radius: 12px; color: #fff; font-size: 13px;
}
.dn-media-preview-overlay svg { width: 28px; height: 28px; animation: dn-spin 1s linear infinite; }

/* Bubble pendente (durante envio) */
.dn-bubble.uploading { position: relative; min-height: 90px; min-width: 200px; }
.dn-bubble.uploading::after {
  content: '';
  position: absolute; inset: 0; border-radius: 12px;
  background: rgba(0,0,0,.42);
  pointer-events: none;
  backdrop-filter: blur(1px);
}
.dn-loader-ring {
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 3.5px solid rgba(255,255,255,.20);
  border-top-color: var(--vinho-200);
  border-right-color: var(--vinho-300);
  animation: dn-spin .85s linear infinite;
  z-index: 2;
  box-shadow: 0 0 18px rgba(0,0,0,.4);
}
.dn-bubble .dn-upload-progress {
  position: absolute; bottom: 6px; left: 8px; right: 8px;
  height: 5px; background: rgba(0,0,0,.30); border-radius: 999px; overflow: hidden;
  z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.dn-bubble .dn-upload-progress > span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--vinho-300), var(--vinho-200));
  transition: width .15s linear;
  box-shadow: 0 0 6px rgba(255,255,255,.4);
}
.dn-upload-pct {
  position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px; color: #fff; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  z-index: 2;
}

/* ---------- Gravação de áudio (UI WhatsApp-style) ---------- */
.dn-recording-bar {
  display: none; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg-elev);
  border-top: 1px solid var(--border);
}
.dn-recording-bar.active { display: flex; }
.dn-rec-cancel,
.dn-rec-pause,
.dn-rec-preview,
.dn-rec-resume,
.dn-rec-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); transition: background .15s, transform .12s;
  flex-shrink: 0;
}
.dn-rec-cancel:hover { background: rgba(185,71,71,.18); color: var(--red-500, #c44); }
.dn-rec-cancel svg { width: 18px; height: 18px; }
.dn-rec-pause,
.dn-rec-preview,
.dn-rec-resume {
  background: var(--bg-elev-2, rgba(0,0,0,.18));
}
.dn-rec-pause:hover,
.dn-rec-preview:hover,
.dn-rec-resume:hover { background: var(--bg-hover); transform: scale(1.05); }
.dn-rec-pause svg,
.dn-rec-preview svg,
.dn-rec-resume svg { width: 16px; height: 16px; }
.dn-rec-send {
  background: var(--vinho-600); color: #fff;
}
.dn-rec-send:hover { background: var(--vinho-500); transform: scale(1.05); }
.dn-rec-send svg { width: 16px; height: 16px; }

.dn-rec-mid {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px;
}
.dn-rec-wave {
  flex: 1; height: 36px;
  display: flex; align-items: center; gap: 2px;
  overflow: hidden;
}
.dn-rec-wave canvas { width: 100%; height: 100%; display: block; }
.dn-rec-wave .dn-wave-bar {
  width: 2px; background: var(--vinho-400);
  border-radius: 1px;
  transition: height .08s ease-out;
}
.dn-rec-time {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13px; color: var(--text); font-weight: 600;
  min-width: 50px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.dn-rec-time .dn-rec-dot-inline {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red-500, #c44); margin-right: 4px;
  vertical-align: 1px;
  animation: dn-pulse 1.4s ease-in-out infinite;
}
.dn-recording-bar.paused .dn-rec-time .dn-rec-dot-inline { animation: none; opacity: .4; }

/* Tags popup (posicionamento dinâmico) */
.dn-tags-pop {
  display: none;
  position: fixed;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px;
  z-index: 90;
  min-width: 240px; max-height: 70vh; overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  animation: dn-pop-in .12s ease-out;
}
.dn-tags-pop-head {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 12.5px;
  padding-bottom: 8px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Tags modernas com ícone opcional */
.dn-tag-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
  border: 1px solid transparent; line-height: 1.2;
  white-space: nowrap;
}
.dn-tag-badge svg { width: 11px; height: 11px; }
.dn-tag-pick {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 6px; cursor: pointer;
  transition: background .12s;
}
.dn-tag-pick:hover { background: var(--bg-hover); }
.dn-tag-pick input[type="checkbox"] { cursor: pointer; }

/* Inline-editable fields no painel de contato */
.dn-contact-fields { display: flex; flex-direction: column; gap: 4px; }
.dn-field {
  display: flex; flex-direction: column; gap: 1px;
  padding: 4px 6px; margin: 0 -6px; border-radius: 6px;
  cursor: text; transition: background .12s;
}
.dn-field:hover { background: var(--bg-hover); }
.dn-field-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-muted); font-weight: 600;
}
.dn-field-value {
  font-size: 12.5px; color: var(--text);
  word-break: break-word;
}
.dn-field-value:empty::before {
  content: attr(data-empty);
  color: var(--text-muted); font-style: italic; opacity: .65;
}
.dn-field-value[data-empty]:empty::before { content: attr(data-empty); }
.dn-field input.dn-field-input {
  background: var(--bg); border: 1px solid var(--accent);
  border-radius: 4px; padding: 4px 8px; font-size: 13px;
  color: var(--text); width: 100%;
  outline: none;
}

/* Modal/Confirm genérico */
.dn-modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  animation: dn-fade-in .12s ease-out;
}
.dn-modal {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
  width: min(420px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  overflow: hidden;
  animation: dn-pop-in .14s cubic-bezier(.34,1.56,.64,1);
}
.dn-modal-head {
  padding: 14px 18px 8px; display: flex; align-items: center; gap: 10px;
}
.dn-modal-head .dn-modal-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--vinho-soft, rgba(122,31,43,.15)); color: var(--vinho-400);
  flex-shrink: 0;
}
.dn-modal-head .dn-modal-icon[data-tone="info"] { background: var(--accent-soft); color: var(--accent); }
.dn-modal-head .dn-modal-icon svg { width: 18px; height: 18px; }
.dn-modal-title { font-weight: 700; font-size: 14.5px; }
.dn-modal-body { padding: 4px 18px 14px; font-size: 13.5px; opacity: .85; line-height: 1.45; }
.dn-modal-foot {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--bg-elev-2, rgba(0,0,0,.10));
}
@keyframes dn-fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes dn-pop-in { from { opacity: 0; transform: scale(.92) translateY(6px) } to { opacity: 1; transform: scale(1) translateY(0) } }

/* Bubble de mensagem apagada — visual sutil e claro */
.dn-bubble.deleted {
  opacity: .72;
  font-style: italic;
}
.dn-bubble.deleted .msg-body { display: inline-flex; align-items: center; gap: 6px; opacity: .85; }
.dn-bubble.deleted .msg-body::before {
  content: ''; display: inline-block;
  width: 13px; height: 13px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='4.93' y1='4.93' x2='19.07' y2='19.07'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='4.93' y1='4.93' x2='19.07' y2='19.07'/></svg>") center / contain no-repeat;
  flex-shrink: 0;
}
.dn-bubble.deleted .msg-menu-btn,
.dn-bubble.deleted .dn-msg-status,
.dn-bubble.deleted .polished-tag,
.dn-bubble.deleted img,
.dn-bubble.deleted video,
.dn-bubble.deleted a[href*="/conversas/media/"],
.dn-bubble.deleted .dn-reply-block,
.dn-bubble.deleted .dn-reactions,
.dn-bubble.deleted .dn-msg-sender,
.dn-bubble.deleted .dn-audio { display: none !important; }

/* Sticker apagado: restaura visual de bubble normal pra "Mensagem apagada" caber */
.dn-bubble.deleted.sticker {
  background: var(--bg-elev) !important;
  border: 1px solid var(--border) !important;
  padding: 9px 12px !important;
  border-radius: 12px !important;
  min-width: 0 !important;
  box-shadow: none !important;
}
.dn-bubble.deleted.sticker.out {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-fg) !important;
}
.dn-bubble.deleted.sticker .when {
  position: static !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 11px;
  display: inline-flex !important;
}
/* Nota interna apagada: mantém moldura vinho mas remove dashed (não é mais "ativa") */
.dn-bubble.deleted.internal {
  border-style: solid !important;
  border-width: 1px !important;
}
.dn-bubble.deleted.sticker.internal::before { display: none !important; }

/* Indicador de gravação pulsante (sem emoji) */
.dn-rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red-500, #b33);
  animation: dn-pulse 1.4s ease-in-out infinite;
}
@keyframes dn-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.85); }
}
.msg-pop {
  position: absolute; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 0; min-width: 160px; z-index: 100;
  box-shadow: 0 8px 20px rgba(0,0,0,.4); font-size: 13px;
}
.msg-pop button {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  background: transparent; border: 0; color: var(--text); cursor: pointer;
}
.msg-pop button:hover { background: var(--bg-hover); }
.msg-pop button.danger { color: var(--red-500); }
.dn-chat-input {
  flex-shrink: 0;
  border-top: 1px solid var(--border); padding: 10px 14px;
  display: flex; gap: 6px; align-items: flex-end;
  background: var(--bg);
}
.dn-chat-input textarea {
  flex: 1; border: 1px solid var(--border); background: var(--bg-elev);
  border-radius: 22px; padding: 11px 16px; color: var(--text);
  resize: none; max-height: 140px; min-height: 42px;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.dn-chat-input textarea:focus {
  border-color: var(--primary); outline: 0;
  box-shadow: 0 0 0 3px var(--vinho-soft);
}

/* Botões de ícone na barra de input — pequenos e ghost */
.dn-input-btn {
  background: transparent; border: 0; cursor: pointer; color: var(--text-muted);
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .12s, color .12s, transform .12s;
}
.dn-input-btn:hover { background: var(--bg-hover); color: var(--text); }
.dn-input-btn:active { transform: scale(.92); }

/* Sub-abas de estado da conversa (ativas | soneca | resolvidas) */
.dn-state-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.dn-state-tab {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: baseline; justify-content: center; gap: 3px;
  white-space: nowrap; overflow: hidden;
  padding: 9px 3px;
  font-size: 10.5px; letter-spacing: -.1px;
  color: var(--text-muted); text-decoration: none; font-weight: 600;
  border-bottom: 2px solid transparent; transition: all .12s;
}
.dn-state-tab:hover { color: var(--text); background: var(--bg-hover); }
.dn-state-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.dn-state-count {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 9px; font-weight: 700; line-height: 1;
  min-width: 14px; height: 13px; padding: 0 4px;
  border-radius: 999px;
  background: var(--bg-elev-2); color: var(--text-muted);
}
.dn-state-tab.active .dn-state-count {
  background: rgba(122,31,43,.12); color: var(--primary);
}
[data-theme="dark"] .dn-state-count { background: rgba(255,255,255,.08); }
[data-theme="dark"] .dn-state-tab.active .dn-state-count { background: rgba(255,255,255,.14); color: var(--primary); }

/* SLA: anima o próprio horário em vez de adicionar badge */
.dn-time-sla-mid {
  background: #fff3d6; color: #9a6810 !important;
  padding: 2px 7px; border-radius: 999px; font-weight: 700;
}
.dn-time-sla-high {
  background: #ffd9d9; color: #a02020 !important;
  padding: 2px 7px; border-radius: 999px; font-weight: 700;
  animation: dn-sla-pulse 1.6s ease-in-out infinite;
}
[data-theme="dark"] .dn-time-sla-mid { background: rgba(220,140,40,.25); color: #ffb060 !important; }
[data-theme="dark"] .dn-time-sla-high { background: rgba(220,40,40,.25); color: #ff8888 !important; }
@keyframes dn-sla-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,40,40,.4); }
  50%     { box-shadow: 0 0 0 4px rgba(220,40,40,0); }
}
.dn-state-count.dn-state-waiting { background: rgba(185,68,68,.18); color: #b94444; }
[data-theme="dark"] .dn-state-count.dn-state-waiting { background: rgba(232,90,90,.22); color: #ff8585; }

/* Borda esquerda do item de conv quando SLA em warn/breach */
.dn-chat-item.dn-sla-warn { box-shadow: inset 3px 0 0 #d99100; }
.dn-chat-item.dn-sla-breach {
  box-shadow: inset 3px 0 0 #d92020;
  background: linear-gradient(90deg, rgba(220,40,40,.06), transparent 35%);
}
.dn-chat-item.dn-sla-breach::before {
  content: ""; position: absolute; left: 4px; top: 12px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #e84545;
  animation: dn-sla-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(232,69,69,.5);
}
.dn-chat-item { position: relative; }
.dn-state-tab.active .dn-state-count.dn-state-waiting { background: #b94444; color: #fff; }

/* Indicador minimalista de temperatura — bolinha colorida sobreposta no avatar */
.dn-temp {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.dn-temp-hot { background: #e84545; }
.dn-temp-warm { background: #ec8d2f; }
.dn-temp-cold { background: #5b87bf; }

/* Host do avatar — wrapper externo que NÃO recorta, pra bolinha de temp poder transbordar */
.dn-avatar-host {
  position: relative; display: inline-flex; flex-shrink: 0;
  align-self: flex-start;
}
/* Quando sobreposto no avatar: canto inferior-direito, transbordando livre */
.dn-temp-onavatar {
  position: absolute; bottom: -1px; right: -1px;
  width: 11px; height: 11px;
  border: 2px solid var(--bg-elev);
  z-index: 2;
}
.dn-chat-item:hover .dn-temp-onavatar { border-color: var(--bg-hover); }
.dn-chat-item.active .dn-temp-onavatar { border-color: var(--vinho-soft); }
.dn-temp-onavatar.dn-temp-hot {
  animation: dn-temp-pulse 1.6s ease-in-out infinite;
}
@keyframes dn-temp-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(232,69,69,.45); }
  50%     { box-shadow: 0 0 0 4px rgba(232,69,69,0); }
}

/* Bolinhas de status na lista lateral */
.dn-state-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 4px; flex-shrink: 0;
}
.dn-state-dot-resolved { background: var(--green-500, #3f8c5b); }
.dn-state-dot-snoozed { background: #c08537; box-shadow: 0 0 4px #c08537; }

/* Menu de transferência */
.dn-transfer-menu {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); padding: 4px; z-index: 200;
}
.dn-transfer-menu button {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  background: transparent; border: 0; cursor: pointer; color: var(--text);
  font-size: 13px; border-radius: 6px;
}
.dn-transfer-menu button:hover { background: var(--bg-hover); }

/* Menu de soneca (rápido) */
.dn-snooze-menu {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); padding: 4px; z-index: 200;
  min-width: 180px;
}
.dn-snooze-menu button {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  background: transparent; border: 0; cursor: pointer; color: var(--text);
  font-size: 13px; border-radius: 6px;
}
.dn-snooze-menu button:hover { background: var(--bg-hover); }

/* Modal de encaminhar mensagem */
.dn-fwd-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
  animation: dn-fade-in .14s ease;
}
.dn-fwd-modal {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 14px; width: min(440px, 92vw); max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 50px rgba(0,0,0,.45);
  animation: dn-modal-pop .18s cubic-bezier(.2,.8,.3,1.2);
  overflow: hidden;
}
@keyframes dn-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dn-modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dn-fwd-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--border);
}
.dn-fwd-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; flex: 1; }
.dn-fwd-search-wrap {
  position: relative; padding: 10px 16px 6px;
  display: flex; align-items: center; gap: 8px;
}
.dn-fwd-search-wrap [data-icon] {
  position: absolute; left: 26px; pointer-events: none;
}
.dn-fwd-search {
  flex: 1; padding: 8px 12px 8px 32px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px; outline: none;
  transition: border-color .12s;
}
.dn-fwd-search:focus { border-color: var(--primary); }
.dn-fwd-list {
  flex: 1; overflow-y: auto;
  padding: 4px 8px 8px;
  scrollbar-width: thin;
}
.dn-fwd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer; transition: background .1s;
  margin-bottom: 2px;
}
.dn-fwd-item:hover { background: var(--bg-hover); }
.dn-fwd-item.selected { background: var(--vinho-soft); }
.dn-fwd-item input[type="checkbox"] { display: none; }
.dn-fwd-avatar {
  position: relative; width: 36px; height: 36px; border-radius: 50%;
  flex-shrink: 0; background: var(--bg-elev-2);
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; border: 1px solid var(--border);
}
.dn-fwd-avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.dn-fwd-avatar-fallback {
  width: 100%; height: 100%; display: none;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: var(--primary);
}
.dn-fwd-item-text { flex: 1; min-width: 0; }
.dn-fwd-name { font-weight: 600; font-size: 13px; color: var(--text); }
.dn-fwd-preview { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.dn-fwd-check {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  background: transparent; color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); transition: all .12s;
}
.dn-fwd-item.selected .dn-fwd-check {
  background: var(--primary); color: var(--primary-fg); border-color: var(--primary);
}
.dn-fwd-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 14px; border-top: 1px solid var(--border);
}
.dn-fwd-count { font-size: 11.5px; color: var(--text-muted); flex: 1; }

/* Skeleton loader pra lista */
.dn-fwd-skel { pointer-events: none; cursor: default; }
.dn-fwd-skel:hover { background: transparent; }
.dn-fwd-skel-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(90deg, var(--bg-elev-2) 0%, var(--bg-hover) 50%, var(--bg-elev-2) 100%);
  background-size: 200% 100%; animation: dn-skel-shimmer 1.4s linear infinite;
  flex-shrink: 0;
}
.dn-fwd-skel-line {
  display: block; height: 10px; border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-elev-2) 0%, var(--bg-hover) 50%, var(--bg-elev-2) 100%);
  background-size: 200% 100%; animation: dn-skel-shimmer 1.4s linear infinite;
  margin-bottom: 5px;
}
.dn-fwd-skel-w70 { width: 70%; }
.dn-fwd-skel-w50 { width: 50%; height: 8px; }
@keyframes dn-skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Spinner do botão */
.dn-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: dn-spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes dn-spin { to { transform: rotate(360deg); } }
#fwd-send-btn.loading .dn-fwd-send-label { display: none; }
#fwd-send-btn.loading .dn-fwd-send-spin { display: inline-flex !important; align-items: center; gap: 6px; }
#fwd-send-btn.loading .dn-fwd-send-spin::after { content: 'Enviando…'; }

/* Animação ao trocar de conv via "Encaminhar" — sai pra esquerda, entra da direita */
.dn-fwd-leaving {
  animation: dn-fwd-out .18s ease forwards;
}
.dn-fwd-entering {
  animation: dn-fwd-in .32s cubic-bezier(.2,.8,.3,1) forwards;
}
@keyframes dn-fwd-out {
  to { opacity: 0; transform: translateX(-12px); }
}
@keyframes dn-fwd-in {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Reply-block (citação) — usado tanto dentro do bubble quanto na barra acima do input */
.dn-reply-block {
  display: flex; align-items: stretch; gap: 8px;
  padding: 5px 8px; margin-bottom: 4px;
  background: rgba(0,0,0,.1); border-left: 3px solid var(--accent);
  border-radius: 5px; font-size: 11.5px; opacity: .92;
  cursor: pointer; transition: background .12s, opacity .12s;
  overflow: hidden;
}
.dn-reply-block:hover { opacity: 1; background: rgba(0,0,0,.15); }
[data-theme="dark"] .dn-reply-block { background: rgba(255,255,255,.06); }
[data-theme="dark"] .dn-reply-block:hover { background: rgba(255,255,255,.10); }
.dn-reply-thumb {
  width: 38px; height: 38px; border-radius: 4px;
  object-fit: cover; flex-shrink: 0; align-self: center;
  background: rgba(0,0,0,.15);
}
.dn-reply-thumb-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.dn-reply-text { min-width: 0; flex: 1; align-self: center; }
.dn-reply-who { font-weight: 700; font-size: 10.5px; color: var(--accent); margin-bottom: 1px; }
.dn-bubble.out .dn-reply-block { background: rgba(255,255,255,.10); border-left-color: rgba(255,255,255,.7); }
.dn-bubble.out .dn-reply-who { color: rgba(255,255,255,.85); }
.dn-bubble.out .dn-reply-thumb-icon { color: rgba(255,255,255,.85); }

/* Flash quando vc clica num reply pra rolar até a msg original */
.dn-msg-flash {
  animation: dn-msg-flash 1.6s ease;
}
@keyframes dn-msg-flash {
  0%   { box-shadow: 0 0 0 0 rgba(168,200,232,.0), 0 0 0 0 rgba(168,200,232,.0); }
  20%  { box-shadow: 0 0 0 3px rgba(168,200,232,.55), 0 0 14px 4px rgba(168,200,232,.45); }
  100% { box-shadow: 0 0 0 0 rgba(168,200,232,.0), 0 0 0 0 rgba(168,200,232,.0); }
}

/* Lightbox de imagem */
.dn-lb-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: dn-lb-fade .12s ease;
}
@keyframes dn-lb-fade { from { opacity: 0; } to { opacity: 1; } }
.dn-lb-img {
  max-width: 92vw; max-height: 92vh;
  user-select: none; -webkit-user-drag: none;
  transition: transform .12s ease;
  transform-origin: center center;
  cursor: zoom-in;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.dn-lb-toolbar {
  position: absolute; top: 14px; right: 14px;
  display: flex; gap: 6px; z-index: 1;
}
.dn-lb-toolbar button {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.dn-lb-toolbar button:hover { background: rgba(255,255,255,.22); }
.dn-lb-toolbar button [data-icon] { width: 16px; height: 16px; }

/* Nota interna — paleta vinho do CRM (substitui post-it amarelo) */
.dn-bubble.internal {
  background: var(--vinho-soft) !important;
  border: 1px dashed var(--primary) !important;
  color: var(--text) !important;
  border-bottom-right-radius: 4px;
}
.dn-bubble.internal .dn-msg-status { display: none !important; }
.dn-bubble.internal .when { color: var(--text-muted) !important; }
.dn-bubble.internal .dn-note-tag { color: var(--primary) !important; }

/* Modo nota: barra de aviso acima do input + estilo do textarea */
.dn-note-mode-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 12px; font-weight: 600;
  background: var(--vinho-soft); color: var(--primary);
  border-top: 1px solid var(--border);
}
.dn-note-mode-bar .dn-note-mode-off {
  margin-left: auto; background: transparent; border: 0; cursor: pointer;
  font-size: 11px; font-weight: 700; color: inherit; text-decoration: underline;
}
body.note-mode #note-btn { color: var(--primary); background: var(--vinho-soft); }
body.note-mode .dn-chat-input textarea {
  background: var(--vinho-soft); border-color: var(--primary); color: var(--text);
}
body.note-mode .dn-btn-send {
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
body.note-mode .dn-btn-send:hover { background: var(--primary-hover); }

/* Switch mobile pro toggle IA */
.dn-ia-switch {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 6px; height: 38px; cursor: pointer;
  user-select: none; flex-shrink: 0;
}
.dn-ia-switch input { display: none; }
.dn-ia-track {
  position: relative; display: inline-block;
  width: 38px; height: 20px; border-radius: 999px;
  background: var(--border); transition: background .2s;
}
.dn-ia-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .2s, background .2s;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.dn-ia-thumb svg { opacity: .6; transition: opacity .2s; }
.dn-ia-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  letter-spacing: .5px; transition: color .2s;
}
.dn-ia-switch.on .dn-ia-track {
  background: linear-gradient(135deg, var(--primary), var(--vinho-300));
  box-shadow: 0 0 8px rgba(122,31,43,.4);
}
.dn-ia-switch.on .dn-ia-thumb {
  transform: translateX(18px);
  color: var(--primary);
}
.dn-ia-switch.on .dn-ia-thumb svg { opacity: 1; }
.dn-ia-switch.on .dn-ia-label { color: var(--primary); }

/* Botão enviar circular */
.dn-btn-send {
  background: var(--primary); color: var(--primary-fg); border: 0; cursor: pointer;
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .12s, transform .12s;
  box-shadow: 0 2px 8px rgba(122,31,43,.35);
}
.dn-btn-send:hover { background: var(--vinho-500, #993a48); transform: scale(1.06); }
.dn-btn-send:active { transform: scale(.94); }

/* Animação IA polindo */
.dn-bubble.ia-working {
  animation: dn-ia-shimmer 1.6s ease-in-out infinite;
  position: relative;
}
.dn-bubble.ia-working::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: dn-ia-sweep 1.6s linear infinite;
}
@keyframes dn-ia-shimmer {
  0%, 100% { box-shadow: 0 0 0 1px transparent; }
  50%      { box-shadow: 0 0 0 1px var(--vinho-300), 0 0 18px rgba(210,139,148,.45); }
}
@keyframes dn-ia-sweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.dn-ia-working {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--vinho-300);
  letter-spacing: .2px;
}
.dn-ia-spark {
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--vinho-300) 60%, transparent 100%);
  animation: dn-spark-pulse 1s ease-in-out infinite;
  box-shadow: 0 0 6px var(--vinho-300);
}
@keyframes dn-spark-pulse {
  0%, 100% { transform: scale(.7); opacity: .6; }
  50%      { transform: scale(1.15); opacity: 1; }
}

.dn-chat-side { background: var(--bg-elev); border-left: 1px solid var(--border); overflow-y: auto; padding: 16px; }
.dn-copilot-suggestion {
  background: linear-gradient(135deg, var(--vinho-soft), var(--accent-soft));
  border: 1px solid var(--accent-soft); border-radius: var(--radius-sm); padding: 12px;
  position: relative;
}
.dn-copilot-suggestion .ai-tag {
  position: absolute; top: -8px; left: 12px;
  background: var(--primary); color: var(--primary-fg); font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .04em;
}

/* ---------- Toggles ---------- */
.dn-switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.dn-switch input { opacity: 0; width: 0; height: 0; }
.dn-switch span {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 999px; transition: .2s;
}
.dn-switch span::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 2px; top: 2px;
  background: var(--text-muted); border-radius: 50%; transition: .2s;
}
.dn-switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.dn-switch input:checked + span::before { transform: translateX(16px); background: #fff; }

/* ---------- Toasts ---------- */
.dn-toast-stack { position: fixed; top: 16px; right: 16px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.dn-toast {
  background: var(--bg-elev-2); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-2);
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  animation: slidein .25s ease;
}
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---------- Public / Landing ---------- */
.dn-hero {
  position: relative; padding: 90px 0 60px;
  background: radial-gradient(1100px 600px at 80% -10%, rgba(122,31,43,.22), transparent 60%),
              radial-gradient(800px 400px at 0% 110%, rgba(168,200,232,.12), transparent 60%);
}
.dn-hero h1 {
  font-size: 56px; line-height: 1.05; letter-spacing: -.025em; font-weight: 800; margin: 0 0 18px;
  background: linear-gradient(180deg, var(--text), var(--text-muted));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dn-hero .lead { font-size: 18px; color: var(--text-muted); max-width: 620px; line-height: 1.55; }
.dn-hero .pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
  background: var(--vinho-soft); border: 1px solid var(--vinho-soft); color: var(--primary);
  font-size: 12px; font-weight: 600; letter-spacing: .02em; margin-bottom: 18px;
}
.dn-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding: 40px 0;
}
.dn-feature {
  padding: 22px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); transition: all .2s;
}
.dn-feature:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.dn-feature .ico {
  width: 38px; height: 38px; border-radius: 10px; background: var(--vinho-soft);
  display: inline-flex; align-items: center; justify-content: center; color: var(--primary); margin-bottom: 12px;
}
.dn-feature h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.dn-feature p { margin: 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.55; }

/* ---------- Login (premium) ---------- */
.dn-login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.dn-login-side {
  background: linear-gradient(135deg, var(--vinho-700) 0%, var(--vinho-900) 70%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.dn-login-side::before {
  content: ""; position: absolute; inset: -50%;
  background: radial-gradient(closest-side, rgba(168,200,232,.18), transparent 60%),
              radial-gradient(closest-side at 80% 90%, rgba(255,255,255,.06), transparent 60%);
  pointer-events: none;
}
.dn-login-form {
  display: flex; align-items: center; justify-content: center; padding: 40px;
  background: var(--bg);
}
.dn-login-card {
  width: 100%; max-width: 420px; padding: 36px;
}
.dn-login-card h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.dn-login-card p.lead { color: var(--text-muted); margin: 0 0 24px; font-size: 14px; }
@media (max-width: 900px) {
  .dn-login-wrap { grid-template-columns: 1fr; }
  .dn-login-side { display: none; }
}

/* ---------- Misc ---------- */
.dn-empty {
  padding: 40px 20px; text-align: center; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.kbd { font-family: 'JetBrains Mono', monospace; font-size: 11px;
  padding: 2px 6px; border-radius: 4px; background: var(--bg-elev-2); border: 1px solid var(--border); }

/* ============== RESPONSIVO ============== */

/* Tablet (≤ 1024px) */
@media (max-width: 1024px) {
  .dn-app { grid-template-columns: 64px 1fr; }
  .dn-sidebar .sidebar-label,
  .dn-sidebar .dn-nav-section,
  .dn-sidebar-brand .name,
  .dn-sidebar-brand .sub { display: none; }
  .dn-nav-link { justify-content: center; padding: 10px 0; }
  .dn-sidebar-brand { justify-content: center; padding: 8px 0 14px; }
  [data-sidebar="collapsed"] .dn-app { grid-template-columns: 64px 1fr; }
  .dn-chat { grid-template-columns: 280px 1fr; }
  .dn-chat-side { display: none; }
  .dn-hero h1 { font-size: 42px; }
  .dn-hero { padding: 60px 0 40px; }
  .dn-content { padding: 18px; }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
  body { font-size: 13.5px; }
  .dn-container { padding: 0 16px; }

  /* Sidebar vira drawer */
  .dn-app { grid-template-columns: 1fr; }
  .dn-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 240px;
    z-index: 100; transform: translateX(-100%); transition: transform .2s;
    box-shadow: var(--shadow-3);
  }
  [data-sidebar="open"] .dn-sidebar { transform: translateX(0); }
  [data-sidebar="open"]::after {
    content:""; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:90;
  }
  .dn-sidebar .sidebar-label,
  .dn-sidebar .dn-nav-section,
  .dn-sidebar-brand .name,
  .dn-sidebar-brand .sub { display: revert; }
  .dn-sidebar-brand .name { display: block; }
  .dn-nav-link { justify-content: flex-start; padding: 8px 10px; }
  .dn-sidebar-brand { justify-content: flex-start; }

  .dn-topbar { height: 56px; padding: 0 14px; gap: 8px; }
  .dn-topbar h1 { font-size: 14.5px; }
  .dn-content { padding: 14px; }

  /* Hero */
  .dn-hero { padding: 48px 0 30px; }
  .dn-hero h1 { font-size: 30px; line-height: 1.1; }
  .dn-hero .lead { font-size: 15px; }

  /* Features grid: 1 coluna */
  .dn-features { grid-template-columns: 1fr; }

  /* Diferenciais: 1 coluna */
  #diferenciais > div, #planos > div, #features > div { grid-template-columns: 1fr !important; }

  /* Login: empilha (sidebar some) */
  .dn-login-wrap { grid-template-columns: 1fr; }
  .dn-login-side { display: none; }
  .dn-login-card { padding: 24px; }
  .dn-login-card h2 { font-size: 22px; }

  /* Tabela rolante */
  .dn-table { font-size: 12.5px; }
  .dn-table th, .dn-table td { padding: 8px 6px; }
  .dn-card-pad { padding: 14px; }

  /* Kanban: deixa scroll horizontal natural, colunas mais estreitas */
  .dn-column { flex: 0 0 280px; }

  /* Chat: 1 coluna por vez (lista OU window) */
  .dn-chat { grid-template-columns: 1fr; height: calc(100vh - 56px); margin: -14px !important; }
  .dn-chat-list { display: none; }
  .dn-chat-side { display: none; }
  [data-chat-view="list"] .dn-chat-list { display: block; }
  [data-chat-view="list"] .dn-chat-window { display: none; }

  /* Header público */
  .dn-hero h1 { background-size: 100% 100%; }
  header nav { gap: 14px !important; }
  header nav a:not(.dn-btn) { display: none; }

  /* Forms em grid 2-col viram 1-col */
  form > div[style*="grid-template-columns:1fr 1fr"],
  form > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile pequeno (≤ 480px) */
@media (max-width: 480px) {
  .dn-hero h1 { font-size: 26px; }
  .dn-btn { padding: 8px 12px; font-size: 13px; }
  .dn-btn-lg { padding: 11px 18px; font-size: 14px; }
}

/* ===== Bulk selection (kanban + leads list) ===== */
.dn-bulk-item { position: relative; }
.dn-bulk-item .dn-bulk-cb {
  position: absolute; top: 6px; left: 6px;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 4px; opacity: 0; transition: opacity .15s;
  z-index: 2; cursor: pointer;
}
.dn-bulk-item:hover .dn-bulk-cb,
.dn-bulk-item.selected .dn-bulk-cb { opacity: 1; }
.dn-bulk-item .dn-bulk-cb input {
  width: 14px; height: 14px; margin: 0; cursor: pointer;
  accent-color: var(--primary);
}
.dn-bulk-item.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: var(--vinho-soft) !important;
}
tr.dn-bulk-item .dn-bulk-cb {
  position: static; opacity: 1; display: inline-flex;
  background: transparent; border: 0;
}

.dn-bulkbar {
  position: fixed; left: 50%; bottom: 18px;
  transform: translateX(-50%) translateY(180%);
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px; border-radius: 14px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0,0,0,0.38), 0 4px 14px rgba(0,0,0,0.22);
  z-index: 9999; transition: transform .25s cubic-bezier(.2,.8,.3,1);
  max-width: calc(100vw - 32px); flex-wrap: nowrap; overflow-x: auto;
  scrollbar-width: thin;
}
.dn-bulkbar.active { transform: translateX(-50%) translateY(0); }
.dn-bulkbar::-webkit-scrollbar { height: 4px; }
.dn-bulkbar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.dn-bulkbar .dn-btn {
  white-space: nowrap; flex-shrink: 0;
  padding: 6px 10px; font-size: 12.5px; line-height: 1;
  gap: 5px; border-radius: 8px;
}
.dn-bulkbar .dn-btn [data-icon] {
  width: 13px; height: 13px; font-size: 13px;
}
.dn-bulkbar-count {
  font-size: 12px; color: var(--text);
  padding: 0 10px 0 6px; white-space: nowrap; flex-shrink: 0;
  border-right: 1px solid var(--border);
  margin-right: 4px;
}
.dn-bulkbar-count b {
  color: var(--primary); font-weight: 700;
  font-size: 14px; margin-right: 3px;
}
.dn-bulkbar-sep {
  width: 1px; height: 18px; background: var(--border);
  flex-shrink: 0; margin: 0 2px;
}
.dn-bulkbar-danger { color: var(--red-500) !important; }
.dn-bulkbar-danger:hover { background: rgba(220,40,40,0.12); }

@media (max-width: 720px) {
  .dn-bulkbar { left: 8px; right: 8px; transform: translateY(180%); width: auto; }
  .dn-bulkbar.active { transform: translateY(0); }
  .dn-bulkbar .dn-btn span:not([data-icon]) { display: none; }
  .dn-bulkbar .dn-btn { padding: 8px; }
}

.dn-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
}
.dn-modal {
  width: min(560px, 92vw); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  display: flex; flex-direction: column; overflow: hidden;
}
.dn-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.dn-modal-body { padding: 12px 16px; }

/* Chips de filtros salvos */
.dn-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 12px;
  cursor: pointer; line-height: 1.4;
  transition: background .12s, border-color .12s;
}
.dn-chip:hover { background: var(--bg-hover); }
.dn-chip.active { background: var(--vinho-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.dn-chip-x {
  background: transparent; border: 0; padding: 0; margin-left: 2px;
  color: var(--text-muted); font-size: 14px; cursor: pointer; line-height: 1;
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.dn-chip-x:hover { background: var(--red-500); color: white; }

/* ===== Cmd+K palette ===== */
.dn-cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: none; z-index: 10000;
  align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  backdrop-filter: blur(2px);
}
.dn-cmdk-overlay.active { display: flex; }
.dn-cmdk {
  width: min(640px, 92vw);
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.dn-cmdk-search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.dn-cmdk-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 16px; font-family: inherit;
}
.dn-cmdk-esc {
  font-size: 10px; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; background: var(--bg-elev-2);
}
.dn-cmdk-results { overflow-y: auto; padding: 6px 0; }
.dn-cmdk-section {
  padding: 8px 16px 4px;
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600;
}
.dn-cmdk-hint, .dn-cmdk-empty {
  padding: 12px 16px; color: var(--text-muted); font-size: 13px;
}
.dn-cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; text-decoration: none; color: var(--text);
  cursor: pointer;
}
.dn-cmdk-item.active { background: var(--vinho-soft); }
.dn-cmdk-icon {
  width: 16px; height: 16px; font-size: 16px;
  color: var(--text-muted); flex-shrink: 0;
}
.dn-cmdk-item.active .dn-cmdk-icon { color: var(--primary); }
.dn-cmdk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dn-cmdk-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-cmdk-subtitle { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-cmdk-enter { opacity: 0; }
.dn-cmdk-item.active .dn-cmdk-enter { opacity: 1; }
.dn-cmdk-foot {
  border-top: 1px solid var(--border); padding: 8px 16px;
  font-size: 10.5px; color: var(--text-muted);
  display: flex; gap: 16px; align-items: center;
}
.dn-cmdk kbd {
  font-family: inherit; font-size: 10px;
  border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 5px; background: var(--bg-elev-2);
  margin: 0 2px;
}

/* ===== Calendário (mês) ===== */
.dn-cal-day {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 6px 4px;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 96px; cursor: pointer;
  transition: background .12s;
}
.dn-cal-day:hover { background: var(--bg-hover); }
.dn-cal-day:nth-child(7n) { border-right: 0; }
.dn-cal-day.dim { background: rgba(0,0,0,0.04); opacity: 0.65; }
[data-theme="dark"] .dn-cal-day.dim { background: rgba(255,255,255,0.02); }
.dn-cal-day.today { background: var(--vinho-soft); }

.dn-cal-task {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 5px; border-radius: 4px;
  font-size: 11px; line-height: 1.3;
  background: var(--bg-elev-2); border-left: 2px solid var(--text-muted);
  cursor: pointer; overflow: hidden;
}
.dn-cal-task:hover { background: var(--bg-hover); }
.dn-cal-task.task    { border-left-color: var(--text-muted); }
.dn-cal-task.call    { border-left-color: #2c8a4a; background: rgba(44,138,74,0.10); }
.dn-cal-task.meeting { border-left-color: #2266cc; background: rgba(34,102,204,0.10); }
.dn-cal-task.followup{ border-left-color: var(--primary); background: rgba(122,31,43,0.12); }
.dn-cal-task.done {
  opacity: 0.5; text-decoration: line-through;
}
.dn-cal-time {
  font-size: 10px; color: var(--text-muted); flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.dn-cal-title {
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ===== Notas privadas no painel do lead ===== */
.lead-note {
  border-left: 3px solid var(--primary);
  padding: 8px 12px; margin-bottom: 8px;
  background: var(--bg-elev-2); border-radius: 6px;
}
.lead-note-body {
  font-size: 13px; line-height: 1.45; color: var(--text);
  white-space: pre-wrap; word-wrap: break-word;
}
.lead-note-body.editing {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
  background: var(--bg-elev);
  padding: 4px;
}
.lead-note-foot {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; font-size: 11px; color: var(--text-muted);
}
.lead-note-foot .dn-avatar { background: var(--primary); color: #fff; }
.lead-note:hover .lead-note-edit,
.lead-note:hover .lead-note-del { opacity: 1; }
.lead-note-edit, .lead-note-del { opacity: 0; transition: opacity .12s; }

/* ===== Intent chip nas bolhas inbound ===== */
.dn-intent-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px; border-radius: 999px;
  font-size: 9.5px; font-weight: 600; line-height: 1.5;
  background: rgba(122,31,43,0.13); color: var(--primary);
  border: 1px solid rgba(122,31,43,0.25);
  cursor: pointer; margin-left: 4px;
  transition: background .12s;
}
.dn-intent-chip:hover { background: rgba(122,31,43,0.22); }
.dn-intent-chip::before { content: "💡"; font-size: 9px; margin-right: 1px; }
.dn-intent-chip[data-intent="complaint"] {
  background: rgba(220,40,40,0.10); color: #d92020;
  border-color: rgba(220,40,40,0.25);
}
.dn-intent-chip[data-intent="complaint"]::before { content: "⚠"; }

/* ===== Agendamento de mensagem (painel topo do chat) ===== */
.dn-sched-panel {
  background: var(--vinho-soft);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 12px;
}
.dn-sched-head {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  cursor: pointer; user-select: none;
  color: var(--text);
}
.dn-sched-head strong { font-weight: 600; font-size: 12.5px; }
.dn-sched-toggle { transition: transform .18s; }
.dn-sched-panel.collapsed .dn-sched-toggle { transform: rotate(-90deg); }
.dn-sched-panel.collapsed .dn-sched-list { display: none; }
.dn-sched-list {
  max-height: 180px; overflow-y: auto;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.dn-sched-item {
  display: grid;
  grid-template-columns: 110px 1fr 28px;
  gap: 8px; align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.dn-sched-item:last-child { border-bottom: 0; }
.dn-sched-item:hover { background: var(--bg-elev-2); }
.dn-sched-time {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--primary); font-weight: 600; font-size: 11.5px;
  white-space: nowrap;
}
.dn-sched-body {
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dn-sched-cancel { padding: 3px; }
.dn-sched-cancel:hover { background: rgba(220,40,40,.12); }

/* ===== Sub-navegação de páginas consolidadas (tabs no topo) ===== */
.dn-subnav {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: -8px 0 18px; padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
}
.dn-subnav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px 8px 0 0;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .12s, border-color .12s, background .12s;
}
.dn-subnav a:hover { color: var(--text); background: var(--bg-elev-2); }
.dn-subnav a.active {
  color: var(--primary); font-weight: 600;
  border-bottom-color: var(--primary);
  background: transparent;
}
.dn-subnav a [data-icon] { width: 13px; height: 13px; }

/* Pill da sub-aba "Não lidas" — usa azul-bebê (accent) pra distinguir de waiting (vermelho) */
.dn-state-count.dn-state-unread { background: rgba(122,31,43,.15); color: var(--primary); font-weight: 600; }
[data-theme="dark"] .dn-state-count.dn-state-unread { background: rgba(168,200,232,.18); color: #a8c8e8; }
.dn-state-tab.active .dn-state-count.dn-state-unread { background: var(--primary); color: #fff; }
[data-theme="dark"] .dn-state-tab.active .dn-state-count.dn-state-unread { background: #a8c8e8; color: #1a1a1f; }

/* Switch mobile-style "Só não lidas" ao lado da busca */
.dn-unread-switch {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; cursor: pointer;
  font-size: 12px; color: var(--text-muted);
  padding: 4px 2px; user-select: none;
  transition: color .12s;
}
.dn-unread-switch:hover { color: var(--text); }
.dn-unread-switch-track {
  position: relative; display: inline-block;
  width: 32px; height: 18px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background .18s, border-color .18s;
  flex-shrink: 0;
}
.dn-unread-switch-thumb {
  position: absolute; top: 1px; left: 1px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
  transition: transform .18s, background .18s;
}
.dn-unread-switch.on .dn-unread-switch-track {
  background: var(--primary); border-color: var(--primary);
}
.dn-unread-switch.on .dn-unread-switch-thumb { transform: translateX(14px); }
.dn-unread-switch.on .dn-unread-switch-label { color: var(--text); font-weight: 600; }
.dn-unread-switch-label { font-weight: 500; }
.dn-unread-switch .dn-unread-count {
  background: var(--primary); color: #fff;
  padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  min-width: 18px; text-align: center;
  margin-left: auto;
}
