/* CRM Sirius — stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e2e4ec;
  --muted: #8b8fa8;
  --accent: #6366f1;
  --accent-h: #4f52cc;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 10px;
  --sidebar-w: 520px;   /* deal detail panel */
  --sb-w: 240px;        /* nav sidebar expanded */
  --sb-w-col: 52px;     /* nav sidebar collapsed */
}

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
}

/* ── Scrollbar global (fina e discreta em todo o sistema) ── */
* { scrollbar-width: thin; scrollbar-color: rgba(140,180,220,.22) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(140,180,220,.20);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(140,180,220,.38); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
/* Mata as setas ▲▼ nativas do Windows (senão a barra vira aquela grossa com botões) */
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* ── Utils ───────────────────────────────────────────── */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.act-recent { color: #22c55e; font-size: 12px; }
.act-warn   { color: #f59e0b; font-size: 12px; }
.act-old    { color: #ef4444; font-size: 12px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.ml-auto { margin-left: auto; }

/* ── Buttons ─────────────────────────────────────────── */
button { cursor: pointer; border: none; font-size: 13px; border-radius: 6px; transition: opacity .15s; }
button:hover { opacity: .85; }
.btn-primary { background: var(--grad-primary, var(--accent)); color: var(--bg-deep, #04090F); padding: 9px 16px; font-weight: 700; border-radius: 10px; font-family: var(--ff-display, inherit); }
.btn-ghost { background: var(--sd-raise); color: var(--text-secondary, var(--text)); padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; font-weight: 500; }
.btn-ghost:hover { color: var(--text); border-color: var(--sd-border-2); opacity: 1; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-danger { background: var(--red); color: #fff; padding: 8px 13px; border-radius: 10px; }

/* ── Form inputs v2 ──────────────────────────────────── */
input, textarea, select {
  background: var(--bg-2, var(--bg));
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 13.5px;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: rgba(0,246,245,.5); box-shadow: 0 0 0 3px rgba(0,246,245,.08); }
input::placeholder, textarea::placeholder { color: var(--txt-3, var(--muted)); }
select { cursor: pointer; }
select option { background: var(--surface); }
label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-secondary, var(--muted)); font-weight: 500; }
.form-group { margin-bottom: 16px; }
.contact-highlight {
  display: flex; flex-direction: column; gap: 2px; background: var(--surface);
  border: 1px solid var(--accent); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px;
}
.contact-highlight .ch-name { font-size: 15px; font-weight: 700; }
.contact-highlight .ch-hint { font-size: 11px; color: var(--muted); }

/* ── Login ───────────────────────────────────────────── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100%; background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%; max-width: 380px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 36px; }
.login-logo span { font-size: 20px; font-weight: 700; color: var(--text); }
.login-error { color: var(--red); font-size: 12px; margin-bottom: 12px; }

/* ── App layout ──────────────────────────────────────── */
#app {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* ── Sidebar vertical ────────────────────────────────── */
#sidebar {
  width: var(--sb-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width .2s ease;
  overflow: hidden;
  z-index: 5;
}

#sidebar.collapsed { width: var(--sb-w-col); }

/* When collapsed: hide text elements */
#sidebar.collapsed .sb-label,
#sidebar.collapsed .sb-ws-btn,
#sidebar.collapsed .sb-user-email { display: none; }

/* Collapsed header: center the toggle */
#sidebar.collapsed .sb-header { flex-direction: column; gap: 8px; align-items: center; padding: 12px 0; }
#sidebar.collapsed .sb-brand { display: none; }
#sidebar.collapsed .sb-item { justify-content: center; padding: 12px 0; }
#sidebar.collapsed .sb-footer { align-items: center; }

/* sb-header */
.sb-header {
  padding: 14px 12px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}

.sb-brand { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.sb-logo { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.sb-logo span { color: var(--accent); }

.sb-ws-btn {
  font-size: 11px; color: var(--muted); background: var(--bg);
  border: 1px solid var(--border); border-radius: 4px; padding: 3px 7px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 150px; text-align: left;
}
.sb-ws-btn:hover { color: var(--text); opacity: 1; }

.sb-toggle {
  position: absolute; top: 14px; right: 12px; /* fora do fluxo: libera a largura toda pro nome do workspace */
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0; padding: 0; line-height: 0;
  background: rgba(140,180,220,.05); border: 1px solid var(--border); color: var(--muted);
  border-radius: 9px; cursor: pointer;
  transition: transform .2s, color .15s, border-color .15s, background .15s;
}
.sb-toggle svg { width: 15px; height: 15px; }
.sb-toggle:hover { color: var(--cyan, var(--accent)); border-color: rgba(0,246,245,.35); background: rgba(0,246,245,.06); opacity: 1; }
#sidebar.collapsed .sb-toggle { transform: rotate(180deg); }

/* ── Dropdown de troca de workspace (ancorado abaixo do botão, não tela cheia) ── */
#sidebar .sb-header { position: relative; }
.sb-ws-caret { transition: transform .18s; }
.sb-ws-btn.open .sb-ws-caret { transform: rotate(180deg); }
.ws-dd {
  position: absolute; top: calc(100% + 6px); left: 12px; right: 12px; z-index: 60;
  background: var(--surface); border: 1px solid var(--sd-border-2, var(--border)); border-radius: 13px;
  padding: 7px; box-shadow: 0 20px 50px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 3px;
}
.ws-dd.hidden { display: none; }
.ws-dd-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: background .12s, border-color .12s; }
.ws-dd-item:hover { background: rgba(140,180,220,.06); }
.ws-dd-item.active { background: linear-gradient(90deg, rgba(0,246,245,.12), rgba(210,78,255,.05) 75%, transparent); border-color: rgba(0,246,245,.25); }
.ws-dd-av { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--grad-primary, var(--accent));
  display: flex; align-items: center; justify-content: center; font-family: var(--ff-display, inherit); font-weight: 700; font-size: 13px; color: var(--bg-deep, #05090F); }
.ws-dd-main { min-width: 0; flex: 1; }
.ws-dd-name { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-dd-role { font-size: 11px; color: var(--muted); margin-top: 1px; }
.ws-dd-check { width: 16px; height: 16px; flex-shrink: 0; color: var(--cyan, var(--accent)); }
.ws-dd-sep { height: 1px; background: var(--sd-hair, var(--border)); margin: 4px 6px; }
.ws-dd-new { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 600; width: 100%; text-align: left; }
.ws-dd-new svg { width: 16px; height: 16px; }
.ws-dd-new:hover { color: var(--cyan, var(--accent)); background: rgba(0,246,245,.06); }

/* Esconde o X nativo do input[type=search] (mantém o visual do campo) */
.contacts-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* sb-nav */
.sb-nav { flex: 1; padding: 6px 0; overflow-y: auto; overflow-x: hidden; }

.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  width: 100%; background: none; border: none;
  color: var(--muted); text-align: left; font-size: 13px;
  cursor: pointer; white-space: nowrap;
  border-radius: 0; transition: background .1s, color .1s;
}
.sb-item:hover { background: rgba(255,255,255,.04); color: var(--text); opacity: 1; }
.sb-item.active { color: var(--text); background: rgba(99,102,241,.12); }
.sb-item.active .sb-icon { filter: none; }

.sb-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.sb-label { flex: 1; }

/* sb-footer */
.sb-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0;
}

.sb-user-email {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sb-logout, .sb-refresh {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px; width: 100%; background: none; border: none;
  color: var(--muted); text-align: left; font-size: 12px; cursor: pointer;
  white-space: nowrap; transition: color .1s;
}
.sb-logout:hover { color: var(--text); opacity: 1; }
.sb-refresh:hover { color: #60a5fa; }
#sidebar.collapsed .sb-refresh .sb-label { display: none; }

/* ── Main content ────────────────────────────────────── */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* View header (Conversas title) */
.view-header {
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.view-title { font-size: 16px; font-weight: 700; }

/* Main toolbar */
#main-toolbar {
  padding: 14px 20px;
  display: flex; gap: 12px; align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}
/* Cabeçalho da pipeline v2 */
.pl-sel { display: inline-flex; align-items: center; gap: 9px; }
.pl-lbl { font-size: 12px; color: var(--muted); }
.pl-dd { position: relative; }
.pl-dd-btn { display: inline-flex; align-items: center; gap: 9px; background: var(--sd-raise); border: 1px solid var(--sd-border-2, var(--border)); border-radius: 11px; color: var(--text); font-family: var(--ff-display, inherit); font-weight: 600; font-size: 13px; padding: 9px 12px; cursor: pointer; }
.pl-dd-btn svg { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.pl-dd-btn.open svg { transform: rotate(180deg); }
.pl-dd-btn:hover { border-color: var(--accent); }
.pl-dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 200; min-width: 210px; background: var(--surface); border: 1px solid var(--sd-border-2, var(--border)); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.pl-dd-menu.hidden { display: none; }
.pl-dd-opt { padding: 9px 11px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap; }
.pl-dd-opt:hover { background: var(--sd-raise); }
.pl-dd-opt.sel { color: var(--accent); background: rgba(0,246,245,.08); }
#board { gap: 16px; padding-bottom: 20px; }

/* ── Kanban ──────────────────────────────────────────── */
#board-container { overflow-x: auto; padding: 20px; flex: 1; overflow-y: auto; }
#board { display: flex; gap: 14px; min-height: calc(100vh - 100px); align-items: flex-start; }

.kanban-col {
  background: var(--bg-2, #070E17);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 290px; min-width: 290px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 110px);
}
.kanban-col.drag-over { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.col-header {
  padding: 14px 15px 12px;
  display: flex; align-items: center; gap: 9px;
  border-bottom: 1px solid var(--sd-hair);
  position: sticky; top: 0; background: var(--bg-2, #070E17); z-index: 1;
  border-radius: 16px 16px 0 0;
}
.col-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.col-name { font-weight: 700; font-size: 13.5px; }
.col-name-input {
  font-family: var(--ff-display, inherit); font-weight: 700; font-size: 13.5px; color: inherit;
  background: transparent; border: 1px solid transparent; border-radius: 5px;
  padding: 2px 5px; min-width: 0; width: auto; flex: 0 1 auto;
}
.col-name-input:hover { border-color: rgba(255,255,255,.12); }
.col-name-input:focus { background: rgba(255,255,255,.06); border-color: var(--accent); outline: none; }
.col-count { font-size: 11px; font-weight: 700; color: var(--text-secondary, var(--text)); background: var(--sd-raise-2); border-radius: 99px; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; flex-shrink: 0; }
.col-sp { flex: 1; }
.col-total { font-size: 12px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: 2px; }
.col-select-all { flex-shrink: 0; }
.col-move-all { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px 3px; border-radius: 4px; opacity: .6; display: inline-flex; align-items: center; flex-shrink: 0; transition: opacity .12s, color .12s; }
.col-move-all:hover { opacity: 1; color: var(--text); }

.col-cards { padding: 11px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.col-add { padding: 2px 11px 12px; }
.col-add button { width: 100%; background: transparent; border: 1px dashed var(--sd-border-2, var(--border)); color: var(--muted); padding: 9px; font-size: 12px; border-radius: 10px; cursor: pointer; }
.col-add button:hover { border-color: var(--accent); color: var(--accent); }

/* ── Deal card v2 ────────────────────────────────────── */
.deal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px 13px 11px;
  cursor: grab;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.deal-card::before { content: ''; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cf, var(--accent)); }
.deal-card:hover { transform: translateY(-2px); border-color: rgba(0,246,245,.3); box-shadow: 0 10px 26px rgba(0,0,0,.4); }
.deal-card.dragging { opacity: .4; cursor: grabbing; }

.dc-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.dc-av { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--ff-display, inherit); font-weight: 700; font-size: 11px; color: var(--bg-deep, #04090F); }
.dc-av.av-g1 { background: linear-gradient(135deg,#00F6F5,#0EA399); }
.dc-av.av-g2 { background: linear-gradient(135deg,#D24EFF,#B66FFF); }
.dc-av.av-g3 { background: linear-gradient(135deg,#B66FFF,#00F6F5); }
.dc-av.av-g4 { background: linear-gradient(135deg,#3DE1B0,#00F6F5); }
.dc-who { min-width: 0; flex: 1; }
.dc-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-sub { font-size: 11px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-val { font-family: var(--ff-display, inherit); font-size: 15px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; margin-bottom: 9px; }
.dc-val.none { color: var(--muted); font-size: 12px; font-weight: 500; font-style: italic; font-family: var(--ff-body, inherit); }
.dc-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.dc-tag { font-size: 10px; color: var(--text-secondary, var(--text)); background: var(--sd-raise-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }
.dc-tag.meta { color: var(--accent); background: rgba(0,246,245,.08); border-color: rgba(0,246,245,.2); }
.dc-foot { display: flex; align-items: center; gap: 8px; padding-top: 9px; border-top: 1px solid var(--sd-hair); }
.dc-resp { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary, var(--text)); min-width: 0; }
.dc-resp-av { width: 19px; height: 19px; border-radius: 50%; background: var(--sd-raise-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.dc-resp.none { color: var(--muted); font-style: italic; }
.dc-foot-r { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dc-time { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.dc-time svg { width: 11px; height: 11px; }
.dc-time.warn { color: var(--amber, #FFB84D); }

.deal-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.deal-company { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.deal-company.dc-blank, .deal-value.dc-blank { opacity: .55; font-style: italic; font-weight: 400; }
.deal-phone { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.deal-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.deal-tags .tag { font-size: 10px; padding: 1px 5px; }
.deal-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.deal-value { font-size: 11px; color: var(--green); font-weight: 600; }
.deal-resp { font-size: 11px; color: var(--muted); background: var(--surface); border-radius: 4px; padding: 1px 5px; }

/* CRM-04: card enriquecido */
.deal-card { position: relative; }
.deal-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.deal-card .deal-value { font-size: 12px; margin-bottom: 6px; }
.deal-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); padding-top: 7px; margin-top: 7px; }
.deal-av { width: 20px; height: 20px; border-radius: 50%; background: var(--grad-primary, var(--accent)); color: var(--bg-deep, #fff); font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.deal-foot .deal-resp { background: transparent; padding: 0; }
.deal-resp-empty { font-style: italic; opacity: .7; }
.deal-foot-r { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.deal-time { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.deal-time.warn { color: var(--amber, #f59e0b); }
.deal-unread { background: var(--red, #ef4444); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* Rodapé de ações rápidas do card (conversa, mover, tag, excluir) */
.deal-actions { display: flex; align-items: center; gap: 3px; margin-top: 8px; }
.da-btn {
  background: none; border: none; color: var(--txt-3, var(--muted)); padding: 5px; border-radius: 7px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .12s, background .12s;
}
.da-btn svg { width: 14px; height: 14px; }
.da-btn:hover { color: var(--cyan, var(--accent)); background: rgba(255,255,255,.06); }
.da-btn-danger:hover { color: var(--red, #ef4444); }
.da-btn:disabled { opacity: .35; cursor: not-allowed; }
.quick-move-pop {
  position: fixed; z-index: 999; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.quick-move-pop select { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 8px; font-size: 12px; }

/* CRM-02: abas do painel do deal */
.dp-tabs-wrap { padding-top: 4px; }
.dp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.dp-tab { flex: 1; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; padding: 8px 4px; cursor: pointer; }
.dp-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.dp-tab:hover { color: var(--text); }
.dp-pane { display: none; }
.dp-pane.active { display: block; }
.dp-add { display: flex; gap: 6px; margin-bottom: 10px; }
.dp-add input { flex: 1; }
.dp-hint { font-size: 11.5px; color: var(--amber); margin-bottom: 8px; }
.dp-assoc { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.dp-assoc:hover:not(.current) { background: #1a1d2a; }
.dp-assoc.current { cursor: default; opacity: .85; }
.dp-assoc-title { font-size: 13px; font-weight: 600; }
.dp-assoc-now { font-size: 10px; color: var(--accent); font-weight: 700; }
.dp-assoc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dp-assoc-val { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--green); white-space: nowrap; }

/* Ajuste 4c — bloco "Empresa" nas Associações */
.assoc-block-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 6px; }
.company-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.company-card .cname { font-size: 13.5px; font-weight: 700; }
.member-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.member-row:first-of-type { border-top: none; }
.member-row .mav { width: 22px; height: 22px; border-radius: 50%; background: var(--lilas, var(--accent)); color: #060D18; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.member-row .mname { font-weight: 600; }
.member-row .mrole { color: var(--muted); font-size: 10.5px; }
.member-row .malert { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--amber, #f59e0b); background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35); border-radius: 20px; padding: 2px 8px; white-space: nowrap; }
.member-row .mok { margin-left: auto; font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ── Checkbox customizado (substitui o quadrado nativo do navegador) ── */
.crm-checkbox {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 17px; height: 17px; border-radius: 5px; flex-shrink: 0;
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; position: relative; transition: border-color .12s, background .12s;
}
.crm-checkbox:hover { border-color: var(--accent); }
.crm-checkbox:checked { background: #0EA399; border-color: transparent; }
.crm-checkbox:checked::after {
  content: ''; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* CRM-06: checkbox + barra flutuante de seleção em lote */
.deal-card-check { position: absolute; top: 9px; right: 9px; z-index: 2; opacity: 0; transition: opacity .12s; }
.deal-card:hover .deal-card-check, .deal-card-check:checked { opacity: 1; }
.deal-card.selected .deal-title { margin-right: 22px; }
#deal-bulk-bar { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 1200; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: 10px; padding: 11px 16px; box-shadow: 0 10px 34px #0009; max-width: 92vw; }
#deal-bulk-bar .dbb-count b { color: var(--accent); }
#deal-bulk-bar .dbb-label { color: var(--muted); font-size: 13px; }
#deal-bulk-bar select { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 7px 10px; font-size: 13px; max-width: 200px; }
#deal-bulk-bar input[type=text] { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 7px 10px; font-size: 13px; }
/* botões todos no mesmo tamanho, uma linha só (o +Tag/-Tag quebrava em duas) */
#deal-bulk-bar .btn-sm { white-space: nowrap; flex-shrink: 0; height: 34px; display: inline-flex; align-items: center; line-height: 1; }

/* ── Notificações de conversas ─────────────────────────── */
/* Badge de não lidas no item Conversas */
.sb-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--grad-primary, var(--accent)); color: var(--bg-deep, #05090F); font-family: var(--ff-display, inherit); font-weight: 700; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 12px rgba(0,246,245,.3); }
#sidebar.collapsed .sb-badge { display: none; }

/* Cards no canto (empilham, ficam até fechar/clicar) */
#notif-stack { position: fixed; bottom: 22px; right: 22px; z-index: 2000; display: flex; flex-direction: column; gap: 12px; width: 340px; max-width: calc(100vw - 44px); }
.ncard { position: relative; background: linear-gradient(180deg, var(--sd-raise, #0E1926), var(--surface)); border: 1px solid var(--sd-border-2, var(--border)); border-radius: 14px; padding: 13px 14px; display: flex; gap: 11px; box-shadow: 0 18px 44px rgba(0,0,0,.5); cursor: pointer; overflow: hidden; animation: notif-in .2s ease; }
.ncard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad-primary, var(--accent)); }
.ncard:hover { border-color: rgba(0,246,245,.35); }
@keyframes notif-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ncard .nav { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; background: linear-gradient(135deg, #1F6FEB, #00F6F5); display: flex; align-items: center; justify-content: center; font-family: var(--ff-display, inherit); font-weight: 700; font-size: 14px; color: var(--bg-deep, #05090F); }
.ncard .nbody { min-width: 0; flex: 1; }
.ncard .ntop { display: flex; align-items: center; gap: 8px; }
.ncard .ndot { width: 6px; height: 6px; border-radius: 50%; background: var(--green, #3DE1B0); box-shadow: 0 0 8px var(--green, #3DE1B0); flex-shrink: 0; }
.ncard .nname { font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncard .ntime { margin-left: auto; font-size: 10.5px; color: var(--muted); flex-shrink: 0; }
.ncard .nmsg { font-size: 12.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncard .nhint { font-size: 10.5px; color: var(--accent); margin-top: 6px; display: inline-block; }
.ncard .nx { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--border); background: rgba(140,180,220,.05); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ncard .nx svg { width: 12px; height: 12px; }
.ncard .nx:hover { color: var(--text); }

/* Toggle (Configurações → Notificações) */
.cfg-notif-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.cfg-notif-row + .cfg-notif-row { border-top: 1px solid var(--sd-hair, var(--border)); }
.cfg-notif-main { flex: 1; min-width: 0; padding-right: 8px; }
.cfg-notif-t { font-size: 13.5px; font-weight: 600; color: var(--text); }
.cfg-notif-d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cfg-switch { width: 44px; height: 25px; border-radius: 20px; flex-shrink: 0; position: relative; cursor: pointer; border: none; background: rgba(140,180,220,.18); transition: background .18s; padding: 0; }
.cfg-switch i { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.cfg-switch.on { background: #0EA399; }
.cfg-switch.on i { left: 22px; }
.cfg-sound-sel { flex: 0 0 200px; width: 200px; max-width: 200px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; cursor: pointer; }
.cfg-sound-sel:focus { outline: none; border-color: var(--accent); }

/* ── Picker de contato com busca (Novo Negócio) ── */
.nd-picker { position: relative; }
.nd-picker-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.nd-picker-input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; padding: 9px 30px 9px 32px; font-family: inherit; box-sizing: border-box; }
.nd-picker-input:focus { outline: none; border-color: var(--accent); }
.nd-picker-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; font-size: 13px; line-height: 1; }
.nd-picker-clear:hover { color: var(--text); background: rgba(255,255,255,.06); }
.nd-picker-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--sd-border-2, var(--border)); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 5px; }
.nd-picker-results.hidden { display: none; }
.nd-res { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 8px; cursor: pointer; }
.nd-res:hover { background: rgba(140,180,220,.07); }
.nd-res-av { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--ff-display, inherit); font-weight: 700; font-size: 11px; color: var(--bg-deep, #05090F); background: var(--grad-primary, var(--accent)); }
.nd-res-av.av-g1 { background: linear-gradient(135deg,#00F6F5,#0EA399); }
.nd-res-av.av-g2 { background: linear-gradient(135deg,#D24EFF,#B66FFF); }
.nd-res-av.av-g3 { background: linear-gradient(135deg,#B66FFF,#00F6F5); }
.nd-res-av.av-g4 { background: linear-gradient(135deg,#3DE1B0,#00F6F5); }
.nd-res-main { min-width: 0; display: flex; flex-direction: column; }
.nd-res-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-res-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-res-none { color: var(--muted); font-size: 12.5px; font-style: italic; }
.nd-res-empty { padding: 10px; color: var(--muted); font-size: 12.5px; text-align: center; }
.col-select-all { accent-color: var(--accent); cursor: pointer; width: 14px; height: 14px; }

/* ── Contacts table ──────────────────────────────────── */
#contacts-container { padding: 20px; overflow: hidden; flex: 1; }
.contacts-toolbar { display: flex; gap: 10px; margin-bottom: 8px; align-items: center; }
/* Busca com ícone (v2) */
.contacts-search { position:relative; flex:1; max-width:340px; }
.contacts-search svg { position:absolute; left:12px; top:50%; transform:translateY(-50%); width:15px; height:15px; color:var(--muted); pointer-events:none; }
.contacts-search input { width:100%; max-width:none; background:var(--bg); border:1px solid var(--border); border-radius:11px; color:var(--text); font-size:13px; padding:10px 12px 10px 34px; font-family:inherit; box-sizing:border-box; }
.contacts-search input:focus { outline:none; border-color:rgba(0,246,245,.4); box-shadow:0 0 0 3px rgba(0,246,245,.08); }
/* Botões pill da toolbar (v2) */
.tb-btn { display:inline-flex; align-items:center; gap:7px; height:38px; padding:0 13px; border-radius:11px; cursor:pointer; background:var(--sd-raise); border:1px solid var(--border); color:var(--text-secondary, var(--text)); font-family:inherit; font-size:12.5px; font-weight:500; white-space:nowrap; }
.tb-btn svg { width:14px; height:14px; flex-shrink:0; }
.tb-btn:hover { color:var(--text); border-color:var(--sd-border-2); }
.tb-btn.primary { background:var(--grad-primary, var(--accent)); color:var(--bg-deep, #04090F); font-weight:700; border:none; box-shadow:0 6px 16px rgba(0,246,245,.2); }
.tb-btn.accent { background:rgba(182,111,255,.10); border-color:rgba(182,111,255,.35); color:var(--lilas); font-weight:600; }
.tb-btn.accent:hover { background:rgba(182,111,255,.16); }
.contacts-toolbar-sp { flex:1 1 auto; min-width:8px; }
.contacts-countbar { margin:2px 0 12px; }
.contacts-count { font-size:12.5px; color:var(--muted); white-space:nowrap; }
.contacts-count b { color:var(--text); font-weight:700; }

/* td de tags = célula normal; o flex/wrap dos chips vive no .ct-tags interno.
   display:flex no <td> tirava a célula do fluxo da tabela e criava uma listra escura. */
.contact-tags { white-space: normal; }

/* Modal de aviso de contato duplicado */
.dup-list { display:flex; flex-direction:column; gap:8px; max-height:320px; overflow-y:auto; margin-bottom:4px; }
.dup-row { display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:11px; background:var(--sd-raise, var(--surface)); border:1px solid var(--border); }
.dup-av { width:32px; height:32px; flex-shrink:0; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px; color:var(--bg-deep, #05090F); background:var(--grad-primary, var(--accent)); }
.dup-main { flex:1; min-width:0; }
.dup-name { font-size:13.5px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dup-sub { font-size:11.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dup-badge { font-size:10px; font-weight:700; color:var(--amber, #FFB84D); background:rgba(255,184,77,.12); border:1px solid rgba(255,184,77,.3); border-radius:20px; padding:2px 8px; white-space:nowrap; flex-shrink:0; }
.contact-tags .tag { font-size: 10px; padding: 1px 6px; }

.contacts-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.contacts-pagination .pag-group { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.contacts-pagination button { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; line-height: 1.2; }
.contacts-pagination button:hover:not(:disabled) { border-color: var(--accent); }
.contacts-pagination button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.contacts-pagination button:disabled { opacity: .4; cursor: default; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
td { padding: 10px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:hover td { background: var(--surface); }
.tag { display: inline-block; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 11px; color: var(--muted); }

/* ── Conversations list ───────────────────────────────── */
#conversations-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

#conversations-list { flex: 1; overflow-y: auto; }

.conv-item {
  display: flex; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
  align-items: flex-start;
}
.conv-item:hover { background: var(--surface); }

.conv-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 15px; color: #fff;
  flex-shrink: 0;
}

.conv-body { flex: 1; min-width: 0; }
.conv-row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.conv-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.conv-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview.out::before { content: 'Você: '; color: var(--muted); }
.conv-deal { font-size: 11px; color: var(--muted); margin-top: 2px; }

.conv-empty { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7; }

/* ── Side panel (deal detail) ─────────────────────────── */
#side-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 60; /* acima do FAB (z-50) pra nenhum botão vazar na borda */
  transform: translateX(100%);
  transition: transform .2s ease;
}
#side-panel.open { transform: translateX(0); }

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.panel-title { font-size: 16px; font-weight: 700; flex: 1; }
.panel-close { display:flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:10px; background:transparent; border:1px solid transparent; color:var(--muted); cursor:pointer; line-height:0; padding:0; transition:color .15s, background .15s, border-color .15s, transform .2s; }
.panel-close:hover { color:var(--text); background:rgba(255,255,255,.06); border-color:var(--border); transform:rotate(90deg); }
.panel-back { background: transparent; border: 1px solid var(--border); color: var(--accent); font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 7px; cursor: pointer; font-family: inherit; flex-shrink: 0; }
.panel-back:hover { background: rgba(0,246,245,.08); border-color: rgba(0,246,245,.4); }
.panel-back.hidden { display: none; }

/* Aba Empresa do painel de contato */
.cdp-empresa-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cdp-empresa-logo { width: 46px; height: 46px; border-radius: 12px; background: var(--sd-raise); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0; }
.cdp-empresa-logo svg { width: 21px; height: 21px; }
.cdp-empresa-name { font-family: var(--ff-display, inherit); font-size: 15px; font-weight: 700; color: var(--text); }
.cdp-empresa-site { font-size: 12px; color: var(--accent); margin-top: 2px; }
.cdp-member-av { width: 30px; height: 30px; border-radius: 50%; background: var(--grad-primary, var(--accent)); color: var(--bg-deep, #040C13); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

.panel-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }

.panel-section h4 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-item label { font-size: 11px; color: var(--muted); }
.detail-item span { font-size: 13px; font-weight: 500; }
.detail-input {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--text); font-size: 13px; font-weight: 500; font-family: inherit;
  padding: 3px 6px; margin: -3px -6px; transition: background .12s, border-color .12s;
}
.detail-input:hover { border-color: rgba(255,255,255,.12); }
.detail-input:focus { background: var(--bg); border-color: var(--accent); outline: none; }
select.detail-input { cursor: pointer; }
.detail-notes { width: 100%; resize: vertical; margin-top: 10px; box-sizing: border-box; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-item { display: flex; gap: 10px; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }
.timeline-content { flex: 1; }
.timeline-desc { font-size: 13px; }
.timeline-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.add-activity-form { display: flex; gap: 8px; }
.add-activity-form input { flex: 1; }

/* ── Panel tabs ───────────────────────────────────────── */
#panel-tabs { display: flex; gap: 16px; padding: 0 22px; border-bottom: 1px solid var(--sd-hair, var(--border)); background: var(--surface); flex-shrink: 0; }
.panel-tab { position: relative; flex: 0 0 auto; padding: 12px 0 13px; font-size: 12.5px; font-weight: 600; background: none; border: none; color: var(--muted); cursor: pointer; }
.panel-tab.active { color: var(--text); }
.panel-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad-primary, var(--accent)); box-shadow: 0 0 10px rgba(0,246,245,.5); }
.panel-tab:hover:not(.active) { color: var(--text-secondary, var(--text)); opacity: 1; }

/* ── WhatsApp chat ────────────────────────────────────── */
.wa-chat { display: flex; flex-direction: column; height: calc(100vh - 172px); }
.wa-messages { flex: 1; overflow-y: auto; padding: 10px 12px; background: #e5ddd5; display: flex; flex-direction: column; gap: 3px; }
/* Separador de dia (Hoje / Ontem / dia da semana / data), estilo WhatsApp */
.wa-day { align-self: center; margin: 10px 0 4px; }
.wa-day span { display: inline-block; background: rgba(255,255,255,.92); color: #54656f; font-size: 11.5px; font-weight: 500; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-bubble { max-width: 78%; padding: 6px 10px 4px; border-radius: 7.5px; font-size: 13.5px; line-height: 1.45; word-break: break-word; position: relative; color: #111b21; }
.wa-bubble.out { background: #d9fdd3; align-self: flex-end; border-radius: 7.5px 0 7.5px 7.5px; }
.wa-bubble.in  { background: #fff; align-self: flex-start; border-radius: 0 7.5px 7.5px 7.5px; }
.wa-bubble.in .wa-sender { font-size: 11px; color: #075e54; font-weight: 600; margin-bottom: 2px; }
.wa-time { font-size: 11px; color: #667781; float: right; margin-left: 8px; margin-top: 2px; }
.wa-input-bar { display: flex; gap: 8px; padding: 9px 12px; background: #f0f0f0; align-items: center; flex-shrink: 0; position: relative; }
.wa-input-bar input { flex: 1; border: none; border-radius: 20px; padding: 9px 14px; font-size: 14px; background: #fff; outline: none; font-family: inherit; color: #111; }
.wa-emoji-btn { background: none; border: none; color: #54656f; cursor: pointer; display: flex; align-items: center; padding: 4px; border-radius: 50%; }
.wa-emoji-btn:hover { background: rgba(0,0,0,.06); }
.emoji-picker { position: absolute; bottom: calc(100% + 8px); left: 8px; background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 60; width: 300px; max-height: 220px; overflow-y: auto; }
.emoji-item { background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; padding: 4px; border-radius: 6px; }
.emoji-item:hover { background: #f0f0f0; }
.wa-send-btn { width: 40px; height: 40px; border-radius: 50%; background: #075e54; border: none; color: #fff; font-size: 20px; cursor: pointer; flex-shrink: 0; line-height: 40px; text-align: center; padding: 0; }
.wa-send-btn:hover { background: #128c7e; opacity: 1; }
.wa-empty { color: #8696a0; font-size: 13px; text-align: center; margin-top: 40px; }

/* ── Modal ───────────────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 3000;  /* acima dos painéis fixos (z-999) e notificações (z-2000): senão o modal abre atrás da conversa */
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 28px;
  width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.modal h3, .modal-title { font-family: var(--ff-display, inherit); font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
/* Tabelas dentro de modais (ex: Gerenciar Campos) — sem o cabeçalho cyan gritante */
.modal table th { background: var(--bg-2, #070E17) !important; color: var(--muted) !important; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--border); padding: 10px 12px; }
.modal table td { border-bottom: 1px solid var(--sd-hair); padding: 10px 12px; }
.transfer-list { display: flex; flex-direction: column; gap: 6px; }
.transfer-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.transfer-opt:hover { border-color: var(--accent); background: rgba(var(--accent-rgb,99,102,241),.05); }
.transfer-opt input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.transfer-opt-label { font-size: 13px; color: var(--text); }

/* ── Workspace selector ───────────────────────────────── */
#ws-selector { display: flex; align-items: center; justify-content: center; height: 100%; }
.ws-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px; width: 100%; max-width: 400px;
}
.ws-card h2 { margin-bottom: 20px; font-size: 18px; }
.ws-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; margin-bottom: 8px;
  transition: border-color .15s;
}
.ws-item:hover { border-color: var(--accent); }
.ws-item-name { font-weight: 600; }
.ws-item-role { font-size: 11px; color: var(--muted); }
.ws-avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }

/* ── Empty state ─────────────────────────────────────── */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }

/* ── Toast ───────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 20px; border-radius: 8px; font-size: 13px;
  z-index: 99; opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
#toast.show { opacity: 1; }
#toast.error { border-color: var(--red); color: var(--red); }
#toast.success { border-color: var(--green); color: var(--green); }
#toast.info { border-color: #6366f1; color: #a5b4fc; }

@media (max-width: 640px) {
  :root { --sidebar-w: 100vw; --sb-w: 200px; }
  .kanban-col { width: 240px; min-width: 240px; }
}

/* ── Atividades ─────────────────────────────────────── */
.act-filter-bar { display: flex; gap: 6px; padding: 0 20px 12px; flex-wrap: wrap; }
.act-filter-btn { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); background: transparent; font-size: 12px; cursor: pointer; color: var(--text); transition: all .15s; }
.act-filter-btn:hover { border-color: var(--accent); }
.act-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
#activities-timeline { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 0; }
.act-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.act-item:last-child { border-bottom: none; }
.act-item-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.act-item-body { flex: 1; min-width: 0; }
.act-item-desc { font-size: 13px; color: var(--text); line-height: 1.4; }
.act-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.act-deal-tag { font-size: 11px; padding: 2px 7px; background: rgba(99,102,241,.1); color: var(--accent); border-radius: 4px; }
.act-item-ts { font-size: 11px; color: var(--muted); }
.act-item-del { opacity: 0; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 12px; padding: 4px 6px; transition: opacity .15s; flex-shrink: 0; }
.act-item:hover .act-item-del { opacity: 1; }

/* ── Relatórios ──────────────────────────────────────── */
.rpt-weekly { display: flex; align-items: flex-end; gap: 8px; padding: 8px 0; height: 120px; }
.rpt-week-col { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; }
.rpt-week-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.rpt-week-bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s; opacity: .85; }
.rpt-week-count { font-size: 11px; color: var(--text); margin-top: 3px; }
.rpt-week-label { font-size: 10px; color: var(--muted); }

/* ── Automações ──────────────────────────────────────── */
.auto-list { display: flex; flex-direction: column; gap: 8px; padding: 0 20px 20px; }
.auto-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.auto-item-disabled { opacity: .5; }
.auto-item-body { flex: 1; min-width: 0; }
.auto-item-rule { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.auto-item-msg { font-size: 12px; color: var(--muted); margin-top: 4px; font-style: italic; }
.auto-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.auto-badge-trigger { background: rgba(99,102,241,.15); color: var(--accent); }
.auto-badge-action  { background: rgba(34,197,94,.15); color: #16a34a; }
.auto-item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.auto-toggle { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; }
.auto-toggle input { opacity: 0; width: 0; height: 0; }
.auto-toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 20px; transition: .2s; }
.auto-toggle-slider::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.auto-toggle input:checked + .auto-toggle-slider { background: var(--accent); }
.auto-toggle input:checked + .auto-toggle-slider::before { transform: translateX(16px); }

/* ── Sidebar divider ─────────────────────────────────── */
.sb-divider { height: 1px; background: var(--border); margin: 4px 10px; }
#sidebar.collapsed .sb-divider { margin: 4px 6px; }

/* ── Conv mode: layout 3 colunas persistente ────────── */
/* Side-panel sai do fluxo fixo e vira coluna direita */
#app.conv-mode #side-panel {
  position: static;
  transform: none !important;
  transition: none !important;
  flex: 1;
  min-width: 0;
  display: flex !important;
}
/* Lista de conversas fica com largura fixa à esquerda */
#app.conv-mode #main-content {
  width: 300px;
  flex-shrink: 0;
  flex: none;
}
/* Esconder elementos desnecessários no conv-mode */
#app.conv-mode .panel-header { display: none !important; }
#app.conv-mode #panel-tabs   { display: none !important; }
#app.conv-mode .panel-body   { padding: 0; gap: 0; overflow: hidden; }
#app.conv-mode .wa-chat      { height: 100%; }

/* Empty state quando nenhuma conversa está aberta */
.conv-no-chat {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; color: var(--muted); text-align: center; padding: 40px;
}
.conv-no-chat-icon { font-size: 52px; opacity: .2; }
.conv-no-chat p { font-size: 13px; color: var(--muted); }

/* ── Header de contato no chat (conv-mode) ───────────── */
.conv-chat-contact {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.conv-chat-contact-top {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.conv-chat-contact-info {
  display: flex; align-items: center; gap: 10px;
}
.conv-avatar-md {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.conv-chat-name  { font-size: 13.5px; font-weight: 600; color: var(--text); }
.conv-chat-phone { font-size: 11px; color: var(--muted); }

/* Tags coloridas */
.conv-tags-bar {
  display: flex; gap: 5px; flex-wrap: wrap;
  align-items: center; min-height: 20px;
}
.conv-tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 2px 9px; border-radius: 10px; border: 1px solid;
  background: rgba(99,102,241,.1); color: var(--accent);
  border-color: rgba(99,102,241,.25);
}

/* Botões de ação no header do chat */
.conv-action-btns {
  display: flex; gap: 4px; align-items: center; flex-shrink: 0;
}
.conv-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--border);
  color: var(--muted); padding: 4px 8px; border-radius: 6px;
  font-size: 12px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.conv-action-btn:hover { color: var(--text); border-color: var(--accent); opacity: 1; }
.conv-stage-btn {
  color: var(--text); border-color: rgba(99,102,241,.4);
  background: rgba(99,102,241,.08);
}
.conv-more-btn { font-size: 16px; padding: 4px 7px; letter-spacing: 1px; }

/* ── Dropdowns reutilizáveis (stage + more-menu) ─────── */
.crm-dropdown {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 200;
  padding: 4px 0;
  min-width: 180px;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
.crm-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; cursor: pointer;
  font-size: 13px; color: var(--muted);
  transition: all .1s;
}
.crm-dropdown-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.crm-dropdown-item.active { color: var(--text); }
.crm-dropdown-item.danger { color: var(--red); }
.crm-dropdown-divider { height: 1px; background: var(--border); margin: 3px 0; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Stub views (Automações, Disparos, etc.) ─────────── */
.stub-view {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 40px;
}
.stub-view-icon { font-size: 52px; opacity: .2; }
.stub-view h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.stub-view p { font-size: 13.5px; color: var(--muted); max-width: 340px; line-height: 1.7; }

/* ── Inbox v93: unread badge + ticks de status ─────────── */
.conv-row2 { display: flex; align-items: center; gap: 6px; }
.conv-row2 .conv-preview { flex: 1; }
.conv-unread {
  background: #25d366; color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 10px; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.conv-item.has-unread .conv-name { font-weight: 700; }
.conv-item.has-unread .conv-preview { color: var(--text, #111b21); font-weight: 500; }
.wa-tick { font-size: 11px; margin-left: 4px; color: #667781; letter-spacing: -2px; }
.wa-tick.read { color: #53bdeb; }
.wa-tick.failed { color: #ef4444; letter-spacing: 0; }
.wa-fail-note { font-size: 11px; color: #ef4444; margin-top: 4px; clear: both; }
.wa-media-note { font-size: 12px; color: #667781; margin-bottom: 3px; }

/* ── Janela 24h pill ─────────────────────────────────── */
.wa-chat-header { padding: 5px 12px; background: #f0f2f5; border-bottom: 1px solid #dde1e7; min-height: 28px; }
.wa-window-pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 12px; }
.wa-window-pill.open { background: #dcfce7; color: #15803d; }
.wa-window-pill.closed { background: #fee2e2; color: #b91c1c; }

/* ── Botão de template na barra de input ─────────────── */
.wa-template-btn { flex-shrink: 0; padding: 0 14px; height: 40px; border-radius: 20px; border: 1.5px solid #075e54; color: #075e54; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; }
.wa-template-btn:hover { background: rgba(7,94,84,.08); }

/* ── Modal de templates ──────────────────────────────── */
.tpl-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; margin-bottom: 8px; }
.tpl-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color .15s; }
.tpl-item:hover { border-color: var(--accent); }
.tpl-item.selected { border-color: var(--accent); background: rgba(37,99,235,.06); }
.tpl-name { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.tpl-folder-chip { font-size: 10px; background: rgba(0,246,245,.12); color: var(--cyan); border-radius: 5px; padding: 1px 6px; margin-left: 6px; font-weight: 600; vertical-align: middle; }
.tpl-body-preview { font-size: 12px; color: var(--muted); }
.tpl-preview { background: #e5ddd5; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin: 8px 0 4px; min-height: 36px; word-break: break-word; line-height: 1.5; }

/* ── Bloco C: mídia nas bolhas ────────────────────────── */
.wa-media-img { max-width: 220px; margin-bottom: 4px; }
.wa-media-img img { width: 100%; max-width: 220px; border-radius: 6px; display: block; cursor: pointer; }
.wa-media-audio { max-width: 240px; height: 40px; display: block; margin-bottom: 4px; }
.wa-media-video { max-width: 240px; border-radius: 6px; display: block; margin-bottom: 4px; }
.wa-media-doc { margin-bottom: 4px; }
.wa-media-doc a { color: var(--accent); text-decoration: none; font-size: 13px; }
.wa-media-doc a:hover { text-decoration: underline; }
.wa-caption { font-size: 13px; margin-top: 2px; margin-bottom: 2px; }

/* ── Botão de anexo ──────────────────────────────────── */
.wa-attach-btn {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: background .15s;
}
.wa-attach-btn:hover { background: rgba(0,0,0,.06); }
.wa-attach-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Botão e UI de gravação de áudio ─────────────────── */
.wa-rec-btn {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: #075e54; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .15s; padding: 0;
}
.wa-rec-btn:hover { background: #128c7e; opacity: 1; }
.wa-rec-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Barra de gravação ativa */
.wa-rec-cancel {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid #9ca3af; background: transparent;
  cursor: pointer; font-size: 13px; color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
}
.wa-rec-cancel:hover { border-color: #ef4444; color: #ef4444; }

.wa-rec-dot {
  flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%;
  background: #ef4444; animation: recPulse 1.2s ease-in-out infinite;
}
@keyframes recPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

#wa-rec-timer {
  flex: 1; text-align: center; font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: #111b21; letter-spacing: .5px;
}
.wa-rec-send {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: #075e54; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.wa-rec-send:hover { background: #128c7e; }

/* ── Conexões WhatsApp ── */
.conn-loading { color: var(--muted); padding: 24px 0; font-size: 13px; }
.conn-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 8px;
}
.conn-warn {
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.28);
  color: #d97706; border-radius: var(--radius); padding: 11px 14px;
  font-size: 12.5px; line-height: 1.5; margin-bottom: 12px;
}
.conn-disconnect {
  font-size: 11px; font-weight: 600; padding: 4px 10px; flex-shrink: 0;
  border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer;
  white-space: nowrap; transition: border-color .12s, color .12s;
}
.conn-disconnect:hover { border-color: #ef4444; color: #ef4444; }
.conn-card-icon { font-size: 22px; flex-shrink: 0; }
.conn-card-body { flex: 1; min-width: 0; }
.conn-card-label { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn-card-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.conn-badge {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
  flex-shrink: 0; text-transform: uppercase; letter-spacing: .3px;
}
.conn-badge-ok { background: rgba(34,197,94,.12); color: #22c55e; }
.conn-badge-warn { background: rgba(245,158,11,.12); color: #f59e0b; }
.conn-badge-err { background: rgba(239,68,68,.12); color: #ef4444; }
.conn-picker-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; cursor: pointer; border-radius: 6px;
  transition: background .12s;
}
.conn-picker-row:hover { background: rgba(255,255,255,.04); }
.conn-picker-row input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; accent-color: var(--accent); }
.conn-picker-info { flex: 1; min-width: 0; }
.conn-picker-name { font-size: 13px; font-weight: 600; }
.conn-picker-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── iaize — badges, selo IA, barra Assumir/Devolver ── */
.iaize-badge {
  display: inline-block; font-size: 12px; margin-left: 4px;
  vertical-align: middle; line-height: 1;
}
.wa-ai-seal { font-size: 11px; margin-right: 3px; vertical-align: middle; opacity: .75; }
.wa-bubble-ai.out { background: #d0eeff; }
#wa-iaize-bar { flex-shrink: 0; }
.iaize-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; font-size: 12px; gap: 8px;
}
.iaize-bar-ai    { background: rgba(0,120,255,.08); border-bottom: 1px solid rgba(0,120,255,.18); color: #3b82f6; }
.iaize-bar-human { background: rgba(34,197,94,.07); border-bottom: 1px solid rgba(34,197,94,.18); color: #16a34a; }
.iaize-bar-label { font-weight: 600; }
.iaize-bar-btn {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 4px; border: 1px solid currentColor; background: transparent;
  color: inherit; cursor: pointer; white-space: nowrap;
  transition: opacity .12s;
}
.iaize-bar-btn:hover { opacity: .75; }
.iaize-bar-btn:disabled { opacity: .4; cursor: default; }

/* ── Templates view ── */
.tpl-search-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tpl-search-wrap { position: relative; }
.tpl-search-wrap svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tpl-search-input { width: 260px; padding: 7px 9px 7px 30px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; outline: none; font-family: inherit; }
.tpl-search-input:focus { border-color: var(--accent); }
.tpl-search-input::placeholder { color: var(--muted); }
.tpl-count { font-size: 12.5px; color: var(--muted); }
.tpl-view-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.tpl-view-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 15px; background: var(--surface); transition: border-color .15s;
  position: relative;
}
.tpl-view-card:hover { border-color: rgba(99,102,241,.35); }
.tpl-view-header { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 5px; }
.tpl-view-name { font-weight: 600; font-size: 13.5px; }
.tpl-menu-wrap { position: relative; flex-shrink: 0; }
.tpl-menu-btn { width: 27px; height: 27px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 17px; line-height: 1; transition: all .14s; }
.tpl-menu-btn:hover, .tpl-menu-btn.open { border-color: var(--border); background: rgba(255,255,255,.05); color: var(--text); }
.tpl-dropdown { position: absolute; right: 0; top: 30px; background: #1e2130; border: 1px solid var(--border); border-radius: 10px; padding: 4px; min-width: 170px; box-shadow: 0 10px 28px rgba(0,0,0,.55); z-index: 40; display: none; }
.tpl-dropdown.open { display: block; }
.tpl-dd-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--muted); width: 100%; text-align: left; border: none; background: none; cursor: pointer; }
.tpl-dd-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.tpl-dd-item.danger { color: #f87171; }
.tpl-dd-item.danger:hover { background: rgba(239,68,68,.08); }
.tpl-dd-div { height: 1px; background: var(--border); margin: 3px 0; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.badge-cat { background: rgba(99,102,241,.12); color: #818cf8; }
.badge-lang { background: rgba(100,116,139,.12); color: #94a3b8; }
.badge-status-ok { background: rgba(34,197,94,.12); color: #22c55e; }
.badge-status-warn { background: rgba(245,158,11,.12); color: #f59e0b; }
.badge-status-err { background: rgba(239,68,68,.12); color: #f87171; }
.tpl-view-body { font-size: 13px; color: var(--muted); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.tpl-view-comp { margin-top: 6px; font-size: 12px; color: var(--muted); }
.tpl-view-comp span { display: inline-block; margin-right: 8px; opacity: .75; }
.tpl-view-empty { color: var(--muted); font-size: 13px; padding: 32px 0; text-align: center; }
.tpl-view-card-rejected { border-color: rgba(239,68,68,.25); }
.tpl-view-card-rejected:hover { border-color: rgba(239,68,68,.55); }
.tpl-view-rejected-reason { margin-top: 8px; font-size: 12px; color: #f87171; display: flex; align-items: center; gap: 5px; }
.tpl-view-section-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.tpl-view-section-label:first-child { margin-top: 0; }
.tpl-view-callout { background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.25); border-left: 3px solid #f59e0b; border-radius: 8px; padding: 10px 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.tpl-view-callout strong { color: #f59e0b; }
/* folder chips */
.tpl-folder-chips-row { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.tpl-folder-chip { background:rgba(99,102,241,.08); border:1px solid rgba(99,102,241,.2); color:var(--muted); font-size:12px; font-weight:600; padding:3px 12px; border-radius:99px; cursor:pointer; transition:all .15s; }
.tpl-folder-chip:hover { border-color:rgba(99,102,241,.5); color:var(--text); }
.tpl-folder-chip.active { background:rgba(99,102,241,.18); border-color:#818cf8; color:#c7d2fe; }
.tpl-folder-chip-new { border-style:dashed; opacity:.6; }
.tpl-folder-chip-new:hover { opacity:1; }
/* badge de pasta no card */
.badge-folder { background:rgba(99,102,241,.1); color:#818cf8; display:inline-flex; align-items:center; gap:3px; }
.badge-folder svg { width:10px; height:10px; }
/* folder picker no modal */
.tpl-fp-opt { width:100%; text-align:left; background:rgba(255,255,255,.04); border:1px solid var(--border); color:var(--text); font-size:13px; padding:8px 12px; border-radius:8px; cursor:pointer; transition:all .15s; }
.tpl-fp-opt:hover { border-color:rgba(99,102,241,.4); background:rgba(99,102,241,.08); }
.tpl-fp-opt.active { border-color:#818cf8; color:#c7d2fe; background:rgba(99,102,241,.12); }

/* ── Template modal redesign ── */
/* toggle */
.nt-toggle { position:relative; display:inline-flex; cursor:pointer; flex-shrink:0; }
.nt-toggle input { opacity:0; width:0; height:0; position:absolute; }
.nt-toggle-track { display:block; width:36px; height:20px; background:var(--border); border-radius:999px; position:relative; transition:background .15s; }
.nt-toggle-track::after { content:''; position:absolute; top:3px; left:3px; width:14px; height:14px; background:#fff; border-radius:50%; transition:left .15s; }
.nt-toggle input:checked + .nt-toggle-track { background:var(--accent); }
.nt-toggle input:checked + .nt-toggle-track::after { left:19px; }
/* wide modal + two-panel layout */
.modal-wide { max-width:900px !important; overflow-y:hidden !important; display:flex; flex-direction:column; padding:0 !important; }
.modal-wide > .modal-title { padding:24px 28px 0; margin-bottom:16px; }
.modal-wide > div:last-child { padding:16px 28px 24px; margin-top:0 !important; border-top:1px solid var(--border); }
.nt-modal-wrap { display:flex; flex:1; overflow:hidden; min-height:0; }
.nt-form-side { flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden; }
.nt-form-head { display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-bottom:1px solid var(--border); flex-shrink:0; }
.nt-form-head h3 { font-size:15px; font-weight:700; margin:0; }
.nt-form-body { flex:1; overflow-y:auto; padding:16px 20px; }
.nt-form-foot { padding:11px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:8px; flex-shrink:0; }
/* preview */
.nt-preview-side { width:228px; background:var(--bg); border-left:1px solid var(--border); display:flex; flex-direction:column; flex-shrink:0; }
.nt-preview-head { padding:9px 14px; border-bottom:1px solid var(--border); font-size:10.5px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); display:flex; align-items:center; gap:5px; flex-shrink:0; }
.nt-preview-body { flex:1; overflow-y:auto; padding:14px 8px; display:flex; justify-content:center; align-items:flex-start; }
/* form layout helpers */
.nt-row2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:14px; }
.nt-field { margin-bottom:12px; }
.nt-lbl { display:block; font-size:11px; font-weight:600; color:var(--muted); margin-bottom:5px; letter-spacing:.04em; text-transform:uppercase; }
.nt-opt { font-weight:400; text-transform:none; letter-spacing:0; }
.nt-inp { width:100%; padding:8px 10px; background:var(--bg); border:1px solid var(--border); border-radius:8px; color:var(--text); font-size:13px; font-family:inherit; outline:none; transition:border-color .15s; }
.nt-inp:focus { border-color:var(--accent); }
select.nt-inp option { background:var(--surface); }
.nt-help { font-size:11px; color:var(--muted); margin-top:4px; }
.nt-help-r { text-align:right; }
.nt-divider { height:1px; background:var(--border); margin:14px 0; }
.nt-sec-lbl { font-size:11px; font-weight:700; color:var(--muted); letter-spacing:.06em; text-transform:uppercase; margin-bottom:10px; }
.nt-toggle-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
/* header type pills */
.nt-hdr-types { display:flex; gap:5px; flex-wrap:wrap; margin-bottom:10px; }
.nt-hdr-type { display:flex; flex-direction:column; align-items:center; gap:3px; padding:7px 10px; border:1px solid var(--border); border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; font-size:11px; font-weight:500; min-width:54px; transition:all .12s; font-family:inherit; }
.nt-hdr-type:hover:not(.nt-disabled) { border-color:rgba(99,102,241,.4); color:var(--text); opacity:1; }
.nt-hdr-type.sel { border-color:rgba(99,102,241,.6); background:rgba(99,102,241,.1); color:#a5b4fc; }
.nt-disabled { opacity:.38; cursor:default; }
/* button section */
.nt-btns-wrap { background:var(--bg); border:1px solid var(--border); border-radius:10px; overflow:visible; }
.nt-btn-add-row { padding:8px; position:relative; }
.nt-buttons-list-border { border-top:1px solid var(--border); }
.nt-btn-add-trigger { display:flex; align-items:center; gap:7px; width:100%; padding:8px 12px; background:rgba(99,102,241,.07); border:1.5px dashed rgba(99,102,241,.3); border-radius:8px; color:#a5b4fc; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; transition:all .12s; }
.nt-btn-add-trigger:hover:not(:disabled) { background:rgba(99,102,241,.14); border-color:rgba(99,102,241,.5); opacity:1; }
.nt-btn-add-trigger:disabled { opacity:.4; cursor:default; }
/* dropdown picker */
.nt-btn-picker { position:absolute; left:8px; right:8px; bottom:calc(100% + 4px); background:#1e2130; border:1px solid var(--border); border-radius:12px; box-shadow:0 -8px 28px rgba(0,0,0,.55); z-index:50; overflow:hidden; display:none; }
.nt-btn-picker.open { display:block; }
.nt-bp-group { font-size:10px; font-weight:700; letter-spacing:.1em; color:var(--muted); padding:9px 12px 4px; text-transform:uppercase; }
.nt-bp-opt { display:flex; align-items:center; gap:10px; padding:8px 12px; cursor:pointer; border:none; background:none; width:100%; text-align:left; transition:background .1s; font-family:inherit; }
.nt-bp-opt:hover { background:rgba(255,255,255,.05); }
.nt-bp-disabled { opacity:.4; pointer-events:none; }
.nt-bp-icon { width:28px; height:28px; border-radius:6px; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:13px; }
.nt-bp-qr { background:rgba(99,102,241,.15); }
.nt-bp-cta { background:rgba(34,197,94,.1); }
.nt-bp-info { flex:1; min-width:0; }
.nt-bp-name { font-size:13px; font-weight:500; color:var(--text); }
.nt-bp-desc { font-size:11px; color:var(--muted); margin-top:1px; }
.nt-bp-rec { font-size:10px; background:rgba(34,197,94,.12); color:#4ade80; padding:1px 5px; border-radius:99px; font-weight:600; margin-left:4px; }
.nt-bp-soon { font-size:10px; background:rgba(245,158,11,.1); color:#f59e0b; padding:1px 5px; border-radius:99px; font-weight:600; margin-left:4px; }
.nt-bp-sep { height:1px; background:var(--border); margin:3px 0; }
/* added button cards */
.nt-added-btn-card { background:#1e2130; border:1px solid var(--border); border-radius:9px; padding:10px 11px; margin:0 8px 8px; }
.nt-added-btn-card:first-child { margin-top:8px; }
.nt-ab-top { display:flex; align-items:center; gap:7px; margin-bottom:8px; }
.nt-ab-icon { width:26px; height:26px; border-radius:6px; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:12px; }
.nt-ab-icon-qr { background:rgba(99,102,241,.12); color:#a5b4fc; }
.nt-ab-icon-cta { background:rgba(34,197,94,.1); color:#4ade80; }
.nt-ab-type { font-size:11.5px; font-weight:600; color:var(--muted); flex:1; }
.nt-ab-remove { width:21px; height:21px; border-radius:5px; border:none; background:rgba(239,68,68,.1); color:#f87171; cursor:pointer; font-size:12px; display:flex; align-items:center; justify-content:center; padding:0; }
.nt-ab-remove:hover { background:rgba(239,68,68,.2); opacity:1; }
.nt-ab-field { margin-bottom:7px; }
.nt-ab-field:last-of-type { margin-bottom:0; }
.nt-ab-lbl { font-size:10px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; display:block; margin-bottom:4px; }
.nt-ab-input { width:100%; padding:6px 8px; background:var(--bg); border:1px solid var(--border); border-radius:6px; color:var(--text); font-size:12.5px; font-family:inherit; outline:none; }
.nt-ab-input:focus { border-color:var(--accent); }
.nt-ab-char { font-size:10.5px; color:var(--muted); flex-shrink:0; min-width:30px; text-align:right; }
.nt-optout-note { background:rgba(245,158,11,.06); border:1px dashed rgba(245,158,11,.3); border-radius:6px; padding:7px 9px; font-size:11px; color:#f59e0b; display:flex; align-items:flex-start; gap:5px; margin-top:7px; }
/* WhatsApp phone preview */
.nt-phone { background:#0b0e14; border-radius:20px; width:188px; padding:8px; box-shadow:0 8px 30px rgba(0,0,0,.6); }
.nt-ph-bar { background:#1a2733; padding:7px 9px; display:flex; align-items:center; gap:6px; border-radius:8px 8px 0 0; }
.nt-ph-av { width:24px; height:24px; border-radius:50%; background:#3b4c5c; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#e2e4ec; flex-shrink:0; }
.nt-ph-name { font-size:12px; font-weight:600; color:#e2e4ec; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nt-ph-msgs { padding:8px 6px; background:#0c1219; border-radius:0 0 8px 8px; min-height:60px; }
.nt-bubble { background:#1f4d35; border-radius:10px 10px 0 10px; padding:8px 9px; margin-bottom:4px; }
.nt-wpp-btn { background:#1a2d23; border:1px solid #2d4a38; border-radius:6px; padding:5px 7px; font-size:10px; font-weight:500; color:#5aeaab; text-align:center; margin-top:3px; }
.nt-upload-zone { border:2px dashed var(--border); border-radius:10px; padding:18px 12px; text-align:center; cursor:pointer; transition:border-color .15s,background .15s; }
.nt-upload-zone:hover { border-color:rgba(99,102,241,.5); background:rgba(99,102,241,.04); }
#nt-upload-status { display:flex; flex-direction:column; align-items:center; gap:6px; color:var(--muted); font-size:12px; }

/* ── Qualidade WABA ── */
.meta-panel-list { display: flex; flex-direction: column; gap: 14px; padding: 4px 0; }
.meta-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; background: var(--surface);
}
.meta-card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.meta-calling { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft, rgba(255,255,255,.08)); }
.meta-calling-h { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.meta-calling-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 5px 0; }
.meta-calling-row > span:first-child { color: var(--muted); }
.meta-calling-note { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.conv-call-btn:hover { color: #22c55e !important; border-color: #22c55e !important; }
.cdp-call-btn { color: #22c55e; }
.cdp-call-btn svg { stroke: #22c55e; }
.da-btn-call:hover { color: #22c55e !important; }
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.meta-stat { display: flex; flex-direction: column; gap: 3px; }
.meta-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.meta-stat-value { font-size: 14px; font-weight: 600; }
.quality-green { color: #22c55e; }
.quality-yellow { color: #f59e0b; }
.quality-red { color: #ef4444; }
.quality-unknown { color: var(--muted); }
.tier-pill {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 99px;
  background: rgba(37,99,235,.12); color: #60a5fa;
}
.meta-error { color: #ef4444; font-size: 13px; }

/* ── Atendentes ── */
.agents-list { display: flex; flex-direction: column; gap: 0; }
.agent-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.agent-row:last-child { border-bottom: none; }
.agent-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(37,99,235,.15); color: #60a5fa;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.agent-info { flex: 1; min-width: 0; }
.agent-email { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge-role-admin { background: rgba(37,99,235,.12); color: #60a5fa; }
.badge-role-member { background: rgba(100,116,139,.1); color: #94a3b8; }
.agent-remove-btn {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  cursor: pointer; transition: color .12s, border-color .12s; flex-shrink: 0;
}
.agent-remove-btn:hover { color: #ef4444; border-color: #ef4444; }


/* ── Dashboard ────────────────────────────────────────── */
#dashboard-container { display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
#dashboard-body { padding: 24px; flex: 1; }
.dash-loading { color: var(--muted); font-size: 14px; padding: 32px 0; }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 18px; }
.dash-card-value { font-size: 28px; font-weight: 700; line-height: 1.1; margin-bottom: 6px; }
.dash-card-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.dash-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.dash-section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.dash-total { font-size: 12px; color: var(--muted); font-weight: 400; }
.dash-stages { display: flex; flex-direction: column; gap: 10px; }
.dash-stage-row { display: grid; grid-template-columns: 10px 140px 1fr 36px; align-items: center; gap: 10px; }
.dash-stage-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-stage-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-stage-bar-wrap { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.dash-stage-bar { height: 100%; border-radius: 4px; transition: width .3s ease; }
.dash-stage-count { font-size: 13px; font-weight: 600; color: var(--text); text-align: right; }
/* Dashboard v2 — interativo */
.dash-controls { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-sel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--text); cursor: pointer; }
.dash-sections-row { display: grid; grid-template-columns: 180px 1fr; gap: 16px; margin-top: 16px; }
.dash-donut-wrap { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.dash-donut-legend { display: flex; flex-direction: column; gap: 8px; }
.dash-legend-item { display: flex; align-items: center; gap: 8px; }
.dash-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-legend-label { font-size: 12px; color: var(--muted); min-width: 60px; }
.dash-legend-val { font-size: 14px; font-weight: 600; color: var(--text); }
.dash-stage-row { display: grid; grid-template-columns: 10px 1fr 1fr 36px 76px; align-items: center; gap: 8px; }
.dash-stage-value { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-stage-clickable { cursor: pointer; border-radius: 6px; padding: 4px 6px; margin: 0 -6px; transition: background .15s; }
.dash-stage-clickable:hover { background: rgba(255,255,255,.04); }
@media (max-width: 720px) {
  .dash-sections-row { grid-template-columns: 1fr; }
  .dash-stage-row { grid-template-columns: 10px 1fr 1fr 36px; }
  .dash-stage-value { display: none; }
}

/* ── Favoritar / DND ─────────────────────────────────── */
.conv-fav-btn {
  background: none; border: none; padding: 0 2px; color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer; flex-shrink: 0;
  transition: color .15s; opacity: .7;
}
.conv-fav-btn:hover, .conv-fav-btn.active { color: #f59e0b; opacity: 1; }
.conv-dnd-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: #ef444422;
  color: #ef4444; font-size: 9px; flex-shrink: 0; margin-left: 2px;
}
/* Selo de origem do lead (anúncio Click-to-WhatsApp) */
.conv-ad-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px 1px 4px; border-radius: 10px;
  background: #3b82f61f; color: #3b82f6;
  font-size: 10px; font-weight: 600; line-height: 1.6;
  flex-shrink: 0; margin-left: 2px; cursor: pointer; white-space: nowrap;
}
.conv-ad-badge svg { width: 11px; height: 11px; }
.wa-ad-origin { margin-bottom: 4px; }
.wa-ad-origin .conv-ad-badge { cursor: pointer; }

/* star button na barra de ações do chat conv-mode */
.conv-action-btn.fav-active { color: #f59e0b; border-color: #f59e0b44; }
.conv-action-btn.dnd-active { color: #ef4444; border-color: #ef444444; }

/* ── Histórico unificado — itens de atividade no chat ─ */
.chat-activity {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; margin: 4px 0; align-self: center;
  max-width: 88%; width: 100%;
}
.chat-activity-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  flex-shrink: 0; margin-top: 5px;
}
.chat-activity-body { flex: 1; }
.chat-activity-type {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  color: var(--accent); letter-spacing: .04em;
}
.chat-activity-desc { font-size: 12px; color: #4a5568; margin-top: 1px; }
.chat-activity-time { font-size: 10px; color: #8696a0; margin-top: 1px; display: block; }

/* ── Pipeline Config Modal (modal-wide 900px) ─────────── */
.pipeline-cfg {
  display: flex; gap: 0; min-height: 420px; max-height: 68vh;
}
.pipeline-cfg-left {
  width: 240px; flex-shrink: 0; border-right: 1px solid var(--border);
  padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.pipeline-cfg-right {
  flex: 1; padding: 18px 24px; display: flex; flex-direction: column; overflow-y: auto;
}
.pipe-item {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  border-radius: 10px; cursor: pointer; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; transition: background .12s, border-color .12s, color .12s;
}
.pipe-item:hover { background: var(--sd-raise); }
.pipe-item.selected { background: rgba(0,246,245,.08); border-color: rgba(0,246,245,.4); color: var(--accent); }
.pipe-item-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-del-btn {
  background: none; border: none; color: var(--muted); padding: 0 2px;
  font-size: 13px; line-height: 1; opacity: 0; transition: opacity .12s; cursor: pointer;
  display: inline-flex; align-items: center;
}
.pipe-del-btn svg { width: 14px; height: 14px; }
.pipe-item:hover .pipe-del-btn { opacity: .6; }
.pipe-del-btn:hover { color: var(--red); opacity: 1; }
.pipe-add-btn, .stage-add-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 1px dashed var(--sd-border-2, var(--border)); color: var(--muted);
  padding: 10px 13px; border-radius: 11px; font-size: 12.5px; font-weight: 500; text-align: left;
  margin-top: 8px; cursor: pointer; transition: border-color .12s, color .12s;
}
.pipe-add-btn svg, .stage-add-btn svg { width: 14px; height: 14px; }
.pipe-add-btn:hover, .stage-add-btn:hover { border-color: var(--accent); color: var(--accent); }

.stage-cfg-list { display: flex; flex-direction: column; gap: 12px; }
.stage-cfg-item {
  padding: 15px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; transition: border-color .12s, box-shadow .12s;
}
.stage-cfg-item:hover { border-color: var(--sd-border-2); }
.stage-cfg-item.drag-over-stage { border-color: var(--accent); }
.stage-cfg-row1 { display: flex; align-items: center; gap: 10px; }
.stage-cfg-drag { color: var(--muted); font-size: 13px; cursor: grab; flex-shrink: 0; }
.stage-cfg-color {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.12); cursor: pointer; padding: 0; transition: transform .1s;
}
.stage-cfg-color:hover { transform: scale(1.08); }
.stage-cfg-name {
  flex: 1; background: transparent; border: 1px solid transparent; color: var(--text);
  font-family: var(--ff-display, inherit); font-size: 14px; font-weight: 700; padding: 4px 7px; border-radius: 7px;
  transition: background .12s, border-color .12s;
}
.stage-cfg-name:hover { border-color: rgba(255,255,255,.1); }
.stage-cfg-name:focus { background: var(--bg); border-color: var(--accent); outline: none; }
.stage-cfg-del {
  background: none; border: none; color: var(--muted); padding: 4px 6px;
  font-size: 13px; opacity: 0; transition: opacity .12s; flex-shrink: 0;
}
.stage-cfg-item:hover .stage-cfg-del { opacity: 1; }
.stage-cfg-del:hover { color: var(--red); opacity: 1; }
.stage-cfg-row2 {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 12px 0 0 36px; padding-top: 12px; border-top: 1px solid var(--border);
}
.stage-cfg-field { display: flex; align-items: center; gap: 6px; }
.stage-cfg-field label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stage-cfg-mode {
  padding: 5px 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 12px; cursor: pointer;
}
.stage-cfg-autotxt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.stage-cfg-textcolor {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.12); cursor: pointer; padding: 0;
}
.stage-cfg-textcolor:disabled { opacity: .4; cursor: not-allowed; }

/* Ajuste 2 (mockup aprovado): 3 botões diretos — Fundo / Texto / Bolinha — sem modo */
.stage-cfg-swatch-field { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.stage-cfg-swatch-field label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stage-cfg-swatch {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.14); cursor: pointer; padding: 0; transition: transform .1s;
}
.stage-cfg-swatch:hover { transform: scale(1.08); }
.stage-cfg-swatch.none { background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 4px, transparent 4px, transparent 8px) !important; }
.stage-cfg-preview { margin-left: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.stage-cfg-preview label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stage-cfg-preview-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px;
  font-weight: 600; font-size: 12.5px; white-space: nowrap;
}
.preview-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }

.stage-add-btn {
  background: none; border: 1px dashed var(--border); color: var(--muted);
  padding: 10px 14px; border-radius: 10px; font-size: 13px; text-align: left;
  margin-top: 6px; transition: border-color .12s, color .12s;
}

/* ── Seletor de cor próprio (popover, substitui o nativo do navegador) ── */
.color-picker-pop {
  position: fixed; z-index: 999; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.5); width: 232px;
}
.cp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.cp-swatch {
  width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent;
  cursor: pointer; transition: transform .1s; padding: 0;
}
.cp-swatch:hover { transform: scale(1.12); }
.cp-swatch.selected { border-color: var(--cyan, #00F6F5); box-shadow: 0 0 0 2px rgba(0,246,245,.3); }
.cp-custom { display: flex; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; }
.cp-hex {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 6px 8px; font-size: 12px; font-family: monospace;
}
.cp-hex:focus { border-color: var(--accent); outline: none; }
.cp-apply {
  background: var(--accent); border: none; border-radius: 6px; color: #fff;
  padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.cp-apply:hover { opacity: .88; }
.stage-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.pipe-cfg-empty { color: var(--muted); font-size: 13px; padding: 32px 0; text-align: center; }
.pipeline-cfg-left-label, .pipeline-cfg-right-label {
  font-size: 11px; font-weight: 700; color: var(--text-subtle); text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 12px;
}
/* gear btn na toolbar de pipeline */
.pipe-cfg-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 4px 8px; border-radius: 6px; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 4px; transition: color .12s, border-color .12s;
}
.pipe-cfg-btn:hover { color: var(--text); border-color: var(--muted); }

/* ── Bulk action bar (ações em massa) ───────────────── */
.bulk-action-bar { display:flex; align-items:center; gap:12px; padding:8px 12px; background:rgba(99,102,241,.1); border:1px solid rgba(99,102,241,.3); border-radius:8px; margin-bottom:12px; flex-wrap:wrap; }
.bulk-action-bar.hidden { display:none; }
.bulk-count { font-size:13px; font-weight:600; color:var(--accent); white-space:nowrap; }
.bulk-actions { display:flex; gap:6px; flex-wrap:wrap; }
.th-check, .td-check { width:32px; padding:4px 8px !important; text-align:center; }
.contact-check { cursor:pointer; accent-color:var(--accent); width:14px; height:14px; }
tr.row-selected td { background:rgba(99,102,241,.07); }
tr.row-active td { background:rgba(99,102,241,.13); }
#contacts-tbody tr[data-contact-id] { cursor:pointer; }
#contacts-tbody tr[data-contact-id]:hover td { background:rgba(255,255,255,.04); }

/* ── Contacts layout (main + side panel) ──────────────── */
.contacts-layout { display:flex; gap:0; min-height:0; overflow:hidden; }
/* main = coluna: barra + contagem ficam fixas; só a tabela rola (thead sticky) */
.contacts-main, #contacts-main { flex:1; min-width:0; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.contacts-table-wrap { flex:1; min-height:0; overflow:auto; }

/* sortable headers */
.th-sortable { cursor:pointer; user-select:none; white-space:nowrap; }
.th-sortable:hover { color:var(--accent); }
.th-sorted { color:var(--accent); }
.sort-arrow { font-size:11px; opacity:.7; }

/* ── Lista de contatos v2 (aprovado) — header sutil, avatares, chips ───── */
.contacts-table-wrap thead th{ background:#070E17 !important; color:var(--muted) !important;
  font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.08em;
  padding:12px 14px; border-bottom:1px solid var(--border); white-space:nowrap;
  position:sticky; top:0; z-index:3; }
.contacts-table-wrap thead th.th-sorted, .contacts-table-wrap .th-sortable:hover{ color:var(--text) !important; }
.contacts-table-wrap tbody td{ padding:11px 14px; border-bottom:1px solid rgba(140,180,220,.05); white-space:nowrap; vertical-align:middle; }
#contacts-tbody tr[data-contact-id]:hover td{ background:var(--sd-raise); }
#contacts-tbody tr[data-contact-id]:hover td:first-child{ box-shadow:inset 2px 0 0 var(--accent); }

.ct-who{ display:flex; align-items:center; gap:11px; }
.ct-av{ width:32px; height:32px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  font-family:var(--ff-display, inherit); font-weight:700; font-size:12px; color:var(--bg-deep, #04090F); }
.ct-av.av-g1{ background:linear-gradient(135deg,#00F6F5,#0EA399); }
.ct-av.av-g2{ background:linear-gradient(135deg,#D24EFF,#B66FFF); }
.ct-av.av-g3{ background:linear-gradient(135deg,#B66FFF,#00F6F5); }
.ct-av.av-g4{ background:linear-gradient(135deg,#3DE1B0,#00F6F5); }
.ct-nm{ font-size:13.5px; font-weight:600; color:var(--text); }
.ct-mono{ font-variant-numeric:tabular-nums; color:var(--text-secondary, var(--text)); }
.ct-src{ display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--text-secondary, var(--text)); }
.ct-src-dot{ width:6px; height:6px; border-radius:50%; background:var(--lilas); flex-shrink:0; }
.ct-resp{ display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--text-secondary, var(--text)); }
.ct-resp-av{ width:22px; height:22px; border-radius:50%; background:var(--sd-raise-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; font-size:9px; font-weight:700; color:var(--muted); flex-shrink:0; }
.ct-tags{ display:flex; gap:5px; flex-wrap:wrap; white-space:normal; }
.ct-chip{ font-size:10.5px; color:var(--text-secondary, var(--text)); background:var(--sd-raise-2); border:1px solid var(--border); border-radius:6px; padding:2px 7px; white-space:nowrap; }
.ct-chip.meta{ color:var(--accent); background:rgba(0,246,245,.08); border-color:rgba(0,246,245,.2); }
.ct-chip.more{ color:var(--muted); }
.ct-date{ font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
/* Coluna Conversar (balãozinho) entre Nome e Empresa */
.th-chat{ width:44px; }
.td-chat{ width:44px; text-align:center; }
.ct-chat-btn{ display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:9px;
  background:transparent; border:1px solid transparent; color:var(--muted); cursor:pointer;
  transition:color .15s, background .15s, border-color .15s; }
.ct-chat-btn svg{ width:17px; height:17px; }
.ct-chat-btn:hover{ color:var(--accent); background:rgba(0,246,245,.08); border-color:rgba(0,246,245,.25); }
/* checkbox custom na lista (tira o branco nativo gritante) */
.contacts-table-wrap .contact-check, .contacts-table-wrap #select-all-contacts{
  appearance:none; -webkit-appearance:none; width:16px; height:16px; border-radius:5px; margin:0; flex-shrink:0;
  border:1.5px solid var(--sd-border-2); background:var(--bg); cursor:pointer; position:relative; vertical-align:middle; }
.contacts-table-wrap .contact-check:hover, .contacts-table-wrap #select-all-contacts:hover{ border-color:var(--accent); }
.contacts-table-wrap .contact-check:checked, .contacts-table-wrap #select-all-contacts:checked{ background:#0EA399; border-color:transparent; }
.contacts-table-wrap .contact-check:checked::after, .contacts-table-wrap #select-all-contacts:checked::after{
  content:''; position:absolute; left:5px; top:2px; width:4px; height:8px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }

/* btn-danger */
.btn-danger { background:rgba(239,68,68,.15); border:1px solid rgba(239,68,68,.4); color:#f87171; border-radius:6px; padding:6px 14px; font-size:13px; cursor:pointer; transition:all .15s; }
.btn-danger:hover { background:rgba(239,68,68,.25); border-color:#f87171; }
.btn-danger.btn-sm { padding:4px 10px; font-size:12px; }

/* ═══════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM (sd-*) — blocos reutilizáveis do redesign da plataforma.
   Fundação extraída do painel de contato; reusar nas próximas telas em vez
   de reinventar. Cores/fontes vêm dos tokens da marca (sirius-ui.css).
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --sd-surface-2: rgba(255,255,255,.035);   /* fundo de campo/card interno */
  --sd-border-2:  rgba(255,255,255,.08);    /* borda de componente interno */
  --sd-hair:      rgba(255,255,255,.05);    /* divisória fina */
  --sd-raise:     #0E1926;                  /* superfície elevada (ícone, botão sec) */
  --sd-raise-2:   #12212F;                  /* superfície elevada 2 (hover, chip) */
  --sd-green:     #3DE1B0;                  /* status positivo (verde real, não o cyan) */
  --bg-2:         #070E17;                  /* fundo de coluna/tabela */
  --line-2:       rgba(140,180,220,.16);    /* borda de destaque */
}

/* Avatar com anel de brilho da marca */
.sd-avatar { width:60px; height:60px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:var(--ff-display, inherit); font-weight:700; font-size:21px; color:var(--bg-deep, #040C13);
  background:var(--grad-primary, var(--accent)); flex-shrink:0;
  box-shadow:0 0 0 3px var(--surface), 0 0 0 4px var(--sd-border-2), 0 8px 24px rgba(210,78,255,.28); }

/* Label de seção (uppercase, discreto) */
.sd-seclabel { font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); margin:0 0 10px; }

/* Campo: caixa de ícone + (label pequeno / valor) */
.sd-field { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--sd-hair); }
.sd-field:last-child { border-bottom:none; }
.sd-field-ico { width:26px; height:26px; border-radius:7px; background:var(--sd-surface-2); display:flex; align-items:center; justify-content:center; flex-shrink:0; color:var(--muted); }
.sd-field-ico svg { width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.sd-field-main { min-width:0; flex:1; }
.sd-field-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.sd-field-value { font-size:13px; color:var(--text); margin-top:1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sd-field-value.sd-blank { color:var(--muted); font-style:italic; white-space:nowrap; }

/* Quick action: ícone em cima, label embaixo */
.sd-qbtn { flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 6px; border-radius:11px;
  border:1px solid var(--border); background:var(--sd-surface-2); cursor:pointer; font-size:11.5px; color:var(--text-secondary, var(--text)); font-weight:600;
  transition:border-color .15s, color .15s, background .15s; font-family:inherit; }
.sd-qbtn svg { width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.sd-qbtn:hover { border-color:rgba(0,246,245,.35); color:var(--accent); }
.sd-qbtn.primary { background:rgba(0,246,245,.08); border-color:rgba(0,246,245,.35); color:var(--accent); }
.sd-qbtn.primary:hover { background:rgba(0,246,245,.14); }

/* Linha-lista clicável (deal, item) */
.sd-listrow { display:flex; align-items:center; gap:12px; padding:12px; border-radius:11px; background:var(--sd-surface-2); border:1px solid var(--border); margin-bottom:8px; cursor:pointer; transition:border-color .15s; }
.sd-listrow:hover { border-color:rgba(0,246,245,.3); }
.sd-listrow-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; box-shadow:0 0 0 1px rgba(255,255,255,.2); }
.sd-listrow-main { flex:1; min-width:0; }
.sd-listrow-title { font-size:13px; font-weight:600; color:var(--text); }
.sd-listrow-sub { font-size:11px; color:var(--muted); margin-top:2px; }
.sd-listrow-val { font-size:12.5px; font-weight:700; color:var(--accent); font-variant-numeric:tabular-nums; }

/* Timeline vertical */
.sd-timeline { position:relative; padding-left:20px; }
.sd-timeline::before { content:''; position:absolute; left:4px; top:4px; bottom:4px; width:1px; background:var(--sd-border-2); }
.sd-tl-item { position:relative; padding-bottom:16px; }
.sd-tl-item:last-child { padding-bottom:0; }
.sd-tl-dot { position:absolute; left:-20px; top:3px; width:9px; height:9px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 3px rgba(0,246,245,.15); }
.sd-tl-desc { font-size:12.5px; color:var(--text-secondary, var(--text)); line-height:1.5; }
.sd-tl-meta { font-size:11px; color:var(--muted); margin-top:3px; }
.sd-tl-meta .ref { color:var(--lilas); }

/* Estado vazio */
.sd-empty { text-align:center; padding:28px 16px; color:var(--muted); font-size:12.5px; }
.sd-listrow-current { cursor:default; opacity:.9; border-color:rgba(0,246,245,.3); }
.sd-listrow-now { font-size:10px; color:var(--accent); font-weight:700; margin-left:4px; }
.sd-alert { font-size:10px; font-weight:700; color:var(--amber, #FFB84D); background:rgba(255,184,77,.12); border:1px solid rgba(255,184,77,.35); border-radius:99px; padding:2px 8px; white-space:nowrap; flex-shrink:0; }

/* ── Painel do negócio v2 — mesma família do painel de contato ─────────── */
/* Header imersivo: escapa o padding do panel-body pra ir edge-to-edge */
.dp-hero { position:relative; display:flex; flex-direction:column; align-items:center; text-align:center; overflow:hidden;
  margin:-20px -20px 18px; padding:26px 20px 18px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(0,246,245,.13), transparent 62%),
    radial-gradient(90% 70% at 85% 0%, rgba(210,78,255,.09), transparent 60%); }
.dp-hero::after { content:''; position:absolute; inset:0; pointer-events:none; opacity:.7;
  background-image:
    radial-gradient(1px 1px at 22% 26%, #cfeaff, transparent), radial-gradient(1.5px 1.5px at 76% 30%, #cfeaff, transparent),
    radial-gradient(1px 1px at 60% 14%, #bfe4ff, transparent), radial-gradient(1px 1px at 88% 16%, #cfeaff, transparent),
    radial-gradient(1px 1px at 12% 44%, #a9d6f5, transparent); }
.dp-hero-avwrap { position:relative; width:66px; height:66px; margin-bottom:12px; z-index:2; }
.dp-hero-avwrap::before { content:''; position:absolute; inset:-5px; border-radius:50%; border:1px solid rgba(0,246,245,.28);
  border-top-color:rgba(210,78,255,.7); border-right-color:rgba(0,246,245,.5); animation:cdp-spin 9s linear infinite; }
@media (prefers-reduced-motion:reduce){ .dp-hero-avwrap::before{ animation:none; } }
.dp-hero-av { position:absolute; inset:0; width:66px; height:66px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:var(--ff-display, inherit); font-weight:700; font-size:22px; color:var(--bg-deep, #04090F);
  background:var(--grad-primary, var(--accent)); box-shadow:0 0 0 4px var(--surface), 0 10px 30px rgba(0,246,245,.28), 0 6px 20px rgba(210,78,255,.26); }
.dp-hero-info { min-width:0; width:100%; z-index:2; }
.dp-hero-title { font-family:var(--ff-display, inherit); font-size:19px; font-weight:700; letter-spacing:-.01em; color:var(--text); line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:0 8px; }
.dp-hero-sub { display:inline-flex; align-items:center; gap:9px; margin-top:9px; }
.dp-hero-stage { font-size:11.5px; font-weight:600; padding:3px 10px; border-radius:99px; }
.dp-hero-val { font-size:14px; font-weight:700; color:var(--accent); font-variant-numeric:tabular-nums; }

/* Abas do negócio: mesmo indicador em degradê do painel de contato */
.dp-tabs { display:flex; gap:16px; border-bottom:1px solid var(--sd-hair); margin-bottom:14px; }
.dp-tab { position:relative; flex:none; background:transparent; border:none; color:var(--muted); font-size:12.5px; font-weight:600; padding:10px 0 11px; cursor:pointer; font-family:inherit; }
.dp-tab.active { color:var(--text); }
.dp-tab.active::after { content:''; position:absolute; left:0; right:0; bottom:-1px; height:2px; border-radius:2px; background:var(--grad-primary, var(--accent)); box-shadow:0 0 10px rgba(0,246,245,.5); }
.dp-tab:hover:not(.active) { color:var(--text-secondary, var(--text)); }

/* ── Contact Detail Panel (CDP) — REDESIGN v2 (aprovado) ───────────────── */
.contact-detail-panel { width:404px; flex-shrink:0; border-left:1px solid var(--border); background:var(--surface); display:flex; flex-direction:column; overflow:hidden; transition:width .2s; }
.contact-detail-panel.hidden { width:0; border-left:none; }
.contact-detail-panel.open { width:404px; }

/* Header imersivo: o contato como uma estrela (glow + órbita + campo estelar) */
.cdp-header { position:relative; display:flex; flex-direction:column; align-items:center; padding:30px 24px 20px; text-align:center; overflow:hidden;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(0,246,245,.13), transparent 62%),
    radial-gradient(90% 70% at 85% 0%, rgba(210,78,255,.09), transparent 60%); }
.cdp-header::after { content:''; position:absolute; inset:0; pointer-events:none; opacity:.7;
  background-image:
    radial-gradient(1px 1px at 20% 24%, #cfeaff, transparent), radial-gradient(1.5px 1.5px at 78% 30%, #cfeaff, transparent),
    radial-gradient(1px 1px at 62% 14%, #bfe4ff, transparent), radial-gradient(1px 1px at 90% 12%, #cfeaff, transparent),
    radial-gradient(1px 1px at 33% 8%, #cfeaff, transparent), radial-gradient(1px 1px at 8% 40%, #a9d6f5, transparent); }
.cdp-close { position:absolute; top:14px; right:14px; z-index:3; width:30px; height:30px; border-radius:10px; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.04); border:1px solid var(--border); color:var(--muted); cursor:pointer; line-height:0; transition:color .15s, background .15s, border-color .15s, transform .2s; }
.cdp-close:hover { color:var(--text); background:rgba(255,255,255,.08); border-color:var(--sd-border-2); transform:rotate(90deg); }

/* Botões de fechar — X moderno em SVG, unificado no sistema */
.cdp-close svg, .panel-close svg, .tag-modal-close svg, .cs-close-btn svg { width:16px; height:16px; display:block; }
.cdp-av-wrap { position:relative; width:88px; height:88px; margin:2px 0 15px; z-index:2; }
.cdp-av-wrap::before { content:''; position:absolute; inset:-6px; border-radius:50%; border:1px solid rgba(0,246,245,.28);
  border-top-color:rgba(210,78,255,.7); border-right-color:rgba(0,246,245,.5); animation:cdp-spin 9s linear infinite; }
@keyframes cdp-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce){ .cdp-av-wrap::before { animation:none; } }
.cdp-avatar { position:absolute; inset:0; width:88px; height:88px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:var(--ff-display, inherit); font-weight:700; font-size:28px; color:var(--bg-deep, #040C13); flex-shrink:0;
  background:var(--grad-primary, var(--accent)); box-shadow:0 0 0 4px var(--surface), 0 10px 34px rgba(0,246,245,.30), 0 6px 22px rgba(210,78,255,.28); }
.cdp-info { text-align:center; z-index:2; }
.cdp-name { font-family:var(--ff-display, inherit); font-size:23px; font-weight:700; letter-spacing:-.02em; color:var(--text); line-height:1.1; }
.cdp-sub { display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--muted); margin-top:9px; }
.cdp-sub .cdp-dot { width:7px; height:7px; border-radius:50%; background:var(--sd-green); box-shadow:0 0 8px var(--sd-green); flex-shrink:0; }
.cdp-sub b { color:var(--text); font-weight:600; }

/* Faixa de métricas */
.cdp-stats { display:flex; padding:2px 12px 18px; }
.cdp-stat { flex:1; text-align:center; padding:0 6px; position:relative; }
.cdp-stat + .cdp-stat::before { content:''; position:absolute; left:0; top:14%; height:72%; width:1px; background:var(--sd-hair); }
.cdp-stat-v { font-family:var(--ff-display, inherit); font-size:18px; font-weight:700; letter-spacing:-.01em; font-variant-numeric:tabular-nums; color:var(--text); }
.cdp-stat-l { font-size:9.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-top:4px; }

/* Ações: 1 CTA vivo + secundárias em ícone */
.cdp-quick { display:flex; gap:9px; padding:0 20px 18px; }
.cdp-quick .cdp-edit-full { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:8px; height:44px; border-radius:12px; background:var(--sd-raise); border:1px solid var(--border); color:var(--text-secondary, var(--text)); font-family:var(--ff-display, inherit); font-weight:600; font-size:13.5px; cursor:pointer; transition:.12s; }
.cdp-quick .cdp-edit-full:hover { color:var(--accent); border-color:var(--sd-border-2); background:var(--sd-raise-2); }
.cdp-quick .cdp-edit-full svg { width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.cdp-cta { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:8px; height:44px; border:none; cursor:pointer;
  border-radius:12px; font-family:var(--ff-display, inherit); font-weight:700; font-size:13.5px; color:var(--bg-deep, #04090F); background:var(--grad-primary, var(--accent));
  box-shadow:0 8px 22px rgba(0,246,245,.22); transition:transform .12s, box-shadow .12s; }
.cdp-cta:hover { transform:translateY(-1px); box-shadow:0 12px 28px rgba(0,246,245,.34); }
.cdp-cta svg { width:17px; height:17px; stroke:var(--bg-deep, #04090F); fill:none; stroke-width:2.2; }
.cdp-ico { width:44px; height:44px; border-radius:12px; flex-shrink:0; display:flex; align-items:center; justify-content:center; background:var(--sd-raise); border:1px solid var(--border); color:var(--muted); cursor:pointer; transition:.12s; }
.cdp-ico:hover { color:var(--accent); border-color:var(--sd-border-2); background:var(--sd-raise-2); }
.cdp-ico svg { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

/* Abas com indicador em degradê */
.cdp-tabs { display:flex; gap:16px; padding:0 22px; border-bottom:1px solid var(--sd-hair); }
.cdp-tab { position:relative; background:none; border:none; color:var(--muted); padding:12px 0 13px; font-size:12.5px; font-weight:600; cursor:pointer; transition:color .15s; font-family:inherit; }
.cdp-tab.active { color:var(--text); }
.cdp-tab.active::after { content:''; position:absolute; left:0; right:0; bottom:-1px; height:2px; border-radius:2px; background:var(--grad-primary, var(--accent)); box-shadow:0 0 10px rgba(0,246,245,.5); }
.cdp-tab:hover:not(.active) { color:var(--text-secondary, var(--text)); }
.cdp-tab-count { opacity:.6; font-weight:600; }

/* CDP body */
.cdp-body { flex:1; overflow-y:auto; padding:18px 22px 24px; }
.cdp-section { margin-bottom:22px; }
.cdp-section:last-child { margin-bottom:0; }
.cdp-tags { display:flex; flex-wrap:wrap; gap:7px; }
.cdp-actions { display:flex; gap:8px; }
.cdp-note-input { width:100%; background:var(--sd-surface-2); border:1px solid var(--border); color:var(--text); border-radius:10px; padding:12px; font-size:13px; resize:vertical; min-height:88px; box-sizing:border-box; font-family:inherit; }
.cdp-note-input:focus { outline:none; border-color:var(--accent); }

/* Campo v2: ícone maior em superfície elevada, respiro, vazio como convite */
.sd-field { display:flex; align-items:center; gap:13px; padding:11px 0; border-bottom:1px solid rgba(140,180,220,.05); }
.sd-field-ico { width:34px; height:34px; border-radius:10px; background:var(--sd-raise); color:var(--muted); }
.sd-field-ico svg { width:15px; height:15px; }
.sd-field-label { font-size:10px; }
.sd-field-value { font-size:14px; font-weight:500; margin-top:2px; }
.sd-field-value.add { color:var(--accent); font-weight:500; font-style:normal; cursor:pointer; display:inline-flex; align-items:center; gap:5px; opacity:.9; white-space:nowrap; }
.sd-field-value.add:hover { opacity:1; }
.sd-field-value.add svg { width:13px; height:13px; stroke:var(--accent); fill:none; stroke-width:2; }

/* ── C10: Chat sidebar (notas + tarefas) ────────────── */
.chat-sidebar { width:280px; flex-shrink:0; border-left:1px solid var(--border); background:var(--surface); display:flex; flex-direction:column; overflow:hidden; }
.chat-sidebar.hidden { display:none; }
#app.conv-mode .chat-sidebar { display:flex; }
#app.conv-mode .chat-sidebar.hidden { display:none; }
.cs-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--border); font-size:13px; font-weight:600; color:var(--text); flex-shrink:0; }
.cs-close-btn { display:flex; align-items:center; justify-content:center; width:30px; height:30px; background:none; border:1px solid transparent; color:var(--muted); cursor:pointer; line-height:0; padding:0; border-radius:10px; transition:color .15s, background .15s, border-color .15s, transform .2s; }
.cs-close-btn:hover { color:var(--text); background:rgba(255,255,255,.06); border-color:var(--border); transform:rotate(90deg); }
.cs-body { flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:14px; }
.cs-block { background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:10px 12px; display:flex; flex-direction:column; gap:8px; }
.cs-block-title { font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; display:flex; align-items:center; gap:6px; }
.cs-notes-ta { width:100%; min-height:80px; max-height:180px; resize:vertical; background:var(--surface); border:1px solid var(--border); border-radius:6px; color:var(--text); font-size:13px; padding:8px; font-family:inherit; line-height:1.4; }
.cs-notes-ta:focus { border-color:var(--accent); outline:none; }
.cs-notes-save-btn { align-self:flex-end; }
.cs-loading, .cs-empty { font-size:12px; color:var(--muted); padding:8px 0; text-align:center; }
.cs-task { display:flex; align-items:center; gap:8px; padding:6px 4px; border-bottom:1px solid var(--border); }
.cs-task:last-child { border-bottom:none; }
.cs-task-check { cursor:pointer; accent-color:var(--accent); width:14px; height:14px; flex-shrink:0; }
.cs-task-title { flex:1; font-size:13px; color:var(--text); }
.cs-task.done .cs-task-title { text-decoration:line-through; color:var(--muted); }
.cs-task-del { background:none; border:none; color:var(--muted); cursor:pointer; font-size:13px; padding:0 2px; opacity:.6; flex-shrink:0; }
.cs-task-del:hover { opacity:1; color:var(--red); }
.cs-add-task-form { padding:6px 4px 8px; }
.cs-add-task-form input { width:100%; margin-bottom:4px; }
.conv-sidebar-btn.active { color:var(--accent); background:rgba(99,102,241,.12); border-radius:6px; }

/* ── Tag filter dropdown (A3) ────────────────────────── */
/* Modal centralizado do gerenciador de tags (antes era dropdown ancorado) */
.tag-modal-overlay { position:fixed; inset:0; z-index:200; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.6); }
.tag-modal { background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:22px; width:min(440px,92vw); max-height:80vh; display:flex; flex-direction:column; box-shadow:0 30px 80px rgba(0,0,0,.55); }
.tag-modal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.tag-modal-title { font-family:var(--ff-display, inherit); font-size:18px; font-weight:700; letter-spacing:-.01em; }
.tag-modal-close { background:var(--bg-2, #070E17); border:1px solid var(--border); color:var(--muted); width:30px; height:30px; border-radius:10px; cursor:pointer; line-height:0; display:flex; align-items:center; justify-content:center; transition:color .15s, border-color .15s, background .15s, transform .2s; }
.tag-modal-close:hover { color:var(--text); border-color:var(--cyan, #00F6F5); background:rgba(0,246,245,.06); transform:rotate(90deg); }
.tag-modal-list { overflow-y:auto; margin:2px -4px 0; padding:0 4px; }
.tag-option { display:flex; align-items:center; gap:8px; padding:7px 10px; border-radius:9px; cursor:pointer; font-size:13px; color:var(--text); user-select:none; transition:background .12s; }
.tag-option:hover { background:var(--bg-2, #070E17); }
.tag-option:hover .tag-mgr-actions { opacity:1; }
.tag-option.sel { color:var(--cyan, #00F6F5); }
.tag-option.sel .tag { background:rgba(0,246,245,.14); border-color:var(--cyan, #00F6F5); color:var(--cyan, #00F6F5); }
.tag-mgr-add { padding:2px 2px 9px; margin-bottom:7px; border-bottom:1px solid var(--border); }
.tag-mgr-add input { width:100%; background:var(--bg-2, #070E17); border:1px solid var(--border); color:var(--text); border-radius:9px; padding:8px 11px; font-size:12.5px; box-sizing:border-box; }
.tag-mgr-add input:focus { outline:none; border-color:var(--cyan, #00F6F5); box-shadow:0 0 0 3px rgba(0,246,245,.1); }
.tag-mgr-empty { padding:12px 8px; font-size:12px; color:var(--muted); text-align:center; }
.tag-mgr-actions { margin-left:auto; display:flex; gap:2px; opacity:0; transition:opacity .12s; flex-shrink:0; }
.tag-mgr-rename, .tag-mgr-delete { background:none; border:none; color:var(--muted); cursor:pointer; padding:4px; border-radius:6px; display:flex; align-items:center; }
.tag-mgr-rename:hover { color:var(--cyan, #00F6F5); background:var(--bg-2, #070E17); }
.tag-mgr-delete:hover { color:#ef4444; background:var(--bg-2, #070E17); }
.tag-option-editing { cursor:default; padding:2px 4px; }
.tag-option-editing:hover { background:none; }
.tag-mgr-rename-input { width:100%; background:var(--bg-2, #070E17); border:1px solid var(--cyan, #00F6F5); color:var(--text); border-radius:8px; padding:6px 9px; font-size:13px; box-sizing:border-box; }
.tag-mgr-rename-input:focus { outline:none; }
.tag-badge { display:inline-flex; align-items:center; justify-content:center; background:var(--grad-primary, var(--cyan, #00F6F5)); color:var(--bg-deep, #040C13); border-radius:10px; font-size:10px; font-weight:700; min-width:16px; height:16px; padding:0 4px; margin-left:2px; vertical-align:middle; }
.tag-clear-row { border-top:1px solid var(--border); margin-top:5px; padding-top:5px; }
.tag-clear-row button { width:100%; text-align:left; background:none; border:none; color:var(--muted); font-size:12px; cursor:pointer; padding:4px 8px; border-radius:4px; }
.tag-clear-row button:hover { color:var(--accent); background:var(--border); }
.tag-chips-row { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 12px; }
.tag-chips-row.hidden { display:none; }
.tag-chip { display:inline-flex; align-items:center; gap:3px; background:rgba(99,102,241,.14); border:1px solid var(--accent) !important; color:var(--accent) !important; }
.tag-chip-x { background:none; border:none; color:inherit; cursor:pointer; padding:0 0 0 2px; font-size:14px; line-height:1; opacity:.7; }
.tag-chip-x:hover { opacity:1; }

/* ── Editor de tags (chips removíveis + input) ─────────────────────────── */
.tag-editor { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.tag-editor .tag.tag-x { display:inline-flex; align-items:center; gap:4px; padding:2px 4px 2px 8px; }
.tag-x-btn { background:none; border:none; color:inherit; cursor:pointer; padding:0 2px; font-size:13px; line-height:1; opacity:.6; }
.tag-x-btn:hover { opacity:1; color:var(--danger, #ff5c5c); }
.tag-add-input { background:var(--bg); border:1px solid var(--border); color:var(--text); border-radius:5px; padding:3px 8px; font-size:11px; width:88px; }
.tag-add-input:focus { border-color:var(--accent); outline:none; width:120px; }

.quick-tag-pop {
  position: fixed; z-index: 999; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 240px;
}

/* ── Disparos / Broadcasts ─────────────────────────────────────────────── */
#broadcasts-container { display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
#broadcasts-body { padding: 20px; flex: 1; }
.bcast-list { display: flex; flex-direction: column; gap: 10px; }
.bcast-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: border-color .15s; }
.bcast-card:hover { border-color: rgba(0,246,245,.3); }
.bcast-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.bcast-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.bcast-card-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.bcast-badge { border-radius: 4px; padding: 2px 7px; font-size: 11px; font-weight: 600; }
.bcast-del-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px 4px; opacity: .7; }
.bcast-del-btn:hover { color: var(--red); opacity: 1; }
.bcast-progress { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.bcast-progress-bar { height: 100%; background: var(--cyan); border-radius: 2px; transition: width .5s; }
.bcast-progress-wrap { margin: 10px 0; }
.bcast-meta-small { font-size: 11px; color: var(--muted); }
.bcast-stat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.bcast-stat-tab { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 12px; color: var(--muted); cursor: pointer; }
.bcast-stat-tab.active { border-color: var(--cyan); color: var(--cyan); }
.bcast-detail { display: flex; flex-direction: column; gap: 12px; }
.bcast-detail-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bcast-detail-meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bcast-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bcast-table th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.bcast-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.03); }
.bcast-recipients { overflow-x: auto; }
/* Wizard */
.bcast-wizard { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.bcast-wizard-header { display: flex; align-items: center; gap: 16px; }
.bwiz-steps { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.bwiz-step { color: var(--muted); }
.bwiz-step.active { color: var(--cyan); font-weight: 600; }
.bwiz-step.done { color: var(--green); }
.bwiz-sep { color: var(--border); }
.bwiz-section { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.bwiz-type-btn { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 14px; font-size: 13px; color: var(--muted); cursor: pointer; transition: all .15s; }
.bwiz-type-btn.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0,246,245,.07); }
.bwiz-recipient-controls { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.bwiz-recipient-controls > input[type="text"], .bwiz-tag-input { height: 38px; }
.bwiz-selall-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; transition: border-color .15s, color .15s; }
.bwiz-selall-label:hover { border-color: var(--cyan); color: var(--text); }
.bwiz-selall-label input[type="checkbox"], .bwiz-contact-row input[type="checkbox"] { accent-color: var(--cyan); width: 15px; height: 15px; cursor: pointer; margin: 0; }
.bwiz-contact-count { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.bwiz-contact-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--bg); }
.bwiz-contact-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.bwiz-contact-row:hover { background: rgba(0,246,245,.06); }
.bwiz-contact-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bwiz-contact-name { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bwiz-contact-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bwiz-contact-co { font-size: 11px; color: var(--muted); }
.bwiz-contact-num { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bwiz-tag { font-size: 10px; background: rgba(0,246,245,.1); color: var(--cyan); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
/* Autocomplete custom da tag (substitui o datalist nativo) */
.bwiz-tag-wrap { position: relative; }
.bwiz-tag-input { min-width: 170px; }
.bwiz-tag-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 5px; max-height: 240px; overflow-y: auto; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.bwiz-tag-drop.hidden { display: none; }
.bwiz-tag-opt { padding: 8px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bwiz-tag-opt:hover { background: rgba(0,246,245,.1); color: var(--cyan); }
.bwiz-tag-empty { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.bwiz-review { display: flex; flex-direction: column; gap: 10px; }
.bwiz-review-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; font-size: 13px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.bwiz-review-row span { color: var(--muted); }
@media (max-width: 600px) {
  .bwiz-recipient-controls { grid-template-columns: 1fr 1fr; }
  .bwiz-selall-label { grid-column: 1 / -1; }
}

/* ── Agenda ───────────────────────────────────────────────────────────── */
.agenda-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 0 20px 20px; height: calc(100vh - 110px); overflow: hidden; }
.agenda-mini-cal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; height: fit-content; }
.agenda-timeline { overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; gap: 20px; }

/* Mini calendar */
.agmc-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.agmc-month { font-size: 13px; font-weight: 600; color: var(--text); }
.agmc-arrow { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 0 4px; line-height: 1; }
.agmc-arrow:hover { color: var(--text); }
.agmc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.agmc-wday { font-size: 10px; color: var(--muted); text-align: center; padding: 2px 0 6px; font-weight: 500; }
.agmc-cell { font-size: 12px; color: var(--text); text-align: center; padding: 5px 2px; border-radius: 5px; cursor: pointer; position: relative; line-height: 1.4; }
.agmc-cell:hover { background: rgba(255,255,255,.06); }
.agmc-cell.today { background: var(--cyan); color: #000; font-weight: 700; }
.agmc-cell.other { color: var(--muted); opacity: .4; cursor: default; }
.agmc-dot { display: block; width: 4px; height: 4px; background: var(--cyan); border-radius: 50%; margin: 1px auto 0; }
.agmc-cell.today .agmc-dot { background: rgba(0,0,0,.5); }
.agmc-today-btn { width: 100%; margin-top: 10px; padding: 6px; background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 12px; cursor: pointer; }
.agmc-today-btn:hover { border-color: var(--cyan); color: var(--cyan); }

/* Timeline */
.agt-loading, .agt-empty { color: var(--muted); font-size: 13px; padding: 40px 20px; text-align: center; }
.agt-day-group { display: flex; flex-direction: column; gap: 8px; }
.agt-day-group.past .agt-event-card { opacity: .55; }
.agt-day-header { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.agt-day-header.today .agt-day-label { color: var(--cyan); font-weight: 700; }
.agt-day-label { font-size: 13px; font-weight: 600; color: var(--text); }
.agt-day-count { font-size: 11px; color: var(--muted); }
.agt-day-events { display: flex; flex-direction: column; gap: 6px; }
.agt-event-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; transition: border-color .15s; }
.agt-event-card:hover { border-color: rgba(0,246,245,.3); }
.agt-event-left { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 36px; }
.agt-type-icon { font-size: 18px; }
.agt-event-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.agt-event-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.agt-event-title { font-size: 13px; font-weight: 500; color: var(--text); }
.agt-event-deal { font-size: 12px; color: var(--cyan); }
.agt-event-desc { font-size: 12px; color: var(--muted); }
.agt-event-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.agt-tag { font-size: 10px; background: rgba(0,246,245,.1); color: var(--cyan); border-radius: 3px; padding: 1px 6px; }
.agt-open-deal { background: none; border: none; color: var(--cyan); font-size: 12px; cursor: pointer; padding: 0; margin-top: 4px; text-align: left; }
.agt-open-deal:hover { text-decoration: underline; }
.agt-del-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px; opacity: .5; flex-shrink: 0; }
.agt-del-btn:hover { color: var(--red); opacity: 1; }

@media (max-width: 768px) {
  .agenda-layout { grid-template-columns: 1fr; height: auto; }
  .agenda-mini-cal { order: 1; }
  .agenda-timeline { order: 0; height: calc(100vh - 300px); }
}

/* ── Wizard: schedule tabs ────────────────────────────────────────────── */
.bwiz-sched-tabs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.bwiz-sched-tab { background: var(--bg); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 5px 14px; font-size: 12px; cursor: pointer; transition: all .15s; }
.bwiz-sched-tab.active { background: rgba(0,246,245,.12); border-color: var(--cyan); color: var(--cyan); }
.bwiz-sched-tab:hover:not(.active) { border-color: var(--text); color: var(--text); }
.bwiz-sched-panel { margin-top: 10px; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.bwiz-sched-panel label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.bwiz-sched-panel input[type="datetime-local"],
.bwiz-sched-panel input[type="time"],
.bwiz-sched-panel input[type="number"],
.bwiz-sched-panel select { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 8px; font-size: 13px; width: 100%; }

/* ── Wizard: source tabs ──────────────────────────────────────────────── */
.bwiz-src-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.bwiz-src-tab { background: var(--bg); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 5px 14px; font-size: 12px; cursor: pointer; transition: all .15s; }
.bwiz-src-tab.active { background: rgba(0,246,245,.12); border-color: var(--cyan); color: var(--cyan); }
.bwiz-src-tab:hover:not(.active) { border-color: var(--text); color: var(--text); }

/* ── Contacts toolbar actions group ──────────────────────────────── */
.contacts-toolbar-actions { display:flex; gap:6px; align-items:center; flex-shrink:0; }

/* ── Import Contacts wizard ───────────────────────────────────────── */
.imp-stepbar { display:flex; align-items:center; gap:8px; margin-bottom:22px; font-size:12px; }
.imp-step { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; border-radius:22px; background:var(--bg-2, #070E17); border:1px solid var(--border); color:var(--muted); font-weight:600; letter-spacing:.01em; transition:all .2s; }
.imp-step.active { background:rgba(0,246,245,.12); border-color:var(--cyan, #00F6F5); color:var(--cyan, #00F6F5); box-shadow:0 0 0 3px rgba(0,246,245,.08); }
.imp-step.done { background:rgba(61,225,176,.1); border-color:var(--sd-green, #3DE1B0); color:var(--sd-green, #3DE1B0); }
.imp-step-sep { color:var(--muted); font-size:13px; opacity:.5; }
.imp-drop { border:2px dashed var(--border); border-radius:14px; padding:36px 20px; text-align:center; cursor:pointer; transition:all .2s; color:var(--muted); font-size:14px; }
.imp-drop:hover, .imp-drop.drag { border-color:var(--cyan, #00F6F5); background:rgba(0,246,245,.05); color:var(--text); }
.imp-drop-icon { font-size:32px; margin-bottom:10px; }
.imp-paste { width:100%; background:var(--bg-2, #070E17); border:1px solid var(--border); color:var(--text); border-radius:10px; padding:11px 13px; font-size:12px; font-family:monospace; resize:vertical; box-sizing:border-box; }
.imp-paste:focus { outline:none; border-color:var(--cyan, #00F6F5); box-shadow:0 0 0 3px rgba(0,246,245,.1); }
.imp-table-wrap { max-height:280px; overflow-y:auto; border:1px solid var(--border); border-radius:12px; }
.imp-map-table { width:100%; border-collapse:collapse; font-size:13px; }
.imp-map-table th { background:var(--bg-2, #070E17); padding:10px 12px; text-align:left; color:var(--muted); font-weight:700; font-size:10.5px; text-transform:uppercase; letter-spacing:.07em; position:sticky; top:0; border-bottom:1px solid var(--border); }
.imp-map-table td { padding:9px 12px; border-bottom:1px solid var(--sd-hair, var(--border)); }
.imp-map-table tr:last-child td { border-bottom:none; }
.imp-col-name { font-weight:600; color:var(--text); width:160px; }
.imp-col-example { width:160px; max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.imp-map-sel { background:var(--bg-2, #070E17); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:6px 10px; font-size:12px; width:100%; }
.imp-map-sel:focus { outline:none; border-color:var(--cyan, #00F6F5); }
.imp-spinner { width:32px; height:32px; border:3px solid var(--border); border-top-color:var(--cyan, #00F6F5); border-radius:50%; animation:spin .8s linear infinite; margin:0 auto; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Custom Fields manager ────────────────────────────────────────── */
.cf-table-wrap { max-height:300px; overflow-y:auto; border:1px solid var(--border); border-radius:12px; margin-bottom:12px; }
.cf-table { width:100%; border-collapse:collapse; font-size:13px; }
.cf-table th { background:var(--bg-2, #070E17); padding:10px 12px; text-align:left; color:var(--muted); font-weight:700; position:sticky; top:0; border-bottom:1px solid var(--border); font-size:10.5px; text-transform:uppercase; letter-spacing:.07em; }
.cf-table td { padding:9px 12px; border-bottom:1px solid var(--sd-hair, var(--border)); }
.cf-table tr:last-child td { border-bottom:none; }
.cf-required { color:var(--red); font-size:11px; }
.cf-add-form { background:var(--bg-2, #070E17); border:1px solid var(--border); border-radius:12px; padding:14px; margin-top:8px; }
.cf-add-row { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.cf-add-row input, .cf-add-row select { background:var(--surface); border:1px solid var(--border); color:var(--text); border-radius:9px; padding:8px 11px; font-size:13px; }
.cf-add-row input:focus, .cf-add-row select:focus { outline:none; border-color:var(--cyan, #00F6F5); box-shadow:0 0 0 3px rgba(0,246,245,.1); }
.cf-add-row select { flex-shrink:0; min-width:160px; }
#cf-options { width:100%; background:var(--surface); border:1px solid var(--border); color:var(--text); border-radius:6px; padding:8px; font-size:13px; resize:vertical; box-sizing:border-box; margin-top:6px; }
#cf-options:focus { outline:none; border-color:var(--accent); }
.cf-add-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:10px; }
.cf-info { padding-top:6px; }

