/* ==========================================================================
   ZapForge V6 Polished — Design System Tokens & Motion Physics
   Fidelidade Cirúrgica aos Mockups (Emil Kowalski / Linear inspired)
   ========================================================================== */

:root {
  /* Emerald Palette */
  --emerald-50:  #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;
  --emerald-900: #064e3b;

  /* Primary Accent & Brand */
  --accent: #059669;
  --accent-base: #059669;
  --accent-hover: #047857;
  --accent-subtle: rgba(16, 185, 129, 0.12);
  --accent-glow: rgba(5, 150, 105, 0.2);
  --accent-focus: rgba(16, 185, 129, 0.35);

  /* Light Theme Canvas & Surfaces */
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --bg-elevated: #ffffff;

  /* Sidebar Tokens (Permanent Dark Slate / Navy in Both Themes) */
  --sidebar-bg: #09131a;
  --sidebar-bg-elevated: #111e29;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text-primary: #f8fafc;
  --sidebar-text-secondary: #94a3b8;
  --sidebar-text-muted: #64748b;
  --sidebar-text-dim: #475569;
  --sidebar-item-active-bg: rgba(16, 185, 129, 0.16);
  --sidebar-item-active-text: #34d399;

  /* Borders */
  --border-subtle: #f1f5f9;
  --border-default: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Typography */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Status Colors */
  --status-ok: #059669;
  --status-ok-bg: #ecfdf5;
  --status-warn: #d97706;
  --status-warn-bg: #fffbeb;
  --status-danger: #dc2626;
  --status-danger-bg: #fef2f2;
  --status-info: #2563eb;
  --status-info-bg: #eff6ff;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-popover: 0 12px 36px -4px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.05);
  --shadow-modal: 0 24px 48px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);

  /* Animation Physics */
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --spring-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --duration-micro: 120ms;
  --duration-fast: 200ms;
  --duration-base: 320ms;
}

:root[data-theme="dark"] {
  --bg-canvas: #080c10;
  --bg-surface: #0e161c;
  --bg-surface-hover: #142028;
  --bg-subtle: #121d24;
  --bg-elevated: #182630;

  --border-subtle: #16252e;
  --border-default: #1f333f;
  --border-strong: #2a4454;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --accent: #10b981;
  --accent-base: #10b981;
  --accent-hover: #34d399;
  --accent-subtle: rgba(16, 185, 129, 0.15);
  --accent-glow: rgba(16, 185, 129, 0.3);
  --accent-focus: rgba(16, 185, 129, 0.45);

  --status-ok: #34d399;
  --status-ok-bg: rgba(16, 185, 129, 0.14);
  --status-warn: #fbbf24;
  --status-warn-bg: rgba(245, 158, 11, 0.14);
  --status-danger: #f87171;
  --status-danger-bg: rgba(239, 68, 68, 0.14);
  --status-info: #60a5fa;
  --status-info-bg: rgba(37, 99, 235, 0.14);

  --shadow-popover: 0 12px 36px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-default);
  --shadow-modal: 0 24px 48px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-strong);
}

/* ==========================================================================
   1. PERMANENT DARK SIDEBAR (Both Light and Dark Modes)
   ========================================================================== */

.sidebar,
:root[data-theme="light"] .sidebar,
:root[data-theme="dark"] .sidebar {
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--sidebar-border) !important;
  color: var(--sidebar-text-primary) !important;
  display: flex !important;
  flex-direction: column !important;
  width: var(--sidebar-w, 260px) !important;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.18) !important;
  padding: 16px 12px !important;
}

/* Brand & Logo */
.sidebar .brand,
.sidebar .zf-app-brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 10px 16px !important;
  text-decoration: none !important;
}
.sidebar .brand .brand-name,
.sidebar .zf-app-brand b {
  font-size: 19px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  color: #ffffff !important;
  display: inline-block !important;
}
.sidebar .brand .brand-name .brand-accent,
.sidebar .zf-app-brand b span {
  color: var(--emerald-500, #10b981) !important;
}
.sidebar .zf-app-brand small {
  color: var(--sidebar-text-muted) !important;
  font-size: 11px !important;
}

/* Sidebar Action Button "+ Nova conversa" */
.sidebar .sidebar-action-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 9px 14px !important;
  margin-bottom: 12px !important;
  border-radius: 9px !important;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500)) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
  transition: all var(--duration-fast) ease !important;
}
.sidebar .sidebar-action-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35) !important;
}

/* Workspace Selector Card */
.sidebar .acct-switch {
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  background: var(--sidebar-bg-elevated) !important;
  border: 1px solid var(--sidebar-border) !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  margin: 0 0 12px !important;
  color: var(--sidebar-text-primary) !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all var(--duration-fast) ease !important;
}
.sidebar .acct-switch:hover {
  background: #162534 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
.sidebar .acct-switch .avatar {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500)) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  display: grid !important;
  place-items: center !important;
  flex: none !important;
}
.sidebar .acct-switch .who b {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.sidebar .acct-switch .who span {
  font-size: 11px !important;
  color: var(--sidebar-text-muted) !important;
  display: block !important;
}
.sidebar .acct-switch .icon {
  color: var(--sidebar-text-muted) !important;
  margin-left: auto !important;
}

/* Navigation Groups & Items */
.sidebar .nav-group {
  margin-top: 10px !important;
}
.sidebar .nav-label {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: var(--sidebar-text-muted) !important;
  padding: 5px 10px !important;
}
.sidebar .nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  color: var(--sidebar-text-secondary) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  background: transparent !important;
  border: none !important;
  text-decoration: none !important;
  transition: all var(--duration-micro) ease !important;
  position: relative !important;
}
.sidebar .nav-item .icon {
  width: 18px !important;
  height: 18px !important;
  color: var(--sidebar-text-muted) !important;
  transition: color var(--duration-micro) ease !important;
}
.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}
.sidebar .nav-item:hover .icon {
  color: #ffffff !important;
}
.sidebar .nav-item.active {
  background: var(--sidebar-item-active-bg) !important;
  color: var(--sidebar-item-active-text) !important;
  font-weight: 600 !important;
}
.sidebar .nav-item.active .icon {
  color: var(--emerald-400, #34d399) !important;
}
.sidebar .nav-item.active::before {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 15% !important;
  bottom: 15% !important;
  width: 3px !important;
  border-radius: 0 4px 4px 0 !important;
  background: var(--emerald-500, #10b981) !important;
}

/* Lower Pro Plan Usage Card */
.sidebar .usage-card {
  margin-top: auto !important;
  background: var(--sidebar-bg-elevated) !important;
  border: 1px solid var(--sidebar-border) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  color: var(--sidebar-text-primary) !important;
}
.sidebar .usage-card .uc-head {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.sidebar .usage-card .uc-sub {
  font-size: 11px !important;
  color: var(--sidebar-text-muted) !important;
  margin-top: 3px !important;
}
.sidebar .usage-card .uc-bar {
  height: 5px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  margin: 8px 0 10px !important;
  overflow: hidden !important;
}
.sidebar .usage-card .uc-bar > i {
  display: block !important;
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, var(--emerald-600), var(--emerald-400)) !important;
}
.sidebar .uc-upgrade {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  background: var(--emerald-500, #10b981) !important;
  color: #ffffff !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
  transition: all var(--duration-fast) ease !important;
}
.sidebar .uc-upgrade:hover {
  background: var(--emerald-400, #34d399) !important;
  transform: translateY(-1px) !important;
}

/* ==========================================================================
   2. REFINED TOPBAR
   ========================================================================== */

.topbar {
  height: var(--topbar-h, 60px) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border-default) !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 0 24px !important;
}

/* Global Search Input (⌘K) */
.global-search-wrap {
  position: relative !important;
  width: min(440px, 42vw) !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 14px !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 999px !important;
  background: var(--bg-subtle) !important;
  color: var(--text-muted) !important;
  transition: all var(--duration-micro) ease !important;
}
.global-search-wrap:focus-within {
  border-color: var(--accent-base) !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 0 0 3px var(--accent-focus) !important;
}
.global-search-wrap input {
  flex: 1 !important;
  min-width: 0 !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 13px !important;
  color: var(--text-primary) !important;
}
.global-search-wrap input::placeholder {
  color: var(--text-muted) !important;
}

/* Operational Health Pill */
.system-health {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all var(--duration-micro) ease !important;
  border: 1px solid transparent !important;
}
.system-health i {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  flex: none !important;
}
.system-health.ok {
  background: var(--status-ok-bg) !important;
  color: var(--status-ok) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}
.system-health.ok i {
  background: var(--emerald-500, #10b981) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}
.system-health.warn {
  background: var(--status-warn-bg) !important;
  color: var(--status-warn) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
}
.system-health.warn i {
  background: var(--status-warn) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
}

/* Notification Bell Button */
.notification-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-default) !important;
  background: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  display: grid !important;
  place-items: center !important;
  position: relative !important;
}
.notification-btn:hover {
  background: var(--bg-surface-hover) !important;
  color: var(--text-primary) !important;
}
.bell-dot {
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  min-width: 16px !important;
  height: 16px !important;
  border-radius: 8px !important;
  padding: 0 4px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  background: var(--status-danger) !important;
  display: grid !important;
  place-items: center !important;
  box-shadow: 0 0 0 2px var(--bg-surface) !important;
}

/* Account Topbar Button */
.account-top {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  height: 38px !important;
  padding: 3px 12px 3px 5px !important;
  border-radius: 999px !important;
  border: 1px solid var(--border-default) !important;
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}
.account-top:hover {
  background: var(--bg-surface-hover) !important;
}
.account-top .avatar {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: #1e293b !important;
  color: #f8fafc !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   3. BUTTONS & FILTER PILLS
   ========================================================================== */

.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 9px 16px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: transform var(--duration-micro) var(--spring-smooth),
              background var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease,
              border-color var(--duration-fast) ease !important;
  white-space: nowrap !important;
  border: 1px solid transparent !important;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px) !important;
}
.btn:active:not(:disabled) {
  transform: scale(0.98) translateY(0) !important;
}

/* Primary Button (Solid Emerald) */
.btn-primary {
  background: var(--emerald-600, #059669) !important;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.28) !important;
  border-color: rgba(5, 150, 105, 0.5) !important;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.38) !important;
}

/* Secondary / Ghost Button */
.btn-ghost {
  background: var(--bg-surface) !important;
  border-color: var(--border-default) !important;
  color: var(--text-primary) !important;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-surface-hover) !important;
  border-color: var(--border-strong) !important;
}

/* Danger Button */
.btn-danger {
  background: var(--status-danger-bg) !important;
  color: var(--status-danger) !important;
  border-color: rgba(220, 38, 38, 0.25) !important;
}
.btn-danger:hover:not(:disabled) {
  background: #fee2e2 !important;
}

/* Filter Chips / Segmented Buttons */
.segmented {
  display: inline-flex !important;
  gap: 6px !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  flex-wrap: wrap !important;
}
.segmented button {
  border: 1px solid var(--border-default) !important;
  background: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all var(--duration-micro) ease !important;
}
.segmented button:hover {
  background: var(--bg-surface-hover) !important;
  color: var(--text-primary) !important;
}
.segmented button.active {
  background: var(--emerald-600, #059669) !important;
  border-color: var(--emerald-600, #059669) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25) !important;
}

/* ==========================================================================
   4. SEMANTIC STATUS BADGES
   ========================================================================== */

.pill, .status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  border: 1px solid transparent !important;
}
.pill:before, .status-badge i {
  content: "" !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: currentColor !important;
  flex: none !important;
}

/* Conectada / Ativo */
.pill.ok, .status-badge.ok {
  background: var(--status-ok-bg) !important;
  color: var(--status-ok) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}

/* Em conexão / Pendente */
.pill.warn, .status-badge.warn {
  background: var(--status-warn-bg) !important;
  color: var(--status-warn) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
}

/* Desconectada / Suspensa */
.pill.danger, .status-badge.danger {
  background: var(--status-danger-bg) !important;
  color: var(--status-danger) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

/* Offline / Inativo */
.pill.off, .status-badge.off {
  background: var(--bg-subtle) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-default) !important;
}

/* ==========================================================================
   5. SPECIFIC SCREEN STYLING & REDESIGN DETAILS
   ========================================================================== */

/* 07 Detalhe da Instância */
.instance-summary {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 20px !important;
}
.instance-summary > div {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  box-shadow: var(--shadow-xs) !important;
}
.instance-summary span {
  display: block !important;
  font-size: 11px !important;
  color: var(--text-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  font-weight: 700 !important;
}
.instance-summary b {
  display: block !important;
  margin-top: 4px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

/* 08 Aquecimento (Warmup) */
.warmup-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 14px !important;
  padding: 18px !important;
  box-shadow: var(--shadow-sm) !important;
}
.progress {
  height: 8px !important;
  border-radius: 999px !important;
  background: var(--bg-subtle) !important;
  overflow: hidden !important;
  margin: 12px 0 !important;
}
.progress-bar {
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, var(--emerald-600), var(--emerald-400)) !important;
  transition: width 300ms ease !important;
}
.switch {
  width: 42px !important;
  height: 24px !important;
  border-radius: 999px !important;
  background: var(--border-strong) !important;
  position: relative !important;
  cursor: pointer !important;
  transition: background var(--duration-fast) ease !important;
}
.switch:after {
  content: "" !important;
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  transition: transform var(--duration-fast) var(--spring-smooth) !important;
}
.switch.on {
  background: var(--emerald-500, #10b981) !important;
}
.switch.on:after {
  transform: translateX(18px) !important;
}

/* 09 & 30 Live Inbox & Chat Screen Redesign */
.conversation-layout {
  display: grid !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 14px !important;
  background: var(--bg-surface) !important;
  overflow: hidden !important;
  height: calc(100vh - 180px) !important;
  min-height: 560px !important;
}
.conversation-list {
  background: var(--bg-surface) !important;
  border-right: 1px solid var(--border-subtle) !important;
}
.conversation-item {
  transition: background var(--duration-micro) ease !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--border-subtle) !important;
}
.conversation-item:hover {
  background: var(--bg-surface-hover) !important;
}
.conversation-item.active {
  background: rgba(16, 185, 129, 0.08) !important;
  border-left: 3px solid var(--emerald-500, #10b981) !important;
}
.conversation-bubble.user {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border-radius: 14px 14px 14px 2px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid var(--border-default) !important;
}
:root[data-theme="dark"] .conversation-bubble.user {
  background: var(--bg-subtle) !important;
  border-color: var(--border-default) !important;
}
.conversation-bubble.assistant,
.conversation-bubble.operator {
  background: var(--emerald-50, #ecfdf5) !important;
  color: var(--emerald-950, #064e3b) !important;
  border-radius: 14px 14px 2px 14px !important;
  border: 1px solid var(--emerald-200, #a7f3d0) !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.08) !important;
}
:root[data-theme="dark"] .conversation-bubble.assistant,
:root[data-theme="dark"] .conversation-bubble.operator {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #f8fafc !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
.chat-date-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 12px auto !important;
  padding: 4px 14px !important;
  border-radius: 999px !important;
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-default) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
}

/* 11 & 29 Automation Studio */
.flow-viewport {
  background-color: var(--bg-canvas) !important;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px) !important;
  background-size: 20px 20px !important;
}
.flow-node {
  border-radius: 12px !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  box-shadow: var(--shadow-md) !important;
}
.flow-node.selected {
  border-color: var(--emerald-500, #10b981) !important;
  box-shadow: 0 0 0 2px var(--accent-focus), var(--shadow-md) !important;
}
.flow-node.trigger { border-left: 4px solid #2563eb !important; }
.flow-node.logic   { border-left: 4px solid #f59e0b !important; }
.flow-node.action  { border-left: 4px solid #10b981 !important; }
.flow-node.ai      { border-left: 4px solid #8b5cf6 !important; }
.flow-node.tool    { border-left: 4px solid #06b6d4 !important; }
.flow-node.data    { border-left: 4px solid #64748b !important; }

.flow-edge-line {
  stroke: var(--border-strong) !important;
  stroke-width: 2 !important;
}
.run-fired .flow-edge-line {
  stroke: var(--emerald-500, #10b981) !important;
  stroke-width: 2.5 !important;
}

/* 12 & 13 Agentes de IA e Estúdio */
.agent-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 14px !important;
  padding: 18px !important;
  box-shadow: var(--shadow-xs) !important;
  transition: all var(--duration-fast) ease !important;
}
.agent-card:hover {
  transform: translateY(-2px) !important;
  border-color: var(--emerald-500, #10b981) !important;
  box-shadow: var(--shadow-md) !important;
}
.agent-orb {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.3)) !important;
  color: var(--emerald-600, #059669) !important;
  display: grid !important;
  place-items: center !important;
}

/* 14 Diff de Versões */
.diff-row {
  border: 1px solid var(--border-default) !important;
  border-radius: 10px !important;
  padding: 12px !important;
  background: var(--bg-surface) !important;
}
.diff-val.old {
  color: var(--status-danger) !important;
  background: var(--status-danger-bg) !important;
  padding: 6px 10px !important;
  border-radius: 6px !important;
}
.diff-val.new {
  color: var(--status-ok) !important;
  background: var(--status-ok-bg) !important;
  padding: 6px 10px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
}

/* 15 & 16 Bases de Conhecimento */
.knowledge-explainer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 16px 20px !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 14px !important;
  margin-bottom: 20px !important;
}
.knowledge-explainer > div {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.retrieval-hit {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 10px !important;
  padding: 12px !important;
  margin-top: 10px !important;
}
.retrieval-hit span {
  color: var(--emerald-600, #059669) !important;
  font-weight: 700 !important;
}

/* 17 Observabilidade */
.runtime-table {
  width: 100% !important;
  border-collapse: collapse !important;
}
.runtime-table th, .runtime-table td {
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--border-subtle) !important;
}
.log-pill.error { background: var(--status-danger-bg); color: var(--status-danger); }
.log-pill.warn  { background: var(--status-warn-bg); color: var(--status-warn); }
.log-pill.info  { background: var(--status-info-bg); color: var(--status-info); }
.log-pill.ok    { background: var(--status-ok-bg); color: var(--status-ok); }

/* 18 Go Live */
.golive-hero {
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-subtle)) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 16px !important;
  padding: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 20px !important;
}
.score-ring {
  width: 84px !important;
  height: 84px !important;
  border-radius: 50% !important;
  background: conic-gradient(var(--emerald-500) calc(var(--score) * 1%), var(--border-default) 0) !important;
  display: grid !important;
  place-items: center !important;
  position: relative !important;
}
.score-ring:before {
  content: "" !important;
  position: absolute !important;
  inset: 8px !important;
  border-radius: 50% !important;
  background: var(--bg-surface) !important;
}
.score-ring span {
  position: relative !important;
  z-index: 1 !important;
  font-size: 20px !important;
  font-weight: 800 !important;
}

/* 21 Developers Playground */
.api-code {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-radius: 10px !important;
  padding: 14px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-size: 12px !important;
}

/* 22 Planos */
.plan.current,
.zf-price-grid article.popular {
  border: 2px solid var(--emerald-500, #10b981) !important;
  box-shadow: 0 10px 28px -10px rgba(16, 185, 129, 0.35) !important;
}

/* 24 Matriz de Acessos */
input[type="checkbox"] {
  accent-color: var(--emerald-500, #10b981) !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 4px !important;
}

/* ==========================================================================
   V6 Screens: tabelas, menus de linha e componentes compartilhados
   ========================================================================== */
.ta-r { text-align: right; }
.zf-muted { color: var(--text-muted); font-size: 13px; }
.zf-num { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; }
.segmented .seg-count { margin-left: 6px; font-weight: 700; opacity: .85; }
.segmented button .icon { margin-right: 4px; }
.card-table.zf-table, .card-table.zf-inst-table { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 14px; box-shadow: var(--shadow-xs); overflow: visible; }
.zf-table table, .zf-inst-table table { border: 0; border-radius: 14px; background: transparent; }
.zf-table thead th, .zf-inst-table thead th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 14px 20px; background: var(--bg-subtle); border-bottom: 1px solid var(--border-default); text-align: left; }
.zf-table thead th.ta-r, .zf-inst-table thead th.ta-r { text-align: right; }
.zf-table tbody td, .zf-inst-table tbody td { padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.zf-table tbody tr:last-child td, .zf-inst-table tbody tr:last-child td { border-bottom: 0; }
.zf-table tbody tr, .zf-inst-table tbody tr { transition: background var(--duration-micro) ease; }
.zf-inst-table tbody tr[data-open], .zf-table tbody tr[data-open] { cursor: pointer; }
.zf-table tbody tr:hover, .zf-inst-table tbody tr:hover { background: var(--bg-surface-hover); }
.zf-inst-id { display: flex; align-items: center; gap: 14px; }
.zf-inst-id b, .zf-cell-title b { display: block; font-size: 14px; color: var(--text-primary); font-weight: 600; }
.zf-inst-id small, .zf-cell-title small { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.zf-wa { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #25d366; flex: none; }
.zf-wa .icon { width: 20px; height: 20px; stroke: #fff; }
.zf-hook { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.zf-hook i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.zf-hook.on { color: var(--text-secondary); }
.zf-hook.on i { background: var(--emerald-500); box-shadow: 0 0 0 3px var(--accent-subtle); }
.zf-row-menu { position: relative; display: inline-block; }
.zf-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 160px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 10px; box-shadow: var(--shadow-popover); padding: 6px; display: flex; flex-direction: column; }
.zf-menu[hidden] { display: none; }
.zf-menu a, .zf-menu button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--text-primary); background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; }
.zf-menu a:hover, .zf-menu button:hover { background: var(--bg-surface-hover); }
.zf-menu button[data-del] { color: var(--status-danger); }

/* 07 Detalhe da instância */
.zf-crumbs { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.zf-crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); text-decoration: none; }
.zf-crumbs a .icon { transform: rotate(90deg); width: 14px; height: 14px; }
.zf-crumbs a:hover { color: var(--accent); }
.zf-crumbs b { color: var(--text-secondary); font-weight: 600; }
.zf-hero-card { display: flex; align-items: center; gap: 20px; padding: 20px 24px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 16px; box-shadow: var(--shadow-xs); }
.zf-hero-ico { width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-subtle); flex: none; }
.zf-hero-ico .icon { width: 40px; height: 40px; stroke: #fff; background: #25d366; border-radius: 50%; padding: 7px; }
.zf-hero-text { flex: 1; min-width: 0; }
.zf-hero-text h1 { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; margin: 0; color: var(--text-primary); }
.zf-hero-text p { margin: 4px 0 2px; color: var(--text-secondary); font-size: 14px; }
.zf-hero-text small { color: var(--text-muted); font-size: 13px; }
.zf-hero-card .actions { display: flex; gap: 10px; }
.btn-danger-soft { background: var(--status-danger-bg); color: var(--status-danger); border: 1px solid color-mix(in srgb, var(--status-danger) 35%, transparent); }
.btn-danger-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--status-danger) 14%, var(--bg-surface)); }
.zf-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-default); margin: 20px 0 20px; overflow-x: auto; }
.zf-tabs button { background: none; border: 0; padding: 12px 18px; font-size: 14px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; transition: color var(--duration-micro) ease, border-color var(--duration-fast) var(--spring-smooth); }
.zf-tabs button:hover { color: var(--text-primary); }
.zf-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.zf-subtabs { margin: -4px 0 16px; width: fit-content; }
.zf-pane { padding: 24px; }
.zf-overview { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.zf-card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0 0 16px; }
.zf-card-title span { font-weight: 400; color: var(--text-muted); }
.zf-ov-main { padding: 22px; }
.zf-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding-bottom: 22px; margin-bottom: 20px; border-bottom: 1px solid var(--border-subtle); }
.zf-metric { border: 1px solid var(--border-default); border-radius: 12px; padding: 16px 18px; background: var(--bg-surface); }
.zf-metric b { display: block; font-size: 24px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.zf-metric span { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.zf-chart-head { display: flex; justify-content: space-between; align-items: center; }
.zf-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-muted); }
.zf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.zf-legend i { width: 8px; height: 8px; border-radius: 50%; }
.zf-legend i.s, .zf-bar-col i.s { background: var(--emerald-500); }
.zf-legend i.r, .zf-bar-col i.r { background: #38bdf8; }
.zf-bars { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: 220px auto; column-gap: 8px; }
.zf-bars-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--text-dim); text-align: right; padding-bottom: 2px; }
.zf-bars-plot { display: grid; grid-template-columns: repeat(24, 1fr); gap: 6px; align-items: end; border-bottom: 1px solid var(--border-default); background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--border-subtle) calc(25% - 1px), var(--border-subtle) 25%); }
.zf-bar-col { height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.zf-bar-col i { width: 42%; border-radius: 4px 4px 0 0; min-height: 2px; transition: height var(--duration-base) var(--spring-smooth); }
.zf-bar-col i.s { background: linear-gradient(to top, var(--emerald-600), var(--emerald-400)); }
.zf-bars-x { grid-column: 2; display: grid; grid-template-columns: repeat(24, 1fr); gap: 6px; font-size: 11px; color: var(--text-dim); margin-top: 8px; }
.zf-info { padding: 22px; }
.zf-info-row { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--border-subtle); }
.zf-info-row:last-child { border-bottom: 0; }
.zf-info-row > .icon { color: var(--text-muted); margin-top: 2px; flex: none; }
.zf-info-row span { display: block; font-size: 12.5px; color: var(--text-muted); }
.zf-info-row b { display: block; font-size: 14px; font-weight: 500; color: var(--text-primary); margin-top: 3px; word-break: break-all; }
@media (max-width: 1100px) { .zf-overview { grid-template-columns: 1fr; } .zf-metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .zf-hero-card { flex-wrap: wrap; } .zf-hero-card .actions { width: 100%; } }

/* 08 Aquecimento */
.zf-pad { padding: 22px; }
.zf-select { min-width: 280px; height: 42px; border-radius: 10px; }
.zf-warm-hero { padding: 24px; }
.zf-warm-top { display: flex; gap: 24px; align-items: center; }
.zf-warm-ico { width: 132px; height: 104px; border-radius: 14px; background: var(--bg-subtle); display: flex; align-items: flex-end; justify-content: center; gap: 7px; padding-bottom: 30px; flex: none; }
.zf-warm-ico i { width: 11px; border-radius: 4px; background: linear-gradient(to top, var(--emerald-600), var(--emerald-400)); }
.zf-warm-ico i:nth-child(1) { height: 18px; } .zf-warm-ico i:nth-child(2) { height: 30px; } .zf-warm-ico i:nth-child(3) { height: 44px; }
.zf-warm-progress { flex: 1; min-width: 0; }
.zf-warm-progress h2 { margin: 0; font-size: 19px; font-weight: 700; color: var(--text-primary); }
.zf-warm-progress p { margin: 6px 0 14px; color: var(--text-muted); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.zf-progress-row { display: flex; align-items: center; gap: 14px; }
.zf-progress-row .progress { flex: 1; height: 10px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
.zf-progress-row .progress-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--emerald-600), var(--emerald-400)); }
.zf-progress-row b { font-size: 13px; color: var(--text-secondary); white-space: nowrap; font-weight: 600; }
.zf-phase { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.zf-phase b { color: var(--text-primary); }
.zf-stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.zf-stat { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border-default); border-radius: 12px; padding: 14px 16px; }
.zf-stat > .icon { width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--accent-subtle); color: var(--accent); flex: none; }
.zf-stat b { display: block; font-size: 20px; font-weight: 700; color: var(--text-primary); }
.zf-stat span { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.txt-ok { color: var(--status-ok) !important; } .txt-warn { color: var(--status-warn) !important; } .txt-danger { color: var(--status-danger) !important; } .txt-off { color: var(--text-muted) !important; }
.zf-warm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-top: 20px; align-items: start; }
.zf-area { width: 100%; height: 260px; display: block; }
.zf-area .grid { stroke: var(--border-subtle); stroke-width: 1; }
.zf-area text { font-size: 11px; fill: var(--text-dim); }
.zf-area .line { fill: none; stroke: var(--emerald-500); stroke-width: 2.5; stroke-linejoin: round; }
.zf-area .future { fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-dasharray: 5 5; }
.zf-area .pt { fill: var(--emerald-500); stroke: var(--bg-surface); stroke-width: 2; }
.zf-area .now { fill: var(--bg-surface); stroke: var(--emerald-500); stroke-width: 3; }
.zf-toggle-line { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--border-subtle); font-size: 14px; color: var(--text-secondary); }
.zf-warm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
@media (max-width: 1100px) { .zf-warm-grid { grid-template-columns: 1fr; } .zf-stat-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .zf-warm-top { flex-direction: column; align-items: stretch; } .zf-warm-ico { display: none; } .zf-select { min-width: 0; width: 100%; } }

/* 12 Agentes de IA */
.zf-head-pill { vertical-align: middle; margin-left: 10px; font-size: 12px; }
.zf-tabs-count button span { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 6px; border-radius: 99px; background: var(--bg-subtle); color: var(--text-muted); font-size: 11.5px; font-weight: 600; }
.zf-tabs-count button.active span { background: var(--accent-subtle); color: var(--accent); }
.zf-select-sm { min-width: 180px; }
.zf-agent-list { display: flex; flex-direction: column; gap: 10px; }
.zf-agent-row { display: flex; align-items: center; gap: 18px; padding: 16px 20px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow-xs); transition: transform var(--duration-fast) var(--spring-smooth), box-shadow var(--duration-fast) ease, border-color var(--duration-fast) ease; }
.zf-agent-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.zf-orb { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; color: var(--orb); background: color-mix(in srgb, var(--orb) 14%, var(--bg-surface)); }
.zf-orb .icon { width: 24px; height: 24px; }
.zf-agent-main { flex: 1; min-width: 0; }
.zf-agent-main b { font-size: 15px; color: var(--text-primary); }
.zf-agent-main p { margin: 3px 0 8px; font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.zf-chips span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); background: var(--bg-subtle); border-radius: 6px; padding: 3px 8px; }
.zf-chips .icon { width: 12px; height: 12px; }
.zf-agent-state { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-left: 18px; border-left: 1px solid var(--border-subtle); min-width: 150px; }
.zf-agent-state small { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.zf-agent-state small i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.zf-runtime-foot { margin-top: 18px; }
@media (max-width: 720px) { .zf-agent-state { display: none; } .zf-agent-main p { white-space: normal; } }
.toolbar .zf-select, .actions .zf-select { width: auto; flex: none; }

/* 14 Comparar versões */
.zf-diff { display: flex; flex-direction: column; gap: 16px; }
.zf-diff-heads { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.zf-vcard { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 18px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface); }
.zf-vcard b { display: block; font-size: 15px; color: var(--text-primary); }
.zf-vcard small { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.zf-diff-arrow { color: var(--text-dim); }
.zf-diff-tabs { width: fit-content; max-width: 100%; overflow-x: auto; }
.zf-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--status-warn); margin-left: 4px; vertical-align: middle; }
.zf-diff-cols { max-height: 46vh; overflow: auto; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface); }
.zf-dtable { display: flex; flex-direction: column; }
.zf-drow { display: grid; grid-template-columns: 1fr 1fr; }
.zf-drow > .zf-dl:first-child { border-right: 1px solid var(--border-default); }
.zf-dhead { position: sticky; top: 0; z-index: 1; background: var(--bg-subtle); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border-default); }
.zf-dhead span { padding: 9px 14px; }
.zf-dhead span:first-child { border-right: 1px solid var(--border-default); }
.zf-dl { display: grid; grid-template-columns: 38px 18px 1fr; align-items: start; min-height: 32px; border-bottom: 1px solid var(--border-subtle); }
.zf-dl:last-child { border-bottom: 0; }
.zf-dl .no { padding: 7px 0; text-align: center; font-size: 11.5px; color: var(--text-dim); border-right: 1px solid var(--border-subtle); align-self: stretch; }
.zf-dl .mk { padding: 7px 0; text-align: center; font-weight: 700; font-size: 12px; }
.zf-dl code { padding: 7px 10px 7px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; color: var(--text-secondary); background: none; }
.zf-dl.del { background: var(--status-danger-bg); } .zf-dl.del .mk, .zf-dl.del code { color: var(--status-danger); }
.zf-dl.add { background: var(--status-ok-bg); } .zf-dl.add .mk, .zf-dl.add code { color: var(--status-ok); }
.zf-dl.pad { background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--bg-subtle) 6px 12px); }
.zf-diff-legend { display: flex; gap: 20px; font-size: 12.5px; color: var(--text-muted); }
.zf-diff-legend span { display: inline-flex; align-items: center; gap: 8px; }
.zf-diff-legend i { width: 22px; height: 14px; border-radius: 4px; }
.zf-diff-legend i.del { background: var(--status-danger-bg); border: 1px solid color-mix(in srgb, var(--status-danger) 30%, transparent); }
.zf-diff-legend i.add { background: var(--status-ok-bg); border: 1px solid color-mix(in srgb, var(--status-ok) 30%, transparent); }
@media (max-width: 720px) { .zf-diff-heads { grid-template-columns: 1fr; } .zf-diff-arrow { display: none; } }

/* 22 Planos */
.zf-cycle { align-items: center; gap: 10px; }
.zf-plan-grid { align-items: stretch; }
.zf-plan-grid .plan { display: flex; flex-direction: column; position: relative; padding: 26px; border-radius: 16px; }
.zf-plan-grid .plan ul { flex: 1; }
.zf-plan-grid .plan.zf-featured { border: 2px solid var(--emerald-500); box-shadow: 0 16px 40px -18px var(--accent-glow); }
.zf-tag-pop { background: var(--emerald-600) !important; color: #fff !important; left: 50% !important; transform: translateX(-50%); }
.zf-plan-ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: var(--orb); background: color-mix(in srgb, var(--orb) 14%, var(--bg-surface)); margin-bottom: 14px; flex: none; }
.zf-plan-ico .icon { width: 24px; height: 24px; }
.zf-plan-grid .plan h3 { margin: 0; font-size: 19px; }
.zf-plan-grid .p-desc { margin: 4px 0 14px; min-height: 38px; }
.zf-bill { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 14px; }
.zf-btn-outline { border: 1px solid var(--border-strong) !important; width: 100%; justify-content: center; }
.zf-plan-grid .plan .btn { width: 100%; justify-content: center; height: 46px; font-size: 14.5px; }
.zf-plan-banner { display: flex; align-items: center; gap: 18px; margin-top: 22px; padding: 20px 24px; border-radius: 16px; background: linear-gradient(90deg, var(--accent-subtle), transparent 70%), var(--bg-surface); border: 1px solid color-mix(in srgb, var(--emerald-500) 25%, var(--border-default)); }
.zf-plan-banner .zf-plan-ico { margin: 0; }
.zf-plan-banner div { flex: 1; }
.zf-plan-banner b { font-size: 15px; color: var(--text-primary); }
.zf-plan-banner p { margin: 3px 0 0; color: var(--text-muted); font-size: 13.5px; }
.zf-plan-banner .btn { width: auto; color: var(--accent); }
@media (max-width: 720px) { .zf-plan-banner { flex-wrap: wrap; } }

/* 20 Integrações */
.zf-integ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.zf-integ-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 16px; box-shadow: var(--shadow-xs); transition: box-shadow var(--duration-fast) ease, transform var(--duration-fast) var(--spring-smooth); }
.zf-integ-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.zf-integ-head { display: flex; align-items: center; gap: 12px; }
.zf-integ-head h3 { margin: 0; font-size: 16px; color: var(--text-primary); }
.zf-integ-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--orb); background: color-mix(in srgb, var(--orb) 14%, var(--bg-surface)); flex: none; }
.zf-integ-logo .icon { width: 22px; height: 22px; }
.zf-integ-card .pill { width: fit-content; }
.zf-integ-card p { margin: 0; flex: 1; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.zf-integ-card .btn { width: 100%; justify-content: center; }

/* 09 & 30 Inbox (Conversas) */
.zf-conv-head { margin-bottom: 14px; }
.zf-conv-head h1 { font-size: 24px; }
.conversation-layout.zf-inbox { display: grid; grid-template-columns: 330px 6px minmax(0, 1fr) 6px 340px; gap: 0 !important; height: calc(100dvh - 176px); min-height: 520px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.zf-inbox .conv-splitter { background: var(--border-subtle); cursor: col-resize; }
.zf-inbox .conv-splitter:hover, .zf-inbox .conv-splitter.dragging { background: var(--accent-subtle); }
.zf-inbox > aside, .zf-inbox > main { min-width: 0; min-height: 0; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: var(--bg-surface) !important; padding: 0 !important; margin: 0 !important; }
.zf-list { display: flex; flex-direction: column; }
.zf-list-top { padding: 18px 16px 12px; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 12px; }
.zf-list-top h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.zf-count { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--bg-subtle); border-radius: 99px; padding: 2px 8px; }
.zf-search { min-width: 0 !important; padding: 8px 12px !important; border-radius: 10px !important; background: var(--bg-subtle) !important; border-color: transparent !important; }
.zf-search input { background: transparent; border: 0; outline: 0; width: 100%; font: inherit; color: var(--text-primary); }
.zf-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.zf-pills button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all var(--duration-micro) ease; }
.zf-pills button em { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--bg-subtle); color: var(--text-muted); }
.zf-pills button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.zf-pills button.active em { background: rgba(255,255,255,.22); color: #fff; }
.zf-list-items { flex: 1; overflow-y: auto; padding: 6px; }
.zf-conv-item { width: 100%; display: flex; gap: 12px; align-items: center; padding: 11px 10px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; transition: background var(--duration-micro) ease; }
.zf-conv-item:hover { background: var(--bg-surface-hover); }
.zf-conv-item.active { background: var(--accent-subtle); }
.zf-conv-body { flex: 1; min-width: 0; }
.zf-conv-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.zf-conv-row b { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zf-conv-row time { font-size: 11.5px; color: var(--text-dim); flex: none; }
.zf-conv-item.active .zf-conv-row time { color: var(--accent); font-weight: 600; }
.zf-conv-row p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.zf-ticks { color: #34b7f1; font-size: 11px; letter-spacing: -2px; margin-right: 2px; }
.zf-conv-tag { flex: none; font-style: normal; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 2px 8px; margin-top: 3px; background: var(--bg-subtle); color: var(--text-muted); }
.zf-conv-tag.human { background: var(--status-warn-bg); color: var(--status-warn); }
.zf-conv-tag.snoozed { background: var(--status-info-bg); color: var(--status-info); }
.zf-conv-tag.error { background: var(--status-danger-bg); color: var(--status-danger); }
.zf-av { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: #fff; background: var(--av); }
.zf-av.md { width: 46px; height: 46px; }
.zf-av.lg { width: 68px; height: 68px; font-size: 22px; }
.zf-av-wa { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: #25d366; border: 2px solid var(--bg-surface); display: grid; place-items: center; }
.zf-av-wa .icon { width: 10px; height: 10px; stroke: #fff; stroke-width: 2.4; }
.zf-av.lg .zf-av-wa { width: 22px; height: 22px; }
.zf-thread { display: flex; flex-direction: column; }
.zf-thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); }
.zf-thread-id { flex: 1; min-width: 0; }
.zf-thread-id b { display: block; font-size: 16px; color: var(--text-primary); }
.zf-thread-id > span { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.zf-thread-actions { display: flex; align-items: center; gap: 6px; }
.zf-thread-actions .zf-menu .danger { color: var(--status-danger); }
.zf-messages { flex: 1; overflow-y: auto; padding: 18px 26px; display: flex; flex-direction: column; gap: 8px; background-color: #efeae2; background-image: radial-gradient(rgba(15, 23, 42, .045) 1px, transparent 1px); background-size: 18px 18px; }
:root[data-theme="dark"] .zf-messages { background-color: #0b141a; background-image: radial-gradient(rgba(255,255,255,.03) 1px, transparent 1px); }
.zf-day { display: flex; justify-content: center; margin: 8px 0; }
.zf-day span { font-size: 12px; font-weight: 500; color: var(--text-secondary); background: var(--bg-surface); border-radius: 8px; padding: 4px 12px; box-shadow: var(--shadow-xs); }
.zf-sys { align-self: center; font-size: 12px; color: var(--text-muted); background: var(--status-warn-bg); border-radius: 8px; padding: 5px 12px; max-width: 80%; text-align: center; }
.zf-msg { position: relative; max-width: min(72%, 560px); padding: 8px 12px 20px; border-radius: 12px; font-size: 14.5px; line-height: 1.5; color: #111b21; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.zf-msg.in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.zf-msg.out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 4px; }
:root[data-theme="dark"] .zf-msg { color: #e9edef; }
:root[data-theme="dark"] .zf-msg.in { background: #202c33; }
:root[data-theme="dark"] .zf-msg.out { background: #005c4b; }
.zf-msg-by { display: block; font-size: 11.5px; font-weight: 700; color: var(--emerald-700); margin-bottom: 2px; }
:root[data-theme="dark"] .zf-msg-by { color: var(--emerald-300); }
.zf-msg-text { word-wrap: break-word; }
.zf-msg time { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: #667781; }
:root[data-theme="dark"] .zf-msg time { color: #8696a0; }
.zf-composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px 6px; border-top: 1px solid var(--border-subtle); }
.zf-composer textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-default); background: var(--bg-surface); font: inherit; font-size: 14px; color: var(--text-primary); line-height: 1.45; outline: none; }
.zf-composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-focus); }
.zf-composer .btn-icon { width: 42px; height: 42px; border-radius: 12px; }
.zf-send .icon { width: 18px; height: 18px; }
.zf-menu-up { top: auto !important; bottom: calc(100% + 6px); left: 0; right: auto !important; }
.zf-composer-hint { display: block; text-align: center; font-size: 11.5px; color: var(--text-dim); padding: 0 16px 10px; }
.zf-ctx { display: flex; flex-direction: column; border-left: 0; }
.zf-ctx-tabs { margin: 0 !important; padding: 0 12px; flex: none; }
.zf-ctx-tabs button { flex: 1; padding: 14px 8px; }
.zf-ctx-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-canvas); }
.zf-ctx-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 12px; padding: 16px; }
.zf-ctx-card h4 { margin: 0 0 10px; font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.zf-ctx-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.zf-ctx-head h4 { margin: 0; }
.zf-link { background: none; border: 0; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.zf-link-ico { background: none; border: 0; padding: 2px; color: var(--text-muted); cursor: pointer; display: inline-grid; place-items: center; border-radius: 6px; }
.zf-link-ico:hover { color: var(--accent); background: var(--accent-subtle); }
.zf-contact { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.zf-contact-id { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.zf-contact-id > b { display: flex; align-items: center; gap: 6px; font-size: 16px; color: var(--text-primary); }
.zf-contact-id > span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); word-break: break-all; }
.zf-contact-id > span > .icon { color: var(--text-muted); flex: none; }
.zf-contact .btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
.zf-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.zf-badge { font-size: 12px; font-weight: 600; border-radius: 6px; padding: 3px 9px; }
.zf-badge.b0 { background: #fff7ed; color: #c2410c; }
.zf-badge.b1 { background: #eff6ff; color: #1d4ed8; }
.zf-badge.b2 { background: var(--accent-subtle); color: var(--accent); }
:root[data-theme="dark"] .zf-badge.b0 { background: rgba(249,115,22,.14); color: #fdba74; }
:root[data-theme="dark"] .zf-badge.b1 { background: rgba(59,130,246,.14); color: #93c5fd; }
.zf-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.zf-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); border: 1px solid var(--border-default); border-radius: 6px; padding: 3px 4px 3px 9px; }
.zf-tag button { background: none; border: 0; cursor: pointer; color: var(--text-muted); font-size: 14px; line-height: 1; padding: 0 3px; border-radius: 4px; }
.zf-tag button:hover { color: var(--status-danger); background: var(--status-danger-bg); }
.zf-tag-form { margin-top: 10px; }
.zf-dl-info { display: grid; grid-template-columns: 116px 1fr; gap: 10px 12px; margin: 0; font-size: 13px; }
.zf-dl-info dt { color: var(--text-muted); }
.zf-dl-info dd { margin: 0; color: var(--text-primary); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.zf-owner { display: flex; align-items: center; gap: 8px; }
.zf-owner .avatar { width: 24px; height: 24px; font-size: 11px; }
.zf-orb-sm { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-subtle); color: var(--accent); }
.zf-note { border: 1px solid var(--border-default); border-left: 3px solid var(--emerald-500); border-radius: 8px; padding: 10px 12px; }
.zf-note + .zf-note { margin-top: 8px; }
.zf-note p { margin: 0 0 4px; font-size: 13px; color: var(--text-primary); white-space: pre-wrap; }
.zf-note small { font-size: 11.5px; color: var(--text-muted); }
.zf-note-row { display: flex; gap: 6px; align-items: flex-start; }
.zf-note-row + .zf-note-row { margin-top: 8px; }
.zf-note-row .zf-note { flex: 1; }
.zf-ctx .trace-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 1250px) { .conversation-layout.zf-inbox { grid-template-columns: 300px 6px minmax(0, 1fr) !important; } .zf-inbox .zf-ctx, .zf-inbox #conv-split-right { display: none; } }
@media (max-width: 760px) { .conversation-layout.zf-inbox { grid-template-columns: 1fr !important; height: auto; } .zf-inbox .conv-splitter { display: none; } .zf-list-items { max-height: 320px; } .zf-thread { min-height: 70vh; } }
.zf-thread-id b { display: flex !important; align-items: center; gap: 10px; white-space: nowrap; }
.zf-thread-id b .pill { font-size: 11px; }
.zf-thread-id > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zf-av > .icon { width: 20px; height: 20px; stroke: #fff; }
.zf-thread-actions .btn-icon { width: 38px; height: 38px; }

/* 26 Command Palette */
.cmd-palette-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: zfFade var(--duration-fast) ease; }
.cmd-palette-modal { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 16px; box-shadow: var(--shadow-modal); overflow: hidden; animation: zfPop var(--duration-base) var(--spring-smooth); }
.cmd-palette-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-subtle); color: var(--text-muted); }
.cmd-palette-input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--text-primary); }
#cmd-cat-pills { width: auto; background: none; border: 0; box-shadow: none; flex-wrap: wrap; }
.cmd-palette-results { flex: 1; overflow-y: auto; padding: 8px; }
.cmd-palette-group-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); padding: 10px 10px 6px; }
.cmd-palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--text-primary); font-size: 14px; }
.cmd-palette-item .icon { color: var(--text-muted); }
.cmd-palette-item span { flex: 1; }
.cmd-palette-item small { font-size: 11.5px; color: var(--text-dim); opacity: 0; transition: opacity var(--duration-micro) ease; }
.cmd-palette-item:hover, .cmd-palette-item.active { background: var(--accent-subtle); }
.cmd-palette-item.active .icon, .cmd-palette-item:hover .icon { color: var(--accent); }
.cmd-palette-item.active small, .cmd-palette-item:hover small { opacity: 1; }
.cmd-palette-footer { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-muted); background: var(--bg-subtle); }
.cmd-palette-footer kbd, .cheat-row kbd { font-size: 10.5px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 4px; padding: 1px 6px; }
@keyframes zfFade { from { opacity: 0; } }
@keyframes zfPop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .cmd-palette-backdrop, .cmd-palette-modal { animation: none; } }
.zf-reconnect { margin: 8px 0 6px; }
