/* ============================================
   VORTEX CRM — DESIGN SYSTEM v3
   Brand: Indigo #6366F1 · Neo-Minimal SaaS
   Font: Inter (Google Fonts)
   Skill: UI/UX Pro Max v2.5 (nextlevelbuilder)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ══ CSS VARIABLES ══════════════════════════════ */
:root {
  --brand-50:  #EEF2FF; --brand-100: #E0E7FF; --brand-200: #C7D2FE;
  --brand-300: #A5B4FC; --brand-400: #818CF8; --brand-500: #6366F1;
  --brand-600: #4F46E5; --brand-700: #4338CA; --brand-800: #3730A3; --brand-900: #312E81;
  --brand-neon: #818CF8;
  --brand-glow: rgba(99,102,241,0.35);

  --bg-base:    #F8F8F8;
  --bg-surface: #FFFFFF;
  --bg-card:    #FFFFFF;
  --bg-glass:   rgba(255,255,255,0.75);
  --bg-glass2:  rgba(248,248,248,0.88);

  --border-subtle: #E5E7EB;
  --border-medium: #D1D5DB;
  --border-glass:  #E5E7EB;

  --text-primary:   #111827;
  --text-secondary: #374151;
  --text-muted:     #9CA3AF;
  --text-inverse:   #FFFFFF;

  --success: #10B981;
  --warning: #F59E0B;
  --danger:  #EF4444;
  --info:    #6366F1;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl:   0 16px 48px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.05);
  --shadow-glow: 0 0 24px rgba(99,102,241,0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --sidebar-w:     260px;
  --sidebar-w-col: 68px;
  --topbar-h:      60px;

  --t-fast: 150ms cubic-bezier(.4,0,.2,1);
  --t-base: 200ms cubic-bezier(.4,0,.2,1);
  --t-slow: 300ms cubic-bezier(.4,0,.2,1);

  --grad-brand:  linear-gradient(135deg, #6366F1 0%, #818CF8 50%, #4F46E5 100%);
  --grad-card:   linear-gradient(145deg, rgba(255,255,255,0.97) 0%, rgba(238,242,255,0.85) 100%);
  --grad-sidebar: linear-gradient(180deg, #F5F5F5 0%, #F5F5F5 100%);
  --sidebar-bdr: rgba(0,0,0,0.07);

  --sb-text:          #4B5563;
  --sb-text-primary:  #111827;
  --sb-text-muted:    rgba(75,85,99,0.55);
  --sb-text-label:    rgba(99,102,241,0.55);
  --sb-text-active:   var(--brand-600);
  --sb-divider:       rgba(99,102,241,0.09);
  --sb-item-hover-bg: rgba(99,102,241,0.07);
  --sb-item-hover-fg: #111827;
  --sb-item-active-bg: rgba(99,102,241,0.12);
  --sb-btn-bg:        rgba(99,102,241,0.07);
  --sb-btn-border:    rgba(99,102,241,0.15);
  --sb-btn-color:     rgba(99,102,241,0.5);
  --sb-btn-hover-bg:  rgba(99,102,241,0.14);
  --sb-btn-hover-fg:  var(--brand-600);
  --sb-sub-text:      rgba(75,85,99,0.6);
  --sb-sub-dot:       rgba(99,102,241,0.25);
  --sb-sub-hover-bg:  rgba(99,102,241,0.06);
  --sb-sub-hover-fg:  #111827;
  --sb-sub-active:    var(--brand-600);
  --sb-sub-active-dot: var(--brand-500);
  --sb-arrow:         rgba(75,85,99,0.35);
}

/* ══ DARK MODE ══════════════════════════════════ */
[data-theme="dark"] {
  --bg-base:    #0C0C14;
  --bg-surface: #13131F;
  --bg-card:    rgba(20,20,32,0.95);
  --bg-glass:   rgba(20,20,32,0.80);
  --bg-glass2:  rgba(15,15,25,0.65);
  --border-subtle: rgba(99,102,241,0.12);
  --border-medium: rgba(99,102,241,0.22);
  --border-glass:  rgba(99,102,241,0.14);
  --text-primary:   #F3F4F6;
  --text-secondary: #D1D5DB;
  --text-muted:     #6B7280;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.45);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.55);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.65);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.75);
  --grad-card: linear-gradient(145deg, rgba(20,20,32,0.97) 0%, rgba(12,12,20,0.92) 100%);
  --grad-sidebar: linear-gradient(180deg, #0D0D1A 0%, #080810 100%);
  --sidebar-bdr: rgba(99,102,241,0.08);

  --sb-text:          rgba(255,255,255,0.55);
  --sb-text-primary:  #fff;
  --sb-text-muted:    rgba(255,255,255,0.38);
  --sb-text-label:    rgba(255,255,255,0.25);
  --sb-text-active:   #fff;
  --sb-divider:       rgba(255,255,255,0.06);
  --sb-item-hover-bg: rgba(255,255,255,0.07);
  --sb-item-hover-fg: rgba(255,255,255,0.9);
  --sb-item-active-bg: rgba(99,102,241,0.18);
  --sb-btn-bg:        rgba(255,255,255,0.06);
  --sb-btn-border:    rgba(255,255,255,0.09);
  --sb-btn-color:     rgba(255,255,255,0.45);
  --sb-btn-hover-bg:  rgba(255,255,255,0.13);
  --sb-btn-hover-fg:  #fff;
  --sb-sub-text:      rgba(255,255,255,0.45);
  --sb-sub-dot:       rgba(255,255,255,0.18);
  --sb-sub-hover-bg:  rgba(255,255,255,0.06);
  --sb-sub-hover-fg:  rgba(255,255,255,0.85);
  --sb-sub-active:    var(--brand-300);
  --sb-sub-active-dot: var(--brand-400);
  --sb-arrow:         rgba(255,255,255,0.3);
}

/* ══ RESET ══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base); color: var(--text-primary);
  min-height: 100vh; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--t-slow), color var(--t-slow);
}
* { font-family: 'Inter', system-ui, -apple-system, sans-serif; }

/* ══ SCROLLBAR ══════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brand-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-500); }

/* ══ FOCUS RING — WCAG 2.1 AA ═══════════════════ */
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

/* ══ REDUCED MOTION ═════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══ TYPOGRAPHY ═════════════════════════════════ */
h1 { font-size: 1.875rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.03em; }
h2 { font-size: 1.375rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; }
h4 { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; }
p  { font-size: 0.9rem; line-height: 1.65; color: var(--text-secondary); }
a  { color: var(--brand-500); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-400); }
/* Tabular numbers for all financial/metric data */
.stat-value, .commission-earn, .lead-value-highlight,
.kanban-card-value, .font-tabular { font-variant-numeric: tabular-nums; }

/* ══ BG GLOW ════════════════════════════════════ */
.bg-glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-glow::before {
  content: ''; position: absolute; top: -15%; right: 5%;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
}
.bg-glow::after {
  content: ''; position: absolute; bottom: 0; left: 8%;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(129,140,248,0.04) 0%, transparent 70%);
}

/* ══ GLASS PRIMITIVES ═══════════════════════════ */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-md); border-radius: var(--radius-md);
}
/* Shadow-only hover lift — no translateY (prevents CLS) */
.glass-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm); border-radius: var(--radius-md);
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.glass-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-medium); }

/* ══════════════════════════════════════════════
   SIDEBAR — ALWAYS DARK
══════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--grad-sidebar);
  border-right: 1px solid var(--sidebar-bdr);
  display: flex; flex-direction: column;
  z-index: 100; overflow: hidden;
  transition: width var(--t-slow);
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-col); }

/* ── Sidebar Top Bar ── */
.sidebar-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--sb-divider);
  flex-shrink: 0; min-height: var(--topbar-h);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; overflow: hidden; min-width: 0; }
.sidebar-brand-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  background: var(--grad-brand);
  box-shadow: 0 4px 12px rgba(99,102,241,0.45);
  transition: box-shadow var(--t-fast);
}
.sidebar-brand-icon.has-logo {
  background: transparent !important; box-shadow: none !important;
  border-radius: 0 !important; overflow: visible;
}
.sidebar-brand-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.sidebar-brand-text { overflow: hidden; transition: opacity var(--t-base); white-space: nowrap; }
.sidebar-brand-name { font-size: 0.9rem; font-weight: 700; color: var(--sb-text-primary); letter-spacing: -0.02em; line-height: 1.15; }
.sidebar-brand-tenant { font-size: 0.62rem; color: var(--sb-text-muted); font-weight: 500; margin-top: 1px; }
.sidebar-collapse-btn {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--sb-btn-bg); border: 1px solid var(--sb-btn-border);
  color: var(--sb-btn-color);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--t-fast); flex-shrink: 0; font-size: 0.75rem;
}
.sidebar-collapse-btn:hover { background: var(--sb-btn-hover-bg); color: var(--sb-btn-hover-fg); border-color: var(--sb-btn-border); }

/* ── Collapsed State ── */
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .nav-sub-arrow,
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .nav-submenu,
body.sidebar-collapsed .sidebar-brand-name,
body.sidebar-collapsed .sidebar-brand-tenant { display: none !important; }
body.sidebar-collapsed .sidebar-top-bar { flex-direction: column; align-items: center; justify-content: flex-start; padding: 14px 0 10px; gap: 10px; }
body.sidebar-collapsed .sidebar-collapse-btn { margin: 0; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
body.sidebar-collapsed .nav-item .nav-icon { width: auto; margin: 0; }
body.sidebar-collapsed .sidebar-footer { padding: 10px; }
body.sidebar-collapsed .sidebar-user { justify-content: center; padding: 8px 0; }

/* ── Sidebar Nav ── */
.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.nav-section-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--sb-text-label);
  padding: 12px 10px 4px; white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  font-size: 0.845rem; font-weight: 500; color: var(--sb-text);
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
  position: relative; white-space: nowrap; min-height: 44px; user-select: none;
}
.nav-item:hover { background: var(--sb-item-hover-bg); color: var(--sb-item-hover-fg); }
.nav-item.active { background: var(--sb-item-active-bg); color: var(--sb-text-active); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 18%; bottom: 18%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand-400); box-shadow: 0 0 8px rgba(129,140,248,0.7);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-sub-arrow { display: flex; align-items: center; flex-shrink: 0; color: var(--sb-arrow); transition: transform var(--t-fast); margin-left: auto; }
.nav-item.open .nav-sub-arrow { transform: rotate(180deg); }
.nav-badge {
  font-size: 0.65rem; font-weight: 700; background: var(--brand-500); color: #fff;
  padding: 1px 7px; border-radius: 99px; box-shadow: 0 2px 6px rgba(99,102,241,0.4);
}

/* ── Nav Submenu ── */
.nav-submenu { overflow: hidden; max-height: 0; transition: max-height var(--t-slow); display: flex; flex-direction: column; gap: 1px; padding-left: 8px; }
.nav-submenu.open { max-height: 600px; }
.nav-subitem {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 20px; border-radius: 6px;
  font-size: 0.8rem; font-weight: 500; color: var(--sb-sub-text);
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap; position: relative; min-height: 38px;
}
.nav-subitem::before {
  content: ''; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--sb-sub-dot);
}
.nav-subitem:hover { background: var(--sb-sub-hover-bg); color: var(--sb-sub-hover-fg); }
.nav-subitem.active { color: var(--sb-sub-active); }
.nav-subitem.active::before { background: var(--sb-sub-active-dot); }

/* Config flyout — popup body-level com fundo claro, precisa de tokens próprios */
#configFlyout .nav-subitem { color: var(--text-secondary); padding-left: 22px; }
#configFlyout .nav-subitem::before { background: var(--text-muted); }
#configFlyout .nav-subitem:hover { background: var(--bg-glass2); color: var(--text-primary); }
#configFlyout .nav-subitem.active { background: rgba(99,102,241,.12); color: var(--brand-500); font-weight: 700; }
#configFlyout .nav-subitem.active::before { background: var(--brand-500); }

/* ── Sidebar Footer ── */
.sidebar-footer { padding: 8px; border-top: 1px solid var(--sb-divider); flex-shrink: 0; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  cursor: pointer; transition: background var(--t-fast); min-height: 44px;
}
.sidebar-user:hover { background: var(--sb-item-hover-bg); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: #fff;
  box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.user-avatar:has(img) {
  background: transparent !important;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.845rem; font-weight: 600; color: var(--sb-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.62rem; color: var(--sb-text-muted); }

/* ══════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════ */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 110;
  transition: left var(--t-slow), background var(--t-slow);
}
body.sidebar-collapsed .topbar { left: var(--sidebar-w-col); }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-menu-btn {
  display: none; width: 40px; height: 40px; align-items: center; justify-content: center;
  background: var(--bg-glass2); border: 1px solid var(--border-subtle);
  border-radius: 8px; cursor: pointer; font-size: 1.05rem; color: var(--text-secondary);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.topbar-menu-btn:hover { background: var(--bg-glass); border-color: var(--border-medium); color: var(--text-primary); }

/* ── Topbar Avatar ── */
.topbar-avatar-wrap { position: relative; }
.topbar-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; background: var(--grad-brand);
  border: 2px solid var(--brand-200);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: #fff; cursor: pointer;
  transition: box-shadow var(--t-fast), border-color var(--t-fast);
  overflow: hidden; box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.topbar-avatar-btn:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.4); border-color: var(--brand-300); }
[data-theme="dark"] .topbar-avatar-btn { border-color: var(--brand-700); }
.topbar-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.topbar-avatar-btn:has(img) { background: transparent !important; }
.topbar-user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 210px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl); z-index: 300; overflow: hidden;
  animation: fadeIn var(--t-base) forwards;
}
.topbar-user-info { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); }
.topbar-user-info strong { display: block; font-size: 0.875rem; font-weight: 600; }
.topbar-user-info span { font-size: 0.75rem; color: var(--text-muted); }

/* ── Theme Toggle ── */
.theme-toggle {
  width: 48px; height: 28px; background: var(--bg-glass2);
  border: 1.5px solid var(--border-medium); border-radius: 99px;
  cursor: pointer; position: relative;
  transition: background var(--t-base), border-color var(--t-base);
  display: flex; align-items: center; padding: 3px;
}
.theme-toggle-knob {
  width: 20px; height: 20px; border-radius: 50%; background: var(--grad-brand);
  box-shadow: 0 2px 8px rgba(99,102,241,0.45);
  transition: transform var(--t-base);
  display: flex; align-items: center; justify-content: center; font-size: 0.65rem;
}
[data-theme="dark"] .theme-toggle-knob { transform: translateX(20px); }

/* ── Notification Btn ── */
.notif-btn {
  position: relative; width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-glass2); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); font-size: 0.95rem;
}
.notif-btn:hover { background: var(--bg-glass); border-color: var(--border-medium); }
.notif-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg-base); }

/* ══════════════════════════════════════════════
   MAIN CONTENT & PAGES
══════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
  padding: 24px; min-height: calc(100vh - var(--topbar-h));
  transition: margin-left var(--t-slow);
}
body.sidebar-collapsed .main-content { margin-left: var(--sidebar-w-col); }
.page { display: none; }
.page.active { display: block; animation: fadeIn var(--t-base) forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-header { margin-bottom: 24px; }
#page-calculadora.active {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 48px);
  overflow: hidden;
}
#page-calculadora .calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
  align-items: start;
}
#page-calculadora .calc-col {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-color: var(--brand-200) !important;
}
#page-calculadora .calc-col-title {
  font-size: .62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--brand-500); margin: 0 0 2px;
}
#page-calculadora .input-group { gap: 4px; }
#page-calculadora .input-field { font-size: .84rem; padding: 8px 12px; min-height: 38px; }
#page-calculadora .form-label { font-size: .75rem; }
.page-header h1 { font-size: 1.625rem; margin-bottom: 4px; }

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: box-shadow var(--t-base), background var(--t-fast), opacity var(--t-fast);
  white-space: nowrap; letter-spacing: -0.01em;
  min-height: 44px; user-select: none; text-decoration: none; position: relative;
}
/* Scale-down on press: tactile press feedback */
.btn:active { transform: scale(0.97); transition: transform 80ms ease-in, box-shadow var(--t-fast); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--grad-brand); color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,0.35);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(99,102,241,0.52); }
.btn-ghost {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-medium);
}
.btn-ghost:hover { background: var(--bg-glass2); border-color: var(--brand-300); }
.btn-danger {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%); color: #fff;
  box-shadow: 0 2px 10px rgba(239,68,68,0.28);
}
.btn-danger:hover { box-shadow: 0 4px 18px rgba(239,68,68,0.42); }
.btn-sm   { padding: 6px 14px; font-size: 0.8rem; min-height: 36px; }
.btn-lg   { padding: 14px 28px; font-size: 1rem; min-height: 52px; }
.btn-icon { padding: 10px; min-width: 44px; min-height: 44px; justify-content: center; border-radius: var(--radius-sm); }
.btn-full { width: 100%; justify-content: center; }

/* ══════════════════════════════════════════════
   FORMS & INPUTS
══════════════════════════════════════════════ */
.input-group { display: flex; flex-direction: column; gap: 6px; }
/* .input-label and .form-label are identical — both used in HTML */
.input-label, .form-label {
  font-size: 0.8125rem; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.01em;
  display: block;
}
/* .input-field and .form-input are identical — both used in HTML */
.input-field, .form-input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-surface); border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.875rem; color: var(--text-primary);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none; min-height: 44px; appearance: none; -webkit-appearance: none;
}
.input-field::placeholder, .form-input::placeholder { color: var(--text-muted); }
.input-field:focus, .form-input:focus {
  border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(99,102,241,0.14);
}
[data-theme="dark"] .input-field, [data-theme="dark"] .form-input {
  background: var(--bg-card); border-color: var(--border-subtle);
}
[data-theme="dark"] .input-field:focus, [data-theme="dark"] .form-input:focus {
  border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
  background: var(--bg-surface);
}
textarea.input-field, textarea.form-input { resize: vertical; min-height: 80px; line-height: 1.55; }
.input-wrapper { position: relative; }
.input-wrapper .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; font-size: 0.9rem;
}
.input-wrapper .input-field,
.input-wrapper .form-input { padding-left: 42px; }
/* Custom select arrow — brand color */
select.input-field, select.form-input {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366F1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 18px 18px !important;
  padding-right: 38px; cursor: pointer;
}

/* ══════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}
.badge-purple { background: rgba(99,102,241,0.1);  color: #4F46E5; border: 1px solid rgba(99,102,241,0.2); }
.badge-blue   { background: rgba(59,130,246,0.1);  color: #2563EB; border: 1px solid rgba(59,130,246,0.2); }
.badge-green  { background: rgba(16,185,129,0.1);  color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.badge-yellow { background: rgba(245,158,11,0.1);  color: #D97706; border: 1px solid rgba(245,158,11,0.2); }
.badge-red    { background: rgba(239,68,68,0.1);   color: #DC2626; border: 1px solid rgba(239,68,68,0.2);  }
.badge-gray   { background: rgba(107,114,128,0.1); color: #6B7280; border: 1px solid rgba(107,114,128,0.2); }
[data-theme="dark"] .badge-purple { color: var(--brand-300); border-color: rgba(99,102,241,0.3); }
[data-theme="dark"] .badge-blue   { color: #93C5FD; }
[data-theme="dark"] .badge-green  { color: #6EE7B7; }
[data-theme="dark"] .badge-yellow { color: #FDE68A; }
[data-theme="dark"] .badge-red    { color: #FCA5A5; }
[data-theme="dark"] .badge-gray   { color: #9CA3AF; }

/* ══════════════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════════════ */
.progress-wrap { background: var(--border-subtle); border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 99px; background: var(--grad-brand);
  box-shadow: 0 0 8px rgba(99,102,241,0.3);
  transition: width 1.1s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.progress-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  animation: shimmer 2.2s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ══════════════════════════════════════════════
   TABS
══════════════════════════════════════════════ */
.tabs {
  display: flex; align-items: center; gap: 2px; background: var(--bg-glass2);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 3px;
}
.tab {
  display: flex; align-items: center; justify-content: center;
  padding: 7px 16px; border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.845rem; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  border: none; background: none; font-family: inherit; height: 36px; white-space: nowrap; flex-shrink: 0;
}
.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--bg-surface); color: var(--brand-600); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .tab.active { background: var(--bg-card); color: var(--brand-400); }

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity var(--t-base);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto;
  transform: scale(0.94) translateY(14px); opacity: 0;
  transition: transform var(--t-slow) cubic-bezier(.34,1.26,.64,1), opacity var(--t-slow);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); opacity: 1; }
.modal-header {
  padding: 22px 24px 18px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; background: var(--bg-surface); z-index: 2;
}
.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.modal-footer {
  padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
}
/* .modal-card — used as inner panel inside modal-overlay */
.modal-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  padding: 28px; width: 100%; max-height: 90vh; overflow-y: auto;
  transform: scale(0.94) translateY(14px); opacity: 0;
  transition: transform var(--t-slow) cubic-bezier(.34,1.26,.64,1), opacity var(--t-slow);
}
.modal-overlay.open .modal-card { transform: scale(1) translateY(0); opacity: 1; }

/* ── Lead 3-Column Panel ── */
#leadModal { padding: 8px; }
#leadModal .modal { max-width: 1440px; width: 98vw; height: 98vh; max-height: 98vh; overflow: hidden; display: flex; flex-direction: column; }
#leadModal .modal-header { padding: 11px 20px; }
#leadModalBody { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.lead-3col { display: grid; grid-template-columns: 285px 1fr 310px; flex: 1; min-height: 0; overflow: hidden; }
.lead-col { min-height: 0; }
.lead-col-1 { padding: 14px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--border-subtle); }
.lead-col-2 { padding: 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.lead-col-3 { display: flex; flex-direction: column; border-left: 1px solid var(--border-subtle); background: var(--bg-glass2); overflow: hidden; }

/* Shared lead primitives */
.lead-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lead-info-block { background: var(--bg-glass2); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 12px 14px; }
.lead-info-block-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 4px; }
.lead-info-block-value { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); word-break: break-word; line-height: 1.4; }
.lead-section-title { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }

/* Linha de contato compacta (telefone / telefone2 / email) */
.lead-contact-row { display: flex; align-items: center; gap: 7px; background: var(--bg-glass2); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 6px 10px; min-height: 32px; }
.lead-contact-icon { font-size: 0.72rem; opacity: 0.7; flex-shrink: 0; }
.lead-contact-val { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-contact-row a.lead-contact-chip { display: inline-flex; align-items: center; font-size: 0.6rem; color: var(--brand-500); font-weight: 700; text-decoration: none; padding: 2px 7px; border: 1px solid var(--brand-300); border-radius: 99px; flex-shrink: 0; background: transparent; }
.lead-contact-edit { background: none; border: none; cursor: pointer; color: var(--text-muted); opacity: 0.45; padding: 2px; flex-shrink: 0; display: inline-flex; transition: opacity var(--t-fast); }
.lead-contact-edit:hover { opacity: 1; color: var(--brand-500); }
.lead-hero-avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-brand); display: flex; align-items: center; justify-content: center; font-size: 1.05rem; font-weight: 800; color: #fff; flex-shrink: 0; box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
.stage-opt { display:block; width:100%; text-align:left; padding:7px 10px; border:none; border-radius:6px; font-size:.8rem; font-weight:700; cursor:pointer; font-family:inherit; background:transparent; color:var(--text-primary); transition:background var(--t-fast), color var(--t-fast); }
.stage-opt:hover { background:var(--bg-glass2); }
.stage-opt.active { background:var(--grad-brand); color:#fff; }
.lead-task-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; background: var(--bg-glass2); padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border-subtle); transition: background var(--t-fast); }
.lead-task-item:hover { background: var(--bg-glass); }
.lead-task-done { text-decoration: line-through; color: var(--text-muted); }
.lead-ficha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lead-contact-chip { display: flex; align-items: center; gap: 10px; background: var(--bg-glass2); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 14px; }
.lead-value-highlight { font-size: 1.4rem; font-weight: 900; color: var(--brand-600); letter-spacing: -0.04em; }

/* Priority badges */
.pri-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 3px 9px; font-size: 0.68rem; font-weight: 700; }
.pri-badge-high   { background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(239,68,68,0.25); }
.pri-badge-medium { background: rgba(245,158,11,0.1); color: #d97706; border: 1px solid rgba(245,158,11,0.25); }
.pri-badge-low    { background: rgba(37,99,235,0.1);  color: var(--brand-600); border: 1px solid rgba(37,99,235,0.25); }

/* Custom lead property dropdowns */
.lead-drop-wrap     { position:relative; }
.lead-field-trigger { display:flex;align-items:center;justify-content:space-between;width:100%;gap:6px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--text-primary);font-family:inherit; }
.lead-prop-dropdown { display:none;position:absolute;top:calc(100% + 6px);left:-14px;right:-14px;z-index:450;background:var(--bg-surface);border:1px solid var(--border-medium);border-radius:10px;padding:4px;box-shadow:var(--shadow-lg);overflow:hidden; }
.lead-drop-opt      { display:flex;align-items:center;width:100%;text-align:left;padding:7px 10px;border:none;border-radius:7px;font-size:.82rem;font-weight:500;cursor:pointer;font-family:inherit;background:transparent;color:var(--text-primary);transition:background var(--t-fast);gap:8px; }
.lead-drop-opt:hover { background:var(--bg-glass2); }
.lead-drop-opt.ld-sel { background:rgba(99,102,241,0.1);color:#6366F1;font-weight:600; }
.lead-drop-chevron  { color:var(--text-muted);flex-shrink:0;transition:transform .2s; }
.lead-drop-wrap.ld-open .lead-drop-chevron { transform:rotate(180deg); }

/* Variante "boxed" — dropdown com cara de input do design system (usado em Registrar Valor) */
.lead-field-trigger.lft-boxed {
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  min-height: 40px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.lead-field-trigger.lft-boxed:hover { border-color: var(--brand-400); }
.lead-drop-wrap.ld-open .lead-field-trigger.lft-boxed {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.14);
}
[data-theme="dark"] .lead-field-trigger.lft-boxed {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}
.av-sm-img { width:26px;height:26px;border-radius:50%;object-fit:cover;flex-shrink:0; }
.av-sm-ini { width:26px;height:26px;border-radius:50%;background:var(--grad-brand);display:flex;align-items:center;justify-content:center;font-size:.62rem;font-weight:800;color:#fff;flex-shrink:0; }

/* Financial highlight cards */
.fin-cards-row { display: flex; gap: 10px; }
.fin-card { flex: 1; border-radius: 10px; padding: 10px 12px; }
.fin-card-green  { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.28); }
.fin-card-blue   { background: rgba(37,99,235,0.1);  border: 1px solid rgba(37,99,235,0.28); }
.fin-card-orange { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.28); }
.fin-card-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 5px; }
.fin-card-green .fin-card-label  { color: #059669; }
.fin-card-blue .fin-card-label   { color: var(--brand-700); }
.fin-card-orange .fin-card-label { color: #b45309; }
.fin-card-value { font-size: 1.12rem; font-weight: 900; letter-spacing: -0.03em; }
.fin-card-green .fin-card-value  { color: #059669; }
.fin-card-blue .fin-card-value   { color: var(--brand-600); }
.fin-card-orange .fin-card-value { color: #d97706; }

/* Financial details table */
.fin-table { background: var(--bg-glass2); border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); overflow: hidden; }
.fin-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 12px; border-bottom: 1px solid var(--border-subtle); font-size: 0.78rem; gap: 8px; transition: background var(--t-fast); }
.fin-row:last-child { border-bottom: none; }
.fin-row-editable { cursor: text; }
.fin-row-editable:hover { background: rgba(99,102,241,0.04); }
.fin-row-editable:hover .fin-row-input { color: var(--brand-500); }
.fin-row-label { color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }
.fin-row-value { font-weight: 700; color: var(--text-primary); text-align: right; min-width: 130px; display: inline-block; }
.fin-row-value.v-green  { color: #059669; }
.fin-row-value.v-blue   { color: var(--brand-600); }
.fin-row-value.v-orange { color: #d97706; }
.fin-row-input { background: transparent; border: none; outline: none; font: inherit; font-weight: 700; color: var(--text-primary); text-align: right; width: 130px; cursor: pointer; padding: 1px 3px; border-radius: 4px; transition: background var(--t-fast); }
.fin-row-input:focus { background: rgba(99,102,241,0.08); cursor: text; }
.fin-row-input.v-green  { color: #059669; }
.fin-row-input.v-blue   { color: var(--brand-600); }
.fin-row-input.v-orange { color: #d97706; }
.fin-section-divider {
  padding: 5px 12px 4px;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--brand-500);
  background: rgba(99,102,241,0.06);
  border-bottom: 1px solid rgba(99,102,241,0.15);
  border-top: 1px solid rgba(99,102,241,0.15);
}

/* Lead tabs (col-2) */
.lead-tab-bar { display: flex; gap: 0; background: var(--bg-glass2); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 3px; flex-shrink: 0; }
.lead-tab-btn { flex: 1; text-align: center; padding: 5px 10px; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); cursor: pointer; border-radius: 5px; transition: all var(--t-fast); border: none; background: none; font-family: inherit; }
.lead-tab-btn.active { background: var(--bg-surface); color: var(--brand-500); box-shadow: var(--shadow-sm); }
.lead-tab-panel { display: none; flex-direction: column; gap: 9px; }
.lead-tab-panel.active { display: flex; }

/* BRL animated input */
.brl-wrap { position: relative; display: inline-flex; align-items: center; width: 130px; flex-shrink: 0; }
.brl-wrap .fin-row-input { width: 100%; color: transparent !important; caret-color: var(--brand-400); }
.brl-num-display {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end;
  pointer-events: none; overflow: hidden; padding: 1px 3px; font-weight: 700; color: var(--text-primary);
}
.brl-num-display.v-green  { color: #059669; }
.brl-num-display.v-orange { color: #d97706; }
.brl-num-display.v-blue   { color: var(--brand-600); }
.brl-num-display span { display: inline-block; line-height: 1; }
@keyframes brl-in-up   { from { transform: translateY(10px) scale(0.88); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes brl-in-down { from { transform: translateY(-10px) scale(0.88); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes brl-card-pop { 0% { transform: scale(1); } 45% { transform: scale(1.1); } 100% { transform: scale(1); } }
.brl-card-pop { animation: brl-card-pop 0.22s cubic-bezier(0.34,1.56,0.64,1); display: inline-block; }

/* PDF generate button */
.btn-gen-pdf { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 20px; background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%); color: #fff; border: none; border-radius: 10px; font-size: 0.875rem; font-weight: 700; cursor: pointer; transition: all 0.2s; letter-spacing: 0.02em; box-shadow: 0 4px 14px rgba(29,78,216,0.3); flex-shrink: 0; font-family: inherit; }
.btn-gen-pdf:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(29,78,216,0.45); }
.btn-gen-pdf:active { transform: none; }

/* Activity chat (col-3) */
.activity-header { padding: 12px 15px; border-bottom: 1px solid var(--border-subtle); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.activity-feed { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.activity-msg { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 9px 11px; position: relative; }
.activity-msg:hover .msg-actions { opacity: 1; }
.msg-actions { position: absolute; top: 6px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity var(--t-fast); }
.msg-action-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px 5px; border-radius: 5px; transition: background var(--t-fast), color var(--t-fast); display: flex; align-items: center; justify-content: center; }
.msg-action-btn:hover { background: var(--bg-glass2); color: var(--brand-500); }
.msg-action-btn.msg-del-btn:hover { background: rgba(239,68,68,0.08); color: #dc2626; }
.msg-text-editing { background: rgba(99,102,241,0.05); border: 1px solid var(--brand-400); border-radius: 5px; padding: 3px 6px; outline: none; min-height: 20px; cursor: text; }
.msg-header { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.msg-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--grad-brand); display: flex; align-items: center; justify-content: center; font-size: 0.58rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.msg-author { font-size: 0.73rem; font-weight: 700; color: var(--text-primary); }
.msg-time { font-size: 0.62rem; color: var(--text-muted); display: block; text-align: right; margin-top: 5px; }
.msg-text { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; }
.activity-syslog { font-size: 0.69rem; color: var(--text-muted); background: var(--bg-glass2); border-radius: 6px; padding: 4px 10px; text-align: center; border: 1px dashed var(--border-medium); }
.activity-input-wrap { padding: 10px 12px; border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.activity-textarea { width: 100%; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 8px 11px; font-family: inherit; font-size: 0.79rem; color: var(--text-primary); background: var(--bg-surface); outline: none; resize: none; min-height: 52px; max-height: 90px; transition: border-color var(--t-fast); }
.activity-textarea:focus { border-color: var(--brand-400); }
.activity-toolbar { display: flex; align-items: center; gap: 3px; margin-top: 6px; position: relative; }
.activity-tool-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 5px; border-radius: 6px; transition: all var(--t-fast); display: flex; align-items: center; justify-content: center; }
.activity-tool-btn:hover { background: var(--bg-glass2); color: var(--brand-500); }
.activity-send-btn { margin-left: auto; background: var(--brand-500); color: #fff; border: none; border-radius: 7px; padding: 6px 13px; font-size: 0.76rem; font-weight: 700; cursor: pointer; transition: background var(--t-fast); display: flex; align-items: center; gap: 5px; min-height: 30px; font-family: inherit; }
.activity-send-btn:hover { background: var(--brand-600); }

/* Dark mode */
[data-theme="dark"] .fin-table { background: rgba(15,15,25,0.6); }
[data-theme="dark"] .lead-col-3 { background: rgba(15,15,25,0.55); }
[data-theme="dark"] .activity-msg { background: var(--bg-card); }
[data-theme="dark"] .activity-textarea { background: var(--bg-card); }
[data-theme="dark"] .lead-tab-btn.active { background: var(--bg-card); }

/* Responsive */
@media (max-width: 1150px) {
  #leadModal .modal { max-width: 98vw; width: 98vw; }
  .lead-3col { grid-template-columns: 255px 1fr 270px; }
}
@media (max-width: 860px) {
  .lead-3col { grid-template-columns: 1fr; height: auto; }
  .lead-col-1 { border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .lead-col-3 { border-left: none; border-top: 1px solid var(--border-subtle); min-height: 380px; }
  .lead-info-grid, .lead-ficha-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   DROPDOWN MENU
══════════════════════════════════════════════ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); box-shadow: var(--shadow-xl);
  min-width: 180px; z-index: 200; overflow: hidden;
  animation: fadeIn var(--t-fast) forwards;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; font-size: 0.845rem; font-weight: 500;
  cursor: pointer; transition: background var(--t-fast);
  color: var(--text-primary); border: none; background: none;
  width: 100%; text-align: left; font-family: inherit; min-height: 44px;
}
.dropdown-item:hover { background: var(--bg-glass2); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.07); }

/* ══════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: var(--radius-sm); background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-left-width: 4px;
  border-left-color: var(--brand-500);
  box-shadow: var(--shadow-xl);
  animation: toastIn var(--t-slow) cubic-bezier(.4,0,.2,1) forwards;
  min-width: 260px; max-width: 380px; pointer-events: all;
}
.toast.removing { animation: toastOut var(--t-base) cubic-bezier(.4,0,.2,1) forwards; }
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg  { font-size: 0.845rem; font-weight: 500; flex: 1; line-height: 1.4; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ══════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════ */
.stat-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.stat-header { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.stat-icon-blue   { background: rgba(99,102,241,0.1); }
.stat-icon-purple { background: rgba(139,92,246,0.1); }
.stat-icon-green  { background: rgba(16,185,129,0.1); }
.stat-icon-yellow { background: rgba(245,158,11,0.1); }
.stat-value  { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; color: var(--text-primary); }
.stat-label  { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-change { font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ══════════════════════════════════════════════
   KANBAN BOARD
══════════════════════════════════════════════ */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-col {
  flex: 0 0 262px; background: var(--bg-glass2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.kanban-col.drag-over { background: rgba(99,102,241,0.07); border-color: rgba(99,102,241,0.35); }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1.5px solid var(--border-subtle); }
.kanban-col-title  { display: flex; align-items: center; gap: 7px; font-size: 0.845rem; font-weight: 700; }
.kanban-dot   { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kanban-count { font-size: 0.7rem; color: var(--text-muted); }
.kanban-cards { display: flex; flex-direction: column; gap: 8px; min-height: 60px; flex: 1; }
/* Shadow-only hover — no translateY (CLS prevention) */
.kanban-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer;
  box-shadow: var(--shadow-sm); position: relative;
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: rgba(99,102,241,0.3); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(1.5deg); cursor: grabbing; box-shadow: var(--shadow-lg); }
.kanban-card-toprow  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 6px; }
.kanban-card-name    { font-size: 0.845rem; font-weight: 600; line-height: 1.35; flex: 1; }
.kanban-card-actions { opacity: 0; transition: opacity var(--t-fast); }
.kanban-card:hover .kanban-card-actions { opacity: 1; }
.kanban-card-actions button {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 0.9rem; padding: 3px 5px; border-radius: 5px;
  transition: background var(--t-fast), color var(--t-fast); min-height: 28px;
}
.kanban-card-actions button:hover { background: var(--bg-glass2); color: var(--text-primary); }
.kanban-card-meta    { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kanban-card-tags    { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.kanban-card-footer  { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.kanban-card-value   { font-size: 0.78rem; font-weight: 700; color: var(--brand-600); }
.kanban-card-assignee { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--text-muted); }
.kanban-card-ficha-ok   { font-size: 0.7rem; color: var(--success); }
.kanban-card-ficha-warn { font-size: 0.7rem; color: var(--warning); }
.add-card-btn {
  width: 100%; padding: 9px; background: transparent;
  border: 1.5px dashed var(--border-medium); border-radius: var(--radius-sm);
  color: var(--text-muted); font-family: inherit; font-size: 0.8rem;
  cursor: pointer; transition: all var(--t-fast);
  display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px;
}
.add-card-btn:hover { background: rgba(99,102,241,0.05); color: var(--brand-500); border-color: rgba(99,102,241,0.4); border-style: solid; }

/* ══════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.855rem; }
thead th {
  text-align: left; padding: 11px 14px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-glass2); white-space: nowrap;
}
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; color: var(--text-primary); line-height: 1.4; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: rgba(99,102,241,0.015); }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: var(--bg-glass2); }
[data-theme="dark"] tbody tr:nth-child(even) td { background: rgba(99,102,241,0.025); }

/* ══════════════════════════════════════════════
   TIMELINE
══════════════════════════════════════════════ */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-dot-wrap { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.timeline-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--grad-brand); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); flex-shrink: 0; z-index: 1; }
.timeline-line { flex: 1; width: 2px; background: linear-gradient(180deg, rgba(99,102,241,0.2) 0%, transparent 100%); margin-top: 4px; }
.timeline-content { flex: 1; padding-top: 4px; }
.timeline-title { font-size: 0.845rem; font-weight: 600; line-height: 1.35; }
.timeline-time  { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 5px; margin-top: 2px; }
.timeline-body  { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.55; }

/* ══════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon  { font-size: 2.8rem; opacity: 0.28; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.empty-desc  { font-size: 0.845rem; color: var(--text-muted); max-width: 280px; line-height: 1.6; }

/* ══════════════════════════════════════════════
   CHART BARS
══════════════════════════════════════════════ */
.chart-bars      { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.chart-bar-wrap  { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.chart-bar-group { width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.chart-bar       { flex: 1; border-radius: 4px 4px 0 0; min-height: 4px; transition: height 1.1s cubic-bezier(.4,0,.2,1); position: relative; cursor: pointer; }
.chart-bar-qty   { background: var(--grad-brand); box-shadow: 0 -2px 8px rgba(99,102,241,0.2); }
.chart-bar-value { background: linear-gradient(180deg, #10B981 0%, #059669 100%); box-shadow: 0 -2px 8px rgba(16,185,129,0.2); }
.chart-bar:hover { filter: brightness(1.1); }
.chart-bar-label { font-size: 0.6rem; color: var(--text-muted); font-weight: 600; text-align: center; }
.chart-legend      { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.chart-legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--text-muted); }
.chart-legend-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ══════════════════════════════════════════════
   FUNNEL CHART
══════════════════════════════════════════════ */
.funnel-wrap { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.funnel-step { border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: #fff; padding: 9px 18px; transition: filter var(--t-fast); cursor: pointer; min-height: 38px; }
.funnel-step:hover { filter: brightness(1.1); }

/* ══════════════════════════════════════════════
   AUTH LAYOUT
══════════════════════════════════════════════ */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-left {
  background: linear-gradient(155deg, #0D0D1A 0%, #13131F 40%, #1a1040 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px; position: relative; overflow: hidden;
}
.auth-left::before { content: ''; position: absolute; top: -20%; right: -15%; width: 500px; height: 500px; border-radius: 50%; background: rgba(99,102,241,0.12); pointer-events: none; }
.auth-left::after  { content: ''; position: absolute; bottom: -15%; left: -10%; width: 380px; height: 380px; border-radius: 50%; background: rgba(129,140,248,0.07); pointer-events: none; }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--bg-base); }
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-logo-big { font-size: 2.2rem; font-weight: 900; color: #fff; letter-spacing: -0.04em; margin-bottom: 6px; }
.auth-tagline  { color: rgba(255,255,255,0.6); font-size: 1rem; max-width: 300px; text-align: center; line-height: 1.6; }

/* ══════════════════════════════════════════════
   COMMISSION / GAMIFICATION
══════════════════════════════════════════════ */
.commission-card { padding: 18px 22px; }
.commission-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.commission-name { font-weight: 700; font-size: 0.9rem; }
.commission-role { font-size: 0.72rem; color: var(--text-muted); }
.commission-rank { font-size: 1.3rem; }
.commission-goal { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 7px; }
.commission-progress { height: 8px; margin-bottom: 5px; }
.commission-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; }
.commission-pct  { color: var(--text-muted); }
.commission-earn { color: var(--success); font-weight: 700; }
.commission-pct-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.comm-pct-green  { background: rgba(16,185,129,0.1);  color: var(--success); }
.comm-pct-yellow { background: rgba(245,158,11,0.1);  color: var(--warning); }
.comm-pct-red    { background: rgba(239,68,68,0.1);   color: var(--danger);  }

/* ══════════════════════════════════════════════
   BATALHA NAVAL (CLIENT MATRIX)
══════════════════════════════════════════════ */
.batalha-wrap { overflow-x: auto; }
.batalha-table { border-collapse: collapse; width: 100%; min-width: 600px; }
.batalha-table th, .batalha-table td { padding: 10px 12px; border: 1px solid var(--border-subtle); font-size: 0.8rem; white-space: nowrap; }
.batalha-table thead th { background: var(--bg-glass2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.65rem; color: var(--text-muted); }
.batalha-table thead th:first-child { min-width: 160px; }
.batalha-table tbody td:first-child { font-weight: 600; }
.batalha-cell-select { width: 100%; border: none; background: transparent; font-family: inherit; font-size: 0.78rem; cursor: pointer; outline: none; color: var(--text-primary); }
.batalha-status-vendido      { background: rgba(16,185,129,0.09);  }
.batalha-status-negociacao   { background: rgba(99,102,241,0.07);  }
.batalha-status-oportunidade { background: rgba(245,158,11,0.07);  }
.batalha-status-urgencia     { background: rgba(239,68,68,0.07);   }
.batalha-status-na           { background: transparent; }

/* ══════════════════════════════════════════════
   LOGO UPLOAD
══════════════════════════════════════════════ */
.logo-upload-area { border: 2px dashed var(--border-medium); border-radius: var(--radius-md); padding: 24px; text-align: center; transition: border-color var(--t-base), background var(--t-base); cursor: pointer; background: var(--bg-glass2); }
.logo-upload-area:hover { border-color: var(--brand-400); background: rgba(99,102,241,0.04); border-style: solid; }
.logo-upload-preview { width: 80px; height: 80px; object-fit: contain; border-radius: var(--radius-sm); margin: 0 auto 12px; display: block; }

/* ══════════════════════════════════════════════
   FILTER BAR & PANEL
══════════════════════════════════════════════ */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--bg-glass2); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); margin-bottom: 16px; }
.filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="date"] {
  padding: 7px 12px; border-radius: 7px; font-family: inherit; font-size: 0.8rem;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-primary); outline: none; transition: border-color var(--t-fast); min-height: 36px;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--brand-500); }
.filter-bar select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236366F1' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px !important;
  cursor: pointer;
}
[data-theme="dark"] .filter-bar select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23818CF8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.filter-panel { display: none; background: var(--bg-glass2); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 18px; animation: fadeIn var(--t-fast) forwards; }
.filter-panel.active { display: block; }

/* ══════════════════════════════════════════════
   API ZONE & DOC MOCK
══════════════════════════════════════════════ */
.api-zone { background: rgba(99,102,241,0.03); border: 2px dashed rgba(99,102,241,0.22); border-radius: var(--radius-md); padding: 22px; text-align: center; transition: background var(--t-base), border-color var(--t-base); }
.api-zone:hover { background: rgba(99,102,241,0.06); border-color: rgba(99,102,241,0.4); border-style: solid; }
.doc-mock-pdf { background: #FFFFFF; color: #111827; box-shadow: 0 4px 30px rgba(0,0,0,0.1); padding: 40px; border-radius: 4px; min-height: 420px; position: relative; }
[data-theme="dark"] .doc-mock-pdf { background: #13131F; color: #F3F4F6; box-shadow: var(--shadow-lg); }
.doc-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-30deg); font-size: 3rem; font-weight: 900; opacity: 0.04; pointer-events: none; color: var(--brand-500); }

/* ══════════════════════════════════════════════
   MISC COMPONENTS
══════════════════════════════════════════════ */
.modal-list-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; background: var(--bg-glass2); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); margin-bottom: 7px; transition: background var(--t-fast), border-color var(--t-fast); color: var(--text-primary); min-height: 44px; }
.modal-list-item:hover { background: var(--bg-glass); border-color: var(--border-medium); }
.section-card { padding: 22px; }
.avatar-group { display: flex; }
.avatar-group .user-avatar { width: 26px; height: 26px; font-size: 0.6rem; margin-left: -7px; border: 2px solid var(--bg-surface); }
.avatar-group .user-avatar:first-child { margin-left: 0; }
.service-group-card   { background: var(--bg-glass2); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px; margin-bottom: 14px; }
.service-group-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1.5px solid var(--border-subtle); padding-bottom: 7px; margin-bottom: 10px; }
.priority-high   { border-left: 3px solid var(--danger);  }
.priority-medium { border-left: 3px solid var(--warning); }
.priority-low    { border-left: 3px solid var(--success); }
.tag     { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 99px; font-size: 0.7rem; font-weight: 700; }
.divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }
.deadline-alert { background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.18); border-radius: var(--radius-sm); padding: 9px 13px; display: flex; align-items: center; gap: 9px; }
.deadline-warn  { background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.18); border-radius: var(--radius-sm); padding: 9px 13px; display: flex; align-items: center; gap: 9px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.pulse { animation: pulse 1.5s ease-in-out infinite; }

/* ── Select Custom Arrow (Dark) ── */
[data-theme="dark"] select.input-field,
[data-theme="dark"] select.form-input {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23818CF8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 18px 18px !important;
  padding-right: 38px;
}

/* ══════════════════════════════════════════════
   LAYOUT GRID
══════════════════════════════════════════════ */
.grid   { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ══════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════ */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-2 { gap: 8px;  } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; }
.mb-1  { margin-bottom: 4px;  } .mb-2  { margin-bottom: 8px;  } .mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; } .mb-5  { margin-bottom: 20px; } .mb-6  { margin-bottom: 24px; }
.mt-auto     { margin-top: auto; }
.w-full      { width: 100%; }
.text-center { text-align: center; } .text-right { text-align: right; }
.font-bold      { font-weight: 700; } .font-semibold { font-weight: 600; }
.text-sm  { font-size: 0.875rem; } .text-xs { font-size: 0.72rem; }
.text-muted   { color: var(--text-muted);  }
.text-brand   { color: var(--brand-500);   }
.text-success { color: var(--success);     }
.text-danger  { color: var(--danger);      }
.text-warning { color: var(--warning);     }

/* ══════════════════════════════════════════════
   DARK MODE REFINEMENTS
══════════════════════════════════════════════ */
[data-theme="dark"] .topbar { background: rgba(19,19,31,0.90); border-bottom-color: var(--border-subtle); }
[data-theme="dark"] .glass-card { box-shadow: none; }
[data-theme="dark"] .modal, [data-theme="dark"] .modal-card { background: var(--bg-surface); border-color: var(--border-subtle); }
[data-theme="dark"] .modal-header, [data-theme="dark"] .modal-footer { background: var(--bg-surface); }
[data-theme="dark"] .dropdown-menu, [data-theme="dark"] .topbar-user-dropdown { background: var(--bg-surface); border-color: var(--border-subtle); }
[data-theme="dark"] .tabs { background: var(--bg-glass2); border-color: var(--border-subtle); }
[data-theme="dark"] .btn-ghost { color: var(--text-secondary); border-color: var(--border-subtle); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.3); color: var(--text-primary); }
[data-theme="dark"] thead th { background: rgba(20,20,32,0.75); }
[data-theme="dark"] .kanban-col { background: rgba(15,15,25,0.65); }
[data-theme="dark"] .kanban-card { background: var(--bg-card); }
[data-theme="dark"] .filter-bar select,
[data-theme="dark"] .filter-bar input { background: var(--bg-card); border-color: var(--border-subtle); color: var(--text-primary); }
[data-theme="dark"] .notif-dot { border-color: var(--bg-surface); }
[data-theme="dark"] .lead-panel-side { background: rgba(15,15,25,0.55); }

/* ══════════════════════════════════════════════
   SIDEBAR BACKDROP (MOBILE)
══════════════════════════════════════════════ */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; backdrop-filter: blur(2px); }

/* ══════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .auth-page  { grid-template-columns: 1fr; }
  .auth-left  { display: none; }
  .sidebar { transform: translateX(-110%); transition: transform var(--t-slow), width var(--t-slow); }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  body.sidebar-collapsed .sidebar { transform: translateX(-110%); }
  .topbar       { left: 0 !important; }
  .main-content { margin-left: 0 !important; padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar-menu-btn { display: flex !important; }
  .sidebar-backdrop.show { display: block; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal, .modal-card { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 94vh; }
  .kanban-col { flex: 0 0 88vw; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .page-header h1 { font-size: 1.375rem; }
  .stat-value { font-size: 1.5rem; }
  .auth-right { padding: 24px 20px; }
  .auth-form-wrap { max-width: 100%; }
  .toast { min-width: 240px; max-width: calc(100vw - 32px); }
  .modal-overlay { padding: 8px; }
}

/* Profile Avatar Custom Hover & Overlay */
.user-avatar-wrapper:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.35);
}
.user-avatar-wrapper:hover .avatar-hover-overlay {
  opacity: 1 !important;
}

