/* ═══════════════════════════════════════════════════════════
   MYMOBI CRM v2.0 — main.css
   Design System: Tema Claro Premium — Verde MYMOBI
══════════════════════════════════════════════════════════════ */

:root {
  /* ── BACKGROUNDS ─────────────────────────────────────────── */
  --bg-base:        #F0F4F8;
  --bg-primary:     #F4F7FB;
  --bg-secondary:   #FFFFFF;
  --bg-card:        #FFFFFF;
  --bg-card-hover:  #F8FAFD;
  --bg-elevated:    #F1F5F9;
  --bg-input:       #FFFFFF;
  --bg-overlay:     rgba(15, 23, 42, 0.45);
  --bg-sidebar:     #FFFFFF;
  --bg-header:      rgba(255, 255, 255, 0.92);

  /* ── BRAND — MYMOBI GREEN ────────────────────────────────── */
  --brand:          #00A86B;
  --brand-light:    #00C97E;
  --brand-dark:     #008A57;
  --brand-soft:     #E6F8F1;
  --brand-softer:   #F0FBF6;
  --brand-glow:     rgba(0, 168, 107, 0.14);
  --brand-gradient: linear-gradient(135deg, #00A86B 0%, #00D68F 100%);
  --brand-gradient-h: linear-gradient(90deg, #00A86B 0%, #00D68F 100%);

  /* ── TEXT ────────────────────────────────────────────────── */
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;
  --text-disabled:  #CBD5E1;
  --text-inverse:   #FFFFFF;
  --text-brand:     #00A86B;

  /* ── BORDERS ─────────────────────────────────────────────── */
  --border-subtle:  #F1F5F9;
  --border-normal:  #E2E8F0;
  --border-strong:  #CBD5E1;
  --border-brand:   rgba(0, 168, 107, 0.35);

  /* ── SEMANTIC COLORS ─────────────────────────────────────── */
  --color-success:  #10B981;
  --color-warning:  #F59E0B;
  --color-danger:   #EF4444;
  --color-info:     #3B82F6;
  --color-purple:   #8B5CF6;
  --color-cyan:     #06B6D4;
  --color-orange:   #F97316;

  /* Soft backgrounds para status */
  --success-soft:   #ECFDF5;
  --warning-soft:   #FFFBEB;
  --danger-soft:    #FEF2F2;
  --info-soft:      #EFF6FF;
  --purple-soft:    #F5F3FF;

  /* ── TEMPERATURA DO LEAD ─────────────────────────────────── */
  --temp-hot:       #EF4444;
  --temp-hot-soft:  #FEF2F2;
  --temp-warm:      #F59E0B;
  --temp-warm-soft: #FFFBEB;
  --temp-cold:      #3B82F6;
  --temp-cold-soft: #EFF6FF;
  --temp-frozen:    #94A3B8;
  --temp-frozen-soft: #F8FAFC;

  /* ── SIDEBAR ─────────────────────────────────────────────── */
  --sidebar-width:     252px;
  --sidebar-collapsed: 68px;

  /* ── LAYOUT ──────────────────────────────────────────────── */
  --header-height:    60px;
  --content-padding:  28px;

  /* ── SHADOWS ─────────────────────────────────────────────── */
  --shadow-xs:    0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm:    0 1px 4px rgba(15, 23, 42, 0.08), 0 0 1px rgba(15, 23, 42, 0.06);
  --shadow-md:    0 4px 12px rgba(15, 23, 42, 0.1), 0 0 1px rgba(15, 23, 42, 0.06);
  --shadow-lg:    0 8px 28px rgba(15, 23, 42, 0.12), 0 0 1px rgba(15, 23, 42, 0.06);
  --shadow-xl:    0 20px 48px rgba(15, 23, 42, 0.16);
  --shadow-brand: 0 4px 16px rgba(0, 168, 107, 0.28);
  --shadow-card:  0 1px 4px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);

  /* ── BORDER RADIUS ───────────────────────────────────────── */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   18px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* ── SPACING ─────────────────────────────────────────────── */
  --space-1: 4px;  --space-2: 8px;   --space-3: 12px;
  --space-4: 16px; --space-5: 20px;  --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px;

  /* ── TRANSITIONS ─────────────────────────────────────────── */
  --transition-fast: 100ms ease;
  --transition-base: 180ms ease;
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ── Z-INDEX ─────────────────────────────────────────────── */
  --z-sidebar:  100;
  --z-header:   90;
  --z-dropdown: 200;
  --z-drawer:   250;
  --z-modal:    300;
  --z-toast:    400;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ── TIPOGRAFIA ──────────────────────────────────────────────── */
.text-xs    { font-size: 11px; }
.text-sm    { font-size: 12px; }
.text-base  { font-size: 14px; }
.text-md    { font-size: 16px; }
.text-lg    { font-size: 18px; }
.text-xl    { font-size: 22px; }

.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold{ font-weight: 800; }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-brand     { color: var(--brand); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-danger    { color: var(--color-danger); }

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

/* ── LOADER ──────────────────────────────────────────────────── */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 280px;
}

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-normal);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ── ANIMAÇÕES ───────────────────────────────────────────────── */
@keyframes spin        { to { transform: rotate(360deg); } }
@keyframes fadeIn      { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp    { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight{ from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn     { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse-dot   { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes shimmer     { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-fadeInUp     { animation: fadeInUp 0.28s ease both; }
.animate-fadeIn       { animation: fadeIn 0.2s ease both; }
.animate-slideInRight { animation: slideInRight 0.28s ease both; }
.animate-scaleIn      { animation: scaleIn 0.22s ease both; }

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.stagger-children > *:nth-child(6) { animation-delay: 250ms; }

/* ── UTILITÁRIOS ─────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── GRID HELPERS ────────────────────────────────────────────── */
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

@media (max-width: 1200px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px)  { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
