/* ═══════════════════════════════════════════════════════
   Weencentive Growth Engine — Modern Design System
   ═══════════════════════════════════════════════════════ */

/* ─── Design Tokens (Dark Mode) ─────────────────────── */
:root {
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 64px;

  /* Brand */
  --brand-50: #1e1b4b;
  --brand-100: #2e2a6e;
  --brand-200: #4f46e5;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;

  /* Semantic — dark-friendly */
  --success-50: #052e16;
  --success-100: #064e3b;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --success-800: #86efac;

  --warning-50: #422006;
  --warning-100: #451a03;
  --warning-500: #f59e0b;
  --warning-800: #fcd34d;

  --danger-50: #450a0a;
  --danger-100: #7f1d1d;
  --danger-200: #991b1b;
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #f87171;
  --danger-800: #fca5a5;

  --info-50: #172554;
  --info-100: #1e3a5f;
  --info-500: #3b82f6;
  --info-800: #93c5fd;

  /* Neutrals — inverted for dark */
  --gray-50: #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-400: #64748b;
  --gray-500: #94a3b8;
  --gray-600: #cbd5e1;
  --gray-700: #e2e8f0;
  --gray-800: #f1f5f9;
  --gray-900: #f8fafc;

  /* Surfaces — dark */
  --surface-bg: #0b0f19;
  --surface-card: #141825;
  --surface-elevated: #1a2033;
  --surface-border: rgba(255,255,255,0.06);
  --surface-hover: rgba(255,255,255,0.04);

  /* Text */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Shadows — dark mode */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.4), 0 8px 10px -6px rgba(0,0,0,0.3);

  /* Glow — for gradient cards */
  --glow-brand: 0 4px 30px rgba(99,102,241,0.2), 0 0 60px rgba(99,102,241,0.08);
  --glow-success: 0 4px 30px rgba(34,197,94,0.2), 0 0 60px rgba(34,197,94,0.08);
  --glow-pink: 0 4px 30px rgba(236,72,153,0.2), 0 0 60px rgba(236,72,153,0.08);
  --glow-cyan: 0 4px 30px rgba(6,182,212,0.2), 0 0 60px rgba(6,182,212,0.08);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;

  /* Compatibility aliases */
  --brand-color: var(--brand-500);
  --brand-light: var(--brand-400);
  --success: var(--success-500);
  --warning: var(--warning-500);
  --danger: var(--danger-500);
  --info: var(--info-500);
  --muted: var(--gray-400);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--surface-bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.6;
}

/* ─── Noise Grain Overlay ─────────────────────────── */
.noise-svg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  mix-blend-mode: overlay;
}

/* ─── Ambient Background Glow ─────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -30vh;
  left: -10vw;
  width: 60vw;
  height: 60vh;
  background: radial-gradient(ellipse, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20vh;
  right: -10vw;
  width: 50vw;
  height: 50vh;
  background: radial-gradient(ellipse, rgba(236,72,153,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app-layout {
  position: relative;
  z-index: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

a:not(.btn) { color: var(--brand-400); text-decoration: none; }
a:not(.btn):hover { color: var(--brand-500); text-decoration: underline; }
a.btn { text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Bricolage Grotesque', 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

/* ─── App Layout ─────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sino flutuante removido — notificações via menu lateral */

/* ─── Sidebar ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #080c16 0%, #0d1220 50%, #0a0e18 100%);
  color: rgba(255,255,255,0.7);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  transition: width var(--duration-normal) var(--ease-out);
  border-right: 1px solid rgba(99,102,241,0.08);
  box-shadow: 4px 0 24px rgba(0,0,0,0.3);
}

/* Collapsed sidebar */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand h2,
.sidebar.collapsed .sidebar-brand small {
  display: none;
}

.sidebar.collapsed .sidebar-brand {
  padding: 1.25rem 0 1.1rem;
}

.sidebar.collapsed .sidebar-logo {
  justify-content: center;
}

.sidebar.collapsed .sidebar-logo > div {
  display: none;
}

.sidebar.collapsed nav a span:not(.nav-icon) {
  display: none;
}

.sidebar.collapsed nav a {
  justify-content: center;
  padding: 0.6rem;
}

.sidebar.collapsed nav a .nav-icon {
  margin: 0;
}

.sidebar.collapsed nav a.active::before {
  left: -0.3rem;
}

.sidebar.collapsed .sidebar-footer-status span:not(.status-dot) {
  display: none;
}

.sidebar.collapsed .sidebar-footer-status {
  justify-content: center;
}

.sidebar.collapsed .sidebar-collapse-btn span {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn {
  justify-content: center;
}

.sidebar.collapsed .theme-toggle span {
  display: none;
}

.sidebar.collapsed .theme-toggle {
  justify-content: center;
  padding: 0.6rem;
}

.sidebar-brand {
  padding: 1.25rem 1.15rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.5rem;
  position: relative;
}

.sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.25), transparent);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-logo > svg { flex-shrink: 0; }

.sidebar-brand h2 {
  margin: 0;
  font-size: 0.95rem;
  color: #fff;
  font-family: 'Bricolage Grotesque', 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sidebar-brand small {
  color: var(--gray-500);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  display: block;
  margin-top: 0.1rem;
}

/* ─── Staging Banner ─────────────────────────────────── */
.staging-banner {
  background: #f59e0b;
  color: #000;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  padding: 0.3rem 0;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.sidebar nav {
  padding: 0 0.6rem;
  flex: 1;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1px;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar nav a:hover {
  background: linear-gradient(90deg, rgba(99,102,241,0.08), rgba(255,255,255,0.04));
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}

.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.18), rgba(99,102,241,0.06));
  color: #a5b4fc;
  font-weight: 600;
  box-shadow: inset 0 0 12px rgba(99,102,241,0.08);
}

.sidebar nav a.active::before {
  content: '';
  position: absolute;
  left: -0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(180deg, var(--brand-400), #a78bfa);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(129,140,248,0.3);
}

.sidebar nav a .nav-icon {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.65;
}

.sidebar nav a.active .nav-icon { opacity: 1; }
.sidebar nav a:hover .nav-icon { opacity: 0.85; }

.sidebar-footer {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
  position: relative;
}

.sidebar-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.2), transparent);
}

.sidebar-footer-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
  color: var(--gray-500);
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-500);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
  animation: statusPulse 3s ease-in-out infinite;
}

/* ─── Notification Bell & Panel ───────────────────── */

.nav-notif-btn {
  position: relative;
  background: rgba(255,255,255,0.06); border: none; cursor: pointer;
  color: var(--text-secondary); padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%;
  font-size: 0.78rem; font-weight: 500;
  margin-bottom: 0.35rem;
}
.nav-notif-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.10);
}
.nav-notif-btn svg { flex-shrink: 0; }
.nav-notif-btn-label { white-space: nowrap; }
.sidebar.collapsed .nav-notif-btn-label { display: none; }
.sidebar.collapsed .nav-notif-btn { justify-content: center; padding: 0.5rem; }
.nav-notif-badge {
  background: var(--danger-500);
  color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; border-radius: 8px; padding: 0 4px;
  margin-left: auto;
}
.nav-notif-badge:empty, .nav-notif-badge[style*="display:none"] { visibility: hidden; }

.notif-panel {
  position: fixed;
  bottom: 80px; left: 80px;
  width: 380px; max-height: 480px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  z-index: 1001;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(10px) scale(0.97);
  transition: all 0.2s var(--ease-out);
}
.notif-panel--open {
  opacity: 1; transform: translateY(0) scale(1);
}
.sidebar.collapsed ~ .notif-panel,
.notif-panel.sidebar-collapsed {
  left: 24px;
}

.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--surface-border);
}
.notif-panel-header h4 {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text-primary); margin: 0;
}

.notif-panel-body {
  overflow-y: auto; flex: 1;
  max-height: 380px;
  scrollbar-width: thin;
}

.notif-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.notif-item {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
    opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, padding 0.25s ease;
  max-height: 120px; overflow: hidden;
}
.notif-item--dismissed {
  opacity: 0; transform: translateX(30px);
  max-height: 0; padding-top: 0; padding-bottom: 0;
  border-bottom-color: transparent;
}
.notif-item:hover {
  background: rgba(255,255,255,0.04);
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item--unread {
  background: rgba(99, 102, 241, 0.06);
}
.notif-item--unread::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--brand-500);
}
.notif-item--unread {
  position: relative;
}

.notif-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  margin-top: 2px;
}

.notif-content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.notif-title {
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-desc {
  font-size: 0.75rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.notif-time {
  font-size: 0.68rem; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
  margin-top: 3px;
}

/* Light mode overrides */
.light .notif-panel {
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.light .notif-item:hover {
  background: rgba(0,0,0,0.03);
}
.light .notif-item--unread {
  background: rgba(99, 102, 241, 0.05);
}
.light .notif-icon {
  background: rgba(0,0,0,0.05);
}
.light .notif-item {
  border-bottom-color: rgba(0,0,0,0.06);
}

/* ─── Toast Notifications ─── */
.notif-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 360px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-left: 4px solid var(--brand-500);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.notif-toast--visible {
  opacity: 1;
  transform: translateX(0);
}
.notif-toast--hiding {
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease-in;
}

.notif-toast-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-md);
  margin-top: 2px;
}
.notif-toast-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.notif-toast-title {
  font-size: 0.82rem; font-weight: 700;
  color: var(--text-primary);
}
.notif-toast-desc {
  font-size: 0.75rem; color: var(--text-secondary);
  line-height: 1.4;
}
.notif-toast-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.notif-toast-close:hover {
  opacity: 1;
}

/* Light mode toast */
.light .notif-toast {
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}
.light .notif-toast-icon {
  background: rgba(99, 102, 241, 0.08);
}

/* ─── Badge Pulse Animation ─── */
@keyframes badgePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { transform: scale(1.25); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.notif-badge--pulse {
  animation: badgePulse 0.6s ease-in-out 3;
}

/* Nav inline badge for notifications */
.nav-notif-badge--inline {
  margin-left: auto;
  background: var(--danger-500);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  min-width: 1.1rem;
  text-align: center;
  line-height: 1.3;
}

/* ─── Notifications Page (Full-Screen) ─────────────── */

.notif-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.notif-page-loading {
  text-align: center; color: var(--text-muted); padding: 3rem;
}
.notif-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.notif-page-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.notif-page-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.notif-page-icon {
  color: var(--brand-400);
  display: flex;
  align-items: center;
}
.notif-page-badge {
  background: var(--danger-500);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  min-width: 1.3rem;
  text-align: center;
}
.notif-page-actions {
  display: flex;
  gap: 0.5rem;
}

/* Filters */
.notif-page-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.notif-filter-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.notif-filter-chip:hover {
  border-color: var(--brand-400);
  color: var(--brand-400);
}
.notif-filter-chip--active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}
.notif-filter-chip--active:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.notif-filter-count {
  font-size: 0.68rem;
  opacity: 0.7;
}

/* Notification List */
.notif-page-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.notif-page-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.notif-page-empty p {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* Notification Item */
.notif-page-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-bg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.notif-page-item:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}
.notif-page-item--unread {
  background: rgba(99, 102, 241, 0.06);
  border-left: 3px solid var(--brand-400);
}
.notif-page-item--unread:hover {
  background: rgba(99, 102, 241, 0.1);
}
.notif-page-item-icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.notif-page-item-body {
  flex: 1;
  min-width: 0;
}
.notif-page-item-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.notif-page-item-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-page-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}
.notif-page-item-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.notif-page-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-400);
}

/* Light mode */
html.light .notif-page-item {
  background: #fff;
}
html.light .notif-page-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html.light .notif-page-item--unread {
  background: rgba(99, 102, 241, 0.04);
}
html.light .notif-filter-chip {
  border-color: #e2e8f0;
}

/* Light mode — Tag Input & Filter Sidebar */
html.light .tag-input-container {
  background: #fff;
  border-color: #e2e8f0;
}
html.light .tag-input-container:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
html.light .tag-pill {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #c7d2fe;
}
html.light .tag-remove:hover {
  color: #dc2626;
  background: #fef2f2;
}
html.light .tag-input-field { color: #1e293b !important; }
html.light .tag-input-field::placeholder { color: #94a3b8; }
html.light .tag-suggestions-dropdown {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}
html.light .tag-suggestion-item {
  color: #334155;
  border-bottom-color: #f1f5f9;
}
html.light .tag-suggestion-item:hover {
  background: #eef2ff;
  color: #4f46e5;
}
html.light .tag-suggestion-item.highlighted {
  background: #e0e7ff;
  color: #4f46e5;
}
html.light .filter-sidebar-header {
  border-bottom-color: #e2e8f0;
}
html.light .filter-sidebar-header h3 { color: #1e293b; }
html.light .filter-section-title {
  color: #64748b;
  border-bottom-color: #e2e8f0;
}
html.light .filter-field > label { color: #475569; }
html.light .filter-modal-footer {
  border-top-color: #e2e8f0;
}
html.light .filter-modal-body::-webkit-scrollbar-thumb { background: #cbd5e1; }

/* Light mode — Apollo search/detail */
html.light .apollo-search-topbar {
  background: #fff;
  border-bottom-color: #e2e8f0;
}
html.light .apollo-search-topbar .search-result-info strong { color: #1e293b; }
html.light .filter-modal {
  background: #fff;
  border-color: #e2e8f0;
}
html.light .filter-modal-header { border-bottom-color: #e2e8f0; }
html.light .filter-modal-header h3 { color: #1e293b; }

/* Light mode — Schedule section */
html.light .schedule-section {
  background: #fff;
  border-color: #e2e8f0;
}
html.light .schedule-section--done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
html.light .schedule-section--scheduled {
  background: #eff6ff;
  border-color: #bfdbfe;
}
html.light .schedule-section--activating {
  background: #fefce8;
  border-color: #fde68a;
}
html.light .schedule-date-input {
  background: #fff;
  border-color: #e2e8f0;
  color: #1e293b;
}

/* Light mode — Notification button in sidebar (stays dark sidebar) */
html.light .nav-notif-btn {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}
html.light .nav-notif-btn:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
}

/* Light mode — Detail datetime edit */
html.light .detail-datetime-edit input {
  background: #fff;
  border-color: #e2e8f0;
  color: #1e293b;
}

/* Light mode — Carousel slide thumbs */
html.light .carousel-slide-thumb {
  border-color: #e2e8f0;
}
html.light .carousel-slide-thumb.selected {
  border-color: #6366f1;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.6); }
}

/* ─── Content ────────────────────────────────────────── */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 0 1.5rem 2rem;
  min-width: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  transition: margin-left var(--duration-normal) var(--ease-out);
}

.content > :first-child {
  padding-top: 1.5rem;
}

.sidebar.collapsed ~ .content {
  margin-left: var(--sidebar-collapsed-width);
}

.content h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--gray-400);
  font-weight: 400;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-right: 3.25rem; /* space for global bell */
}

.page-header h1 { margin-bottom: 0.15rem; }

/* ─── KPI Cards ──────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-border);
  transition: box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md), 0 0 16px rgba(99,102,241,0.05);
  transform: translateY(-2px);
  border-color: rgba(99,102,241,0.12);
}

.kpi-card .kpi-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.kpi-card .kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
  font-family: 'JetBrains Mono', 'Inter', monospace;
}

.kpi-card.brand .kpi-value { color: var(--brand-500); }
.kpi-card.success .kpi-value { color: var(--success-500); }
.kpi-card.warning .kpi-value { color: var(--warning-500); }
.kpi-card.info .kpi-value { color: var(--info-500); }

/* ─── Tables ─────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-border);
}

.data-table th {
  background: var(--gray-50);
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 0.7rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-bottom: 1px solid var(--gray-200);
}

.data-table td {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr:nth-child(even) td { background: var(--gray-50); }

.data-table tbody tr:hover td {
  background: var(--brand-50);
}

.data-table tbody tr {
  transition: background var(--duration-fast);
}

.data-table tr.clickable {
  cursor: pointer;
}

.data-table tr.clickable:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--brand-400);
}

/* ─── Avatar ────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 3px rgba(255,255,255,0.06);
}

.avatar-sm { width: 26px; height: 26px; font-size: 0.6rem; }

.lead-name-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lead-name-cell strong {
  font-size: 0.85rem;
  color: var(--gray-800);
}

.lead-name-cell small {
  display: block;
  font-size: 0.72rem;
  color: var(--gray-400);
  font-weight: 400;
}

/* ─── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.badge-success { background: var(--success-100); color: var(--success-800); }
.badge-warning { background: var(--warning-100); color: var(--warning-800); }
.badge-danger { background: var(--danger-100); color: var(--danger-800); }
.badge-info { background: var(--info-100); color: var(--info-800); }
.badge-paused { background: #fef3c7; color: #92400e; font-weight: 600; }
.badge-muted { background: var(--gray-100); color: var(--gray-500); }

.pause-reason {
  font-size: 0.68rem;
  color: #d97706;
  font-weight: 500;
}

/* ─── Reply Classification Badges ─────────────────────── */

.badge-bounce { background: #374151; color: #9ca3af; font-weight: 600; }
.badge-ooo { background: #1f2937; color: #6b7280; font-weight: 500; }
.badge-danger { background: #fecaca; color: #991b1b; font-weight: 600; }

/* Pipeline stage badges */
.badge-pipeline-feedback { background: rgba(99, 102, 241, 0.15); color: #818cf8; font-weight: 600; }
.badge-pipeline-proposta { background: rgba(245, 158, 11, 0.15); color: #fbbf24; font-weight: 600; }
.badge-pipeline-cobranca { background: rgba(236, 72, 153, 0.15); color: #f472b6; font-weight: 600; }

/* Pipeline sub-filter pills */
.filter-pills--pipeline { margin-top: -0.25rem; }

.score-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Thermometer Card ────────────────────────────────── */

.thermometer-card {
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.thermometer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.thermometer-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
}

.thermometer-score {
  font-size: 0.95rem;
  font-weight: 700;
}

.thermometer-bar {
  position: relative;
  height: 10px;
  background: var(--gray-100);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.thermometer-segments {
  display: flex;
  height: 100%;
  gap: 2px;
}

.thermometer-seg {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: var(--gray-100);
  transition: background 0.3s;
}

.thermometer-fill { display: none; }

.thermometer-detail { margin-bottom: 0.5rem; }

.thermometer-motivo {
  font-size: 0.82rem;
  color: var(--gray-400);
  margin: 0;
  line-height: 1.4;
}

.thermometer-reclassify {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
}

/* Bounce/OOO banner variant */
.paused-banner--bounce {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
}
.paused-banner--bounce strong { color: #9ca3af !important; }
.paused-banner--bounce .paused-banner-reason { color: #6b7280 !important; }

/* ─── Light Mode Overrides (Reply Classification) ───── */

html.light .badge-bounce { background: #e5e7eb; color: #374151; }
html.light .badge-ooo { background: #f3f4f6; color: #6b7280; }
html.light .badge-danger { background: #fee2e2; color: #991b1b; }
html.light .thermometer-card { background: #fff; border-color: #e5e7eb; }
html.light .thermometer-motivo { color: #6b7280; }
html.light .paused-banner--bounce { background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%) !important; }
html.light .paused-banner--bounce strong { color: #374151 !important; }
html.light .paused-banner--bounce .paused-banner-reason { color: #6b7280 !important; }

/* ─── WhatsApp Interactive Card ──────────────────────── */

.whatsapp-reply-card {
  border-top: 3px solid #22c55e;
}

.whatsapp-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.whatsapp-reply-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.whatsapp-reply-icon { font-size: 1.2rem; }

.whatsapp-signal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: var(--radius-md, 8px);
  font-size: 0.85rem;
}

.whatsapp-signal-icon { color: #22c55e; }
.whatsapp-signal-text { color: var(--text-secondary, var(--gray-400)); }

.whatsapp-cooldown-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: var(--radius-md, 8px);
  font-size: 0.83rem;
  color: var(--text-secondary, var(--gray-400));
  margin-bottom: 1rem;
}

.whatsapp-editor {
  width: 100%;
  min-height: 100px;
  max-height: 250px;
  padding: 0.75rem 1rem;
  background: var(--surface-elevated, var(--surface-2));
  border: 1px solid var(--surface-border, var(--gray-200));
  border-radius: var(--radius-sm, 6px);
  color: var(--text-primary, var(--gray-100));
  font-size: 0.9rem;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.whatsapp-editor:focus { border-color: #22c55e; }
.whatsapp-editor:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-success {
  background: #22c55e !important;
  border-color: #22c55e !important;
  color: #fff !important;
}

.btn-success:hover { background: #16a34a !important; }
.btn-success:disabled { opacity: 0.5; cursor: not-allowed; }

/* WhatsApp History */

.whatsapp-history-accordion {
  border-top: 1px solid var(--surface-border, var(--gray-200));
  padding-top: 0.75rem;
  margin-top: 1rem;
}

.whatsapp-history-summary {
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--text-muted, var(--gray-500));
  font-weight: 500;
  padding: 0.4rem 0;
  user-select: none;
}

.whatsapp-history-summary:hover { color: var(--text-secondary, var(--gray-400)); }

.whatsapp-history-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.whatsapp-history-item {
  background: var(--surface-elevated, var(--surface-2));
  border: 1px solid var(--surface-border, var(--gray-200));
  border-radius: var(--radius-sm, 6px);
  padding: 0.6rem 0.75rem;
  max-width: 85%;
}

/* Outbound (nossas mensagens) — alinhado à direita */
.whatsapp-bubble-outbound {
  margin-left: auto;
  border-left: 3px solid #22c55e;
}

/* Inbound (mensagem do lead) — alinhado à esquerda */
.whatsapp-bubble-inbound {
  margin-right: auto;
  border-left: 3px solid #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.whatsapp-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.whatsapp-history-tipo {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #22c55e;
}

.whatsapp-bubble-inbound .whatsapp-history-tipo {
  color: #3b82f6;
}

.whatsapp-history-date {
  font-size: 0.75rem;
  color: var(--text-muted, var(--gray-500));
}

.whatsapp-history-text {
  font-size: 0.85rem;
  color: var(--text-secondary, var(--gray-400));
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Light mode */

html.light .whatsapp-reply-card { border-top-color: #22c55e; }
html.light .whatsapp-signal-bar { background: rgba(34, 197, 94, 0.04); }
html.light .whatsapp-editor { background: #f8fafc; border-color: #e5e7eb; color: #1e293b; }
html.light .whatsapp-history-item { background: #f8fafc; }
html.light .whatsapp-bubble-inbound { background: rgba(59, 130, 246, 0.05); }

/* ─── Direct Pipeline Lead Form ──────────────────────── */

.direct-lead-intro {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--gray-400);
  line-height: 1.6;
}

.direct-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.direct-section:last-of-type { border-bottom: none; }

.direct-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-500, #6366f1);
  margin-bottom: 1rem;
}

.direct-feedback-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.direct-feedback-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  border: 2px solid var(--gray-200);
  background: var(--surface-card);
  cursor: pointer;
  transition: all 0.2s;
}
.direct-feedback-btn:hover {
  border-color: var(--fb-color);
  background: color-mix(in srgb, var(--fb-color) 8%, transparent);
}
.direct-feedback-btn.active {
  border-color: var(--fb-color);
  background: color-mix(in srgb, var(--fb-color) 15%, transparent);
  box-shadow: 0 0 0 1px var(--fb-color);
}
.direct-feedback-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-100);
}
.direct-feedback-btn.active .direct-feedback-label {
  color: var(--fb-color);
}
.direct-feedback-desc {
  font-size: 0.72rem;
  color: var(--gray-500);
}

.direct-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.direct-drop-zone:hover,
.direct-drop-active {
  border-color: var(--brand-500, #6366f1);
  background: color-mix(in srgb, var(--brand-500, #6366f1) 5%, transparent);
}
.direct-drop-text {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-top: 0.5rem;
}
.direct-drop-hint {
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

html.light .direct-feedback-label { color: #374151; }
html.light .direct-feedback-btn.active .direct-feedback-label { color: var(--fb-color); }

/* ─── Hub Tabs (Leads Hub) ───────────────────────────── */

.hub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin: 0 -2.5rem 0;
  padding: 0 2.5rem;
  position: sticky;
  top: 0;
  background: var(--surface-bg);
  z-index: 5;
}

.hub-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--gray-500);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--duration-fast);
  font-weight: 500;
}

.hub-tab:hover {
  color: var(--brand-400);
  text-decoration: none;
}

.hub-tab.active {
  color: var(--brand-400);
  border-bottom-color: var(--brand-400);
  font-weight: 700;
}

.hub-tab-icon {
  display: flex;
  align-items: center;
}

html.light .hub-tabs {
  background: var(--surface-bg);
  border-bottom-color: var(--gray-200);
}

html.light .hub-tab.active {
  color: var(--brand-600);
  border-bottom-color: var(--brand-600);
}

/* ─── Cadence Timeline (Horizontal) ──────────────────── */
.tl-hz {
  overflow-x: auto;
  padding: 0.5rem 0;
}
.tl-hz-track {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}
.tl-hz-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  cursor: default;
  min-width: 0;
}
.tl-hz-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--gray-300);
  background: var(--surface-card);
  transition: all var(--duration-normal) var(--ease-out);
  color: var(--text-muted);
}
.tl-hz-dot svg { width: 12px; height: 12px; }
.tl-hz-day {
  font-size: 0.65rem; font-weight: 600;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.tl-hz-line {
  flex: 1; min-width: 8px; height: 2px;
  background: var(--gray-200);
  align-self: flex-start; margin-top: 13px;
}

/* States */
.tl-hz-step--done .tl-hz-dot {
  background: rgba(34, 197, 94, 0.15); border-color: var(--success-500);
  color: var(--success-500);
}
.tl-hz-step--done + .tl-hz-line { background: var(--success-500); }
.tl-hz-line--done { background: var(--success-500); }

.tl-hz-step--current .tl-hz-dot {
  background: var(--brand-500); border-color: var(--brand-500);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  animation: tl-pulse 2s infinite;
}
.tl-hz-step--current .tl-hz-day { color: var(--brand-500); font-weight: 700; }

.tl-hz-step--pending .tl-hz-dot {
  background: var(--surface-elevated); border-color: var(--gray-300);
}

@keyframes tl-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.06); }
}

/* Scrollbar */
.tl-hz::-webkit-scrollbar { height: 3px; }
.tl-hz::-webkit-scrollbar-track { background: transparent; }
.tl-hz::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

/* Light mode */
html.light .tl-hz-dot { background: #fff; }
html.light .tl-hz-step--pending .tl-hz-dot { background: #f8fafc; }
html.light .tl-hz-line { background: #e2e8f0; }
html.light .tl-hz-line--done { background: var(--success-500); }

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-border);
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.card:hover {
  border-color: rgba(99,102,241,0.12);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card h3 {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin: 0 0 1rem 0;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.msg-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  border: 1px solid var(--gray-100);
  transition: box-shadow var(--duration-fast);
}

.msg-card:hover {
  box-shadow: var(--shadow-sm);
}

.msg-card h4 {
  font-size: 0.8rem;
  color: var(--brand-500);
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.msg-card p {
  font-size: 0.825rem;
  color: var(--gray-700);
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

/* ─── Info Grid ──────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 2rem;
}

.info-item {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.info-item .label {
  font-size: 0.8rem;
  color: var(--gray-400);
  min-width: 100px;
  font-weight: 500;
}

.info-item .value {
  font-size: 0.875rem;
  color: var(--gray-800);
  font-weight: 500;
}

/* ─── Lead Split Layout (Timeline + Info side by side) ── */
.lead-split-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.lead-split-title {
  text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); margin: 0 0 0.75rem;
}

.lead-split-col {
  min-width: 0;
}

.lead-split-col--timeline {
  /* No card background — clean timeline */
}

/* Info Table — matches quick-stats style */
.info-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface-card); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--surface-border);
}
.info-table tr { border-bottom: 1px solid var(--gray-100); }
.info-table tr:last-child { border-bottom: none; }
.info-table-label {
  padding: 0.6rem 1rem; font-size: 0.78rem; font-weight: 500;
  color: var(--text-muted); white-space: nowrap; width: 90px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.info-table-value {
  padding: 0.6rem 1rem; font-size: 0.88rem; font-weight: 500;
  color: var(--text-primary);
}
.info-table-value a {
  color: var(--brand-400); text-decoration: none;
}
.info-table-value a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .lead-split-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 1px 3px rgba(99,102,241,0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn-primary:hover:not(:disabled)::after {
  opacity: 1;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-600);
  box-shadow: 0 4px 12px rgba(99,102,241,0.4), 0 0 20px rgba(99,102,241,0.15);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 4px rgba(99,102,241,0.3);
}

.btn-success {
  background: var(--success-500);
  color: #fff;
  box-shadow: 0 1px 3px rgba(34,197,94,0.3);
}

.btn-success:hover:not(:disabled) {
  background: var(--success-600);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger-500);
  color: #fff;
  box-shadow: 0 1px 3px rgba(239,68,68,0.3);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-600);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--brand-500);
  border: 1.5px solid var(--brand-200);
  font-weight: 600;
}

.btn-outline:hover:not(:disabled) {
  background: var(--brand-50);
  border-color: var(--brand-500);
  color: var(--brand-600);
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ─── Search / Filters ───────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-input {
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  width: 280px;
  background: var(--surface-card);
  color: var(--gray-800);
  transition: all var(--duration-fast);
}

.search-input::placeholder { color: var(--gray-400); }

.search-input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), 0 0 16px rgba(99,102,241,0.06);
}

.filter-pills {
  display: flex;
  gap: 0.35rem;
}

.filter-pill {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  border: 1.5px solid var(--gray-200);
  background: var(--surface-card);
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-pill:hover {
  border-color: var(--brand-400);
  color: var(--brand-500);
  background: var(--brand-50);
}

.filter-pill.active {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
  box-shadow: 0 1px 4px rgba(99,102,241,0.25);
}

.filter-pills--source {
  align-items: center;
  margin-top: 0.25rem;
}

.filter-pill--source {
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem;
}

/* ─── Toast ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.3rem;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  animation: toastSlideIn 0.35s var(--ease-out), toastFadeOut 0.35s ease 3.5s forwards;
  max-width: 380px;
  box-shadow: var(--shadow-xl), 0 0 30px rgba(0,0,0,0.15);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
}

.toast-success { background: var(--success-500); }
.toast-error { background: var(--danger-500); }
.toast-info { background: var(--info-500); }

@keyframes toastSlideIn {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastFadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ─── Forms ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--surface-card);
  color: var(--gray-800);
  transition: all var(--duration-fast);
}

.form-group input::placeholder { color: var(--gray-400); }

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), 0 0 16px rgba(99,102,241,0.06);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-error {
  color: var(--danger-500);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ─── Tabs ───────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--duration-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-weight: 500;
}

.tab:hover { color: var(--brand-500); }
.tab.active {
  color: var(--brand-500);
  border-bottom-color: var(--brand-500);
  font-weight: 700;
}

/* ─── CSV Preview ────────────────────────────────────── */
.csv-drop {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  color: var(--gray-400);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  background: var(--gray-50);
}

.csv-drop:hover,
.csv-drop--active {
  border-color: var(--brand-400);
  background: var(--brand-50);
  color: var(--brand-500);
}

.csv-drop input[type="file"] { display: none; }

.csv-drop-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
  opacity: 0.5;
}

/* ─── Select / Dropdown improvements ────────────────── */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem !important;
}

/* ─── Activity Log Cards ────────────────────────────── */
.log-level-bar {
  width: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.log-row-info td:first-child { border-left: 3px solid var(--info-500); }
.log-row-warn td:first-child { border-left: 3px solid var(--warning-500); }
.log-row-error td:first-child { border-left: 3px solid var(--danger-500); }
.log-row-summary td:first-child { border-left: 3px solid var(--success-500); }

/* ─── Distribution Bars ──────────────────────────────── */
.dist-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  height: 100px;
  padding: 0.5rem 0;
}

.dist-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.dist-bar-fill {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-500));
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 4px;
  transition: height 0.5s var(--ease-out);
}

.dist-bar-label {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 500;
}

.dist-bar-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-700);
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Loading ────────────────────────────────────────── */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--gray-400);
  font-weight: 500;
}

/* SVG spinner — styled via spinner.js, these are layout helpers */
.spinner-svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.6rem;
  flex-shrink: 0;
}
.spinner-svg--sm {
  margin-right: 0.4rem;
}

/* Legacy .spinner class (fallback) */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--brand-500);
  animation: spin 0.8s linear infinite;
  margin-right: 0.6rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Empty State ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-400);
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--surface-border);
}

.empty-state p { margin: 0.5rem 0; }
.empty-state svg { opacity: 0.5; }

/* ─── Back Link ──────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  transition: color var(--duration-fast);
}

.back-link:hover {
  color: var(--brand-500);
  text-decoration: none;
}

/* ─── Section ────────────────────────────────────────── */
.section { margin-bottom: 2rem; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════════
   Kanban Board
   ═══════════════════════════════════════════════════════ */

.kanban-header {
  margin-bottom: 1rem;
}

.kanban-header h1 { margin: 0 0 0.25rem 0; }

.kanban-subtitle {
  font-size: 0.85rem;
  color: var(--gray-400);
  font-weight: 400;
  margin: 0;
}

/* Kanban Tabs */
.kanban-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.kanban-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--gray-200);
  background: var(--surface-card);
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.kanban-tab:hover {
  border-color: var(--brand-400);
  color: var(--brand-500);
  background: var(--brand-50);
}

.kanban-tab.active {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.kanban-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  background: var(--gray-100);
  color: var(--gray-500);
}

.kanban-tab.active .kanban-tab-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.kanban-tab-info {
  background: var(--brand-50);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--brand-100);
}

.kanban-tab-info p {
  font-size: 0.82rem;
  color: var(--gray-600);
  margin: 0;
  line-height: 1.5;
}

.kanban-tab-info strong {
  color: var(--brand-600);
}

/* Kanban Summary Stats */
.kanban-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.kanban-stat {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--surface-border);
  transition: box-shadow var(--duration-fast), transform var(--duration-fast);
}

.kanban-stat:hover {
  box-shadow: var(--shadow-sm), 0 0 12px rgba(99,102,241,0.05);
  transform: translateY(-2px);
  border-color: rgba(99,102,241,0.1);
}

.kanban-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
  font-family: 'JetBrains Mono', monospace;
}

.kanban-stat-value.stat-highlight { color: var(--info-500); }
.kanban-stat-value.stat-success { color: var(--success-500); }

.kanban-stat-label {
  font-size: 0.65rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Kanban Board */
.board-title {
  margin: 1.5rem 0 0.25rem;
  font-size: 1rem;
  color: var(--gray-500);
}

.board-subtitle {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin: 0 0 0.75rem 0;
}

/* ─── Kanban Sticky Top (tabs + header + column labels) */
.kanban-sticky-top {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-bg);
  margin: 0 -2.5rem;
  padding: 0.75rem 2.5rem 0.5rem;
}

.kanban-sticky-top .page-header {
  margin-bottom: 0.5rem;
}

.kanban-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-right: 3.25rem; /* space for global bell */
}

.kanban-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* ─── Kanban Search ──────────────────────────── */
.kanban-search-wrap {
  position: relative;
  width: 260px;
}
.kanban-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.kanban-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.kanban-search-input:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.kanban-search-input::placeholder {
  color: var(--text-muted);
}

.kanban-header-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;          /* Firefox */
}
.kanban-header-row::-webkit-scrollbar { display: none; } /* Chrome */

.kanban-header-row .kanban-column-header {
  min-width: 140px;
  max-width: 180px;
  flex: 1 0 140px;
}

.kanban-board {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 200px;
}

.kanban-column {
  min-width: 140px;
  max-width: 180px;
  flex: 1 0 140px;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  background: var(--surface-elevated);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 0.6rem 0.65rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--surface-border);
  border-bottom: 2px solid rgba(99,102,241,0.15);
}

.kanban-column-day {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
  font-family: 'JetBrains Mono', monospace;
}

.kanban-column-title {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-700);
  letter-spacing: 0.01em;
}

.kanban-column-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.6rem;
  color: var(--gray-400);
  font-weight: 400;
  margin-top: 0.1rem;
  min-height: 2.7em;
  line-height: 1.3;
}

.kanban-column-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.3rem;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.kanban-column-body {
  flex: 1;
  background: var(--surface-bg);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid var(--surface-border);
  min-height: 60px;
}

/* Kanban Cards */
.kanban-card {
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.6rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-border);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md), 0 0 16px rgba(99,102,241,0.06);
  transform: translateY(-2px);
  border-color: var(--brand-200);
}

.kanban-card-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-900);
}

.kanban-card-header strong {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-900);
}

.kanban-card-company {
  font-size: 0.68rem;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}

.kanban-card--replied {
  border-left: 3px solid #eab308;
}

.kanban-card--meeting {
  border-left: 3px solid var(--success-500);
}

/* ─── Card colors by funnel column ───────────── */
.kcard-col--fila {
  background: linear-gradient(135deg, rgba(148,163,184,0.06), var(--surface-elevated));
}
.kcard-col--aquecimento {
  background: linear-gradient(135deg, rgba(139,92,246,0.10), var(--surface-elevated));
  border-left: 3px solid rgba(139,92,246,0.5);
}
.kcard-col--contato {
  background: linear-gradient(135deg, rgba(59,130,246,0.10), var(--surface-elevated));
  border-left: 3px solid rgba(59,130,246,0.5);
}
.kcard-col--followup {
  background: linear-gradient(135deg, rgba(245,158,11,0.10), var(--surface-elevated));
  border-left: 3px solid rgba(245,158,11,0.5);
}
.kcard-col--breakup {
  background: linear-gradient(135deg, rgba(239,68,68,0.08), var(--surface-elevated));
  border-left: 3px solid rgba(239,68,68,0.5);
}
.kcard-col--respondeu {
  background: linear-gradient(135deg, rgba(234,179,8,0.12), var(--surface-elevated));
  border-left: 3px solid rgba(234,179,8,0.6);
}
.kcard-col--reuniao {
  background: linear-gradient(135deg, rgba(34,197,94,0.10), var(--surface-elevated));
  border-left: 3px solid rgba(34,197,94,0.5);
}
.kcard-col--feedback {
  background: linear-gradient(135deg, rgba(99,102,241,0.10), var(--surface-elevated));
  border-left: 3px solid rgba(99,102,241,0.5);
}
.kcard-col--proposta {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(245,158,11,0.06));
  border-left: 3px solid rgba(99,102,241,0.5);
}
.kcard-col--cobranca {
  background: linear-gradient(135deg, rgba(236,72,153,0.10), var(--surface-elevated));
  border-left: 3px solid rgba(236,72,153,0.5);
}
.kcard-col--resultado {
  background: linear-gradient(135deg, rgba(20,184,166,0.10), var(--surface-elevated));
  border-left: 3px solid rgba(20,184,166,0.5);
}

/* Pipeline kanban card — border comes from kcard-col--* now */
.kanban-card--pipeline { /* column color classes handle border-left */ }
.kcard-pipeline-info {
  font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.35rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.kcard-valor {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 0.82rem; color: var(--text-primary);
}
.kcard-validade { font-size: 0.72rem; color: var(--text-muted); }
.kcard-validade--expired { color: var(--danger-400); font-weight: 600; }
.kcard-pipeline-resultado {
  font-size: 0.78rem; font-weight: 600; margin-top: 0.35rem;
  padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); display: inline-block;
}
.kcard--ganhou { background: rgba(34, 197, 94, 0.12); color: var(--success-400); }
.kcard--perdeu { background: rgba(239, 68, 68, 0.12); color: var(--danger-400); }
.kcard--sem-resp { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }

/* Card Tags */
.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.kanban-card-actions {
  margin-top: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--gray-100);
}

.btn-quick-reply {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-200);
  background: var(--brand-50);
  color: var(--brand-400);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-quick-reply:hover {
  background: var(--brand-100);
  border-color: var(--brand-400);
}
.btn-quick-reply:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-meeting-done {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.08);
  color: #10b981;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  justify-content: center;
}
.btn-meeting-done:hover {
  background: rgba(16,185,129,0.18);
  border-color: #10b981;
}
.btn-meeting-done:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.scard-cookie-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm, 4px);
  background: var(--surface-bg);
  color: var(--text-primary);
}
.scard-cookie-form { margin-top: 0.5rem; }

/* WhatsApp QR section in status card */
.scard-wpp-qr { margin-top: 0.75rem; }
.scard-wpp-qr-btn { width: 100%; }
.scard-wpp-qr-display { text-align: center; margin-top: 0.5rem; }
.scard-wpp-qr-img { max-width: 250px; border-radius: 8px; border: 2px solid var(--surface-border); }

.card-tag {
  font-size: 0.58rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tag-connected { background: var(--success-100); color: var(--success-800); }
.tag-pending { background: var(--gray-100); color: var(--gray-500); }
.tag-replied { background: var(--info-100); color: var(--info-800); }
.tag-meeting { background: var(--success-100); color: var(--success-800); }

/* Kanban Card — Header with status */
.kcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  margin-bottom: 0.05rem;
}

.kcard-status {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.kcard-status--active { background: var(--success-100); color: var(--success-700); }
.kcard-status--scheduled { background: #fef3c7; color: #92400e; }
.kcard-status--paused { background: #fef3c7; color: #92400e; }
.kcard-status--replied { background: var(--info-100); color: var(--info-700); }
.kcard-status--meeting { background: var(--success-100); color: var(--success-700); }

.kcard-schedule {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  margin-top: 0.3rem;
}

.kcard-event {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}
.kcard-event--ok {
  background: var(--success-100);
  color: var(--success-700);
}
.kcard-event--fail {
  background: #fee2e2;
  color: #b91c1c;
}

.kcard-next {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}
.kcard-next svg { opacity: 0.6; }

/* Kanban Card — Email status indicator */
.kcard-email-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.58rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  padding: 0.15rem 0.35rem;
  background: var(--surface-body);
  border-radius: var(--radius-sm);
}
.kcard-email-status svg { opacity: 0.6; }
.kcard-email-replied { color: var(--success-500); font-weight: 600; }

/* Kanban Card — Scheduled modifier */
.kanban-card--scheduled {
  border-left: 3px solid #f59e0b;
  opacity: 0.85;
}

/* ─── Pipeline v2: Compact Cards ──────────────────── */

.kcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.kcard-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.kcard-badges {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.kcard-badge {
  font-size: 0.5rem;
  font-weight: 700;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.kcard-badge--c1 { background: #818cf8; color: white; }
.kcard-badge--c2 { background: #f59e0b; color: #1a1a2e; }

.kcard-li {
  color: var(--gray-600);
  opacity: 0.35;
  flex-shrink: 0;
}
.kcard-li--on {
  color: #0a66c2;
  opacity: 1;
}

.kcard-company {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Progress bar */
.kcard-progress {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.45rem 0 0.1rem;
}

.kcard-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--gray-700);
  border-radius: 2px;
  overflow: hidden;
}

.kcard-progress-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.kcard-progress-label {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 24px;
  text-align: right;
}

/* Tags row */
.kcard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.35rem;
}

.kcard-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.55rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}
.kcard-tag--connected {
  background: rgba(10, 102, 194, 0.15);
  color: #3b82f6;
}
.kcard-tag--bounced {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Events section */
.kcard-events {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kcard-status-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1.3;
}

.kcard-icon {
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  font-weight: 700;
}

.kcard-status--ok { color: var(--success-500); }
.kcard-status--ok .kcard-icon { color: var(--success-500); }
.kcard-status--fail { color: #ef4444; }
.kcard-status--fail .kcard-icon { color: #ef4444; }
.kcard-status--next { color: var(--text-muted); }
.kcard-status--next .kcard-icon { color: var(--text-secondary); }
.kcard-status--sched { color: #f59e0b; }
.kcard-status--sched svg { stroke: #f59e0b; }

.kcard-status--reply {
  color: var(--text-secondary);
}

.kcard-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.kcard-countdown {
  font-weight: 700;
  color: var(--brand-400);
  white-space: nowrap;
  flex-basis: 100%;
  padding-left: calc(14px + 0.25rem);
}

/* Live countdown (< 24h) — running seconds */
.kcard-countdown--live {
  color: #f59e0b;
  font-variant-numeric: tabular-nums;
  font-size: 0.6rem;
  padding: 1px 5px;
  padding-left: calc(14px + 0.25rem);
  background: rgba(245, 158, 11, 0.12);
  border-radius: var(--radius-sm);
  width: fit-content;
}

/* Light mode */
.light .kcard-countdown--live {
  background: rgba(245, 158, 11, 0.08);
}

/* Bounced card accent */
.kanban-card--bounced {
  border-left: 3px solid #ef4444;
}

/* Quick actions */
.kcard-actions {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--surface-border);
}

.kcard-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 1rem 0;
  opacity: 0.5;
}

/* Special section below pipeline */
.pipe-special {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
}

.pipe-special-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.pipe-special-grid {
  display: flex;
  gap: 2rem;
}

.pipe-special-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.pipe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pipe-special-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.pipe-special-item {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.pipe-special-item:hover {
  background: var(--brand-500);
  color: white;
}

/* Light mode overrides */
html.light .trail-dot { background: #d1d5db; }
html.light .kcard-progress-bar { background: #e5e7eb; }
html.light .kcard-progress-fill { background: #16a34a; }
html.light .kcard-badge--c1 { background: #6366f1; }
html.light .kcard-li { color: #d1d5db; opacity: 0.6; }
html.light .kcard-li--on { color: #0a66c2; opacity: 1; }
html.light .kcard-tag--bounced { background: rgba(239, 68, 68, 0.1); }

/* ═══════════════════════════════════════════════════════
   Lead Detail
   ═══════════════════════════════════════════════════════ */

/* Stage Indicator */
.stage-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

/* Lead Header */
.lead-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.lead-header-info h1 {
  margin: 0 0 0.15rem 0;
  font-size: 1.5rem;
}

.lead-header-company {
  font-size: 0.9rem;
  color: var(--gray-500);
  font-weight: 500;
}

.lead-header-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.badge-large {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-meeting { background: var(--success-100); color: var(--success-800); }
.badge-replied { background: var(--info-100); color: var(--info-800); }
.badge-connected-lg { background: var(--success-100); color: var(--success-800); }

/* Meeting Banner */
.meeting-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--success-50), var(--success-100));
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
  animation: fadeInUp 0.4s var(--ease-out);
}

.meeting-banner-icon { font-size: 1.5rem; }

.meeting-banner strong {
  color: var(--success-800);
  font-size: 0.95rem;
}

.meeting-banner-date {
  display: block;
  font-size: 0.8rem;
  color: var(--success-700);
  font-weight: 500;
}
.meeting-banner-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--success-600);
  opacity: 0.8;
}

/* Paused Banner */
.paused-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

.paused-banner-icon { font-size: 1.5rem; }

.paused-banner strong {
  color: #92400e;
  font-size: 0.95rem;
}

.paused-banner-reason {
  display: block;
  font-size: 0.8rem;
  color: #b45309;
  font-weight: 500;
}

/* Quick Stats Bar */
.lead-quick-stats {
  display: flex;
  gap: 0;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-border);
  animation: fadeInUp 0.35s var(--ease-out);
}

.lead-stat {
  flex: 1;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border-right: 1px solid var(--gray-100);
  transition: background var(--duration-fast);
}

.lead-stat:last-child { border-right: none; }
.lead-stat:hover { background: var(--gray-50); }

.lead-stat-label {
  font-size: 0.6rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.lead-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray-900);
  font-family: 'JetBrains Mono', monospace;
}

.lead-stat-value small {
  font-weight: 400;
  color: var(--gray-400);
}

.lead-stat-bar {
  width: 60px;
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.2rem;
}

.lead-stat-bar-fill {
  height: 100%;
  border-radius: 3px;
}

/* Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  background: var(--surface-card);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  text-align: center;
  font-family: inherit;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-btn.loading { opacity: 0.5; pointer-events: none; }

.action-btn-icon { font-size: 1.4rem; }
.action-btn-text { font-size: 0.85rem; font-weight: 700; color: var(--gray-800); }
.action-btn-desc { font-size: 0.7rem; color: var(--gray-400); font-weight: 500; }

.action-btn-primary { border-color: var(--brand-200); }
.action-btn-primary:hover { background: var(--brand-50); border-color: var(--brand-400); }
.action-btn-success { border-color: var(--info-100); }
.action-btn-success:hover { background: var(--info-50); border-color: var(--info-500); }
.action-btn-meeting { border-color: var(--success-100); }
.action-btn-meeting:hover { background: var(--success-50); border-color: var(--success-500); }
.action-btn-danger { border-color: var(--danger-100); }
.action-btn-danger:hover { background: var(--danger-50); border-color: var(--danger-500); }

/* Message Status Badges */
.msg-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.msg-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.msg-status-dot.sent { background: var(--success-500); }
.msg-status-dot.pending { background: var(--gray-300); }
.msg-status-dot.scheduled { background: var(--warning-500); }

/* ═══════════════════════════════════════════════════════
   History Timeline
   ═══════════════════════════════════════════════════════ */

/* History Accordion */
.history-accordion summary { list-style: none; }
.history-accordion summary::-webkit-details-marker { display: none; }
.history-accordion-summary {
  display: flex; align-items: center; gap: 0.5rem;
  cursor: pointer; user-select: none;
  padding: 0.25rem 0;
}
.history-accordion-summary h3 { margin: 0; }
.history-accordion-count {
  font-size: 0.72rem; font-weight: 600;
  background: var(--gray-100); color: var(--text-muted);
  padding: 2px 8px; border-radius: var(--radius-full, 20px);
}
.history-accordion-chevron {
  display: inline-flex; margin-left: auto;
  color: var(--text-muted); transition: transform var(--duration-fast);
}
.history-accordion-chevron svg { width: 14px; height: 14px; }
.history-accordion[open] .history-accordion-chevron {
  transform: rotate(90deg);
}
.history-accordion[open] .history-timeline {
  margin-top: 0.75rem;
}

.history-timeline {
  position: relative;
  padding-left: 1.75rem;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--brand-200), var(--gray-200));
  border-radius: 1px;
}

.history-item {
  position: relative;
  padding-bottom: 1.25rem;
  padding-left: 1.1rem;
}

.history-item::before {
  content: '';
  position: absolute;
  left: -1.35rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-300);
  border: 2px solid var(--surface-card);
  box-shadow: 0 0 0 2px var(--gray-200);
}

/* Action type dot colors */
.history-item.action-profile_view::before { background: var(--gray-400); box-shadow: 0 0 0 2px var(--gray-200); }
.history-item.action-like::before { background: #ec4899; box-shadow: 0 0 0 2px #fce7f3; }
.history-item.action-connect::before { background: #8b5cf6; box-shadow: 0 0 0 2px #ede9fe; }
.history-item.action-message::before { background: var(--info-500); box-shadow: 0 0 0 2px var(--info-100); }
.history-item.action-followup::before { background: var(--warning-500); box-shadow: 0 0 0 2px var(--warning-100); }
.history-item.action-advance::before { background: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-100); }
.history-item.action-intake::before { background: var(--success-500); box-shadow: 0 0 0 2px var(--success-100); }
.history-item.action-personalization::before { background: var(--warning-500); box-shadow: 0 0 0 2px var(--warning-100); }
.history-item.action-email::before { background: #06b6d4; box-shadow: 0 0 0 2px #cffafe; }
.history-item.action-response::before { background: var(--success-500); box-shadow: 0 0 0 2px var(--success-100); }
.history-item.action-connected::before { background: var(--success-500); box-shadow: 0 0 0 2px var(--success-100); }
.history-item.action-error::before { background: var(--danger-500); box-shadow: 0 0 0 2px var(--danger-100); }
.history-item.action-manual::before { background: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-100); }
.history-item.action-system::before { background: var(--gray-300); box-shadow: 0 0 0 2px var(--gray-100); }

.history-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.history-action-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.history-action-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-item-time {
  font-size: 0.65rem;
  color: var(--gray-400);
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.history-item-msg {
  font-size: 0.85rem;
  color: var(--gray-700);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   Apollo
   ═══════════════════════════════════════════════════════ */

.apollo-search-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.apollo-filters-panel {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-border);
  max-height: 80vh;
  overflow-y: auto;
}

.apollo-filters-panel h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.apollo-filters-panel .form-group {
  margin-bottom: 0.85rem;
}

.apollo-filters-panel .form-group label {
  font-size: 0.75rem;
  margin-bottom: 0.3rem;
}

.apollo-filters-panel .form-group small {
  font-size: 0.65rem;
  color: var(--gray-400);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--gray-600);
  padding: 0.25rem 0.5rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.checkbox-label:hover { background: var(--brand-50); }

.checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--brand-500);
}

.apollo-results-panel {
  min-height: 300px;
}

.apollo-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.apollo-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1rem;
  padding: 0.75rem 0;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.pagination-num {
  min-width: 32px;
  padding: 0.35rem 0.5rem !important;
  text-align: center;
}

.pagination-dots {
  padding: 0 0.25rem;
  color: var(--gray-400);
  user-select: none;
}

.apollo-list-row { cursor: pointer; }
.apollo-list-row:hover { background: var(--gray-50); }

.apollo-filters-summary {
  font-size: 0.75rem;
  color: var(--gray-500);
  max-width: 250px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apollo-actions {
  display: flex;
  gap: 0.35rem;
}

.apollo-detail-header {
  margin-bottom: 1.5rem;
}

.apollo-detail-header h2 { margin: 0 0 0.5rem; }

.apollo-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.filter-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--brand-50);
  color: var(--brand-600);
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-100);
}

.apollo-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--surface-border);
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-900);
  font-family: 'JetBrains Mono', monospace;
}

.kpi-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  font-weight: 700;
  margin-top: 0.15rem;
}

.apollo-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.apollo-search-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  background: var(--gray-800, #1e1e2e);
  border: 1px solid var(--gray-700, #2d2d3d);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  min-width: 0;
}
html.light .apollo-search-inline {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.apollo-search-inline svg {
  color: var(--gray-500);
  flex-shrink: 0;
}
.apollo-search-inline input {
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font-size: 0.8rem;
  width: 140px;
  padding: 0;
}
html.light .apollo-search-inline input {
  color: #1e293b;
}
html.light .apollo-search-inline input::placeholder {
  color: #64748b;
}
.apollo-search-inline input::placeholder {
  color: var(--gray-500);
}
.search-count-label {
  font-size: 0.75rem;
  color: var(--gray-400);
  white-space: nowrap;
}
html.light .search-count-label {
  color: #475569;
}
.btn-danger {
  background: var(--red-500, #ef4444);
  color: #fff;
  border: none;
}
.btn-danger:hover {
  background: var(--red-600, #dc2626);
}

.row-activated { opacity: 0.5; }
.row-duplicate { opacity: 0.4; background: var(--gray-50); }
.row-new { border-left: 3px solid var(--brand-500); }

.badge-new { background: var(--brand-100); color: var(--brand-700); }
.badge-ok { background: var(--success-100); color: var(--success-800); }
.badge-warn { background: var(--warning-100); color: var(--warning-800); }
.badge-info { background: var(--info-100); color: var(--info-800); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--red-500, #ef4444); }

.link-external {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-500);
  text-decoration: none;
}

.link-external:hover { text-decoration: underline; }

.apollo-removed-section {
  margin-top: 1.5rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.apollo-removed-section summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
}

.apollo-removed-section ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* ─── Schedule Section (Play na Lista) ────────────── */

.schedule-section {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
}

.schedule-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-200);
  color: var(--gray-500);
}

.schedule-content {
  flex: 1;
  min-width: 0;
}

.schedule-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
}

.schedule-desc {
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.5;
}

.schedule-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Ready state — Play */
.schedule-section--ready {
  border-color: var(--brand-200);
  background: var(--brand-50);
}

.schedule-icon--play {
  background: var(--brand-500);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.schedule-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.schedule-date-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
}

.schedule-date-input {
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  background: var(--surface-card);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast);
}

.schedule-date-input:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.schedule-play-btn {
  white-space: nowrap;
}

/* Scheduled state */
.schedule-section--scheduled {
  border-color: var(--warning-500);
  background: var(--warning-50);
}

.schedule-icon--scheduled {
  background: var(--warning-500);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.schedule-section--scheduled .schedule-title {
  color: var(--warning-800);
}

/* Completed state */
.schedule-section--done {
  border-color: var(--success-500);
  background: var(--success-50);
}

.schedule-icon--done {
  background: var(--success-500);
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.schedule-section--done .schedule-title {
  color: var(--success-800);
}

/* Error state */
.schedule-section--error {
  border-color: var(--red-500, #ef4444);
  background: rgba(239, 68, 68, 0.08);
}
.schedule-icon--error {
  background: var(--red-500, #ef4444);
  color: white;
}
.schedule-section--error .schedule-title {
  color: var(--red-500, #ef4444);
}
.schedule-section--error .schedule-desc {
  color: var(--red-400, #f87171);
  font-size: 0.8rem;
}

/* Queued state */
.schedule-section--queued {
  border-color: var(--brand-500);
  background: var(--brand-50, rgba(99, 102, 241, 0.06));
}
.schedule-icon--queued {
  background: var(--brand-500);
  color: white;
}
.schedule-section--queued .schedule-title {
  color: var(--brand-700, #6366f1);
}

/* Activating state */
.schedule-section--activating {
  border-color: var(--info-500);
  background: var(--info-50);
}

.schedule-section--activating .schedule-icon {
  background: var(--info-500);
  color: white;
}

.schedule-section--activating .schedule-title {
  color: var(--info-800);
}

/* Empty state — no new leads */
.schedule-section--empty {
  border-color: var(--gray-200);
  background: var(--gray-50);
  opacity: 0.7;
}

.schedule-icon--empty {
  background: var(--gray-200);
  color: var(--gray-400);
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
}

.btn-danger-ghost {
  background: transparent; border: none;
  color: var(--danger-400); font-size: 0.78rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.75rem; border-radius: var(--radius-sm);
  cursor: pointer; opacity: 0.7; transition: all var(--duration-fast);
}
.btn-danger-ghost:hover {
  opacity: 1; background: rgba(239, 68, 68, 0.08);
}
.btn-danger-ghost svg { width: 14px; height: 14px; }

.btn-danger-outline {
  border: 1.5px solid var(--danger-200);
  background: transparent;
  color: var(--danger-500);
  border-radius: var(--radius-sm);
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-danger-outline:hover {
  background: var(--danger-50);
  border-color: var(--danger-400);
}

.data-table-compact th,
.data-table-compact td {
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.alert { padding: 0.85rem 1.1rem; border-radius: var(--radius-md); font-size: 0.85rem; }
.alert-error { background: var(--danger-50); color: var(--danger-700); border: 1px solid var(--danger-200); }

/* ═══════════════════════════════════════════════════════
   Sidebar Collapse Button
   ═══════════════════════════════════════════════════════ */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
  margin-top: 0.25rem;
}

.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

.sidebar-collapse-btn svg {
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-out);
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

/* ═══════════════════════════════════════════════════════
   Modern Dashboard — Gradient & Glassmorphism
   ═══════════════════════════════════════════════════════ */

/* Welcome header */
.dash-header {
  margin-bottom: 1.75rem;
}

.dash-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.dash-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Hero gradient cards */
.dash-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.dash-hero-grid--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.dash-hero-card {
  border-radius: var(--radius-2xl);
  padding: 1.75rem 2rem;
  position: relative;
  overflow: hidden;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.dash-hero-card:hover {
  transform: translateY(-3px) scale(1.01);
}

.dash-hero-card--brand {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  box-shadow: var(--glow-brand);
}

.dash-hero-card--pink {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 50%, #fb923c 100%);
  box-shadow: var(--glow-pink);
}

.dash-hero-card--amber {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.25);
}

.dash-hero-card--cyan {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
  box-shadow: var(--glow-cyan);
}

.dash-hero-card--success {
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  box-shadow: var(--glow-success);
}

.dash-hero-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.dash-hero-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 150px;
  height: 150px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.dash-hero-card .hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

.dash-hero-card .hero-value {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  position: relative;
  z-index: 1;
  margin: 0.5rem 0;
}

.dash-hero-card .hero-sub {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Glass KPI cards */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.dash-kpi-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 1.15rem 1.25rem;
  transition: all var(--duration-normal) var(--ease-out);
}

.dash-kpi-card:hover {
  background: var(--surface-elevated);
  border-color: rgba(99,102,241,0.15);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 20px rgba(99,102,241,0.06);
}

.dash-kpi-card .kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.dash-kpi-card .kpi-icon--brand { background: rgba(99,102,241,0.15); color: var(--brand-400); }
.dash-kpi-card .kpi-icon--success { background: rgba(34,197,94,0.15); color: var(--success-500); }
.dash-kpi-card .kpi-icon--warning { background: rgba(245,158,11,0.15); color: var(--warning-500); }
.dash-kpi-card .kpi-icon--info { background: rgba(59,130,246,0.15); color: var(--info-500); }
.dash-kpi-card .kpi-icon--danger { background: rgba(239,68,68,0.15); color: var(--danger-500); }

.dash-kpi-card .kpi-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.1;
}

.dash-kpi-card .kpi-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}
.dash-kpi-card .kpi-detail {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 0.15rem;
}
.kpi-bounce { color: #ef4444; opacity: 1; }

/* Meeting projection card */
.dash-projection-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  border-left: 3px solid var(--brand-500);
}
.projection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.projection-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.projection-fraction {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-400);
}
.projection-bar {
  height: 12px;
  border-radius: 6px;
  background: var(--surface-border);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.projection-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease-out;
}
.projection-bar--success { background: var(--success-500); }
.projection-bar--warning { background: var(--warning-500); }
.projection-bar--danger { background: #ef4444; }
.projection-pct {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.projection-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.projection-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Apollo projection note */
.apollo-proj-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* Apollo KPI highlight */
.kpi-card--highlight {
  border-left: 3px solid var(--brand-500, #6366f1);
}
.kpi-card--highlight .kpi-value {
  color: var(--brand-400, #818cf8);
}

/* Connected integrations bar */
.dash-integrations {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  margin-bottom: 1.75rem;
}

.dash-integrations-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.dash-integration-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-fast);
}

.dash-integration-chip .int-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dash-integration-chip .int-dot--ok { background: var(--success-500); box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.dash-integration-chip .int-dot--error { background: var(--danger-500); }
.dash-integration-chip .int-dot--unknown { background: var(--gray-400); }

/* A/B Test Section */
.dash-ab-section {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.dash-ab-section h3 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.dash-ab-note { font-size: 0.75rem; color: var(--text-muted); margin: 0 0 1rem; }
.dash-ab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 0.75rem; }
.dash-ab-card {
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  text-align: center;
}
.dash-ab-card--winner { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.ab-variant-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.5rem; }
.ab-stat-row { display: flex; align-items: baseline; justify-content: center; gap: 0.4rem; }
.ab-stat-big { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.ab-stat-label { font-size: 0.75rem; color: var(--text-muted); }
.ab-stat-detail { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem; }
.dash-ab-samples { margin-top: 0.75rem; }
.dash-ab-samples summary { font-size: 0.78rem; color: var(--text-muted); cursor: pointer; }
.ab-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; font-size: 0.75rem; }
.ab-table th { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--surface-border); color: var(--text-muted); font-weight: 600; }
.ab-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--surface-border); }

/* Dashboard sections grid */
.dash-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.dash-section {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.dash-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.2), transparent);
}

.dash-section > :last-child {
  margin-top: auto;
}

.dash-section h3 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin: 0 0 1rem;
}

/* Horizontal distribution bars */
.dash-hbars {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dash-hbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-hbar-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
}

.dash-hbar-track {
  flex: 1;
  height: 28px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dash-hbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  border-radius: var(--radius-full);
  min-width: 8px;
  transition: width 0.6s var(--ease-out);
}

.dash-hbar-value {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  min-width: 28px;
  flex-shrink: 0;
}

/* Vertical cadence chart */
.dash-cadence-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 1;
  min-height: 100px;
  padding: 0 0.25rem;
  justify-content: flex-start;
}

.cadence-bar-col {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cadence-bar-count {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.cadence-bar-track {
  width: 100%;
  max-width: 32px;
  height: 120px;
  display: flex;
  align-items: flex-end;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}

.cadence-bar-fill {
  width: 100%;
  border-radius: var(--radius-md);
  min-height: 4px;
  transition: height 0.8s var(--ease-out);
}

.cadence-bar--warmup {
  background: linear-gradient(180deg, #818cf8, #6366f1);
}
.cadence-bar--contact {
  background: linear-gradient(180deg, #34d399, #059669);
}
.cadence-bar--nurture {
  background: linear-gradient(180deg, #fbbf24, #d97706);
}
.cadence-bar--breakup {
  background: linear-gradient(180deg, #f87171, #dc2626);
}

.cadence-bar-day {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cadence-legend {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.cadence-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cadence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cadence-dot--warmup { background: #818cf8; }
.cadence-dot--contact { background: #34d399; }
.cadence-dot--nurture { background: #fbbf24; }
.cadence-dot--breakup { background: #f87171; }

/* Activity mini-list */
.dash-activity-list {
  list-style: none;
}

.dash-activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--surface-border);
}

.dash-activity-item:last-child {
  border-bottom: none;
}

.dash-activity-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  width: 55px;
}

.dash-activity-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.dash-activity-msg {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* ─── Response & Connection Panel ─────────────────── */

.dash-panel-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.dash-panel-split > .panel-sub + .panel-sub {
  border-left: 1px solid var(--surface-border);
  padding-left: 1.25rem;
}

.panel-sub-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.panel-sub-title svg {
  opacity: 0.6;
}

.panel-count {
  background: var(--brand-500);
  color: white;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.panel-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.panel-lead-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s;
}

.panel-lead-link:hover {
  background: var(--surface-hover);
}

.panel-lead-name {
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-lead-link .badge-sm {
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  flex-shrink: 0;
}

.panel-linkedin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0a66c2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-linkedin-dot::after {
  content: 'in';
  font-size: 0.55rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
}

.panel-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  margin: 0;
}

.panel-see-all {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--brand-400);
  text-decoration: none;
  padding: 0.4rem 0;
  margin-top: 0.25rem;
  transition: color 0.15s;
}

.panel-see-all:hover {
  color: var(--brand-300);
}

/* ═══════════════════════════════════════════════════════
   Light Mode Override
   ═══════════════════════════════════════════════════════ */
html.light {
  /* Brand */
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;

  /* Semantic */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-800: #166534;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-800: #92400e;

  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-200: #fecaca;
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;
  --danger-800: #991b1b;

  --info-50: #eff6ff;
  --info-100: #dbeafe;
  --info-800: #1e40af;

  /* Neutrals — original light */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Surfaces — light */
  --surface-bg: #f0f2f5;
  --surface-card: #ffffff;
  --surface-elevated: #ffffff;
  --surface-border: rgba(0,0,0,0.06);
  --surface-hover: rgba(0,0,0,0.03);

  /* Text — light */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;

  /* Shadows — light */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
}

/* Light mode sidebar */
html.light .sidebar {
  background: linear-gradient(180deg, #0c1222 0%, #131c31 50%, #0f172a 100%);
}

/* Light mode scrollbar */
html.light ::-webkit-scrollbar-thumb { background: var(--gray-300); }
html.light ::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
html.light .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

/* Light mode kanban */
html.light .kanban-column-header {
  border-bottom-color: rgba(99,102,241,0.12);
}
html.light .kanban-card:hover {
  border-color: var(--brand-400);
}

/* Light mode horizontal bars */
html.light .dash-hbar-track {
  background: rgba(0,0,0,0.05);
}

html.light .cadence-bar-track {
  background: rgba(0,0,0,0.04);
}
html.light .calendar-day:not(.calendar-day--empty) {
  background: #f8fafc; border: 1px solid rgba(0,0,0,0.06);
}
html.light .calendar-day--today {
  background: rgba(99,102,241,0.06); border-color: var(--brand-400);
}

/* Light mode status — darker text for contrast */
html.light .status-summary--ok { color: #15803d; }
html.light .status-summary--error { color: #b91c1c; }
html.light .status-summary--warning { color: #92400e; }

/* Light mode service cards */
html.light .scard:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
html.light .scard--ok .scard-status-label { color: #15803d; }
html.light .scard--error .scard-status-label { color: #b91c1c; }
html.light .scard--warning .scard-status-label { color: #92400e; }

/* Light mode kanban tabs */
html.light .kanban-tab.active {
  color: var(--brand-500);
}

/* Light mode ambient glows — subtler on light bg */
html.light body::before {
  background: radial-gradient(ellipse, rgba(99,102,241,0.04) 0%, transparent 70%);
}
html.light body::after {
  background: radial-gradient(ellipse, rgba(236,72,153,0.025) 0%, transparent 70%);
}

/* Light mode noise — less visible */
html.light .noise-svg {
  opacity: 0.015;
}

/* Light mode links — darker for contrast */
html.light a:not(.btn) { color: var(--brand-500); }
html.light a:not(.btn):hover { color: var(--brand-600); }

/* Light mode data-table zebra rows */
html.light .data-table tbody tr:nth-child(even) td {
  background: rgba(0,0,0,0.015);
}

/* Light mode data-table hover */
html.light .data-table tbody tr:hover td {
  background: #eef2ff;
}

html.light .badge-paused { background: #fef3c7; color: #92400e; }
html.light .pause-reason { color: #b45309; }

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

.theme-toggle svg {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */
/* ─── Content Fade-in & Stagger ────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.content > *:first-child { animation: fadeInUp 0.4s var(--ease-out); }

/* Staggered grid animations */
.dash-hero-grid > * {
  animation: fadeInUp 0.5s var(--ease-out) backwards;
}
.dash-hero-grid > *:nth-child(1) { animation-delay: 0.05s; }
.dash-hero-grid > *:nth-child(2) { animation-delay: 0.12s; }
.dash-hero-grid > *:nth-child(3) { animation-delay: 0.19s; }

.dash-kpi-grid > * {
  animation: fadeInUp 0.45s var(--ease-out) backwards;
}
.dash-kpi-grid > *:nth-child(1) { animation-delay: 0.08s; }
.dash-kpi-grid > *:nth-child(2) { animation-delay: 0.13s; }
.dash-kpi-grid > *:nth-child(3) { animation-delay: 0.18s; }
.dash-kpi-grid > *:nth-child(4) { animation-delay: 0.23s; }
.dash-kpi-grid > *:nth-child(5) { animation-delay: 0.28s; }

.dash-sections > * {
  animation: fadeInUp 0.5s var(--ease-out) backwards;
}
.dash-sections > *:nth-child(1) { animation-delay: 0.15s; }
.dash-sections > *:nth-child(2) { animation-delay: 0.25s; }

/* Agent insights stagger */
.agents-insights-grid > * {
  animation: scaleIn 0.4s var(--ease-out) backwards;
}
.agents-insights-grid > *:nth-child(1) { animation-delay: 0.1s; }
.agents-insights-grid > *:nth-child(2) { animation-delay: 0.2s; }
.agents-insights-grid > *:nth-child(3) { animation-delay: 0.3s; }
.agents-insights-grid > *:nth-child(4) { animation-delay: 0.4s; }

/* Kanban summary stagger */
.kanban-summary > * {
  animation: fadeInUp 0.35s var(--ease-out) backwards;
}
.kanban-summary > *:nth-child(1) { animation-delay: 0.04s; }
.kanban-summary > *:nth-child(2) { animation-delay: 0.08s; }
.kanban-summary > *:nth-child(3) { animation-delay: 0.12s; }
.kanban-summary > *:nth-child(4) { animation-delay: 0.16s; }
.kanban-summary > *:nth-child(5) { animation-delay: 0.2s; }
.kanban-summary > *:nth-child(6) { animation-delay: 0.24s; }
.kanban-summary > *:nth-child(7) { animation-delay: 0.28s; }
.kanban-summary > *:nth-child(8) { animation-delay: 0.32s; }

/* Status grid stagger */
.status-grid-v2 > * {
  animation: scaleIn 0.4s var(--ease-out) backwards;
}
.status-grid-v2 > *:nth-child(1) { animation-delay: 0.05s; }
.status-grid-v2 > *:nth-child(2) { animation-delay: 0.1s; }
.status-grid-v2 > *:nth-child(3) { animation-delay: 0.15s; }
.status-grid-v2 > *:nth-child(4) { animation-delay: 0.2s; }
.status-grid-v2 > *:nth-child(5) { animation-delay: 0.25s; }
.status-grid-v2 > *:nth-child(6) { animation-delay: 0.3s; }

/* Table rows subtle entrance */
.data-table tbody tr {
  animation: fadeIn 0.25s ease backwards;
}

/* Action grid stagger (lead detail) */
.action-grid > * {
  animation: scaleIn 0.35s var(--ease-out) backwards;
}
.action-grid > *:nth-child(1) { animation-delay: 0.05s; }
.action-grid > *:nth-child(2) { animation-delay: 0.1s; }
.action-grid > *:nth-child(3) { animation-delay: 0.15s; }
.action-grid > *:nth-child(4) { animation-delay: 0.2s; }

/* Content ideas grid stagger */
.content-ideas-grid > * {
  animation: fadeInUp 0.4s var(--ease-out) backwards;
}
.content-ideas-grid > *:nth-child(1) { animation-delay: 0.05s; }
.content-ideas-grid > *:nth-child(2) { animation-delay: 0.12s; }
.content-ideas-grid > *:nth-child(3) { animation-delay: 0.19s; }
.content-ideas-grid > *:nth-child(4) { animation-delay: 0.26s; }

/* Cadence bar chart animation */
.cadence-bar-fill {
  animation: growUp 0.8s var(--ease-out) backwards;
}
@keyframes growUp {
  from { height: 0 !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Full-Screen Content Override ─────────────────── */
.content--fullscreen {
  padding: 0 !important;
  overflow: hidden !important;
  height: 100vh;
}

/* ─── Apollo Search Full-Screen Layout ─────────────── */
.apollo-search-fullscreen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  animation: none;
}

.apollo-search-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface-card);
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
  z-index: 10;
}

.apollo-search-topbar .search-result-info {
  flex: 1;
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 500;
}

.apollo-search-topbar .search-result-info strong {
  color: var(--gray-800);
  font-weight: 700;
}

.apollo-search-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ─── Filter Modal (Popup) ─────────────────────────── */
.filter-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.filter-modal-backdrop--open { opacity: 1; }

.filter-modal {
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl, 16px);
  width: 90vw;
  max-width: 1100px;
  height: 85vh;
  max-height: 750px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  transform: translateY(10px);
  transition: transform 0.2s ease;
}
.filter-modal-backdrop--open .filter-modal { transform: translateY(0); }

.filter-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}
.filter-modal-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
  white-space: nowrap;
}
.filter-modal-preview {
  flex: 1;
  font-size: 0.82rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.filter-modal-preview strong { color: var(--brand-400); font-size: 1rem; }
.filter-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.filter-modal-close:hover { color: var(--gray-800); }

.filter-modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 1.5rem;
  scrollbar-width: thin;
}
.filter-modal-body::-webkit-scrollbar { width: 5px; }
.filter-modal-body::-webkit-scrollbar-track { background: transparent; }
.filter-modal-body::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

.filter-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 2.5rem;
  align-items: start;
}

.filter-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  font-weight: 700;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--gray-100);
}

.filter-field > label {
  display: block;
  font-size: 0.72rem;
  color: var(--gray-600);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.filter-field--empty {
  visibility: hidden;
}

.filter-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-500);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  margin-left: 4px;
}

/* Results full-width when no sidebar */
.apollo-results-main--full { width: 100%; }

@media (max-width: 768px) {
  .filter-modal-grid { grid-template-columns: 1fr; }
  .filter-modal { width: 95vw; height: 90vh; }
}

/* ─── Results Main Area ────────────────────────────── */
.apollo-results-main {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  min-width: 0;
}

.apollo-results-main .empty-state {
  padding: 4rem 2rem;
}

/* ─── Search Loading Indicator ─────────────────────── */
.search-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--brand-500);
  animation: spin 0.8s linear infinite;
}

/* ─── Company Logo in Apollo Results ───────────────── */
.company-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.company-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--surface-card);
}

.company-logo--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
}

/* ─── Apollo Search Results Table ──────────────────── */
.apollo-results-main .data-table-compact {
  width: 100%;
  table-layout: fixed;
}

.apollo-results-main .data-table-compact td {
  padding: 0.6rem 0.75rem;
  vertical-align: middle;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apollo-results-main .data-table-compact th {
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-400);
  font-weight: 600;
}

.apollo-results-main .data-table-compact tr:hover {
  background: var(--surface-hover);
}

.apollo-results-main .data-table-compact td:first-child,
.apollo-results-main .data-table-compact th:first-child {
  padding-left: 0.5rem;
  width: 36px;
}

/* Column widths: checkbox | Nome 25% | Cargo 35% | Empresa 40% */
.apollo-results-main .data-table-compact th:nth-child(2),
.apollo-results-main .data-table-compact td:nth-child(2) { width: 25%; }

.apollo-results-main .data-table-compact th:nth-child(3),
.apollo-results-main .data-table-compact td:nth-child(3) { width: 35%; }

.apollo-results-main .data-table-compact th:nth-child(4),
.apollo-results-main .data-table-compact td:nth-child(4) { width: 40%; }

/* ─── Search Selection Bar ─────────────────────────── */
.search-selection-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--brand-400);
  font-weight: 500;
}

/* ─── Tag Input Component ──────────────────────────── */
.tag-input-wrapper {
  position: relative;
}

.tag-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.3rem 0.45rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  min-height: 34px;
  align-items: center;
  cursor: text;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.tag-input-container:focus-within {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.1rem 0.1rem 0.45rem;
  background: var(--brand-50);
  color: var(--brand-500);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--brand-100);
  white-space: nowrap;
  max-width: 180px;
  line-height: 1.4;
}

.tag-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-400);
  font-size: 0.9rem;
  padding: 0 0.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  border-radius: 3px;
  transition: all var(--duration-fast);
}

.tag-remove:hover {
  color: var(--danger-500);
  background: var(--danger-50, #fef2f2);
}

.tag-input-field {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0.15rem 0 !important;
  font-size: 0.78rem !important;
  font-family: inherit;
  background: transparent !important;
  flex: 1;
  min-width: 70px;
  color: var(--gray-800);
  line-height: 1.4;
}

.tag-input-field::placeholder {
  color: var(--gray-400);
  font-size: 0.75rem;
}

/* ─── Suggestion Dropdown ──────────────────────────── */
.tag-suggestions-dropdown {
  position: fixed;
  z-index: 9999;
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  margin-top: 0;
  scrollbar-width: thin;
}
.tag-suggestions-dropdown::-webkit-scrollbar { width: 5px; }
.tag-suggestions-dropdown::-webkit-scrollbar-track { background: transparent; }
.tag-suggestions-dropdown::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

.tag-suggestion-item {
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: background var(--duration-fast);
  border-bottom: 1px solid var(--gray-50);
}

.tag-suggestion-item:last-child {
  border-bottom: none;
}

.tag-suggestion-item:hover {
  background: var(--brand-50);
  color: var(--brand-500);
}

.tag-suggestion-item.highlighted {
  background: var(--brand-100);
  color: var(--brand-500);
}

/* ─── Empty State with icon ─────────────────────────── */
.empty-state svg {
  opacity: 0.3;
  margin-bottom: 0.75rem;
}

/* ─── Stat change indicator ─────────────────────────── */
.stat-up { color: var(--success-500); }
.stat-down { color: var(--danger-500); }

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }

  .sidebar-brand h2,
  .sidebar-brand small,
  .sidebar nav a span:not(.nav-icon),
  .sidebar-collapse-btn span,
  .sidebar-footer-status span:not(.status-dot) {
    display: none;
  }

  .sidebar nav a {
    justify-content: center;
    padding: 0.7rem;
  }

  .sidebar-collapse-btn {
    justify-content: center;
  }

  .content {
    margin-left: var(--sidebar-collapsed-width);
    padding: 1rem;
  }

  .dash-hero-grid,
  .dash-hero-grid--3,
  .dash-sections {
    grid-template-columns: 1fr;
  }

  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kanban-column {
    min-width: 120px;
  }

  .card-grid,
  .form-row,
  .info-grid,
  .action-grid,
  .apollo-kpis {
    grid-template-columns: 1fr;
  }

  .apollo-search-layout {
    grid-template-columns: 1fr;
  }

  .apollo-search-body {
    flex-direction: column;
  }

  .lead-quick-stats {
    flex-wrap: wrap;
  }

  .lead-stat {
    min-width: 45%;
  }
}

/* ═══════════════════════════════════════════════════════
   Status / Integrations Dashboard
   ═══════════════════════════════════════════════════════ */

/* ─── Tabs ────────────────────────────────────────── */

.status-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: 1.5rem;
}

.status-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-400);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-tab:hover {
  color: var(--gray-600);
}

.status-tab--active {
  color: var(--brand-600);
  border-bottom-color: var(--brand-500);
}

/* ─── Status Page v2 ─────────────────────────────── */

.status-page {
  max-width: 100%;
}

.status-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 3rem 1rem;
  color: var(--gray-400);
  font-size: 0.85rem;
}

/* Top bar: summary + refresh */
.status-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.status-summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.status-summary svg { flex-shrink: 0; }
.status-summary--ok { color: var(--success-500); }
.status-summary--error { color: var(--danger-500); }
.status-summary--warning { color: var(--warning-500); }

.status-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-timestamp {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-family: 'JetBrains Mono', monospace;
}

.btn-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-refresh:hover {
  background: var(--gray-50);
  color: var(--gray-600);
  border-color: var(--gray-200);
}

/* ─── Card Grid v2 ───────────────────────────────── */

.status-grid-v2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .status-grid-v2 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .status-grid-v2 { grid-template-columns: 1fr; }
}

/* ─── Service Card ───────────────────────────────── */

.scard {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  transition: all 0.2s ease;
  position: relative;
}
.scard:hover {
  border-color: var(--gray-200);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* Status-specific left border accent */
.scard--ok { border-left: 3px solid var(--success-500); }
.scard--error { border-left: 3px solid var(--danger-500); background: var(--danger-50); }
.scard--warning { border-left: 3px solid var(--warning-500); }
.scard--loading { border-left: 3px solid var(--brand-300); opacity: 0.7; }

.scard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.scard-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.scard-test {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0;
}
.scard:hover .scard-test { opacity: 1; }
.scard-test:hover {
  background: var(--gray-50);
  color: var(--gray-600);
  border-color: var(--gray-200);
}
.scard-test:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.scard-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.3rem;
}

.scard-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.scard-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.scard-dot--ok { background: var(--success-500); box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.scard-dot--error { background: var(--danger-500); box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.scard-dot--warning { background: var(--warning-500); box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.scard-dot--loading { background: var(--brand-400); animation: pulse-dot 1.5s infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.scard-status-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.scard--ok .scard-status-label { color: var(--success-600); }
.scard--error .scard-status-label { color: var(--danger-600); }
.scard--warning .scard-status-label { color: var(--warning-600); }
.scard--loading .scard-status-label { color: var(--brand-400); }

.scard-detail {
  font-size: 0.73rem;
  color: var(--gray-500);
  line-height: 1.35;
  word-break: break-word;
  min-height: 1rem;
}
.scard--error .scard-detail { color: var(--danger-600); }
.scard-error { color: var(--danger-500); font-size: 0.72rem; }

.scard-latency {
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--gray-400);
  margin-top: 0.5rem;
}

/* ─── Agent sub-rows (PhantomBuster) ─────────────── */

.scard-agents {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-100);
}

.scard-agent-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--gray-500);
}

.scard-agent-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.agent-dot--ok { background: var(--success-500); }
.agent-dot--error { background: var(--danger-500); }
.agent-dot--expired { background: var(--danger-500); }
.agent-dot--missing { background: var(--gray-400); }
.agent-dot--stale { background: var(--warning-500); }
.agent-dot--unknown { background: var(--gray-300); }
.agent-dot--not-configured { background: var(--gray-400); box-shadow: inset 0 0 0 1.5px var(--gray-500); }

.scard-cookie-warn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.45rem;
  margin-bottom: 0.35rem;
  background: var(--warning-50);
  border: 1px solid var(--warning-100);
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--warning-800);
}
.scard-cookie-warn svg { flex-shrink: 0; color: var(--warning-500); }

/* Cookie badges */
.cookie-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  margin-left: 0.2rem;
  cursor: help;
  vertical-align: middle;
}
.cookie-badge--expired { background: var(--danger-100); color: var(--danger-800); }
.cookie-badge--missing { background: var(--gray-100); color: var(--gray-600); }
.cookie-badge--stale { background: var(--warning-100); color: var(--warning-800); }
.cookie-badge--unknown { background: var(--gray-100); color: var(--gray-500); }

/* ─── Cron Section v2 ────────────────────────────── */

.cron-section-v2 {
  padding: 0.75rem 1rem;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
}

.cron-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}
.cron-header svg { color: var(--gray-400); }

.cron-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cron-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 6px;
  font-size: 0.73rem;
}

.cron-chip-time {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--brand-500);
}

.cron-chip-label {
  color: var(--gray-500);
}

/* ─── Logs sub-tab ────────────────────────────────── */

.logs-header {
  margin-bottom: 0.75rem;
}

.logs-subtitle {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* ─── Small button variant ────────────────────────── */

.btn-xs {
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 4px;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  cursor: pointer;
}

.btn-ghost:hover {
  background: var(--gray-50);
  color: var(--gray-700);
}

/* Small spinner */
.spinner--sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* ═══════════════════════════════════════════════════════
   Leads Table Improvements
   ═══════════════════════════════════════════════════════ */

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable:hover {
  color: var(--brand-600);
}

.sort-icon {
  font-size: 0.7rem;
  margin-left: 0.25rem;
}

.sort-icon--inactive {
  opacity: 0.3;
}

.leads-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* ─── Status responsive ──────────────────────────── */

@media (max-width: 768px) {
  .status-bar {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════
   Content Creator — LinkedIn Post Generator
   ═══════════════════════════════════════════════════════ */

.content-page { padding: 0 2rem 2rem; max-width: 100%; }

/* ─── Content Toolbar (tabs + brand + linkedin) ─── */
.content-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--surface-border);
  background: var(--bg-primary);
}
.content-toolbar-left { display: flex; align-items: center; gap: 1rem; }
.content-toolbar-right { display: flex; align-items: center; gap: 0.75rem; }

/* LinkedIn connection badge */
.li-badge {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500;
}
.li-badge--connected {
  background: rgba(10, 102, 194, 0.12); color: #0a66c2;
  border: 1px solid rgba(10, 102, 194, 0.25);
}
.li-badge-btn {
  background: none; border: none; color: inherit; cursor: pointer;
  opacity: 0.5; font-size: 0.75rem; padding: 0 2px;
  transition: opacity var(--duration-fast);
}
.li-badge-btn:hover { opacity: 1; }
.li-connect-btn {
  background: #0a66c2 !important; color: #fff !important;
  border: none; display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.85rem; font-size: 0.8rem; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--duration-fast);
}
.li-connect-btn:hover { background: #004182 !important; }

.content-loading {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--text-secondary); padding: 3rem 0; justify-content: center;
}

/* ─── Sections ────────────────────────────────── */

.content-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.content-section-header h2 {
  font-size: 1.1rem; font-weight: 600; color: var(--text-primary);
}
.content-badge {
  background: var(--brand-50); color: var(--brand-400);
  padding: 0.25rem 0.75rem; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
}

/* ─── Themes Grid ─────────────────────────────── */

.content-themes { margin-bottom: 2rem; }
.content-themes-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.content-theme-card {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.content-theme-card h3 {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.theme-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.theme-tag {
  padding: 0.3rem 0.6rem; border-radius: var(--radius-full);
  font-size: 0.78rem; font-weight: 500;
}
.theme-tag small { opacity: 0.6; font-weight: 400; }
.theme-tag--sector { background: rgba(99,102,241,0.12); color: var(--brand-400); }
.theme-tag--role { background: rgba(16,185,129,0.12); color: var(--success-500); }
.theme-tag--company { background: rgba(6,182,212,0.12); color: #06b6d4; }

/* ─── Generate CTA ────────────────────────────── */

.content-generate { margin-bottom: 2rem; }
.content-generate-cta {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 2rem;
  text-align: center;
}
.content-generate-cta p {
  color: var(--text-secondary); margin-bottom: 1.25rem; font-size: 0.9rem;
}
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; gap: 0.5rem; }

/* ─── Ideas Grid ──────────────────────────────── */

.content-ideas { margin-bottom: 2rem; }
.content-ideas-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.content-idea-card {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.content-idea-card:hover { border-color: var(--brand-400); }
.content-idea-card--written { border-color: var(--success-500); }

.idea-card-top {
  display: flex; align-items: center; justify-content: space-between;
}
.idea-format-badge {
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--brand-50); color: var(--brand-400);
  padding: 0.2rem 0.6rem; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
}
.idea-targets { display: flex; gap: 0.3rem; }
.idea-target {
  font-size: 0.7rem; color: var(--text-muted);
  background: var(--surface-elevated); padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.idea-title {
  font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
  line-height: 1.3;
}
.idea-hook {
  display: flex; align-items: flex-start; gap: 0.4rem;
  font-size: 0.82rem; color: var(--text-secondary);
  background: var(--surface-elevated); padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md); border-left: 3px solid var(--brand-400);
}
.idea-hook em { font-style: italic; }
.idea-preview {
  font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5;
}
.idea-roles { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.idea-role-tag {
  font-size: 0.7rem; color: var(--success-500);
  background: rgba(16,185,129,0.1); padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.idea-card-top-right { display: flex; align-items: center; gap: 0.4rem; }
.idea-target-badge {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full); white-space: nowrap;
}
.idea-target-badge--perfil {
  background: rgba(139,92,246,0.15); color: #a78bfa;
}
.idea-target-badge--fanpage {
  background: rgba(34,197,94,0.15); color: #4ade80;
}

.idea-card-actions { margin-top: auto; padding-top: 0.5rem; }

/* ─── Written Posts ───────────────────────────── */

.content-posts { margin-bottom: 2rem; }
.content-written-post {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  margin-bottom: 1rem;
}
.written-post-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1rem;
}
.written-post-header h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.written-post-meta {
  display: flex; gap: 1rem; margin-top: 0.25rem;
  font-size: 0.78rem; color: var(--text-muted);
}

.written-post-body { margin-bottom: 1rem; }

/* LinkedIn preview mock */
.linkedin-post-preview {
  display: flex; gap: 0.75rem;
  background: var(--surface-elevated); border-radius: var(--radius-md);
  padding: 1rem; border: 1px solid var(--surface-border);
}
.linkedin-avatar {
  width: 40px; height: 40px; min-width: 40px;
  background: var(--brand-500); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
}
.linkedin-post-content { flex: 1; }
.linkedin-author { margin-bottom: 0.5rem; }
.linkedin-author strong {
  color: var(--text-primary); font-size: 0.88rem;
}
.linkedin-author span {
  color: var(--text-muted); font-size: 0.78rem; margin-left: 0.4rem;
}
.linkedin-post-text {
  color: var(--text-secondary); font-size: 0.85rem; line-height: 1.6;
  white-space: pre-wrap;
}

.written-post-tip {
  display: flex; align-items: flex-start; gap: 0.5rem;
  background: var(--warning-50); border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md); padding: 0.75rem 1rem;
  font-size: 0.8rem; color: var(--warning-500);
}

/* ─── Spinner small (inline) ──────────────────── */
/* (unified with .spinner-sm above) */

/* ─── Content responsive ──────────────────────── */

/* ─── Brand Identity Section ─────────────────── */

.brand-section {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  margin-bottom: 2rem;
}
.brand-section .content-section-header { margin-bottom: 1rem; }

.brand-config-form { margin-bottom: 1rem; }
.brand-url-row {
  display: flex; gap: 0.75rem; align-items: center;
}
.brand-url-row .input {
  flex: 1; min-width: 0;
}
.brand-hint {
  color: var(--text-muted); font-size: 0.78rem; margin-top: 0.5rem;
}

/* Brand preview */
.brand-preview { margin-bottom: 0.5rem; }
.brand-preview-row {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; padding: 0.75rem 0;
}
.brand-preview-colors {
  display: flex; gap: 1.5rem; align-items: flex-start;
}
.brand-swatch-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.brand-swatch-circle {
  width: 40px; height: 40px; border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(255,255,255,0.1);
  transition: transform var(--duration-fast) var(--ease-out);
  position: relative; overflow: hidden; cursor: pointer;
}
.brand-swatch-item:hover .brand-swatch-circle { transform: scale(1.1); }
.brand-swatch-name {
  font-size: 0.65rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.brand-swatch-hex {
  font-size: 0.6rem; color: var(--text-muted); font-family: monospace;
}
.brand-preview-divider {
  width: 1px; height: 48px; background: var(--surface-border);
}
.brand-preview-meta {
  display: flex; align-items: center; gap: 0.6rem;
}
.brand-favicon {
  width: 28px; height: 28px; border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.brand-meta-info {
  display: flex; flex-direction: column; gap: 0.1rem;
}
.brand-meta-label {
  font-size: 0.6rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.brand-font-label {
  font-size: 0.85rem; color: var(--text-primary); font-weight: 600;
}

/* Brand editing */
.brand-color-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
}
.brand-swatch-edit-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--duration-fast);
  pointer-events: none;
}
.brand-swatch-circle:hover .brand-swatch-edit-hint {
  opacity: 1;
}
.brand-logo-edit {
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo-edit:hover {
  opacity: 0.8;
}
.brand-logo-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px dashed var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: bold;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.brand-logo-edit:hover .brand-logo-placeholder {
  border-color: var(--brand-400);
  color: var(--brand-400);
}
.brand-logo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  border-radius: 6px;
  opacity: 0;
  transition: opacity var(--duration-fast);
}
.brand-logo-edit:hover .brand-logo-overlay {
  opacity: 1;
}

.brand-url-label {
  font-size: 0.75rem; color: var(--text-muted);
}

/* Brand editor */
.brand-editor {
  background: var(--surface-elevated); border-radius: var(--radius-md);
  padding: 1.25rem; margin-bottom: 0.75rem;
  border: 1px solid var(--surface-border);
}
.brand-editor-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1rem;
}
.brand-editor-field label {
  display: block; font-size: 0.75rem; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 0.4rem;
}
.color-picker-row {
  display: flex; align-items: center; gap: 0.5rem;
}
.color-picker-row input[type="color"] {
  width: 36px; height: 36px; border: none;
  border-radius: var(--radius-md); cursor: pointer;
  background: none; padding: 0;
}
.color-picker-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-row input[type="color"]::-webkit-color-swatch {
  border: 2px solid var(--surface-border); border-radius: var(--radius-md);
}
.color-hex-input {
  width: 90px; font-family: var(--font-mono, monospace);
  font-size: 0.8rem; text-transform: lowercase;
}

/* Extracted colors from site */
.brand-extracted-colors {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.brand-extracted-label {
  font-size: 0.75rem; color: var(--text-muted); white-space: nowrap;
}
.brand-extracted-swatches { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.brand-mini-swatch {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.brand-mini-swatch:hover {
  border-color: var(--brand-400); transform: scale(1.2);
}

.brand-editor-actions {
  display: flex; gap: 0.5rem;
}
.brand-edit-toggle { margin-top: 0.5rem; }

/* ─── Calendar Section ───────────────────────── */

.calendar-section {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem;
}
.calendar-stats { display: flex; gap: 0.5rem; }
.cal-stat {
  font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.03em;
}
.cal-stat--draft { background: rgba(245,158,11,0.15); color: #fbbf24; }
.cal-stat--approved { background: rgba(139,92,246,0.15); color: #a78bfa; }
.cal-stat--published { background: rgba(34,197,94,0.15); color: #4ade80; }

.calendar-nav {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  margin-bottom: 1rem;
}
.calendar-nav h3 {
  font-size: 1rem; font-weight: 600; color: var(--text-primary);
  min-width: 160px; text-align: center;
}

.calendar-grid { margin-bottom: 1rem; }
.calendar-header {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  margin-bottom: 4px;
}
.calendar-header span {
  text-align: center; font-size: 0.7rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.4rem 0;
}

.calendar-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.calendar-day {
  min-height: 70px; padding: 0.3rem;
  background: var(--surface-elevated); border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.calendar-day:hover { border-color: var(--surface-border); }
.calendar-day--empty { background: transparent; border: none; }
.calendar-day--today {
  border-color: var(--brand-400);
  background: rgba(99,102,241,0.06);
}
.calendar-day-num {
  font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
  display: block; margin-bottom: 0.2rem;
}
.calendar-day--today .calendar-day-num { color: var(--brand-400); }
.calendar-day-posts { display: flex; flex-direction: column; gap: 2px; }

.cal-post-chip {
  display: flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.35rem; border-radius: var(--radius-sm);
  font-size: 0.65rem; cursor: pointer; border: none;
  background: rgba(245,158,11,0.15); color: #fbbf24;
  transition: all var(--duration-fast) var(--ease-out);
}
.cal-post-chip:hover { transform: scale(1.05); }
.cal-post-chip--approved { background: rgba(139,92,246,0.15); color: #a78bfa; }
.cal-post-chip--published { background: rgba(34,197,94,0.15); color: #4ade80; }

.cal-post-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.cal-post-chip--perfil .cal-post-dot { background: #a78bfa; }
.cal-post-chip--fanpage .cal-post-dot { background: #4ade80; }

.cal-post-time { font-weight: 600; white-space: nowrap; }

/* Calendar post metrics */
.cal-post-main {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}
.cal-post-metrics {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.1rem;
}
.cal-metric {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.5rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.cal-metric svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* Post detail metrics section */
.post-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.post-metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem;
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
}
.post-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.post-metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
}

.calendar-legend {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
}
.cal-legend-item {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; color: var(--text-muted);
}
.cal-legend-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.cal-legend-dot--draft { background: #fbbf24; }
.cal-legend-dot--approved { background: #a78bfa; }
.cal-legend-dot--published { background: #4ade80; }
.cal-legend-dot--perfil { background: #a78bfa; border: 2px solid #7c3aed; }
.cal-legend-dot--fanpage { background: #4ade80; border: 2px solid #16a34a; }

/* ─── Modals ─────────────────────────────────── */

.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 2rem;
  animation: modalOverlayIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal-overlay.modal-closing {
  animation: modalOverlayOut 0.25s cubic-bezier(0.4, 0, 1, 1) both;
}
@keyframes modalOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalOverlayOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.modal-content {
  background: var(--surface-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 60px rgba(99, 102, 241, 0.06);
  animation: modalContentIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal-closing .modal-content {
  animation: modalContentOut 0.22s cubic-bezier(0.4, 0, 1, 1) both;
}
@keyframes modalContentIn {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalContentOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(12px) scale(0.97); }
}
.modal-content--wide { max-width: 640px; }

/* Smooth scrollbar inside modals */
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1); border-radius: 3px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-header h3 {
  font-size: 1.05rem; font-weight: 600; color: var(--text-primary);
  letter-spacing: -0.01em;
}
.modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: scale(1.05);
}
.modal-body {
  padding: 1.5rem 1.75rem;
}
.modal-footer {
  display: flex; gap: 0.75rem; justify-content: flex-end;
  padding: 1.15rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-post-title {
  font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem;
}
.modal-post-preview {
  font-size: 0.82rem; color: var(--text-secondary); font-style: italic;
  margin-bottom: 1.25rem;
}

/* ═══════════════════════════════════════════════════════
   System Dialog (replaces native alert/confirm/prompt)
   ═══════════════════════════════════════════════════════ */

.system-dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  position: fixed;
  inset: 0;
  width: fit-content;
  height: fit-content;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
  z-index: 1100;
}

.system-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: dialogBackdropIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes dialogBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.system-dialog .modal-content {
  animation: dialogContentIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 440px;
  min-width: 340px;
}
@keyframes dialogContentIn {
  from { opacity: 0; transform: translateY(20px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.system-dialog.dialog-closing .modal-content {
  animation: dialogContentOut 0.2s cubic-bezier(0.4, 0, 1, 1) both;
}
@keyframes dialogContentOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.96); }
}

.system-dialog .modal-header {
  padding: 1.5rem 1.75rem 0.75rem;
  border-bottom: none;
}
.system-dialog .modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.system-dialog .modal-body {
  padding: 0.5rem 1.75rem 1.25rem;
}
.system-dialog .modal-body p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.system-dialog .modal-footer {
  padding: 1rem 1.75rem 1.5rem;
  border-top: none;
  gap: 0.65rem;
}
.system-dialog .modal-footer .btn {
  padding: 0.6rem 1.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.system-dialog .modal-footer .btn:hover {
  transform: translateY(-1px);
}
.system-dialog .modal-footer .btn:active {
  transform: translateY(0);
}

/* Dialog input styling */
.system-dialog .regua-text-input {
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.system-dialog .regua-text-input:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Progress dialog */
.progress-dialog .modal-content {
  min-width: 300px;
  max-width: 360px;
  padding: 0;
}
.progress-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.25rem 2rem 1.25rem;
  gap: 1rem;
}
.progress-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.06);
  transition: background 0.3s ease;
}
.progress-icon--success {
  background: rgba(34, 197, 94, 0.1);
}
.progress-icon--error {
  background: rgba(239, 68, 68, 0.1);
}
.progress-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.progress-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.progress-message {
  font-size: 0.82rem;
  color: var(--text-secondary, var(--gray-400));
  margin: 0;
  line-height: 1.5;
}
.progress-message:empty {
  display: none;
}
.progress-footer {
  padding: 0.75rem 2rem 1.75rem;
  display: flex;
  justify-content: center;
}
.progress-footer .btn {
  padding: 0.55rem 2.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-footer .btn:hover {
  transform: translateY(-1px);
}
.progress-footer .btn:active {
  transform: translateY(0);
}

.schedule-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.schedule-field { display: flex; flex-direction: column; gap: 0.35rem; }
.schedule-field label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.schedule-field:last-child { grid-column: span 2; }
.schedule-hint {
  font-size: 0.78rem; color: var(--brand-400); margin-top: 0.75rem;
}

.detail-meta-row {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem;
}
.detail-datetime {
  font-size: 0.82rem; color: var(--text-secondary);
}
.detail-datetime-edit {
  display: flex; align-items: center; gap: 0.4rem;
}
.detail-datetime-edit span {
  font-size: 0.82rem; color: var(--text-secondary);
}
.regua-date-input--sm,
.regua-time-input--sm {
  font-size: 0.8rem !important;
  padding: 0.25rem 0.4rem !important;
  height: 30px !important;
  min-width: unset !important;
  width: auto !important;
}
.regua-date-input--sm { max-width: 140px; }
.regua-time-input--sm { max-width: 100px; }
.btn-save-schedule {
  font-size: 0.75rem !important;
  padding: 0.2rem 0.6rem !important;
  height: 28px !important;
  gap: 0.25rem;
  white-space: nowrap;
}

/* ─── Template Gallery ────────────────────────── */

.template-gallery {
  margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
}
.template-gallery-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.template-gallery-header h4 {
  font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
}
.template-gallery-hint {
  font-size: 0.72rem; color: var(--text-muted);
}
.template-gallery-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem;
}
.template-variant { text-align: center; }
.template-img {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius-md);
  cursor: pointer; border: 2px solid transparent;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.template-img:hover {
  border-color: var(--brand-400); transform: scale(1.03);
  box-shadow: var(--shadow-md);
}
.template-variant-label {
  display: block; margin-top: 0.35rem;
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.template-placeholder {
  grid-column: span 2; text-align: center;
  color: var(--text-muted); font-size: 0.82rem; padding: 1rem;
}
.template-img--selected {
  border-color: var(--brand-400) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25), var(--shadow-md);
  transform: scale(1.02);
}
.template-img--selected + .template-variant-label {
  color: var(--brand-400);
}

/* Carousel Preview */
.carousel-preview-section {
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--surface-border);
}
.carousel-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.carousel-preview-title {
  font-size: 0.9rem; font-weight: 700; color: var(--text-primary);
  margin: 0;
}
.carousel-preview-strip {
  display: flex; gap: 0.75rem; overflow-x: auto;
  padding-bottom: 0.75rem;
  scrollbar-width: thin;
}
.carousel-slide-thumb {
  width: 180px; height: 225px; object-fit: cover;
  border-radius: var(--radius-md); border: 2px solid var(--surface-border);
  flex-shrink: 0; box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
}
.carousel-slide-thumb:hover {
  border-color: var(--brand-400); transform: scale(1.03);
  box-shadow: var(--shadow-md);
}
.carousel-slide-thumb.template-img--selected {
  border-color: var(--brand-500); border-width: 3px;
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 21,128,61), 0.2);
}

.written-post-actions { display: flex; gap: 0.5rem; }

/* btn-danger */
.btn-danger {
  background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* btn-warning */
.btn-warning {
  background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3);
}
.btn-warning:hover { background: rgba(245,158,11,0.25); }

/* Calendar post image preview */
.cal-post-image-preview {
  margin: 1rem 0; text-align: center;
}
.cal-post-image-preview h4 {
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.cal-post-image-thumb {
  max-width: 280px; max-height: 280px; border-radius: var(--radius-md);
  border: 2px solid var(--surface-border); box-shadow: var(--shadow-md);
}

/* Régua date input */
.regua-date-input {
  max-width: 200px;
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color var(--duration-fast);
  color-scheme: dark;
}
.regua-date-input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.regua-date-input::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.6);
  cursor: pointer;
}
.regua-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.light .regua-date-input {
  color-scheme: light;
}
.light .regua-date-input::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.6;
}

/* DateTime row (date + time side by side) */
.regua-datetime-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.regua-datetime-row .regua-date-input {
  flex: 1;
  max-width: none;
}
.regua-time-input {
  width: 120px;
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color var(--duration-fast);
  color-scheme: dark;
}
.regua-time-input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.regua-time-input::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.6);
  cursor: pointer;
}
.regua-time-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.light .regua-time-input {
  color-scheme: light;
}
.light .regua-time-input::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.6;
}

/* Régua text input */
.regua-text-input {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color var(--duration-fast);
}
.regua-text-input::placeholder { color: var(--text-muted); }
.regua-text-input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ═══════════════════════════════════════════════════════
   Régua de Conteúdo — Wizard Steps
   ═══════════════════════════════════════════════════════ */

/* ─── Régua List ─────────────────────────────────── */

.regua-list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.regua-list-header h2 { font-size: 1.1rem; font-weight: 600; margin: 0; }

.regua-list-grid {
  display: flex; flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.regua-card {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 1.5rem 1.75rem; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  display: flex; flex-direction: column; gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.regua-card:hover {
  border-color: var(--brand-400);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}
.regua-card--active {
  border-color: var(--success-400);
  background: linear-gradient(135deg, var(--surface-card), rgba(34, 197, 94, 0.04));
}
.regua-card--active:hover {
  border-color: var(--success-400);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.15);
}

.regua-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
}
.regua-card-name { font-weight: 700; font-size: 1.05rem; }
.regua-card-status {
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
}
.regua-card-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.regua-card-meta {
  display: flex; gap: 1.25rem; font-size: 0.82rem; color: var(--text-muted);
}
.regua-card-meta span { display: flex; align-items: center; gap: 0.35rem; }

.regua-card-btn { align-self: flex-start; margin-top: auto; }
.regua-card-delete {
  background: none; border: none; cursor: pointer; padding: 0.25rem;
  color: var(--text-muted); border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  line-height: 1; display: flex; align-items: center;
}
.regua-card-delete:hover { color: var(--danger-500); background: rgba(239,68,68,0.1); }

.regua-list-empty {
  text-align: center; padding: 2.5rem; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: 12px;
}

.regua-list-completed-toggle { margin-top: 1.5rem; margin-bottom: 0.75rem; }

.regua-back-btn { margin-bottom: 1rem; }

/* ─── Step Progress Bar ──────────────────────────── */

.regua-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 2rem; padding: 1.25rem 0;
}
.regua-step {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  position: relative; z-index: 1;
}
.regua-step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  background: var(--surface-elevated); border: 2px solid var(--surface-border);
  color: var(--text-muted); transition: all 0.3s ease;
}
.regua-step--active .regua-step-circle {
  background: var(--brand-400); border-color: var(--brand-400);
  color: #fff; box-shadow: 0 0 12px rgba(99,102,241,0.4);
}
.regua-step--done .regua-step-circle {
  background: rgba(34,197,94,0.15); border-color: #22c55e; color: #22c55e;
}
.regua-step-label {
  font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.regua-step--active .regua-step-label { color: var(--brand-400); }
.regua-step--done .regua-step-label { color: #22c55e; }
.regua-step-line {
  width: 60px; height: 2px; background: var(--surface-border);
  margin: 0 0.5rem; margin-bottom: 1.4rem;
  transition: background 0.3s ease;
}
.regua-step-line--done { background: #22c55e; }

/* ─── Themes compact ─────────────────────────────── */

.content-themes--compact { margin-bottom: 1.5rem; }
.content-themes-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}

/* ─── Step 0: Config ─────────────────────────────── */

.regua-config { margin-bottom: 2rem; }
.regua-config-card {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 2rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.regua-config-field label {
  font-size: 0.82rem; font-weight: 600; color: var(--text-primary);
  display: block; margin-bottom: 0.5rem;
}
.regua-slider-row {
  display: flex; align-items: center; gap: 1rem;
}
.regua-slider {
  flex: 1; height: 6px; appearance: none; -webkit-appearance: none;
  background: var(--surface-border); border-radius: 3px; outline: none;
  cursor: pointer;
}
.regua-slider::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-400); cursor: pointer;
  box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}
.regua-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-400); cursor: pointer; border: none;
}
.regua-slider-value {
  font-size: 1.25rem; font-weight: 700; color: var(--brand-400);
  min-width: 2rem; text-align: center;
}
.regua-config-hint {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem;
}
.regua-target-toggles {
  display: flex; gap: 0.5rem;
}
.regua-target-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem; font-weight: 600;
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.regua-target-pill:hover {
  border-color: var(--brand-400);
  color: var(--text-primary);
  background: rgba(99,102,241,0.04);
}
.regua-target-pill.active {
  border-color: var(--brand-500);
  background: rgba(99,102,241,0.1);
  color: var(--brand-400);
}
html.light .regua-target-pill.active {
  background: rgba(99,102,241,0.08);
  border-color: var(--brand-500);
  color: var(--brand-600);
}

/* Form label — uppercase micro label */
.form-label-sm {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.form-label-sm--mt {
  margin-top: 0.75rem;
}

.regua-config-summary {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; background: rgba(99,102,241,0.06);
  border-radius: var(--radius-md); color: var(--brand-400);
  font-size: 0.82rem; font-weight: 500;
}

/* ─── Step 1: Plan (Timeline) ────────────────────── */

.regua-plan { margin-bottom: 2rem; }
.regua-plan-badges { display: flex; gap: 0.5rem; }
.regua-plan-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end;
  margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--surface-border);
}

.regua-timeline {
  position: relative; padding-left: 100px;
}
.regua-timeline::before {
  content: ''; position: absolute; left: 86px; top: 0; bottom: 0;
  width: 2px; background: var(--surface-border);
}

.timeline-card {
  display: flex; gap: 1rem; margin-bottom: 1rem;
  position: relative;
}
.timeline-date {
  position: absolute; left: -100px; top: 0.3rem;
  text-align: right; width: 76px;
}
.timeline-day {
  display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-primary);
}
.timeline-time {
  display: block; font-size: 0.68rem; color: var(--text-muted);
}
.timeline-dot {
  position: absolute; left: -18px; top: 0.5rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-400); border: 2px solid var(--surface-card);
  box-shadow: 0 0 0 2px var(--brand-400);
  z-index: 1;
}
.timeline-content {
  flex: 1; background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md); padding: 1rem 1.25rem;
  transition: border-color 0.2s ease;
}
.timeline-content:hover { border-color: var(--brand-400); }
.timeline-top {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.timeline-fw {
  font-size: 0.68rem; font-weight: 500; color: var(--text-muted);
  padding: 0.15rem 0.5rem; background: var(--surface-elevated);
  border-radius: var(--radius-full);
}
.timeline-title {
  font-size: 0.92rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.timeline-hook {
  font-size: 0.82rem; color: var(--brand-400); font-style: italic;
  margin-bottom: 0.35rem;
}
.timeline-preview {
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5;
  margin-bottom: 0.5rem;
}
.timeline-targets {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
}

/* ─── Step 2: Pieces ─────────────────────────────── */

.regua-pieces { margin-bottom: 2rem; }
.regua-pieces-stats { display: flex; gap: 0.5rem; }
.regua-pieces-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.piece-card {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-md); padding: 1rem 1.25rem;
  transition: all 0.2s ease;
}
.piece-card:hover { border-color: var(--brand-400); transform: translateY(-1px); }
.piece-card--approved { border-left: 3px solid #a78bfa; }
.piece-card--published { border-left: 3px solid #22c55e; opacity: 0.7; }

.piece-card-top {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.piece-date {
  font-size: 0.75rem; font-weight: 700; color: var(--text-secondary);
}
.piece-status {
  font-size: 0.65rem; font-weight: 600; padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full); text-transform: uppercase;
  margin-left: auto;
}
.piece-status--draft { background: rgba(245,158,11,0.15); color: #fbbf24; }
.piece-status--approved { background: rgba(139,92,246,0.15); color: #a78bfa; }
.piece-status--published { background: rgba(34,197,94,0.15); color: #4ade80; }
.piece-title {
  font-size: 0.88rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.piece-preview {
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.piece-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.5rem; border-top: 1px solid var(--surface-border);
}
.piece-chars {
  font-size: 0.7rem; color: var(--text-muted);
}
.piece-actions { display: flex; gap: 0.4rem; }

/* ─── Writing progress ───────────────────────────── */

.regua-writing { margin-bottom: 2rem; }
.regua-writing-card {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 3rem 2rem;
  text-align: center; max-width: 480px; margin: 0 auto;
}
.regua-writing-spinner { margin-bottom: 1.5rem; }
.regua-writing-card h3 {
  font-size: 1.1rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.regua-writing-card p {
  font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 1.5rem;
}
.regua-writing-progress {
  display: flex; align-items: center; gap: 1rem; justify-content: center;
}
.regua-writing-bar {
  flex: 1; max-width: 240px; height: 6px;
  background: var(--surface-border); border-radius: 3px; overflow: hidden;
}
.regua-writing-fill {
  height: 100%; background: var(--brand-400); border-radius: 3px;
  transition: width 0.5s ease;
}
.regua-writing-progress span {
  font-size: 0.82rem; font-weight: 600; color: var(--brand-400);
}

/* ─── Step 3: Autopilot ──────────────────────────── */

.regua-autopilot { margin-bottom: 2rem; }

.autopilot-banner {
  display: flex; align-items: center; gap: 1.25rem;
  background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-lg); padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.autopilot-banner-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(34,197,94,0.1); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.autopilot-banner-text h3 {
  font-size: 1rem; font-weight: 600; color: #22c55e;
  margin-bottom: 0.25rem;
}
.autopilot-banner-text p {
  font-size: 0.82rem; color: var(--text-secondary);
}

.autopilot-stats {
  display: flex; gap: 1rem; margin-bottom: 1.5rem;
}
.autopilot-stat {
  flex: 1; background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-md); padding: 1rem;
  text-align: center;
}
.autopilot-stat-num {
  display: block; font-size: 1.75rem; font-weight: 700; color: var(--text-primary);
}
.autopilot-stat--approved { color: #a78bfa !important; }
.autopilot-stat--published { color: #22c55e !important; }
.autopilot-stat-label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.autopilot-next {
  margin-bottom: 1.5rem;
}
.autopilot-next h4 {
  font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.autopilot-next-card {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-left: 3px solid var(--brand-400);
  border-radius: var(--radius-md); padding: 1rem 1.25rem;
}
.autopilot-next-date {
  font-size: 0.72rem; font-weight: 600; color: var(--brand-400);
  display: block; margin-bottom: 0.25rem;
}
.autopilot-next-card strong {
  font-size: 0.92rem; color: var(--text-primary);
  display: block; margin-bottom: 0.25rem;
}
.autopilot-next-card p {
  font-size: 0.78rem; color: var(--text-secondary);
}

/* ─── Light mode overrides (Régua) ────────────── */

html.light .regua-step-circle {
  background: #f1f5f9; border-color: #e2e8f0; color: #94a3b8;
}
html.light .regua-step--active .regua-step-circle {
  background: var(--brand-400); border-color: var(--brand-400); color: #fff;
}
html.light .regua-step--done .regua-step-circle {
  background: rgba(34,197,94,0.1); border-color: #22c55e; color: #16a34a;
}
html.light .regua-step-line { background: #e2e8f0; }
html.light .regua-config-summary { background: rgba(99,102,241,0.08); }
html.light .timeline-content { background: #fff; border-color: #e2e8f0; }
html.light .timeline-dot { border-color: #fff; }
html.light .piece-card { background: #fff; }
html.light .autopilot-banner { background: rgba(34,197,94,0.04); }
html.light .autopilot-stat { background: #fff; }
html.light .regua-writing-card { background: #fff; }

/* ─── Email Thread ──────────────────────────────── */

.email-thread {
  display: flex; flex-direction: column; gap: 0.75rem;
}
.email-msg {
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary, #6366f1);
  background: var(--surface-card, rgba(255,255,255,0.03));
}
.email-msg.email-reply {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.04);
}
.email-msg-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem;
}
.email-msg-from {
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary, #94a3b8);
}
.email-msg.email-reply .email-msg-from {
  color: #22c55e;
}
.email-msg-date {
  font-size: 0.72rem; color: var(--text-muted, #64748b);
}
.email-msg-subject {
  font-weight: 700; font-size: 0.88rem;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: 0.4rem;
}
.email-msg-body {
  font-size: 0.82rem; line-height: 1.6;
  color: var(--text-secondary, #94a3b8);
  white-space: pre-wrap; word-break: break-word;
}
.email-ai-interest {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.7rem; font-weight: 600;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  background: rgba(99, 102, 241, 0.1); color: #818cf8;
}

/* Light mode */
html.light .email-msg {
  background: #f8fafc;
}
html.light .email-msg.email-reply {
  background: rgba(34, 197, 94, 0.06);
}
html.light .email-msg-subject { color: #1e293b; }
html.light .email-msg-body { color: #475569; }

/* ─── Email Reply Card ────────────────────────── */

.email-reply-card {
  border-top: 3px solid var(--brand-500);
  margin-top: 1.25rem;
}

.email-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.email-reply-header h3 {
  margin: 0;
}

.reply-sent-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  background: var(--success-50);
  color: var(--success-500);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.reply-score-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
}

.reply-score-stars {
  display: flex;
  gap: 0.15rem;
  font-size: 1.25rem;
}

.reply-score-star {
  color: var(--gray-300);
  transition: color var(--duration-fast);
}

.reply-score-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.reply-classification-reason {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

.reply-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.reply-meta-label {
  color: var(--text-muted);
  font-weight: 500;
}

.reply-meta-value {
  color: var(--text-primary);
}

.reply-field {
  margin-bottom: 0.75rem;
}

.reply-field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.reply-subject-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--duration-fast);
}

.reply-subject-input:focus {
  border-color: var(--brand-400);
}

.reply-subject-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.reply-editor {
  min-height: 180px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.7;
  font-family: inherit;
  outline: none;
  transition: border-color var(--duration-fast);
}

.reply-editor:focus {
  border-color: var(--brand-400);
}

.reply-editor a {
  color: var(--brand-400);
  text-decoration: underline;
}

.reply-editor--disabled {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.reply-empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  border: 1px dashed var(--surface-border);
  margin-bottom: 1rem;
}

.reply-reasoning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--brand-50);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  font-style: italic;
}

.reply-reasoning-icon {
  color: var(--brand-400);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
}

.reply-sent-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success-500);
  font-size: 0.88rem;
  font-weight: 500;
}

/* Light mode overrides */
html.light .email-reply-card {
  border-top-color: var(--brand-500);
}
html.light .reply-score-bar {
  background: #f8fafc;
  border-color: #e5e7eb;
}
html.light .reply-subject-input {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #1e293b;
}
html.light .reply-editor {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #1e293b;
}
html.light .reply-empty-state {
  background: #f8fafc;
  border-color: #d1d5db;
}
html.light .reply-reasoning {
  background: #eef2ff;
  border-color: rgba(99, 102, 241, 0.15);
}

/* ─── Agent Insights ─────────────────────────── */

.agent-insights-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}
.agent-insights-header h3 { margin: 0; }

.agents-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.agent-insight-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border-left: 3px solid var(--agent-color, var(--brand-400));
  transition: box-shadow var(--duration-fast) var(--ease-out);
}
.agent-insight-card:hover {
  box-shadow: var(--shadow-md), 0 0 20px rgba(99,102,241,0.04);
  transform: translateY(-1px);
}

.agent-insight-header {
  display: flex; align-items: center; gap: 0.75rem;
}
.agent-insight-icon { font-size: 1.4rem; line-height: 1; }
.agent-insight-header h4 {
  margin: 0; font-size: 0.9rem; font-weight: 700;
  color: var(--text-primary);
  text-transform: none; letter-spacing: 0;
}
.agent-insight-role {
  font-size: 0.72rem; color: var(--text-muted); display: block;
}
.agent-insight-time {
  font-size: 0.72rem; color: var(--text-muted); display: block;
}

.agent-score {
  margin-left: auto; font-size: 1.1rem; font-weight: 700;
  padding: 0.25rem 0.6rem; border-radius: var(--radius-md);
  flex-shrink: 0;
}
.agent-score--good { background: rgba(34,197,94,0.12); color: #22c55e; }
.agent-score--warning { background: rgba(245,158,11,0.12); color: #f59e0b; }
.agent-score--critical { background: rgba(239,68,68,0.12); color: #ef4444; }

.agent-insight-summary {
  font-size: 0.82rem; color: var(--text-secondary);
  line-height: 1.55; margin: 0.75rem 0;
}

.agent-insight-highlights {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem;
}
.highlight-chip {
  font-size: 0.72rem; padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full); font-weight: 600;
}
.highlight--good { background: rgba(34,197,94,0.1); color: #22c55e; }
.highlight--warning { background: rgba(245,158,11,0.1); color: #f59e0b; }
.highlight--critical { background: rgba(239,68,68,0.1); color: #ef4444; }

.agent-insight-suggestions { margin-top: 0.5rem; }
.agent-insight-suggestions summary {
  font-size: 0.78rem; color: var(--text-muted); cursor: pointer;
  padding: 0.3rem 0; user-select: none;
}
.agent-insight-suggestions summary:hover { color: var(--text-secondary); }
.agent-insight-suggestions ul {
  margin: 0.5rem 0 0; padding-left: 1.2rem;
  font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6;
}
.agent-insight-suggestions li { margin-bottom: 0.4rem; }
.suggestion-alta { color: #ef4444; font-weight: 600; }
.suggestion-media { color: #f59e0b; font-weight: 600; }
.suggestion-baixa { color: #22c55e; font-weight: 600; }

.agent-ux-suggestions summary { color: var(--brand-400); }

/* Light mode overrides */
html.light .agent-insight-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
}
html.light .agent-insight-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Post content sections (modal) */
.post-sections { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; }
.post-section {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  background: var(--surface-card);
}
.post-section-label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.post-section-label svg { opacity: 0.6; }
.post-section-content {
  font-size: 0.85rem; color: var(--text-primary); line-height: 1.6;
  white-space: pre-wrap;
}
.post-hook-text {
  font-size: 1rem; font-weight: 600; color: var(--brand-400);
  font-style: italic;
}
.post-hashtags-list {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.hashtag-chip {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  background: var(--brand-400);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Calendar post title in chip */
.cal-post-title {
  font-size: 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  color: var(--text-secondary);
  line-height: 1.2;
}
.cal-post-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

/* Piece card hook */
.piece-hook {
  font-size: 0.78rem;
  color: var(--brand-400);
  font-style: italic;
  margin: 0.2rem 0;
  line-height: 1.4;
}
.piece-hashtags-count {
  font-size: 0.7rem;
  color: var(--brand-400);
  font-weight: 600;
}

/* ─── Content responsive (full) ──────────────── */

@media (max-width: 768px) {
  .content-page { padding: 1rem; }
  .content-themes-grid { grid-template-columns: 1fr; }
  .content-ideas-grid { grid-template-columns: 1fr; }
  .brand-url-row { flex-direction: column; }
  .brand-editor-grid { grid-template-columns: 1fr 1fr; }
  .brand-preview-row { flex-direction: column; gap: 1rem; }
  .brand-preview-divider { width: 80px; height: 1px; }
  .brand-preview-colors { gap: 1rem; }
  .brand-swatch-circle { width: 36px; height: 36px; }
  .calendar-day { min-height: 50px; }
  .calendar-day-num { font-size: 0.65rem; }
  .cal-post-time { display: none; }
  .schedule-form { grid-template-columns: 1fr; }
  .schedule-field:last-child { grid-column: span 1; }
  .modal-content { max-width: 95vw; }
  .modal-overlay { padding: 1rem; }
  .agents-insights-grid { grid-template-columns: 1fr; }
}

/* Delete inline button (leads table) */
.btn-delete-inline {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  opacity: 0.35;
  transition: opacity 0.15s, background 0.15s;
  line-height: 1;
}
.btn-delete-inline:hover {
  opacity: 1;
  background: var(--danger-50, #fef2f2);
}
.btn-delete-inline:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ─── Pipeline Comercial Pós-Reunião ─────────────────── */

.pipeline-card { margin-top: 0; }

/* Section icon (inline SVG next to text) */
.section-icon { display: inline-flex; vertical-align: -2px; margin-right: 0.35rem; opacity: 0.7; }

.pipeline-stepper {
  display: flex; align-items: flex-start; gap: 0;
  margin: 1.5rem 0; justify-content: center;
}
.pipeline-step {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  min-width: 90px; flex-shrink: 0;
}
.pipeline-step-dot {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--duration-normal) var(--ease-out);
}
.pipeline-step-dot svg { width: 18px; height: 18px; }
.pipeline-step-label {
  font-size: 0.8rem; color: var(--text-muted); white-space: nowrap;
  font-weight: 500;
}
.pipeline-step--done .pipeline-step-dot {
  background: rgba(34, 197, 94, 0.15); color: var(--success-500);
}
.pipeline-step--active .pipeline-step-dot {
  background: var(--brand-500); color: #fff;
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.15);
}
.pipeline-step--active .pipeline-step-label {
  color: var(--brand-500); font-weight: 600;
}
.pipeline-step--pending .pipeline-step-dot {
  background: var(--gray-100); color: var(--text-muted);
}
.pipeline-step-line {
  flex: 1; min-width: 40px; max-width: 120px; height: 2px;
  background: var(--gray-200); margin: 0 0.5rem;
  align-self: flex-start; margin-top: 20px;
  transition: background var(--duration-normal);
}
.pipeline-line--done { background: var(--success-500); }

/* Pipeline Action Card */
.pipeline-action-card {
  background: var(--surface-elevated); border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem; margin-top: 0.75rem;
  border: 1px solid var(--surface-border);
}
.pipeline-action-card h4 {
  margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--text-primary);
  display: flex; align-items: center;
}
.pipeline-action-card h4 .section-icon { opacity: 0.6; }
.pipeline-prev-note {
  font-size: 0.82rem; color: var(--text-secondary); margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem; background: var(--gray-50);
  border-radius: var(--radius-sm); border-left: 3px solid var(--brand-500);
}

/* Feedback Option Cards */
.pipeline-feedback-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}
@media (max-width: 768px) {
  .pipeline-feedback-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .pipeline-feedback-grid { grid-template-columns: repeat(2, 1fr); }
}
.pipeline-feedback-opt {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 1.1rem 0.75rem; border-radius: var(--radius-md);
  border: 2px solid var(--gray-200); background: var(--surface-card);
  cursor: pointer; transition: all var(--duration-fast);
  text-align: center;
}
.pipeline-feedback-opt:hover {
  border-color: var(--brand-400); background: rgba(99, 102, 241, 0.06);
  transform: translateY(-1px);
}
.pipeline-feedback-opt--selected {
  border-color: var(--brand-500) !important; background: rgba(99, 102, 241, 0.1) !important;
}
.pipeline-feedback-opt-icon { display: flex; }
.pipeline-feedback-opt-icon svg { width: 22px; height: 22px; }
.pipeline-feedback-opt-label {
  font-size: 0.82rem; font-weight: 600; color: var(--text-primary);
}
.pipeline-feedback-opt-desc {
  font-size: 0.72rem; color: var(--text-muted); line-height: 1.3;
}

/* No-show actions */
.pipeline-noshow-actions {
  margin-top: 1rem; padding: 1rem 1.25rem;
  background: var(--surface-card); border: 1px solid var(--warning-500);
  border-radius: var(--radius-md);
}
.pipeline-noshow-actions p {
  margin: 0 0 0.75rem; font-weight: 600; font-size: 0.9rem; color: var(--warning-500);
}
.pipeline-noshow-actions .noshow-row {
  display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap;
}
.pipeline-noshow-actions .noshow-field {
  display: flex; flex-direction: column; gap: 0.3rem; flex: 1; min-width: 200px;
}
.pipeline-noshow-actions .noshow-field label {
  font-size: 0.75rem; color: var(--text-muted); font-weight: 500;
}
.pipeline-noshow-actions .noshow-field input {
  padding: 0.5rem 0.6rem; font-size: 0.85rem; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200); background: var(--surface-base); color: var(--text-primary);
}

/* Calendly Scheduler */
.calendly-scheduler {
  margin-top: 0.75rem; padding: 1rem;
  background: var(--surface-card); border: 1px solid var(--brand-500);
  border-radius: var(--radius-md);
}
.calendly-scheduler-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem; font-weight: 600; font-size: 0.9rem; color: var(--brand-500);
}
.calendly-scheduler-body label {
  display: block; font-size: 0.78rem; color: var(--text-muted);
  margin: 0.6rem 0 0.3rem; font-weight: 500;
}
.calendly-scheduler-body label:first-child { margin-top: 0; }
.calendly-scheduler-body input[type="date"],
.calendly-scheduler-body input[type="time"] {
  width: 100%; padding: 0.5rem 0.6rem; font-size: 0.85rem;
  border-radius: var(--radius-sm); border: 1px solid var(--gray-200);
  background: var(--surface-base); color: var(--text-primary);
}
.calendly-slots-grid {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem;
}
.calendly-slot-btn {
  padding: 0.4rem 0.75rem; font-size: 0.82rem; font-weight: 500;
  border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  background: var(--surface-base); color: var(--text-primary);
  cursor: pointer; transition: all 0.15s;
}
.calendly-slot-btn:hover { border-color: var(--brand-500); color: var(--brand-500); }
.calendly-slot-btn.active {
  background: var(--brand-500); color: #fff; border-color: var(--brand-500);
}

/* Pipeline Form */
.pipeline-form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.pipeline-form-field { flex: 1; min-width: 140px; }
.pipeline-form-field label {
  display: block; font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 0.3rem; font-weight: 500;
}
.pipeline-proposta-info {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.pipeline-proposta-valor {
  font-size: 1.25rem; font-weight: 700; color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}
.pipeline-proposta-validade {
  font-size: 0.85rem; color: var(--text-secondary);
  padding: 0.25rem 0.75rem; border-radius: var(--radius-sm);
  background: var(--gray-50);
}
.pipeline-expired {
  color: var(--danger-500) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Proposta Layout (upload + fields side by side) */
.proposta-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  align-items: stretch; margin-top: 0.25rem;
}
@media (max-width: 600px) { .proposta-layout { grid-template-columns: 1fr; } }
.proposta-fields {
  display: flex; flex-direction: column; gap: 0.6rem;
  justify-content: space-between;
}
.proposta-fields-row {
  display: flex; gap: 0.75rem; flex: 1;
}
.proposta-field-group {
  flex: 1; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0;
}
.proposta-field-group .input-icon-wrap { flex: 1; display: flex; flex-direction: column; }
.proposta-field-group .input-with-icon { width: 100%; flex: 1; }
.proposta-input-tall { min-height: 48px; }
input[type="date"].proposta-input-tall { padding-right: 1.1rem; }
.proposta-field-label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.proposta-field-label .text-muted { font-weight: 400; opacity: 0.7; text-transform: none; }

/* Input with icon */
.input-icon-wrap {
  position: relative;
}
.input-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  display: flex; color: var(--text-muted); pointer-events: none; z-index: 1;
  opacity: 0.5;
}
.input-icon svg { width: 15px; height: 15px; }
.input-icon--text {
  font-size: 0.78rem; font-weight: 700; font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted); opacity: 0.6;
}
.input-with-icon {
  padding-left: 2.2rem !important;
  border: 1px solid var(--surface-border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--surface-card) !important;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.input-with-icon:focus {
  border-color: var(--brand-400) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  outline: none;
}
.input-with-icon--text {
  padding-left: 2.4rem !important;
}

/* Upload Zone */
.proposta-upload-zone {
  border: 2px dashed var(--surface-border); border-radius: var(--radius-lg);
  padding: 1.5rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  transition: all var(--duration-fast); cursor: pointer;
  position: relative; min-height: 120px; justify-content: center;
  background: var(--surface-card);
}
.proposta-upload-zone:hover,
.proposta-upload-zone--hover {
  border-color: var(--brand-400); background: rgba(99, 102, 241, 0.04);
}
.proposta-upload-zone--has-file {
  border-color: var(--success-500); border-style: solid;
  background: rgba(34, 197, 94, 0.04);
}
.proposta-upload-icon { color: var(--brand-400); opacity: 0.4; }
.proposta-upload-icon svg { width: 28px; height: 28px; }
.proposta-upload-text { font-size: 0.82rem; color: var(--text-secondary); }
.proposta-upload-text a { color: var(--brand-400); font-weight: 600; text-decoration: none; }
.proposta-upload-text a:hover { text-decoration: underline; }
.proposta-upload-hint {
  font-size: 0.68rem; color: var(--text-muted); opacity: 0.6;
  margin-top: 0.15rem;
}
.proposta-upload-zone--has-file .proposta-upload-icon,
.proposta-upload-zone--has-file .proposta-upload-text,
.proposta-upload-zone--has-file .proposta-upload-hint { display: none; }

/* File Preview inside drop zone */
.proposta-file-preview {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.85rem; border-radius: var(--radius-md);
  background: var(--surface-elevated); width: 100%;
}
.proposta-file-icon { display: flex; color: var(--brand-400); flex-shrink: 0; }
.proposta-file-name {
  font-size: 0.82rem; color: var(--text-primary); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.proposta-file-remove {
  display: flex; padding: 4px; border: none; background: none;
  color: var(--text-muted); cursor: pointer; flex-shrink: 0;
  border-radius: var(--radius-sm); transition: all var(--duration-fast);
}
.proposta-file-remove:hover { color: var(--danger-400); background: rgba(239, 68, 68, 0.1); }
.proposta-file-remove svg { width: 14px; height: 14px; }

/* Anexo link in cobranca stage */
.proposta-anexo-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--brand-400); font-weight: 500;
  text-decoration: none; padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md); background: rgba(99, 102, 241, 0.08);
  transition: all var(--duration-fast);
}
.proposta-anexo-link:hover { background: rgba(99, 102, 241, 0.15); transform: translateY(-1px); }
.proposta-anexo-link svg { width: 14px; height: 14px; }

/* Proposta submit button */
.proposta-submit-btn {
  width: 100%; justify-content: center; text-align: center;
  font-size: 0.88rem; padding: 0.7rem 1.25rem;
}

/* Pipeline Result Buttons */
.pipeline-result-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
@media (max-width: 600px) { .pipeline-result-btns { grid-template-columns: repeat(2, 1fr); } }
.pipeline-result-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  border: 2px solid var(--gray-200); background: var(--surface-card);
  color: var(--text-primary); transition: all var(--duration-fast);
}
.pipeline-result-btn:hover { transform: translateY(-1px); }
.pipeline-result-btn-icon { display: inline-flex; }
.pipeline-result-btn-icon svg { width: 15px; height: 15px; }

.pipeline-result-btn--ganhou:hover { border-color: var(--success-500); background: rgba(34,197,94,0.08); color: var(--success-500); }
.pipeline-result-btn--perdeu:hover { border-color: var(--danger-500); background: rgba(239,68,68,0.08); color: var(--danger-500); }
.pipeline-result-btn--neutro:hover { border-color: var(--gray-400); background: rgba(148,163,184,0.08); }
.pipeline-result-btn--adiou:hover { border-color: var(--warning-500); background: rgba(245,158,11,0.08); color: var(--warning-500); }

/* Cobrança Follow-up Section */
.cobranca-follow-section {
  margin: 1.25rem 0;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md, 10px);
}
.cobranca-follow-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
html.light .cobranca-follow-section {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* Resultado Badge */
.resultado-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.25rem; border-radius: var(--radius-md);
  font-weight: 600; font-size: 1rem;
}
.resultado-badge-icon { display: inline-flex; }
.resultado-badge-icon svg { width: 18px; height: 18px; }
.resultado--ganhou { background: rgba(34, 197, 94, 0.12); color: var(--success-500); }
.resultado--perdeu { background: rgba(239, 68, 68, 0.12); color: var(--danger-500); }
.resultado--sem_resposta { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }
.resultado-motivo {
  font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.5rem;
}

/* Score dot indicator (replaces emoji) */
.score-dot-indicator {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  vertical-align: middle; margin-right: 0.25rem;
}

/* Message type icon */
.msg-type-icon { display: inline-flex; vertical-align: -2px; margin-right: 0.25rem; opacity: 0.7; }
.msg-type-icon svg { width: 13px; height: 13px; }

/* Dashboard Pipeline Board */
.dash-pipeline-card { margin-top: 1.25rem; }
.pipe-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.pipe-header h3 { margin: 0; }
.pipe-header-stats { display: flex; gap: 0.75rem; }
.pipe-stat {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm); font-weight: 500;
}
.pipe-stat svg { width: 13px; height: 13px; }
.pipe-stat b { font-weight: 700; }
.pipe-stat--active { background: rgba(99,102,241,0.1); color: var(--brand-500); }
.pipe-stat--ganhou { background: rgba(34,197,94,0.1); color: var(--success-500); }

.pipe-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

.pipe-col {
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface-elevated);
  padding: 0;
  display: flex; flex-direction: column;
  min-height: 120px;
  transition: border-color 0.2s;
}
.pipe-col:hover { border-color: rgba(99,102,241,0.3); }
.pipe-col--empty { opacity: 0.5; }
.pipe-col--empty:hover { opacity: 0.7; }

.pipe-col-head {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.6rem 0.65rem 0.4rem;
  border-bottom: 2px solid transparent;
}
.pipe-col--active .pipe-col-head { border-bottom-color: var(--brand-500); }
.pipe-col--ganhou .pipe-col-head { border-bottom-color: var(--success-500); }
.pipe-col--perdeu .pipe-col-head { border-bottom-color: var(--danger-500); }
.pipe-col--neutro .pipe-col-head { border-bottom-color: var(--text-muted); }

.pipe-col-icon { display: inline-flex; opacity: 0.65; }
.pipe-col-icon svg { width: 14px; height: 14px; }
.pipe-col-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); flex: 1; }
.pipe-col-count {
  font-size: 0.85rem; font-weight: 800;
  min-width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.pipe-col--active .pipe-col-count { color: var(--brand-500); background: rgba(99,102,241,0.12); }
.pipe-col--ganhou .pipe-col-count { color: var(--success-500); background: rgba(34,197,94,0.12); }
.pipe-col--perdeu .pipe-col-count { color: var(--danger-500); background: rgba(239,68,68,0.12); }
.pipe-col--neutro .pipe-col-count { color: var(--text-muted); background: rgba(148,163,184,0.12); }

.pipe-col-valor {
  padding: 0.2rem 0.65rem 0.35rem;
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
}

.pipe-col-deals { padding: 0.25rem 0.5rem 0.5rem; flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }

.pipe-deal-card {
  display: flex; align-items: center; justify-content: space-between; gap: 0.25rem;
  padding: 0.4rem 0.55rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  text-decoration: none; color: inherit;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.pipe-deal-card:hover {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.2);
}
.pipe-deal-name {
  font-size: 0.76rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.pipe-deal-val {
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
  white-space: nowrap;
}
.pipe-deal-empty { font-size: 0.75rem; color: var(--text-muted); text-align: center; padding: 1rem 0; }
.pipe-deal-more { font-size: 0.7rem; color: var(--brand-400); text-align: center; padding: 0.2rem 0; }

/* Light mode */
html.light .pipe-col { background: #fff; border-color: #e2e8f0; }
html.light .pipe-deal-card { background: #f8fafc; border-color: #e2e8f0; }
html.light .pipe-deal-card:hover { background: rgba(99,102,241,0.06); border-color: rgba(99,102,241,0.2); }

/* Mobile: 2-row layout */
@media (max-width: 900px) {
  .pipe-board { grid-template-columns: repeat(3, 1fr); }
}

/* Light mode */
html.light .pipeline-step--pending .pipeline-step-dot { background: #f1f5f9; }
html.light .pipeline-action-card { background: #fff; border-color: #e2e8f0; }
html.light .pipeline-prev-note { background: #f8fafc; }
html.light .pipeline-proposta-validade { background: #f1f5f9; }
html.light .pipeline-feedback-opt { background: #fff; border-color: #e2e8f0; }
html.light .pipeline-feedback-opt:hover { background: rgba(99,102,241,0.04); }
html.light .pipeline-result-btn { background: #fff; border-color: #e2e8f0; }
html.light .dash-pipeline-tag { background: #fff; border-color: #e2e8f0; }

/* ═══════════════════════════════════════════════════════
   REDESIGN v3 — Visual Dashboard + Lead Detail 2-col
   ═══════════════════════════════════════════════════════ */

/* ─── Dashboard v3 Container ─────────────────────────── */
.dash-v3 { max-width: 100%; }

/* ─── Greeting ───────────────────────────────────────── */
.dash-greeting-v3 {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.dash-greeting-v3 .dg-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-xl, 20px);
  background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(6,182,212,0.1) 100%);
  flex-shrink: 0;
}
.dash-greeting-v3 h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}
.dash-greeting-v3 p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.125rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-full, 999px);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.dg-badge--att {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}
.dg-badge--ok {
  background: var(--success-500);
  color: #fff;
}

/* ─── KPI Cards Grid ─────────────────────────────────── */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.5fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 700px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 14px);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Colored top edge */
.kpi-card--brand  { border-top: 3px solid var(--brand-400); }
.kpi-card--green  { border-top: 3px solid var(--success-500); }
.kpi-card--cyan   { border-top: 3px solid #06b6d4; }
.kpi-card--meta   { border-top: 3px solid var(--warning-500); }

/* Gradient glow bg */
.kpi-card--brand::before,
.kpi-card--green::before,
.kpi-card--cyan::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60px;
  pointer-events: none;
  opacity: 0.07;
  border-radius: var(--radius-lg, 14px) var(--radius-lg, 14px) 0 0;
}
.kpi-card--brand::before { background: linear-gradient(180deg, var(--brand-400), transparent); }
.kpi-card--green::before { background: linear-gradient(180deg, var(--success-500), transparent); }
.kpi-card--cyan::before  { background: linear-gradient(180deg, #06b6d4, transparent); }

.kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md, 10px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-icon--brand { background: rgba(99,102,241,0.15); color: var(--brand-400); }
.kpi-icon--green { background: rgba(34,197,94,0.15); color: var(--success-500); }
.kpi-icon--cyan  { background: rgba(6,182,212,0.15); color: #06b6d4; }

.kpi-data { position: relative; z-index: 1; }
.kpi-number {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}
.kpi-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  z-index: 1;
}

/* Meta card */
.kpi-card--meta {
  justify-content: center;
  gap: 0.5rem;
}
.kpi-meta-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.kpi-meta-header svg { color: var(--warning-500); }
.kpi-meta-big {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  line-height: 1;
}
.kpi-meta-of {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}
.kpi-meta-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.kpi-meta-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.kpi-meta-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--warning-500), #f97316);
  transition: width 0.6s var(--ease-out, ease);
  box-shadow: 0 0 8px rgba(245,158,11,0.3);
}
.kpi-meta-pct {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--warning-500);
  min-width: 32px;
}

/* ─── Attention Feed v3 ──────────────────────────────── */
.dash-attention-v3 {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 14px);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.da-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.da-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.da-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md, 10px);
  background: rgba(249,115,22,0.12);
  color: #f97316;
}
.da-icon--pulse { animation: att-pulse 3.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes att-pulse {
  0% { box-shadow: 0 0 0 0 rgba(249,115,22,0.25); }
  40% { box-shadow: 0 0 0 10px rgba(249,115,22,0); }
  100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}
.da-header h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0;
}
.da-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: var(--radius-full, 999px);
  background: rgba(249,115,22,0.15);
  color: #f97316;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.da-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--success-500);
  font-size: 0.875rem;
}

.da-list { display: flex; flex-direction: column; gap: 2px; }
.da-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  transition: all var(--duration-fast, 150ms) ease;
  border-left: 3px solid transparent;
}
.da-item:hover {
  transform: translateX(3px);
}
/* Color variants */
.da-item--green {
  border-left-color: var(--success-500);
}
.da-item--green:hover { background: rgba(34,197,94,0.06); }
.da-item--green .da-item-icon { color: var(--success-500); }
.da-item--green .da-item-cta { color: var(--success-500); }

.da-item--yellow {
  border-left-color: var(--warning-500);
}
.da-item--yellow:hover { background: rgba(245,158,11,0.06); }
.da-item--yellow .da-item-icon { color: var(--warning-500); }
.da-item--yellow .da-item-cta { color: var(--warning-500); }

.da-item--orange {
  border-left-color: #f97316;
}
.da-item--orange:hover { background: rgba(249,115,22,0.06); }
.da-item--orange .da-item-icon { color: #f97316; }
.da-item--orange .da-item-cta { color: #f97316; }

.da-item--red {
  border-left-color: var(--danger-500);
}
.da-item--red:hover { background: rgba(239,68,68,0.06); }
.da-item--red .da-item-icon { color: var(--danger-500); }
.da-item--red .da-item-cta { color: var(--danger-500); }

.da-item-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.da-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.da-item-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.da-item-co {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.da-item-reason {
  flex: 1;
  font-size: 0.775rem;
  color: var(--text-secondary);
  text-align: right;
  padding: 0 0.5rem;
}
.da-item-cta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.da-item-cta svg { transition: transform 0.15s ease; }
.da-item:hover .da-item-cta svg { transform: translateX(2px); }

/* ─── Analytics Row v3 ───────────────────────────────── */
.dash-analytics-v3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
  .dash-analytics-v3 { grid-template-columns: 1fr; }
}

/* Channel bars */
.db-channels { display: flex; flex-direction: column; gap: 0.6rem; }
.db-channel-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}
.db-channel-icon { flex-shrink: 0; display: flex; }
.db-channel-label { width: 60px; color: var(--text-secondary); font-weight: 500; }
.db-channel-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.db-channel-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.db-channel-count { font-weight: 600; color: var(--text-primary); min-width: 20px; text-align: right; }
.db-channel-pct { color: var(--text-muted); font-size: 0.75rem; min-width: 30px; text-align: right; }

/* Funnel */
.db-funnel { display: flex; flex-direction: column; gap: 0.5rem; }
.db-funnel-step {}
.db-funnel-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.2rem;
}
.db-funnel-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.db-funnel-value { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.db-funnel-pct { font-weight: 400; color: var(--text-muted); font-size: 0.75rem; }
.db-funnel-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.db-funnel-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Sectors */
.db-sectors { display: flex; flex-direction: column; gap: 0.5rem; }
.db-sector-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}
.db-sector-name {
  width: 80px;
  color: var(--text-secondary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.db-sector-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}
.db-sector-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--brand-400);
  transition: width 0.4s ease;
}
.db-sector-stat { color: var(--text-muted); font-size: 0.75rem; min-width: 28px; text-align: right; }
.db-sector-pct { font-weight: 600; color: var(--text-primary); min-width: 30px; text-align: right; }

/* Empty state for analytics cards */
.db-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 1.5rem 0;
}

/* ─── Bottom Row v3 ──────────────────────────────────── */
.dash-bottom-v3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 600px) {
  .dash-bottom-v3 { grid-template-columns: 1fr; }
}
.db-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 14px);
  padding: 1.125rem 1.25rem;
}
.db-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.db-card-head h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

/* Cadencia stats */
.db-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.db-stat {
  text-align: center;
  padding: 0.625rem 0.25rem;
  border-radius: var(--radius-md, 10px);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--surface-border);
}
.db-stat--highlight {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.2);
}
.db-stat-val {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  line-height: 1.2;
}
.db-stat--highlight .db-stat-val { color: var(--brand-400); }
.db-stat-lbl {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* Rate rings */
.db-rates {
  display: flex;
  justify-content: center;
  gap: 2rem;
}
.db-rate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
}
.db-rate-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    var(--ring-color) calc(var(--pct) * 3.6deg),
    var(--gray-200) calc(var(--pct) * 3.6deg)
  );
  position: relative;
}
.db-rate-ring::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--surface-card);
}
.db-rate-ring span {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}
.db-rate-lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Pipeline card */
.db-pipe-total {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.db-pipe-stages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.db-pipe-stage-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.db-pipe-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.db-pipe-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex: 1;
}
.db-pipe-count {
  font-size: 0.875rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}
.db-pipe-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.db-pipe-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s var(--ease-out, ease);
  min-width: 2px;
}

.db-pipe-results {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-border);
  margin-bottom: 0.75rem;
}
.db-pipe-result {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.775rem;
}
.db-pipe-result--won { color: var(--success-500); }
.db-pipe-result--lost { color: var(--text-muted); }

.db-pipe-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand-400);
  cursor: pointer;
  transition: gap 0.15s ease;
}
.db-pipe-link:hover { gap: 0.5rem; text-decoration: none; }

/* ─── Lead Detail: 2-Column Layout ────────────────────── */
.ld-columns {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .ld-columns { grid-template-columns: 1fr; }
}

.ld-header-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.ld-header-main h2 { margin: 0; font-size: 1.25rem; }
.ld-header-badges { display: flex; gap: 0.375rem; flex-wrap: wrap; }

.ld-banner {
  background: var(--warning-50);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md, 8px);
  padding: 0.5rem 0.875rem;
  font-size: 0.8rem;
  color: var(--warning-500);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ld-next-action {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-left: 4px solid var(--brand-400);
  border-radius: var(--radius-lg, 12px);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s ease;
}
/* Color variants */
.ld-next-action.na-type--email    { border-left-color: var(--brand-400); }
.ld-next-action.na-type--linkedin { border-left-color: #0a66c2; }
.ld-next-action.na-type--done     { border-left-color: var(--success-500); }
.ld-next-action.na-type--danger   { border-left-color: var(--danger-500); }
.ld-next-action.na-type--whatsapp { border-left-color: #25d366; }
.ld-next-action.na-type--reply    { border-left-color: var(--success-500); }
.ld-next-action.na-type--warning  { border-left-color: var(--warning-500); }
.ld-next-action.na-type--brand    { border-left-color: var(--brand-400); }

.na-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}
.na-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md, 10px);
  background: rgba(99,102,241,0.1);
  flex-shrink: 0;
}
.na-type--email .na-icon    { background: rgba(99,102,241,0.1); color: var(--brand-400); }
.na-type--linkedin .na-icon { background: rgba(10,102,194,0.1); color: #0a66c2; }
.na-type--whatsapp .na-icon { background: rgba(37,211,102,0.1); color: #25d366; }
.na-type--reply .na-icon    { background: rgba(34,197,94,0.1); color: var(--success-500); }
.na-type--warning .na-icon  { background: rgba(245,158,11,0.1); color: var(--warning-500); }

.na-header-text { flex: 1; min-width: 0; }
.ld-next-action h4 {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0;
  line-height: 1;
}
.na-subtitle {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 0.2rem;
}
.na-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}
.ld-next-action .na-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Channel toggle inside next-action */
.na-channel-toggle {
  display: flex;
  gap: 0;
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.na-ch-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}
.na-ch-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}
.na-ch-btn:hover {
  background: var(--bg-hover);
}
.na-ch-btn--active {
  background: var(--brand-500);
  color: #fff;
}
.na-ch-btn--active:hover {
  background: var(--brand-600);
}
.na-ch-btn--active svg { stroke: #fff; }

/* Inline reply content inside next-action */
.na-inline-reply {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.na-inline-reply .reply-score-bar {
  margin: 0;
}
.na-inline-reply .reply-meta {
  font-size: 0.8rem;
}
.na-inline-reply .reply-empty-state {
  padding: 1rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
}
.na-inline-reply .reply-empty-state p {
  margin: 0;
  font-size: 0.85rem;
}
.na-inline-reply .reply-actions {
  margin-top: 0.25rem;
}

/* Light mode */
html.light .na-type--email .na-icon    { background: rgba(99,102,241,0.08); }
html.light .na-type--linkedin .na-icon { background: rgba(10,102,194,0.08); }
html.light .na-type--whatsapp .na-icon { background: rgba(37,211,102,0.08); }
html.light .na-type--reply .na-icon    { background: rgba(34,197,94,0.08); }
html.light .na-type--warning .na-icon  { background: rgba(245,158,11,0.08); }

/* ─── Lead Detail: Communication Tabs ─────────────────── */
.ld-comm-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 1rem;
}
.ld-comm-tab {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--duration-fast, 150ms) ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.ld-comm-tab:hover { color: var(--text-secondary); }
.ld-comm-tab.active {
  color: var(--brand-400);
  border-bottom-color: var(--brand-400);
}
.ld-comm-panel { display: none; }
.ld-comm-panel.active { display: block; }

/* ─── Lead Detail: Sidebar ────────────────────────────── */
.ld-sidebar {
  position: sticky;
  top: 1rem;
}
.ld-sidebar-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 12px);
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
}
.ld-sidebar-card h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.ld-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.8rem;
}
.ld-dl dt { color: var(--text-muted); }
.ld-dl dd { color: var(--text-primary); margin: 0; }
.ld-dl dd a { color: var(--brand-400); }

.ld-signal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ld-sidebar-accordion {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.ld-sidebar-accordion:hover { color: var(--text-primary); }
.ld-sidebar-accordion .acc-arrow { transition: transform 0.2s; }
.ld-sidebar-accordion.open .acc-arrow { transform: rotate(90deg); }
.ld-sidebar-acc-body { display: none; padding-top: 0.375rem; overflow: hidden; }
.ld-sidebar-acc-body.open { display: block; }

/* ─── Sidebar Messages (compact) ─────────────────────── */
.sidebar-msgs { max-height: 500px; overflow-y: auto; }
.sidebar-msgs-group {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.25rem 0;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--surface-border);
}
.sidebar-msgs-cnt {
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.7;
  text-transform: none;
}
.sidebar-msgs-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-msg-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
}

.sidebar-msg-item {
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
}
.sidebar-msg-head {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-sm, 6px);
  transition: background 0.15s ease;
  list-style: none;
}
.sidebar-msg-head::-webkit-details-marker { display: none; }
.sidebar-msg-head::marker { display: none; content: ''; }
.sidebar-msg-head:hover { background: var(--surface-hover); }
.sidebar-msg-item[open] .sidebar-msg-head { background: rgba(99,102,241,0.06); }

.sidebar-msg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-msg-dot.sent { background: var(--success-500); }
.sidebar-msg-dot.pending { background: var(--gray-300); }
.sidebar-msg-dot.scheduled { background: var(--warning-500); }

.sidebar-msg-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.sidebar-msg-icon svg { width: 12px; height: 12px; }

.sidebar-msg-title {
  flex: 1;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.sidebar-msg-item[open] .sidebar-msg-title { color: var(--brand-400); font-weight: 600; }

.sidebar-msg-status {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-msg-body {
  padding: 0.375rem 0.5rem 0.625rem 1.5rem;
  border-left: 2px solid var(--surface-border);
  margin-left: 0.75rem;
  margin-bottom: 0.25rem;
}
.sidebar-msg-body p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.sidebar-msg-na {
  font-style: italic;
  color: var(--text-muted) !important;
  opacity: 0.6;
}

/* Light mode */
html.light .sidebar-msg-head:hover { background: #f1f5f9; }
html.light .sidebar-msg-item[open] .sidebar-msg-head { background: rgba(99,102,241,0.04); }
html.light .sidebar-msg-body { border-left-color: #e2e8f0; }

.ld-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.25rem;
}
.ld-sidebar-actions .btn { font-size: 0.8rem; width: 100%; justify-content: center; }

/* ─── Lead Detail: Progress Bar (sidebar) ─────────────── */
.ld-progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.375rem 0;
}
.ld-progress-fill {
  height: 100%;
  background: var(--brand-400);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.ld-progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Leads Table: Segment Filters ────────────────────── */
.filter-segments {
  display: inline-flex;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full, 999px);
  padding: 3px;
  gap: 2px;
}
.filter-seg {
  padding: 0.375rem 0.875rem;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-full, 999px);
  cursor: pointer;
  transition: all var(--duration-fast, 150ms) ease;
  border: none;
  background: none;
  white-space: nowrap;
}
.filter-seg:hover { color: var(--text-secondary); background: var(--surface-hover); }
.filter-seg.active {
  background: var(--brand-500);
  color: #fff;
  font-weight: 600;
}
.filter-seg .seg-count {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-left: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Leads Table: Attention Dot ──────────────────────── */
.attention-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f97316;
  box-shadow: 0 0 6px rgba(249,115,22,0.4);
  margin-right: 0.375rem;
  flex-shrink: 0;
}

/* ─── Light Mode Overrides ────────────────────────────── */
html.light .kpi-card,
html.light .dash-attention-v3,
html.light .db-card,
html.light .ld-next-action,
html.light .ld-sidebar-card { background: #fff; border-color: #e2e8f0; }

html.light .kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
html.light .kpi-card--brand::before { opacity: 0.05; }
html.light .kpi-card--green::before { opacity: 0.05; }
html.light .kpi-card--cyan::before  { opacity: 0.05; }

html.light .db-stat { background: #f8fafc; border-color: #e2e8f0; }
html.light .db-stat--highlight { background: rgba(99,102,241,0.06); border-color: rgba(99,102,241,0.15); }
html.light .db-rate-ring::before { background: #fff; }

html.light .da-item--green:hover  { background: rgba(34,197,94,0.04); }
html.light .da-item--yellow:hover { background: rgba(245,158,11,0.04); }
html.light .da-item--orange:hover { background: rgba(249,115,22,0.04); }
html.light .da-item--red:hover    { background: rgba(239,68,68,0.04); }

html.light .ld-banner { background: #fffbeb; border-color: rgba(245,158,11,0.15); }
html.light .filter-segments { background: #fff; border-color: #e2e8f0; }
html.light .filter-seg:hover { background: #f1f5f9; }
html.light .filter-seg.active { background: var(--brand-500); color: #fff; }

html.light .dash-greeting-v3 .dg-icon { background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(6,182,212,0.07) 100%); }
html.light .da-icon { background: rgba(249,115,22,0.08); }
html.light .da-count { background: rgba(249,115,22,0.1); }

/* ─── Bounce table columns ────────────────────────── */
.bounce-error-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.bounce-error-label {
  font-size: 0.78rem;
  font-weight: 600;
}
.bounce-error--hard { color: #ef4444; }
.bounce-error--ooo { color: #f59e0b; }
.bounce-cadence-cell { line-height: 1.3; }
.filter-seg--bounce.active {
  background: #ef4444 !important;
  color: #fff !important;
}
/* ─── Dismiss button ──────────────────────────── */
.da-item-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 0.25rem;
  flex-shrink: 0;
}
.da-item-dismiss:hover {
  background: rgba(34,197,94,0.15);
  color: var(--success-500);
  transform: scale(1.1);
}
html.light .da-item-dismiss { background: rgba(0,0,0,0.04); }
html.light .da-item-dismiss:hover { background: rgba(34,197,94,0.12); color: #16a34a; }

html.light .bounce-error--hard { color: #dc2626; }
html.light .bounce-error--ooo { color: #d97706; }

/* ─── Content Channel Tabs ─────────────────────────────── */

.content-channel-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
  border-bottom: none;
}
.content-channel-tab {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-400);
  cursor: pointer;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.content-channel-tab:hover { color: var(--text-primary); background: var(--surface-elevated); }
.content-channel-tab.active {
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
}
.content-channel-tab .tab-icon {
  width: 15px;
  height: 15px;
  opacity: 0.6;
}
.content-channel-tab.active .tab-icon { opacity: 1; }

html.light .content-channel-tabs { border-bottom-color: var(--gray-200); }
html.light .content-channel-tab { color: var(--gray-500); }
html.light .content-channel-tab:hover { color: var(--gray-700); }
html.light .content-channel-tab.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }

/* ─── Instagram Post Grid ──────────────────────────────── */

.ig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.ig-card {
  background: var(--gray-800);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--gray-700);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.ig-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.ig-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ig-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ig-card-image--empty {
  color: var(--gray-500);
  font-size: 2.5rem;
}
.ig-card-body {
  padding: 0.85rem;
}
.ig-card-caption {
  font-size: 0.82rem;
  color: var(--gray-200);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.ig-card-hashtags {
  font-size: 0.72rem;
  color: var(--brand-400);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.5rem;
}
.ig-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ig-card-status {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ig-card-status--draft { background: var(--gray-700); color: var(--gray-400); }
.ig-card-status--ready { background: rgba(34,197,94,0.15); color: var(--success-500); }

html.light .ig-card { background: #fff; border-color: var(--gray-200); }
html.light .ig-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
html.light .ig-card-caption { color: var(--gray-700); }
html.light .ig-card-status--draft { background: var(--gray-100); color: var(--gray-500); }

/* Instagram / Blog Create shared */
.ig-create-title { margin-bottom: 1rem; }
.ig-create-field { margin-bottom: 1.25rem; }
.ig-create-input-row { display: flex; gap: 0.5rem; }

/* Instagram Detail (single post view — image + text side by side) */
.ig-detail-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 800px) {
  .ig-detail-split { grid-template-columns: 1fr; }
}
.ig-detail-img {
  width: 100%; border-radius: var(--radius-lg);
  aspect-ratio: 1/1; object-fit: cover;
}
.ig-detail-placeholder {
  width: 100%; aspect-ratio: 1/1;
  background: var(--gray-800); border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--gray-600);
}
html.light .ig-detail-placeholder { background: var(--gray-100); color: var(--gray-400); }
.ig-detail-download-btn { margin-top: 0.75rem; }
.ig-detail-delete-btn { margin-left: auto; }

/* Instagram Create section */

.ig-create-section {
  display: flex;
  flex-direction: column;
}
.ig-art-actions {
  margin-top: 0.75rem;
}
.ig-text-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}
.ig-text-col { min-width: 0; }
.ig-tip {
  font-size: 0.78rem; color: var(--gray-400); margin-top: 0.5rem;
}
.ig-final-actions {
  display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap;
}
@media (max-width: 768px) {
  .ig-text-fields { grid-template-columns: 1fr; }
}
.ig-image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.ig-image-option {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}
.ig-image-option:hover { transform: scale(1.03); }
.ig-image-option.selected { border-color: var(--brand-500); }
.ig-image-option img { width: 100%; height: 100%; object-fit: cover; }

.ig-caption-input {
  width: 100%;
  min-height: 120px;
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: 8px;
  color: var(--gray-100);
  padding: 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
}
.ig-caption-input:focus { border-color: var(--brand-500); outline: none; }

.ig-hashtags-input {
  width: 100%;
  min-height: 60px;
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: 8px;
  color: var(--brand-400);
  padding: 0.75rem;
  font-size: 0.8rem;
  font-family: inherit;
  resize: vertical;
}
.ig-hashtags-input:focus { border-color: var(--brand-500); outline: none; }

html.light .ig-caption-input,
html.light .ig-hashtags-input { background: #fff; border-color: var(--gray-300); color: var(--gray-800); }

.ig-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  background: var(--brand-500);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ig-copy-btn:hover { background: var(--brand-600); }
.ig-copy-btn--secondary {
  background: var(--gray-700);
  color: var(--gray-200);
}
.ig-copy-btn--secondary:hover { background: var(--gray-600); }
.ig-copy-btn--sm { padding: 0.4rem 0.85rem; font-size: 0.78rem; }

/* Delete button */
.ig-delete-btn {
  color: var(--danger-400) !important;
}
.ig-delete-btn:hover {
  background: rgba(239,68,68,0.12) !important;
  color: var(--danger-400) !important;
}
html.light .ig-delete-btn {
  color: #dc2626 !important;
}
html.light .ig-delete-btn:hover {
  background: rgba(220,38,38,0.08) !important;
}

/* ─── Config Channel Selector ────────────────────────────── */
.config-channel-selector {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.config-channel-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.config-channel-btn:not(:last-child) {
  border-right: 1px solid var(--border-subtle);
}
.config-channel-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.config-channel-btn.active {
  background: var(--brand-500);
  color: #fff;
}
html.light .config-channel-btn {
  background: #f3f4f6;
  color: #6b7280;
}
html.light .config-channel-btn:hover {
  background: #e5e7eb;
  color: #374151;
}
html.light .config-channel-btn.active {
  background: var(--brand-500);
  color: #fff;
}

/* Channel target badges (Instagram/Blog) */
.idea-target-badge--instagram {
  background: rgba(225, 48, 108, 0.12);
  color: #e1306c;
  border-color: rgba(225, 48, 108, 0.25);
}
.idea-target-badge--blog {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.25);
}
html.light .idea-target-badge--instagram {
  background: rgba(225, 48, 108, 0.08);
  color: #be185d;
  border-color: rgba(225, 48, 108, 0.2);
}
html.light .idea-target-badge--blog {
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.2);
}

/* Autopilot posts list (IG/Blog) */
.autopilot-posts-list {
  margin-top: 1.5rem;
}
.autopilot-posts-list h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.autopilot-post-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: var(--surface-secondary);
  margin-bottom: 0.4rem;
}
.autopilot-post-row:hover {
  background: var(--surface-hover);
}
.autopilot-post-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 40px;
}
.autopilot-post-title {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.light .autopilot-post-row {
  background: #f9fafb;
}
html.light .autopilot-post-row:hover {
  background: #f3f4f6;
}

/* ─── Instagram Autopilot Cards ─────────────────────────── */
.ig-autopilot-card {
  border-radius: 10px;
  background: var(--surface-secondary);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.ig-autopilot-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.ig-autopilot-header:hover {
  background: var(--surface-hover);
}
.ig-autopilot-chevron {
  transition: transform 0.2s;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ig-chevron-open {
  transform: rotate(180deg);
}
.ig-autopilot-detail {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--surface-border);
}
.ig-autopilot-detail-grid {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.75rem;
}
.ig-autopilot-img-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}
.ig-autopilot-img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}
.ig-autopilot-img--blog {
  width: 280px;
  height: auto;
  aspect-ratio: 2 / 1;
}
.ig-autopilot-text-wrap {
  flex: 1;
  min-width: 0;
}
.ig-autopilot-text-wrap label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.3rem;
}
.ig-autopilot-caption {
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.ig-autopilot-hashtags {
  font-size: 0.82rem;
  color: var(--brand-400);
  margin-bottom: 0.5rem;
  word-break: break-word;
}
html.light .ig-autopilot-card {
  background: #f9fafb;
}
html.light .ig-autopilot-header:hover {
  background: #f3f4f6;
}
html.light .ig-autopilot-detail {
  border-color: #e5e7eb;
}

/* ─── IG Modal Selected Art ─────────────────────────────── */
.ig-modal-selected-art {
  margin-top: 1rem;
}
.ig-modal-selected-art h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.ig-modal-selected-img {
  max-width: 320px;
  border-radius: 8px;
  display: block;
  margin-bottom: 0.5rem;
}
.btn-success {
  background: #22c55e;
  color: #fff;
  border: none;
}
.btn-success:hover {
  background: #16a34a;
}

/* ─── Instagram / Blog Art Grid (PostCanvas variants) ──── */
.ig-art-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.ig-art-option {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 3px solid var(--surface-border);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.ig-art-option:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-400); }
.ig-art-option.selected {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25), var(--shadow-md);
}
.ig-art-option img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}
.ig-art-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 0.65rem 0.6rem;
  background: linear-gradient(transparent 0%, rgba(0,0,0,0.65) 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.light .ig-art-option.selected {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

/* Blog Art Grid (wider for 1800x900) */
.blog-art-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.blog-art-option {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 3px solid var(--surface-border);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.blog-art-option:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-400); }
.blog-art-option.selected {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25), var(--shadow-md);
}
.blog-art-option img {
  width: 100%;
  aspect-ratio: 2/1;
  object-fit: cover;
  display: block;
}
.blog-art-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.65rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
}
html.light .blog-art-option.selected {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

/* ─── Blog Table & Editor ──────────────────────────────── */

.blog-table {
  width: 100%;
  border-collapse: collapse;
}
.blog-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--gray-700);
}
.blog-table td {
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--gray-200);
  border-bottom: 1px solid var(--gray-800);
  vertical-align: middle;
}
.blog-table tr { cursor: pointer; transition: background 0.12s; }
.blog-table tr:hover { background: var(--gray-800); }

.blog-thumb-cell { padding: 0.5rem 0.75rem !important; width: 96px; }
.blog-thumb-img {
  width: 88px; height: 50px; object-fit: cover;
  border-radius: var(--radius-sm); display: block;
  border: 1px solid var(--surface-border);
}
.blog-thumb-empty {
  width: 88px; height: 50px;
  background: var(--surface-elevated); border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
}

.blog-title-cell {
  font-weight: 500;
  max-width: 350px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blog-category-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(99,102,241,0.12);
  color: var(--brand-400);
  white-space: nowrap;
}
.blog-meta-row {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem;
}
.blog-seo-keywords {
  font-size: 0.78rem; color: var(--gray-400);
}
.blog-result-title {
  font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--gray-100);
}
.blog-result-excerpt {
  font-size: 0.82rem; color: var(--gray-400); margin-bottom: 1rem;
}
html.light .blog-result-title { color: var(--gray-800); }
html.light .blog-result-excerpt { color: var(--gray-600); }
.blog-status-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.blog-status-badge--published { background: rgba(34,197,94,0.15); color: var(--success-500); }
.blog-status-badge--draft { background: var(--gray-700); color: var(--gray-400); }

html.light .blog-table th { border-bottom-color: var(--gray-200); }
html.light .blog-table td { border-bottom-color: var(--gray-100); color: var(--gray-700); }
html.light .blog-table tr:hover { background: var(--gray-50); }
html.light .blog-status-badge--draft { background: var(--gray-100); color: var(--gray-500); }

/* Blog Edit Header */
.blog-edit-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.blog-edit-title { margin: 0; }
.blog-edit-actions {
  margin-left: auto; display: flex; gap: 0.5rem;
}

/* Blog Featured Image */
.blog-featured-img {
  width: 100%; max-height: 280px; object-fit: cover;
  border-radius: var(--radius-lg);
}

/* Blog Editor */

.blog-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .blog-editor { grid-template-columns: 1fr; }
}
.blog-editor-form { display: flex; flex-direction: column; gap: 1rem; }
.blog-editor-form label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.blog-editor-form input,
.blog-editor-form select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: 8px;
  color: var(--gray-100);
  font-size: 0.85rem;
}
.blog-editor-form input:focus,
.blog-editor-form select:focus { border-color: var(--brand-500); outline: none; }

.blog-body-textarea {
  width: 100%;
  min-height: 400px;
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: 8px;
  color: var(--gray-100);
  padding: 0.85rem;
  font-size: 0.85rem;
  font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
  line-height: 1.6;
  resize: vertical;
}
.blog-body-textarea:focus { border-color: var(--brand-500); outline: none; }

html.light .blog-editor-form input,
html.light .blog-editor-form select,
html.light .blog-body-textarea { background: #fff; border-color: var(--gray-300); color: var(--gray-800); }

/* Blog Preview (markdown rendered) */

.blog-preview {
  background: var(--gray-800);
  border: 1px solid var(--gray-700);
  border-radius: 12px;
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 600px;
}
.blog-preview h1 { font-size: 1.5rem; margin-bottom: 0.75rem; color: var(--gray-100); }
.blog-preview h2 { font-size: 1.2rem; margin: 1.25rem 0 0.5rem; color: var(--gray-100); border-bottom: 1px solid var(--gray-700); padding-bottom: 0.4rem; }
.blog-preview h3 { font-size: 1rem; margin: 1rem 0 0.4rem; color: var(--gray-200); }
.blog-preview p { font-size: 0.88rem; line-height: 1.7; color: var(--gray-300); margin-bottom: 0.75rem; }
.blog-preview ul, .blog-preview ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.blog-preview li { font-size: 0.88rem; line-height: 1.6; color: var(--gray-300); margin-bottom: 0.3rem; }
.blog-preview strong { color: var(--gray-100); }
.blog-preview blockquote {
  border-left: 3px solid var(--brand-500);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--gray-400);
  font-style: italic;
}

html.light .blog-preview { background: #fff; border-color: var(--gray-200); }
html.light .blog-preview h1, html.light .blog-preview h2 { color: var(--gray-900); }
html.light .blog-preview h2 { border-bottom-color: var(--gray-200); }
html.light .blog-preview h3 { color: var(--gray-700); }
html.light .blog-preview p, html.light .blog-preview li { color: var(--gray-600); }
html.light .blog-preview strong { color: var(--gray-800); }
html.light .blog-preview blockquote { color: var(--gray-500); }

/* Blog Publish Button */

.blog-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  background: var(--success-500);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.blog-publish-btn:hover { background: #16a34a; }
.blog-publish-btn--unpublish {
  background: var(--gray-600);
}
.blog-publish-btn--unpublish:hover { background: var(--gray-500); }

/* Content empty state */

.content-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}
.content-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}
.content-empty h3 {
  font-size: 1.1rem;
  color: var(--gray-300);
  margin-bottom: 0.5rem;
}
.content-empty p {
  font-size: 0.85rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Content section header (used in Instagram/Blog tabs) */
.content-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.content-section-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-100);
}
html.light .content-section-header h2 { color: var(--gray-800); }

/* Create button */
.content-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--brand-500);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.content-create-btn:hover { background: var(--brand-600); }

/* Topic input (shared between Instagram/Blog create) */
.content-topic-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: 8px;
  color: var(--gray-100);
  font-size: 0.9rem;
}
.content-topic-input:focus { border-color: var(--brand-500); outline: none; }
.content-topic-input::placeholder { color: var(--gray-500); }
html.light .content-topic-input { background: #fff; border-color: var(--gray-300); color: var(--gray-800); }

/* Generate button */
.content-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.content-generate-btn:hover { opacity: 0.9; }
.content-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading spinner */
.content-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: content-spin 0.6s linear infinite;
}
@keyframes content-spin { to { transform: rotate(360deg); } }

/* Back link */
.content-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--gray-400);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: color 0.15s;
}
.content-back-link:hover { color: var(--brand-400); }
html.light .content-back-link { color: var(--gray-500); }
html.light .content-back-link:hover { color: var(--brand-600); }

/* ─── Login Overlay ───────────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem 2rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl, 16px);
  border: 1px solid var(--border-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.login-brand h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.login-brand small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#login-step-credentials,
#login-step-totp {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.login-field input {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
}

.login-field input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.login-error {
  color: var(--danger-500);
  font-size: 0.78rem;
  font-weight: 500;
  min-height: 1.2em;
}

.login-btn {
  padding: 0.7rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand-500);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  margin-top: 0.25rem;
  text-align: center;
  justify-content: center;
}

.login-btn:hover { background: var(--brand-600); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* TOTP step */
.login-totp-header {
  text-align: center;
  margin-bottom: 1rem;
}
.login-totp-header svg {
  margin-bottom: 0.5rem;
}
.login-totp-header h3 {
  font-size: 1rem; font-weight: 700; margin: 0 0 0.35rem;
  color: var(--text-primary);
}
.login-totp-header p {
  font-size: 0.82rem; color: var(--text-secondary); margin: 0;
  line-height: 1.4;
}
.login-totp-input {
  text-align: center !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.35em !important;
  font-family: 'SF Mono', 'Fira Code', monospace !important;
}
.login-totp-hint {
  text-align: center; font-size: 0.72rem; color: var(--text-muted);
  margin: 0.25rem 0 0;
}
.login-back-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 0.82rem; cursor: pointer; padding: 0.5rem;
  transition: color 0.15s;
}
.login-back-btn:hover { color: var(--text-primary); }

/* 2FA Security modal */
.totp-setup-qr { text-align: center; margin: 1rem 0; }
.totp-setup-qr img { border-radius: var(--radius-md); max-width: 200px; }
.totp-setup-secret {
  text-align: center; font-family: monospace;
  font-size: 0.85rem; color: var(--text-muted);
  background: var(--surface-secondary); padding: 0.5rem 1rem;
  border-radius: var(--radius-sm); word-break: break-all;
  margin-bottom: 1rem;
}
.totp-backup-codes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem;
  margin: 1rem 0;
}
.totp-backup-code {
  font-family: monospace; font-size: 0.85rem; font-weight: 600;
  text-align: center; padding: 0.4rem;
  background: var(--surface-secondary); border-radius: var(--radius-sm);
  color: var(--text-primary);
}
.totp-status-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0; border-bottom: 1px solid var(--surface-border);
}
.totp-status-label { font-size: 0.85rem; color: var(--text-primary); }
.totp-status-value {
  font-size: 0.82rem; font-weight: 600;
  display: flex; align-items: center; gap: 0.4rem;
}
.totp-status-value--active { color: var(--success-500); }
.totp-status-value--inactive { color: var(--text-muted); }

html.light .login-card {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

/* ─── Sidebar User + Logout ───────────────────────── */

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .user-name { display: none; }
.sidebar.collapsed .sidebar-user { justify-content: center; }

.nav-security-btn {
  background: rgba(255,255,255,0.06);
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  width: 100%;
}
.nav-security-btn:hover {
  color: var(--brand-400);
  background: rgba(99,102,241,0.1);
}
.nav-security-btn svg { flex-shrink: 0; }
.sidebar.collapsed .nav-security-btn span { display: none; }
.sidebar.collapsed .nav-security-btn { justify-content: center; padding: 0.5rem; }
html.light .nav-security-btn {
  background: rgba(0,0,0,0.04);
  color: var(--gray-600);
}
html.light .nav-security-btn:hover {
  color: var(--brand-600);
  background: rgba(99,102,241,0.08);
}

.nav-logout-btn {
  background: rgba(255,255,255,0.06);
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.nav-logout-btn:hover {
  color: var(--danger-400);
  background: rgba(239,68,68,0.1);
}

.nav-logout-btn svg { flex-shrink: 0; }
.sidebar.collapsed .nav-logout-btn span { display: none; }
.sidebar.collapsed .nav-logout-btn { justify-content: center; padding: 0.5rem; }

html.light .nav-logout-btn {
  background: rgba(0,0,0,0.04);
  color: var(--gray-600);
}
html.light .nav-logout-btn:hover {
  color: var(--danger-600);
  background: rgba(239,68,68,0.08);
}

/* ─── Régua Dashboard (landing page) ─────────────── */

.regua-dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.regua-dashboard-stats {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.regua-stat-pill {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem; font-weight: 500;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
}
.regua-stat-pill .regua-stat-num { font-weight: 700; color: var(--text-primary); }
.regua-stat-pill--published .regua-stat-num { color: #4ade80; }
.regua-stat-pill--approved .regua-stat-num { color: #a78bfa; }
.regua-stat-pill--draft .regua-stat-num { color: #fbbf24; }

.regua-dashboard-body {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 2fr;
  gap: 1.75rem;
  align-items: start;
}
.regua-dashboard-cards {
  display: flex; flex-direction: column; gap: 0.75rem;
}
.regua-dashboard-calendar { min-width: 0; }
.regua-dashboard-calendar .calendar-section { margin-bottom: 0; }

.regua-completed-toggle {
  font-size: 0.75rem; opacity: 0.6;
}
.regua-completed-toggle:hover { opacity: 1; }

/* ─── Config Layout (step 0 — two-column) ────────── */

.config-layout {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 300px);
  gap: 2rem;
  align-items: start;
}
.config-layout-form { min-width: 0; }
.config-layout-sidebar { position: sticky; top: 5rem; }

.config-row {
  display: grid; gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.config-row--one { grid-template-columns: 1fr; }
.config-row--two { grid-template-columns: 1fr 1fr; }
.config-row--three { grid-template-columns: 1fr 1fr 1fr; }

.config-preview-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.config-preview-card h3 {
  font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); margin-bottom: 1.25rem;
}
.config-preview-rows {
  display: flex; flex-direction: column; gap: 0;
}
.config-preview-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.82rem;
}
.config-preview-row:last-child { border-bottom: none; }
.config-preview-row span { color: var(--text-secondary); }
.config-preview-row strong { color: var(--text-primary); font-weight: 600; }

.config-generate-btn {
  width: 100%;
  margin-top: 1.5rem;
}

/* ─── Brand Trigger Button (compact, in toolbar) ─── */

.brand-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

.brand-trigger:hover {
  border-color: var(--brand-400);
  color: var(--text-primary);
}

.brand-trigger-dots {
  display: flex;
  gap: 2px;
}

.brand-trigger-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
}

.brand-trigger-logo {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
}

.brand-trigger-label {
  display: none;
}

.brand-trigger--configured .brand-trigger-label {
  display: inline;
}

.brand-trigger-chevron {
  opacity: 0.3;
  flex-shrink: 0;
}

.brand-trigger:hover .brand-trigger-chevron { opacity: 0.7; }

html.light .brand-trigger-dot {
  border-color: rgba(0,0,0,0.1);
}

/* ─── Brand Modal ─────────────────────────────────── */

.brand-modal .brand-modal-content {
  max-width: 520px;
  width: 90vw;
}

.brand-modal .brand-section {
  margin-bottom: 0;
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.brand-modal .modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.brand-modal .brand-section .content-section-header {
  display: none;
}

/* ─── Back button (ghost style) ──────────────────── */

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--surface-elevated);
}
