/* ============================================================
   IZZAT CRM — APPLE HIG DESIGN SYSTEM
   Baseado em Apple Human Interface Guidelines
   Princípios: Clarity · Deference · Depth · Hierarchy · Harmony · Consistency
   ============================================================ */

:root {
  /* ─── SF Pro Typography (Apple) ────────────────────── */
  --apple-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --apple-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, monospace;

  /* Type scale (Apple HIG) */
  --hig-large-title: 34px;     /* 34/41 */
  --hig-title-1: 28px;         /* 28/34 */
  --hig-title-2: 22px;         /* 22/28 */
  --hig-title-3: 20px;         /* 20/25 */
  --hig-headline: 17px;        /* 17/22 SemiBold */
  --hig-body: 17px;            /* 17/22 Regular */
  --hig-callout: 16px;         /* 16/21 */
  --hig-subhead: 15px;         /* 15/20 */
  --hig-footnote: 13px;        /* 13/18 */
  --hig-caption-1: 12px;       /* 12/16 */
  --hig-caption-2: 11px;       /* 11/13 */

  /* ─── Apple System Colors (Light Mode) ─────────────── */
  --system-background: #FFFFFF;
  --secondary-system-background: #F2F2F7;
  --tertiary-system-background: #FFFFFF;
  --system-grouped-background: #F2F2F7;
  --secondary-system-grouped-background: #FFFFFF;

  /* System Fills */
  --system-fill: rgba(120, 120, 128, 0.20);
  --secondary-system-fill: rgba(120, 120, 128, 0.16);
  --tertiary-system-fill: rgba(118, 118, 128, 0.12);
  --quaternary-system-fill: rgba(116, 116, 128, 0.08);

  /* Labels */
  --label: #000000;
  --secondary-label: rgba(60, 60, 67, 0.60);
  --tertiary-label: rgba(60, 60, 67, 0.30);
  --quaternary-label: rgba(60, 60, 67, 0.18);

  /* Separators */
  --separator: rgba(60, 60, 67, 0.29);
  --opaque-separator: #C6C6C8;

  /* Apple System Colors — valores exatos light mode (iOS/macOS HIG) */
  --system-blue: #007AFF;
  --system-green: #34C759;
  --system-indigo: #5856D6;
  --system-orange: #FF9500;
  --system-pink: #FF2D55;
  --system-purple: #AF52DE;
  --system-red: #FF3B30;
  --system-teal: #30B0C0;
  --system-cyan: #32ADE6;
  --system-yellow: #FFCC00;
  --system-mint: #00C7BE;
  --system-brown: #A2845C;

  /* System Gray */
  --system-gray: #8E8E93;
  --system-gray-2: #AEAEB2;
  --system-gray-3: #C7C7CC;
  --system-gray-4: #D1D1D6;
  --system-gray-5: #E5E5EA;
  --system-gray-6: #F2F2F7;

  /* Radius — Apple continuous corners */
  --apple-r-xs: 6px;
  --apple-r-sm: 8px;
  --apple-r-md: 10px;
  --apple-r-lg: 14px;
  --apple-r-xl: 18px;
  --apple-r-2xl: 24px;
  --apple-r-full: 999px;

  /* Spacing (8pt grid Apple) */
  --apple-s-1: 4px;
  --apple-s-2: 8px;
  --apple-s-3: 12px;
  --apple-s-4: 16px;
  --apple-s-5: 20px;
  --apple-s-6: 24px;
  --apple-s-8: 32px;
  --apple-s-10: 40px;
  --apple-s-12: 48px;

  /* Elevation (Apple shadow system) */
  --apple-elev-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  --apple-elev-2: 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.08);
  --apple-elev-3: 0 4px 8px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.12);
  --apple-elev-4: 0 8px 16px rgba(0, 0, 0, 0.06), 0 24px 48px rgba(0, 0, 0, 0.16);

  /* Spring easing */
  --apple-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --apple-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --apple-ease-out: cubic-bezier(0, 0, 0.2, 1);

  /* Override tokens legados */
  --bg-0: var(--system-grouped-background);
  --bg-1: var(--secondary-system-grouped-background);
  --bg-2: var(--system-gray-6);
  --bg-3: var(--system-gray-5);
  --border: rgba(60, 60, 67, 0.12);
  --border-strong: rgba(60, 60, 67, 0.20);
  --border-hover: rgba(60, 60, 67, 0.30);
  --tx-1: var(--label);
  --tx-2: var(--secondary-label);
  --tx-3: var(--tertiary-label);
  --tx-4: var(--quaternary-label);
  --primary: #000000;
  --primary-hover: #1C1C1E;
  --primary-fg: #FFFFFF;
  --accent: var(--system-blue);

  --topbar-h: 52px;
  --sidebar-w: 260px;
}

/* ─── Base ──────────────────────────────────────────── */
html, body {
  font-family: var(--apple-font);
  font-size: var(--hig-footnote);
  line-height: 1.47;
  color: var(--label);
  background: var(--system-grouped-background);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv01", "cv02", "cv11";
  letter-spacing: -0.01em;
}
code, pre, .mono, .font-mono { font-family: var(--apple-mono); }

/* ─── App layout (grid limpo, sem !important) ──────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  background: var(--system-grouped-background);
}

.topbar { grid-area: topbar; position: sticky; top: 0; z-index: 100; }
.sidebar { grid-area: sidebar; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
.main { grid-area: main; min-width: 0; overflow-x: hidden; }

/* Modais sempre acima da topbar */
.modal-overlay, .composer-modal-overlay, .settings-overlay, .drawer-overlay { z-index: 200; }
.drawer { z-index: 210 !important; }
.modal { z-index: 210 !important; }
.composer-modal { z-index: 210 !important; }
.settings-modal { z-index: 210 !important; }
.toast { z-index: 300; }

/* Utility: hide elements when workspace doesn't match */
.is-hidden { display: none !important; }

/* ============================================================
   PREMIUM MODAL (Stripe/Linear/Notion-style)
   .gd-overlay > .gd-modal
   ============================================================ */
.gd-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15, 17, 21, 0.40);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: gdFadeIn 0.18s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes gdFadeIn { from { opacity: 0 } to { opacity: 1 } }

.gd-modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.06),
    0 32px 80px rgba(0,0,0,0.18),
    0 8px 24px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--apple-font);
  animation: gdSlideIn 0.28s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.gd-modal-sm { max-width: 420px; }
@keyframes gdSlideIn { from { opacity: 0; transform: translateY(8px) scale(0.97) } to { opacity: 1; transform: translateY(0) scale(1) } }

/* Header */
.gd-head {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 22px 22px 16px;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  background: linear-gradient(to bottom, #FAFAFA, #FFFFFF);
}
.gd-head-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(0, 122, 255, 0.10);
  color: var(--system-blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.gd-head > div:not(.gd-head-icon) { flex: 1; min-width: 0; }
.gd-head-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: #1D1D1F;
  line-height: 1.3;
}
.gd-head-sub {
  font-size: 13px;
  color: #6E6E73;
  margin-top: 4px;
  line-height: 1.45;
  font-weight: 400;
}
.gd-close {
  width: 28px; height: 28px;
  border: none;
  background: rgba(0,0,0,0.04);
  border-radius: 50%;
  color: #6E6E73;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.gd-close:hover { background: rgba(0,0,0,0.08); color: #1D1D1F; }

/* Body */
.gd-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
}

/* Stepped list (numbered circles) */
.gd-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.05);
}
.gd-step:last-child { border-bottom: none; padding-bottom: 0; }
.gd-step:first-child { padding-top: 4px; }
.gd-step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #F2F2F7;
  color: #1D1D1F;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-feature-settings: "tnum";
}
.gd-step-content { min-width: 0; }
.gd-step-title {
  font-size: 14px;
  font-weight: 600;
  color: #1D1D1F;
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.gd-step-desc {
  font-size: 13px;
  color: #6E6E73;
  line-height: 1.5;
  margin-bottom: 10px;
}
.gd-step-desc strong { color: #1D1D1F; font-weight: 600; }

/* Form */
.gd-form { display: flex; flex-direction: column; gap: 6px; }
.gd-form label {
  font-size: 11px;
  font-weight: 600;
  color: #6E6E73;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 6px;
}
.gd-form label:first-child { margin-top: 2px; }
.gd-input,
.gd-form input {
  width: 100%;
  padding: 10px 14px;
  background: #F8F8FA;
  border: 0.5px solid rgba(0,0,0,0.10);
  border-radius: 10px;
  font-family: var(--apple-mono);
  font-size: 13px;
  color: #1D1D1F;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.gd-input:focus,
.gd-form input:focus {
  background: #FFFFFF;
  border-color: var(--system-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
}
.gd-form input::placeholder { color: #B5B5BA; font-family: var(--apple-font); }

.gd-form-actions {
  display: flex; gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* Warn / info / messages */
.gd-warn {
  display: flex; gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 149, 0, 0.08);
  border: 0.5px solid rgba(255, 149, 0, 0.25);
  border-radius: 10px;
  font-size: 12px;
  color: #6E4F1A;
  line-height: 1.5;
  margin-top: 8px;
}
.gd-warn i, .gd-warn [data-icon] { color: #FF9500; flex-shrink: 0; margin-top: 1px; }
.gd-warn i svg, .gd-warn [data-icon] svg { width: 14px; height: 14px; }

.gd-msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
}
.gd-msg-info { background: rgba(0, 122, 255, 0.06); color: var(--system-blue); border: 0.5px solid rgba(0, 122, 255, 0.20); }
.gd-msg-ok { background: rgba(52, 199, 89, 0.08); color: #0F7A2A; border: 0.5px solid rgba(52, 199, 89, 0.25); }
.gd-msg-err { background: rgba(255, 59, 48, 0.06); color: #B22B23; border: 0.5px solid rgba(255, 59, 48, 0.22); }
.gd-msg strong { font-weight: 600; }

/* Spinner */
.gd-spin { display: inline-block; animation: gdSpin 0.8s linear infinite; }
@keyframes gdSpin { to { transform: rotate(360deg); } }

/* Auto-clipboard pulse animation (when key is auto-pasted) */
.gd-input-pulse {
  animation: gdInputPulse 0.6s ease-out;
  border-color: var(--system-green) !important;
  background: rgba(52, 199, 89, 0.06) !important;
}
@keyframes gdInputPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0.15); }
  100% { box-shadow: 0 0 0 12px rgba(52, 199, 89, 0); }
}

/* Live indicator (pulsing dot) */
.gd-badge-live {
  display: inline-block;
  color: var(--system-green);
  animation: gdLivePulse 1.6s ease-in-out infinite;
  margin-right: 4px;
  font-size: 10px;
  vertical-align: middle;
}
@keyframes gdLivePulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Auto-detected badge */
.gd-auto-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--system-green);
  background: rgba(52, 199, 89, 0.10);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.02em;
  text-transform: none;
  animation: gdSlideIn 0.3s var(--apple-ease);
}

/* Footer tip (call-out) */
.gd-footer-tip {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.06), rgba(0, 122, 255, 0.02));
  border: 0.5px solid rgba(0, 122, 255, 0.18);
  border-radius: 10px;
  font-size: 12px;
  color: #1D1D1F;
  line-height: 1.5;
}
.gd-footer-tip [data-icon] { color: var(--system-blue); flex-shrink: 0; }
.gd-footer-tip [data-icon] svg { width: 14px; height: 14px; }

/* Mobile */
@media (max-width: 540px) {
  .gd-overlay { padding: 0; align-items: flex-end; }
  .gd-modal { max-height: 92vh; border-radius: 18px 18px 0 0; max-width: 100%; }
  .gd-head { padding: 20px 18px 14px; }
  .gd-body { padding: 16px 18px 20px; }
}

/* ============================================================
   WORKSPACE FILTER (CSS-only — bulletproof)
   body[data-workspace="X"] esconde sidebar items que não são X
   ============================================================ */
body[data-workspace="home"] .sidebar [data-workspace]:not([data-workspace="home"]),
body[data-workspace="crm"] .sidebar [data-workspace]:not([data-workspace="crm"]),
body[data-workspace="marketing"] .sidebar [data-workspace]:not([data-workspace="marketing"]),
body[data-workspace="campaigns"] .sidebar [data-workspace]:not([data-workspace="campaigns"]),
body[data-workspace="ads"] .sidebar [data-workspace]:not([data-workspace="ads"]),
/* Aliases legados — também filtram corretamente quando usados (workspace.js redireciona pra marketing) */
body[data-workspace="email"] .sidebar [data-workspace]:not([data-workspace="email"]):not([data-workspace="marketing"]),
body[data-workspace="whatsapp"] .sidebar [data-workspace]:not([data-workspace="whatsapp"]):not([data-workspace="marketing"]),
body[data-workspace="sms"] .sidebar [data-workspace]:not([data-workspace="sms"]):not([data-workspace="marketing"]) {
  display: none !important;
}
/* Default: se body não tem data-workspace, mostra Home */
body:not([data-workspace]) .sidebar [data-workspace]:not([data-workspace="home"]) {
  display: none !important;
}

/* ─── TOPBAR (Apple toolbar estilo macOS) ───────────── */
.topbar {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 0 16px !important;
  height: var(--topbar-h) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  border-bottom: 0.5px solid var(--separator) !important;
  overflow: hidden !important;
}

.topbar-brand {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  flex-shrink: 0 !important;
}
.topbar-brand img { width: 24px !important; height: 24px !important; }
.topbar-brand span { display: none; }

.topbar-nav {
  display: inline-flex !important;
  gap: 2px !important;
  padding: 2px !important;
  background: var(--system-gray-6) !important;
  border-radius: var(--apple-r-md) !important;
  border: none !important;
  flex: 0 1 auto !important;
  margin-right: auto !important;
}

.ws-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 5px 12px !important;
  background: transparent !important;
  border: none !important;
  color: var(--secondary-label) !important;
  font-family: var(--apple-font) !important;
  font-size: var(--hig-footnote) !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  transition: all 0.18s var(--apple-ease) !important;
  white-space: nowrap !important;
  height: 28px !important;
}
.ws-btn svg { width: 14px !important; height: 14px !important; opacity: 0.75 !important; }
.ws-btn:hover { color: var(--label) !important; background: rgba(0, 0, 0, 0.03) !important; }
.ws-btn.active {
  background: var(--system-background) !important;
  color: var(--label) !important;
  font-weight: 600 !important;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06) !important;
}
.ws-btn.active svg { opacity: 1 !important; }
.ws-btn .ws-sub { display: none !important; }

.topbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
}

.tb-icon-btn, .topbar-right .notif-bell {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  color: var(--secondary-label) !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  transition: all 0.15s var(--apple-ease) !important;
}
.tb-icon-btn:hover, .topbar-right .notif-bell:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--label) !important;
}
/* Garante que ícones SVG dentro da topbar/sidebar/botões aparecem com tamanho correto */
.tb-icon-btn svg, .topbar-right .notif-bell svg,
.tb-icon-btn [data-icon], .topbar-right .notif-bell [data-icon] {
  width: 18px !important;
  height: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.tb-icon-btn [data-icon] svg, .topbar-right .notif-bell [data-icon] svg {
  width: 18px !important;
  height: 18px !important;
}
/* Geral: qualquer <i data-icon=""> recebe tamanho default 16px */
i[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
i[data-icon] svg {
  width: 100%;
  height: 100%;
}

.tb-user {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 3px 6px 3px 3px !important;
  background: transparent !important;
  border-radius: var(--apple-r-full) !important;
  border: none !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
}
.tb-user:hover { background: rgba(0, 0, 0, 0.05) !important; }
.tb-user .user-avatar {
  width: 26px !important; height: 26px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, var(--system-gray-3), var(--system-gray-4)) !important;
  color: var(--label) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04) !important;
}
.tb-user-info { max-width: 120px !important; }
.tb-user-info > div:first-child { font-size: 12px !important; font-weight: 600 !important; color: var(--label) !important; }
.tb-user-info > div:last-child { font-size: 10px !important; color: var(--secondary-label) !important; text-transform: uppercase !important; letter-spacing: 0.04em !important; }

/* ─── SIDEBAR (Apple source list estilo Finder) ─────── */
.sidebar {
  background: var(--system-grouped-background) !important;
  border-right: 0.5px solid var(--separator) !important;
  padding: 8px 8px !important;
  display: flex !important;
  flex-direction: column !important;
}

.sidebar-logo { display: none !important; }

.sidebar-quick-search {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  background: var(--tertiary-system-fill) !important;
  border: none !important;
  color: var(--secondary-label) !important;
  border-radius: var(--apple-r-sm) !important;
  margin: 4px 0 12px !important;
  cursor: text !important;
  font-size: 13px !important;
  transition: background 0.15s !important;
}
.sidebar-quick-search:hover { background: var(--secondary-system-fill) !important; }
.sidebar-quick-search svg { width: 12px !important; height: 12px !important; color: var(--tertiary-label) !important; }
.sidebar-quick-search kbd {
  margin-left: auto !important;
  padding: 1px 5px !important;
  background: rgba(0, 0, 0, 0.05) !important;
  border-radius: 4px !important;
  font-size: 10px !important;
  color: var(--tertiary-label) !important;
  font-family: var(--apple-font) !important;
  border: none !important;
}

.sidebar-section, .ws-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--tertiary-label) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  padding: 14px 12px 4px !important;
  display: block !important;
}
.sidebar-section::before, .ws-label::before { display: none !important; }
.ws-label {
  color: var(--secondary-label) !important;
}

.nav-item {
  display: flex;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 10px !important;
  margin: 1px 0 !important;
  color: var(--label) !important;
  border-radius: var(--apple-r-sm) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  cursor: pointer !important;
  transition: background 0.12s var(--apple-ease) !important;
  border: none !important;
  background: transparent !important;
  letter-spacing: -0.005em !important;
}
.nav-item:hover {
  background: var(--tertiary-system-fill) !important;
}
.nav-item.active {
  background: rgba(0, 0, 0, 0.06) !important;
  font-weight: 500 !important;
  color: var(--label) !important;
  box-shadow: none !important;
  border: none !important;
}
.nav-item .nav-ico {
  width: 16px !important;
  height: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--secondary-label) !important;
  flex-shrink: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}
.nav-item .nav-ico svg {
  width: 16px !important; height: 16px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 1.7 !important;
  background: transparent !important;
}
.nav-item:hover .nav-ico, .nav-item.active .nav-ico { color: var(--label) !important; }
.nav-item .dot { width: 7px !important; height: 7px !important; border-radius: 50% !important; }

.nav-count {
  margin-left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 22px !important;
  height: 18px !important;
  padding: 0 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
  color: var(--secondary-label) !important;
  background: rgba(120,120,128,0.16) !important;
  border: none !important;
  border-radius: 6px !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
}
.nav-item:hover .nav-count {
  background: rgba(120,120,128,0.24) !important;
  color: var(--label) !important;
}
.nav-item.active .nav-count {
  background: var(--system-blue) !important;
  color: #fff !important;
}
/* Esconde count quando é zero (pra não poluir) */
.nav-count:empty,
.nav-count[data-empty="1"] {
  display: none !important;
}

/* Hero nav items — viram list-rows Apple-style */
.nav-item-hero {
  display: flex !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  grid-template-areas: none !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 10px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: var(--apple-r-sm) !important;
  color: var(--label) !important;
  transform: none !important;
  margin: 1px 0 !important;
}
.nav-item-hero:hover {
  background: var(--tertiary-system-fill) !important;
  transform: none !important;
  border-color: transparent !important;
}
.nav-item-hero.active {
  background: rgba(0, 0, 0, 0.06) !important;
  border: none !important;
  color: var(--label) !important;
}
.nav-item-hero .nav-ico {
  grid-area: auto !important;
  background: transparent !important;
  width: 16px !important; height: 16px !important;
  color: var(--secondary-label) !important;
}
.nav-item-hero .nav-lbl-main {
  grid-area: auto !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--label) !important;
}
.nav-item-hero .nav-lbl-sub { display: none !important; }

/* Featured nav item (Criar email corporativo) */
.nav-item-featured {
  background: transparent !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--label) !important;
  box-shadow: none !important;
  padding: 7px 10px !important;
  margin: 4px 0 !important;
  font-weight: 500 !important;
}
.nav-item-featured:hover {
  background: var(--tertiary-system-fill) !important;
  transform: none !important;
}
.nav-item-featured .nav-ico { color: var(--label) !important; }
.nav-tag-new {
  background: var(--system-blue) !important;
  color: white !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  padding: 1px 6px !important;
  border-radius: var(--apple-r-full) !important;
  letter-spacing: 0.04em !important;
}

/* ─── MAIN (content area) ───────────────────────────── */
.main {
  padding: 20px 24px !important;
  background: var(--system-grouped-background) !important;
}

/* Page headers */
.header, .wiz-header, .page-header {
  margin-bottom: 20px !important;
  background: transparent !important;
}
.header h1, .wiz-header h1, h1, .page-title {
  font-family: var(--apple-font) !important;
  font-size: var(--hig-title-1) !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  color: var(--label) !important;
  margin: 0 !important;
  line-height: 1.15 !important;
}
.header .sub, .wiz-header p, .page-subtitle {
  color: var(--secondary-label) !important;
  font-size: var(--hig-subhead) !important;
  margin-top: 4px !important;
}

/* ─── CARDS (Apple grouped-list + card) ─────────────── */
.card, .glass, .dash-card, .stat-card, .wiz-step, .wiz-conn-card,
.dom-box, .acc-card, .mkt-card, .mkt-kpi, .mkt-stat-box,
.composer-modal, .drawer, .settings-modal, .onb-card, .quick-action,
.stat, .kb-card {
  background: var(--system-background) !important;
  border: 0.5px solid var(--separator) !important;
  color: var(--label) !important;
  border-radius: var(--apple-r-lg) !important;
  box-shadow: none !important;
}
.card-interactive:hover, .mkt-card:hover, .wiz-conn-card:hover,
.dom-box:hover, .quick-action:hover, .kb-card:hover {
  background: var(--system-background) !important;
  border-color: var(--border-hover) !important;
  box-shadow: var(--apple-elev-1) !important;
  transform: none !important;
}

/* ─── BUTTONS (Apple HIG: filled/bordered/plain) ─────── */
.btn, button.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 7px 14px !important;
  background: transparent;
  border: none;
  border-radius: 8px;          /* radius normal — botões longos não viram oval */
  color: var(--label);
  font-family: var(--apple-font);
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 0.15s var(--apple-ease), transform 0.1s var(--apple-ease), box-shadow 0.15s var(--apple-ease);
  white-space: nowrap;
  line-height: 1.3;
  min-height: 30px;
  user-select: none;
  vertical-align: middle;
}
/* Pílula só quando explicitamente pedida */
.btn.btn-pill { border-radius: 999px; }
/* Botão de ícone — quadrado fixo (não vira oval) */
.btn.btn-ico, .btn-ico.btn,
a.btn.btn-ico, a.btn-ico.btn {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
}
.btn.btn-ico svg, .btn-ico.btn svg,
a.btn.btn-ico svg, a.btn-ico.btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  fill: none !important;
  flex-shrink: 0;
}
.btn-sm.btn-ico, .btn-ico.btn-sm {
  width: 26px !important;
  min-width: 26px !important;
  height: 26px !important;
}
/* Garante que .btn-sm não fique oval */
.btn-sm {
  padding: 5px 10px !important;
  font-size: 12px !important;
  min-height: 26px;
  border-radius: 7px;
}

/* Primary = systemBlue Apple (não preto pesado) */
.btn-primary, .btn-orange {
  background: var(--system-blue) !important;
  color: #fff !important;
  font-weight: 590 !important;
  box-shadow: 0 1px 2px rgba(0, 122, 255, 0.18), inset 0 0.5px 0 rgba(255, 255, 255, 0.18) !important;
  border: none !important;
}
.btn-primary:hover, .btn-orange:hover {
  background: #0066D6 !important;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.25), inset 0 0.5px 0 rgba(255, 255, 255, 0.18) !important;
  transform: none !important;
}
.btn-primary:active, .btn-orange:active {
  background: #0055B8 !important;
  transform: scale(0.97) !important;
  box-shadow: 0 1px 2px rgba(0, 122, 255, 0.18) inset !important;
}

/* Variante "dark" — quando precisar do preto Apple charcoal (não puro) */
.btn-dark {
  background: #1D1D1F !important;
  color: #fff !important;
  font-weight: 590 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.10), inset 0 0.5px 0 rgba(255,255,255,.10) !important;
}
.btn-dark:hover { background: #2C2C2E !important; }
.btn-dark:active { background: #0A0A0A !important; transform: scale(0.97) !important; }

/* Secondary = bordered Apple */
.btn-secondary {
  background: var(--system-background) !important;
  color: var(--label) !important;
  border: 0.5px solid rgba(0,0,0,0.12) !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 1.5px rgba(0,0,0,0.04) !important;
}
.btn-secondary:hover {
  background: var(--system-gray-6) !important;
  border-color: rgba(0,0,0,0.18) !important;
}
.btn-secondary:active { background: var(--system-gray-5) !important; }

/* Ghost / Plain Apple */
.btn-ghost {
  background: transparent !important;
  color: var(--system-blue) !important; /* Apple plain text buttons são azuis */
  border: none !important;
  font-weight: 500 !important;
  padding: 6px 12px !important;
}
.btn-ghost:hover {
  background: rgba(0, 122, 255, 0.08) !important;
  color: var(--system-blue) !important;
}
.btn-ghost.btn-ghost-neutral { color: var(--label) !important; }
.btn-ghost.btn-ghost-neutral:hover { background: rgba(0,0,0,0.04) !important; color: var(--label) !important; }

/* Danger */
.btn-danger {
  background: var(--system-red) !important;
  color: white !important;
  border: none !important;
  font-weight: 590 !important;
  box-shadow: 0 1px 2px rgba(255, 59, 48, 0.18), inset 0 0.5px 0 rgba(255,255,255,0.18) !important;
}
.btn-danger:hover { background: #D9322A !important; }

.btn-sm { padding: 5px 12px !important; font-size: 12px !important; min-height: 24px !important; }
.btn-lg { padding: 9px 20px !important; font-size: 15px !important; min-height: 36px !important; }

/* ─── INPUTS (Apple text field) ─────────────────────── */
input, textarea, select,
.input, .composer-input, .composer-textarea, .composer-from,
.wiz-input, .mkt-input, .settings-input, .flow-input,
input.search, .inbox-search {
  background: var(--system-background) !important;
  border: 0.5px solid var(--border-strong) !important;
  color: var(--label) !important;
  border-radius: var(--apple-r-sm) !important;
  padding: 8px 12px !important;
  font-family: var(--apple-font) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  outline: none !important;
  transition: all 0.15s var(--apple-ease) !important;
  box-shadow: none !important;
}
input:focus, textarea:focus, select:focus,
.input:focus, .composer-input:focus, .wiz-input:focus {
  border-color: var(--system-blue) !important;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15) !important;
  outline: none !important;
}
input::placeholder, textarea::placeholder { color: var(--tertiary-label) !important; }

/* ─── BADGES / PILLS (Apple status) ─────────────────── */
.pill, .badge, .mkt-card-status, .dom-b, .thread-channel {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  border-radius: var(--apple-r-full) !important;
  border: none !important;
  letter-spacing: 0 !important;
  line-height: 1.45 !important;
}
.pill-lab, .thread-channel.email { background: rgba(0, 122, 255, 0.12) !important; color: var(--system-blue) !important; }
.pill-partners { background: rgba(88, 86, 214, 0.12) !important; color: var(--system-indigo) !important; }
.pill-ecom { background: rgba(255, 149, 0, 0.14) !important; color: var(--system-orange) !important; }
.pill-reboot { background: rgba(255, 59, 48, 0.12) !important; color: var(--system-red) !important; }
.pill-novo { background: var(--system-gray-6) !important; color: var(--secondary-label) !important; }
.pill-contatado { background: rgba(255, 204, 0, 0.20) !important; color: #8C6B00 !important; }
.pill-qualificado, .thread-channel.sms { background: rgba(0, 122, 255, 0.12) !important; color: var(--system-blue) !important; }
.pill-reuniao { background: rgba(175, 82, 222, 0.12) !important; color: var(--system-purple) !important; }
.pill-proposta { background: rgba(255, 149, 0, 0.14) !important; color: var(--system-orange) !important; }
.pill-fechado, .mkt-status-sent, .thread-channel.whatsapp { background: rgba(52, 199, 89, 0.14) !important; color: #0A7F33 !important; }
.pill-perdido, .mkt-status-failed, .mkt-status-cancelled { background: rgba(255, 59, 48, 0.12) !important; color: var(--system-red) !important; }
.mkt-status-draft { background: var(--system-gray-6) !important; color: var(--secondary-label) !important; }
.mkt-status-scheduled, .mkt-status-paused { background: rgba(255, 204, 0, 0.20) !important; color: #8C6B00 !important; }
.mkt-status-sending, .mkt-status-active { background: rgba(0, 122, 255, 0.12) !important; color: var(--system-blue) !important; }

.dom-b-ok { background: rgba(52, 199, 89, 0.14) !important; color: #0A7F33 !important; }
.dom-b-warn { background: rgba(255, 204, 0, 0.20) !important; color: #8C6B00 !important; }
.dom-b-err { background: rgba(255, 59, 48, 0.12) !important; color: var(--system-red) !important; }

/* ─── TABLES (Apple list style) ─────────────────────── */
table, .table, .mkt-table {
  background: var(--system-background) !important;
  border-radius: var(--apple-r-lg) !important;
  border: 0.5px solid var(--separator) !important;
  overflow: hidden !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
table thead th, .mkt-table thead th {
  background: var(--secondary-system-grouped-background) !important;
  color: var(--secondary-label) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 10px 14px !important;
  border-bottom: 0.5px solid var(--separator) !important;
}
table tbody td, .mkt-table tbody td {
  padding: 12px 14px !important;
  color: var(--label) !important;
  border-bottom: 0.5px solid var(--separator) !important;
  font-size: 13px !important;
}
table tbody tr:last-child td { border-bottom: none !important; }
table tbody tr:hover { background: var(--tertiary-system-fill) !important; }

/* ─── KANBAN (Apple grouped columns) ────────────────── */
.kb-col {
  background: var(--secondary-system-grouped-background) !important;
  border: 0.5px solid var(--separator) !important;
  border-radius: var(--apple-r-lg) !important;
  padding: 12px !important;
}
.kb-col-head {
  color: var(--label) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding-bottom: 8px !important;
  border-bottom: 0.5px solid var(--separator) !important;
}
.kb-card {
  background: var(--system-background) !important;
  border: 0.5px solid var(--separator) !important;
  border-radius: var(--apple-r-md) !important;
  padding: 12px !important;
  box-shadow: var(--apple-elev-1) !important;
  color: var(--label) !important;
}
.kb-card:hover {
  box-shadow: var(--apple-elev-2) !important;
  transform: none !important;
}

/* ─── INBOX ─────────────────────────────────────────── */
.inbox-root { background: var(--system-background) !important; border: 0.5px solid var(--separator) !important; border-radius: var(--apple-r-lg) !important; overflow: hidden !important; }
.inbox-list { background: var(--secondary-system-grouped-background) !important; border-right: 0.5px solid var(--separator) !important; }
.inbox-list-header { background: var(--secondary-system-grouped-background) !important; border-bottom: 0.5px solid var(--separator) !important; }
.inbox-list-title h1 { font-size: var(--hig-title-2) !important; font-weight: 700 !important; color: var(--label) !important; letter-spacing: -0.02em !important; }

.inbox-search {
  background: var(--tertiary-system-fill) !important;
  border: none !important;
  color: var(--label) !important;
  border-radius: var(--apple-r-sm) !important;
  font-size: 13px !important;
}
.inbox-chip {
  background: var(--tertiary-system-fill) !important;
  color: var(--secondary-label) !important;
  border: none !important;
  font-size: 12px !important;
  padding: 4px 10px !important;
  border-radius: var(--apple-r-full) !important;
}
.inbox-chip:hover { background: var(--secondary-system-fill) !important; color: var(--label) !important; }
.inbox-chip.active { background: var(--label) !important; color: var(--primary-fg) !important; font-weight: 600 !important; }
.inbox-new-btn { background: var(--label) !important; color: var(--primary-fg) !important; border-radius: var(--apple-r-md) !important; }
.inbox-new-btn:hover { background: #1C1C1E !important; }

.thread-item {
  background: transparent !important;
  border-bottom: 0.5px solid var(--separator) !important;
  padding: 12px 16px !important;
}
.thread-item:hover { background: var(--tertiary-system-fill) !important; }
.thread-item.active { background: var(--secondary-system-fill) !important; }
.thread-item.active::before { background: var(--system-blue) !important; }
.thread-item.unread::after { background: var(--system-blue) !important; box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15) !important; }

.thread-avatar {
  background: linear-gradient(135deg, var(--system-gray-3), var(--system-gray-4)) !important;
  color: var(--label) !important;
}
.thread-name { color: var(--label) !important; font-weight: 500 !important; }
.thread-subject { color: var(--secondary-label) !important; }
.thread-snippet { color: var(--tertiary-label) !important; }

.inbox-thread { background: var(--system-background) !important; }
.thread-header { background: var(--system-background) !important; border-bottom: 0.5px solid var(--separator) !important; }
.thread-header h2 { color: var(--label) !important; font-weight: 600 !important; }

.msg.out .msg-bubble {
  background: var(--system-blue) !important;
  color: white !important;
  border: none !important;
}
.msg.in .msg-bubble {
  background: var(--system-gray-6) !important;
  color: var(--label) !important;
  border: none !important;
}
.msg-bubble { box-shadow: none !important; }

.thread-composer { background: var(--system-background) !important; border-top: 0.5px solid var(--separator) !important; }
.composer-textarea { background: var(--tertiary-system-fill) !important; border: none !important; color: var(--label) !important; }
.composer-textarea:focus { background: var(--system-background) !important; border: 0.5px solid var(--system-blue) !important; }
.composer-send { background: var(--system-blue) !important; color: white !important; border-radius: var(--apple-r-full) !important; padding: 7px 16px !important; }
.composer-send:hover { background: #0063CC !important; }

/* ─── TOGGLE iOS-style ──────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
  position: absolute;
  inset: 0;
  background: var(--system-gray-4);
  border-radius: 31px;
  cursor: pointer;
  transition: background 0.25s var(--apple-ease);
}
.toggle-switch .slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 1px 1px rgba(0,0,0,0.16);
  transition: transform 0.25s var(--apple-ease);
}
.toggle-switch input:checked + .slider { background: var(--system-green); }
.toggle-switch input:checked + .slider::after { transform: translateX(20px); }

/* ─── MODAL / SHEET (Apple) ─────────────────────────── */
.modal-overlay, .drawer-overlay, .composer-modal-overlay, .settings-overlay {
  background: rgba(0, 0, 0, 0.36) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.modal, .composer-modal, .settings-modal, .drawer {
  background: var(--system-background) !important;
  border-radius: var(--apple-r-xl) !important;
  border: 0.5px solid var(--separator) !important;
  box-shadow: var(--apple-elev-4) !important;
  color: var(--label) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}
.modal *, .composer-modal *, .settings-modal *, .drawer * {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.drawer-close, .composer-modal-close {
  background: var(--tertiary-system-fill) !important;
  border: none !important;
  color: var(--secondary-label) !important;
  width: 24px !important; height: 24px !important;
  border-radius: 50% !important;
  font-size: 15px !important;
  line-height: 22px !important;
}
.drawer-close:hover, .composer-modal-close:hover { background: var(--secondary-system-fill) !important; color: var(--label) !important; }

/* ─── STATS / KPIs (Apple widget) ───────────────────── */
.stat, .mkt-kpi, .mkt-stat-box, .stat-card {
  background: var(--system-background) !important;
  border: 0.5px solid var(--separator) !important;
  border-radius: var(--apple-r-lg) !important;
  padding: 16px 18px !important;
}
.stat-label, .mkt-kpi-label, .mkt-stat-k, .stat-card__label {
  color: var(--secondary-label) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}
.stat-value, .mkt-kpi-value, .mkt-stat-v, .stat-card__value {
  color: var(--label) !important;
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  font-feature-settings: "tnum", "ss01" !important;
}

/* ─── QUICK ACTIONS ─────────────────────────────────── */
.quick-actions {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 20px !important;
}
.quick-action {
  background: var(--system-background) !important;
  border: 0.5px solid var(--separator) !important;
  border-radius: var(--apple-r-lg) !important;
  padding: 14px 16px !important;
  box-shadow: none !important;
  transition: all 0.15s var(--apple-ease) !important;
}
.quick-action:hover {
  background: var(--system-background) !important;
  border-color: var(--border-hover) !important;
  box-shadow: var(--apple-elev-2) !important;
  transform: none !important;
}
.qa-ico-orange { background: rgba(255, 149, 0, 0.15) !important; color: var(--system-orange) !important; }
.qa-ico-blue { background: rgba(0, 122, 255, 0.12) !important; color: var(--system-blue) !important; }
.qa-ico-purple { background: rgba(175, 82, 222, 0.12) !important; color: var(--system-purple) !important; }
.qa-title { color: var(--label) !important; font-weight: 600 !important; }
.qa-sub { color: var(--secondary-label) !important; font-size: 12px !important; }

/* ─── ONBOARDING ────────────────────────────────────── */
.onb-card {
  background: var(--system-background) !important;
  border: 0.5px solid var(--separator) !important;
  border-radius: var(--apple-r-lg) !important;
  padding: 20px !important;
}
.onb-card::before { display: none !important; }
.onb-title { color: var(--label) !important; font-size: 17px !important; font-weight: 600 !important; }
.onb-sub { color: var(--secondary-label) !important; font-size: 13px !important; }
.onb-progress-bar { background: var(--system-gray-5) !important; }
.onb-progress-fill { background: var(--system-blue) !important; }
.onb-step {
  background: var(--secondary-system-grouped-background) !important;
  border: 0.5px solid var(--separator) !important;
  border-radius: var(--apple-r-md) !important;
  padding: 12px 14px !important;
}
.onb-step:hover { background: var(--tertiary-system-fill) !important; border-color: var(--border-hover) !important; }
.onb-step.done .onb-step-check { background: var(--system-green) !important; border-color: var(--system-green) !important; }
.onb-step-title { color: var(--label) !important; font-size: 14px !important; font-weight: 500 !important; }
.onb-step-desc { color: var(--secondary-label) !important; font-size: 12px !important; }

/* ─── MARKETING ─────────────────────────────────────── */
.mkt-hero {
  background: linear-gradient(135deg, var(--system-background), var(--secondary-system-grouped-background)) !important;
  border: 0.5px solid var(--separator) !important;
  border-radius: var(--apple-r-xl) !important;
  padding: 28px !important;
}
.mkt-hero h1 { font-size: var(--hig-title-1) !important; font-weight: 700 !important; letter-spacing: -0.03em !important; color: var(--label) !important; }
.mkt-hero .sub { color: var(--secondary-label) !important; font-size: 14px !important; }
.mkt-nav { border-bottom: 0.5px solid var(--separator) !important; }
.mkt-nav-tab { color: var(--secondary-label) !important; font-size: 14px !important; }
.mkt-nav-tab.active { color: var(--label) !important; border-bottom-color: var(--label) !important; font-weight: 600 !important; }

/* ─── WIZARD ────────────────────────────────────────── */
.wiz-step {
  background: var(--system-background) !important;
  border: 0.5px solid var(--separator) !important;
  border-radius: var(--apple-r-lg) !important;
}
.wiz-step.active { border-color: var(--system-blue) !important; box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08) !important; }
.wiz-step.done { background: rgba(52, 199, 89, 0.04) !important; border-color: rgba(52, 199, 89, 0.25) !important; }
.wiz-step-num { background: var(--system-gray-5) !important; color: var(--secondary-label) !important; }
.wiz-step.active .wiz-step-num { background: var(--system-blue) !important; color: white !important; }
.wiz-step.done .wiz-step-num { background: var(--system-green) !important; color: white !important; }

/* ─── SETTINGS ──────────────────────────────────────── */
.settings-modal { max-width: 900px !important; }
.settings-head { border-bottom: 0.5px solid var(--separator) !important; padding: 16px 20px !important; }
.settings-body { display: flex !important; }
.settings-tabs {
  background: var(--secondary-system-grouped-background) !important;
  border-right: 0.5px solid var(--separator) !important;
  padding: 8px !important;
  width: 210px !important;
}
.settings-tab {
  color: var(--label) !important;
  padding: 8px 12px !important;
  border-radius: var(--apple-r-sm) !important;
  font-size: 13px !important;
  margin: 1px 0 !important;
}
.settings-tab:hover { background: var(--tertiary-system-fill) !important; }
.settings-tab.active { background: rgba(0, 0, 0, 0.08) !important; color: var(--label) !important; font-weight: 500 !important; }
.settings-content { padding: 24px !important; background: var(--system-background) !important; }

/* ─── CORES DOT (filtro sidebar) ────────────────────── */
.nav-item .dot[style*="#FFFFFF"] { background: var(--system-gray-3) !important; border: 0.5px solid var(--border-strong) !important; }
.nav-item .dot[style*="#FFC440"] { background: var(--system-yellow) !important; }
.nav-item .dot[style*="#FFB020"] { background: #FFB800 !important; }
.nav-item .dot[style*="#FF9B20"] { background: var(--system-orange) !important; }
.nav-item .dot[style*="#FF8A20"] { background: #FF7A00 !important; }
.nav-item .dot[style*="#FF7A20"] { background: #FF6B00 !important; }
.nav-item .dot[style*="#40C8FF"] { background: var(--system-teal) !important; }
.nav-item .dot[style*="#C88FFF"] { background: var(--system-purple) !important; }
.nav-item .dot[style*="#FF6A00"] { background: var(--system-orange) !important; }
.nav-item .dot[style*="#34D380"] { background: var(--system-green) !important; }
.nav-item .dot[style*="#FF5470"] { background: var(--system-red) !important; }

/* ─── LOGIN ─────────────────────────────────────────── */
.login-wrap { background: var(--system-grouped-background) !important; }
.login-split { background: var(--system-grouped-background) !important; }
.login-left {
  background: var(--label) !important;
  color: white !important;
}
.login-left .login-brand { color: white !important; }
.login-left .login-brand img { filter: invert(1) !important; }
.login-pitch h1 { color: white !important; font-weight: 700 !important; letter-spacing: -0.03em !important; }
.login-pitch p { color: rgba(255,255,255,0.7) !important; }
.login-feat { color: white !important; }
.login-feat-dot { background: var(--system-blue) !important; box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2) !important; }
.login-right { background: var(--system-grouped-background) !important; }
.login-card {
  background: var(--system-background) !important;
  border: 0.5px solid var(--separator) !important;
  box-shadow: var(--apple-elev-3) !important;
  border-radius: var(--apple-r-xl) !important;
}

/* ─── SIDEBAR FOOTER ────────────────────────────────── */
.sidebar-footer { margin-top: auto !important; border-top: 0.5px solid var(--separator) !important; padding-top: 8px !important; }
.pending-chip {
  background: rgba(255, 149, 0, 0.12) !important;
  border: 0.5px solid rgba(255, 149, 0, 0.25) !important;
  color: var(--label) !important;
  border-radius: var(--apple-r-md) !important;
  padding: 10px !important;
}

/* ─── TOAST ─────────────────────────────────────────── */
.toast {
  background: var(--label) !important;
  color: white !important;
  border-radius: var(--apple-r-md) !important;
  font-size: 13px !important;
  box-shadow: var(--apple-elev-3) !important;
  padding: 10px 16px !important;
  font-weight: 500 !important;
}
.toast.success { background: var(--system-green) !important; }
.toast.error { background: var(--system-red) !important; }

/* ─── Scrollbars ────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-clip: content-box; background: rgba(0, 0, 0, 0.35); border: 2px solid transparent; }

/* ─── Focus ring (Apple accessibility) ──────────────── */
*:focus-visible {
  outline: 2px solid var(--system-blue) !important;
  outline-offset: 2px !important;
}
*:focus:not(:focus-visible) { outline: none !important; }

/* ─── Remove hard dark overrides antigos ────────────── */
.msg-bubble, .composer-textarea, .composer-from, .composer-header {
  color: inherit;
}

/* ─── Utility: text truncate ───────────────────────── */
.truncate, .thread-name, .thread-subject, .thread-snippet, .mkt-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Calendar — view switcher + pickers ───────────── */
.cal-view-switcher {
  display: inline-flex;
  background: rgba(120,120,128,0.12);
  border-radius: 8px;
  padding: 2px;
  gap: 1px;
}
.cal-view-btn {
  border: none; background: transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--secondary-label);
  cursor: pointer;
  transition: all 0.12s ease;
}
.cal-view-btn:hover { background: rgba(255,255,255,0.4); color: var(--label); }
.cal-view-btn.active {
  background: #fff;
  color: var(--label);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.cal-picker {
  height: 30px;
  padding: 0 24px 0 10px !important;
  border: 0.5px solid var(--separator);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  background: var(--system-background);
  color: var(--label);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23999' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.cal-picker:focus { outline: none; border-color: var(--system-blue); }

/* ─── Week view ─────────────────────────────────── */
.cal-week {
  display: flex; flex-direction: column;
  border: 0.5px solid var(--separator);
  border-radius: 12px;
  overflow: hidden;
  background: var(--system-background);
}
.cal-week-headers {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 0.5px solid var(--separator);
  background: var(--secondary-system-background);
}
.cal-week-head {
  padding: 12px 10px;
  text-align: center;
  border-right: 0.5px solid var(--separator);
}
.cal-week-head:last-child { border-right: none; }
.cal-week-head.today { background: rgba(0,122,255,0.08); }
.cal-week-wd { font-size: 10px; font-weight: 600; color: var(--tertiary-label); text-transform: uppercase; letter-spacing: 0.05em; }
.cal-week-num { font-size: 22px; font-weight: 700; margin-top: 4px; }
.cal-week-head.today .cal-week-num { color: var(--system-blue); }
.cal-week-cols { display: grid; grid-template-columns: repeat(7, 1fr); min-height: 400px; }
.cal-week-col {
  border-right: 0.5px solid var(--separator);
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.cal-week-col:last-child { border-right: none; }
.cal-week-col:hover { background: var(--secondary-system-background); }
.cal-week-task {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  background: rgba(0,122,255,0.1);
  color: var(--label);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.cal-week-task:hover { background: rgba(0,122,255,0.18); }
.cal-week-task .cal-task-icon { width: 14px; height: 14px; flex-shrink: 0; }
.cal-week-task svg { width: 12px; height: 12px; }
.cal-week-empty { color: var(--tertiary-label); font-size: 11px; text-align: center; padding: 8px; }

/* ─── Day view ──────────────────────────────────── */
.cal-day {
  background: var(--system-background);
  border: 0.5px solid var(--separator);
  border-radius: 12px;
  padding: 24px;
  min-height: 400px;
}
.cal-day-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--tertiary-label);
}
.cal-day-empty-icon { font-size: 40px; margin-bottom: 12px; }
.cal-day-empty-title { font-size: 16px; font-weight: 600; color: var(--label); margin-bottom: 4px; }
.cal-day-empty-sub { font-size: 13px; }
.cal-day-list { display: flex; flex-direction: column; gap: 8px; }
.cal-day-task {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  background: var(--secondary-system-background);
  border: 0.5px solid var(--separator);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.cal-day-task:hover { border-color: var(--system-blue); background: rgba(0,122,255,0.04); }
.cal-day-time {
  font-size: 13px; font-weight: 600;
  color: var(--system-blue);
  min-width: 60px;
  font-variant-numeric: tabular-nums;
}
.cal-day-icon { width: 18px; height: 18px; color: var(--secondary-label); flex-shrink: 0; }
.cal-day-icon svg { width: 100%; height: 100%; }
.cal-day-content { flex: 1; min-width: 0; }
.cal-day-title { font-size: 14px; font-weight: 600; color: var(--label); }
.cal-day-notes { font-size: 12px; color: var(--secondary-label); margin-top: 4px; }

/* ─── Year view (12 mini-meses) ─────────────────── */
.cal-year {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.cal-y-month {
  background: var(--system-background);
  border: 0.5px solid var(--separator);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-y-month:hover { border-color: var(--system-blue); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.cal-y-mname {
  font-size: 13px; font-weight: 700;
  color: var(--label);
  margin-bottom: 10px;
}
.cal-y-head, .cal-y-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  font-size: 10px;
}
.cal-y-head {
  margin-bottom: 4px;
  color: var(--tertiary-label);
  font-weight: 600;
}
.cal-y-head span { text-align: center; padding: 2px 0; }
.cal-y-day {
  text-align: center;
  padding: 3px 0;
  border-radius: 4px;
  cursor: pointer;
  color: var(--secondary-label);
  font-weight: 500;
  transition: background 0.1s ease;
}
.cal-y-day:hover { background: var(--secondary-system-background); color: var(--label); }
.cal-y-day.today {
  background: var(--system-blue);
  color: #fff;
  font-weight: 700;
}
.cal-y-day.has-tasks::after {
  content: '';
  display: block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--system-orange);
  margin: 1px auto 0;
}
.cal-y-day.today.has-tasks::after { background: #fff; }
.cal-y-empty { padding: 3px 0; }

/* ─── WhatsApp Connect ─────────────────────────────── */
.wa-connect-overlay {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: skFadeIn 0.18s ease;
}
.wa-connect-modal {
  width: min(680px, 100%); max-height: 90vh;
  background: var(--system-background, #fff);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.24);
  display: flex; flex-direction: column;
}
.wa-connect-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 0.5px solid rgba(60,60,67,0.12);
}
.wa-connect-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.wa-connect-sub { font-size: 12px; color: var(--t3, #888); margin-top: 2px; }
.wa-connect-close {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(120,120,128,0.16); color: var(--t2);
  cursor: pointer; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.wa-connect-close:hover { background: rgba(120,120,128,0.24); }
.wa-connect-body { padding: 22px; overflow-y: auto; flex: 1; }

.wa-loading, .wa-error, .wa-bridge-offline, .wa-connected {
  text-align: center; padding: 30px 20px;
}
.wa-spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(120,120,128,0.2);
  border-top-color: var(--system-blue);
  border-radius: 50%;
  animation: waSpin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes waSpin { to { transform: rotate(360deg); } }
.wa-icon-big { font-size: 56px; margin-bottom: 12px; }
.wa-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.wa-phone { font-size: 22px; font-weight: 600; color: #25D366; font-variant-numeric: tabular-nums; margin: 8px 0; }
.wa-desc { font-size: 13px; color: var(--t2); line-height: 1.5; max-width: 480px; margin: 0 auto; }
.wa-error { color: var(--system-red); padding: 16px; background: rgba(255,59,48,0.08); border-radius: 10px; }

.wa-qr-flow {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: center;
}
@media (max-width: 600px) { .wa-qr-flow { grid-template-columns: 1fr; } }
.wa-steps { display: flex; flex-direction: column; gap: 14px; }
.wa-step {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--t2);
  line-height: 1.4;
}
.wa-step span {
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: #25D366; color: #fff;
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.wa-step b { color: var(--label); }
.wa-qr-box {
  background: #fff;
  border: 1px solid rgba(60,60,67,0.16);
  border-radius: 14px;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.wa-qr {
  width: 280px; height: 280px;
  display: block;
  image-rendering: pixelated;
}
.wa-qr-loading {
  width: 280px; height: 280px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--t3); font-size: 12px;
}
.wa-status-pill {
  font-size: 11px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(0,122,255,0.12); color: var(--system-blue);
}

/* Tabs QR / Phone */
.wa-tabs {
  display: flex; gap: 4px;
  background: rgba(120,120,128,0.12);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 22px;
}
.wa-tab {
  flex: 1;
  border: none; background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--secondary-label);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wa-tab:hover { color: var(--label); }
.wa-tab.active {
  background: #fff;
  color: var(--label);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* Pair flow */
.wa-pair-flow { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media (max-width: 600px) { .wa-pair-flow { grid-template-columns: 1fr; } }
.wa-pair-form {
  display: flex; flex-direction: column;
}
.wa-pair-code-box {
  text-align: center;
  padding: 20px;
  background: #25D366;
  color: #fff;
  border-radius: 12px;
}
.wa-pair-code-label { font-size: 12px; opacity: 0.9; margin-bottom: 8px; }
.wa-pair-code {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.15em;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin: 4px 0;
}
.wa-pair-code-hint {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 8px;
}
.wa-success {
  background: rgba(52,199,89,0.12);
  color: #2c862a;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* ─── Importer (CSV/XLSX) — overlay próprio ───────── */
.imp-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  backdrop-filter: blur(8px) saturate(180%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: impFadeIn 0.18s ease;
}
@keyframes impFadeIn { from { opacity: 0; } to { opacity: 1; } }
.imp-modal {
  width: min(720px, 100%); max-height: 90vh;
  background: var(--system-background, #fff);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.24), 0 4px 16px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  animation: impSlideIn 0.22s cubic-bezier(0.32,0.72,0,1);
}
@keyframes impSlideIn { from { transform: translateY(12px) scale(0.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.imp-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 0.5px solid rgba(60,60,67,0.12);
}
.imp-modal-title { font-size: 17px; font-weight: 700; color: var(--label, #000); letter-spacing: -0.01em; }
.imp-modal-sub { font-size: 12px; color: var(--t3, #888); margin-top: 2px; }
.imp-modal-close {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(120,120,128,0.16); color: var(--t2, #555);
  cursor: pointer; font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.imp-modal-close:hover { background: rgba(120,120,128,0.24); }
.imp-modal-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
  flex: 1;
}
.imp-wrap { display: flex; flex-direction: column; gap: 18px; }
.imp-stepper { display: flex; align-items: center; gap: 8px; padding-bottom: 14px; border-bottom: 0.5px solid rgba(60,60,67,0.18); }
.imp-step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t3); font-weight: 500; padding: 4px 10px; border-radius: 8px; }
.imp-step span { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(60,60,67,0.15); color: var(--t2); font-size: 11px; font-weight: 600; }
.imp-step.active { color: var(--label); background: rgba(0,122,255,0.08); }
.imp-step.active span { background: #007AFF; color: #fff; }
.imp-step.done span { background: var(--system-green); color: #fff; }
.imp-pane { min-height: 280px; }
.imp-help { font-size: 12px; color: var(--t3); margin: 0 0 14px; line-height: 1.5; }

.imp-drop {
  border: 2px dashed rgba(60,60,67,0.25);
  border-radius: 14px; padding: 40px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; transition: all 0.2s ease; background: rgba(120,120,128,0.04);
}
.imp-drop.drag { border-color: #007AFF; background: rgba(0,122,255,0.08); }
.imp-drop-title { font-size: 15px; font-weight: 600; color: var(--label); margin-bottom: 4px; }
.imp-drop-sub { font-size: 12px; color: var(--t3); }
.imp-fileinfo {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: rgba(52,199,89,0.08); border: 0.5px solid rgba(52,199,89,0.24);
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}

.imp-filelist { margin-top: 14px; }
.imp-filelist-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--t2); margin-bottom: 8px; padding: 0 4px;
}
.imp-filelist-items { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.imp-fileitem {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(120,120,128,0.06); border: 0.5px solid rgba(60,60,67,0.12);
}
.imp-fileitem-info { flex: 1; min-width: 0; }
.imp-fileitem-name { font-size: 13px; font-weight: 500; color: var(--label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-fileitem-meta { font-size: 11px; color: var(--t3); margin-top: 2px; }
.imp-fileitem-rm {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: transparent; color: var(--t3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.imp-fileitem-rm:hover { background: rgba(255,59,48,0.12); color: var(--system-red); }

.imp-stats { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 0.5px solid rgba(60,60,67,0.12); }
.imp-stat { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 8px; letter-spacing: 0.2px; }
.imp-stat-ok { background: rgba(52,199,89,0.12); color: var(--system-green); }
.imp-stat-warn { background: rgba(255,149,0,0.12); color: var(--system-orange); }

.imp-map-tag {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px;
  background: rgba(0,122,255,0.1); color: #007AFF; font-size: 10px; font-weight: 600;
  vertical-align: middle;
}

.imp-mapping { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 4px; }
.imp-map-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px; background: rgba(120,120,128,0.06);
}
.imp-map-col { font-size: 13px; font-weight: 500; color: var(--label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-map-sel { font-size: 12px; padding: 6px 10px; }

.imp-preview-wrap { margin-top: 16px; }
.imp-preview-label { font-size: 11px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.imp-preview { border: 0.5px solid rgba(60,60,67,0.18); border-radius: 10px; overflow: auto; max-height: 180px; }
.imp-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.imp-preview-table th { background: rgba(120,120,128,0.08); padding: 8px 10px; text-align: left; font-weight: 600; color: var(--label); border-bottom: 0.5px solid rgba(60,60,67,0.18); position: sticky; top: 0; }
.imp-preview-table td { padding: 7px 10px; border-bottom: 0.5px solid rgba(60,60,67,0.08); color: var(--t2); }
.imp-preview-table tr:last-child td { border-bottom: none; }

.imp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.imp-field label { font-size: 12px; font-weight: 600; color: var(--label); }
.imp-locked-list {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(0,122,255,0.08); border: 0.5px solid rgba(0,122,255,0.24);
  font-size: 13px; color: var(--label);
}

.imp-progress { display: flex; flex-direction: column; gap: 10px; padding: 28px 0; }
.imp-progress-label { font-size: 13px; color: var(--t2); text-align: center; }
.imp-progress-bar { height: 6px; border-radius: 3px; background: rgba(120,120,128,0.16); overflow: hidden; }
.imp-progress-fill { height: 100%; background: linear-gradient(90deg, #007AFF, #34C759); transition: width 0.4s ease; }

.imp-result { margin-top: 18px; }
.imp-result-ok { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; }
.imp-result-count { font-size: 15px; }
.imp-result-stat { font-size: 12px; color: var(--t3); }
.imp-result-err { padding: 14px; border-radius: 10px; background: rgba(255,59,48,0.08); color: var(--system-red); font-size: 13px; }
.imp-result-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

.imp-actions { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 0.5px solid rgba(60,60,67,0.18); }

/* ─── Email Providers (UI de conexão) ──────────────── */
.ep-list { display: flex; flex-direction: column; gap: 10px; }
.ep-card {
  border: 0.5px solid rgba(60,60,67,0.16);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--system-background, #fff);
  transition: border-color 0.15s ease;
}
.ep-card:hover { border-color: rgba(60,60,67,0.32); }
.ep-row { display: flex; align-items: center; gap: 12px; }
.ep-info { flex: 1; min-width: 0; }
.ep-name { font-size: 15px; font-weight: 600; color: var(--label, #000); }
.ep-quota { font-size: 12px; color: var(--t3, #888); margin-top: 2px; }
.ep-meta { font-size: 11px; color: var(--t3, #888); margin-top: 4px; }
.ep-meta code { background: rgba(120,120,128,0.1); padding: 1px 6px; border-radius: 4px; font-size: 10px; }
.ep-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ep-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 6px; }
.ep-badge-ok { background: rgba(52,199,89,0.12); color: var(--system-green, #2c862a); }
.ep-badge-env { background: rgba(0,122,255,0.12); color: #007AFF; }
.ep-badge-off { background: rgba(120,120,128,0.16); color: var(--t3, #888); }
.ep-form {
  margin-top: 12px; padding-top: 12px;
  border-top: 0.5px solid rgba(60,60,67,0.12);
}
.ep-msg {
  margin-top: 10px; padding: 8px 12px;
  font-size: 12px; border-radius: 8px;
}
.ep-msg-ok { background: rgba(52,199,89,0.12); color: var(--system-green, #2c862a); }
.ep-msg-err { background: rgba(255,59,48,0.12); color: var(--system-red, #d70015); }

/* ─── Skills Picker (Cmd+Shift+K) ──────────────────── */
.skills-picker-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(0,0,0,0.32);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  animation: skFadeIn 0.18s ease;
}
@keyframes skFadeIn { from { opacity: 0; } to { opacity: 1; } }
.skills-picker {
  width: min(640px, 92vw); max-height: 70vh;
  background: rgba(255,255,255,0.95);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 16px; border: 0.5px solid rgba(60,60,67,0.18);
  box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  display: flex; flex-direction: column; overflow: hidden;
  animation: skSlideIn 0.18s cubic-bezier(0.32,0.72,0,1);
}
@keyframes skSlideIn { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.skills-picker-search {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 0.5px solid rgba(60,60,67,0.12);
}
.skills-picker-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 15px; color: var(--label); font-family: inherit;
}
.skills-picker-list { flex: 1; overflow-y: auto; padding: 6px; }
.skills-picker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  cursor: pointer; transition: background 0.1s ease;
}
.skills-picker-item.active { background: rgba(0,122,255,0.1); }
.skills-picker-item.active .skills-picker-label { color: #007AFF; }
.skills-picker-meta { flex: 1; min-width: 0; }
.skills-picker-label { font-size: 14px; font-weight: 500; color: var(--label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skills-picker-sub { font-size: 11px; color: var(--t3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skills-picker-empty { padding: 24px; text-align: center; color: var(--t3); font-size: 13px; }
.skills-picker-foot {
  display: flex; gap: 14px; padding: 8px 16px;
  border-top: 0.5px solid rgba(60,60,67,0.12);
  font-size: 11px; color: var(--t3);
}
.skills-picker-foot kbd, .skills-picker-kbd {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: rgba(120,120,128,0.16); color: var(--t2);
  font-family: -apple-system, "SF Mono", monospace; font-size: 10px; font-weight: 600;
  min-width: 18px; text-align: center;
}

/* ─── Blocks Browser (shadcnblocks) ────────────────── */
.skills-blocks-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 4vh;
  animation: skFadeIn 0.18s ease;
}
.skills-blocks {
  width: min(1200px, 95vw); height: min(800px, 92vh);
  background: var(--system-background, #fff);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.24);
  display: flex; flex-direction: column;
}
.skills-blocks-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 0.5px solid rgba(60,60,67,0.12);
}
.skills-blocks-title { font-size: 17px; font-weight: 700; }
.skills-blocks-sub { font-size: 12px; color: var(--t3); margin-top: 2px; }
.skills-blocks-body { flex: 1; display: flex; min-height: 0; }
.skills-blocks-cats {
  width: 200px; flex-shrink: 0; padding: 12px;
  border-right: 0.5px solid rgba(60,60,67,0.12);
  overflow-y: auto;
}
.skills-blocks-cat {
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--t2); margin-bottom: 2px;
  transition: background 0.12s ease;
}
.skills-blocks-cat:hover { background: rgba(120,120,128,0.08); }
.skills-blocks-cat.active { background: rgba(0,122,255,0.12); color: #007AFF; font-weight: 600; }
.skills-blocks-grid {
  flex: 1; padding: 16px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; align-content: start;
}
.skills-blocks-loading, .skills-blocks-empty {
  grid-column: 1 / -1;
  padding: 60px; text-align: center; color: var(--t3); font-size: 13px;
}
.skills-blocks-card {
  border: 0.5px solid rgba(60,60,67,0.16);
  border-radius: 12px; overflow: hidden;
  background: var(--system-background, #fff);
  transition: all 0.18s ease;
  display: flex; flex-direction: column;
}
.skills-blocks-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); border-color: rgba(0,122,255,0.4); }
.skills-blocks-thumb {
  aspect-ratio: 16/10; background: rgba(120,120,128,0.06);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.skills-blocks-thumb img { width: 100%; height: 100%; object-fit: cover; }
.skills-blocks-info { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.skills-blocks-name { font-size: 14px; font-weight: 600; color: var(--label); }
.skills-blocks-desc { font-size: 12px; color: var(--t3); flex: 1; line-height: 1.4; }
.skills-blocks-actions { display: flex; gap: 6px; margin-top: 6px; }
.gd-spin { animation: skSpin 0.8s linear infinite; }
@keyframes skSpin { to { transform: rotate(360deg); } }

/* ─── WhatsApp Connect — Chooser + Meta inventory ───── */
.wa-back-btn {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: rgba(120,120,128,0.12); color: var(--t2);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.wa-back-btn:hover { background: rgba(120,120,128,0.22); color: var(--label); }
.wa-back-btn svg { width: 14px; height: 14px; }

.wa-chooser { display: flex; flex-direction: column; gap: 10px; }
.wa-method {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--system-background, #fff);
  border: 1px solid rgba(60,60,67,0.16);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}
.wa-method:hover {
  border-color: rgba(60,60,67,0.28);
  background: rgba(120,120,128,0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.wa-method-primary {
  border-color: rgba(24,119,242,0.4);
  background: linear-gradient(180deg, rgba(24,119,242,0.04), rgba(24,119,242,0.01));
}
.wa-method-primary:hover {
  border-color: rgba(24,119,242,0.7);
  background: linear-gradient(180deg, rgba(24,119,242,0.06), rgba(24,119,242,0.02));
}
.wa-method-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.wa-method-icon svg { width: 22px; height: 22px; }
.wa-method-body { flex: 1; min-width: 0; }
.wa-method-title {
  font-size: 15px; font-weight: 600;
  color: var(--label);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.wa-method-desc {
  font-size: 12.5px;
  color: var(--t3);
  line-height: 1.45;
}
.wa-method-arrow {
  flex-shrink: 0;
  color: var(--t4);
  display: inline-flex; align-items: center;
}
.wa-method-arrow svg { width: 16px; height: 16px; }
.wa-method:hover .wa-method-arrow { color: var(--label); transform: translateX(2px); transition: transform 0.15s ease; }

.wa-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.wa-badge-rec {
  background: rgba(24,119,242,0.12);
  color: #1877F2;
}

/* Meta Inventory list */
.wa-meta-waiting { text-align: center; padding: 40px 20px; }
.wa-meta-empty { text-align: center; padding: 36px 24px; }
.wa-meta-list { display: flex; flex-direction: column; gap: 8px; }
.wa-num-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(120,120,128,0.04);
  border: 1px solid rgba(60,60,67,0.1);
  border-radius: 12px;
  transition: background 0.15s ease;
}
.wa-num-card:hover { background: rgba(120,120,128,0.08); }
.wa-num-card.connected {
  background: rgba(37,211,102,0.06);
  border-color: rgba(37,211,102,0.25);
}
.wa-num-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.wa-num-icon svg { width: 18px; height: 18px; }
.wa-num-body { flex: 1; min-width: 0; }
.wa-num-title {
  font-size: 14px; font-weight: 600;
  color: var(--label);
  font-variant-numeric: tabular-nums;
}
.wa-num-sub {
  font-size: 11.5px;
  color: var(--t3);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
