/* ========== RESET & VARIABLES ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ===== SURFACES ===== */
  --bg: #fafafa;              /* Off-white page background */
  --bg-raised: #ffffff;       /* Sidebar, topbar */
  --bg-card: #ffffff;         /* Card surfaces */
  --bg-card-hover: #fafafa;   /* Subtle hover */
  --bg-input: #f5f5f5;        /* Form inputs */
  --bg-subtle: #fafafa;

  /* ===== BRAND — BLACK + YELLOW ===== */
  --accent: #000000;          /* Primary — pure black */
  --accent-hover: #1a1a1a;    /* Near black hover */
  --accent-dim: #f5f5f5;      /* Light gray tint for soft bg */
  --accent-soft: #e5e5e5;
  --accent-glow: rgba(0, 0, 0, 0.08);
  --accent-contrast: #ffffff; /* White text on black */

  --highlight: #ffed00;       /* Brand yellow — pop accent */
  --highlight-hover: #f5e200;
  --highlight-dim: #fffde5;   /* Very pale yellow background */
  --highlight-contrast: #000000; /* Always black text on yellow */

  /* ===== AUTO DASHBOARD THEME — personalizável por cliente ===== */
  /* Default = amarelo do Analytics GD. Sobrescrito em runtime via JS
     (applyClientTheme) quando o cliente tem cor customizada salva. */
  --auto-primary: #ffed00;
  --auto-primary-contrast: #000000;
  --auto-primary-dark: #b3a600;
  --auto-primary-bg: rgba(255, 237, 0, 0.08);

  /* ===== SEMANTIC — preserved for warnings/success/etc ===== */
  --green: #16a34a;
  --green-dim: #f0fdf4;
  --green-border: #bbf7d0;

  --red: #dc2626;
  --red-dim: #fef2f2;
  --red-border: #fecaca;

  --blue: #2563eb;
  --blue-dim: #eff6ff;
  --blue-border: #bfdbfe;

  --amber: #d97706;
  --amber-dim: #fffbeb;
  --amber-border: #fde68a;

  --purple: #525252;          /* Formerly violet, now neutral gray */
  --purple-dim: #f5f5f5;

  --orange: #ea580c;
  --orange-dim: #fff7ed;

  /* ===== TEXT — pure black hierarchy ===== */
  --text: #000000;            /* Headings — pure black */
  --text-secondary: #525252;  /* Body — gray 600 */
  --text-soft: #737373;       /* Soft labels — gray 500 (meta, deltas, subtitles) */
  --text-muted: #a3a3a3;      /* Muted labels — gray 400 */
  --text-placeholder: #d4d4d4;

  /* ===== BORDERS ===== */
  --border: #e5e5e5;          /* Gray 200 — subtle card borders */
  --border-strong: #d4d4d4;   /* Gray 300 — inputs */
  --border-accent: #000000;   /* Black — active/focused */

  /* ===== GEOMETRY ===== */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ===== SHADOWS — minimal, grayscale only ===== */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10);
  --shadow-focus: 0 0 0 3px rgba(255, 237, 0, 0.45); /* Yellow focus ring */

  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Animação de entrada só dispara se o body tiver a classe `anim-enabled`.
   Essa classe é adicionada brevemente em renderApp() apenas quando o usuário
   troca de view (Home → Pasta → Dashboard). Em re-renders da mesma view
   (boot, loadings sucessivos do Supabase, filtros), a classe NÃO é
   adicionada — então tudo aparece estaticamente, sem flicker em cascata. */
body.anim-enabled .animate-in {
  animation: fadeUp 0.5s var(--transition) both;
}

body.anim-enabled .animate-in-delay-1 { animation-delay: 0.06s; }
body.anim-enabled .animate-in-delay-2 { animation-delay: 0.12s; }
body.anim-enabled .animate-in-delay-3 { animation-delay: 0.18s; }
body.anim-enabled .animate-in-delay-4 { animation-delay: 0.24s; }
body.anim-enabled .animate-in-delay-5 { animation-delay: 0.30s; }

/* ========== APP LAYOUT ========== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ========== SIDEBAR ========== */
/* ==========================================================
   SIDEBAR — 3 estados (modelo ClickUp)
   1. Default (não pinned): barra fina permanente 64px, expande pra 260px no hover
   2. Pinned: fixa expandida 260px, sempre visível, layout empurra
   3. Pinned + Collapsed: fixa estreita 64px, só ícones, sem hover-expand
   Em mobile (<768px): vira overlay tradicional com hamburger.
   ========================================================== */
.sidebar {
  width: 64px;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transform: translateX(0);
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease;
  box-shadow: none;
  overflow: hidden;
}

/* Default state: hover expande pra 260px com sombra forte + backdrop no app */
.sidebar:hover {
  width: 260px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Backdrop: pseudo-element fixo que escurece o resto do app quando sidebar
   está expandida via hover. Só aparece no modo default (não pinned, pra
   não ficar piscando enquanto pinned é estável). */
body:not(.sidebar-pinned)::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  z-index: 95; /* atrás da sidebar (z:100), na frente do conteúdo */
  transition: background 0.22s ease;
}
body:not(.sidebar-pinned):has(.sidebar:hover)::before {
  background: rgba(0, 0, 0, 0.22);
}

/* Layout principal sempre tem 64px de margem (espaço da barra fina) */
.main-content {
  margin-left: 64px;
}

/* Quando hover-expanded, NÃO empurra o layout (sobrepõe — comportamento ClickUp) */
/* Elementos textuais ficam sempre no DOM, mas invisíveis quando barra fina.
   Usar opacity ao invés de display:none evita o reflow/flicker que acontece
   a cada toggle de hover. Transição suave. */
.brand-text-wrap,
.nav-section-label,
.nav-btn span:not(.icon),
.client-name,
.client-item .client-count,
.nav-add-client,
.sidebar-user-email,
.btn-logout,
.btn-sidebar-action,
.sidebar-controls {
  transition: opacity 0.15s ease;
}

/* Estado padrão (não pinned): esconde texto via display:none quando sidebar não tem hover.
   Note: o pisca anterior NÃO vinha do display:none — vinha da herança de animate-in
   no boot/render. Como a sidebar não tem animate-in, display:none aqui é seguro
   e evita problemas visuais (texto vazando além de 64px) que opacity:0 causa. */
body:not(.sidebar-pinned) .sidebar:not(:hover) .brand-text-wrap,
body:not(.sidebar-pinned) .sidebar:not(:hover) .nav-section-label,
body:not(.sidebar-pinned) .sidebar:not(:hover) .nav-btn span:not(.icon),
body:not(.sidebar-pinned) .sidebar:not(:hover) .client-name,
body:not(.sidebar-pinned) .sidebar:not(:hover) .client-item > span:not(.client-dot):not(.client-name),
body:not(.sidebar-pinned) .sidebar:not(:hover) .nav-add-client,
body:not(.sidebar-pinned) .sidebar:not(:hover) .sidebar-user-meta,
body:not(.sidebar-pinned) .sidebar:not(:hover) .btn-logout,
body:not(.sidebar-pinned) .sidebar:not(:hover) .btn-sidebar-action,
body:not(.sidebar-pinned) .sidebar:not(:hover) .sidebar-controls {
  display: none;
}
/* Quando a sidebar tá fina (default sem hover), esconde TODA a nav central.
   Mostra só logo (header) e avatar (footer). Lista de projetos, botão Início,
   botão "+ Novo projeto" — tudo escondido. Aparecem só quando expande. */
body:not(.sidebar-pinned) .sidebar:not(:hover) .sidebar-nav {
  display: none;
}
body:not(.sidebar-pinned) .sidebar:not(:hover) .sidebar-header {
  padding: 18px 10px;
  justify-content: center;
}
body:not(.sidebar-pinned) .sidebar:not(:hover) .brand {
  justify-content: center;
  flex: 0;
}
body:not(.sidebar-pinned) .sidebar:not(:hover) .nav-btn,
body:not(.sidebar-pinned) .sidebar:not(:hover) .client-item {
  justify-content: center;
  padding: 10px 8px;
}
body:not(.sidebar-pinned) .sidebar:not(:hover) .sidebar-user {
  justify-content: center;
}
body:not(.sidebar-pinned) .sidebar:not(:hover) .sidebar-footer {
  padding: 10px 8px;
}
/* Combinado com white-space: nowrap nos textos, eles ficam "atrás" do limite e
   reaparecem suavemente quando a sidebar expande. */
.brand-text-wrap,
.nav-section-label,
.nav-btn,
.client-item,
.nav-add-client,
.sidebar-user-name,
.sidebar-user-email,
.btn-logout,
.btn-sidebar-action {
  white-space: nowrap;
}

/* ===== Sidebar PINNED — fixa expandida, ignora :hover completamente =====
   Sem regras de :not(:hover) — todos os elementos textuais ficam visíveis
   por default, sem precisar de override. */
body.sidebar-pinned .sidebar {
  width: 260px;
  box-shadow: none;
}
body.sidebar-pinned .sidebar:hover {
  box-shadow: none;
}
body.sidebar-pinned .main-content {
  margin-left: 260px;
}

/* ===== Sidebar COLLAPSED — só funciona com pinned ===== */
body.sidebar-pinned.sidebar-collapsed .sidebar {
  width: 64px;
}
body.sidebar-pinned.sidebar-collapsed .sidebar:hover {
  /* Quando pinned+collapsed, hover NÃO expande (comportamento "travado fino") */
  width: 64px;
  box-shadow: none;
}
body.sidebar-pinned.sidebar-collapsed .main-content {
  margin-left: 64px;
}
/* Esconde textos quando collapsed via display:none (sidebar não tem animate-in,
   então não há risco de re-disparo de animação como na Home) */
body.sidebar-pinned.sidebar-collapsed .brand-text-wrap,
body.sidebar-pinned.sidebar-collapsed .nav-section-label,
body.sidebar-pinned.sidebar-collapsed .nav-btn span:not(.icon),
body.sidebar-pinned.sidebar-collapsed .client-name,
body.sidebar-pinned.sidebar-collapsed .client-item > span:not(.client-dot):not(.client-name),
body.sidebar-pinned.sidebar-collapsed .nav-add-client,
body.sidebar-pinned.sidebar-collapsed .sidebar-user-meta,
body.sidebar-pinned.sidebar-collapsed .btn-logout,
body.sidebar-pinned.sidebar-collapsed .btn-sidebar-action {
  display: none;
}
/* Pinned + collapsed: header vira coluna com logo em cima e botão de expandir
   em baixo. Não esconde .sidebar-controls (era esse o bug — usuário ficava preso
   sem botão pra sair do estado collapsed). Esconde só o pin (não cabe e não
   é prioridade — pra desafixar, expande primeiro e clica no pin). */
body.sidebar-pinned.sidebar-collapsed .sidebar-header {
  flex-direction: column;
  padding: 14px 10px;
  gap: 12px;
  justify-content: flex-start;
}
body.sidebar-pinned.sidebar-collapsed .sidebar-controls {
  flex-direction: column;
  gap: 4px;
}
body.sidebar-pinned.sidebar-collapsed .sidebar-controls #sidebarPinBtn {
  display: none;
}

/* Pinned + collapsed (travada fina): esconde a nav inteira igual ao default fino.
   Só mostra logo + avatar do usuário. */
body.sidebar-pinned.sidebar-collapsed .sidebar-nav {
  display: none;
}
body.sidebar-pinned.sidebar-collapsed .brand {
  justify-content: center;
  flex: 0;
}
body.sidebar-pinned.sidebar-collapsed .nav-btn,
body.sidebar-pinned.sidebar-collapsed .client-item {
  justify-content: center;
  padding: 10px 8px;
}
body.sidebar-pinned.sidebar-collapsed .sidebar-user {
  justify-content: center;
}
body.sidebar-pinned.sidebar-collapsed .sidebar-footer {
  padding: 10px 8px;
}

/* ===== Botões de controle: pin + collapse ===== */
.sidebar-controls {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.sidebar-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.15s;
}
.sidebar-control-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.sidebar-control-btn.is-active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Mobile: vira overlay tradicional, esconde barra fina */
@media (max-width: 768px) {
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
  }
  .sidebar:hover {
    width: 260px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  }
  .main-content {
    margin-left: 0;
  }
  body.sidebar-pinned .main-content,
  body.sidebar-pinned.sidebar-collapsed .main-content {
    margin-left: 0;
  }
  body.sidebar-pinned .sidebar,
  body.sidebar-pinned.sidebar-collapsed .sidebar {
    width: 260px;
    transform: translateX(-100%);
  }
  body.sidebar-pinned .sidebar.open,
  body.sidebar-pinned.sidebar-collapsed .sidebar.open {
    transform: translateX(0);
  }
}

/* Hover hotzone on left edge — DEPRECATED.
   A barra fina permanente da sidebar agora é o próprio trigger.
   O elemento ainda é renderizado pelo JS (legacy), mas escondemos via display:none. */
.sidebar-trigger {
  display: none !important;
}

/* Visible handle — yellow pill with arrow, grabs attention */
.sidebar-trigger::before {
  content: '›';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 56px;
  background: var(--highlight);
  border-radius: 0 12px 12px 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.08);
  color: var(--highlight-contrast);
  font-size: 22px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 3px;
  transition: width 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  animation: sidebarTriggerPulse 2.4s ease-in-out infinite;
}

.sidebar-trigger:hover::before {
  width: 32px;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.12);
  animation: none;
}

/* "Menu" label that appears on hover */
.sidebar-trigger::after {
  content: 'Menu';
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-trigger:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Pulsing animation — gentle attention grabber */
@keyframes sidebarTriggerPulse {
  0%, 100% {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18),
                0 2px 4px rgba(0, 0, 0, 0.08),
                0 0 0 0 rgba(255, 237, 0, 0.5);
  }
  50% {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22),
                0 2px 4px rgba(0, 0, 0, 0.10),
                0 0 0 10px rgba(255, 237, 0, 0);
  }
}

/* When sidebar is open, hide the trigger handle completely */
.sidebar.open ~ .sidebar-trigger {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
  gap: 2px;
}

.brand-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  padding: 0;
}

.brand-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  padding: 0;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 16px 12px 8px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.nav-btn:hover {
  background: rgba(15, 23, 42, 0.03);
  color: var(--text);
}

.nav-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-btn .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.client-list {
  padding: 0 10px 16px;
}

.client-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 14px;
  position: relative;
}

.client-item:hover {
  background: rgba(15, 23, 42, 0.03);
  color: var(--text);
}

.client-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.client-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.client-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity var(--transition);
}

.client-item:hover .client-delete { opacity: 1; }

.nav-add-client {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 20px);
  margin: 4px 10px 12px;
  padding: 10px 12px;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-add-client:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.nav-add-client:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ========== LOGIN SCREEN ========== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 24px;
  background: var(--bg);
}

/* Container split-screen — painel preto à esquerda, formulário à direita */
.login-split {
  width: 100%;
  max-width: 920px;
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Painel esquerdo — preto, com marca, headline e faixa amarela */
.login-hero {
  position: relative;
  background: #0a0a0a;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
  overflow: hidden;
}

.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.login-hero-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px;
}

.login-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-hero-brandname {
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.login-hero-headline {
  position: relative;
  z-index: 1;
  max-width: 340px;
}

.login-hero-headline h1 {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.9px;
  color: #ffffff;
  margin: 0 0 16px;
}

.login-hero-headline h1 em {
  color: #FFED00;
  font-style: normal;
  font-weight: 600;
}

.login-hero-headline p {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  max-width: 320px;
  font-weight: 400;
}

.login-hero-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: #FFED00;
}

/* Painel direito — formulário */
.login-panel {
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
}

.login-panel-inner {
  width: 100%;
  max-width: 320px;
}

.login-panel-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.5px;
  margin: 0 0 6px;
}

.login-panel-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.login-field input {
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-field input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.login-field input::placeholder {
  color: var(--text-placeholder);
}

.login-submit {
  padding: 13px 20px;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 6px;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.login-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-error {
  font-size: 13px;
  color: var(--red);
  padding: 10px 14px;
  background: var(--red-dim);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  display: none;
}

.login-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* Sidebar logout */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* .sidebar-user é um button (clicável). Estilizado pra parecer um bloco
   neutro com hover sutil. Abre o modal Meu Perfil. */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.sidebar-user.is-clickable:hover {
  background: rgba(0, 0, 0, 0.04);
}
.sidebar-user.is-clickable:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--highlight);
  color: var(--highlight-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-avatar.has-photo {
  background: transparent;
}
.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Meta = bloco direito com nome em destaque + email pequeno embaixo */
.sidebar-user-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Visual base compartilhado: usado pelo botão Sair (.btn-logout) e
   por ações neutras da sidebar (.btn-sidebar-action) como Criar conta,
   Trocar senha e Reportar bug. */
.btn-logout,
.btn-sidebar-action {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Hover vermelho — exclusivo do Sair, que é ação destrutiva (encerra sessão). */
.btn-logout:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red-border);
}

/* Hover neutro — pra ações não-destrutivas da sidebar. */
.btn-sidebar-action:hover {
  background: var(--bg-input);
  color: var(--text);
  border-color: var(--border-strong);
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  /* margin-left controlado pelo bloco de sidebar (linha ~210):
     64px default, 260px quando pinned, 64px quando pinned+collapsed */
  min-height: 100vh;
  width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Sem padding aqui — o wrapper interno cuida pra alinhar com .page-content.
     Background/blur continuam cobrindo a tela toda. */
  padding: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

/* Wrapper interno da topbar: mesmo max-width + margin auto do .page-content
   pra que "Voltar" e breadcrumb fiquem na mesma coluna do conteúdo abaixo,
   evitando o desalinhamento que aparece em telas widescreen. */
.topbar-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
}

.topbar-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.page-content {
  padding: 28px 32px 48px;
  max-width: 1800px;
  margin: 0 auto;
}

/* ========== HOME VIEW ========== */
/* ========== HOME — Hero, eyebrow, headline, overview ========== */

.home-eyebrow {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.home-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #639922;
  box-shadow: 0 0 0 3px rgba(99, 153, 34, 0.18);
  flex-shrink: 0;
}

.home-headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 4px;
}

.home-headline-text h1 {
  font-size: 40px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -1.2px;
  line-height: 1.02;
  margin: 0;
}

.home-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 8px 0 0;
  line-height: 1.5;
}

.home-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.home-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.home-action-btn.primary {
  background: var(--text);
  color: var(--bg-card);
}

.home-action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.home-action-btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.home-action-btn.secondary:hover {
  border-color: var(--text-secondary);
}

.home-action-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.home-divider {
  height: 1px;
  background: linear-gradient(to right,
    rgba(0, 0, 0, 0.12) 0%,
    rgba(0, 0, 0, 0.04) 80%,
    transparent 100%);
  margin: 22px 0 20px;
}

.home-overview {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.home-overview-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.home-overview-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  font-feature-settings: 'tnum' on, 'lnum' on;
}

.home-overview-spacer {
  flex: 1;
}

.home-overview-meta {
  color: var(--text-muted);
}

/* ========== HOME ADMIN — Atalhos rápidos ========== */

.home-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.home-shortcut {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-shortcut:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.home-shortcut-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  margin-bottom: 8px;
}

.home-shortcut-icon [data-lucide],
.home-shortcut-icon svg.lucide {
  width: 17px;
  height: 17px;
}

.home-shortcut-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.1px;
}

.home-shortcut-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ========== HOME ADMIN — Atividade recente ========== */

.home-activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 20px;
}

.home-activity-list {
  display: flex;
  flex-direction: column;
}

.home-activity-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.home-activity-list .home-activity-item:last-child {
  border-bottom: none;
}

.home-activity-time {
  font-size: 12px;
  color: var(--text-muted);
}

.home-activity-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  min-width: 0;
}

.home-activity-text b {
  font-weight: 500;
}

.home-activity-detail {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.home-activity-detail.is-error {
  color: var(--red);
}

.home-activity-empty {
  padding: 18px 4px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ========== ANOMALIAS — View dedicada ========== */

.anomalies-loading,
.anomalies-empty {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.anomalies-loading p,
.anomalies-empty p {
  margin: 8px 0 0;
  font-size: 13px;
}

.anomalies-loading-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
  animation: spin 1s linear infinite;
}

.anomalies-loading-spinner [data-lucide],
.anomalies-loading-spinner svg.lucide {
  width: 22px;
  height: 22px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.anomalies-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: #639922;
  margin-bottom: 4px;
}

.anomalies-empty-icon [data-lucide],
.anomalies-empty-icon svg.lucide {
  width: 36px;
  height: 36px;
}

.anomalies-empty h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin: 4px 0 0;
}

.anomalies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.anomalies-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.anomalies-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.anomalies-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.anomalies-card-project {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.anomalies-card-drop {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  font-feature-settings: 'tnum' on;
}

.anomalies-card-metric {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-top: -6px;
}

.anomalies-card-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.anomalies-card-period {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.anomalies-card-period:last-child {
  text-align: right;
}

.anomalies-card-period-label {
  font-size: 11px;
  color: var(--text-muted);
}

.anomalies-card-period-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-feature-settings: 'tnum' on;
}

.anomalies-card-arrow {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.anomalies-card-arrow [data-lucide],
.anomalies-card-arrow svg.lucide {
  width: 16px;
  height: 16px;
}

/* ========== HOME — Cliente: greeting + featured card ========== */

.home-greeting {
  margin-bottom: 4px;
}

.home-greeting h1 {
  font-size: 40px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -1.2px;
  line-height: 1.02;
  margin: 0;
}

.home-greeting h1 .home-greeting-name {
  color: var(--text);
}

.home-featured {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin: 32px 0 0;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.home-featured:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.home-featured-left {
  display: flex;
  gap: 20px;
  align-items: center;
  min-width: 0;
}

.home-featured-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.home-featured-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-featured-info {
  min-width: 0;
}

.home-featured-info h3 {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.4px;
}

.home-featured-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-featured-meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #639922;
  box-shadow: 0 0 0 3px rgba(99, 153, 34, 0.18);
  flex-shrink: 0;
}

.home-featured-meta-dot.is-empty {
  background: var(--text-placeholder);
  box-shadow: none;
}

.home-featured-meta-dot.is-loading {
  background: var(--text-placeholder);
  box-shadow: none;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

.home-featured-meta-sep {
  width: 2px;
  height: 2px;
  background: var(--text-placeholder);
  border-radius: 50%;
  flex-shrink: 0;
}

.home-featured-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

.home-featured-btn {
  padding: 12px 22px;
  background: var(--text);
  color: var(--bg-card);
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.home-featured-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}


/* ========== IMPORT VIEW ========== */
.import-area {
  max-width: 600px;
  margin: 0 auto;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.drop-zone .icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.drop-zone h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.drop-zone p {
  color: var(--text-muted);
  font-size: 13px;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.import-info {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.import-info strong { color: var(--text); }

.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s ease;
}

.processing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  text-align: center;
  animation: scaleIn 0.3s ease;
}

.processing-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

/* ========== DASHBOARD VIEW ========== */
.dash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.dash-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Container dos controles à direita do header */
.dash-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Título com logo do relatório */
.dashboard-title-with-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.dashboard-title-with-logo h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-title-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.report-label {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
}
/* Variante com logo do relatório no chip */
.report-label-with-logo {
  padding: 4px 14px 4px 4px;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
}
.report-label-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Toggle "Aplicar a todos os relatórios" — abaixo do header do dashboard CSV */
.report-theme-scope {
  margin: 12px 0 16px;
  padding: 10px 14px;
  background: var(--auto-primary-bg);
  border: 1px dashed var(--auto-primary);
  border-radius: 8px;
}
.report-theme-scope-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.report-theme-scope-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  accent-color: var(--auto-primary);
  cursor: pointer;
}
.report-theme-scope-toggle strong {
  color: var(--text);
  font-weight: 600;
}

/* Informational stat chips — flat text metadata, NOT buttons.
   Used on the dashboard meta row (platform, report type, row count). */
.stat-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 2px 0;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  background: transparent;
  border: none;
  padding: 0;
  cursor: default;
  user-select: none;
}

.stat-chip-primary {
  color: var(--text);
  font-weight: 700;
}

.stat-chip-primary::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--border);
  margin-left: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

/* Grid de rankings do HubSpot — 2 cards lado a lado em desktop */
.hubspot-rankings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

/* Card de plataforma do dashboard HubSpot — bloco grande pra cada plataforma paga */
.hubspot-platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: inset 0 3px 0 var(--accent);
}

.hubspot-platform-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.hubspot-platform-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.hubspot-platform-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.hubspot-platform-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: all var(--transition);
  position: relative;
}

.kpi-card.kpi-leads       { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-conv        { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-cpl         { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-cost        { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-clicks      { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-impressions { box-shadow: inset 0 3px 0 var(--accent); }

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.5px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== CHART CARD ========== */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.chart-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.chart-card-header h2 {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: transparent;
  padding: 0;
  border-radius: 0;
  justify-content: center;
}

.chart-tab {
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.chart-tab:hover:not(.active) {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.chart-tab.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.chart-tab:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.chart-container {
  position: relative;
  height: 300px;
}

/* ========== TABLE ========== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-card-header {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.table-card-header h2 {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.table-search {
  padding: 7px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 220px;
  transition: border-color var(--transition);
}

.table-search:focus { border-color: var(--accent); }
.table-search::placeholder { color: var(--text-muted); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  background: rgba(15, 23, 42, 0.02);
}

.data-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.data-table th:hover { color: var(--text-secondary); }

.data-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.02);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.table-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========== REPORTS LIST ========== */
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.report-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition);
}

.report-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.report-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.report-item-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.report-item-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.report-item-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.report-item-actions {
  display: flex;
  gap: 6px;
}

.report-item-actions button {
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
}

.report-item-actions button:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.report-item-actions button.delete-report:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 64px 20px;
}

.empty-state .icon {
  font-size: 56px;
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover { background: rgba(15, 23, 42, 0.03); color: var(--text); }

.btn-danger {
  background: var(--red);
  color: #ffffff;
}
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }

/* ========== ICON BUTTONS ========== */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--border-accent);
}

.icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ========== BREADCRUMBS ========== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb-item {
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.breadcrumb-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.breadcrumb-item.current {
  color: var(--text);
  font-weight: 600;
  cursor: default;
}

.breadcrumb-item.current:hover {
  background: transparent;
}

.breadcrumb-sep {
  color: var(--text-placeholder);
  font-size: 12px;
}

/* ========== BACK BUTTON ========== */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-back:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateX(-2px);
  box-shadow: var(--shadow);
}

.btn-back:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ========== HOME — Section header + grid ========== */
.home-section {
  margin-top: 0;
}

/* Respiro entre seções consecutivas da home (Projetos → Atalhos → Atividade) */
.home-section + .home-section {
  margin-top: 40px;
}

.home-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.home-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.1px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-transform: none;
}

.home-section-title::before { content: none; }

.home-section-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.home-section-sort {
  font-size: 11px;
  color: var(--text-secondary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.dashboard-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px 18px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
  overflow: hidden;
}

.dashboard-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Feature card removido — a ordenação por atividade recente já comunica
   qual é o card mais relevante; faixa amarela virava decoração sem rótulo. */

.dashboard-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
  justify-content: space-between;
}

.dashboard-card-head-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  flex: 1;
}

.dashboard-card-dot {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.dashboard-card-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-card-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.dashboard-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.dashboard-card-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.dashboard-card-stat-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  font-feature-settings: 'tnum' on, 'lnum' on;
  letter-spacing: -0.3px;
  line-height: 1;
}

.dashboard-card-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.dashboard-card-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #3b6d11;
}

.dashboard-card-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #639922;
  flex-shrink: 0;
}

.dashboard-card-status.is-empty {
  color: var(--text-muted);
}

.dashboard-card-status.is-empty::before {
  background: var(--text-placeholder);
}

/* Action buttons — visible on hover (admin only) */
.dashboard-card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.dashboard-card:hover .dashboard-card-actions {
  opacity: 1;
}

.dashboard-card-actions button {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}

.dashboard-card-actions button:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.dashboard-card-actions button.delete-action:hover {
  background: var(--red-dim);
  color: var(--red);
}

.dashboard-card-empty {
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.dashboard-card-empty strong {
  color: var(--text);
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 500;
}

/* ========== HELP TOOLTIP ========== */
.help-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
  cursor: help;
  position: relative;
  vertical-align: middle;
  transition: all var(--transition);
}

.help-hint:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

.help-hint::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 280px;
  white-space: normal;
  width: max-content;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  box-shadow: var(--shadow);
  z-index: 100;
  letter-spacing: normal;
  text-transform: none;
}

.help-hint::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  pointer-events: none;
  z-index: 100;
}

.help-hint:hover::after,
.help-hint:hover::before {
  opacity: 1;
  visibility: visible;
}

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: 100%;
  /* Em telas baixas (mobile, laptops 1366×768), conteúdo extenso (modal de
     bug report) excedia a viewport e empurrava os botões pra fora.
     Padrão de modal acessível: limitar altura, header e actions fixos,
     corpo rolável. Mantém visual em telas grandes (max-height só ativa
     quando o conteúdo passa de 90vh). */
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  /* Padding agora é por seção (header/body/actions) — necessário pra
     o scroll do body não cortar o conteúdo na borda do card. */
  padding: 0;
  animation: scaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-header {
  padding: 28px 28px 0;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.modal-icon-danger {
  color: var(--red);
  font-size: 22px;
}

.modal-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 10px;
  margin-bottom: 0;
  line-height: 1.55;
}

/* Body rolável quando o conteúdo exceder o espaço disponível. min-height: 0
   é necessário pra flex-shrink funcionar dentro de coluna flex (sem isso o
   item de flex não encolhe abaixo do tamanho intrínseco do conteúdo). */
.modal-body {
  padding: 0 28px;
  margin-bottom: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.modal-input::placeholder { color: var(--text-placeholder); }

/* Label acima do input — usado no modal de troca de senha */
.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Texto de ajuda abaixo do input de senha nova (requisitos) */
.modal-pw-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

.modal-error {
  display: none;
  font-size: 13px;
  color: var(--red);
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--red-dim);
  border-left: 3px solid var(--red);
  border-radius: 4px;
}

.modal-actions {
  padding: 0 28px 28px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ========== BUG REPORT ========== */
/* Card do modal de bug report tem largura um pouco maior pra acomodar
   descrição multi-linha + drop zone confortavelmente. */
.bug-report-modal {
  max-width: 500px;
}

.bug-report-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bug-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bug-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.bug-label-hint {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}

.bug-textarea {
  min-height: 90px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

/* Drop zone */
.bug-drop {
  position: relative;
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
}

.bug-drop:hover {
  border-color: var(--text-secondary);
  background: var(--bg-card);
}

.bug-drop.is-dragover {
  border-color: var(--text);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(255, 237, 0, 0.25);
}

.bug-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 14px;
  text-align: center;
}

.bug-drop-icon {
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bug-drop-icon [data-lucide],
.bug-drop-icon svg.lucide {
  width: 22px;
  height: 22px;
}

.bug-drop-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.bug-drop-text b {
  color: var(--text);
  font-weight: 600;
}

.bug-drop-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Grid de thumbnails das imagens anexadas, abaixo do drop zone */
.bug-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.bug-thumbs:empty {
  margin-top: 0;
}

.bug-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-input);
}

.bug-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bug-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.bug-thumb-remove:hover {
  background: rgba(0, 0, 0, 0.95);
}

/* Caixa informativa sobre metadados auto-coletados */
.bug-meta-box {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 12px;
  background: var(--bg-input);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.bug-meta-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-top: 1px;
}

.bug-meta-icon [data-lucide],
.bug-meta-icon svg.lucide {
  width: 14px;
  height: 14px;
}

.bug-meta-text b {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ========== KBD (keyboard shortcut hint) ========== */
kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.18); }

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* ========== INSIGHTS ========== */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all var(--transition);
}

.insight-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.insight-danger {
  border-left-color: var(--red);
  background: linear-gradient(90deg, var(--red-dim), var(--bg-card) 55%);
}
.insight-warning {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, var(--amber-dim), var(--bg-card) 55%);
}
.insight-success {
  border-left-color: var(--green);
  background: linear-gradient(90deg, var(--green-dim), var(--bg-card) 55%);
}
.insight-info {
  border-left-color: var(--blue);
  background: linear-gradient(90deg, var(--blue-dim), var(--bg-card) 55%);
}

.insight-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 2px;
}

.insight-body {
  flex: 1;
  min-width: 0;
}

.insight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.1px;
}

.insight-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ========== SECTION LABELS ========== */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label:first-of-type { margin-top: 8px; }

/* ========== FUNNEL ========== */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.funnel-row {
  display: grid;
  grid-template-columns: 130px 1fr 130px 90px;
  gap: 16px;
  align-items: center;
}

.funnel-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
}

.funnel-bar-wrap {
  position: relative;
  height: 32px;
  background: var(--bg-input);
  border-radius: 8px;
  overflow: hidden;
}

.funnel-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.funnel-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.funnel-rate {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

@media (max-width: 640px) {
  .funnel-row {
    grid-template-columns: 90px 1fr 90px 60px;
    gap: 10px;
  }
  .funnel-label { font-size: 12px; }
  .funnel-value { font-size: 13px; }
}

/* ========== ADDITIONAL KPI ACCENT COLORS ========== */
.kpi-card.kpi-cpm      { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-cpc      { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-ctr      { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-reach    { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-freq     { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-revenue  { box-shadow: inset 0 3px 0 var(--accent); }
.kpi-card.kpi-roas     { box-shadow: inset 0 3px 0 var(--green); }
.kpi-card.kpi-profit   { box-shadow: inset 0 3px 0 var(--green); }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .page-content {
    padding: 20px 16px 40px;
  }
  .topbar {
    padding: 14px 16px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mobile-toggle {
    display: flex !important;
  }
}

.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
}

/* ===========================================================
   AUTO DASHBOARD — estilo da view que lê de campaign_metrics
   =========================================================== */

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Botão sutil estilo link — pra ações secundárias que não devem competir
   com o conteúdo principal (ex: "+ Adicionar relatório CSV" no header da pasta) */
.btn-link {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-link:hover {
  color: var(--text);
  border-color: var(--text-secondary);
  border-style: solid;
}

.auto-loading {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.auto-dashboard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
}

.auto-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.auto-dashboard-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}
.auto-dashboard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Color picker swatch — quadradinho clicável que abre o picker nativo */
.theme-swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.15s, transform 0.15s;
}
.theme-swatch:hover {
  border-color: var(--text-secondary);
  transform: scale(1.05);
}
.theme-swatch input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.theme-swatch-preview {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
  pointer-events: none;
  position: relative;
}
/* Estado "cor padrão": overlay diagonal semi-transparente pra mostrar
   visualmente que o relatório não tem cor própria (herda da pasta) */
.theme-swatch-preview.is-default::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(
    45deg,
    transparent 0,
    transparent 3px,
    rgba(255,255,255,0.6) 3px,
    rgba(255,255,255,0.6) 4px
  );
  pointer-events: none;
}

/* Botão de upload da logo (input file escondido) */
.logo-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 16px;
  transition: all 0.15s;
}
.logo-upload:hover {
  border-color: var(--text-secondary);
  transform: scale(1.05);
}
.logo-upload-icon {
  pointer-events: none;
}

/* Botão pequenininho de remover logo */
.logo-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  margin-left: -6px;
  transition: all 0.15s;
}
.logo-remove:hover {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

/* Logo grande no header do Dashboard Auto */
.auto-dashboard-title-with-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auto-dashboard-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg-input);
  padding: 4px;
}

/* Logo no card da Home (substituindo a bolinha colorida) */
.dashboard-card-dot-logo {
  background: var(--bg-input) !important;
  padding: 4px;
  overflow: hidden;
}
.dashboard-card-dot-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auto-filters-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.auto-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auto-filter-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.auto-pills {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}
.auto-pill {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.auto-pill:hover { background: var(--bg-card-hover); color: var(--text); }
.auto-pill.active {
  background: var(--auto-primary);
  color: var(--auto-primary-contrast);
  border-color: var(--auto-primary);
}

.auto-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.auto-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.auto-tab:hover { color: var(--text); }
.auto-tab.active {
  color: var(--text);
  border-bottom-color: var(--auto-primary);
}

/* ===== Tabs do nível da pasta (Dashboard | Relatórios CSV) ===== */
.client-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 8px 0 24px;
  flex-wrap: wrap;
}
.client-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  letter-spacing: -0.1px;
}
.client-tab:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}
.client-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.client-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.client-tab.active .client-tab-count {
  background: var(--accent);
  color: var(--accent-contrast);
}

.auto-range-info {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.auto-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.auto-kpi {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Faixa superior agora é um pseudo-elemento com gradiente da cor primária
     do tema — mais elegante que box-shadow inset duro. Fade pra transparente
     dá leveza sem perder a identidade da marca. */
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.auto-kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--auto-primary) 0%,
    var(--auto-primary) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
}
.auto-kpi:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}
.auto-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.auto-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  transition: opacity 0.2s ease;
  font-variant-numeric: tabular-nums;
}
.auto-kpi-value.is-updating {
  opacity: 0.3;
}

/* KPI clicável — botão (não div) com hover affordance */
button.auto-kpi-clickable {
  position: relative;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  align-items: stretch;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
/* Quando o botão clicável é um KPI do dashboard CSV (.kpi-card),
   garante que o reset do <button> não quebre o layout do card. */
button.kpi-card.auto-kpi-clickable {
  display: block;
  width: 100%;
  background: var(--bg-card);
  color: inherit;
  font-size: inherit;
}
button.auto-kpi-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--auto-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}
button.auto-kpi-clickable:active { transform: translateY(0); }
button.auto-kpi-clickable:focus-visible {
  outline: 2px solid var(--auto-primary);
  outline-offset: 2px;
}
.auto-kpi-zoom {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
button.auto-kpi-clickable:hover .auto-kpi-zoom {
  opacity: 1;
}

/* ===== KPI DRILLDOWN MODAL ===== */
.kpi-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: kpi-modal-fade-in 0.15s ease-out;
}
@keyframes kpi-modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
.kpi-modal {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: kpi-modal-pop 0.2s ease-out;
}
@keyframes kpi-modal-pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.kpi-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.kpi-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.kpi-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.kpi-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.kpi-modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: var(--text-secondary);
}
.kpi-modal-controls {
  padding: 14px 24px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.kpi-modal-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.kpi-modal-search:focus { border-color: var(--auto-primary); }
.kpi-modal-body {
  padding: 16px 24px 20px;
  overflow-y: auto;
  flex: 1;
}
.kpi-modal-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.kpi-modal-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kpi-modal-bar-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) 2fr auto;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}
.kpi-modal-bar-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.kpi-modal-bar-canal {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.kpi-modal-bar-campaign {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-modal-bar-track {
  background: var(--bg-input);
  border-radius: 4px;
  height: 22px;
  overflow: hidden;
}
.kpi-modal-bar-fill {
  background: linear-gradient(90deg, var(--auto-primary), var(--auto-primary-dark));
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.kpi-modal-bar-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}

@media (max-width: 640px) {
  .kpi-modal { max-height: 100vh; border-radius: 0; }
  .kpi-modal-overlay { padding: 0; }
  .kpi-modal-bar-row { grid-template-columns: 1fr; }
  .kpi-modal-bar-track { height: 18px; }
  .kpi-modal-controls { padding: 12px 16px; }
  .kpi-modal-header { padding: 16px 16px 12px; }
  .kpi-modal-body { padding: 12px 16px 16px; }
}

/* Botão ícone discreto (ex: editar labels no header) */
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-icon:hover {
  border-color: var(--text-secondary);
  transform: scale(1.05);
}

/* Labels Edit Modal */
.labels-modal { max-width: 640px; }
.labels-modal .kpi-modal-body {
  padding: 8px 24px 16px;
}
.labels-modal-group {
  margin: 16px 0;
}
.labels-modal-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.labels-modal-field {
  margin-bottom: 14px;
}
.labels-modal-field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.labels-modal-field-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.labels-modal-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.labels-modal-input:focus { border-color: var(--auto-primary); }
.labels-modal-reset {
  width: 36px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.labels-modal-reset:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}
.labels-modal-field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}
.labels-modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
}

.auto-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 32px 0 18px;
  text-align: center;
}

.auto-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.auto-bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 3fr auto;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}
.auto-bar-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auto-bar-track {
  background: var(--bg-input);
  border-radius: 4px;
  height: 22px;
  overflow: hidden;
}
.auto-bar-fill {
  background: linear-gradient(90deg, var(--auto-primary), var(--auto-primary-dark));
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.auto-bar-value {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 500;
}

.auto-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.auto-table-wrap {
  margin-top: 8px;
}
.auto-table-search {
  width: 100%;
  max-width: 360px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 8px;
}
.auto-table-search:focus { border-color: var(--auto-primary); }
.auto-table-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.auto-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.auto-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.auto-table th {
  background: var(--bg-input);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 11px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.auto-table th:hover { background: var(--bg-card-hover); }
.auto-table th.num, .auto-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.auto-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auto-table tbody tr:hover { background: var(--bg-card-hover); }

.reports-section {
  margin-top: 8px;
}
.reports-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

@media (max-width: 640px) {
  .auto-dashboard { padding: 16px; }
  .auto-bar-row { grid-template-columns: 1fr; }
  .auto-bar-name { font-size: 11px; }
}

/* ===== Skeleton screen — animação shimmer enquanto carrega ===== */
.skel {
  display: inline-block;
  background: linear-gradient(90deg,
    var(--bg-input) 0%,
    var(--bg-card-hover) 50%,
    var(--bg-input) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-line-sm { height: 12px; width: 70px; }
.skel-line-md { height: 16px; width: 120px; }
.skel-line-lg { height: 24px; width: 100px; }
.skel-tab {
  height: 36px;
  width: 110px;
  margin-right: 4px;
  border-radius: 4px 4px 0 0;
}
.auto-kpi-skel {
  background: var(--bg-input);
  box-shadow: inset 0 3px 0 transparent;
}
.auto-kpi-skel .skel {
  display: block;
}
.auto-kpi-skel .skel-line-sm {
  width: 50%;
  margin-bottom: 8px;
}
.auto-kpi-skel .skel-line-lg {
  width: 80%;
}

/* ===== Botão do seletor de período (abre Litepicker) ===== */
.auto-period-btn {
  display: inline-block;
  padding: 8px 36px;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: left 12px center, right 12px center;
  background-size: 16px, 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 240px;
  text-align: left;
  font-variant-numeric: tabular-nums;
  outline: none;
  /* Remove aparência nativa do input (Safari/iOS) */
  -webkit-appearance: none;
  appearance: none;
}
.auto-period-btn:hover,
.auto-period-btn:focus {
  background-color: var(--bg-card-hover);
  border-color: var(--auto-primary);
}
.auto-period-btn::selection { background: transparent; }

/* ===== Litepicker — tema preto + amarelo ===== */
.litepicker {
  font-family: 'DM Sans', system-ui, sans-serif !important;
  --litepicker-day-width: 44px !important;
  --litepicker-button-prev-month-color-hover: var(--auto-primary) !important;
  --litepicker-button-next-month-color-hover: var(--auto-primary) !important;
  --litepicker-day-color-hover: var(--auto-primary) !important;
  --litepicker-is-start-color-bg: var(--auto-primary) !important;
  --litepicker-is-end-color-bg: var(--auto-primary) !important;
  --litepicker-is-in-range-color: var(--auto-primary-bg) !important;
}
.litepicker .container__main {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}
.litepicker .container__days {
  gap: 0 !important;
  padding: 4px !important;
}
.litepicker .day-item {
  height: 38px !important;
  line-height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}
.litepicker .day-item.is-today {
  color: var(--auto-primary-dark) !important;
  font-weight: 700;
}
.litepicker .day-item:hover {
  color: var(--auto-primary-contrast) !important;
  background: var(--auto-primary) !important;
  box-shadow: none !important;
}
.litepicker .day-item.is-start-date,
.litepicker .day-item.is-end-date {
  background: var(--auto-primary) !important;
  color: var(--auto-primary-contrast) !important;
}
.litepicker .day-item.is-in-range {
  background: var(--auto-primary-bg) !important;
  color: var(--text) !important;
}
.litepicker .container__predefined-ranges {
  border-right: 1px solid var(--border) !important;
}
.litepicker .container__predefined-ranges > button {
  font-family: 'DM Sans', system-ui, sans-serif !important;
  font-size: 13px !important;
  padding: 10px 14px !important;
  color: var(--text-secondary) !important;
}
.litepicker .container__predefined-ranges > button:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text) !important;
}
.litepicker .container__months .month-item-header div > .month-item-name,
.litepicker .container__months .month-item-header div > .month-item-year {
  font-weight: 600;
  color: var(--text);
}

/* ========== LUCIDE ICONS ========== */
/* Tamanho e alinhamento padrão dos ícones Lucide. Após substituição,
   o <i data-lucide> vira um <svg class="lucide"> com as dimensões abaixo. */
[data-lucide],
svg.lucide {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  vertical-align: -3px;
  display: inline-block;
  flex-shrink: 0;
}

/* Variantes por contexto */
.btn-icon [data-lucide], .btn-icon svg.lucide,
.sidebar-control-btn [data-lucide], .sidebar-control-btn svg.lucide,
.mobile-toggle [data-lucide], .mobile-toggle svg.lucide { width: 18px; height: 18px; }

.kpi-card [data-lucide], .kpi-card svg.lucide,
.section-label [data-lucide], .section-label svg.lucide,
.auto-dashboard-title [data-lucide], .auto-dashboard-title svg.lucide,
.home-section-title [data-lucide], .home-section-title svg.lucide,
.modal-title [data-lucide], .modal-title svg.lucide,
.chart-card-header h2 [data-lucide], .chart-card-header h2 svg.lucide,
.table-card-header h2 [data-lucide], .table-card-header h2 svg.lucide { width: 18px; height: 18px; }

.report-item-icon [data-lucide], .report-item-icon svg.lucide,
.dashboard-card-stat-icon [data-lucide], .dashboard-card-stat-icon svg.lucide,
.insight-icon [data-lucide], .insight-icon svg.lucide { width: 22px; height: 22px; }

/* Marcadores de plataforma — quadrados coloridos em substituição
   aos emojis (Meta azul, Google vermelho, LinkedIn azul forte) que
   indicavam plataforma no dashboard HubSpot. */
.platform-marker {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: -1px;
  flex-shrink: 0;
}
.platform-marker--meta     { background: #1877F2; }
.platform-marker--google   { background: #EA4335; }
.platform-marker--linkedin { background: #0A66C2; }
.platform-marker--tiktok   { background: #000000; }
.platform-marker--reddit   { background: #FF4500; }

/* ==========================================================
   SALVY DASHBOARD — Entrega 2 (Marketing Digital)
   Reusa .auto-kpi/.auto-table/.client-tab e adiciona:
   - .salvy-kpi*: deltas período-anterior dentro do KPI card
   - .salvy-rate-*: cards de taxas de conversão do funil
   - .salvy-section-title: títulos de seção do dashboard Salvy
   ========================================================== */

/* Espaçamento entre seções do dashboard Salvy */
.salvy-section {
  margin-bottom: 32px;
}
.salvy-section:last-child {
  margin-bottom: 0;
}

/* Título de seção do dashboard Salvy: regra consolidada mais abaixo
   (procure por "Títulos de seção: centralizados") */

/* Sub-tabs do dashboard Salvy (Marketing Digital | Salesforce).
   Reusa .client-tabs/.client-tab; mantém pequena distinção visual. */
.salvy-subtabs {
  margin-bottom: 24px;
}

/* KPI cards da Salvy — extensão de .auto-kpi com slot pra delta.
   Funnel KPIs (Lead/MQL/Opp/Ganho) recebem destaque com box-shadow ampliado. */
.salvy-kpi {
  position: relative;
}
.salvy-kpi-funnel {
  box-shadow:
    inset 0 3px 0 var(--auto-primary),
    inset 0 -1px 0 var(--auto-primary);
}

/* Delta período-anterior (↑12,5% / ↓3,2% / —) abaixo do valor do KPI */
.salvy-kpi-delta {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  margin-top: 2px;
  display: inline-block;
}
.salvy-delta-up      { color: #16a34a; }            /* verde — métrica subiu (good direction) */
.salvy-delta-down    { color: #dc2626; }            /* vermelho — métrica caiu (bad direction) */
.salvy-delta-neutral { color: var(--text-muted); }  /* cinza — sem mudança */
.salvy-delta-new     { color: var(--text-muted); font-style: italic; }

/* Cards de taxa do funil (Lead → MQL: 12,46%, etc.) */
.salvy-rates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.salvy-rate-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.salvy-rate-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.salvy-rate-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}

/* Tabela "Desempenho por Canal" — reusa .auto-table; primeira coluna em destaque */
.salvy-table .salvy-table-canal {
  font-weight: 600;
  white-space: nowrap;
}

/* Tabela matriz (cross-tab canal × dimensão CRM) — coluna/linha de total em destaque */
.salvy-matrix-table th,
.salvy-matrix-table td {
  white-space: nowrap;
}
.salvy-matrix-table .salvy-matrix-rowhead {
  text-align: left;
}
.salvy-matrix-table .salvy-matrix-total {
  font-weight: 600;
  background: rgba(0, 0, 0, 0.03);
}

/* Drill-down hierárquico do dashboard Salvy ----------------------------- */

.salvy-drill-table tbody tr {
  border-bottom: 1px solid var(--border);
}

/* Indentação visual por nível (paddint-left é setado inline pelo JS, mas
   manter um background sutil ajuda a percepção de hierarquia) */
.salvy-drill-level-1 {
  background: rgba(0, 0, 0, 0.012);
}
.salvy-drill-level-2 {
  background: rgba(0, 0, 0, 0.024);
}

.salvy-drill-name {
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.salvy-drill-level-0 .salvy-drill-name { font-weight: 600; }
.salvy-drill-level-1 .salvy-drill-name { font-weight: 500; }
.salvy-drill-level-2 .salvy-drill-name {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* Botão [+] / [−] de expansão */
.salvy-drill-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}
.salvy-drill-toggle:hover {
  background: var(--auto-primary);
  border-color: var(--auto-primary);
  color: var(--auto-primary-contrast, #000);
}
.salvy-drill-toggle:focus-visible {
  outline: 2px solid var(--auto-primary);
  outline-offset: 1px;
}
/* Folha (sem filhos) — ocupa o mesmo espaço pra alinhar nomes */
.salvy-drill-toggle-leaf {
  border: none;
  background: transparent;
  cursor: default;
  pointer-events: none;
}
.salvy-drill-row.is-expanded > .salvy-drill-name .salvy-drill-toggle {
  background: var(--auto-primary);
  border-color: var(--auto-primary);
  color: var(--auto-primary-contrast, #000);
}

.salvy-drill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

/* ==========================================================
   SALVY DASHBOARD — Entrega 5 (Fase 2 agressiva)
   - Filtros (auto-tabs/auto-pill já existem)
   - Charts ao longo do tempo (Chart.js wrappers)
   - Total geral no rodapé das tabelas
   ========================================================== */

/* Card que envolve cada chart Salvy */
.salvy-chart-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  padding: 20px 22px 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.salvy-chart-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Container do <canvas>: altura fixa pro chart não pular ao re-render.
   Chart.js calcula responsivamente dentro desse box. */
.salvy-chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}

@media (max-width: 768px) {
  .salvy-chart-wrap {
    height: 220px;
  }
}

/* Linha de Total geral no <tfoot> das tabelas Salvy */
.salvy-table-total {
  background: var(--bg-card-hover, rgba(0,0,0,0.04));
  font-weight: 600;
  border-top: 2px solid var(--border);
}
.salvy-table-total td {
  font-weight: 600;
}
.salvy-table-total .salvy-table-canal {
  font-weight: 700;
}

/* ==========================================================
   SALVY TABLE TOOLBAR — Entrega 5b (busca + sort + top N)
   Inspirado no padrão do auto-table do Logcomex.
   ========================================================== */

.salvy-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 12px 0;
  flex-wrap: wrap;
}

.salvy-table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.salvy-table-search {
  flex: 1 1 280px;
  min-width: 200px;
  max-width: 360px;
}

/* Header clicável da tabela (sort) */
.salvy-th-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.salvy-th-sortable:hover {
  background: var(--bg-card-hover, rgba(0,0,0,0.04));
}

.salvy-sort-arrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
  color: var(--auto-primary);
  vertical-align: 0;
}

/* ==========================================================
   SALVY DASHBOARD — Reorganização visual (4 mudanças)
   1. Tabs de dados (Canal/Campanha/Grupo/Palavra/Qualidade)
   2. Toggle "Mais filtros"
   3. Charts em grid 2 colunas
   4. Espaçamento e hierarquia visual
   ========================================================== */

/* ----- 4. Espaçamento e hierarquia ----- */

/* Aumenta respiro entre seções (era 32px, agora 40px) */
.salvy-section {
  margin-bottom: 40px;
}

/* Charts agrupados ficam ainda mais visíveis */
.salvy-section-charts {
  margin-bottom: 48px;
}

/* Títulos de seção: centralizados, com peso visual */
.salvy-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

/* ----- 3. Charts em grid 2 colunas ----- */

.salvy-charts-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.salvy-chart-full {
  width: 100%;
}

/* Grid 2 colunas para charts secundários (Funil + Custos) */
.salvy-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .salvy-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Charts dentro do grid: espaçamento uniforme */
.salvy-chart-full .salvy-section-title,
.salvy-charts-grid .salvy-section-title {
  margin-bottom: 12px;
}

/* ----- 1. Tabs de dados (Canal/Campanha/Grupo/Palavra/Qualidade) ----- */

.salvy-datatabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.salvy-datatab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.salvy-datatab:hover {
  color: var(--text);
}
.salvy-datatab.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--auto-primary);
}

.salvy-datatab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  background: var(--bg-input);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
}
.salvy-datatab.active .salvy-datatab-count {
  background: var(--auto-primary);
  color: var(--auto-primary-contrast, #000);
}

/* Título da tabela ativa visível e centralizado dentro da data-tab */
.salvy-datatab-content .salvy-section-title {
  margin-top: 4px;
  margin-bottom: 14px;
}

/* Toolbar da tabela: espaçamento ajustado pra primeira posição */
.salvy-datatab-content .salvy-table-toolbar {
  margin-top: 0;
}

/* Chart card mais compacto quando dentro do grid */
.salvy-charts-grid .salvy-chart-card {
  padding: 14px 16px;
}
.salvy-charts-grid .salvy-chart-wrap {
  height: 240px;
}

/* Título quando dentro de um chart card: sem border (o card já tem borda própria),
   margem ajustada pra dar respiro entre título e gráfico */
.salvy-chart-card .salvy-chart-title {
  border-bottom: none;
  padding-bottom: 0;
  margin: 0 0 16px 0;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

/* ==========================================================
   SALVY DASHBOARD — Header com tema/logo/labels controls
   Espelha o padrão auto-dashboard-header do Logcomex.
   ========================================================== */

/* ==========================================================
   SALVY DASHBOARD — Header
   Reusa as classes globais .auto-dashboard-header, .auto-dashboard-title,
   .auto-dashboard-actions, .auto-dashboard-logo, .auto-filters-row, etc.
   pra ficar idêntico ao padrão Logcomex. Não precisa de overrides.
   ========================================================== */

/* ==========================================================
   ÍCONES LUCIDE — tamanhos contextuais
   Aplicados nos lugares onde substituímos símbolos Unicode
   por <i data-lucide="..."> pra padronizar o visual.
   ========================================================== */

/* Sort arrows nas tabelas Salvy: pequenos, alinhados ao texto */
.salvy-sort-arrow [data-lucide],
.salvy-sort-arrow svg.lucide {
  width: 12px;
  height: 12px;
  vertical-align: middle;
}

/* Delta dos KPIs Salvy: ícone trending-up/down */
.salvy-kpi-delta [data-lucide],
.salvy-kpi-delta svg.lucide {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
}

/* Drill-down toggle: chevrons no canto da linha */
.salvy-drill-toggle [data-lucide],
.salvy-drill-toggle svg.lucide {
  width: 14px;
  height: 14px;
}

/* Botão de reset do labels modal: ícone redondo */
.labels-modal-reset [data-lucide],
.labels-modal-reset svg.lucide {
  width: 14px;
  height: 14px;
}

/* Sidebar collapse: chevron no canto */
.sidebar-control-btn [data-lucide],
.sidebar-control-btn svg.lucide {
  width: 16px;
  height: 16px;
}

/* Breadcrumb separator: chevron entre crumbs */
.breadcrumb-sep [data-lucide],
.breadcrumb-sep svg.lucide {
  width: 14px;
  height: 14px;
  vertical-align: middle;
}

/* Botão Voltar */
.btn-back [data-lucide],
.btn-back svg.lucide {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* Botão Sair (ações destrutivas) e ações neutras (criar conta, trocar senha, reportar bug) */
.btn-logout [data-lucide],
.btn-logout svg.lucide,
.btn-sidebar-action [data-lucide],
.btn-sidebar-action svg.lucide {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* Zoom KPI: ícone de expand */
.auto-kpi-zoom [data-lucide],
.auto-kpi-zoom svg.lucide {
  width: 14px;
  height: 14px;
}

/* Headers da tabela CSV: ícone de sort placeholder */
th [data-lucide="chevrons-up-down"] {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
  opacity: 0.5;
}

/* Funnel rate (→ no CSV) */
.funnel-rate [data-lucide],
.funnel-rate svg.lucide {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
}

/* ============================================================
   POLIMENTO DE ALINHAMENTO — passe final
   Não muda cores, só tamanhos, gaps, vertical-align e altura
   uniforme em elementos que aparecem juntos.
   ============================================================ */

/* ---- Header da pasta: alturas uniformes em 36px ----
   .btn-secondary tinha padding 9px → ~38-40px (não batia com .btn-icon 36px,
   .theme-swatch 36px, .logo-upload 36px). Forçar mesma altura nos vizinhos
   do .auto-dashboard-actions evita "dente" no alinhamento. */
.auto-dashboard-actions .btn-secondary,
.auto-dashboard-actions .btn-icon,
.auto-dashboard-actions .theme-swatch,
.auto-dashboard-actions .logo-upload {
  height: 36px;
}
.auto-dashboard-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}
.auto-dashboard-actions .btn-secondary [data-lucide],
.auto-dashboard-actions .btn-secondary svg.lucide {
  width: 14px;
  height: 14px;
}

/* ---- Período input: bater 36px também ---- */
.auto-period-btn {
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 34px; /* 36 - 2 (border) */
}

/* ---- Salvy KPI delta com ícone trending-up/down: alinha inline ---- */
.salvy-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
.salvy-kpi-delta [data-lucide],
.salvy-kpi-delta svg.lucide {
  width: 12px;
  height: 12px;
  vertical-align: 0;
  flex-shrink: 0;
}

/* ---- Breadcrumb separator com chevron: alinha sem deslocar baseline ---- */
.breadcrumb-sep {
  display: inline-flex;
  align-items: center;
  margin: 0 2px;
  color: var(--text-muted);
}
.breadcrumb-sep [data-lucide],
.breadcrumb-sep svg.lucide {
  width: 14px;
  height: 14px;
  vertical-align: 0;
}

/* ---- Botão Voltar com ícone arrow-left ---- */
.btn-back {
  gap: 6px;
}
.btn-back [data-lucide],
.btn-back svg.lucide {
  width: 14px;
  height: 14px;
  vertical-align: 0;
  flex-shrink: 0;
}

/* ---- Botões da sidebar (Sair + ações neutras) com ícone Lucide ---- */
.btn-logout,
.btn-sidebar-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-logout [data-lucide],
.btn-logout svg.lucide,
.btn-sidebar-action [data-lucide],
.btn-sidebar-action svg.lucide {
  width: 14px;
  height: 14px;
  vertical-align: 0;
  flex-shrink: 0;
}

/* ---- Funnel-rate (CSV): drop indicator com ícone corner-down-right ---- */
.funnel-rate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.funnel-rate [data-lucide],
.funnel-rate svg.lucide {
  width: 12px;
  height: 12px;
  vertical-align: 0;
  flex-shrink: 0;
}

/* ---- Sort placeholder ↕ → chevrons-up-down nos headers da tabela CSV ---- */
.auto-table th [data-lucide="chevrons-up-down"] {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -2px;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.auto-table th:hover [data-lucide="chevrons-up-down"] {
  opacity: 0.8;
}

/* ---- Drill-down toggle: chevron centralizado, mesma área de clique ---- */
.salvy-drill-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.salvy-drill-toggle [data-lucide],
.salvy-drill-toggle svg.lucide {
  width: 14px;
  height: 14px;
}

/* ---- Sidebar collapse: ícone centralizado, sem flutuar ---- */
.sidebar-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- Stat chips no header do CSV: gap uniforme + chip-primary com separador limpo ---- */
.stat-chips-row,
.report-stat-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 4px 0 18px;
}
.stat-chip {
  line-height: 1.2;
}
.stat-chip [data-lucide],
.stat-chip svg.lucide {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
/* Simple Icons (Meta, TikTok, Reddit, Google Ads) usa font, não SVG.
   Alinha tamanho ao Lucide via font-size. */
.stat-chip .si {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
/* Remove o separator ::after pesado — usa gap consistente em vez disso */
.stat-chip-primary::after {
  display: none;
}
.stat-chip-primary {
  position: relative;
  padding-right: 14px;
}
.stat-chip-primary::before {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  width: 1px;
  height: 14px;
  background: var(--border);
  transform: translateY(-50%);
}

/* ---- Salvy: rates do funil — alinhamento dos cards no grid ---- */
.salvy-rate-card {
  min-height: 76px;
  justify-content: center;
}

/* ---- Salvy KPI value: alinhamento vertical com o delta abaixo ---- */
.auto-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---- Salvy data-tab count badge: tamanho consistente ---- */
.salvy-datatab-count {
  font-variant-numeric: tabular-nums;
}

/* ---- Pills/tabs: ajuste fino de gap pra ficar mais arejado ---- */
.auto-pills {
  gap: 6px;
}
.auto-tabs {
  gap: 4px;
}

/* ---- Auto filters row: gap entre grupos consistente ---- */
.auto-filters-row {
  gap: 24px;
  row-gap: 12px;
}

/* ---- Dashboard-card stat: ícone + número + texto bem espaçados ---- */
.dashboard-card-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dashboard-card-stat-icon {
  display: inline-flex;
  align-items: center;
}
.dashboard-card-stat-icon [data-lucide],
.dashboard-card-stat-icon svg.lucide {
  width: 14px;
  height: 14px;
}

/* ---- Client tabs (Dashboard | Relatórios CSV): badge inline alinhado ---- */
.client-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

/* ---- Espaçamento vertical no auto-dashboard: margem suave entre rows ---- */
.auto-dashboard .auto-tabs {
  margin-top: 4px;
  margin-bottom: 16px;
}

/* ---- Salvy header: bate com o auto-dashboard padrão Logcomex ---- */
.salvy-header {
  margin-bottom: 0;
}
.salvy-header .auto-tabs {
  margin-top: 4px;
}
/* ============================================================
   BUG REPORTS — view dedicada
   ============================================================ */

.bug-reports-view {
  max-width: 980px;
}

.bug-reports-view .view-header {
  margin-bottom: 24px;
}

.bug-reports-view .view-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}

.bug-reports-view .view-sub {
  color: var(--text-soft);
  margin: 0;
}

.bug-reports-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.bug-reports-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 14px;
}

.bug-reports-stats b {
  color: var(--text);
  font-weight: 600;
}

.bug-reports-stat-sep {
  color: var(--border-strong);
}

.bug-reports-loading,
.bug-reports-empty {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 24px;
  text-align: center;
  color: var(--text-soft);
}

.bug-reports-empty h3 {
  margin: 16px 0 6px;
  color: var(--text);
}

.bug-reports-empty p {
  margin: 0;
}

.bug-reports-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bug-report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  transition: border-color var(--transition), background var(--transition);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.bug-report-card:hover {
  border-color: var(--border-strong);
}

.bug-report-card.is-selected {
  border-color: var(--text);
  background: var(--bg-input);
}

.bug-report-card-body {
  min-width: 0; /* permite ellipsis se necessário */
}

/* Checkbox custom — só aparece em bugs limpáveis */
.bug-select-toggle {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  margin-top: 2px;
  flex-shrink: 0;
  transition: all var(--transition);
}

.bug-select-toggle:hover {
  border-color: var(--text);
}

.bug-select-toggle.is-selected {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.bug-select-toggle [data-lucide],
.bug-select-toggle svg.lucide {
  width: 14px;
  height: 14px;
}

/* Spacer pra alinhar visualmente bugs não-limpáveis com os limpáveis */
.bug-select-spacer {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Botão de link no toolbar (Selecionar todos / Limpar seleção) */
.btn-link-action {
  background: none;
  border: none;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
}

.btn-link-action:hover {
  opacity: 0.7;
}

.bug-report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.bug-report-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.bug-report-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
  flex-wrap: wrap;
}

.bug-report-card-desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  opacity: 0.8;
}

/* Badges de estado: ativos / limpos / sem anexo */
.bug-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.bug-badge-active {
  background: rgba(255, 237, 0, 0.18);
  color: #6f5a00;
}

.bug-badge-cleaned {
  background: rgba(16, 185, 129, 0.12);
  color: #0e8f6c;
}

.bug-badge-neutral {
  background: var(--bg-input);
  color: var(--text-soft);
}

.bug-clickup-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.bug-clickup-link:hover {
  text-decoration: underline;
}

.bug-clickup-failed {
  color: #c1392c;
  font-weight: 500;
  cursor: help;
}

/* Modal de resultado do cleanup */
.cleanup-result-card {
  max-width: 560px;
}

.cleanup-result-empty {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0;
}

.cleanup-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cleanup-result-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: 6px;
}

.cleanup-result-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.cleanup-result-meta {
  font-size: 12px;
  color: var(--text-soft);
}

.cleanup-result-skipped {
  margin-top: 16px;
}

.cleanup-result-skipped summary {
  cursor: pointer;
  color: var(--text-soft);
  font-size: 13px;
  margin-bottom: 8px;
  user-select: none;
}

.cleanup-result-skipped summary:hover {
  color: var(--text);
}

/* Spin animation pro ícone de loading no botão de cleanup */
.btn .spin,
.btn [data-lucide="loader-2"] {
  animation: spin 1s linear infinite;
}

/* Modal de confirmação antes de cleanup */
.cleanup-confirm-card {
  max-width: 520px;
}

.cleanup-confirm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.cleanup-confirm-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: 6px;
}

.cleanup-confirm-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cleanup-confirm-meta {
  font-size: 12px;
  color: var(--text-soft);
  flex-shrink: 0;
}

/* Seções do modal de confirmação (dry-run): verde pra "vai limpar",
   amarelo pra "bloqueado". */
.cleanup-confirm-section + .cleanup-confirm-section {
  margin-top: 16px;
}

.cleanup-confirm-section-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cleanup-confirm-section-title [data-lucide],
.cleanup-confirm-section-title svg.lucide {
  width: 14px;
  height: 14px;
}

.cleanup-confirm-section-ok {
  color: #0e8f6c;
}

.cleanup-confirm-section-warn {
  color: #b76e00;
}

/* ============================================================
   HOME CLIENTE — Seção de Relatórios CSV (preview)
   ============================================================ */

.home-csv-section {
  margin-top: 28px;
}

.home-csv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.home-csv-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-csv-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.02em;
}

.home-csv-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: var(--bg-input);
  color: var(--text-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* Estado preenchido: lista compacta de relatórios */
.home-csv-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.home-csv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.home-csv-item:last-child {
  border-bottom: none;
}

.home-csv-item:hover {
  background: var(--bg-input);
}

.home-csv-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text);
}

.home-csv-item-icon [data-lucide],
.home-csv-item-icon svg.lucide {
  width: 16px;
  height: 16px;
}

.home-csv-item-info {
  flex: 1;
  min-width: 0;
}

.home-csv-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-csv-item-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}

.home-csv-item-arrow {
  width: 16px;
  height: 16px;
  color: var(--text-soft);
  flex-shrink: 0;
}

/* Estado vazio: drop zone enxuta */
.home-csv-empty {
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.home-csv-empty:hover {
  border-color: var(--text);
  background: var(--bg-input);
}

.home-csv-empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text);
}

.home-csv-empty-icon [data-lucide],
.home-csv-empty-icon svg.lucide {
  width: 18px;
  height: 18px;
}

.home-csv-empty-info {
  flex: 1;
  min-width: 0;
}

.home-csv-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.home-csv-empty-sub {
  font-size: 12px;
  color: var(--text-soft);
}

.home-csv-empty-action {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.home-csv-empty-action [data-lucide],
.home-csv-empty-action svg.lucide {
  width: 14px;
  height: 14px;
}

/* ============================================================
   HOME CLIENTE — Insights (KPIs + alerta)
   ============================================================ */

.home-insights {
  margin-top: 28px;
}

.home-insights-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.home-insights-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

.home-insights-sub {
  font-size: 12px;
  color: var(--text-soft);
}

/* Grid de 4 KPI cards */
.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 720px) {
  .home-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.home-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.12s;
}

.home-kpi-card:hover {
  border-color: var(--border-strong);
}

/* Quando clicável (vai abrir o dashboard com filtro 30d), reforça o
   affordance: cursor pointer + leve elevação no hover. */
.home-kpi-card.is-clickable {
  cursor: pointer;
}
.home-kpi-card.is-clickable:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}
.home-kpi-card.is-clickable:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}
.home-kpi-card.is-clickable:active {
  transform: translateY(0);
}

.home-kpi-label {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}

/* Sublabel discreto abaixo do label principal — indica o período/contexto
   do KPI sem competir com o número grande abaixo. */
.home-kpi-sublabel {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.2px;
  margin-top: 2px;
  text-transform: uppercase;
}

.home-kpi-value {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  font-family: var(--font-mono, inherit);
}

/* Delta intencionalmente neutro por padrão — sentimento aplicado via
   .home-kpi-delta-positive / -negative pelo JS conforme a métrica
   (CPL é invertido: queda = positiva). Tons dessaturados pra não virar
   semáforo de Excel. */
.home-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 500;
}

.home-kpi-delta-positive {
  color: #3f7a3f;
}

.home-kpi-delta-negative {
  color: #9c4040;
}

.home-kpi-delta [data-lucide],
.home-kpi-delta svg.lucide {
  width: 12px;
  height: 12px;
}

.home-kpi-delta-new {
  color: var(--text-soft);
  font-style: italic;
}

.home-kpi-delta-empty {
  color: var(--text-placeholder);
}

/* Skeleton enquanto carrega */
.home-kpi-card-skeleton {
  pointer-events: none;
}

.home-kpi-skeleton-label,
.home-kpi-skeleton-value,
.home-kpi-skeleton-delta {
  background: var(--bg-input);
  border-radius: 4px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.home-kpi-skeleton-label { height: 12px; width: 60%; }
.home-kpi-skeleton-value { height: 22px; width: 80%; }
.home-kpi-skeleton-delta { height: 11px; width: 50%; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* Estado "em breve" pra Pulsus (sem fonte automática) */
.home-kpi-comingsoon {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-soft);
}

.home-kpi-comingsoon [data-lucide],
.home-kpi-comingsoon svg.lucide {
  width: 22px;
  height: 22px;
  color: var(--text);
  flex-shrink: 0;
}

.home-kpi-comingsoon-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.home-kpi-comingsoon-sub {
  font-size: 12px;
  color: var(--text-soft);
}

/* Alerta de anomalia — soft, sem amarelo gritante */
.home-insights-alert {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.home-insights-alert-icon {
  width: 16px;
  height: 16px;
  color: var(--text);
  flex-shrink: 0;
  margin-top: 2px;
}

.home-insights-alert-body {
  flex: 1;
  min-width: 0;
}

.home-insights-alert-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.home-insights-alert-sub {
  font-size: 12px;
  color: var(--text-soft);
}

/* Animação de entrada delay-1-5 (entre 1 e 2 dos existentes) */
.animate-in-delay-1-5 {
  animation-delay: 0.15s;
}

/* ============================================================
   Botão pílula sutil — usado pra "Ver todos →" e similares
   ============================================================ */

.btn-pill-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-pill-action:hover {
  border-color: var(--text);
  color: var(--text);
}

.btn-pill-action [data-lucide],
.btn-pill-action svg.lucide {
  width: 12px;
  height: 12px;
}

/* Animação só faz sentido pra ícones no FIM do botão (chevron-right "Ver todos →").
   Ícone no início (ex: + Adicionar) não anima — não tem direção. */
.btn-pill-action [data-lucide]:last-child,
.btn-pill-action svg.lucide:last-child {
  transition: transform var(--transition);
}

.btn-pill-action:hover [data-lucide]:last-child,
.btn-pill-action:hover svg.lucide:last-child {
  transform: translateX(2px);
}

/* Container de ações no header de seção (ex: "+ Adicionar" + "Ver todos →") */
.home-csv-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* ==========================================================
   Dashboard Pulsus V2 — placeholders dos blocos pendentes
   Substituídos progressivamente pelos blocos 2–8 do plano.
   ========================================================== */
.pulsus-v2-placeholder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  margin: 12px 0;
  border: 1px dashed var(--border-color, #d1d5db);
  border-radius: 10px;
  background: var(--surface-alt, #f9fafb);
  color: var(--text-muted, #6b7280);
  font-size: 14px;
}
.pulsus-v2-placeholder-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: #000000;
  color: #FFED00;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.pulsus-v2-placeholder-label {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 500;
}

/* ==========================================================
   Dashboard Pulsus V2 — Bloco 2: Header + Filtros
   ========================================================== */

/* Seção do header. .pulsus-v2-section é o container genérico
   de cada seção do dashboard V2; serve como ponto de modernização futura. */
.pulsus-v2-section {
  margin: 16px 0;
}
.pulsus-v2-section-header {
  background: #ffffff;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Linha superior: título + ações (logo/tema/labels/sync) */
.pulsus-v2-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Linha de filtros: 3 dropdowns + date picker + Limpar */
.pulsus-v2-filters-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ----- Dropdown multi-select customizado ----- */
.pulsus-v2-dropdown {
  position: relative;
  min-width: 160px;
}
.pulsus-v2-dd-trigger {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  color: #111827;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 40px;
}
.pulsus-v2-dd-trigger:hover {
  border-color: #9ca3af;
  background: #fafafa;
}
.pulsus-v2-dropdown.is-open .pulsus-v2-dd-trigger {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(255, 237, 0, 0.25);
  background: #ffffff;
}
.pulsus-v2-dropdown.has-selection .pulsus-v2-dd-trigger {
  background: #fffbcc;
  border-color: #000000;
  font-weight: 500;
}
.pulsus-v2-dd-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}
.pulsus-v2-dd-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.pulsus-v2-dropdown.is-open .pulsus-v2-dd-chevron {
  transform: rotate(180deg);
}

/* Painel popover */
.pulsus-v2-dd-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 280px;
  max-width: 380px;
  max-height: 380px;
  background: #ffffff;
  border: 1px solid #000000;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 100;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: pulsusV2DdFade 0.12s ease-out;
}
@keyframes pulsusV2DdFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Item do dropdown (option ou master) */
.pulsus-v2-dd-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #111827;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: background 0.1s;
  position: relative;
}
.pulsus-v2-dd-option:hover {
  background: #f3f4f6;
}
.pulsus-v2-dd-master {
  border-bottom: 1px solid #f3f4f6;
  border-radius: 6px 6px 0 0;
  padding-bottom: 10px;
  margin-bottom: 2px;
}

/* Checkbox visual (não usa input nativo para controle total do estilo).
   Visual claro: borda cinza no estado vazio, branco com check escuro
   no estado marcado. */
.pulsus-v2-dd-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  background: #ffffff;
  transition: background 0.1s, border-color 0.1s;
}
.pulsus-v2-dd-option:hover .pulsus-v2-dd-check {
  border-color: #9ca3af;
}
.pulsus-v2-dd-option.is-checked .pulsus-v2-dd-check {
  background: #ffffff;
  border-color: #374151;
}
.pulsus-v2-dd-option.is-checked .pulsus-v2-dd-check::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0;
  width: 5px;
  height: 10px;
  border: solid #374151;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.pulsus-v2-dd-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Botão SOMENTE (visível no hover do item) */
/* Atalho "SOMENTE" — visualmente discreto.
   Aparece só no hover do item; é uma ação secundária pra deixar só esse
   valor selecionado. Estilo de link em vez de botão pra não competir
   visualmente com o checkbox. */
.pulsus-v2-dd-only {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 4px;
  background: transparent;
  color: #6b7280;
  border: none;
  border-radius: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s;
  flex-shrink: 0;
}
.pulsus-v2-dd-option:hover .pulsus-v2-dd-only {
  opacity: 1;
}
.pulsus-v2-dd-only:hover {
  background: transparent;
  color: #111827;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Search box */
.pulsus-v2-dd-search-wrap {
  position: relative;
  padding: 0 2px;
}
.pulsus-v2-dd-search-wrap svg.lucide {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #9ca3af;
  pointer-events: none;
}
.pulsus-v2-dd-search {
  width: 100%;
  padding: 8px 10px 8px 34px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.pulsus-v2-dd-search:focus {
  border-color: #000000;
}

/* Lista de opções com scroll */
.pulsus-v2-dd-options {
  flex: 1;
  overflow-y: auto;
  max-height: 240px;
}
.pulsus-v2-dd-empty {
  padding: 12px;
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* ----- Date picker do Pulsus V2 ----- */
.pulsus-v2-period {
  padding: 9px 14px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  color: #111827;
  cursor: pointer;
  min-width: 220px;
  min-height: 40px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.pulsus-v2-period:hover {
  border-color: #9ca3af;
  background: #fafafa;
}
.pulsus-v2-period:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(255, 237, 0, 0.25);
  background: #ffffff;
}

/* ----- Botão Limpar filtros ----- */
.pulsus-v2-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  color: #374151;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
  margin-left: auto;
}
.pulsus-v2-clear-filters:hover:not(.is-disabled) {
  background: #000000;
  color: #FFED00;
  border-color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.pulsus-v2-clear-filters:active:not(.is-disabled) {
  transform: translateY(0);
}
.pulsus-v2-clear-filters.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pulsus-v2-clear-filters svg.lucide {
  width: 14px;
  height: 14px;
}

/* Responsivo: empilha em mobile */
@media (max-width: 768px) {
  .pulsus-v2-filters-row {
    flex-direction: column;
    align-items: stretch;
  }
  .pulsus-v2-dropdown,
  .pulsus-v2-period,
  .pulsus-v2-clear-filters {
    width: 100%;
    min-width: 0;
  }
  .pulsus-v2-clear-filters {
    margin-left: 0;
  }
}

/* ==========================================================
   Dashboard Pulsus V2 — Bloco 3: Scorecards
   ========================================================== */

.pulsus-v2-section-scorecards {
  margin-top: 16px;
}

/* Grid de 6 cards. Em viewports largos: 6 colunas iguais.
   Reaproveita o estilo base de .auto-kpi mas força grid mais
   apertada já que sempre temos exatamente 6 cards (vs auto-fit). */
.pulsus-v2-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

/* Taxa secundária abaixo do delta (só nos cards #1 Impressões e #2 Cliques).
   Visual sutil em cinza pra não competir com o valor principal nem com o delta. */
.pulsus-v2-kpi-secondary {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  margin-top: 2px;
}

/* Footnote do bloco de scorecards — alinhado à direita.
   Tom mais legível (cor mais escura, sem itálico) porque é a única
   pista visual de que os %Δ comparam com período anterior — leitor
   casual precisa pegar isso sem precisar passar mouse. */
.pulsus-v2-kpi-footnote {
  font-size: 12px;
  color: #6b7280;
  text-align: right;
  margin-top: 6px;
  letter-spacing: 0.1px;
}

/* Responsivo: 6 colunas só em viewport realmente largo (≥1280px), já que
   valores cheios "R$ 502.657,96" + decimais precisam de espaço. Em médio
   (1100-1280px) cai pra 3 colunas; em mobile, 2 colunas. */
@media (max-width: 1280px) {
  .pulsus-v2-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .pulsus-v2-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Fix: o tooltip dos scorecards Pulsus precisa "escapar" do card, então o
   overflow:hidden do .auto-kpi não serve. Com overflow:visible, a faixa superior
   feita via ::before vazava nos cantos (border-radius de 3px não acompanha o
   canto de 12px do card). Solução: desliga o ::before e desenha a faixa como
   background-image — o background é recortado pelo border-radius do card sem
   precisar de overflow:hidden. Canto limpo + tooltip visível. Gradiente idêntico
   ao do ::before original. Não afeta Logcomex/Salvy. */
.pulsus-v2-kpi {
  overflow: visible;
  background-image: linear-gradient(
    90deg,
    var(--auto-primary) 0%,
    var(--auto-primary) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  background-repeat: no-repeat;
  background-size: 100% 3px;
  background-position: top left;
}
.pulsus-v2-kpi::before {
  display: none;
}

/* ==========================================================
   Dashboard Pulsus V2 — Tooltips reutilizáveis (CSS-only)
   Usado em: scorecards, gráficos e tabelas dos blocos seguintes.
   Para outros blocos usarem é só aplicar .pulsus-v2-tip + data-tip.
   ========================================================== */

.pulsus-v2-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  color: var(--text-muted, #6b7280);
  cursor: help;
  vertical-align: middle;
  transition: color 0.15s;
}
.pulsus-v2-tip:hover {
  color: #000000;
}
.pulsus-v2-tip svg {
  pointer-events: none;
}

/* Balão do tooltip — invisível até hover. data-tip carrega o texto.
   Visual claro: fundo branco, borda cinza, texto cinza-escuro. */
.pulsus-v2-tip::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #ffffff;
  color: #374151;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.4;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  white-space: normal;
  width: max-content;
  max-width: 240px;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}

/* Setinha do tooltip apontando pra baixo (mesma cor do fundo do balão) */
.pulsus-v2-tip::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 5px solid transparent;
  border-top-color: #ffffff;
  filter: drop-shadow(0 1px 0 #e5e7eb);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 1000;
}

.pulsus-v2-tip:hover::before,
.pulsus-v2-tip:hover::after,
.pulsus-v2-tip:focus-visible::before,
.pulsus-v2-tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Variante: tooltip aparece embaixo (útil para elementos no topo da página). */
.pulsus-v2-tip[data-tip-pos="bottom"]::before {
  bottom: auto;
  top: calc(100% + 8px);
}
.pulsus-v2-tip[data-tip-pos="bottom"]::after {
  bottom: auto;
  top: calc(100% + 3px);
  border-top-color: transparent;
  border-bottom-color: #ffffff;
  filter: drop-shadow(0 -1px 0 #e5e7eb);
}

/* Tooltip dentro do label uppercase do KPI não deve herdar o uppercase
   (o texto do balão é prosa normal, não label). Garantido pelo text-transform:none
   já no ::before — esta regra é só uma rede de segurança. */
.auto-kpi-label .pulsus-v2-tip::before,
.pulsus-v2-kpi-secondary .pulsus-v2-tip::before,
.pulsus-v2-kpi-footnote .pulsus-v2-tip::before {
  text-transform: none;
  letter-spacing: normal;
}

/* Ajuste de alinhamento dentro dos labels uppercase pra não desalinhar o baseline */
.auto-kpi-label {
  display: inline-flex;
  align-items: center;
}

/* ==========================================================
   Dashboard Pulsus V2 — Bloco 4: Gráficos
   ========================================================== */

.pulsus-v2-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.pulsus-v2-chart-card {
  background: #ffffff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 20px 22px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pulsus-v2-chart-card:hover {
  border-color: var(--border-strong, #d4d4d4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pulsus-v2-chart-title {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Container do canvas: altura fixa pra Chart.js renderizar bem em responsive */
.pulsus-v2-chart-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 280px;
  height: 280px;
}

/* Estado vazio (sem dados no período) */
.pulsus-v2-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--text-muted, #6b7280);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  font-style: italic;
}

/* Responsivo: 1 coluna em viewports estreitos */
@media (max-width: 980px) {
  .pulsus-v2-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   Dashboard Pulsus V2 — Bloco 5+ : Tabelas
   Estilo base reutilizável pelas 4 tabelas (Pilar, Canal, Campanha, Mês).
   ========================================================== */

.pulsus-v2-section-table {
  background: #ffffff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 20px 22px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pulsus-v2-section-table:hover {
  border-color: var(--border-strong, #d4d4d4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pulsus-v2-table-title {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.pulsus-v2-table-wrap {
  width: 100%;
}

.pulsus-v2-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  color: #111827;
}

/* Cabeçalho — fundo neutro, sem bordas duras top/bottom (só inferior fina) */
.pulsus-v2-table-th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: #6b7280;
  background: transparent;
  padding: 11px 12px;
  border-bottom: 1px solid #e5e7eb;
  border-top: none;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  vertical-align: middle;
}
.pulsus-v2-table-th-num {
  text-align: right;
}
.pulsus-v2-table-th .pulsus-v2-tip {
  color: #9ca3af;
}

/* Células com mais respiro vertical */
.pulsus-v2-table-cell {
  padding: 12px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.12s ease;
}
.pulsus-v2-table-cell-label {
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
}
.pulsus-v2-table-cell-num {
  text-align: right;
  color: #374151;
}

/* Hover de linha mais perceptível (cinza levemente mais quente) */
.pulsus-v2-table-row:hover .pulsus-v2-table-cell {
  background: #fafafa;
}

/* Linha de total — separador mais leve (sem borda preta dura),
   fundo discreto, sem hover */
.pulsus-v2-table-row.is-total .pulsus-v2-table-cell {
  font-weight: 700;
  color: #111827;
  background: #fafafa;
  border-top: 1px solid #d4d4d4;
  border-bottom: none;
  padding-top: 14px;
  padding-bottom: 14px;
}
.pulsus-v2-table-row.is-total:hover .pulsus-v2-table-cell {
  background: #fafafa;
}

/* Estado vazio */
.pulsus-v2-table-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-style: italic;
  font-size: 13px;
}

/* Responsivo: scroll horizontal em telas estreitas */
@media (max-width: 768px) {
  .pulsus-v2-table {
    font-size: 12px;
  }
  .pulsus-v2-table-th,
  .pulsus-v2-table-cell {
    padding: 8px 10px;
  }
}

/* ==========================================================
   Dashboard Pulsus V2 — Bloco 6: tabela com %Δ
   ========================================================== */

/* Filosofia do layout com delta:
   Cada "métrica" são DUAS colunas (valor + %Δ) que devem PARECER UMA SÓ.
   Para isso, valor tem padding-right pequeno, %Δ tem padding-left pequeno
   (colados). O espaço maior vem DEPOIS do %Δ, separando os grupos. */

/* Célula numérica em tabela com delta: padding direito reduzido pra
   colar no %Δ logo a seguir. */
.pulsus-v2-section-table-delta .pulsus-v2-table-cell-num,
.pulsus-v2-section-table-delta .pulsus-v2-table-th-num {
  padding-right: 4px;
  text-align: right;
}

/* Coluna %Δ: alinhada à esquerda, padding esquerdo mínimo (cola no número),
   padding direito maior (espaço entre grupos de colunas). */
.pulsus-v2-table-th-delta {
  text-align: left;
  padding-left: 4px;
  padding-right: 20px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}
.pulsus-v2-table-cell-delta {
  text-align: left;
  padding-left: 4px;
  padding-right: 20px;
  font-size: 11px;
  white-space: nowrap;
  vertical-align: middle;
}

/* Última coluna %Δ não precisa do padding-right extra (já está na borda). */
.pulsus-v2-section-table-delta .pulsus-v2-table-cell-delta:last-child,
.pulsus-v2-section-table-delta .pulsus-v2-table-th-delta:last-child {
  padding-right: 12px;
}

/* Coluna do label (Canal) ocupa largura natural, não estica.
   width:1% + white-space:nowrap é o truque clássico pra coluna "encolher
   ao conteúdo" em tabelas com width:100%. */
.pulsus-v2-section-table-delta .pulsus-v2-table-th-label,
.pulsus-v2-section-table-delta .pulsus-v2-table-cell-label {
  width: 1%;
  white-space: nowrap;
  padding-right: 24px;
}

/* Tabela com delta: fonte um pouco menor pra 13 colunas caberem bem */
.pulsus-v2-section-table-delta .pulsus-v2-table {
  font-size: 12px;
}
.pulsus-v2-section-table-delta .pulsus-v2-table-th,
.pulsus-v2-section-table-delta .pulsus-v2-table-cell {
  padding-top: 8px;
  padding-bottom: 8px;
}
.pulsus-v2-section-table-delta .pulsus-v2-table-th {
  font-size: 11px;
}

/* Delta dentro da tabela: alinha verticalmente com o valor, sem o
   box-shadow/background que aparece nos KPI cards (essa é versão tabular).
   Reusa as classes .salvy-delta-up/down/neutral pra cor consistente. */
.pulsus-v2-table-cell-delta .salvy-kpi-delta {
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.pulsus-v2-table-cell-delta .salvy-kpi-delta svg.lucide {
  width: 11px;
  height: 11px;
}

/* ==========================================================
   Dashboard Pulsus V2 — Bloco 7: tabela Campanha
   ========================================================== */

/* Tabela sem delta: nome do label pode quebrar em até 2 linhas se for
   muito longo (campanhas têm nomes tipo google_cap_kw_performance-search-institucional-lp).
   Ellipsis cortaria informação útil; quebra controlada é melhor. */
.pulsus-v2-section-table:not(.pulsus-v2-section-table-delta) .pulsus-v2-table-cell-label {
  white-space: normal;
  word-break: break-word;
  max-width: 380px;
  line-height: 1.35;
}

/* Tabela de Campanha pode ficar alta (30+ linhas). Mantém visual limpo
   nas linhas alternadas pra facilitar a leitura horizontal. */
.pulsus-v2-section-table[data-pulsus-v2-table-id="pulsus-v2-table-campanha"] .pulsus-v2-table-row:nth-child(even) .pulsus-v2-table-cell {
  background: #fafbfc;
}
.pulsus-v2-section-table[data-pulsus-v2-table-id="pulsus-v2-table-campanha"] .pulsus-v2-table-row:nth-child(even):hover .pulsus-v2-table-cell {
  background: #f3f4f6;
}

/* ==========================================================
   Modal: Meu perfil — avatar + nome + email
   ========================================================== */

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0 16px;
}

.profile-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-initials {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: #6b7280;
}

.profile-avatar-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.profile-avatar-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.profile-avatar-upload-label .lucide,
.profile-avatar-upload-label svg.lucide {
  width: 14px;
  height: 14px;
}
.btn-link-danger {
  background: transparent;
  border: none;
  color: #b91c1c;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  text-decoration: none;
}
.btn-link-danger:hover {
  text-decoration: underline;
  color: #7f1d1d;
}
.btn-link-danger .lucide,
.btn-link-danger svg.lucide {
  width: 12px;
  height: 12px;
}
.profile-avatar-hint {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  line-height: 1.4;
}