/* ═══════════════════════════════════════════════════════════════════
   MyLion CRM — Design System v3 (2026-06-25)
   Premium SaaS UI inspirada em Linear / Vercel / Raycast / Attio.
   Princípios:
   - Cor é semântica, não decoração (1 accent + neutros warm)
   - Borda 1px > sombras pesadas
   - Hierarquia via tipografia + opacidade (não cor)
   - Motion como linguagem (tokens consistentes, reduced-motion respeitado)
   - Interatividade descoberta (Cmd+K, atalhos, tooltips com kbd)
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Brand (indigo elétrico) ── */
  --accent:        #6366F1;
  --accent-hover:  #4F46E5;
  --accent-bg:     #EEF2FF;
  --accent-border: #C7D2FE;
  --accent-glow:   rgba(99, 102, 241, 0.15);

  /* ── Status ── */
  --success:    #10B981;
  --success-bg: #D1FAE5;
  --warning:    #F59E0B;
  --warn:       #F59E0B;
  --warn-bg:    #FEF3C7;
  --danger:     #EF4444;
  --danger-bg:  #FEE2E2;
  --info:       #0EA5E9;
  --info-bg:    #E0F2FE;

  /* ── Neutros warm-tinted (não cinza puro do Tailwind) ── */
  --bg:           #FAFAF9;
  --surface:      #FFFFFF;
  --surface-2:    #F5F5F4;
  --surface-3:    #E7E5E4;
  --overlay:      rgba(15, 15, 14, 0.55);

  /* ── Texto (opacidade tier, não cores diferentes) ── */
  --text:         #0A0A09;   /* opacity 1 — primário */
  --text-soft:    rgba(10, 10, 9, 0.92);
  --text-muted:   rgba(10, 10, 9, 0.60);
  --text-faded:   rgba(10, 10, 9, 0.45);

  /* ── Bordas via opacidade (pattern Vercel) ── */
  --border:        rgba(10, 10, 9, 0.08);
  --border-strong: rgba(10, 10, 9, 0.14);
  --border-focus:  #6366F1;

  /* ── Shadows minimal — sombra é elevação real, não decoração ── */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow:     0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg:  0 12px 32px rgba(0, 0, 0, 0.12);

  /* ── Radius ── */
  --radius-sm:  4px;
  --radius:     6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* ── Spacing (4/8 base) ── */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px;

  /* ── Shell ── */
  --sidebar-w:  248px;
  --topbar-h:   64px;

  /* ═══ MOTION TOKENS ═══ */
  --motion-fast:     120ms;  /* hover, focus, micro */
  --motion-base:     180ms;  /* modal, panel, toast */
  --motion-slow:     240ms;  /* page transition, layout */
  --ease-fast:       cubic-bezier(0.2, 0, 0, 1);
  --ease-base:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Bootstrap mapping (já tirei Bootstrap, mas mantém vars caso volte) ── */
  --bs-primary: #6366F1;
  --bs-primary-rgb: 99, 102, 241;
  --bs-body-color: #0A0A09;
  --bs-body-bg: #FAFAF9;
  --bs-border-color: rgba(10, 10, 9, 0.08);
}

/* ═══ TYPOGRAPHY — hierarquia via opacidade + tracking, max peso 600 ═══ */
body, .app {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}
h1, h2, h3, h4, h5 {
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
}
h1 { font-size: 24px; letter-spacing: -0.4px; }
h2 { font-size: 20px; letter-spacing: -0.3px; }
h3 { font-size: 18px; letter-spacing: -0.2px; }
h4 { font-size: 16px; letter-spacing: -0.1px; }

/* Tabular-nums em métricas/tabelas (não negociável pra SaaS) */
.stat-card, .stat-pill, .admgeral-table, .members-table,
[data-tabular], .num, .price, .count {
  font-variant-numeric: tabular-nums;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  background: var(--surface) !important;
  border-right: 1px solid var(--border);
  box-shadow: none;
  padding: 20px 0 24px;
}
.sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  display: flex; align-items: center;
}
.sidebar-brand-mark {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.sidebar-brand-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  margin-right: 10px;
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.sidebar-nav { padding: 0 12px; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted) !important;
  background: transparent !important;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--motion-fast) var(--ease-fast),
              color      var(--motion-fast) var(--ease-fast),
              transform  var(--motion-fast) var(--ease-fast);
}
.nav-item:hover {
  background: var(--surface-2) !important;
  color: var(--text) !important;
}
.nav-item.active {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  font-weight: 600;
}
.nav-item .nav-icon svg { width: 16px; height: 16px; }

/* ═══ TOPBAR ═══ */
.topbar {
  background: var(--surface) !important;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 0 24px !important;
  display: flex; align-items: center; gap: 16px;
}
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.topbar-search input {
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-md) !important;
  padding: 7px 14px 7px 36px !important;
  font-size: 13px !important;
  transition: background var(--motion-fast) var(--ease-fast),
              border-color var(--motion-fast) var(--ease-fast);
}
.topbar-search input:focus {
  background: var(--surface) !important;
  border-color: var(--border-strong) !important;
  box-shadow: none !important;
}

/* ═══ CARDS — borda 1px, hover sutil com translateY ═══ */
.dash-card, .stat-card, .lead-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  transition: border-color var(--motion-fast) var(--ease-fast),
              transform    var(--motion-fast) var(--ease-fast),
              box-shadow   var(--motion-fast) var(--ease-fast);
}
.dash-card:hover, .lead-card:hover {
  border-color: var(--border-strong) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow) !important;
}

/* ═══ BUTTONS — radius pequeno, hover/active responsivo ═══ */
.btn-primary, .modal-btn-primary {
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 500 !important;
  border-radius: var(--radius) !important;
  padding: 8px 14px !important;
  font-size: 14px;
  box-shadow: none !important;
  transition: background var(--motion-fast) var(--ease-fast),
              transform  60ms ease-out;
  cursor: pointer;
}
.btn-primary:hover, .modal-btn-primary:hover {
  background: var(--accent-hover) !important;
}
.btn-primary:active, .modal-btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius) !important;
  padding: 7px 14px !important;
  font-weight: 500;
  transition: background var(--motion-fast) var(--ease-fast),
              transform 60ms ease-out;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--surface-2) !important; }
.btn-secondary:active { transform: scale(0.97); }

/* ═══ INPUTS — focus ring com glow indigo ═══ */
.input-text,
input[type="text"], input[type="email"], input[type="number"],
input[type="password"], input[type="tel"], input[type="url"],
input[type="search"], textarea, select {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  line-height: 1.5 !important;
  transition: border-color var(--motion-fast) var(--ease-fast),
              box-shadow   var(--motion-fast) var(--ease-fast);
}
.input-text:focus, input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px var(--accent-glow) !important;
}
.input-text::placeholder { color: var(--text-faded); }

/* ═══ TABLES ═══ */
.members-table thead th, .admgeral-table thead th {
  background: var(--surface-2) !important;
  color: var(--text-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px !important;
}
.members-table tr:hover td, .admgeral-table tr:hover td {
  background: var(--surface-2);
}

/* ═══ ORG PICKER ═══ */
.org-picker-btn {
  background: var(--surface) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius) !important;
  padding: 7px 12px !important;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--motion-fast) var(--ease-fast);
}
.org-picker-btn:hover { background: var(--surface-2) !important; }
.org-picker-pill {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.org-picker-menu {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  padding: 6px;
}
.org-picker-item {
  transition: background var(--motion-fast) var(--ease-fast),
              color var(--motion-fast) var(--ease-fast);
}
.org-picker-item:hover { background: var(--surface-2); color: var(--text); }
.org-picker-item.active { background: var(--accent-bg); color: var(--accent); }
.org-picker-item.active .org-picker-item-meta { color: var(--accent); opacity: 0.75; }

/* ═══ MODAIS — radius 16px, sombra de elevação real ═══ */
.modal {
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  animation: modal-in var(--motion-base) var(--ease-base);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-head {
  border-bottom: 1px solid var(--border) !important;
  padding: 20px 24px !important;
}
.modal-name {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  letter-spacing: -0.02em;
}
.modal-handle {
  font-size: 13px !important;
  color: var(--text-muted) !important;
  margin-top: 4px;
  line-height: 1.4;
}
.modal-body { padding: 20px 24px !important; }
.modal-actions {
  padding: 16px 24px !important;
  border-top: 1px solid var(--border) !important;
  background: var(--surface-2);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  display: flex; justify-content: flex-end; gap: 8px;
}
.modal-btn {
  border-radius: var(--radius) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  padding: 8px 14px !important;
  transition: background var(--motion-fast) var(--ease-fast), transform 60ms ease-out;
}
.modal-btn:active { transform: scale(0.97); }
.modal-backdrop {
  background: var(--overlay) !important;
  backdrop-filter: blur(2px);
}

/* ═══ EMPTY STATES ═══ */
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  box-shadow: none;
}
.empty-state-text { color: var(--text-muted); font-size: 14px; }

/* ═══ TOASTS — pill escura como Linear ═══ */
.toast {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  background: var(--text) !important;
  color: var(--surface) !important;
  font-weight: 500;
  font-size: 13px;
  padding: 12px 16px !important;
  border: none !important;
  animation: toast-in var(--motion-base) var(--ease-out-expo);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ SCROLLBAR ═══ */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══ SPINNER ═══ */
.spinner { color: var(--accent); }

/* ═══ STAT PILLS no topbar ═══ */
.stat-pill {
  background: var(--surface-2) !important;
  color: var(--text-soft) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-full) !important;
  padding: 4px 12px !important;
  font-size: 12px !important;
  font-weight: 500;
}
.stat-pill strong { color: var(--text); font-weight: 600; }
.stat-pill.accent  { background: var(--accent-bg) !important; color: var(--accent) !important; border-color: var(--accent-border) !important; }
.stat-pill.accent strong { color: var(--accent); }
.stat-pill.success { background: var(--success-bg) !important; color: var(--success) !important; border-color: var(--success-bg) !important; }
.stat-pill.success strong { color: var(--success); }

/* ═══════════════════════════════════════════════════════════════════
   NOVO: SKELETON LOADERS (substitui spinners em listas)
   ═══════════════════════════════════════════════════════════════════ */
.skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    var(--surface-3) 50%,
    var(--surface-2) 100%
  );
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: skeleton-shimmer 1.4s linear infinite;
}
.skeleton.h-10 { height: 10px; }
.skeleton.h-14 { height: 14px; }
.skeleton.h-20 { height: 20px; }
.skeleton.h-40 { height: 40px; }
.skeleton.h-60 { height: 60px; }
.skeleton.w-50 { width: 50%; }
.skeleton.w-75 { width: 75%; }
.skeleton.w-100 { width: 100%; }
.skeleton + .skeleton { margin-top: 8px; }
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   NOVO: COMMAND PALETTE (⌘K) — central pra navegação + ações
   ═══════════════════════════════════════════════════════════════════ */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
  z-index: 1000;
}
.cmdk-backdrop.show {
  display: flex;
  animation: cmdk-bg-in var(--motion-base) var(--ease-base);
}
@keyframes cmdk-bg-in { from { opacity: 0; } to { opacity: 1; } }

.cmdk-panel {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cmdk-panel-in var(--motion-base) var(--ease-out-expo);
}
@keyframes cmdk-panel-in {
  from { opacity: 0; transform: scale(0.98) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.cmdk-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.cmdk-input-icon { color: var(--text-muted); font-size: 14px; }
.cmdk-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  font-size: 16px !important;
  color: var(--text) !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.cmdk-input::placeholder { color: var(--text-faded); }

.cmdk-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}
.cmdk-section {
  padding: 0 8px;
  margin-bottom: 4px;
}
.cmdk-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faded);
  padding: 8px 10px 4px;
  font-weight: 600;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background var(--motion-fast) var(--ease-fast);
}
.cmdk-item:hover, .cmdk-item.cmdk-active {
  background: var(--accent-bg);
  color: var(--accent);
}
.cmdk-item-ic {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cmdk-item.cmdk-active .cmdk-item-ic {
  background: var(--accent);
  color: #fff;
}
.cmdk-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item-sub   { font-size: 11px; color: var(--text-muted); opacity: 0.75; }
.cmdk-item.cmdk-active .cmdk-item-sub { color: var(--accent); }
.cmdk-kbd {
  display: inline-flex; gap: 2px;
  font-size: 11px;
}
.cmdk-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.cmdk-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-muted);
}
.cmdk-footer-hints { display: flex; gap: 14px; }
.cmdk-footer-hint { display: inline-flex; align-items: center; gap: 6px; }

/* ═══ KBD (teclas) ═══ */
kbd, .kbd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-soft);
  min-width: 18px;
  text-align: center;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   NOVO: CHEATSHEET (?) — todos os atalhos numa modal
   ═══════════════════════════════════════════════════════════════════ */
.cheatsheet-backdrop {
  position: fixed; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.cheatsheet-backdrop.show {
  display: flex;
  animation: cmdk-bg-in var(--motion-base) var(--ease-base);
}
.cheatsheet-panel {
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: cmdk-panel-in var(--motion-base) var(--ease-out-expo);
}
.cheatsheet-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.cheatsheet-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.cheatsheet-section {
  margin-bottom: 18px;
}
.cheatsheet-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faded);
  font-weight: 600;
  margin-bottom: 8px;
}
.cheatsheet-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cheatsheet-row:last-child { border-bottom: none; }
.cheatsheet-row-label { color: var(--text); }
.cheatsheet-row-keys { display: flex; gap: 4px; }

/* ═══════════════════════════════════════════════════════════════════
   NOVO: VIEW TRANSITIONS API — fade entre views
   ═══════════════════════════════════════════════════════════════════ */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
  animation-timing-function: var(--ease-base);
}
::view-transition-old(root) {
  animation-name: vt-fade-out;
}
::view-transition-new(root) {
  animation-name: vt-fade-in;
}
@keyframes vt-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}
@keyframes vt-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ BOOTSTRAP RESETS (caso volte) ═══ */
.btn { border-radius: var(--radius); font-family: inherit; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.card { border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: none; background: var(--surface); }
.form-control { border-radius: var(--radius); border-color: var(--border); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }

/* ═══════════════════════════════════════════════════════════════════
   PREFERS-REDUCED-MOTION — respeitar sempre
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton { animation: none; opacity: 0.6; }
}

/* ═══════════════════════════════════════════════════════════════════
   LOGIN SCREEN v2 — split layout premium (form + lado decorativo)
   ═══════════════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0;
  display: flex;                       /* flex em vez de grid pra controle preciso */
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  overflow: hidden;
}
.login-form-side, .login-visual-side {
  flex: 1 1 50%;
  width: 50%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}
@media (max-width: 900px) {
  .login-screen { flex-direction: column; }
  .login-form-side, .login-visual-side { width: 100%; flex: 1 1 50%; height: 50vh; }
  .login-visual-side { display: none !important; }
  .login-form-side { height: 100vh; }
}
.login-box { display: none !important; }

.login-form-side {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 24px;
}
.login-form-card {
  width: 100%;
  max-width: 360px;
  animation: cmdk-panel-in var(--motion-slow) var(--ease-out-expo);
}
.login-brand-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 40px;
}
.login-brand-dot-v2 {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.login-brand-mark-v2 {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.login-hero-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 8px;
}
.login-hero-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 28px;
}
.login-field { margin-bottom: 14px; }
.login-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.login-input {
  width: 100%;
  padding: 10px 14px !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  font-size: 14px !important;
  background: var(--surface) !important;
}
.login-input:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px var(--accent-glow) !important;
}
.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 11px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--motion-fast) var(--ease-fast), transform 60ms ease-out;
}
.login-btn:hover { background: var(--accent-hover); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.5; cursor: wait; }
.login-error {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 13px;
}
.login-error.show { display: block; }
.login-foot {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-faded);
  text-align: center;
}

/* ═══ LADO DIREITO VISUAL — <img> edge-to-edge + conteúdo centralizado ═══ */
.login-visual-side {
  /* Fallback gradient bonito caso a imagem falhe em carregar */
  background: linear-gradient(135deg, #1E1B4B 0%, #4338CA 50%, #6366F1 100%);
  color: #fff;
  display: flex;
  align-items: center;       /* CENTRO VERTICAL */
  justify-content: center;   /* CENTRO HORIZONTAL */
  padding: 0;
  margin: 0;
  overflow: hidden;
}
.login-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  display: block;
}
.login-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(15, 12, 41, 0.55) 0%,
    rgba(30, 27, 75, 0.65) 50%,
    rgba(15, 12, 41, 0.80) 100%);
  z-index: 1;
}
.login-visual-glow,
.login-visual-badge,
.login-visual-image { display: none !important; }
.login-visual-content {
  position: relative;
  z-index: 2;
  padding: 48px;
  max-width: 480px;
  width: 100%;
  text-align: center;        /* CENTRO HORIZONTAL DO TEXTO */
}
.login-visual-headline {
  font-size: 44px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 32px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.login-visual-quote {
  position: relative;
  padding: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: left;          /* quote em si fica left-aligned (mais legível) */
}
.login-visual-quote-mark {
  position: absolute;
  top: -8px; left: 16px;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.4;
}
.login-visual-quote p {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR v3 — seções nomeadas + user card no rodapé
   ═══════════════════════════════════════════════════════════════════ */
.app.show {
  display: grid !important;
  grid-template-rows: 1fr !important;
}
.sidebar {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 16px;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faded);
  padding: 16px 14px 6px;
  user-select: none;
}
.sidebar-section-label:first-of-type { padding-top: 4px; }

.sidebar-foot {
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-fast);
}
.sidebar-user:hover { background: var(--surface-2); }
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-text { flex: 1; min-width: 0; text-align: left; }
.sidebar-user-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px; color: var(--text-muted);
  text-transform: capitalize;
}
.sidebar-cmdk-hint {
  width: 100%;
  margin-top: 8px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--motion-fast) var(--ease-fast);
}
.sidebar-cmdk-hint:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
  border-style: solid;
}
.sidebar-cmdk-hint .cmdk-kbd { display: inline-flex; gap: 2px; }


/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATES com personalidade — usar via emptyState() helper
   ═══════════════════════════════════════════════════════════════════ */
.empty-state-v2 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 56px 32px;
  text-align: center;
  max-width: 480px;
  margin: 40px auto;
}
.empty-state-v2-icon {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.empty-state-v2-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 8px;
}
.empty-state-v2-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 auto 24px;
  max-width: 320px;
}
.empty-state-v2-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-fast), transform 60ms ease-out;
}
.empty-state-v2-cta:hover { background: var(--accent-hover); }
.empty-state-v2-cta:active { transform: scale(0.97); }
.empty-state-v2-cta-secondary {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.empty-state-v2-cta-secondary kbd { vertical-align: middle; }

/* ═══════════════════════════════════════════════════════════════════
   TOPBAR refinada — agrupamento direita, search com hint Cmd+K
   ═══════════════════════════════════════════════════════════════════ */
.topbar-search {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.topbar-search::after {
  content: '⌘K';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faded);
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  pointer-events: none;
  font-family: ui-monospace, monospace;
}
.topbar-search input { padding-right: 50px !important; }

/* Workspace/org picker no topbar — mais proeminente */
.org-picker-btn {
  padding: 8px 14px !important;
}
.org-picker-pill {
  background: linear-gradient(135deg, var(--accent) 0%, #8B5CF6 100%);
  color: #fff;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════
   GESTOR ADMINISTRATIVO — tela separada
   ═══════════════════════════════════════════════════════════════════ */
.topbar-admgeral-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: #fff !important;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
  transition: transform 60ms ease-out, box-shadow var(--motion-fast) var(--ease-fast);
}
.topbar-admgeral-btn:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.topbar-admgeral-btn:active { transform: scale(0.97); }

.admgeral-back-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.admgeral-mode-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admgeral-mode-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

/* Quando estiver na view admgeral, esconde a sidebar (tela cheia "gestor") */
.app:has(.view[data-view="admgeral"].active) .sidebar { display: none !important; }
.app:has(.view[data-view="admgeral"].active) { grid-template-columns: 1fr !important; }
.app:has(.view[data-view="admgeral"].active) .topbar-admgeral-btn {
  background: var(--surface);
  color: var(--text) !important;
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════
   FIELD HINTS
   ═══════════════════════════════════════════════════════════════════ */
.field-block-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════
   AI SCORE CARD (no lead modal) — análise IA do quiz
   ═══════════════════════════════════════════════════════════════════ */
.ai-score-card {
  background: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 100%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.ai-score-empty {
  display: flex; align-items: center; gap: 14px;
}
.ai-score-empty-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent) 0%, #8B5CF6 100%);
  color: #fff;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ai-score-empty-title { font-size: 14px; font-weight: 600; color: var(--text); }
.ai-score-empty-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ai-score-empty > div { flex: 1; }
.ai-score-empty .btn-primary { flex-shrink: 0; }

.ai-score-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.ai-score-result { display: flex; flex-direction: column; gap: 12px; }
.ai-score-num-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.ai-score-num {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ai-score-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.ai-score-bar-fill {
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 700ms var(--ease-out-expo);
}
.ai-score-bar-fill.tier-quente { background: linear-gradient(90deg, #10B981 0%, #34D399 100%); }
.ai-score-bar-fill.tier-morno  { background: linear-gradient(90deg, #F59E0B 0%, #FBBF24 100%); }
.ai-score-bar-fill.tier-frio   { background: linear-gradient(90deg, #6366F1 0%, #818CF8 100%); }

.ai-score-tier {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.ai-score-tier.tier-quente { background: #D1FAE5; color: #047857; border-color: #6EE7B7; }
.ai-score-tier.tier-morno  { background: #FEF3C7; color: #92400E; border-color: #FCD34D; }
.ai-score-tier.tier-frio   { background: #E0E7FF; color: #3730A3; border-color: #A5B4FC; }

.ai-score-reasoning {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.ai-score-action {
  font-size: 13px;
  color: var(--text);
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--accent-border);
  font-weight: 500;
  display: flex; align-items: flex-start; gap: 8px;
}
.ai-score-action-icon { color: var(--accent); font-weight: 700; }
.ai-score-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
  color: var(--text-faded);
}
.ai-score-regen {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-fast);
}
.ai-score-regen:hover { background: var(--surface-2); color: var(--accent); border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════
   QUIZ ANSWERS — pares pergunta/resposta no lead modal
   ═══════════════════════════════════════════════════════════════════ */
.quiz-answers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.quiz-answer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.quiz-answer-q {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.quiz-answer-a {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════
   METRIC CARDS — overrides + bento (1º card maior)
   ═══════════════════════════════════════════════════════════════════ */
.metric-grid {
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  gap: 12px !important;
}
@media (max-width: 1200px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
.metric-card {
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  border: 1px solid var(--border) !important;
  transition: transform var(--motion-fast) var(--ease-fast),
              border-color var(--motion-fast) var(--ease-fast),
              box-shadow var(--motion-fast) var(--ease-fast);
}
.metric-card:hover {
  transform: translateY(-2px) !important;
  border-color: var(--border-strong) !important;
  box-shadow: var(--shadow) !important;
}
.metric-card::before { height: 2px !important; opacity: 0.7; }
.metric-value {
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 32px !important;
  letter-spacing: -0.03em !important;
  font-variant-numeric: tabular-nums !important;
}
/* 1º card (Total leads) = hero, fonte maior */
.metric-grid > .metric-card:first-child .metric-value {
  font-size: 56px !important;
  line-height: 1 !important;
}
.metric-grid > .metric-card:first-child {
  padding: 24px !important;
}

/* ═══════════════════════════════════════════════════════════════════
   DARK MODE — tokens via [data-theme="dark"]
   ═══════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg:           #0A0A09;
  --surface:      #14140F;
  --surface-2:    #1F1E1A;
  --surface-3:    #2A2925;
  --overlay:      rgba(0, 0, 0, 0.7);

  --text:         #F5F5F4;
  --text-soft:    rgba(245, 245, 244, 0.92);
  --text-muted:   rgba(245, 245, 244, 0.60);
  --text-faded:   rgba(245, 245, 244, 0.40);

  --border:        rgba(245, 245, 244, 0.08);
  --border-strong: rgba(245, 245, 244, 0.16);

  --accent:        #818CF8;
  --accent-hover:  #A5B4FC;
  --accent-bg:     rgba(129, 140, 248, 0.12);
  --accent-border: rgba(129, 140, 248, 0.30);
  --accent-glow:   rgba(129, 140, 248, 0.25);

  --success-bg: rgba(16, 185, 129, 0.15);
  --warn-bg:    rgba(245, 158, 11, 0.15);
  --danger-bg:  rgba(239, 68, 68, 0.15);
  --info-bg:    rgba(14, 165, 233, 0.15);

  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow:     0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:  0 12px 32px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .ai-score-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.10) 0%, rgba(139, 92, 246, 0.10) 100%);
  border-color: rgba(129, 140, 248, 0.20);
}
[data-theme="dark"] .ai-score-tier.tier-quente { background: rgba(16, 185, 129, 0.15); color: #6EE7B7; border-color: rgba(16, 185, 129, 0.3); }
[data-theme="dark"] .ai-score-tier.tier-morno  { background: rgba(245, 158, 11, 0.15); color: #FCD34D; border-color: rgba(245, 158, 11, 0.3); }
[data-theme="dark"] .ai-score-tier.tier-frio   { background: rgba(99, 102, 241, 0.15); color: #A5B4FC; border-color: rgba(99, 102, 241, 0.3); }
[data-theme="dark"] .login-visual-side { background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4338CA 100%); }

/* Topbar theme toggle */
.topbar-theme-toggle {
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-soft);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--motion-fast) var(--ease-fast);
}
.topbar-theme-toggle:hover { background: var(--surface-3); color: var(--text); }
.topbar-theme-toggle .theme-icon-moon { display: none; }
[data-theme="dark"] .topbar-theme-toggle .theme-icon-sun  { display: none; }
[data-theme="dark"] .topbar-theme-toggle .theme-icon-moon { display: block; }

/* ═══════════════════════════════════════════════════════════════════
   LEAD DETAIL como SIDE-PANEL (slide-in da direita, Linear-style)
   ═══════════════════════════════════════════════════════════════════ */
.modal-side-backdrop {
  align-items: stretch !important;
  justify-content: flex-end !important;
  padding: 0 !important;
}
.modal.modal-side {
  width: 100%;
  max-width: 580px;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0 !important;
  border-left: 1px solid var(--border) !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  display: flex;
  flex-direction: column;
  animation: side-panel-in var(--motion-base) var(--ease-out-expo);
}
@keyframes side-panel-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.modal-side .modal-body {
  flex: 1;
  overflow-y: auto;
}
.modal-side .modal-actions {
  flex-shrink: 0;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .modal.modal-side { max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════
   BULK ACTION BAR (flutuante no rodapé, aparece em seleção múltipla)
   ═══════════════════════════════════════════════════════════════════ */
.bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: 800;
  animation: bulk-bar-in var(--motion-base) var(--ease-out-expo);
  font-size: 13px;
}
@keyframes bulk-bar-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.bulk-bar-count {
  font-weight: 600;
  padding-right: 12px;
  border-right: 1px solid rgba(255,255,255,0.2);
}
.bulk-bar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.1);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-fast);
}
.bulk-bar-btn:hover { background: rgba(255,255,255,0.2); }
.bulk-bar-btn.danger:hover { background: var(--danger); }
.bulk-bar-hint {
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.2);
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}
.bulk-bar-hint kbd {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 10px;
}

/* Card selecionado */
[data-lead-id].bulk-selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: var(--accent-bg) !important;
}
[data-lead-id].bulk-cursor:not(.bulk-selected) {
  outline: 2px dashed var(--border-strong);
  outline-offset: 1px;
}

/* ═══════════════════════════════════════════════════════════════════
   SKELETON CARD no kanban
   ═══════════════════════════════════════════════════════════════════ */
.skeleton-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  padding: 12px !important;
  margin-bottom: 8px !important;
  display: flex; flex-direction: column; gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   STAGGER REVEAL — listas entram em cascata (max 8 items)
   ═══════════════════════════════════════════════════════════════════ */
@keyframes stagger-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.column-body > .card,
.vendors-list > .vendor-row,
.leaderboard > *,
.admgeral-table tbody > tr,
.members-table tbody > tr,
.tasks-list > *,
.cmdk-item {
  animation: stagger-in 240ms var(--ease-out-expo) both;
}
/* delays graduais — só pros 8 primeiros pra evitar lista longa "rolando" */
.column-body > .card:nth-child(1),
.vendors-list > :nth-child(1),
.leaderboard > :nth-child(1),
.cmdk-item:nth-child(1)              { animation-delay: 0ms; }
.column-body > .card:nth-child(2),
.vendors-list > :nth-child(2),
.leaderboard > :nth-child(2),
.cmdk-item:nth-child(2)              { animation-delay: 25ms; }
.column-body > .card:nth-child(3),
.vendors-list > :nth-child(3),
.leaderboard > :nth-child(3),
.cmdk-item:nth-child(3)              { animation-delay: 50ms; }
.column-body > .card:nth-child(4),
.vendors-list > :nth-child(4),
.leaderboard > :nth-child(4),
.cmdk-item:nth-child(4)              { animation-delay: 75ms; }
.column-body > .card:nth-child(5),
.vendors-list > :nth-child(5),
.leaderboard > :nth-child(5),
.cmdk-item:nth-child(5)              { animation-delay: 100ms; }
.column-body > .card:nth-child(6),
.vendors-list > :nth-child(6),
.leaderboard > :nth-child(6),
.cmdk-item:nth-child(6)              { animation-delay: 125ms; }
.column-body > .card:nth-child(7),
.vendors-list > :nth-child(7),
.leaderboard > :nth-child(7),
.cmdk-item:nth-child(7)              { animation-delay: 150ms; }
.column-body > .card:nth-child(n+8) { animation-delay: 175ms; }

/* ═══════════════════════════════════════════════════════════════════
   CONFETTI quando lead vira VENDIDA 🎉
   ═══════════════════════════════════════════════════════════════════ */
.confetti-wrap {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px; height: 14px;
  opacity: 0.9;
  animation: confetti-fall var(--dur, 2200ms) cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
@keyframes confetti-fall {
  to {
    transform: translate3d(var(--dx, 0), 110vh, 0) rotate(var(--rot, 720deg));
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   PROJECT IMAGE (sidebar topo) + Project picker com thumbnail
   ═══════════════════════════════════════════════════════════════════ */
/* Layout horizontal compacto: imagem 88px à esquerda + nome/meta à direita */
.project-image-wrap {
  padding: 0 12px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.project-image-box {
  position: relative;
  width: 88px; height: 88px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border);
  /* Anel sutil na cor do projeto (passada como --proj-color inline) */
  box-shadow: 0 0 0 0 var(--proj-color, var(--accent));
  transition: all var(--motion-fast) var(--ease-fast);
}
.project-image-box:hover {
  border-color: var(--proj-color, var(--accent));
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.project-image-box.readonly { cursor: default; }
.project-image-box.readonly:hover { transform: none; box-shadow: none; border-color: var(--border); }
.project-image-box img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.project-image-placeholder {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
/* Camera icon sobreposto no hover (admin) */
.project-image-edit-hint {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 18px;
  opacity: 0;
  transition: opacity var(--motion-fast) var(--ease-fast);
  backdrop-filter: blur(2px);
}
.project-image-box:hover:not(.readonly) .project-image-edit-hint { opacity: 1; }

/* Info à direita: nome + meta (cor, "trocar") */
.project-image-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-image-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-image-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.project-image-meta-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--proj-color, var(--accent));
  box-shadow: 0 0 0 2px var(--surface);
}

/* Project menu items com thumbnail (quando tem image_url) */
.project-menu-item .project-menu-thumb {
  width: 24px; height: 24px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   SHELL DESTACADO — sidebar + topbar com mais peso visual
   - Canvas (main content bg) mais escuro pra surfaces ressaltarem
   - Sombras crisp 1px sob topbar + à direita do sidebar
   - Nav items com mais presença (15px, padding maior)
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --bg: #EEEDEB;          /* canvas mais escuro pra contraste com surface branca */
}
[data-theme="dark"] {
  --bg: #050505;
}

/* MAIN CONTENT pega o novo bg via .main */
.main { background: var(--bg); }

/* SIDEBAR — sombra crisp à direita pra "flutuar" */
.sidebar {
  box-shadow:
    1px 0 0 var(--border),
    4px 0 12px rgba(0, 0, 0, 0.04) !important;
  z-index: 10;
  position: relative;
}
[data-theme="dark"] .sidebar {
  box-shadow:
    1px 0 0 var(--border),
    4px 0 12px rgba(0, 0, 0, 0.3) !important;
}

/* TOPBAR — sombra crisp embaixo */
.topbar {
  box-shadow:
    0 1px 0 var(--border),
    0 4px 12px rgba(0, 0, 0, 0.03) !important;
  z-index: 5;
  position: relative;
}
[data-theme="dark"] .topbar {
  box-shadow:
    0 1px 0 var(--border),
    0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* NAV ITEMS — mais presença */
.nav-item {
  padding: 9px 12px !important;
  font-size: 14.5px !important;
  font-weight: 500 !important;
  border-radius: 7px !important;
}
.nav-item .nav-icon svg { width: 17px !important; height: 17px !important; }
.nav-item.active {
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.10);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-item { position: relative; }

/* Section labels mais discretas mas legíveis */
.sidebar-section-label {
  font-size: 11px !important;
  padding: 18px 14px 4px !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  opacity: 0.55;
}

/* TOPBAR title maior e mais bold */
.topbar-title {
  font-size: 17px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

/* Brand do sidebar maior */
.sidebar-brand-mark {
  font-size: 17px !important;
  font-weight: 700 !important;
}
.sidebar-brand-dot {
  width: 9px !important;
  height: 9px !important;
}

/* (Bloco antigo do login-visual movido pra cima — definição unificada lá) */

/* ═══════════════════════════════════════════════════════════════════
   DESTINATION PICKER (pós-login: CRM vs Gestor)
   ═══════════════════════════════════════════════════════════════════ */
.destination-picker {
  position: fixed; inset: 0;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 9000;
}
.destination-picker.show { display: flex; animation: cmdk-bg-in var(--motion-base) var(--ease-base); }
.destination-picker-inner {
  width: 100%;
  max-width: 760px;
  text-align: center;
  animation: cmdk-panel-in var(--motion-slow) var(--ease-out-expo);
}
.destination-picker-brand {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 32px;
}
.destination-picker-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  color: var(--text);
}
.destination-picker-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 40px;
}
.destination-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .destination-grid { grid-template-columns: 1fr; }
}
.destination-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  text-align: left;
  cursor: pointer;
  transition: all var(--motion-base) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}
.destination-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--motion-base) var(--ease-out-expo);
}
.destination-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.destination-card:hover::before { transform: scaleX(1); }
.destination-card-icon {
  width: 48px; height: 48px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.destination-card-gestor::before { background: linear-gradient(90deg, var(--accent) 0%, #8B5CF6 100%); }
.destination-card-gestor .destination-card-icon {
  background: linear-gradient(135deg, var(--accent) 0%, #8B5CF6 100%);
  color: #fff;
}
.destination-card-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}
.destination-card-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}
.destination-card-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════
   PROJECT PICKER v2 — cards ricos com imagem + meta
   ═══════════════════════════════════════════════════════════════════ */
.project-picker {
  position: fixed; inset: 0;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 8900;
  overflow-y: auto;
}
.project-picker.show { display: flex; animation: cmdk-bg-in var(--motion-base) var(--ease-base); }
.project-picker-box-v2 {
  width: 100%;
  max-width: 900px;
  text-align: center;
  animation: cmdk-panel-in var(--motion-slow) var(--ease-out-expo);
  padding: 24px 0;
}
.project-picker-list-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
  text-align: left;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--motion-base) var(--ease-out-expo);
  display: flex;
  flex-direction: column;
  position: relative;
}
.project-card:hover {
  border-color: var(--proj-color, var(--accent));
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.project-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.project-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease-out-expo);
}
.project-card:hover .project-card-image img { transform: scale(1.04); }
.project-card-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  font-weight: 700;
  color: var(--text-faded);
  text-transform: uppercase;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--proj-color, var(--accent)) 0%, transparent 100%);
}
.project-card-image-placeholder span {
  background: rgba(255,255,255,0.5);
  width: 80px; height: 80px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--proj-color, var(--accent));
}
.project-card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project-card-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card-stats {
  display: flex; gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.project-card-stat {
  display: flex; flex-direction: column;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.project-card-stat-num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.project-card-cta {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--proj-color, var(--accent));
  display: inline-flex; align-items: center; gap: 6px;
  opacity: 0;
  transition: opacity var(--motion-fast) var(--ease-fast);
}
.project-card:hover .project-card-cta { opacity: 1; }
.project-card-color-bar {
  height: 4px;
  background: var(--proj-color, var(--accent));
}

.project-picker-back {
  margin-top: 24px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: background var(--motion-fast) var(--ease-fast), color var(--motion-fast) var(--ease-fast);
}
.project-picker-back:hover { background: var(--surface-2); color: var(--text); }

/* Esconde o picker antigo box */
.project-picker-box { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   ADM GERAL v2 — layout com nav lateral + sub-seções
   ═══════════════════════════════════════════════════════════════════ */
.app:has(.view[data-view="admgeral"].active) .admgeral-wrap { display: none !important; }

.admgeral-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  background: var(--bg);
}
@media (max-width: 800px) { .admgeral-layout { grid-template-columns: 1fr; } .admgeral-nav { display: none; } }

.admgeral-nav {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex; flex-direction: column;
  gap: 4px;
  box-shadow: 1px 0 12px rgba(0,0,0,0.03);
}
.admgeral-nav-brand {
  padding: 0 4px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.admgeral-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--motion-fast) var(--ease-fast), color var(--motion-fast) var(--ease-fast);
}
.admgeral-nav-item:hover:not([disabled]) { background: var(--surface-2); color: var(--text); }
.admgeral-nav-item.active {
  background: linear-gradient(135deg, var(--accent) 0%, #8B5CF6 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.admgeral-nav-item[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.admgeral-nav-item span:not(.admgeral-soon):not(.admgeral-nav-badge) { flex: 1; }
.admgeral-nav-badge {
  font-size: 11px;
  background: rgba(0,0,0,0.08);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}
.admgeral-nav-item.active .admgeral-nav-badge { background: rgba(255,255,255,0.25); color: #fff; }
.admgeral-soon {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.admgeral-nav-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.admgeral-content {
  overflow-y: auto;
  padding: 32px 40px;
}
.admgeral-section { display: none; }
.admgeral-section.active { display: block; animation: vt-fade-in 240ms var(--ease-out-expo); }

.admgeral-head-actions {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.admgeral-view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.adm-view-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--motion-fast) var(--ease-fast);
}
.adm-view-btn:hover { background: var(--surface-2); color: var(--text); }
.adm-view-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ═══ CARDS dos orgs (vista card) ═══ */
.admgeral-list.view-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.admgeral-list.view-cards .admgeral-table { display: none; }
.admgeral-list.view-list .admgeral-cards { display: none; }

.org-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 12px;
  transition: all var(--motion-fast) var(--ease-fast);
  position: relative;
}
.org-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.org-card-head {
  display: flex; align-items: center; justify-content: space-between;
}
.org-card-status {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 9999px;
}
.org-card-status.active    { background: var(--success-bg); color: var(--success); }
.org-card-status.suspended { background: var(--danger-bg);  color: var(--danger); }
.org-card-name {
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.org-card-meta {
  font-size: 12px; color: var(--text-muted);
}
.org-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.org-card-stat {
  display: flex; flex-direction: column;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.org-card-stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.org-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.org-card-actions .org-action-btn {
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background var(--motion-fast) var(--ease-fast);
}
.org-card-actions .org-action-btn:hover { background: var(--accent-bg); color: var(--accent); }
.org-card-actions .org-action-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.org-card-actions .org-action-btn.full { grid-column: 1 / -1; }

/* ═══ LISTA de projetos no modal ═══ */
.org-projects-list {
  display: flex; flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}
.org-projects-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.org-projects-row-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--surface-3);
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.org-projects-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.org-projects-row-info { flex: 1; }
.org-projects-row-name { font-weight: 600; color: var(--text); }
.org-projects-row-meta { font-size: 12px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════
   MODO GESTOR: esconde topbar do CRM, mostra topbar dedicada
   ═══════════════════════════════════════════════════════════════════ */
/* Quando admgeral está ativa, esconde a topbar normal e a toolbar do CRM */
.app:has(.view[data-view="admgeral"].active) > .main > .topbar,
.app:has(.view[data-view="admgeral"].active) > .main > .toolbar {
  display: none !important;
}
/* main pega altura total quando admgeral, sem espaço pra topbar */
.app:has(.view[data-view="admgeral"].active) > .main {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.app:has(.view[data-view="admgeral"].active) .view[data-view="admgeral"] {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
}

/* Layout do admgeral muda pra deixar topbar em cima da nav */
.admgeral-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* TOPBAR DEDICADA do modo Gestor */
.admgeral-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), 0 4px 12px rgba(0,0,0,0.03);
  flex-shrink: 0;
}
.admgeral-topbar-brand {
  display: flex; align-items: center; gap: 10px;
}
.admgeral-topbar-actions {
  display: flex; align-items: center; gap: 10px;
}
.admgeral-topbar #btn-back-to-crm-top {
  background: linear-gradient(135deg, var(--accent) 0%, #8B5CF6 100%) !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   UPLOADER DE IMAGEM nos modais (cliente)
   ═══════════════════════════════════════════════════════════════════ */
.org-image-uploader {
  display: flex; align-items: center; gap: 14px;
}
.org-image-preview {
  width: 72px; height: 72px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 28px;
  color: var(--text-muted);
  position: relative;
}
.org-image-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════════════════════════════════════════════════════════════
   ORG CARD com IMAGEM
   ═══════════════════════════════════════════════════════════════════ */
.org-card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: -4px;
}
.org-card-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease-out-expo);
}
.org-card:hover .org-card-image-wrap img { transform: scale(1.04); }
.org-card-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  background: linear-gradient(135deg, var(--accent) 0%, #8B5CF6 100%);
  letter-spacing: -0.04em;
}

/* Org row (lista) com thumb */
.admgeral-table tbody tr td:first-child .admgeral-row-thumb {
  width: 32px; height: 32px;
  border-radius: 7px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════
   TOPBAR — user button compacto (só avatar + chevron)
   ═══════════════════════════════════════════════════════════════════ */
.topbar-user {
  padding: 4px 8px !important;
  gap: 6px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius) !important;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-fast);
}
.topbar-user:hover { background: var(--surface-2) !important; }
.topbar-user-text { display: none !important; }   /* esconde nome+role do botão (estão no dropdown) */
.topbar-user-name-hidden,
.topbar-user-role-hidden { display: none !important; }
.topbar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
}
.topbar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-user-chevron { width: 12px; height: 12px; color: var(--text-muted); }

/* Esconde o botão antigo do gestor (foi pro dropdown) */
.topbar-admgeral-btn { display: none !important; }

/* Pills de role no list de usuários */
.user-role-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.user-role-pill.admin  { background: var(--accent-bg);  color: var(--accent); }
.user-role-pill.seller { background: var(--success-bg); color: var(--success); }
