/* ============================================================
   Groot CRM — Sistema de design
   Núcleo da marca (fundo, texto, cor de destaque, fonte) segue o
   design system oficial de 3 cores: Porcelain #F9F8F5 (fundo),
   Jet Black #272D2D (texto), Sapphire Sky #1570D5 (destaque/CTA).
   Fonte: Poppins (Montserrat reservada ao wordmark).

   As cores SEMÂNTICAS abaixo (admin/positive/alert) NÃO fazem parte
   dessas 3 cores de marca — são um sistema separado e intencional,
   mapeado aos 3 pilares do Método ADC: roxo #534AB7 (Autoridade —
   modo admin), teal #0E8F73 (Demanda — sucesso/qualificado), coral
   #C45A3A (Comercial — alerta/desqualificado). Mantidas como estão.
   ============================================================ */

:root {
  --ink: #272D2D;
  --ink-soft: #5C6363;
  --ink-faint: #9AA0A0;
  --bg: #F9F8F5;
  --surface: #FFFFFF;
  --border: rgba(39, 45, 45, 0.14);

  --brand: #1570D5;
  --brand-ink: #0E5CB0;
  --brand-soft: #E9F1FC;

  --admin: #534AB7;
  --admin-soft: #EDEAFA;

  --positive: #0E8F73;
  --positive-soft: #E3F5F0;

  --alert: #C45A3A;
  --alert-soft: #FBEAE4;

  --amber: #B8791A;
  --amber-soft: #FBF1DF;

  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

  --font-wordmark: 'Montserrat', -apple-system, 'Segoe UI', sans-serif; /* uso restrito: só o nome "CRM Groot" */
  --font-display: 'Poppins', -apple-system, 'Segoe UI', sans-serif;    /* títulos, botões, rótulos */
  --font-body: 'Poppins', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .navbar-brand, .btn, .btn-primary, button, .stat-value {
  font-family: var(--font-display);
}

h1 { font-size: 21px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.005em; }

a { color: var(--brand); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   Auth (login)
   ============================================================ */
.auth-body {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; box-sizing: border-box; padding: 24px 16px;
  background: linear-gradient(160deg, #14335E 0%, var(--brand) 140%);
}
.auth-body .auth-card { margin: auto; }
.auth-card {
  background: var(--surface); padding: 40px; border-radius: 16px; width: 340px;
  box-shadow: 0 24px 60px rgba(10, 14, 40, 0.35);
}
.auth-card h1 { color: var(--ink); font-size: 22px; font-family: var(--font-wordmark); }
.auth-card .subtitle { margin: 4px 0 20px; color: var(--ink-soft); font-size: 14px; font-family: var(--font-body); }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; font-family: var(--font-body); }
.alert-dismissible { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.alert-close {
  background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; padding: 0 2px;
  color: inherit; opacity: 0.5; flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }
.alert-error { background: var(--alert-soft); color: #8A3D26; }
.alert-success { background: var(--positive-soft); color: var(--positive); }

/* ============================================================
   Forms
   ============================================================ */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; color: var(--ink-soft); font-family: var(--font-body); }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-body); background: var(--surface); color: var(--ink);
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input[readonly] { background: var(--bg); color: var(--ink-soft); font-family: var(--font-mono); font-size: 13px; }

.btn {
  display: inline-block; padding: 9px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; font-size: 14px;
  font-weight: 700; transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-ink); }
.btn-block { width: 100%; margin-top: 16px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; text-decoration: underline; font-size: 13px; padding: 0; font-family: var(--font-body); }
.link-btn.danger { color: var(--alert); }
.btn-danger { background: var(--alert-soft); color: var(--alert); border-color: transparent; }
.btn-danger:hover { background: var(--alert); color: #fff; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  font-family: var(--font-body); letter-spacing: 0.02em; white-space: nowrap;
}
.badge-blue { background: var(--brand-soft); color: var(--brand); }
.badge-teal { background: rgba(14,143,115,0.12); color: var(--positive); }
.workspace-chip {
  display: inline-block; vertical-align: middle; margin-left: 10px; padding: 4px 12px; border-radius: 999px;
  background: rgba(24,71,232,0.1); color: var(--brand); font-size: 13px; font-weight: 700; font-family: var(--font-body);
}

/* ============================================================
   Layout: sidebar + main content
   ============================================================ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px; flex-shrink: 0; background: var(--ink); color: #fff;
  transition: width 0.2s ease; overflow: hidden;
}
.sidebar-inner {
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.mobile-nav-panel {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
}
.sidebar-strip { height: 4px; background: var(--brand); }
.sidebar.is-admin .sidebar-strip { background: var(--admin); }

.sidebar-brand {
  padding: 22px 20px 18px; font-family: var(--font-wordmark); font-weight: 800; font-size: 17px;
  border-bottom: 1px solid rgba(255,255,255,0.08); white-space: nowrap; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand .brand-mark { display: none; }
.sidebar.collapsed .sidebar-brand { padding: 22px 0 18px; justify-content: center; }
.sidebar.collapsed .sidebar-brand .brand-mark { display: inline; }

.brand-logo-img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; flex-shrink: 0; background: #fff; }
.brand-logo-letter {
  width: 30px; height: 30px; border-radius: 7px; background: var(--brand); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
}
.sidebar.is-admin .brand-logo-letter { background: var(--admin); }
.brand-text { overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand .mode-tag {
  display: block; font-family: var(--font-body); font-weight: 600; font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: rgba(255,255,255,0.5); margin-top: 4px;
}
.sidebar.is-admin .sidebar-brand .mode-tag { color: #C4BCEF; }

.workspace-scope {
  flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 14px 20px 10px;
}
.sidebar-workspaces-label {
  display: block; font-family: var(--font-body); font-weight: 700; font-size: 10.5px; letter-spacing: 0.05em;
  text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 10px;
}

.workspace-block { margin: 0 -10px 4px; }
.workspace-header {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  background: none; border: none; cursor: pointer; text-align: left;
  color: rgba(255,255,255,0.75); font-size: 13.5px; font-weight: 700; font-family: var(--font-body);
  transition: background 0.15s ease, color 0.15s ease;
}
.workspace-header:hover { background: rgba(255,255,255,0.06); color: #fff; }
.workspace-header.active { background: var(--brand); color: #fff; }
.workspace-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-chevron { width: 13px; height: 13px; flex-shrink: 0; transition: transform 0.15s ease; }
.workspace-block.open .workspace-chevron { transform: rotate(-180deg); }

.workspace-submenu {
  display: none; position: relative; padding: 4px 0 8px 22px; margin-top: 1px;
}
.workspace-submenu::before {
  content: ''; position: absolute; left: 16px; top: 0; bottom: 10px; width: 1px; background: rgba(255,255,255,0.12);
}
.workspace-block.open .workspace-submenu { display: block; }
.workspace-submenu a {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65); text-decoration: none; font-size: 13px; font-weight: 600; margin-bottom: 1px;
  transition: background 0.15s ease, color 0.15s ease;
}
.workspace-submenu a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.workspace-submenu a.active { background: rgba(255,255,255,0.12); color: #fff; }
.workspace-submenu svg { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar.collapsed .workspace-scope { padding: 10px 0 0; overflow-y: hidden; overflow-x: hidden; }
.sidebar.collapsed .sidebar-workspaces-label { display: none; }
.sidebar.collapsed .workspace-block { display: none; }
.sidebar.collapsed .workspace-block.current { display: block; }
.sidebar.collapsed .workspace-header { display: none; }
.sidebar.collapsed .workspace-submenu {
  display: flex !important; flex-direction: column; position: static; padding: 0; margin: 0;
}
.sidebar.collapsed .workspace-submenu::before { display: none; }
.sidebar.collapsed .workspace-submenu a { justify-content: center; padding: 10px 0; margin: 0 0 2px; }
.sidebar.collapsed .workspace-submenu .label { display: none; }
.sidebar-nav {
  flex: 1; padding: 14px 10px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: rgba(255,255,255,0.72);
  text-decoration: none; font-size: 14px; font-weight: 600; margin-bottom: 2px; transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.sidebar-nav svg { flex-shrink: 0; width: 19px; height: 19px; }

.sidebar-toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: none; border: none; border-top: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.55);
  padding: 10px; cursor: pointer; font-size: 12px; font-family: var(--font-body); font-weight: 600;
}
.sidebar-toggle:hover { color: #fff; }
.sidebar-toggle svg { width: 17px; height: 17px; transition: transform 0.2s ease; }

.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-brand .brand-text,
.sidebar.collapsed .sidebar-brand .mode-tag,
.sidebar.collapsed .sidebar-nav .label,
.sidebar.collapsed .sidebar-footer .user-name,
.sidebar.collapsed .sidebar-footer .back-link .label,
.sidebar.collapsed .sidebar-footer .sair-btn .label,
.sidebar.collapsed .sidebar-toggle .label { display: none; }
.sidebar.collapsed .sidebar-nav a { justify-content: center; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-footer {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 8px;
}

.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 13px; }
.sidebar-footer .user-name { display: block; color: #fff; font-weight: 700; margin-bottom: 4px; }
.sidebar-footer form { display: inline; }
.sidebar-footer .link-btn { color: rgba(255,255,255,0.6); }
.sidebar-footer .link-btn:hover { color: #fff; }
.sidebar-footer .back-link { display: block; color: rgba(255,255,255,0.6); text-decoration: none; font-size: 12px; margin-bottom: 8px; }
.sidebar-footer .back-link:hover { color: #fff; }
.sair-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 0;
  background: none; border: none; cursor: pointer; font-family: inherit; font-size: 13px;
}
.sair-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; }
.main-area > main { flex: 1; }
.container { max-width: none; margin: 0; padding: 28px 24px; overflow-x: auto; }
.container-narrow { max-width: 640px; margin: 0 auto; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { margin: 0; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }

/* ============================================================
   Cards / stats
   ============================================================ */
.cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }

.chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 24px; height: 300px;
  display: flex; flex-direction: column;
}
.chart-title {
  display: block; font-family: var(--font-display); font-weight: 800; font-size: 14px;
  color: var(--ink); margin-bottom: 14px;
}
.chart-card canvas { flex: 1; width: 100% !important; height: 100% !important; }
.stat-label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; font-family: var(--font-body); font-weight: 600; }
.stat-value { font-size: 22px; font-weight: 800; }
.stat-card.positive .stat-value { color: var(--positive); }
.stat-card.negative .stat-value { color: var(--alert); }

/* ============================================================
   Abas de status (filtro rápido de leads no topo da lista)
   ============================================================ */
.status-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 20px; overflow-x: auto; border-bottom: 1px solid var(--border); flex-wrap: nowrap; }
.leads-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.leads-toolbar .qual-pill, .leads-toolbar .btn { flex-shrink: 0; }
.status-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; font-size: 13px; font-weight: 700;
  color: var(--ink-soft); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent;
  font-family: var(--font-body); transition: color 0.15s ease, border-color 0.15s ease;
}
.status-tab:hover { color: var(--ink); }
.status-tab.active {
  color: #fff; background: var(--brand); border-bottom-color: var(--brand);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.status-tab-count {
  background: var(--bg); color: var(--ink-soft); border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700;
}
.status-tab.active .status-tab-count { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* ============================================================
   Tables
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table-scroll {
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; max-width: 100%;
  border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border);
}
.table-scroll .data-table { box-shadow: none; }
.data-table th, .data-table td { padding: 9px 11px; text-align: center; border-bottom: 1px solid #EFEEEA; font-size: 12.5px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table th { background: var(--ink); font-weight: 700; color: #fff; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; font-family: var(--font-body); white-space: nowrap; }
.data-table td.positive { color: var(--positive); font-weight: 700; }
.data-table td.negative { color: var(--alert); font-weight: 700; }
.empty-state { text-align: center; color: var(--ink-faint); padding: 32px !important; font-size: 14px; }
.row-desqualificado { background: var(--alert-soft); }
.row-desqualificado:hover { background: #f6ded6; }
.row-actions { white-space: nowrap; min-width: 70px; padding-left: 4px; }
.cell-notas { padding-right: 4px; }
.row-actions a, .row-actions form { display: inline-flex; vertical-align: middle; margin-left: 8px; }
.row-actions a:first-child, .row-actions form:first-child { margin-left: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: var(--radius-sm); border: none; background: none;
  color: var(--brand); transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit; cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--admin-soft); color: var(--admin); }
.icon-btn svg { width: 16px; height: 16px; display: block; }
.icon-btn-danger:hover { background: var(--alert-soft); color: var(--alert); }
.ad-spend-input { width: 78px; display: inline-block; padding: 4px 6px; font-size: 12.5px; }

.cell-notas { width: 40px; text-align: center; }
.notes-btn-filled { color: var(--positive); }
.notes-btn-filled:hover { background: var(--positive-soft); color: var(--positive); }

.cell-answers { white-space: nowrap; }
.answers-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: var(--radius-sm); border: none; background: none;
  color: var(--ink-soft); cursor: pointer; padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.answers-btn:hover { background: var(--brand-soft); color: var(--brand); }
.answers-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.answers-btn-filled { color: var(--brand); }

.respostas-popover-lista { max-height: 320px; overflow-y: auto; padding: 6px 0; }
.resposta-item { padding: 8px 14px; border-bottom: 1px solid var(--border); }
.resposta-item:last-child { border-bottom: none; }
.resposta-pergunta { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 2px; }
.resposta-valor { font-size: 13.5px; color: var(--ink); }

/* Painel de Respostas do Formulário: tema escuro, diferente do de Observações */
#respostas-popover { background: var(--ink); border-color: var(--ink); }
#respostas-popover .notas-popover-header { border-bottom-color: rgba(255, 255, 255, 0.12); color: #fff; }
#respostas-popover .notas-popover-close { color: rgba(255, 255, 255, 0.6); }
#respostas-popover .notas-popover-close:hover { color: #fff; }
#respostas-popover .resposta-item { border-bottom-color: rgba(255, 255, 255, 0.12); }
#respostas-popover .resposta-pergunta { color: rgba(255, 255, 255, 0.55); }
#respostas-popover .resposta-valor { color: #fff; }

.notas-popover {
  position: absolute; z-index: 200; width: 320px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(15, 22, 56, 0.18);
}
.notas-popover-header {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--ink);
}
.notas-popover-status { font-weight: 400; font-size: 12px; color: var(--muted); flex: 1; }
.notas-popover-close {
  border: none; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); padding: 0 2px;
}
.notas-popover-close:hover { color: var(--ink); }
.notas-popover textarea {
  display: block; width: 100%; min-height: 120px; border: none; padding: 10px;
  font-family: inherit; font-size: 13.5px; resize: vertical; box-sizing: border-box; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.notas-popover textarea:focus { outline: none; }

.data-table td a:not(.btn):not(.icon-btn) {
  color: var(--brand); text-decoration: none; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-sm);
  display: inline-block; transition: background 0.15s ease;
}
.data-table td a:not(.btn):not(.icon-btn):hover { background: var(--brand-soft); }

.month-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.month-link:hover { text-decoration: underline; }

.table-zebra tbody tr:nth-child(even) td { background: var(--bg); }
.table-zebra th, .table-zebra td { padding: 5px 11px; }
.table-zebra th, .table-zebra td { text-align: center; }
.table-zebra th:first-child, .table-zebra td:first-child { text-align: left; }
.table-zebra th:last-child, .table-zebra td:last-child { text-align: right; }

/* ============================================================
   Status — funil de estágio (elemento de assinatura)
   Cada status vira uma sequência de pontos conectados, mostrando
   o quanto o lead já andou no funil. Desqualificado quebra a
   sequência com um X, em vez de tentar encaixar numa progressão.
   ============================================================ */
.funnel-track { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; flex-shrink: 0; }
.funnel-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.funnel-dot.filled { background: var(--positive); }
.funnel-dot.current { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.funnel-line { width: 10px; height: 1.5px; background: var(--border); flex-shrink: 0; }
.funnel-line.filled { background: var(--positive); }
.funnel-x { width: 7px; height: 7px; border-radius: 50%; background: var(--alert); position: relative; flex-shrink: 0; }

.status-pill-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.status-select {
  padding: 5px 9px; font-size: 11.5px; border-radius: 20px; border: none; font-weight: 700;
  font-family: var(--font-body); cursor: pointer; min-width: max-content; width: auto; flex-shrink: 0;
  -webkit-appearance: menulist; appearance: menulist;
}
.status-Em-contato { background: var(--brand-soft); color: var(--brand-ink); }
.status-Qualificado { background: var(--positive-soft); color: var(--positive); }
.status-Desqualificado { background: var(--bg); color: var(--ink-soft); }
.status-Agendado { background: var(--amber-soft); color: var(--amber); }
.status-Em-negociação { background: var(--admin-soft); color: var(--admin); }
.status-Fechado { background: var(--positive-soft); color: var(--positive); }

/* ============================================================
   Criativos
   ============================================================ */
.objective-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; font-family: var(--font-body); }
.objective-lead { background: var(--brand-soft); color: var(--brand-ink); }
.objective-mensagem { background: var(--admin-soft); color: var(--admin); }
.objective-venda { background: var(--positive-soft); color: var(--positive); }
.objective-outro { background: var(--bg); color: var(--ink-soft); }
.qualificacao-bar-track { background: var(--bg); border-radius: 6px; height: 8px; width: 100%; overflow: hidden; }
.qualificacao-bar-fill { background: var(--positive); height: 100%; }
.creative-name { font-weight: 400; font-family: var(--font-display); }
.creative-campaign { font-size: 12px; color: var(--ink-soft); }

/* ============================================================
   Forms grid / Settings
   ============================================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; background: var(--surface); padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.form-group-full { grid-column: 1 / -1; }
.page-subtitle { color: var(--ink-soft); font-size: 13.5px; margin: 8px 0 20px; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 32px 0 20px; }
.status-row { margin-bottom: 8px; }
.status-row input { width: 100%; }
.field-hint { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.cell-answers { max-width: 260px; }
.answer-line { font-size: 12px; line-height: 1.5; }
.answer-key { color: var(--ink-soft); font-weight: 600; }
.cell-message { max-width: 280px; font-size: 12.5px; white-space: normal; word-break: break-word; }
.qual-select.qual-Qualificado { color: var(--positive); font-weight: 700; }
.qual-select.qual-Desqualificado { color: var(--alert); font-weight: 700; }

.drag-handle { cursor: grab; color: var(--ink-soft); width: 34px; }
.drag-handle svg { width: 16px; height: 16px; display: block; }
#funil-body tr.dragging { opacity: 0.45; background: var(--brand-soft, #E9F1FC); }
.status-edit-form { align-items: center; gap: 6px; }

.lead-star { color: #E8A400; margin-left: 6px; vertical-align: -1px; }
.lead-star svg { width: 14px; height: 14px; }

.qual-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 14px; flex-wrap: wrap; gap: 10px; }
.qual-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.qual-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
  text-decoration: none; font-size: 12.5px; font-weight: 700; transition: all 0.15s ease;
}
.qual-pill:hover { border-color: var(--brand); color: var(--brand); }
.qual-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.qual-pill-pos.active { background: var(--positive); border-color: var(--positive); }
.qual-pill-neg.active { background: var(--alert); border-color: var(--alert); }

.lead-locked { display: inline-flex; color: var(--ink-soft); opacity: 0.6; }
.lead-locked svg { width: 15px; height: 15px; }

.cell-valor { min-width: 150px; }
.valor-form { display: inline-flex; align-items: center; gap: 4px; }
.valor-prefix { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.valor-input {
  width: 90px; padding: 5px 6px; font-size: 12.5px; border: none; border-radius: var(--radius-sm);
  background: var(--bg);
}
.cell-valor-destaque .valor-input { border-color: var(--positive); background: var(--positive-soft); font-weight: 700; }
.valor-form .link-btn { font-size: 13px; opacity: 0.6; }
.valor-form .link-btn:hover { opacity: 1; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-block { background: var(--surface); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.editable-list { list-style: none; padding: 0; margin: 0 0 12px; }
.editable-list li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }

/* Tokens/IDs técnicos exibidos pro usuário copiar */
.token-value { font-family: var(--font-mono); font-size: 13px; background: var(--bg); padding: 8px 10px; border-radius: var(--radius-sm); display: block; word-break: break-all; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; height: auto; overflow: visible; }
  .main-area { height: auto; overflow-y: visible; }
  .sidebar {
    width: 100%; height: auto; position: relative; flex-direction: row; align-items: center;
    flex-wrap: wrap; padding: 0 14px;
  }
  .sidebar-inner {
    height: auto; position: static; flex-direction: row; align-items: center;
    flex-wrap: wrap; width: 100%;
  }
  .sidebar-strip { position: absolute; top: 0; left: 0; right: 0; }
  .sidebar-brand { border-bottom: none; padding: 14px 0; margin-right: 16px; }
  .sidebar-brand .mode-tag { display: none; }
  .sidebar-nav { flex: 1; display: flex; padding: 0; overflow-x: auto; gap: 2px; }
  .sidebar-nav a { white-space: nowrap; padding: 8px 10px; }
  .sidebar-footer { border-top: none; padding: 10px 0; display: flex; align-items: center; gap: 10px; }
  .sidebar-footer .user-name { display: none; }
  .sidebar-toggle { display: none; }
  .workspace-scope { flex: 1 1 100%; max-height: 240px; padding: 8px 0 6px; }

  /* Menu do admin: formato hambúrguer, em vez da barra rolável horizontal */
  .hamburger-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: none; background: transparent; color: #fff;
    cursor: pointer; margin-left: auto;
  }
  .hamburger-btn svg { width: 22px; height: 22px; }
  .sidebar.is-admin .mobile-nav-panel { display: none; }
  .sidebar.is-admin.mobile-nav-open {
    position: relative; z-index: 100; overflow: visible;
  }
  .sidebar.is-admin.mobile-nav-open .mobile-nav-panel {
    display: block; width: 100%;
    position: absolute; top: 100%; left: 0; right: 0; background: var(--ink);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  }
  .sidebar.is-admin.mobile-nav-open .sidebar-nav {
    display: flex; flex-direction: column; width: 100%; overflow-x: visible; padding: 6px 14px;
  }
  .sidebar.is-admin.mobile-nav-open .sidebar-nav a { padding: 12px 6px; }
  .sidebar.is-admin.mobile-nav-open .sidebar-footer {
    display: flex; width: 100%; padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Menu do lado do cliente: mesmo formato de hambúrguer (inclusive quando
     é o admin "vendo como" um cliente — por isso o link de "Voltar pra
     Clientes" não pode mais ficar escondido, agora ele mora aqui dentro). */
  .sidebar-client-view .mobile-nav-panel { display: none; }
  .sidebar-client-view.mobile-nav-open {
    position: relative; z-index: 100; overflow: visible;
  }
  .sidebar-client-view.mobile-nav-open .mobile-nav-panel {
    display: block; width: 100%; max-height: calc(100vh - 60px); overflow-y: auto;
    position: absolute; top: 100%; left: 0; right: 0; background: var(--ink);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  }
  .sidebar-client-view.mobile-nav-open .sidebar-nav {
    display: flex; flex-direction: column; width: 100%; overflow-x: visible; padding: 6px 14px;
  }
  .sidebar-client-view.mobile-nav-open .workspace-scope {
    max-height: none; padding: 10px 14px;
  }
  .sidebar-client-view.mobile-nav-open .sidebar-footer {
    display: flex; flex-direction: column; align-items: stretch; width: 100%; padding: 10px 14px; gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .sidebar-client-view.mobile-nav-open .sidebar-footer .back-link { display: block; }
}
@media (min-width: 901px) {
  .hamburger-btn { display: none; }
}

@media (max-width: 700px) {
  .cards-row { grid-template-columns: 1fr 1fr; }
  .form-grid, .settings-grid { grid-template-columns: 1fr; }
  .container { padding: 20px; }
}

.site-footer {
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 24px; margin-top: 12px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--ink-soft); opacity: 0.65; min-height: 38px; box-sizing: border-box;
  text-align: center;
}
.site-footer-company { line-height: 1.4; }
.site-footer-privacy { color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.site-footer-privacy:hover { color: var(--brand); text-decoration: underline; }
.auth-body .site-footer {
  border-top: none; justify-content: center; text-align: center;
  margin-top: auto; width: 100%; opacity: 0.9;
  color: #fff;
}
.auth-body .site-footer-company { color: #fff; }
.auth-body .site-footer-privacy { color: #fff; }
.auth-body .site-footer-privacy:hover { color: #fff; text-decoration: underline; }
