:root {
  /* ═══ CLARO — premium minimalista (neutros frios) ═══ */
  --bg: #f7f8fa;
  --bg-deep: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-tint: #f3f4f6;
  --line: rgba(17, 19, 28, 0.08);
  --line-strong: rgba(17, 19, 28, 0.14);
  --text: #16181d;
  --muted: #5b616e;
  --muted-soft: #8a909c;
  /* Vermelho Meal Time como acento preciso */
  --brand: #bc2026;
  --brand-deep: #9e1a1f;
  --brand-soft: rgba(188, 32, 38, 0.08);
  --leaf: #16a34a;
  --leaf-soft: rgba(22, 163, 74, 0.10);
  --navy: #1f2937;
  --navy-soft: rgba(31, 41, 55, 0.06);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);
  /* Sombras sutis e neutras (premium) */
  --shadow-sm: 0 1px 2px rgba(17, 19, 28, 0.06);
  --shadow: 0 1px 3px rgba(17, 19, 28, 0.04), 0 8px 24px rgba(17, 19, 28, 0.06);
  --shadow-lg: 0 12px 40px rgba(17, 19, 28, 0.10);
  /* Cantos crispos */
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Aliases p/ seções que usam tokens paralelos (lead detail, gestão 360).
     Resolvem via var() no momento do uso → adaptam automático ao tema. */
  --card-bg: var(--surface);
  --bg-card: var(--surface);
  --bg-surface: var(--bg);
  --clr-surface: var(--surface);
  --clr-surface-hover: var(--surface-tint);
  --clr-border: var(--line);
  --clr-border-light: var(--line);
  --clr-text: var(--text);
  --clr-text-secondary: var(--muted);
  --clr-accent: var(--brand);
  --clr-accent-light: var(--brand-soft);
}

/* ═══════ ESCURO — grafite sofisticado (padrão) ═══════ */
[data-theme="dark"] {
  --bg: #0f1115;
  --bg-deep: #0b0d11;
  --surface: #181b21;
  --surface-strong: #1f232b;
  --surface-tint: #23272f;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #eceef1;
  --muted: #9ba1ad;
  --muted-soft: #6b7280;
  --brand: #e85d5d;            /* vermelho clareado p/ fundo escuro */
  --brand-deep: #bc2026;
  --brand-soft: rgba(232, 93, 93, 0.14);
  --leaf: #34d399;
  --leaf-soft: rgba(52, 211, 153, 0.14);
  --navy: #1a2030;
  --navy-soft: rgba(255, 255, 255, 0.04);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.40), 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

[data-theme="dark"] body {
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Instrument Sans", sans-serif;
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(188, 32, 38, 0.18);
}

/* O atributo HTML `hidden` deve SEMPRE esconder, mesmo quando o elemento tem
   display próprio (ex.: .app-shell{display:grid}). Sem isto, o logout deixava
   o app sobreposto à tela de login. Vale pra qualquer elemento com [hidden]. */
[hidden] { display: none !important; }

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 92px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: #141519;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: #e8e9ec;
}
[data-theme="dark"] .sidebar {
  background: #0c0e12;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-block {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: white;
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(188, 32, 38, 0.30);
}

.sidebar-top {
  display: grid;
  gap: 18px;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-brand {
  display: grid;
  gap: 2px;
}

.sidebar-brand h1,
.topbar-title,
.hero h3,
.panel h3,
.form-panel h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.sidebar-brand h1 {
  font-size: 1.6rem;
  line-height: 1;
}

.sidebar-subtitle {
  margin: 0;
  color: var(--surface);
  font-size: 0.95rem;
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff8f1;
  cursor: pointer;
}

.sidebar-section-label {
  padding: 0 10px;
  color: var(--surface);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-link,
.ghost-button,
.primary-button,
.toolbar-button,
.task-action,
.calendar-day {
  border: 0;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #c9ccd3;
  background: transparent;
  text-align: left;
  font-weight: 500;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-link.is-active {
  background: var(--brand-soft);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand);
}

.nav-icon {
  display: inline-flex;
  width: 18px;
  justify-content: center;
  color: currentColor;
}

.nav-label {
  white-space: nowrap;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.sidebar-meta {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-meta strong {
  font-size: 1.5rem;
  line-height: 1;
}

.sidebar-meta-label {
  color: var(--surface);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-settings-button {
  justify-content: center;
}

.sidebar.is-collapsed {
  padding: 22px 12px;
}

.sidebar.is-collapsed .sidebar-expand-only,
.sidebar.is-collapsed .nav-label {
  display: none;
}

.sidebar.is-collapsed .brand-block {
  grid-template-columns: 1fr;
}

.sidebar.is-collapsed .nav-link {
  justify-content: center;
  padding: 12px;
}

.main-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* coluna preenche 100% da largura (sem vão lateral) */
  grid-auto-rows: min-content;           /* linhas pelo conteúdo, não esticam */
  align-content: start;                  /* empacota no topo — sem caixas vazias gigantes */
  gap: 22px;
  padding: 24px;
}

.topbar,
.hero,
.panel,
.report-card,
.stat-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.topbar.is-hidden {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

.topbar-tools {
  display: grid;
  gap: 12px;
  justify-items: end;
  min-width: min(520px, 100%);
}

.topbar-search {
  width: min(420px, 100%);
  background: var(--surface);
}

.ghost-button-whatsapp {
  color: #179c52;
  border: 1px solid rgba(23, 156, 82, 0.18);
}

.topbar-copy {
  display: grid;
  gap: 6px;
}

.topbar-title {
  font-size: clamp(1.3rem, 2vw, 1.9rem);
}

.topbar-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.topbar-notice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.quick-action-card {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quick-action-card strong,
.dashboard-card-head h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.quick-action-card small {
  color: var(--muted);
}

.quick-action-card-whatsapp {
  background: linear-gradient(135deg, var(--leaf-soft), transparent 60%), var(--surface);
}

.quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--surface-tint);
  color: var(--brand-deep);
  font-weight: 700;
}

.topbar-notice-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-notice-feed {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-notice-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(35, 48, 69, 0.06);
  color: var(--muted);
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
}

.topbar-notice-item.is-whatsapp {
  background: rgba(23, 156, 82, 0.11);
  color: #137346;
}

.topbar-notice-item.is-empty {
  background: rgba(95, 113, 135, 0.08);
}

.is-info-chip {
  background: rgba(33, 76, 171, 0.12);
  color: #214cab;
}

.is-warning-chip {
  background: rgba(191, 89, 70, 0.12);
  color: #9a3322;
}

.hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, var(--brand-soft), transparent 55%),
    var(--surface-strong);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(188, 32, 38, 0.16), transparent 68%);
}

.hero-content {
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.hero h3 {
  font-size: clamp(1.8rem, 2.8vw, 3rem);
}

.hero.hero-compact {
  padding: 20px 22px;
}

.hero-content-compact {
  gap: 14px;
}

.hero.hero-compact h3 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.hero-copy {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-copy-block {
  display: grid;
  gap: 10px;
}

.hero-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tag,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.86rem;
}

.hero-tag {
  background: var(--surface);
  border: 1px solid rgba(188, 32, 38, 0.12);
  color: var(--brand-deep);
  font-weight: 700;
}

.primary-button,
.ghost-button,
.toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.primary-button {
  background: var(--brand);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.primary-button:hover { background: var(--brand-deep); }

.ghost-button,
.toolbar-button {
  background: var(--surface-tint);
  color: var(--brand-deep);
}

.primary-button:hover,
.ghost-button:hover,
.toolbar-button:hover,
.task-action:hover,
.calendar-day:hover {
  transform: translateY(-1px);
}

.toolbar-button.is-active,
.task-filter.is-active {
  background: linear-gradient(135deg, var(--navy), #314760);
  color: white;
}

.stats-grid,
.content-grid,
.form-grid,
.report-grid,
.metrics-grid,
.task-card-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(188, 32, 38, 0.92), rgba(63, 125, 77, 0.5));
}

.dashboard-card-tasks::before {
  background: linear-gradient(90deg, rgba(191, 89, 70, 0.95), rgba(188, 32, 38, 0.75));
}

.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-card-head h4 {
  font-size: 1.02rem;
}

.dashboard-task-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-inline-list,
.dashboard-kpi-stack,
.funnel-mini-chart {
  display: grid;
  gap: 10px;
}

.dashboard-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
}

.dashboard-inline-row span {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
}

.dashboard-inline-row small {
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(35, 48, 69, 0.06);
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-kpi-stack div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
}

.funnel-mini-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
}

.funnel-mini-row span,
.dashboard-kpi-stack span {
  color: var(--muted);
  font-size: 0.86rem;
}

.funnel-mini-row strong {
  font-size: 0.88rem;
  color: var(--navy);
}

.funnel-mini-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(35, 48, 69, 0.08);
  overflow: hidden;
}

.funnel-mini-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-deep));
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.22);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  min-height: 185px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.summary-card:hover,
.summary-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(35, 48, 69, 0.12);
  border-color: rgba(33, 76, 171, 0.2);
  outline: none;
}

.summary-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(95, 113, 135, 0.12);
}

.summary-card-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.summary-card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px 0;
}

.summary-card-list {
  padding: 10px 12px;
  display: grid;
  gap: 5px;
}

.summary-card-list p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.summary-card-footer {
  padding: 8px 12px;
  border-top: 1px solid rgba(95, 113, 135, 0.12);
  color: #334fbc;
  font-weight: 600;
  text-align: center;
  font-size: 0.78rem;
}

.summary-chip {
  font-weight: 700;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.summary-chip.is-danger {
  background: rgba(191, 89, 70, 0.14);
  color: #9a3322;
}

.summary-chip.is-attention {
  background: rgba(188, 32, 38, 0.14);
  color: #b85e1e;
}

.summary-chip.is-success {
  background: rgba(55, 134, 82, 0.14);
  color: #2f7a49;
}

.summary-chip.is-info {
  background: rgba(33, 76, 171, 0.12);
  color: #214cab;
}

.summary-chip.is-neutral {
  background: rgba(95, 113, 135, 0.1);
  color: var(--muted);
}

.summary-mini-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
}

.summary-mini-link strong {
  font-size: 0.72rem;
}

.summary-mini-link.is-danger {
  color: #9a3322;
}

.summary-mini-link.is-attention {
  color: #b85e1e;
}

.summary-mini-link.is-success {
  color: #2f7a49;
}

.summary-mini-link.is-info {
  color: #214cab;
}

.summary-mini-link.is-neutral {
  color: var(--muted);
}

.summary-line {
  width: 100%;
  text-align: left;
  border: none;
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 8px;
  color: var(--text);
  line-height: 1.28;
  cursor: pointer;
  font-size: 0.84rem;
}

.summary-line:hover,
.summary-line:focus-visible {
  background: rgba(35, 48, 69, 0.06);
  outline: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.content-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.92fr);
}

.report-grid,
.metrics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-ops-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.task-ops-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.task-ops-card span {
  display: block;
  color: var(--muted-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.task-ops-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
  font-family: "Space Grotesk", sans-serif;
}

.task-ops-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.task-ops-card.is-overdue {
  border-color: rgba(191, 89, 70, 0.26);
  background: var(--surface);
}

.task-ops-card.is-active,
.task-ops-card:hover {
  transform: translateY(-1px);
  border-color: rgba(33, 76, 171, 0.22);
  box-shadow: 0 10px 24px rgba(35, 48, 69, 0.08);
}

.task-priority-rail {
  margin-top: 16px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.task-priority-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.task-priority-header strong {
  font-size: 1rem;
  color: var(--text);
}

.task-priority-list {
  display: grid;
  gap: 10px;
}

.task-priority-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.task-priority-item p,
.task-priority-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.task-priority-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.task-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.report-card,
.stat-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-header-stack {
  align-items: stretch;
  flex-direction: column;
}

.toolbar-secondary {
  justify-content: space-between;
  gap: 12px;
}

.chip {
  background: rgba(35, 48, 69, 0.06);
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--muted-soft);
  font-weight: 700;
}

.stat-card strong,
.report-card strong {
  display: block;
  margin-top: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
}

.stat-card p,
.report-card p,
.muted,
label,
th,
td,
.calendar-weekday,
.notification-banner,
.calendar-agenda p {
  color: var(--muted);
}

.report-list,
.task-list,
.calendar-agenda,
.client-history,
.linked-tasks {
  display: grid;
  gap: 12px;
}

.report-row,
.metric-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.metric-pill strong {
  margin: 0;
  font-size: 1rem;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.pipeline-column {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid rgba(102, 69, 32, 0.08);
}

.pipeline-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pipeline-column-header h4 {
  margin: 0;
  font-size: 1rem;
}

.pipeline-card,
.task-item,
.agenda-item,
.history-item,
.task-card,
.linked-task {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid rgba(102, 69, 32, 0.08);
}

.pipeline-card {
  cursor: pointer;
}

.pipeline-card.is-dragging {
  opacity: 0.5;
}

.pipeline-column.is-drop-target {
  border-color: rgba(188, 32, 38, 0.4);
  background: var(--surface);
}

.pipeline-card.is-selected,
tbody tr.is-selected {
  outline: 2px solid rgba(188, 32, 38, 0.24);
}

.pipeline-card strong,
.task-item strong,
.agenda-item strong,
.history-item strong,
.task-card strong,
.linked-task strong {
  display: block;
  margin-bottom: 6px;
}

.meta-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.task-item,
.task-card {
  border-left: 4px solid transparent;
}

.task-item.is-today,
.task-card.is-today {
  border-left-color: var(--brand);
}

.task-item.is-overdue,
.task-card.is-overdue {
  border-left-color: var(--danger);
}

.task-item time,
.agenda-item time,
.history-item time,
.task-card time {
  color: var(--leaf);
  font-weight: 700;
}

.notification-banner {
  min-height: 56px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid rgba(188, 32, 38, 0.14);
}

.notification-banner.is-warning {
  border-color: rgba(191, 89, 70, 0.18);
  background: var(--surface);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-weekday {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.calendar-day {
  min-height: 86px;
  padding: 10px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid rgba(102, 69, 32, 0.08);
  text-align: left;
}

.calendar-day-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.calendar-day.is-outside {
  opacity: 0.42;
}

.calendar-day.is-active {
  border-color: rgba(188, 32, 38, 0.22);
  background: var(--surface);
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(63, 125, 77, 0.26);
}

.calendar-day-number {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.calendar-task-count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(188, 32, 38, 0.14);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

.calendar-day-meta {
  min-height: 18px;
  margin-bottom: 8px;
}

.calendar-day-label {
  display: inline-block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.calendar-day-label.is-empty {
  color: var(--muted-soft);
  font-weight: 500;
}

.calendar-dot {
  display: inline-flex;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--brand);
}

.calendar-agenda {
  margin-top: 16px;
}

.search input,
label input,
label select,
label textarea,
.history-form input,
select {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.search input {
  margin-top: 0;
  min-width: 220px;
}

.search-wide input {
  min-width: 320px;
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(102, 69, 32, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(102, 69, 32, 0.08);
  vertical-align: top;
}

tbody tr {
  cursor: pointer;
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-soft);
  background: var(--surface);
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.sort-arrow {
  color: var(--brand-deep);
  font-size: 0.86rem;
}

.task-row-main {
  background: var(--surface);
}

.task-row-main.is-completed {
  /* Concluída fica igual às demais linhas (sem destaque claro nem opacidade). */
  opacity: 1;
  background: var(--surface);
}

.task-row-details td {
  padding-top: 8px;
  padding-bottom: 16px;
  background: var(--surface);
}

.task-status {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.task-status.is-open {
  background: var(--navy-soft);
  color: var(--navy);
}

.task-status.is-today {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.task-status.is-overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-action {
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid rgba(102, 69, 32, 0.1);
  font-weight: 700;
}

.task-action.action-complete {
  background: var(--leaf-soft);
  color: var(--leaf);
}

.task-action.action-postpone {
  background: var(--navy-soft);
  color: var(--navy);
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
}

.client-panel {
  background:
    linear-gradient(180deg, var(--surface), var(--surface)),
    var(--surface);
}

.history-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.history-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 18px;
}

.linked-tasks {
  margin-top: 16px;
}

.modal {
  width: min(920px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  border-radius: 28px;
  background: transparent;
}

.modal::backdrop {
  background: rgba(29, 24, 19, 0.38);
  backdrop-filter: blur(8px);
}

.form-panel {
  display: grid;
  gap: 18px;
  padding: 26px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-grid,
.settings-grid {
  display: grid;
  gap: 18px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid {
  gap: 20px;
}

.stage-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
}

.stage-remove-button,
.stage-move-button,
.settings-add-button {
  margin-top: 8px;
}

.app-view-panel[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.integration-content {
  display: grid;
  gap: 18px;
}

.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.integration-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.integration-info {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  border: 1px solid var(--line);
  color: var(--muted);
}

.integration-log {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.integration-log-entry {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

.integration-log-entry.is-success {
  border-color: var(--leaf);
  color: var(--leaf);
}

.integration-log-entry.is-error {
  border-color: var(--danger);
  color: var(--danger);
}

.settings-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.settings-hub-card {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.settings-hub-card h4 {
  margin: 6px 0 8px;
  font-size: 1.1rem;
}

.settings-hub-card p {
  color: var(--muted);
}

.settings-user-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.settings-user-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.settings-user-form input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.settings-section-head {
  margin-top: 8px;
}

.bling-connected {
  color: var(--leaf);
  font-weight: 600;
}

.bling-disconnected {
  color: var(--danger);
  font-weight: 600;
}

.imported-customers-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.imported-customer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

/* === Leads table (getCRM style) === */
.leads-header-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
}

.leads-toolbar {
  flex-wrap: wrap;
}

.leads-table {
  font-size: 0.88rem;
}

.leads-table th,
.leads-table td {
  padding: 10px 10px;
  white-space: nowrap;
}

.leads-table .th-check {
  width: 36px;
  text-align: center;
}

.leads-table .th-check input,
.leads-table .td-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.leads-table .td-check {
  text-align: center;
}

.lead-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.lead-type-badge.type-ativo {
  background: var(--leaf-soft);
  color: var(--leaf);
}

.lead-type-badge.type-inativo {
  background: var(--danger-soft);
  color: var(--danger);
}

.lead-type-badge.type-lead {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.lead-segment-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--navy-soft);
  color: var(--navy);
}

.lead-actions-cell {
  display: flex;
  gap: 4px;
  align-items: center;
}

.lead-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  transition: 120ms ease;
  white-space: nowrap;
}

.lead-action-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: var(--brand);
}

.lead-action-btn.action-whatsapp {
  color: #25d366;
}

.lead-action-btn.action-whatsapp:hover {
  background: rgba(37, 211, 102, 0.1);
  border-color: #25d366;
}

.lead-action-btn.action-complete-btn {
  color: var(--leaf);
}

.lead-action-btn.action-complete-btn:hover {
  background: var(--leaf-soft);
  border-color: var(--leaf);
}

.is-disabled-button,
.is-disabled-button:hover {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.leads-detail-row td {
  padding: 6px 10px 14px;
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}

.lead-detail-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.lead-detail-info span {
  white-space: nowrap;
}

.leads-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.leads-pagination-info {
  font-weight: 600;
}

.leads-pagination-controls {
  display: flex;
  gap: 4px;
}

.leads-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.leads-page-btn:hover {
  background: var(--surface-tint);
}

.leads-page-btn.is-active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

/* ── Bulk Delete Button ── */
.danger-button {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.danger-button:hover {
  background: #a84838;
}

/* ── Lead Detail Page ── */
.lead-detail-page {
  padding: 0;
}

.lead-detail-page .lead-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 18px;
}
.lead-detail-page .lead-detail-back:hover {
  text-decoration: underline;
}

.lead-detail-page .lead-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.lead-detail-page .lead-profile-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 4px;
  font-family: "Space Grotesk", sans-serif;
}

.lead-detail-page .lead-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 6px;
}

.lead-detail-page .lead-profile-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.lead-detail-page .lead-section {
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.lead-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.lead-tab {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.lead-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
  box-shadow: 0 10px 22px rgba(35, 48, 69, 0.14);
}

.lead-section-hidden {
  display: none;
}

.lead-detail-page .lead-section-title {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--muted-soft);
  font-weight: 700;
  margin: 0 0 14px;
}

.lead-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.lead-section-heading strong {
  display: block;
  color: var(--text);
  font-size: 0.96rem;
}

.lead-ai-section {
  background: linear-gradient(135deg, rgba(33, 76, 171, 0.08), rgba(255, 150, 67, 0.1));
}

.lead-ai-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.lead-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-ai-toggle {
  padding: 9px 14px;
}

.lead-ai-body[hidden] {
  display: none !important;
}

.lead-ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.lead-ai-card {
  background: var(--surface);
  border: 1px solid rgba(33, 76, 171, 0.12);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.lead-ai-card-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
  font-weight: 700;
}

.lead-ai-card p {
  margin: 0;
  line-height: 1.55;
  color: var(--text);
}

.lead-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.lead-ai-suggestions span {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(33, 76, 171, 0.12);
  font-size: 0.82rem;
  color: var(--text);
}

.lead-detail-page .lead-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px 28px;
}

.lead-detail-page .lead-info-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 2px;
}

.lead-detail-page .lead-info-item span {
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

.lead-detail-page .lead-notes-block {
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.lead-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lead-note-action {
  padding: 8px 12px;
}

#taskOwnerFilter,
#taskChannelFilter,
#taskResultFilter {
  min-width: 180px;
}

.task-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-date-range input {
  min-width: 150px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.lead-detail-page .lead-history-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-history-quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 16px 0;
}

.lead-history-quick-form input {
  min-width: 0;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.lead-detail-page .lead-history-entry {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 10px 14px;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
}

.lead-detail-page .lead-history-entry .entry-type {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--brand);
  flex-shrink: 0;
  min-width: 90px;
}

.lead-detail-page .lead-history-entry .entry-date {
  font-size: 0.8rem;
  color: var(--muted-soft);
  flex-shrink: 0;
  min-width: 140px;
}

.lead-detail-page .lead-history-entry .entry-note {
  font-size: 0.88rem;
  color: var(--text);
}

.purchase-products-inline {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
}

.purchase-product-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.purchase-product-card {
  display: grid;
  gap: 10px;
}

/* Aba "Resumo IA" na ficha do lead (análise do Claude, organizada) */
.ia-analise { background: var(--surface-tint); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.ia-analise-resumo { margin: 0 0 14px; font-size: .98rem; line-height: 1.55; color: var(--text); }
.ia-analise-grid { display: grid; gap: 10px; }
.ia-analise-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.ia-analise-lbl { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-soft); }
.ia-analise-lbl.is-warn { color: var(--danger); }
.ia-analise-lbl.is-next { color: var(--brand); }
.ia-analise-val { font-size: .9rem; line-height: 1.5; color: var(--text); }
.ia-analise-next { margin-top: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--brand); border-radius: 12px; }
.ia-analise-next .ia-analise-lbl { display: block; margin-bottom: 4px; }
.ia-analise-next p { margin: 0; font-size: .92rem; line-height: 1.5; }
.ia-ant-item { padding: 10px 0; border-top: 1px solid var(--line); }
.ia-ant-date { font-size: .74rem; font-weight: 600; color: var(--muted-soft); }
.ia-ant-note { margin: 4px 0 0; font-size: .86rem; line-height: 1.45; color: var(--muted); }

.purchase-ledger {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.purchase-ledger-head,
.purchase-ledger-row {
  display: grid;
  grid-template-columns: 180px 220px minmax(240px, 1fr) 120px;
  gap: 10px;
  align-items: center;
}

/* Variante com coluna de ação (Excluir venda) — só admin/supervisor */
.purchase-ledger--actions .purchase-ledger-head,
.purchase-ledger--actions .purchase-ledger-row {
  grid-template-columns: 160px 200px minmax(200px, 1fr) 110px auto;
}
.purchase-del {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted-soft);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  justify-self: end;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.purchase-del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.purchase-del:disabled { opacity: 0.6; cursor: default; }
.purchase-ledger-hint {
  margin: 10px 4px 0;
  font-size: 0.78rem;
  color: var(--muted-soft);
  line-height: 1.45;
}

.purchase-ledger-head {
  padding: 0 4px;
  color: var(--muted-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.purchase-ledger-row {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text);
}

.purchase-ledger-row strong {
  font-size: 0.92rem;
}

.purchase-ledger-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.purchase-product-row {
  display: grid;
  grid-template-columns: 180px 220px minmax(240px, 1fr) auto 110px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.purchase-product-row strong {
  margin: 0;
}

.purchase-product-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.purchase-load-items-btn {
  justify-self: start;
  padding: 8px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.purchase-items-panel {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.purchase-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.purchase-items-list {
  display: grid;
  gap: 8px;
}

.purchase-item-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid rgba(102, 69, 32, 0.08);
}

.purchase-item-line:first-child {
  border-top: 0;
  padding-top: 0;
}

.purchase-item-qty {
  font-weight: 700;
  color: var(--brand-deep);
}

.purchase-item-name {
  line-height: 1.4;
}

@media (max-width: 1180px) {
  .app-shell,
  .content-grid,
  .stats-grid,
  .summary-grid,
  .report-grid,
  .task-card-grid,
  .form-grid,
  .history-form,
  .metrics-grid {
    grid-template-columns: minmax(0, 1fr); /* minmax(0,...) deixa a coluna encolher: conteúdo largo não estoura a tela no mobile */
  }

  .sidebar,
  .summary-quick-actions,
  .stats-grid,
  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-tools {
    justify-items: stretch;
  }

  .topbar {
    align-items: stretch;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions > * {
    flex: 1 1 180px;
  }

  .sidebar {
    padding-bottom: 18px;
  }

  .topbar,
  .hero,
  .panel-header,
  .history-header,
  .toolbar-secondary {
    flex-direction: column;
    align-items: start;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search input,
  .search-wide input {
    min-width: 100%;
  }

  .topbar-notice-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-notice-feed {
    justify-content: flex-start;
  }

  .dashboard-inline-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-inline-actions {
    width: 100%;
  }

  .funnel-mini-row {
    grid-template-columns: 1fr;
  }

  .funnel-mini-row strong {
    justify-self: end;
  }

  .settings-hub-grid {
    grid-template-columns: 1fr;
  }

  .purchase-ledger-head {
    display: none;
  }

  .purchase-ledger-row,
  .task-priority-item {
    grid-template-columns: 1fr;
  }

  /* Empilha também a variante com ação; o botão Excluir fica à esquerda */
  .purchase-ledger--actions .purchase-ledger-row {
    grid-template-columns: 1fr;
  }
  .purchase-del { justify-self: start; }

  .lead-history-quick-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 16px;
    border-radius: 22px;
  }

  .topbar-title {
    font-size: 1.18rem;
    line-height: 1.2;
  }

  .topbar-subtitle {
    font-size: 0.88rem;
  }

  .topbar-search {
    width: 100%;
  }

  .hero-actions > * {
    flex: 1 1 100%;
  }

  .quick-action-card {
    padding: 14px;
  }

  .dashboard-card {
    padding: 15px;
    border-radius: 18px;
  }

  .dashboard-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-task-pills {
    gap: 8px;
  }

  .summary-mini-link {
    font-size: 0.8rem;
  }
}

/* ══════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════ */

.login-screen[hidden] { display: none !important; }
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface-tint) 50%, var(--bg-deep) 100%);
  padding: 1rem;
}

.login-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-mark {
  width: 56px;
  height: 56px;
  font-size: 1.3rem;
  margin: 0 auto 0.75rem;
}

.login-brand h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
  margin: 0;
}

.login-brand p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.login-field {
  margin-bottom: 1rem;
}

.login-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.login-field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--bg-deep);
  color: var(--text);
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.login-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.login-submit {
  width: 100%;
  padding: 0.7rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.login-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 1.5rem;
}

/* ══════════════════════════════════════════
   TOPBAR USER INFO
   ══════════════════════════════════════════ */

.topbar-user-info {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 4px 10px;
  background: var(--surface-tint);
  border-radius: 6px;
  white-space: nowrap;
}

/* ══════════════════════════════════════════
   SIDEBAR LOGOUT & USERS BUTTONS
   ══════════════════════════════════════════ */

.sidebar-logout {
  color: var(--danger) !important;
  border-color: rgba(220, 53, 69, 0.2) !important;
}

.sidebar-logout:hover {
  background: rgba(220, 53, 69, 0.08) !important;
}

/* ══════════════════════════════════════════
   WHATSAPP TEMPLATE CARDS
   ══════════════════════════════════════════ */

.whatsapp-template-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
}

.whatsapp-template-card .template-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.whatsapp-template-card .template-preview {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.whatsapp-template-card .template-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ══════════════════════════════════════════
   SCORE BADGES
   ══════════════════════════════════════════ */

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.score-badge.score-hot {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
}

.score-badge.score-warm {
  background: rgba(188, 32, 38, 0.12);
  color: var(--brand);
}

.score-badge.score-cold {
  background: rgba(108, 117, 125, 0.12);
  color: #6c757d;
}

.score-badge.score-none {
  background: rgba(108, 117, 125, 0.06);
  color: var(--muted-soft);
}

.pipeline-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* ══════════════════════════════════════════
   RECOMPRA BANDS (Dashboard)
   ══════════════════════════════════════════ */

.dashboard-recompra-bands {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.recompra-band {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recompra-band strong {
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════
   REPORTS PAGE
   ══════════════════════════════════════════ */

.reports-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.report-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.report-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
}

.report-kpi .eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-soft);
  margin-bottom: 4px;
}

.report-kpi h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.report-kpi span {
  font-size: 0.78rem;
  color: var(--muted-soft);
}

.report-kpi.kpi-danger h2 {
  color: #dc3545;
}

.report-section-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.report-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
}

.report-section-full {
  width: 100%;
}

.report-section-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
}

.score-distribution {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-dist-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-dist-bar span {
  font-size: 0.8rem;
  min-width: 140px;
}

.score-dist-fill {
  height: 18px;
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.3s ease;
}

.score-hot-bg { background: rgba(220, 53, 69, 0.6); }
.score-warm-bg { background: rgba(239, 125, 50, 0.6); }
.score-cold-bg { background: rgba(108, 117, 125, 0.5); }
.score-none-bg { background: rgba(108, 117, 125, 0.2); }

.report-ranking {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.ranking-pos {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted-soft);
  min-width: 20px;
}

.ranking-name {
  flex: 1;
  font-size: 0.85rem;
}

.stage-performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.stage-perf-card {
  background: rgba(108, 117, 125, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
}

.stage-perf-card strong {
  font-size: 0.82rem;
  display: block;
  margin-bottom: 4px;
}

.stage-perf-nums {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted-soft);
}

@media (max-width: 768px) {
  .report-section-row {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════
   WHATSAPP INLINE PANEL (Lead Detail)
   ══════════════════════════════════════════ */

.lead-whatsapp-panel {
  margin-top: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.whatsapp-quick-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.whatsapp-custom-textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  resize: vertical;
}

.whatsapp-templates-inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.whatsapp-template-inline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.template-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.template-inline-preview {
  font-size: 0.8rem;
  color: var(--muted-soft);
  margin-bottom: 8px;
  line-height: 1.4;
}

.whatsapp-send-btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  font-size: 0.82rem;
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}

.whatsapp-send-btn:hover {
  background: #1da851;
}

/* ══════════════════════════════════════════
   AUTOMATION QUICK ACTION CARD
   ══════════════════════════════════════════ */

.quick-action-card-automation {
  border-color: rgba(130, 80, 223, 0.25);
}

.quick-action-card-automation:hover {
  border-color: rgba(130, 80, 223, 0.5);
  background: rgba(130, 80, 223, 0.04);
}

/* ══════════════════════════════════════════
   BULK ACTION BAR
   ══════════════════════════════════════════ */

.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(33, 76, 171, 0.06);
  border: 1px solid rgba(33, 76, 171, 0.15);
  border-radius: 8px;
  font-size: 0.82rem;
}

.bulk-action-bar span {
  font-weight: 600;
  color: var(--muted-soft);
  margin-right: 4px;
}

/* ══════════════════════════════════════════
   WIDE MODAL
   ══════════════════════════════════════════ */

.modal-card-wide {
  max-width: 720px;
}

.users-toolbar {
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════════
   SETTINGS SECTIONS (Nova estrutura)
   ══════════════════════════════════════════ */

.settings-section-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.settings-section-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 10px;
  flex-shrink: 0;
}

.settings-section-title h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.settings-section-desc {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.settings-profile-grid {
  max-width: 640px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .form-grid-2, .form-grid-4 {
    grid-template-columns: 1fr;
  }
}

.settings-team-toolbar {
  margin-bottom: 1rem;
}

.settings-new-user-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.settings-new-user-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.settings-users-table {
  font-size: 0.85rem;
}

.settings-users-table td {
  vertical-align: middle;
}

.user-row-inactive {
  opacity: 0.5;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-active {
  background: var(--success, #22c55e);
}

.status-inactive {
  background: var(--muted, #888);
}

.settings-checkboxes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.75rem;
}

/* ══════ PIPELINE MELHORADO ══════ */

.pipeline-column-stats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pipeline-column-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent, #214cab);
}

.pipeline-card-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent, #214cab);
  margin: 2px 0;
}

.pipeline-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.pipeline-card-action {
  font-size: 0.72rem;
  color: var(--muted-soft, #888);
}

.pipeline-card-days {
  font-size: 0.72rem;
  color: var(--muted-soft, #888);
}

.pipeline-card-urgent {
  border-left: 3px solid #ef4444 !important;
}

.pipeline-card-warning {
  border-left: 3px solid #f59e0b !important;
}

.pipeline-card-quick-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 6px;
}

.pipeline-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  background: var(--card-bg, #fff);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.pipeline-quick-btn:hover {
  background: var(--accent, #214cab);
  color: #fff;
  border-color: var(--accent, #214cab);
  transform: scale(1.1);
}

.pipeline-quick-wa:hover {
  background: #25d366;
  border-color: #25d366;
}

.pipeline-card-empty {
  opacity: 0.5;
}

/* ══════ LEAD DETAIL LAYOUT (sidebar + main) ══════ */

.lead-detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .lead-detail-layout {
    grid-template-columns: 1fr;
  }
}

.lead-detail-main {
  min-width: 0;
}

/* ══════ LEAD SIDEBAR SUMMARY ══════ */

.lead-sidebar-summary {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e2e2);
  border-radius: 12px;
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
  height: fit-content;
}

.lead-sidebar-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--heading, #1a1a2e);
}

.lead-sidebar-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lead-sidebar-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.lead-sidebar-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.lead-sidebar-item div {
  display: flex;
  flex-direction: column;
}

.lead-sidebar-label {
  font-size: 0.72rem;
  color: var(--muted-soft, #888);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lead-sidebar-item strong {
  font-size: 0.88rem;
  color: var(--heading, #1a1a2e);
}

.lead-sidebar-item small {
  font-size: 0.75rem;
  color: var(--muted-soft, #888);
}

.lead-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e2e2e2);
}

.lead-sidebar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e2e2);
  background: var(--card-bg, #fff);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  color: var(--text, #333);
  transition: all 0.15s ease;
}

.lead-sidebar-action-btn:hover {
  background: var(--accent, #214cab);
  color: #fff;
  border-color: var(--accent, #214cab);
}

/* ══════ TIMELINE ══════ */

.timeline-list {
  position: relative;
  padding-left: 24px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border, #e2e2e2);
}

.timeline-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  color: #fff;
  position: relative;
  z-index: 1;
  margin-left: -24px;
}

.timeline-content {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e2e2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  flex: 1;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 4px;
}

.timeline-header strong {
  font-size: 0.85rem;
}

.timeline-date {
  font-size: 0.72rem;
  color: var(--muted-soft, #888);
  white-space: nowrap;
}

.timeline-desc {
  font-size: 0.82rem;
  color: var(--text, #555);
  margin: 4px 0;
}

.timeline-result {
  font-size: 0.72rem;
}

.timeline-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent, #214cab);
  margin-left: 0.5rem;
}

.timeline-owner {
  font-size: 0.72rem;
  color: var(--muted-soft, #888);
  margin-left: 0.5rem;
}

.timeline-empty {
  color: var(--muted-soft, #888);
  font-size: 0.88rem;
  padding: 1rem;
}

/* ══════════════════════ DASHBOARD FUNIL + METAS ══════════════════════ */

.dash-funil-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.dash-kpi {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
}
.dash-kpi .eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #666);
  margin-bottom: 0.3rem;
}
.dash-kpi h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text, #1a1a2e);
}
.dash-kpi span {
  font-size: 0.78rem;
  color: var(--muted-soft, #888);
}

.dash-section-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dash-section {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 1.2rem;
}
.dash-section-wide {
  grid-column: 1 / -1;
}
.dash-section-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
  color: var(--text, #1a1a2e);
}

/* Metas cards */
.metas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}
.meta-card {
  background: var(--bg-surface, #f8fafc);
  border-radius: 8px;
  padding: 1rem;
  border-left: 4px solid var(--border, #e2e8f0);
}
.meta-card.meta-achieved { border-left-color: #22c55e; }
.meta-card.meta-on-track { border-left-color: #eab308; }
.meta-card.meta-behind { border-left-color: #ef4444; }

.meta-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.meta-card-label { font-weight: 600; font-size: 0.82rem; }
.meta-card-pct {
  font-weight: 700;
  font-size: 0.88rem;
}
.meta-achieved .meta-card-pct { color: #22c55e; }
.meta-on-track .meta-card-pct { color: #eab308; }
.meta-behind .meta-card-pct { color: #ef4444; }

.meta-progress-bar {
  height: 6px;
  background: var(--border, #e2e8f0);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.meta-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.meta-achieved .meta-progress-fill { background: #22c55e; }
.meta-on-track .meta-progress-fill { background: #eab308; }
.meta-behind .meta-progress-fill { background: #ef4444; }

.meta-card-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-soft, #888);
}
.meta-card-values strong { color: var(--text, #1a1a2e); }

/* Funnel chart */
.funnel-chart {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.funnel-row {
  display: flex;
  align-items: center;
}
.funnel-bar {
  background: linear-gradient(90deg, var(--accent, #214cab), var(--accent-light, #4a7cff));
  color: #fff;
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  transition: width 0.4s ease;
}
.funnel-stage-name { font-weight: 600; font-size: 0.82rem; }
.funnel-stage-nums { font-size: 0.75rem; opacity: 0.9; }

/* Daily sales chart */
.daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding-top: 0.5rem;
}
.daily-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.daily-bar {
  width: 100%;
  max-width: 28px;
  background: var(--accent, #214cab);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
  min-height: 4px;
}
.daily-bar-wrap:hover .daily-bar { background: var(--accent-light, #4a7cff); }
.daily-bar-label {
  font-size: 0.6rem;
  color: var(--muted-soft, #888);
  margin-top: 2px;
}

/* Activity type bars */
.act-type-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.82rem;
}
.act-type-bar-wrap {
  height: 8px;
  background: var(--border, #e2e8f0);
  border-radius: 4px;
  overflow: hidden;
}
.act-type-bar {
  height: 100%;
  background: var(--accent, #214cab);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.act-result-bar { background: #8b5cf6; }

/* Ranking detail */
.ranking-detail {
  font-size: 0.75rem;
  color: var(--muted-soft, #888);
  flex: 1;
  text-align: right;
  margin-right: 0.5rem;
}

@media (max-width: 900px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-section-row { grid-template-columns: 1fr; }
  .metas-grid { grid-template-columns: repeat(2, 1fr); }
  /* Cabeçalho do painel quebra no mobile (título + botões não estouram a tela) */
  .panel-header { flex-wrap: wrap; gap: 10px; }
  .panel-header > div { min-width: 0; }
  .panel-header-actions { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .dash-kpi-row { grid-template-columns: 1fr; }
  .metas-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   SPRINT 2 — Visual Moderno
   ═══════════════════════════════════════════════════════════ */

/* ─── Lucide icons: tamanho consistente em qualquer contexto ─── */
[data-lucide],
.lucide {
  width: 1em;
  height: 1em;
  stroke-width: 2;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.nav-icon [data-lucide],
.nav-icon .lucide {
  width: 1.15em;
  height: 1.15em;
  stroke-width: 1.75;
}

/* ─── Theme toggle button (header) ─── */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.theme-toggle:hover {
  background: var(--brand-soft);
  transform: translateY(-1px);
}
.theme-toggle [data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
[data-theme="dark"] .theme-toggle .lucide-sun,
[data-theme="light"] .theme-toggle .lucide-moon,
:root:not([data-theme="dark"]) .theme-toggle .lucide-sun {
  display: none;
}

/* ─── Skeleton loaders (substitui "Carregando..." cru) ─── */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-tint) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    var(--surface-tint) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
  display: inline-block;
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-tint) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    var(--surface-tint) 100%
  );
  background-size: 200% 100%;
}
.skeleton-line { height: 14px; width: 100%; margin: 4px 0; }
.skeleton-line.is-sm { width: 60%; }
.skeleton-line.is-xs { width: 40%; }
.skeleton-block { height: 80px; width: 100%; border-radius: var(--radius-md); }
.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.skeleton-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skeleton-table-row {
  display: grid;
  grid-template-columns: 30% 20% 20% 15% 15%;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

/* ─── Empty states ilustrados ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-state-icon {
  font-size: 48px;
  opacity: 0.5;
  margin-bottom: 8px;
}
.empty-state h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}
.empty-state p {
  margin: 0;
  font-size: 0.9rem;
  max-width: 360px;
}
.empty-state-cta {
  margin-top: 8px;
}

/* ─── Tabela moderna de leads ─── */
.leads-table-wrapper {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 280px);
}
.leads-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-strong);
  z-index: 5;
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.leads-table tbody tr {
  position: relative;
  transition: background var(--transition-fast);
}
.leads-table tbody tr:nth-child(even) {
  background: var(--surface-tint);
}
[data-theme="dark"] .leads-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
.leads-table tbody tr:hover {
  background: var(--brand-soft);
}
.leads-table tbody tr:hover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
  border-radius: 0 4px 4px 0;
}
.leads-table tbody tr.is-selected {
  background: var(--brand-soft);
}
.leads-table tbody tr.is-selected::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand-deep);
}

/* ─── Bulk action bar flutuante ─── */
.bulk-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--text);
  color: var(--bg-deep);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
  transition: transform var(--transition-med);
  font-size: 0.9rem;
}
.bulk-action-bar.is-visible {
  transform: translateX(-50%) translateY(0);
}
.bulk-action-bar .bulk-count {
  background: var(--brand);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.8rem;
}
.bulk-action-bar button {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font: inherit;
  transition: all var(--transition-fast);
}
.bulk-action-bar button:hover {
  background: rgba(255, 255, 255, 0.1);
}
.bulk-action-bar button.is-danger {
  color: #ff8a8a;
  border-color: rgba(255, 138, 138, 0.3);
}
.bulk-action-bar button.is-danger:hover {
  background: rgba(255, 138, 138, 0.15);
}

/* ─── Command Palette (Cmd+K) ─── */
.command-palette {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}
.command-palette.is-open {
  opacity: 1;
  pointer-events: auto;
}
.command-palette-card {
  width: min(640px, 92vw);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform var(--transition-fast);
}
.command-palette.is-open .command-palette-card {
  transform: scale(1);
}
.command-palette-input-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.command-palette-input-row [data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.command-palette-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
}
.command-palette-input::placeholder {
  color: var(--muted-soft);
}
.command-palette-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
}
.command-palette-section {
  margin-bottom: 8px;
}
.command-palette-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-soft);
  padding: 8px 12px 4px;
  font-weight: 600;
}
.command-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition-fast);
}
.command-palette-item:hover,
.command-palette-item.is-active {
  background: var(--brand-soft);
}
.command-palette-item .item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-tint);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.command-palette-item .item-icon [data-lucide] {
  width: 16px;
  height: 16px;
}
.command-palette-item .item-content {
  flex: 1;
  min-width: 0;
}
.command-palette-item .item-title {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.command-palette-item .item-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.command-palette-item .item-shortcut {
  font-size: 0.72rem;
  color: var(--muted-soft);
  background: var(--surface-tint);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
}
.command-palette-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.command-palette-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted-soft);
  background: var(--surface-tint);
}
.command-palette-footer kbd {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  margin: 0 2px;
}

/* ─── Kanban: feedback de drag-and-drop ─── */
.pipeline-card {
  cursor: grab;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
              opacity var(--transition-fast);
}
.pipeline-card:active {
  cursor: grabbing;
}
.pipeline-card.is-dragging {
  opacity: 0.4;
  transform: scale(0.98) rotate(-1deg);
}
.pipeline-column.is-drop-target {
  background: var(--brand-soft);
  outline: 2px dashed var(--brand);
  outline-offset: -4px;
  border-radius: var(--radius-lg);
}
.pipeline-column.is-drop-target .pipeline-column-cards {
  min-height: 80px;
}

/* ─── Hide login footer "admin padrão" em produção ─── */
.login-footer { display: none; }
.is-dev .login-footer { display: block; }


/* ─── Topbar search reformulado (botão que abre command palette) ─── */
.topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  min-width: 280px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.topbar-search:hover {
  border-color: var(--brand);
  background: var(--surface-tint);
}
.topbar-search [data-lucide] {
  width: 16px;
  height: 16px;
  color: var(--muted-soft);
}
.topbar-search-label {
  flex: 1;
  text-align: left;
}
.topbar-search-kbd {
  background: var(--surface-tint);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ─── Login: link "esqueceu senha" ─── */
.login-footer { display: block; margin-top: 16px; font-size: 0.85rem; color: var(--muted); text-align: center; }
.login-footer a { color: var(--brand); text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* ─── Smooth fade quando troca de view ─── */
.app-view-panel:not([hidden]) {
  animation: viewFadeIn var(--transition-med);
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ─── Segment filter bar ─── */
.toolbar-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-top: 12px;
}
.toolbar-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-right: 4px;
}
.segment-filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.segment-filter-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.segment-filter-btn.is-active {
  background: var(--text);
  color: var(--bg-deep);
  border-color: var(--text);
}
[data-theme="dark"] .segment-filter-btn.is-active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

/* ─── Segment chip (consistente em todos os contextos) ─── */
.segment-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   ABA CLIENTES — Análise Comportamental + Brevo
   ══════════════════════════════════════════════════════════ */

/* KPIs row */
.clientes-kpi-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--clr-border, #e5e7eb);
  margin-bottom: 16px;
}
.clientes-kpi {
  flex: 1 1 120px;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  background: var(--clr-surface, #f8fafc);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--clr-border, #e5e7eb);
}
.clientes-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--clr-text, #1e293b);
  line-height: 1.2;
}
.clientes-kpi-value.accent { color: #22c55e; }
.clientes-kpi-value.warn { color: #f97316; }
.clientes-kpi-value.danger { color: #ef4444; }
.clientes-kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clr-text-secondary, #64748b);
  font-weight: 600;
  text-align: center;
}

/* Table */
.clientes-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.clientes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.clientes-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clr-text-secondary, #64748b);
  border-bottom: 2px solid var(--clr-border, #e5e7eb);
  white-space: nowrap;
  background: var(--clr-surface, #f8fafc);
  position: sticky;
  top: 0;
  z-index: 1;
}
.clientes-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--clr-border-light, #f1f5f9);
  vertical-align: middle;
}
.clientes-row {
  cursor: pointer;
  transition: background 0.15s;
}
.clientes-row:hover {
  background: var(--clr-surface-hover, #f1f5f9);
}
.clientes-name-cell strong {
  font-size: 0.85rem;
  color: var(--clr-text, #1e293b);
}
.clientes-count {
  font-size: 0.78rem;
  color: var(--clr-text-secondary, #64748b);
  padding: 10px 0 0;
  text-align: right;
}
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--clr-text-secondary, #64748b); }
.loading-text { color: var(--clr-text-secondary, #64748b); padding: 24px; text-align: center; }
.error-text { color: #ef4444; padding: 24px; text-align: center; }
.empty-text { color: var(--clr-text-secondary, #64748b); padding: 40px; text-align: center; font-size: 0.9rem; }

/* Badges */
.churn-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill, 20px);
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.lifecycle-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill, 20px);
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--clr-accent-light, #e0f2fe);
  color: var(--clr-accent, #0369a1);
  white-space: nowrap;
}

/* Health bar */
.health-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}
.health-bar-wrap {
  position: relative;
  width: 60px;
  height: 7px;
  background: var(--clr-border, #e5e7eb);
  border-radius: 4px;
  overflow: visible;
}
.health-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.health-bar-num {
  position: absolute;
  right: -28px;
  top: -3px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--clr-text, #1e293b);
}

/* Search input in header */
.search-input {
  padding: 6px 12px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  font-size: 0.82rem;
  background: var(--clr-surface, #fff);
  color: var(--clr-text, #1e293b);
  width: 180px;
}
.search-input:focus {
  outline: none;
  border-color: var(--clr-accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* ── Brevo Modal ── */
.modal-lg { max-width: 640px; }

.brevo-setup, .brevo-connected { padding: 8px 0; }
.brevo-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.brevo-form label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--clr-text-secondary, #64748b);
}
.input-field {
  padding: 8px 12px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  font-size: 0.85rem;
  background: var(--clr-surface, #fff);
  color: var(--clr-text, #1e293b);
}
.input-field:focus {
  outline: none;
  border-color: var(--clr-accent, #2563eb);
}

.brevo-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 16px;
}
.brevo-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b7280;
}
.brevo-status-dot.connected { background: #22c55e; }

.brevo-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.brevo-stat {
  flex: 1 1 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px;
  background: var(--clr-surface, #f8fafc);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--clr-border, #e5e7eb);
}
.brevo-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-text, #1e293b);
}
.brevo-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clr-text-secondary, #64748b);
  font-weight: 600;
  text-align: center;
}

.brevo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.danger-text { color: #ef4444 !important; }

.brevo-lists {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brevo-lists h4 {
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.brevo-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--clr-surface, #f8fafc);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--clr-border, #e5e7eb);
  font-size: 0.82rem;
}
.brevo-list-item small {
  color: var(--clr-text-secondary, #64748b);
  font-size: 0.72rem;
}
.brevo-info { border-top: 1px solid var(--clr-border, #e5e7eb); padding-top: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .clientes-kpi-row { gap: 8px; }
  .clientes-kpi { min-width: 90px; padding: 8px 4px; }
  .clientes-kpi-value { font-size: 1.1rem; }
  .clientes-table { font-size: 0.75rem; }
  .search-input { width: 140px; }
  .brevo-stats { gap: 8px; }
}


/* ─── Filtros unificados de leads (barra única) ─── */
.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.toolbar-filters .filter-divider {
  width: 1px;
  align-self: stretch;
  min-height: 22px;
  background: var(--line-strong);
  margin: 0 4px;
}
.toolbar-filters .lifecycle-filter.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ═══════════════════════════════════════════════════════════
   REFINO MINIMALISTA — superfícies mais limpas, menos peso visual
   ═══════════════════════════════════════════════════════════ */

/* Painéis: borda sutil, sombra leve, cantos contidos */
.panel {
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

/* Cabeçalho de seção mais enxuto */
.leads-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.leads-header-top h3 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
#leadCountChip {
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-tint);
  color: var(--muted);
  border: none;
}

/* Filtros: pills menores, leves, estado inativo discreto */
.toolbar-filters .lifecycle-filter {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: all var(--transition-fast);
}
.toolbar-filters .lifecycle-filter:hover {
  border-color: var(--brand);
  color: var(--text);
}
.toolbar-filters .lifecycle-filter.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* Toolbar de ações: botões compactos */
.leads-toolbar .toolbar-button {
  font-size: 0.82rem;
  padding: 7px 14px;
}

/* Busca + select: linha única, clean */
.toolbar-secondary {
  gap: 10px;
}
.toolbar-secondary .search input,
.toolbar-secondary select {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  font-size: 0.88rem;
  padding: 9px 13px;
}

/* Tabela: cabeçalho leve, linhas arejadas, sem borda dura */
.leads-table thead th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-soft);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.leads-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.leads-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges de tipo/segmento: planos, sem sombra */
.lead-type-badge,
.segment-chip {
  box-shadow: none;
  font-weight: 500;
}

/* Sidebar: navegação mais respirada */
.nav-link {
  font-size: 0.9rem;
  border-radius: var(--radius-md);
}

/* Quick-action cards: menos chamativos, mais flat */
.quick-action-card {
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.quick-action-card:hover {
  border-color: var(--brand);
}

/* ─── Painel de Filtros da aba Leads ─── */
.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}
#leadFiltersToggle.is-active {
  border-color: var(--brand);
  color: var(--brand);
}

.leads-filter-panel {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 4px 0 8px;
}
.leads-filter-panel .filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.leads-filter-panel .filter-group-wide {
  grid-column: 1 / -1;
}
.leads-filter-panel .filter-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-chip:hover { border-color: var(--brand); color: var(--text); }
.filter-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.filter-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-range input {
  flex: 1;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
}
.filter-range input:focus { outline: none; border-color: var(--brand); }
.filter-range span { color: var(--muted-soft); font-size: 0.85rem; }
.filter-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .leads-filter-panel .filter-grid { grid-template-columns: 1fr; }
}

/* ─── Ações da tabela de leads: ícones estáveis (sem deslocar no hover) ─── */
.lead-actions-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-start;
}
.lead-action-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.lead-action-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}
.lead-action-icon:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
  /* sem transform — não desloca */
}

/* Linha de leads: hover só muda o fundo, NÃO desloca conteúdo */
.leads-table tbody tr.lead-main-row {
  transition: background var(--transition-fast);
}
.leads-table tbody tr.lead-main-row:hover {
  background: var(--surface-tint);
}
.leads-table tbody tr.lead-main-row:hover::before,
.leads-table tbody tr:hover::before {
  content: none !important;   /* remove a barra lateral que causava o "pulo" */
}
.leads-table tbody tr.lead-main-row td {
  transition: none;
}

/* Select de ordenação ocupa a largura do grupo */
.filter-select-full {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
}
.filter-select-full:focus { outline: none; border-color: var(--brand); }

/* ─── Prontuário do lead: header limpo ─── */
.lead-profile-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.lead-profile-meta span { font-size: 0.88rem; color: var(--text); }
.lead-profile-meta em {
  font-style: normal;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-soft);
  margin-right: 5px;
}
.lead-profile-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.lead-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }

/* Menu "Mais ações" (native details/summary) */
.lead-more-menu { position: relative; }
.lead-more-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.lead-more-menu > summary::-webkit-details-marker { display: none; }
.lead-more-menu[open] > summary { border-color: var(--brand); color: var(--brand); }
.lead-more-content {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 220px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
}
.lead-more-item {
  text-align: left;
  background: transparent;
  border: none;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.lead-more-item:hover { background: var(--brand-soft); color: var(--brand); }

/* Sidebar de métricas: limpa, sem ícones */
.lead-sidebar-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.lead-sidebar-item:last-child { border-bottom: none; }
.lead-sidebar-item .lead-sidebar-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-soft);
  margin-bottom: 2px;
}
.lead-sidebar-item strong { font-size: 1rem; color: var(--text); }
.lead-sidebar-item small { display: block; font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.lead-sidebar-action-primary { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ─── Ícones SVG em contextos coloridos/compactos ─── */
.timeline-dot svg { width: 13px; height: 13px; color: #fff; display: block; }
.pipeline-quick-btn svg { width: 15px; height: 15px; display: block; }
.pipeline-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Campo de busca de lead (modal de tarefa) ─── */
.lead-search-field { position: relative; }
.lead-search-field input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.92rem;
}
.lead-search-field input[type="text"]:focus { outline: none; border-color: var(--brand); }
.lead-search-results {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 30;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
}
.lead-search-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.lead-search-item:hover { background: var(--brand-soft); }
.lead-search-item strong { font-size: 0.9rem; color: var(--text); }
.lead-search-item span { font-size: 0.76rem; color: var(--muted); }
.lead-search-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* ─── Aba Tarefas: reenquadre minimalista ─── */
/* Calendário compacto — sem "Livre", células menores, dia limpo */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day {
  /* Sem aspect-ratio: em tela cheia as células ficavam enormes/altas. Altura
     proporcional fixa → calendário preenche a largura toda sem virar gigante. */
  min-height: clamp(64px, 9vh, 104px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.calendar-day:hover { border-color: var(--brand); }
.calendar-day.is-today { border-color: var(--brand); background: var(--brand-soft); }
.calendar-day.is-active { background: var(--brand); }
.calendar-day.is-active .calendar-day-number { color: #fff; }
.calendar-day.is-outside { opacity: 0.35; }
.calendar-day-top { display: flex; align-items: center; gap: 4px; width: 100%; justify-content: space-between; }
.calendar-day-number { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.calendar-task-count {
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.calendar-day.is-active .calendar-task-count { background: #fff; color: var(--brand); }

/* Painéis da aba Tarefas mais enxutos */
[data-view-panel="tasks"].panel { padding: 16px 18px; }
[data-view-panel="tasks"] .panel-header h3 { font-size: 1.05rem; }
[data-view-panel="tasks"] .panel-header .eyebrow { font-size: 0.64rem; }
.task-list .task-item, .task-list > div { font-size: 0.86rem; }

/* Tabela de tarefas: células e fontes menores */
.task-table thead th { font-size: 0.66rem; padding: 8px 10px; }
.task-table tbody td { font-size: 0.83rem; padding: 9px 10px; }
/* Enquadra a tabela de Tarefas na largura do painel (igual às demais) */
.task-table { table-layout: fixed; width: 100%; }
.task-table th, .task-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.task-table th:nth-child(1), .task-table td:nth-child(1) { width: 34px; }
.task-table th:nth-child(2), .task-table td:nth-child(2) { width: 9%; }
.task-table th:nth-child(3), .task-table td:nth-child(3) { width: 15%; }
.task-table th:nth-child(4), .task-table td:nth-child(4) { width: 17%; }
.task-table th:nth-child(5), .task-table td:nth-child(5) { width: 12%; }
.task-table th:nth-child(6), .task-table td:nth-child(6) { width: 13%; }
.task-table th:nth-child(7), .task-table td:nth-child(7) { width: 11%; }
.task-table th:nth-child(8), .task-table td:nth-child(8) { width: 10%; }
.task-table th:nth-child(9), .task-table td:nth-child(9) { width: 156px; overflow: visible; }
.task-table .lead-actions-cell { flex-wrap: nowrap; gap: 3px; }
.action-reopen-btn { color: #22c55e; font-weight: 700; }
.task-status { font-size: 0.72rem; padding: 2px 8px; }

/* Agenda do dia: card compacto */
#dailyTaskList { font-size: 0.86rem; }
#calendarAgenda { font-size: 0.84rem; color: var(--muted); }

/* Agenda do dia: itens clicáveis (vão pra tabela de tarefas do dia) */
.agenda-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.agenda-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.agenda-item time { font-size: 0.72rem; color: var(--muted); }
.agenda-item strong { display: block; font-size: 0.9rem; color: var(--text); margin: 2px 0; }
.agenda-item p { font-size: 0.78rem; color: var(--muted); margin: 0; }

/* ══════ Gestão do Cliente — painel 360 ══════ */
.g360 { display: flex; flex-direction: column; gap: 16px; }
.g360-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.g360-health { display: flex; align-items: center; gap: 12px; }
.g360-health-ring {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 1.25rem; color: var(--text);
  background: radial-gradient(closest-side, var(--surface) 70%, transparent 71%),
    conic-gradient(var(--c) calc(var(--pct) * 1%), var(--line) 0);
  position: relative;
}
.g360-health-ring span { position: relative; }
.g360-health-title { margin: 0; font-weight: 600; color: var(--text); }
.g360-health small { color: var(--muted); font-size: .78rem; }
.g360-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.g360-badge { padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.g360-badge-soft { background: var(--surface-strong); color: var(--muted); border: 1px solid var(--line); }
.g360-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.g360-kpi {
  background: var(--surface-strong); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 2px;
}
.g360-kpi-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.g360-kpi-value { font-size: 1.15rem; color: var(--text); }
.g360-kpi-sub { font-size: .72rem; color: var(--muted-soft); }
.g360-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .g360-cols { grid-template-columns: 1fr; } }
.g360-card { background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; }
.g360-card-title { margin: 0 0 10px; font-weight: 600; color: var(--text); font-size: .9rem; }
.g360-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.g360-list li { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); padding: 4px 0; border-bottom: 1px solid var(--line); }
.g360-list li:last-child { border-bottom: none; }
.g360-list li strong { color: var(--text); }

/* Gestão do Cliente — aba do menu */
.gestao-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.gestao-pill {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-strong); color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition-fast);
}
.gestao-pill:hover { border-color: var(--brand); }
.gestao-pill.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.gestao-pill strong { font-weight: 700; }
.gestao-search {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); margin-bottom: 12px; font-size: .9rem;
}
/* Painel "Tarefas do dia" (lista redundante) escondido — a listagem oficial fica
   no painel "Tarefas (Compromissos da agenda)". O elemento permanece no DOM pra
   não quebrar renderDailyTasks/renderNotificationBanner. */
#dailyTasksPanel { display: none !important; }
/* Mapa de execução por vendedor (Resumo admin) */
.vendor-exec { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.vendor-exec[hidden] { display: none; }
.vendor-exec-head .eyebrow { margin: 0; }
.vendor-exec-head h3 { margin: 2px 0 0; font-size: 1.05rem; }
.vendor-exec-hint { display: block; color: var(--muted); font-size: .76rem; margin: 2px 0 10px; }
.vendor-exec-wrap { overflow-x: auto; }
.vendor-exec-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.vendor-exec-table th, .vendor-exec-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vendor-exec-table th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; text-align: center; }
.vendor-exec-table th:first-child, .vendor-exec-table td:first-child { text-align: left; }
.vendor-exec-table td { text-align: center; }
.vendor-exec-table tfoot td { border-top: 2px solid var(--line); border-bottom: none; }
.vexec-badge { display: inline-block; min-width: 26px; padding: 2px 9px; border-radius: 999px; background: var(--surface-strong); font-weight: 600; }
.vexec-badge.is-bad { background: rgba(239,68,68,.16); color: #ef4444; }
.vexec-badge.is-warn { background: rgba(234,179,8,.16); color: #eab308; }
.vexec-badge.is-good { background: rgba(34,197,94,.16); color: #22c55e; }
.vexec-badge.is-await { background: rgba(99,102,241,.16); color: #818cf8; }
/* Números clicáveis da "Execução por vendedor" (drill-down para a aba Tarefas) */
.vexec-clickable { cursor: pointer; transition: filter .12s ease, box-shadow .12s ease, transform .12s ease; }
.vexec-clickable:hover { filter: brightness(1.18); box-shadow: 0 0 0 2px var(--accent, #ef4444) inset; transform: translateY(-1px); }
.vexec-clickable:focus-visible { outline: 2px solid var(--accent, #ef4444); outline-offset: 2px; }
td > strong.vexec-clickable { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* Chip do filtro ativo vindo do drill (aba Tarefas) */
.task-drill-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; margin-left: 4px; border-radius: 999px; background: rgba(239,68,68,.14); color: #ef4444; font-weight: 600; font-size: 13px; }
.task-drill-chip button { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: none; border-radius: 999px; background: rgba(239,68,68,.22); color: inherit; cursor: pointer; font-size: 12px; line-height: 1; }
.task-drill-chip button:hover { background: rgba(239,68,68,.4); }
/* Tag "Sem pedido": lead só cadastro, ainda sem compra */
.sem-pedido-tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: rgba(161,98,7,.14); color: #d0891f; font-size: .7rem; font-weight: 600; border: 1px solid rgba(161,98,7,.3); white-space: nowrap; }
/* Logs do sistema */
.settings-logs-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.log-row { display: grid; grid-template-columns: 150px 130px 1fr; gap: 10px; align-items: baseline; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.log-row:last-child { border-bottom: none; }
.log-row .log-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-row .log-source { font-weight: 600; }
.log-row.is-error { background: rgba(239,68,68,.08); }
.log-row.is-error .log-source { color: #ef4444; }
.log-row.is-warn { background: rgba(234,179,8,.08); }
.log-row.is-warn .log-source { color: #eab308; }
.log-row.is-info .log-source { color: #818cf8; }
@media (max-width: 640px) { .log-row { grid-template-columns: 1fr; gap: 2px; } }
/* Auditoria */
.audit-row { display: grid; grid-template-columns: 150px 1fr 160px; gap: 10px; align-items: baseline; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.audit-row:last-child { border-bottom: none; }
.audit-row.audit-head { font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; border: 1px solid var(--border); border-bottom: none; border-radius: 10px 10px 0 0; background: var(--surface-strong); }
.audit-row .audit-user { font-weight: 600; }
.audit-row .audit-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
#auditList { border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; max-height: 460px; overflow-y: auto; }
@media (max-width: 640px) { .audit-row { grid-template-columns: 1fr; gap: 2px; } .audit-row.audit-head { display: none; } }
/* Configurações: menu lateral + páginas */
.settings-layout { display: flex; gap: 22px; align-items: flex-start; margin-top: 8px; }
.settings-menu { flex: 0 0 220px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 12px; }
.settings-menu-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 10px; background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; font-size: 14px; font-weight: 500; width: 100%; }
.settings-menu-item:hover { background: var(--surface-strong); }
.settings-menu-item.is-active { background: var(--surface-strong); border-color: var(--border); color: var(--accent, #ef4444); font-weight: 700; }
.settings-menu-item .smenu-ico { width: 20px; text-align: center; }
.settings-pages { flex: 1; min-width: 0; }
.settings-pages .settings-section-block { margin: 0; }
/* No modo página, o título da seção é só um cabeçalho (sem colapsar) */
.settings-pages .settings-section-title { cursor: default; }
.settings-pages .settings-chevron { display: none; }
@media (max-width: 900px) {
  .settings-layout { flex-direction: column; }
  .settings-menu { flex-direction: row; overflow-x: auto; width: 100%; position: static; padding-bottom: 4px; }
  .settings-menu-item { white-space: nowrap; width: auto; }
}
/* Relatórios: tabela de performance de vendedores */
.report-vend-table { display: flex; flex-direction: column; gap: 2px; }
.rvt-row { display: grid; grid-template-columns: 1.6fr 1.4fr 1.4fr; gap: 12px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 13px; }
.rvt-row:last-child { border-bottom: none; }
.rvt-row.rvt-head { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; font-weight: 700; }
.rvt-row .rvt-name { font-weight: 600; }
.rvt-row .vchart-track { display: inline-block; width: 60px; height: 7px; vertical-align: middle; margin-right: 6px; }
@media (max-width: 640px) { .rvt-row { grid-template-columns: 1fr 1fr; } }
.vendor-exec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.vendor-exec-head .eyebrow { margin: 0; }
.vexec-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vexec-range-btn { background: var(--surface-strong); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 4px 12px; font-size: .78rem; cursor: pointer; }
.vexec-range-btn:hover { border-color: var(--brand); }
.vexec-range-btn.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.vexec-range-custom { display: inline-flex; align-items: center; gap: 4px; }
.vexec-range-custom input[type="date"] { background: var(--surface-strong); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 3px 8px; font-size: .78rem; }
/* Gráficos da equipe */
.vendor-charts { margin-top: 16px; }
.vendor-charts[hidden] { display: none; }
.vchart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.vchart-card { background: var(--surface-strong); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.vchart-card h4 { margin: 0 0 10px; font-size: .9rem; color: var(--muted); }
.vchart-row { display: grid; grid-template-columns: 120px 1fr 36px; align-items: center; gap: 10px; margin: 6px 0; }
.vchart-name { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vchart-track { background: var(--line); border-radius: 999px; height: 12px; overflow: hidden; }
.vchart-bar { display: block; height: 100%; border-radius: 999px; min-width: 2px; }
.vchart-bar.is-open { background: #eab308; }
.vchart-bar.is-exec { background: #22c55e; }
.vchart-val { font-size: .82rem; font-weight: 700; text-align: right; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }
/* Situação "Aguardando resposta" / "Reabordar" */
.task-status.is-awaiting { background: rgba(99,102,241,.16); color: #818cf8; }
.task-status.is-reabordar { background: rgba(239,68,68,.18); color: #ef4444; font-weight: 700; }
.action-awaiting-btn { color: #818cf8; }
.action-reabordar-btn { color: #ef4444; font-weight: 700; }
/* Abas visíveis de tarefas (Hoje/Atrasadas/Aguardando/Abertas/Concluídas) */
.task-quick-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.task-quick-tab { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-strong); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 6px 14px; font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.task-quick-tab:hover { border-color: var(--brand); }
.task-quick-tab.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.task-quick-tab .qtab-count { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; padding: 0 6px; border-radius: 999px; background: var(--line); font-size: .74rem; font-weight: 700; }
.task-quick-tab.is-active .qtab-count { background: rgba(255,255,255,.22); color: #fff; }
.task-quick-tab.is-bad:not(.is-active) .qtab-count { background: rgba(239,68,68,.18); color: #ef4444; }
.task-quick-tab.is-await:not(.is-active) .qtab-count { background: rgba(99,102,241,.18); color: #818cf8; }
.task-quick-tab.is-good:not(.is-active) .qtab-count { background: rgba(34,197,94,.18); color: #22c55e; }
/* Modal de reagendar em massa (data + OBS por lead) */
.bulk-resched-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 14px; max-height: 48vh; overflow-y: auto; }
.bulk-resched-item { background: var(--surface-strong); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.bulk-resched-lead { font-size: .9rem; margin-bottom: 5px; }
.bulk-resched-lead .muted { font-weight: 400; }
.bulk-resched-obs { width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 9px; font: inherit; font-size: .85rem; }
/* PUSH de situação do CRM: modal central ao abrir + sininho depois */
.task-push-modal { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); padding: 16px; animation: taskPushFade .15s ease; }
.task-push-modal[hidden] { display: none; }
@keyframes taskPushFade { from { opacity: 0; } to { opacity: 1; } }
.task-push-card { width: 360px; max-width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.55); padding: 20px; animation: taskPushIn .2s ease; }
@keyframes taskPushIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.task-push-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.task-push-title { font-weight: 700; font-size: 1.02rem; }
.task-push-sub { color: var(--muted); font-size: .82rem; margin: 0 0 12px; }
.task-push-close { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 6px; }
.task-push-close:hover { color: var(--text); }
.task-push-line { display: flex; align-items: center; justify-content: space-between; width: 100%; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 8px; padding: 9px 13px; margin-bottom: 7px; color: var(--text); font-size: .9rem; cursor: pointer; }
.task-push-line:hover { border-color: var(--brand); }
.task-push-line strong { font-size: 1.1rem; }
.task-push-line.is-bad strong { color: #ef4444; }
.task-push-line.is-await strong { color: #818cf8; }
.task-push-dismiss { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--muted); margin: 10px 0 0; cursor: pointer; }
.task-push-ok { width: 100%; margin-top: 12px; }
/* Sininho (sinal de notificações em aberto) */
.task-push-signal { position: fixed; top: 16px; right: 18px; z-index: 80; width: 46px; height: 46px; border-radius: 999px; background: var(--brand); color: #fff; border: none; font-size: 1.15rem; cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.4); }
.task-push-signal[hidden] { display: none; }
.task-push-signal:hover { filter: brightness(1.08); }
.task-push-signal .signal-badge { position: absolute; top: -5px; right: -5px; background: #ef4444; color: #fff; border-radius: 999px; min-width: 21px; height: 21px; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--surface); }
@media (max-width: 600px) { .task-push-signal { top: 10px; right: 10px; } }
/* ALARME sonoro de tarefa (card pulsante) */
.task-alarm { position: fixed; bottom: 18px; right: 18px; z-index: 90; width: 300px; background: var(--surface); border: 2px solid #ef4444; border-radius: 12px; box-shadow: 0 12px 34px rgba(239,68,68,.35); padding: 12px 14px; animation: alarmPulse 1.4s ease-in-out infinite; }
.task-alarm[hidden] { display: none; }
@keyframes alarmPulse { 0%,100% { box-shadow: 0 10px 30px rgba(239,68,68,.22); } 50% { box-shadow: 0 12px 42px rgba(239,68,68,.6); } }
.task-alarm-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; color: #ef4444; margin-bottom: 8px; }
.task-alarm-mute { background: transparent; border: none; cursor: pointer; font-size: 1rem; }
.task-alarm-item { background: var(--surface-strong); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 7px; }
.task-alarm-info { font-size: .85rem; margin-bottom: 6px; }
.task-alarm-actions { display: flex; gap: 6px; }
.task-alarm-done, .task-alarm-ack { flex: 1; border-radius: 6px; padding: 5px 8px; font-size: .8rem; font-weight: 600; cursor: pointer; border: 1px solid var(--line); }
.task-alarm-done { background: var(--brand); color: #fff; border-color: var(--brand); }
.task-alarm-ack { background: var(--surface); color: var(--text); }
@media (max-width: 600px) { .task-alarm { bottom: 8px; right: 8px; left: 8px; width: auto; } }
.gestao-table-wrap { overflow-x: auto; }
.gestao-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.gestao-table td { font-size: .86rem; }
.gestao-row:hover { background: var(--brand-soft); }

/* Gestão do Cliente — cabeçalho ordenável + ações por linha */
.gestao-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.gestao-sortable:hover { color: var(--brand); }
.gestao-actions { display: flex; gap: 4px; }
.gestao-actions .lead-action-icon { width: 28px; height: 28px; padding: 5px; }
.gestao-actions .lead-action-icon svg { width: 16px; height: 16px; }

/* ══════ Ficha do lead — layout mais clean e enquadrado ══════ */
/* Cabeçalho: contato rápido em chips */
.lead-detail-page .lead-profile-meta { gap: 8px; margin-top: 8px; }
.lead-detail-page .lead-profile-meta span {
  background: var(--surface-strong); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: .8rem; color: var(--text); display: inline-flex; gap: 6px; align-items: baseline;
}
.lead-detail-page .lead-profile-meta em {
  font-style: normal; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em;
}

/* Seções: respiro e separação claros */
.lead-detail-page .lead-section { padding: 18px 20px; margin-bottom: 14px; }
.lead-detail-page .lead-section-heading { margin-bottom: 16px; }

/* Dados do Contato: cada campo num card enquadrado */
.lead-detail-page .lead-info-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.lead-detail-page .lead-info-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.lead-detail-page .lead-info-item label {
  font-size: .68rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0;
}
.lead-detail-page .lead-info-item span {
  font-size: .9rem; font-weight: 500; color: var(--text); line-height: 1.35;
}

/* Dados Comerciais: métricas enquadradas e uniformes */
.lead-detail-page .metrics-grid {
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 10px;
}
.lead-detail-page .metric-pill {
  flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px;
}
.lead-detail-page .metric-pill span {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.lead-detail-page .metric-pill strong { font-size: 1.02rem; color: var(--text); }

/* ══════ Tabela de Leads — par (linha + detalhe) como bloco único ══════ */
/* Remove zebra (fazia o detalhe ficar com cor diferente da linha principal) */
.leads-table tbody tr:nth-child(even),
[data-theme="dark"] .leads-table tbody tr:nth-child(even) { background: transparent; }

/* Sem barra lateral e sem outline (causavam "pulo"/desenquadre no hover/seleção) */
.leads-table tbody tr::before,
.leads-table tbody tr:hover::before,
.leads-table tbody tr.is-selected::before { content: none !important; }
.leads-table tbody tr.is-selected { outline: none; }

/* Separador entre leads: borda no topo da linha principal */
.leads-table tbody tr.lead-main-row > td {
  border-top: 1px solid var(--line);
  padding-top: 12px; padding-bottom: 4px;
  vertical-align: middle; background: transparent;
}
.leads-table tbody tr.leads-detail-row > td {
  border-top: none; padding-top: 0; padding-bottom: 12px; background: transparent;
}

/* Hover e seleção tingem o PAR inteiro (linha + detalhe), sem deslocar nada */
.leads-table tbody tr.lead-main-row:hover > td,
.leads-table tbody tr.lead-main-row:hover + .leads-detail-row > td,
.leads-table tbody tr.leads-detail-row:hover > td,
.leads-table tbody tr.lead-main-row.is-selected > td,
.leads-table tbody tr.lead-main-row.is-selected + .leads-detail-row > td {
  background: var(--brand-soft);
}
/* Bordas arredondadas sutis no bloco em hover/seleção */
.leads-table tbody tr.lead-main-row:hover > td:first-child,
.leads-table tbody tr.lead-main-row.is-selected > td:first-child { border-top-left-radius: 8px; }
.leads-table tbody tr.lead-main-row:hover > td:last-child,
.leads-table tbody tr.lead-main-row.is-selected > td:last-child { border-top-right-radius: 8px; }

/* Aba Compras: cards distribuídos em 3 colunas uniformes */
.lead-detail-page .purchase-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; align-items: stretch;
}
.lead-detail-page .purchase-cards .metric-pill {
  flex-direction: column; align-items: flex-start; gap: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
.lead-detail-page .purchase-cards .metric-pill span { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lead-detail-page .purchase-cards .metric-pill strong { font-size: .9rem; color: var(--text); line-height: 1.35; }
@media (max-width: 720px) { .lead-detail-page .purchase-cards { grid-template-columns: 1fr; } }

/* Botão Editar lead em destaque */
.lead-edit-btn { border-color: var(--brand) !important; color: var(--brand) !important; font-weight: 600; }
.lead-edit-btn:hover { background: var(--brand-soft) !important; }

/* Tag de ticket: sutil, sem contaminar */
.ticket-tag { vertical-align: middle; white-space: nowrap; }
.lead-profile-name .ticket-tag { font-size: .68rem; margin-left: 6px; }

/* Badge de unidade (Centro / Parque UNA) na compra */
.unit-badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  font-size: .68rem; font-weight: 600; background: var(--brand-soft); color: var(--brand-deep, var(--brand));
  border: 1px solid var(--line); white-space: nowrap;
}

/* Compras: card único de produtos + lista de pedidos recolhível */
.lead-detail-page .metric-pill-full { width: 100%; margin-bottom: 14px; }
.purchase-ledger-summary {
  cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--brand);
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface-strong); list-style: none; user-select: none;
  display: flex; align-items: center; gap: 6px;
}
.purchase-ledger-summary::before { content: "▸"; transition: transform .15s ease; }
.purchase-ledger-details[open] > .purchase-ledger-summary::before { transform: rotate(90deg); }
.purchase-ledger-summary:hover { border-color: var(--brand); }
.purchase-ledger-details[open] > .purchase-ledger-summary { margin-bottom: 10px; }
.purchase-ledger-summary::-webkit-details-marker { display: none; }

/* Histórico/Timeline: bloco recolhível das entradas antigas */
.entries-more { margin-top: 8px; }
.entries-more > .purchase-ledger-summary { margin-bottom: 8px; }

/* ══════ CONFIGURAÇÕES — Equipe (cards) ══════ */
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.user-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.user-card-inactive { opacity: .55; }
.user-card-avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep, var(--brand)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; }
.user-card-body { flex: 1; min-width: 0; }
.user-card-name { font-weight: 600; font-size: .95rem; }
.user-card-name small { color: var(--muted); font-weight: 400; }
.user-card-email { color: var(--muted); font-size: .82rem; margin: 2px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .78rem; }
.user-card-unit { color: var(--muted); }
.user-card-status { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.user-card-actions { display: flex; flex-direction: column; gap: 6px; }
.user-card-actions .ghost-button { padding: 5px 12px; font-size: .8rem; }

/* ══════ CONFIGURAÇÕES — Matriz de permissões ══════ */
.perms-matrix-wrap { overflow-x: auto; margin-top: 12px; }
.perms-matrix { width: 100%; border-collapse: collapse; font-size: .88rem; }
.perms-matrix th, .perms-matrix td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.perms-matrix th:first-child, .perms-matrix td.perm-label { text-align: left; }
.perms-matrix thead th { font-weight: 600; color: var(--muted); background: var(--surface-strong); }
.perms-matrix td.perm-label { font-weight: 500; }
.perms-matrix input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; accent-color: var(--brand); }
.perms-matrix tbody tr:hover { background: var(--surface-strong); }

/* ══════ CONFIGURAÇÕES — Sistema (sub-cards) ══════ */
.settings-system-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 12px; }
.settings-subcard { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.settings-subcard > strong { display: block; margin-bottom: 2px; }
.settings-subcard .settings-section-desc { margin-bottom: 12px; }

/* Selo de usuário ainda não confirmado */
.user-card-pending { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; background: rgba(245,158,11,.14); color: #b45309; border: 1px solid rgba(245,158,11,.35); }

/* Leads: contato com ícone de WhatsApp inline + data de inclusão compacta */
.lead-contact-cell { display: inline-flex; align-items: center; gap: 8px; }
.wa-inline { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; color: #25d366; background: rgba(37, 211, 102, 0.12); flex: 0 0 auto; transition: background 150ms ease; }
.wa-inline:hover { background: rgba(37, 211, 102, 0.22); }
.wa-inline svg { width: 15px; height: 15px; }
.td-incluido { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

/* Tarefa vinculada clicável (ficha do lead) */
.lead-task-clickable { cursor: pointer; transition: background 150ms ease, border-color 150ms ease; position: relative; }
.lead-task-clickable:hover { background: var(--surface-tint); border-color: var(--brand); }
.lead-task-cta { display: inline-block; margin-top: 6px; font-size: 0.78rem; font-weight: 600; color: var(--brand); }

/* Enquadra a tarefa vinculada: 1ª linha = nome + data; 2ª linha = descrição
   (largura total); "Ver/Concluir →" fixo no canto. Evita o nome longo empurrar
   e quebrar o texto. */
.lead-detail-page .lead-task-clickable {
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding-right: 84px;
}
.lead-detail-page .lead-task-clickable .entry-type { min-width: 0; flex-shrink: 1; }
.lead-detail-page .lead-task-clickable .entry-date { min-width: 0; flex-shrink: 0; }
.lead-detail-page .lead-task-clickable .entry-note {
  flex-basis: 100%;
  margin-top: 2px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.lead-detail-page .lead-task-clickable .entry-note .stage-badge { vertical-align: baseline; }
.lead-detail-page .lead-task-clickable .lead-task-actions {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.lead-detail-page .lead-task-clickable .lead-task-cta {
  margin: 0;
}
.lead-task-edit {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.lead-task-edit:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--surface-tint);
}

/* Orientações da tarefa no modal de execução/conclusão */
.task-orientacoes { background: var(--surface-tint); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 14px; }
.task-orient-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.task-orient-name { font-size: 1rem; }
.task-orient-date { color: var(--muted); font-size: .82rem; margin-left: 8px; }
.task-orient-lead { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.task-orient-line { margin: 8px 0 0; font-size: .88rem; }
.task-orient-line b, .task-orient-guide b, .task-orient-notes b { color: var(--muted); font-weight: 600; }
.task-orient-guide { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .9rem; line-height: 1.5; }
.task-orient-notes { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); line-height: 1.5; }
.task-result-sep { font-size: .82rem; font-weight: 600; color: var(--muted-soft); margin: 4px 0 8px; text-transform: uppercase; letter-spacing: .02em; }

/* Observações do lead — gerais (editável) + individuais (log) */
.lead-obs-block { margin-bottom: 18px; }
.lead-obs-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.lead-obs-label small { display: block; font-weight: 400; color: var(--muted-soft); font-size: .76rem; margin-top: 2px; }
.lead-obs-textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-deep); color: var(--text); font: inherit; resize: vertical; box-sizing: border-box; }
.lead-obs-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lead-obs-save { margin-top: 8px; padding: 8px 16px; font-size: .85rem; }
.lead-obs-add { display: flex; gap: 8px; margin-bottom: 8px; }
.lead-obs-add input { flex: 1; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-deep); color: var(--text); font: inherit; }
.lead-obs-add input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lead-notes-block { white-space: pre-line; background: var(--surface-tint); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .88rem; line-height: 1.6; color: var(--text); }

/* Observações no sidebar do lead (abaixo do Resumo do Lead) — clean e menor */
.lead-sidebar-obs { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.lead-sidebar-obs .lead-sidebar-title { margin-bottom: 8px; }
.lead-sidebar-obs-input { width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: .82rem; line-height: 1.45;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-deep); color: var(--text); resize: vertical; }
.lead-sidebar-obs-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lead-sidebar-obs-save { margin-top: 8px; width: 100%; font-size: .82rem; padding: 8px; }
.lead-sidebar-obs-history { margin-top: 12px; white-space: pre-line; font-size: .8rem; line-height: 1.6; color: var(--muted);
  max-height: 320px; overflow-y: auto; padding-right: 4px; }

/* Visualização somente leitura de tarefa concluída */
.task-view-body { display: grid; gap: 2px; margin-top: 8px; }
.task-view-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.task-view-row:last-child { border-bottom: 0; }
.task-view-row > span { color: var(--muted); }
.task-view-row > strong { font-weight: 600; }

/* Histórico de observações — itens limpos e fáceis de ler */
.lead-sidebar-obs-history { display: grid; gap: 8px; }
.lead-obs-entry { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.lead-obs-entry:last-child { border-bottom: 0; padding-bottom: 0; }
.lead-obs-date { font-size: .7rem; font-weight: 600; color: var(--muted-soft); letter-spacing: .02em; }
.lead-obs-entry p { margin: 0; font-size: .82rem; line-height: 1.45; color: var(--text); }
.lead-obs-empty { font-size: .8rem; color: var(--muted-soft); margin: 0; }

/* ══════ TIMELINE minimalista (todas movimentações + horário) ══════ */
.tl { position: relative; display: grid; gap: 0; padding-left: 6px; }
.tl-row { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; box-shadow: 0 0 0 3px var(--surface); position: relative; z-index: 1; }
/* fio vertical conectando os pontos */
.tl-row::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-row:first-child::before { top: 12px; }
.tl-row:last-child::before { bottom: auto; height: 12px; }
.tl-body { min-width: 0; }
.tl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tl-title { font-weight: 600; font-size: .9rem; color: var(--text); }
.tl-time { font-size: .74rem; color: var(--muted-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-meta { display: block; font-size: .76rem; color: var(--muted); margin-top: 2px; }
.tl-desc { margin: 4px 0 0; font-size: .82rem; line-height: 1.45; color: var(--muted); }
.timeline-empty { color: var(--muted-soft); font-size: .88rem; }

/* ══════ RESUMO — Foco do dia (saudação + KPIs + fila priorizada) ══════ */
.summary-focus { margin-bottom: 18px; }
.focus-greet h3 { margin: 0 0 2px; font-size: 1.25rem; }
.focus-greet p { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.focus-greet p strong { color: var(--text); }
.focus-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.focus-kpi { background: var(--surface-tint); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; }
.focus-kpi span { display: block; font-size: .76rem; color: var(--muted); margin-bottom: 4px; }
.focus-kpi strong { font-size: 1.5rem; font-weight: 700; }
.focus-list-head { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted-soft); margin-bottom: 8px; }
.focus-list { display: grid; gap: 8px; }
.focus-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.focus-tag { font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.focus-tag.is-danger { background: var(--danger-soft); color: var(--danger); }
.focus-tag.is-attention { background: var(--brand-soft); color: var(--brand); }
.focus-tag.is-info { background: var(--navy-soft); color: var(--muted); }
.focus-info { min-width: 0; }
.focus-info strong { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-sub { font-size: .78rem; color: var(--muted); }
.focus-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.focus-btn { padding: 6px 12px; font-size: .8rem; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-tint); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.focus-btn:hover { border-color: var(--brand); }
.focus-btn-wa { background: rgba(37,211,102,.12); border-color: rgba(37,211,102,.3); color: #1f9d57; }
.focus-empty { color: var(--muted); font-size: .9rem; padding: 8px 0; }
@media (max-width: 620px) { .focus-kpis { grid-template-columns: 1fr; } .focus-row { grid-template-columns: 1fr; } .focus-actions { justify-content: flex-start; } }

/* ══════ Tabela de Leads — enquadra em 100% (sem scroll lateral) ══════ */
/* gestao-table fica de fora: tem 9 colunas e usa scroll horizontal próprio
   (.gestao-table-wrap overflow-x:auto). Com table-layout:fixed o nome era
   espremido a ~1 letra. */
.leads-table:not(.task-table):not(.gestao-table) { table-layout: fixed; width: 100%; }
.leads-table:not(.task-table):not(.gestao-table) th,
.leads-table:not(.task-table):not(.gestao-table) td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
/* Nome e Contato podem quebrar (não corta info importante) */
.leads-table:not(.task-table) td:nth-child(2),
.leads-table:not(.task-table) td:nth-child(3) { white-space: normal; word-break: break-word; }
/* Larguras por coluna: check · Nome · Contato · Tipo · Cidade · Últ.compra · Resp · Incluído · Ação */
/* 8 colunas (sem Tipo): check · Nome · Contato · Ticket · Últ.compra · Resp · Incluído · Ação */
.leads-table:not(.task-table) th:nth-child(1), .leads-table:not(.task-table) td:nth-child(1) { width: 34px; }
.leads-table:not(.task-table) th:nth-child(2), .leads-table:not(.task-table) td:nth-child(2) { width: 24%; }
.leads-table:not(.task-table) th:nth-child(3), .leads-table:not(.task-table) td:nth-child(3) { width: 17%; }
.leads-table:not(.task-table) th:nth-child(4), .leads-table:not(.task-table) td:nth-child(4) { width: 10%; }
.leads-table:not(.task-table) th:nth-child(5), .leads-table:not(.task-table) td:nth-child(5) { width: 17%; }
.leads-table:not(.task-table) th:nth-child(6), .leads-table:not(.task-table) td:nth-child(6) { width: 14%; }
.leads-table:not(.task-table) th:nth-child(7), .leads-table:not(.task-table) td:nth-child(7) { width: 10%; }
.leads-table:not(.task-table) th:nth-child(8), .leads-table:not(.task-table) td:nth-child(8) { width: 122px; }
.leads-table:not(.task-table) .td-compra { font-size: .82rem; white-space: nowrap; }
/* Cashback: chip na lista + destaque no detalhe */
.cb-chip { display: inline-block; font-size: .72rem; font-weight: 700; color: #16a34a; background: rgba(22,163,74,.12); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.lead-detail-page .metric-cashback.is-ativo strong { color: #16a34a; }
.lead-detail-page .metric-cashback .cb-vence { display: inline-block; font-size: .74rem; font-weight: 600; color: var(--muted); margin-left: 4px; }
.leads-table:not(.task-table) td:nth-child(8) { overflow: visible; }
.leads-table:not(.task-table) .lead-actions-cell { gap: 6px; justify-content: flex-start; }
/* não força largura mínima que reintroduz scroll */
#leadTableBody, .leads-table:not(.task-table) { min-width: 0; }

/* ══════ Automações ══════ */
.automacao-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); max-width: 760px; overflow: hidden; }
.automacao-summary { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; font-weight: 600; }
.automacao-summary::-webkit-details-marker { display: none; }
.automacao-summary::before { content: "▸"; color: var(--muted-soft); transition: transform .15s ease; }
.automacao-card[open] .automacao-summary::before { transform: rotate(90deg); }
.automacao-summary:hover { background: var(--surface-tint); }
.automacao-status { margin-left: auto; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.automacao-status.is-on { background: var(--leaf-soft); color: var(--leaf); }
.automacao-status.is-off { background: var(--surface-tint); color: var(--muted-soft); }
.automacao-body { padding: 4px 20px 20px; border-top: 1px solid var(--line); }
.automacao-toggle { margin: 14px 0; }
.automacao-fields label small { font-weight: 400; color: var(--muted-soft); }
.automacao-title { font-size: 1rem; }
.automacao-desc { margin: 4px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.automacao-toggle { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; font-size: .82rem; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }
.automacao-toggle input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.automacao-fields { display: grid; grid-template-columns: 160px 1fr; gap: 14px; margin: 18px 0; }
.automacao-fields label { display: grid; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--text); }
.automacao-fields .automacao-guide { grid-column: 1 / -1; }
.automacao-fields input, .automacao-fields textarea { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-deep); color: var(--text); font: inherit; font-weight: 400; resize: vertical; }
.automacao-fields input:focus, .automacao-fields textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.automacao-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.automacao-note { margin: 14px 0 0; font-size: .78rem; color: var(--muted-soft); line-height: 1.5; }
@media (max-width: 620px) { .automacao-fields { grid-template-columns: 1fr; } }

/* Navegação do calendário (prev/próximo mês) */
.calendar-nav { display: inline-flex; align-items: center; gap: 8px; }
.calendar-nav-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); background: var(--surface-tint); color: var(--text); border-radius: var(--radius-sm); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.calendar-nav-btn:hover { border-color: var(--brand); color: var(--brand); }

/* Botão excluir no card de usuário */
.user-card-delete { color: var(--danger); border-color: var(--danger-soft); }
.user-card-delete:hover { border-color: var(--danger); background: var(--danger-soft); }

/* ── Campos de formulário modernos (.form-group em modais: Editar usuário etc.) ── */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label {
  font-size: .82rem; font-weight: 600; color: var(--muted);
  letter-spacing: .01em; margin: 0;
}
.form-group label small { font-weight: 400; color: var(--muted-soft); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; box-sizing: border-box; margin: 0;
  padding: 12px 14px; font-size: .94rem; line-height: 1.3;
  color: var(--text); background: var(--surface-tint);
  border: 1.5px solid transparent; border-radius: var(--radius-md);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-group input::placeholder { color: var(--muted-soft); }
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { background: var(--surface); border-color: var(--line-strong); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; background: var(--surface);
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
/* Seta custom no select (remove a nativa) */
.form-group select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235b616e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.form-group select:disabled { opacity: .55; cursor: not-allowed; }
[data-theme="dark"] .form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%239ba1ad' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
}

/* Prazo compacto inline na linha da tarefa (situação) */
.task-days-inline { display: inline-block; margin-left: 8px; font-size: 0.72rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.task-days-inline.is-overdue { color: var(--danger); }

/* Contraste dos badges de situação no modo escuro (antes "Aberta" era texto
   quase preto sobre fundo escuro = invisível) */
[data-theme="dark"] .task-status.is-open { background: rgba(255,255,255,0.08); color: #d4d9e2; }
[data-theme="dark"] .task-status.is-today { background: rgba(248,113,113,0.16); color: #ff9a9e; }
[data-theme="dark"] .task-status.is-overdue { background: rgba(248,113,113,0.18); color: #fca5a5; }

/* Resumo do dia abaixo do calendário (substitui a lista por extenso) */
.cal-agenda-summary { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; cursor: pointer; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-tint); color: var(--text); transition: border-color .15s ease, background .15s ease; }
.cal-agenda-summary:hover { border-color: var(--brand); background: var(--surface); }
.cal-agenda-head { font-size: .82rem; font-weight: 600; color: var(--muted); }
.cal-agenda-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-agenda-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--brand-soft); color: var(--text); font-size: .8rem; }
.cal-agenda-chip b { color: var(--brand-deep); font-weight: 700; }
[data-theme="dark"] .cal-agenda-chip b { color: #ff9a9e; }
.cal-agenda-empty { color: var(--muted-soft); font-size: .86rem; padding: 8px 2px; margin: 0; }

/* Painel de filtros de tarefas (recolhível) */
.task-filters-panel { display: flex; flex-direction: column; gap: 14px; }
.task-filters-panel .filter-group > label { display: block; margin-bottom: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.task-filters-panel .toolbar-filters { gap: 6px; flex-wrap: wrap; }
.task-filters-panel .task-filter { font-size: .82rem; padding: 7px 14px; }

/* Configurações: seções recolhíveis (accordion) — menos poluído */
.settings-section-title { cursor: pointer; user-select: none; }
.settings-section-title > div { flex: 1; min-width: 0; }
.settings-chevron { flex-shrink: 0; font-size: 1.3rem; line-height: 1; color: var(--muted); transition: transform .2s ease; margin-left: 4px; }
.settings-section-block.is-collapsed .settings-chevron { transform: rotate(-90deg); }
.settings-section-block.is-collapsed > :not(.settings-section-title) { display: none; }
.settings-section-block.is-collapsed .settings-section-title { margin-bottom: 0; }
.settings-section-block { transition: background .15s ease; }
.settings-section-block.is-collapsed:hover { background: var(--surface-tint); }

/* Toggle Minhas / Da loja (vendedor) */
.task-scope-toggle { display: inline-flex; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); overflow: hidden; }
.task-scope { border: none; background: transparent; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600; padding: 7px 14px; cursor: pointer; }
.task-scope.is-active { background: var(--brand); color: #fff; }
.task-scope:not(.is-active):hover { background: var(--surface-tint); color: var(--text); }

/* Barra global de filtro por loja (só admin) */
.store-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md); position: sticky; top: 0; z-index: 30; }
.store-filter-label { font-size: .85rem; font-weight: 700; color: var(--muted); margin-right: 2px; }
.store-filter-btn { border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; padding: 6px 14px; border-radius: var(--radius-pill); cursor: pointer; transition: all .15s ease; }
.store-filter-btn:hover { color: var(--text); border-color: var(--brand); }
.store-filter-btn.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Feedback de carregamento ao trocar de loja */
.store-filter-bar.is-loading { opacity: .6; pointer-events: none; cursor: progress; }
.store-filter-bar.is-loading::after { content: "atualizando…"; font-size: .8rem; color: var(--brand); font-weight: 600; }

/* Barra de ações em massa das tarefas (inline, abaixo da tabela) */
.task-bulk-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding: 12px 16px; background: var(--surface-tint); border: 1px solid var(--line-strong); border-radius: var(--radius-md); }
.task-bulk-bar.is-loading { opacity: .6; pointer-events: none; }
.task-bulk-count { font-weight: 700; color: var(--text); margin-right: 4px; }
.task-bulk-bar .toolbar-button { font-size: .85rem; }
.task-bulk-danger { color: var(--danger); border-color: var(--danger) !important; }
.task-bulk-danger:hover { background: var(--danger); color: #fff; }

/* ══════════════════ Inteligência (Cérebro) ══════════════════
   Página enxuta: hero de pergunta + 4 KPIs próprios + gaveta de alertas +
   thread de respostas. Tudo com os tokens do app (surface/line/brand). */
.intel-hero { max-width: 760px; margin: 6px auto 22px; text-align: center; display: grid; gap: 10px; }
.intel-hero-title { font-family: "Space Grotesk", sans-serif; font-size: 1.45rem; margin: 0; }
.intel-hero-sub { color: var(--muted); font-size: 0.9rem; margin: 0 auto; max-width: 560px; line-height: 1.5; }
.intel-brain-input { display: flex; gap: 10px; margin-top: 6px; }
.intel-brain-input input {
  flex: 1; min-width: 0; padding: 13px 16px; font-size: 0.95rem;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.intel-brain-input input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.intel-brain-input .primary-button { border-radius: 14px; padding: 0 22px; white-space: nowrap; }
.intel-brain-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.intel-brain-chips .ghost-button { font-size: 0.78rem; padding: 6px 12px; }

.intel-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.intel-kpi-hint { display: block; font-size: 0.78rem; margin-top: 4px; line-height: 1.35; }
.intel-kpi-small { font-size: 0.95rem; font-weight: 500; opacity: 0.6; }
.intel-kpi-click { cursor: pointer; transition: border-color .15s, transform .1s; }
.intel-kpi-click:hover { border-color: var(--brand); }
.intel-kpi-click:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.intel-alerts-drawer { display: grid; gap: 8px; margin: 0 0 14px; }
.intel-alert-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
}
.intel-alert-txt { min-width: 0; display: grid; gap: 2px; }
.intel-alert-txt strong { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intel-alert-txt .muted { font-size: 0.76rem; }
.intel-alert-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.intel-alert-actions .ghost-button { padding: 5px 10px; font-size: 0.76rem; }
.intel-drawer-note { font-size: 0.78rem; text-align: center; margin: 2px 0 0; }
.intel-sev { padding: 3px 10px; border-radius: 99px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.intel-sev-alta { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.intel-sev-media { background: rgba(234, 179, 8, 0.14); color: #b45309; }
.intel-sev-baixa { background: var(--surface-tint); color: var(--muted); }
[data-theme="dark"] .intel-sev-media { color: #eab308; }

.intel-thread { max-width: 860px; margin: 4px auto 0; display: grid; gap: 12px; }
.intel-brain-qa { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.intel-brain-q { font-weight: 700; margin: 0 0 8px; font-size: 0.92rem; }
.intel-brain-a { color: var(--muted); font-size: 0.9rem; line-height: 1.6; overflow-wrap: break-word; }
.intel-thinking { animation: intelPulse 1.2s ease-in-out infinite; }
@keyframes intelPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.intel-list { margin: 8px 0 2px; padding-left: 18px; display: grid; gap: 5px; color: var(--muted); }

@media (max-width: 1100px) { .intel-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .intel-brain-input { flex-direction: column; }
  .intel-brain-input .primary-button { padding: 12px 22px; }
  .intel-alert-row { grid-template-columns: auto 1fr; }
  .intel-alert-row .intel-alert-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Respostas do Cérebro: hierarquia escaneável (destaque > pontos > passos) */
.intel-brain-qa summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; }
.intel-brain-qa summary::-webkit-details-marker { display: none; }
.intel-brain-qa summary::before { content: "▸"; color: var(--brand); font-size: 0.85rem; transition: transform .15s; flex-shrink: 0; }
.intel-brain-qa[open] summary::before { transform: rotate(90deg); }
.intel-brain-body { margin-top: 4px; }
.intel-a-headline {
  font-size: 1.02rem; font-weight: 700; color: var(--text); line-height: 1.45;
  margin: 10px 0 12px; padding: 2px 0 2px 12px; border-left: 3px solid var(--brand);
}
.intel-a-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.intel-a-points li { position: relative; padding-left: 20px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.intel-a-points li::before { content: "•"; position: absolute; left: 6px; color: var(--brand); font-weight: 700; }
.intel-a-points strong, .intel-a-headline strong, .intel-brain-a strong { color: var(--text); }
.intel-a-steps { margin-top: 14px; background: var(--surface-tint); border-radius: 12px; padding: 12px 16px; }
.intel-a-steps-title { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-soft); margin-bottom: 8px; }
.intel-a-steps ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text); font-size: 0.88rem; line-height: 1.45; }

/* ══════════════════ WhatsApp (acompanhamento) ══════════════════ */
.wpp-empty { max-width: 560px; margin: 30px auto; text-align: center; display: grid; gap: 8px; }
.wpp-conn { margin-bottom: 14px; }
.wpp-conn-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.wpp-conn-summary::-webkit-details-marker { display: none; }
.wpp-conn-summary::after { content: "▾"; color: var(--muted); margin-left: auto; transition: transform .15s; }
.wpp-conn[open] .wpp-conn-summary::after { transform: rotate(180deg); }
.wpp-conn-count { font-size: .76rem; font-weight: 700; color: var(--muted); background: var(--surface-tint); padding: 3px 10px; border-radius: 99px; }
.wpp-conn-count.is-ok { color: #16a34a; background: rgba(34,197,94,.12); }
.wpp-conn-list { display: grid; gap: 8px; margin-top: 12px; }
.wpp-conn-row { display: flex; align-items: center; gap: 10px; }
.wpp-av.is-sm { width: 30px; height: 30px; font-size: .68rem; }
.wpp-conn-row { flex-wrap: wrap; }
.wpp-conn-name { min-width: 0; flex: 1; font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpp-conn-del { padding: 4px 8px; opacity: .6; }
.wpp-conn-del:hover { opacity: 1; border-color: #e0575d; color: #e0575d; }
.wpp-conn-add { margin-top: 2px; }
.wpp-conn-add .ghost-button { border-style: dashed; opacity: .85; }
.wpp-st { padding: 3px 10px; border-radius: 99px; font-size: 0.74rem; font-weight: 700; }
.wpp-st-on { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
.wpp-st-mid { background: rgba(234, 179, 8, 0.14); color: #b45309; }
.wpp-st-off { background: var(--surface-tint); color: var(--muted); }
[data-theme="dark"] .wpp-st-on { color: #22c55e; }
[data-theme="dark"] .wpp-st-mid { color: #eab308; }
.wpp-qr { width: 240px; height: 240px; border-radius: 14px; border: 1px solid var(--line); background: #fff; padding: 8px; }
.wpp-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.wpp-filter .ghost-button.is-active { background: var(--brand); color: #fff; }

/* Sub-abas Conversas | Atendimento (IA) — rolam no mobile em vez de estourar */
.wpp-tabs { display: flex; width: fit-content; max-width: 100%; overflow-x: auto; gap: 4px; background: var(--surface-tint); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; scrollbar-width: none; }
.wpp-tabs::-webkit-scrollbar { display: none; }
.wpp-tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .86rem; padding: 7px 15px; border-radius: 9px; cursor: pointer; flex-shrink: 0; white-space: nowrap; }
.wpp-tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.wpp-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 5px; border-radius: 99px; background: #ef4444; color: #fff; font-size: .66rem; font-weight: 800; }
mark.wpp-kw { background: rgba(234,179,8,.4); color: inherit; border-radius: 3px; padding: 0 2px; font-weight: 700; }

/* Palavras-chave: config + lista de menções */
.wpp-kw-wrap { display: grid; gap: 14px; }
.wpp-kw-config-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wpp-kw-reset { color: #ef4444; font-size: .78rem; padding: 4px 10px; }
.wpp-kw-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 12px; min-height: 4px; }
.wpp-kw-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand); border: 1px solid rgba(0,0,0,.05); border-radius: 99px; padding: 4px 6px 4px 12px; font-size: .84rem; font-weight: 600; }
.wpp-kw-chip-x { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0,0,0,.08); color: inherit; font-size: .9rem; line-height: 1; cursor: pointer; }
.wpp-kw-chip-x:hover { background: #ef4444; color: #fff; }
.wpp-kw-config-row { display: flex; gap: 8px; }
.wpp-kw-config-row input { flex: 1; min-width: 0; background: var(--surface-strong, var(--surface)); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; color: var(--text); font: inherit; }
.wpp-kw-config-row input:focus { outline: none; border-color: var(--brand); }
.wpp-kw-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wpp-kw-list { display: grid; gap: 8px; }
.wpp-kw-hit { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; cursor: pointer; display: grid; gap: 6px; font: inherit; color: inherit; }
.wpp-kw-hit:hover { border-color: var(--brand); }
.wpp-kw-hit.is-new { border-left: 3px solid #ef4444; }
.wpp-kw-hit-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wpp-kw-hit-top .muted { font-size: .72rem; white-space: nowrap; }
.wpp-kw-tag { font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface-tint); color: var(--muted); }
.wpp-kw-tag.is-me { background: var(--brand-soft); color: var(--brand); }
.wpp-kw-hit-body { font-size: .86rem; line-height: 1.4; color: var(--text); overflow-wrap: break-word; }

/* Comportamento */
.wpp-bh-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; } /* minmax(0,1fr): coluna encolhe até o container (não estoura no mobile) */
.wpp-bh-wrap > * { min-width: 0; }
/* Neutraliza o strong 2rem herdado de .report-card: aqui o **negrito** é ênfase inline */
.wpp-bh-wrap strong { display: inline; margin: 0; font-family: inherit; font-size: inherit; font-weight: 800; }
/* Panorama: números ao vivo, escaneáveis */
.wpp-bh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.wpp-bh-kpi { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.wpp-bh-kpi > div { display: grid; gap: 1px; min-width: 0; }
.wpp-bh-kpi-ic { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.wpp-bh-kpi-val { font-size: 1.55rem; font-weight: 800; line-height: 1.05; }
.wpp-bh-kpi-lbl { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.wpp-bh-kpi.is-good .wpp-bh-kpi-val { color: #16a34a; }
.wpp-bh-kpi.is-bad .wpp-bh-kpi-val { color: #ef4444; }
.wpp-bh-kpi.is-warn .wpp-bh-kpi-val { color: #d97706; }
/* Recompra: bloco destacado (KPI-mor) */
.wpp-bh-recompra { border-left: 3px solid var(--brand); }
.wpp-bh-recompra-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
/* Cérebro: perguntas sugeridas */
.wpp-bh-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wpp-bh-sug { font-size: .76rem; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-tint); color: var(--text); cursor: pointer; transition: border-color .12s, color .12s; }
.wpp-bh-sug:hover { border-color: var(--brand); color: var(--brand); }
.wpp-bh-empty { text-align: center; padding: 22px 16px; }
/* Coaching por vendedora */
.wpp-coach-wrap { display: grid; gap: 10px; }
.wpp-coach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; } /* min(100%,300px): não estoura em tela estreita */
.wpp-coach-card { display: grid; gap: 5px; align-content: start; }
.wpp-coach-head { display: flex; align-items: center; gap: 10px; }
.wpp-coach-name { display: grid; gap: 1px; min-width: 0; flex: 1; }
.wpp-coach-name strong { font-size: .95rem; }
.wpp-coach-name .muted { font-size: .72rem; }
.wpp-coach-pot { font-size: .66rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; flex-shrink: 0; white-space: nowrap; }
.wpp-coach-pot.is-good { background: rgba(22,163,74,.16); color: #16a34a; }
.wpp-coach-pot.is-mid { background: rgba(148,163,184,.2); color: #9aa7b8; }
.wpp-coach-pot.is-warn { background: rgba(217,119,6,.18); color: #e0902a; }
.wpp-coach-com { font-size: .84rem; line-height: 1.45; margin: 4px 0 2px; }
.wpp-coach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.wpp-coach-list li { display: flex; gap: 7px; font-size: .82rem; line-height: 1.4; }
.wpp-coach-ic { flex-shrink: 0; }
.wpp-coach-evo { font-size: .82rem; line-height: 1.45; margin: 5px 0 0; color: var(--muted); }
.wpp-coach-rec { font-size: .83rem; line-height: 1.45; background: var(--brand-soft); border-radius: 8px; padding: 8px 11px; margin-top: 5px; }
.wpp-bh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wpp-bh-stop { color: var(--danger); border-color: var(--danger); }
.wpp-bh-stop:hover { background: rgba(224,87,93,.12); }
.wpp-bh-live { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.wpp-bh-live strong { color: var(--text); font-weight: 700; }
.wpp-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0; box-shadow: 0 0 0 0 rgba(34,197,94,.55); animation: wppLivePulse 1.6s infinite; }
.wpp-live-dot.is-ok { animation: none; box-shadow: none; }
.wpp-live-dot.is-warn { background: #f59e0b; animation: none; box-shadow: none; }
@keyframes wppLivePulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.wpp-bh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.wpp-bh-card { display: grid; gap: 6px; align-content: start; }
.wpp-bh-resumo { margin: 0 0 6px; font-size: .9rem; line-height: 1.5; }
.wpp-bh-sub { margin: 10px 0 3px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.wpp-bh-bars { display: grid; gap: 5px; margin: 4px 0; }
.wpp-bh-bar { display: grid; grid-template-columns: 62px 1fr 26px; align-items: center; gap: 8px; font-size: .78rem; }
.wpp-bh-bar b { text-align: right; font-size: .8rem; }
.wpp-bh-track { height: 8px; background: var(--surface-tint); border-radius: 99px; overflow: hidden; }
.wpp-bh-fill { height: 100%; border-radius: 99px; }
.wpp-bh-fill.is-good { background: #16a34a; }
.wpp-bh-fill.is-mid { background: #94a3b8; }
.wpp-bh-fill.is-bad { background: #ef4444; }
.wpp-bh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.wpp-bh-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .84rem; background: var(--surface-tint); border-radius: 7px; padding: 5px 10px; }
.wpp-bh-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpp-bh-list li strong { flex-shrink: 0; font-size: .82rem; }
.wpp-bh-list li strong.is-bad { color: #ef4444; }
.wpp-bh-bullets { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.wpp-bh-bullets li { font-size: .84rem; line-height: 1.4; }
.wpp-bh-ask { margin-top: 2px; }

/* Análise de atendimento (IA) */
.wpp-an-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.wpp-an-period { display: flex; gap: 4px; }
.wpp-day { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: .78rem; font-weight: 700; padding: 5px 11px; border-radius: 8px; cursor: pointer; }
.wpp-day.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.wpp-an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.wpp-an-note { font-size: .8rem; line-height: 1.5; margin: -4px 0 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wpp-an-reset { flex-shrink: 0; }
.wpp-an-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.wpp-an-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.wpp-an-card-top strong { font-size: .92rem; }
.wpp-an-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wpp-an-metric { background: var(--surface-tint); border-radius: 10px; padding: 9px 10px; display: grid; gap: 1px; }
.wpp-an-metric span { font-size: 1.15rem; font-weight: 800; line-height: 1.1; }
.wpp-an-metric label { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.wpp-an-metric.is-warn span { color: #b45309; }
.wpp-an-metric.is-bad span { color: #ef4444; }
[data-theme="dark"] .wpp-an-metric.is-warn span { color: #eab308; }

/* Barra do botão "Atualizar análise agora" (topo das abas de análise) */
.wpp-analise-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 12px 14px; }
.wpp-analise-btn { flex: 0 0 auto; white-space: nowrap; }
.wpp-analise-btn:disabled { opacity: .6; cursor: default; }
.wpp-analise-status { font-size: .85rem; color: var(--muted); }
.wpp-analise-status.is-pend { color: var(--warn, #b45309); font-weight: 600; }
/* Neutraliza o strong gigante de .report-card: aqui é ênfase inline */
.wpp-analise-status strong { display: inline; margin: 0; font-family: inherit; font-size: inherit; font-weight: 700; }
.wpp-an-ai { margin-top: 4px; }

/* ── Aba Evolução (histórico datado + tendência por loja) ── */
.evo-head { margin-bottom: 12px; }
.evo-stores { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.evo-store-card { background: var(--card, #16181d); border: 1px solid var(--border, #262a31); border-radius: 12px; padding: 14px; }
.evo-store-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.evo-store-head strong { font-size: .98rem; }
.evo-score { font-weight: 800; font-size: 1.35rem; line-height: 1; padding: 2px 8px; border-radius: 8px; }
.evo-s-otimo { color: #16a34a; background: rgba(22,163,74,.12); }
.evo-s-bom   { color: #0891b2; background: rgba(8,145,178,.12); }
.evo-s-aten  { color: #b45309; background: rgba(180,83,9,.14); }
.evo-s-crit  { color: #dc2626; background: rgba(220,38,38,.12); }
.evo-s-na    { color: var(--muted, #9aa0aa); background: rgba(127,127,127,.10); }
.evo-store-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: .82rem; color: var(--muted, #9aa0aa); }
.evo-delta { font-weight: 700; }
.evo-up { color: #16a34a; } .evo-down { color: #dc2626; } .evo-flat { color: var(--muted, #9aa0aa); }
.evo-spark { margin-top: 10px; height: 34px; color: #6366f1; }
.evo-spark-svg { width: 100%; height: 34px; display: block; }
.evo-spark-empty { font-size: .74rem; color: var(--muted, #9aa0aa); padding-top: 10px; }
.evo-store-sub { margin-top: 6px; font-size: .74rem; color: var(--muted, #9aa0aa); }

.evo-timeline { display: flex; flex-direction: column; gap: 8px; }
.evo-snap { padding: 0; overflow: hidden; }
.evo-snap-sum { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.evo-snap-sum::-webkit-details-marker { display: none; }
.evo-snap-sum::before { content: "▸"; color: var(--muted, #9aa0aa); font-size: .8rem; }
.evo-snap[open] .evo-snap-sum::before { content: "▾"; }
.evo-date { font-weight: 700; font-size: .86rem; white-space: nowrap; }
.evo-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.evo-chip { font-size: .72rem; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.evo-c-otimo { color: #16a34a; background: rgba(22,163,74,.12); }
.evo-c-bom   { color: #0891b2; background: rgba(8,145,178,.12); }
.evo-c-aten  { color: #b45309; background: rgba(180,83,9,.14); }
.evo-c-crit  { color: #dc2626; background: rgba(220,38,38,.12); }
.evo-snap-body { padding: 0 14px 14px; border-top: 1px solid var(--border, #262a31); }
.evo-snap-body p { margin: 10px 0 0; font-size: .88rem; line-height: 1.5; }
.evo-lbl { display: inline-block; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #9aa0aa); margin-right: 6px; }
.evo-vend { margin: 8px 0 0; padding-left: 18px; font-size: .84rem; line-height: 1.5; }
.evo-vend li { margin: 3px 0; }
.evo-mini { font-size: .82rem !important; color: var(--muted, #9aa0aa); }
.evo-snap-body strong { display: inline; margin: 0; font-family: inherit; font-size: inherit; font-weight: 700; }

/* ── Aba Desenvolvimento: bloco GERAL + análise mensal (30d) ── */
.dev-geral { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 16px; margin-bottom: 14px; }
.dev-geral-hero { display: flex; align-items: center; gap: 12px; padding-right: 18px; border-right: 1px solid var(--border, #262a31); }
.dev-hero-num { font-size: 2.4rem; font-weight: 800; line-height: 1; color: #6366f1; }
.dev-hero-lbl { font-size: .82rem; line-height: 1.25; }
.dev-hero-lbl strong { font-weight: 700; }
.dev-geral-kpis { display: flex; flex-wrap: wrap; gap: 22px; flex: 1; }
.dev-kpi { display: flex; flex-direction: column; gap: 2px; }
.dev-kpi span { font-size: 1.05rem; font-weight: 700; }
.dev-kpi label { font-size: .74rem; color: var(--muted, #9aa0aa); }
.dev-vend-tbl { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; border-top: 1px solid var(--border, #262a31); padding-top: 10px; }
.dev-vend-row { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; color: var(--muted, #9aa0aa); }
.dev-vend-nome { font-weight: 600; color: inherit; flex: 1; }
.dev-vend-row span:not(.dev-vend-nome) { white-space: nowrap; }

.dev-mes { margin: 6px 0 4px; }
.dev-mes-resumo { font-size: .9rem; line-height: 1.55; margin: 6px 0 12px; }
.dev-lojas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.dev-loja { padding: 14px; }
.dev-loja-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.dev-loja-head strong { font-size: .98rem; }
.dev-tend { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.dev-tend.dev-up { color: #16a34a; background: rgba(22,163,74,.12); }
.dev-tend.dev-down { color: #dc2626; background: rgba(220,38,38,.12); }
.dev-tend.dev-flat { color: var(--muted, #9aa0aa); background: rgba(127,127,127,.12); }
.dev-line { font-size: .84rem; line-height: 1.5; margin: 6px 0 0; }
.dev-line span[class^="dev-lbl-"] { display: inline-block; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin-right: 6px; padding: 1px 6px; border-radius: 6px; }
.dev-lbl-up { color: #16a34a; background: rgba(22,163,74,.12); }
.dev-lbl-down { color: #b45309; background: rgba(180,83,9,.14); }
.dev-lbl-foco { color: #6366f1; background: rgba(99,102,241,.14); }
.dev-loja strong { display: inline; margin: 0; font-family: inherit; font-size: inherit; font-weight: 700; }

/* ── Avaliação por vendedora (filtro por data + agregação) ── */
.dev-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 12px; }
.dev-filter-lbl { font-size: .8rem; color: var(--muted, #9aa0aa); margin-right: 4px; }
.dev-frange { font-size: .8rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border, #262a31); background: transparent; color: var(--muted, #9aa0aa); cursor: pointer; }
.dev-frange.is-active { background: #6366f1; border-color: #6366f1; color: #fff; font-weight: 600; }
.dva-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.dva-card { padding: 14px; }
.dva-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dva-head strong { font-size: 1rem; display: inline; margin: 0; font-family: inherit; font-weight: 700; }
.dva-alertas { font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.dva-ok { color: #16a34a; background: rgba(22,163,74,.12); }
.dva-warn { color: #b45309; background: rgba(180,83,9,.14); }
.dva-bad { color: #dc2626; background: rgba(220,38,38,.14); }
.dva-nota { font-size: .78rem; color: var(--muted, #9aa0aa); margin-top: 4px; }
.dva-sec { margin-top: 10px; }
.dva-sec-t { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.dva-sec ul { margin: 0; padding-left: 18px; font-size: .84rem; line-height: 1.45; }
.dva-sec li { margin: 2px 0; }
.dva-sec.dva-good .dva-sec-t { color: #16a34a; }
.dva-sec.dva-dev .dva-sec-t { color: #6366f1; }
.dva-sec.dva-crit .dva-sec-t { color: #b45309; }
.dva-sec.dva-bad .dva-sec-t { color: #dc2626; }
.dva-sec.dva-bad ul { color: #dc2626; font-weight: 600; }
.dva-date { color: var(--muted, #9aa0aa); font-size: .72rem; font-weight: 400; }
.dva-resumos { margin-top: 10px; font-size: .84rem; }
.dva-resumos summary { cursor: pointer; color: var(--muted, #9aa0aa); font-size: .8rem; }
.dva-resumos ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.dva-resumos li { margin: 3px 0; }
/* Neutraliza o strong gigante de .report-card: aqui o **negrito** da IA é ênfase inline */
.wpp-an-ai strong { display: inline; margin: 0; font-family: inherit; font-size: inherit; font-weight: 800; }
.wpp-ev-top strong { font-size: .92rem; }
.wpp-an-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
/* Interruptor da IA (liga/desliga) + estado desligado */
.wpp-an-ai-actions, .wpp-bh-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wpp-ai-toggle { white-space: nowrap; }
.wpp-ai-off { margin-top: 4px; }
.wpp-ai-off p strong { font-weight: 800; }
.wpp-ev-resumo { font-size: .95rem; line-height: 1.5; margin: 0 0 14px; }
.wpp-ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.wpp-ev-card { background: var(--surface-tint); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; align-content: start; }
.wpp-ev-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wpp-ev-nota { font-size: .7rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.wpp-ev-nota.is-good { background: rgba(34,197,94,.14); color: #16a34a; }
.wpp-ev-nota.is-warn { background: rgba(234,179,8,.16); color: #b45309; }
.wpp-ev-nota.is-bad { background: rgba(239,68,68,.14); color: #ef4444; }
.wpp-ev-line { margin: 0; font-size: .82rem; line-height: 1.45; }
.wpp-ev-tag { display: inline-block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 5px; margin-right: 4px; background: var(--surface-strong, var(--surface)); color: var(--muted); border: 1px solid var(--line); }
.wpp-ev-tag.is-good { color: #16a34a; border-color: rgba(34,197,94,.4); }
.wpp-ev-tag.is-warn { color: #b45309; border-color: rgba(234,179,8,.4); }
.wpp-ev-alertas { margin-top: 14px; }
.wpp-ev-alertas ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.wpp-ev-alertas li { font-size: .82rem; line-height: 1.4; }
.wpp-ev-date { margin: 12px 0 0; font-size: .72rem; }
.wpp-ev-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; padding: 8px 0; }
.spinner { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Avatar circular (iniciais + cor do nome) */
.wpp-av { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; font-weight: 800; font-size: .88rem; flex-shrink: 0; }

/* ── Visual estilo WhatsApp Web (dark) ── */
.wpp-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.wpp-list { display: flex; flex-direction: column; max-height: 660px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.wpp-chat { display: flex; align-items: center; gap: 12px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid rgba(134,150,160,.1); border-radius: 0; padding: 10px 14px; cursor: pointer; font: inherit; color: inherit; min-width: 0; transition: background .12s ease; }
.wpp-chat:first-child { border-top-left-radius: 14px; border-top-right-radius: 14px; }
.wpp-chat:last-child { border-bottom: 0; }
.wpp-chat:hover { background: #202c33; }
.wpp-chat.is-open { background: #2a3942; }
.wpp-chat-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.wpp-chat-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; min-width: 0; }
.wpp-chat-top strong { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpp-chat-time { font-size: .7rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.wpp-chat-sub { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-width: 0; }
.wpp-chat-preview { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpp-owner-tag { font-size: .64rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface); color: var(--muted); flex-shrink: 0; border: 1px solid var(--line); }

.wpp-thread { background: #0b141a; border: 1px solid var(--line); border-radius: 14px; min-height: 460px; display: flex; flex-direction: column; overflow: hidden; }
.wpp-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid rgba(0,0,0,.35); background: #202c33; }
.wpp-thread-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.wpp-thread-who .wpp-av { width: 38px; height: 38px; font-size: .8rem; }
.wpp-thread-who-txt { display: grid; gap: 0; min-width: 0; }
.wpp-thread-who-txt strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpp-thread-who-txt .muted { font-size: .72rem; }
.wpp-thread-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.wpp-thread-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 40px; text-align: center; color: var(--muted); gap: 10px; }
.wpp-thread-empty-ic { font-size: 2.4rem; opacity: .45; }
.wpp-thread-empty p { margin: 0; font-size: .9rem; line-height: 1.5; }
.wpp-msgs { flex: 1; overflow-y: auto; max-height: 520px; padding: 14px 16px 18px; display: grid; gap: 3px; align-content: start; background: #0b141a; }
.wpp-msg { position: relative; max-width: 65%; justify-self: start; background: #202c33; color: #e9edef; border-radius: 8px; border-top-left-radius: 0; padding: 6px 9px 7px; display: grid; gap: 2px; box-shadow: 0 1px .5px rgba(11,20,26,.28); }
.wpp-msg.is-me { justify-self: end; background: #005c4b; border-radius: 8px; border-top-left-radius: 8px; border-top-right-radius: 0; }
/* Rabinho (tail) discreto no canto superior, como no WhatsApp */
.wpp-msg::before { content: ""; position: absolute; top: 0; width: 0; height: 0; border-style: solid; }
.wpp-msg:not(.is-me)::before { left: -7px; border-width: 0 8px 6px 0; border-color: transparent #202c33 transparent transparent; }
.wpp-msg.is-me::before { right: -7px; border-width: 0 0 6px 8px; border-color: transparent transparent transparent #005c4b; }
.wpp-msg p { margin: 0; font-size: .875rem; line-height: 1.4; overflow-wrap: break-word; color: #e9edef; }
.wpp-msg a { color: #53bdeb; }
.wpp-msg-sender { font-size: .72rem; font-weight: 600; color: #53bdeb; }
.wpp-msg.is-me .wpp-msg-sender { color: #93d3c4; }
.wpp-msg-time { font-size: .625rem; color: rgba(233,237,239,.5); justify-self: end; margin-top: -1px; }
.wpp-phase-note { font-size: 0.76rem; padding: 8px 16px; border-top: 1px solid var(--line); margin: 0; }

/* Mídia dentro da bolha (imagem/áudio/vídeo/documento) */
.wpp-msg.is-media { max-width: 300px; grid-template-columns: minmax(0, 1fr); } /* coluna resolvível: doc/nome longo encolhe com reticências em vez de estourar */
.wpp-media-wrap { min-width: 180px; }
.wpp-media-ph { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); padding: 22px 10px; justify-content: center; }
.wpp-media-img { max-width: 100%; max-height: 320px; border-radius: 10px; cursor: zoom-in; display: block; }
.wpp-media-img.is-sticker { max-width: 130px; max-height: 130px; cursor: default; }
.wpp-media-vid { max-width: 100%; max-height: 340px; border-radius: 10px; display: block; background: #000; }
/* Player de áudio estilo WhatsApp (nota de voz): play + barra + tempo */
.wa-audio { display: flex; align-items: center; gap: 10px; width: 250px; max-width: 100%; padding: 2px 0; }
.wa-audio-btn { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 0; background: rgba(233,237,239,.9); color: #0b141a; font-size: .74rem; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 0 1px; line-height: 1; }
.wa-audio.is-playing .wa-audio-btn { padding-left: 0; }
.wa-audio-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wa-audio-track { position: relative; height: 3px; border-radius: 3px; background: rgba(233,237,239,.28); cursor: pointer; }
.wa-audio-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 3px; background: rgba(233,237,239,.85); }
.wa-audio-dot { position: absolute; top: 50%; left: 0; width: 11px; height: 11px; margin-left: -5px; transform: translateY(-50%); border-radius: 50%; background: #e9edef; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.wa-audio.is-ptt .wa-audio-dot { background: #06cf9c; }
.wa-audio-time { font-size: .62rem; color: rgba(233,237,239,.6); }
.wa-audio-mic { font-size: .95rem; opacity: .55; flex-shrink: 0; align-self: flex-end; }
.wpp-media-caption { margin: 4px 0 0; font-size: .86rem; line-height: 1.4; overflow-wrap: break-word; }
.wpp-media-err { font-size: .78rem; color: var(--muted); padding: 12px 10px; text-align: center; }
.wpp-doc { display: flex; align-items: center; gap: 9px; max-width: 100%; width: 100%; min-width: 0; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; cursor: pointer; color: inherit; font: inherit; }
.wpp-doc:hover { border-color: var(--brand); }
.wpp-doc-ic { font-size: 1.3rem; flex-shrink: 0; }
.wpp-doc-name { flex: 1; min-width: 0; font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpp-doc-dl { font-size: .68rem; font-weight: 700; color: var(--brand); text-transform: uppercase; flex-shrink: 0; }
.wpp-lightbox { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,.86); display: none; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.wpp-lightbox.is-open { display: flex; }
.wpp-lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.wpp-lightbox-x { position: fixed; top: 18px; right: 22px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.1rem; cursor: pointer; }

/* Modal do link de conexão da vendedora */
.wpp-link-modal { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; padding: 20px; }
.wpp-link-modal.is-open { display: flex; }
.wpp-link-card { position: relative; width: 460px; max-width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.5); padding: 22px; }
.wpp-link-x { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; }
.wpp-link-title { font-weight: 700; font-size: 1rem; margin: 0 24px 6px 0; }
.wpp-link-sub { color: var(--muted); font-size: .85rem; line-height: 1.45; margin: 0 0 14px; }
.wpp-link-input { width: 100%; background: var(--surface-tint); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; color: var(--text); font-size: .82rem; font-family: ui-monospace, monospace; }
.wpp-link-actions { display: flex; gap: 8px; margin-top: 12px; }
.wpp-link-actions .primary-button { flex: 1; }
.wpp-link-note { color: var(--muted-soft); font-size: .76rem; margin: 12px 0 0; line-height: 1.4; }

@media (max-width: 900px) {
  #wppContent { overflow-x: hidden; } /* quebra a propagação de min-content: nada estoura a largura da tela */
  .wpp-layout { grid-template-columns: minmax(0, 1fr); } /* coluna encolhe até caber */
  .wpp-list { max-height: 340px; }
  .wpp-list, .wpp-thread { min-width: 0; }
}
.wpp-composer { display: flex; gap: 8px; padding: 9px 14px; border-top: 0; background: #202c33; align-items: center; }
.wpp-composer input { flex: 1; min-width: 0; padding: 10px 15px; border-radius: 8px; border: 0; background: #2a3942; color: #e9edef; font-size: 0.9rem; }
.wpp-composer input::placeholder { color: #8696a0; }
.wpp-composer input:focus { outline: none; box-shadow: none; }
.wpp-composer .primary-button { border-radius: 8px; padding: 0 18px; white-space: nowrap; }
.wpp-thread-actions { display: flex; align-items: center; gap: 8px; }
.wpp-del { color: var(--danger); }
.wpp-del:hover { background: var(--danger); color: #fff; }

/* Alerta de WhatsApp caído dentro do push "Situação do CRM" */
.task-push-wpp { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: rgba(239,68,68,.10); border: 1px solid rgba(239,68,68,.35); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; cursor: pointer; color: var(--text); }
.task-push-wpp:hover { background: rgba(239,68,68,.16); }
.task-push-wpp-icon { font-size: 1.15rem; flex-shrink: 0; }
.task-push-wpp-txt { display: grid; gap: 1px; font-size: .82rem; color: var(--muted); line-height: 1.3; }
.task-push-wpp-txt strong { color: #ef4444; font-size: .9rem; }
/* Alerta de palavra-chave citada: âmbar (diferencia da desconexão vermelha) */
.task-push-kw { background: rgba(234,179,8,.12); border-color: rgba(234,179,8,.4); }
.task-push-kw:hover { background: rgba(234,179,8,.2); }
.task-push-kw .task-push-wpp-txt strong { color: #b45309; }
[data-theme="dark"] .task-push-kw .task-push-wpp-txt strong { color: #eab308; }
/* Alerta da Inteligência: teal */
.task-push-intel { background: rgba(20,184,166,.12); border-color: rgba(20,184,166,.4); }
.task-push-intel:hover { background: rgba(20,184,166,.2); }
.task-push-intel .task-push-wpp-txt strong { color: #0d9488; }
[data-theme="dark"] .task-push-intel .task-push-wpp-txt strong { color: #2dd4bf; }
/* Modal dos alertas da Inteligência (aberto pelo sino) */
.intel-alerts-modal { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,.55); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.intel-alerts-modal.is-open { display: flex; }
.intel-alerts-card { width: 560px; max-width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.5); overflow: hidden; }
.intel-alerts-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.intel-alerts-body { padding: 12px 16px; display: grid; gap: 8px; max-height: 70vh; overflow-y: auto; }
.task-push-signal .signal-badge.is-alert { background: #ef4444; animation: wppBadgePulse 1.4s ease-in-out infinite; }
@keyframes wppBadgePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 5px rgba(239,68,68,0); } }

/* ── Recados (mural do admin p/ vendedores) ── */
.recados-wrap { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.recados-form { display: grid; gap: 10px; }
.recado-field { display: grid; gap: 5px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.recado-field input, .recado-field textarea, .recado-field select { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-tint); color: var(--text); font: inherit; font-weight: 400; }
.recado-field textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.recado-field input:focus, .recado-field textarea:focus, .recado-field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.recado-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.recados-list { display: grid; gap: 10px; }
.recado-item { display: grid; gap: 5px; }
.recado-item.is-inactive { opacity: .62; }
.recado-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recado-alvo { font-size: .78rem; font-weight: 700; color: var(--text); }
.recado-status { font-size: .68rem; font-weight: 800; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.recado-status.is-on { background: rgba(22,163,74,.16); color: #16a34a; }
.recado-status.is-off { background: rgba(148,163,184,.2); color: #9aa7b8; }
.recado-item-title { font-size: .92rem; }
.recado-item-body { margin: 0; font-size: .86rem; line-height: 1.5; color: var(--text); white-space: pre-wrap; overflow-wrap: break-word; }
.recado-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.recado-item-meta .muted { font-size: .74rem; }
.recado-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.recado-item-actions .ghost-button { padding: 4px 10px; font-size: .78rem; }
.recado-del { color: var(--danger); }
@media (max-width: 820px) { .recados-wrap { grid-template-columns: minmax(0, 1fr); } }

/* Push do recado ao abrir o CRM */
.admin-msg-modal { position: fixed; inset: 0; z-index: 4200; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; padding: 20px; }
.admin-msg-modal.is-open { display: flex; }
.admin-msg-card { width: 460px; max-width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.5); padding: 22px; display: grid; gap: 14px; }
.admin-msg-head { display: flex; align-items: center; gap: 9px; font-size: 1.02rem; }
.admin-msg-icon { font-size: 1.4rem; }
.admin-msg-body { display: grid; gap: 12px; max-height: 60vh; overflow-y: auto; }
.admin-msg-item { display: grid; gap: 4px; padding: 12px 14px; background: var(--surface-tint); border-radius: 12px; border-left: 3px solid var(--brand); }
.admin-msg-item strong { font-size: .95rem; }
.admin-msg-item p { margin: 0; font-size: .9rem; line-height: 1.55; overflow-wrap: break-word; }
.admin-msg-ok { width: 100%; }
