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

:root {
  --bg: #07090e;
  --surface: #0f111a;
  --surface-hover: #1a1d29;
  --surface-active: #242938;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(10, 132, 255, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  
  --brand: #0a84ff;
  --brand-secondary: #00d4ff;
  --brand-hover: #0070e0;
  --brand-gradient: linear-gradient(135deg, var(--brand), var(--brand-secondary));
  
  --danger: #ef4444;
  --warn: #f59e0b;
  --info: #3b82f6;
  --purple: #8b5cf6;
  
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Plus Jakarta Sans', sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px -1px rgb(0 0 0 / 0.2), 0 2px 6px -2px rgb(0 0 0 / 0.2);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text-primary); font-family: var(--font); font-size: 13px; height: 100vh; overflow: hidden; -webkit-font-smoothing: antialiased; }

/* Layout Geral */
.app { display: grid; grid-template-columns: 260px 1fr; height: 100vh; }
.main-nav { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px 20px; }
.nav-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; font-weight: 800; font-size: 20px; margin-bottom: 40px; letter-spacing: -0.5px; border-bottom: 1px solid var(--border); padding-bottom: 24px; }
.brand-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 16px; background: rgba(255,255,255,0.03); padding: 8px; border: 1px solid var(--border); transition: all 0.3s; box-shadow: 0 0 15px rgba(0, 212, 255, 0.3); }
.brand-logo:hover { transform: scale(1.05); box-shadow: 0 0 25px rgba(0, 212, 255, 0.5); }
.brand-subtitle { font-size: 11px; color: var(--text-secondary); margin-top: 4px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; opacity: 0.8; }
.nav-links { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-btn { background: transparent; border: none; color: var(--text-secondary); text-align: left; padding: 12px 16px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600; transition: all 0.2s; display: flex; align-items: center; gap: 10px; }
.nav-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-btn.active { background: var(--brand-gradient); color: #fff; border-right: none; box-shadow: var(--shadow-md); }
.nav-footer { margin-top: auto; border-top: 1px solid var(--border); padding-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.powered-by { font-size: 10px; color: var(--text-secondary); text-align: center; margin-top: 20px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; opacity: 0.6; }
.powered-by a { color: var(--brand); text-decoration: none; transition: opacity 0.2s; }
.powered-by a:hover { opacity: 1; text-decoration: underline; }

/* Views */
.main-content { overflow-y: auto; padding: 32px 40px; position: relative; background: var(--bg); }
.view { display: none; animation: fadeIn 0.4s ease-out; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Headers */
.header-bar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.header-bar h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.header-bar p { color: var(--text-secondary); margin-top: 4px; font-size: 14px; }
.actions { display: flex; gap: 12px; align-items: center; }

/* Forms */
input[type=text], input[type=number], input[type=password], input[type=email], textarea, select {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  color: var(--text-primary); padding: 10px 14px; border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  outline: none; transition: all 0.2s; margin-top: 6px; box-shadow: var(--shadow-sm);
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.2); }
label { font-size: 12px; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.2px; display: block; margin-top: 16px; }
label:first-child { margin-top: 0; }
.hint { font-size: 11px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }

/* Chips de Filtro */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); font-size: 12px; background: transparent; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; font-weight: 600; }
.chip:hover { border-color: var(--text-secondary); }
.chip.on { background: var(--brand); color: #000; border-color: var(--brand); }
.chip.danger.on { background: var(--danger); color: #fff; border-color: var(--danger); }
.chip.info.on { background: var(--info); color: #fff; border-color: var(--info); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: none; border-radius: var(--radius-sm); font-weight: 700; font-family: inherit; font-size: 13px; cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--brand-gradient); color: #fff; border: 1px solid rgba(255,255,255,0.1); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-warn { background: linear-gradient(135deg, var(--warn), #d97706); color: #000; }
.btn-warn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-purple { background: linear-gradient(135deg, var(--purple), #a855f7); color: #fff; }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Grid Layouts */
.prospect-grid { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.sidebar-tools { display: flex; flex-direction: column; gap: 20px; }
.sec { background: rgba(24,24,27,0.5); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(10px); }
.sec-title { font-weight: 800; font-size: 15px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.sec-title span { font-size: 10px; background: rgba(255,255,255,0.1); padding: 3px 8px; border-radius: 6px; color: var(--text-secondary); font-weight: 700; text-transform: uppercase; }

/* Tabela e Filtros de Seleção */
.table-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 130px); box-shadow: var(--shadow-md); }
.table-toolbar { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; background: rgba(255,255,255,0.02); }
.table-toolbar-top { display: flex; justify-content: space-between; align-items: center; }
.table-toolbar-bottom { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.05); }
.search-input { width: 280px; margin: 0; border-radius: 20px; padding-left: 16px; }

.table-scroll { overflow-y: auto; flex: 1; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 20px; font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #121214; z-index: 2; letter-spacing: 0.5px; }
td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:hover td { background: rgba(255,255,255,0.03); }
tr.excluded td { opacity: 0.35; }
.empty { text-align: center; color: var(--text-secondary); padding: 60px !important; font-size: 14px; }

/* Badges e Status */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; letter-spacing: 0.3px; }
.b-ok { background: rgba(34,197,94,0.15); color: var(--brand); border: 1px solid rgba(34,197,94,0.2); }
.b-err { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.b-warn { background: rgba(245,158,11,0.15); color: var(--warn); border: 1px solid rgba(245,158,11,0.2); }
.b-pend { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--border); }
.b-ai { background: rgba(139,92,246,0.15); color: var(--purple); border: 1px solid rgba(139,92,246,0.2); }

.b-site { background: rgba(59,130,246,0.15); color: var(--info); border: 1px solid rgba(59,130,246,0.3); }
.b-nosite { background: rgba(245,158,11,0.15); color: var(--warn); border: 1px solid rgba(245,158,11,0.4); font-weight: 800; }
.b-insta { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: white; border: none; }
.b-face { background: #1877f2; color: white; border: none; }
.b-linkedin { background: #0077b5; color: white; border: none; }
.b-location { background: rgba(52,211,153,0.15); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }

/* Utilitários de espaçamento */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* Utilitários de cor */
.text-info   { color: var(--info); }
.text-accent { color: #22c55e; }
.text-danger { color: var(--danger); }
.text-warn   { color: var(--warn); }
.text-purple { color: var(--purple); }

/* Estatísticas */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stats.dashboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: rgba(255,255,255,0.15); }
.stat-card h3 { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.stat-card .num { font-size: 32px; font-weight: 800; letter-spacing: -1px; }

/* Kanban */
.kanban-board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.col-head { padding: 14px 16px; font-weight: 700; font-size: 13px; border-bottom: 2px solid var(--brand); background: rgba(255,255,255,0.02); }
.col-body { padding: 12px; min-height: 120px; }

/* Kanban Cards */
.k-card { background: var(--surface-hover); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; cursor: grab; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; }
.k-card:hover { transform: scale(1.02); border-color: var(--brand); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.k-card::after { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--brand); opacity: 0; transition: 0.3s; }
.k-card:hover::after { opacity: 1; }
.k-name { font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.k-phone { font-size: 11px; color: var(--text-secondary); font-family: monospace; }
.sortable-ghost { opacity: 0.2; transform: scale(0.9); }
.sortable-drag { opacity: 0.9; transform: rotate(2deg); }

/* Delay range inputs */
.delay-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }

.dash-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 0 16px; }
.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.dash-panel-head { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 12px; }
.dash-panel-value { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.dash-panel-meta { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.dash-runs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
#dash-apify-runs-list > div:last-child { margin-bottom: 0; }

/* Modais & Overlays */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.progress-overlay { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; pointer-events: none; animation: slideUpIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.modal, .prog-box { background: #121214; border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: 100%; max-width: 500px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.progress-overlay .prog-box { pointer-events: auto; max-width: 380px; width: auto; }
.modal { max-width: 500px; }
@keyframes slideUpIn { from { transform: translateY(120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.modal-body { padding: 4px 0; }
.close-btn { background: var(--surface-hover); border: none; color: var(--text-secondary); font-size: 16px; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.close-btn:hover { background: var(--surface-active); color: #fff; }

/* Progresso */
.prog-track { height: 10px; background: rgba(255,255,255,0.05); border-radius: 5px; overflow: hidden; margin-top: 10px; }
.prog-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), #4ade80); transition: width 0.4s ease; border-radius: 5px; box-shadow: 0 0 10px rgba(34,197,94,0.5); }

/* Toasts */
#toast { position: fixed; bottom: 120px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 12px; }
.toast-msg { background: #18181b; border: 1px solid var(--border); padding: 14px 20px; border-radius: var(--radius-sm); box-shadow: 0 10px 25px rgba(0,0,0,0.4); animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.toast-msg.ok { border-left: 4px solid var(--brand); }
.toast-msg.err { border-left: 4px solid var(--danger); }
.toast-msg.warn { border-left: 4px solid var(--warn); }
@keyframes slideIn { from { transform: translateX(120%); } to { transform: translateX(0); } }

/* Conexão Badge */
.conn-badge { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; background: var(--surface); padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.dot.on { background: var(--brand); box-shadow: 0 0 10px var(--brand); }

/* WhatsApp Info */
#wa-info { max-height: 200px; overflow-y: auto; }
#wa-info > div:first-child { color: var(--text-secondary); font-size: 11px; margin-bottom: 6px; }
#wa-info .badge { background: var(--surface-hover); border: 1px solid var(--border); padding: 6px 8px; border-radius: 6px; margin: 2px 0; font-size: 11px; line-height: 1.4; }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Run Cards - Histórico Premium */
.run-row {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px !important;
    padding: 16px !important;
    margin-bottom: 12px !important;
    position: relative;
    overflow: hidden;
}

.run-row:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--brand) !important;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-finished { 
    background: rgba(0, 212, 255, 0.1); 
    color: #00D4FF; 
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.status-running { 
    background: rgba(255, 184, 0, 0.1); 
    color: #FFB800; 
    border: 1px solid rgba(255, 184, 0, 0.2);
}

.status-error { 
    background: rgba(255, 71, 87, 0.1); 
    color: #FF4757; 
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.run-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-sm {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon-sm:hover {
    background: var(--brand);
    color: white;
    transform: scale(1.1);
}

/* ─────────────────────────────────────────────
   USER BADGE (nav)
───────────────────────────────────────────── */
.user-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.user-badge-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.user-badge-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-logout {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.btn-logout:hover { background: rgba(239,68,68,0.15); border-color: var(--danger); }

/* ─────────────────────────────────────────────
   HAMBURGER & SIDEBAR OVERLAY (mobile)
───────────────────────────────────────────── */
.hamburger {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
}
.hamburger:hover { background: var(--surface-hover); }
.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
  display: block;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 300;
  backdrop-filter: blur(2px);
}

/* ─────────────────────────────────────────────
   SETTINGS GRID (responsivo)
───────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ─────────────────────────────────────────────
   RESPONSIVIDADE — TABLET (≤ 900px)
───────────────────────────────────────────── */
@media (max-width: 900px) {
  .prospect-grid { grid-template-columns: 1fr; }
  .table-container { max-height: none; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}

/* ─────────────────────────────────────────────
   RESPONSIVIDADE — MOBILE (≤ 768px)
───────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Mostrar hamburger */
  .hamburger { display: flex; }

  /* Layout geral */
  .app { grid-template-columns: 1fr; }
  body { overflow: auto; }

  /* Sidebar vira drawer lateral */
  .main-nav {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100%;
    width: 260px;
    z-index: 400;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }
  .main-nav.open { left: 0; }
  .sidebar-overlay.open { display: block; }

  /* Conteúdo principal */
  .main-content {
    padding: 72px 16px 24px;
    min-height: 100vh;
  }

  /* Headers */
  .header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .actions {
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }
  .actions .btn { flex: 1 1 auto; min-width: 120px; }
  .actions select { width: 100%; }

  /* Stats */
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats.dashboard { grid-template-columns: repeat(2, 1fr); }

  /* Dashboard panels */
  .dash-panels { grid-template-columns: 1fr; }
  .dash-runs { grid-template-columns: 1fr !important; }

  /* Settings */
  .settings-grid { grid-template-columns: 1fr; }

  /* Kanban — scroll horizontal */
  .kanban-board {
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
  }
  .kanban-col {
    min-width: 260px;
    scroll-snap-align: start;
  }

  /* Tabela */
  .table-scroll { overflow-x: auto; }
  .search-input { width: 100%; }
  .table-toolbar-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-toolbar-top > div { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .table-toolbar-top > div .btn { flex: 1; }

  /* Modais */
  .modal-overlay { align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    margin: 0;
  }
  .progress-overlay {
    bottom: 0;
    right: 0;
    left: 0;
    padding: 0 16px 16px;
  }
  .prog-box { max-width: 100%; width: 100%; }
}

/* ─────────────────────────────────────────────
   RESPONSIVIDADE — MOBILE PEQUENO (≤ 480px)
───────────────────────────────────────────── */
@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat-card .num { font-size: 24px; }
  .header-bar h2 { font-size: 20px; }
  .main-content { padding: 68px 12px 24px; }

  /* Tabela compacta */
  th, td { padding: 10px 12px; font-size: 12px; }

  /* Prospect sidebar full width */
  .sidebar-tools { width: 100%; }

  /* Nav brand compacta */
  .nav-brand { margin-bottom: 24px; }
}

/* ─────────────────────────────────────────────
   CAIXA DE ENTRADA (INBOX)
───────────────────────────────────────────── */
.inbox-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 68vh;
  min-height: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.inbox-list-panel {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.inbox-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.inbox-contact-item:hover { background: var(--surface-hover); }
.inbox-contact-item.active { background: var(--surface-active); }

.inbox-contact-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: white; flex-shrink: 0;
}

.inbox-contact-info { flex: 1; min-width: 0; }
.inbox-contact-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-contact-preview { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.inbox-contact-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.inbox-contact-time { font-size: 10px; color: var(--text-secondary); }
.inbox-unread-badge { background: var(--brand); color: white; border-radius: 10px; font-size: 10px; font-weight: 800; padding: 1px 7px; min-width: 20px; text-align: center; }

/* Painel de chat */
.inbox-chat-panel { display: flex; flex-direction: column; overflow: hidden; }

.inbox-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;
}

#inbox-chat {
  display: none; height: 100%; flex-direction: column;
}

.inbox-chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; background: var(--surface-hover);
}
.inbox-chat-header-info { display: flex; flex-direction: column; gap: 2px; }

.inbox-messages-scroll {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
}

/* Balões de mensagem */
.msg-row { display: flex; margin-bottom: 6px; }
.msg-row.msg-out { justify-content: flex-end; }
.msg-row.msg-in  { justify-content: flex-start; }

.msg-bubble {
  max-width: 72%; padding: 10px 14px;
  border-radius: 12px; font-size: 13px; line-height: 1.55;
}
.msg-in .msg-bubble {
  background: var(--surface-hover);
  border-radius: 4px 12px 12px 12px;
}
.msg-out .msg-bubble {
  background: var(--brand-gradient);
  color: white;
  border-radius: 12px 4px 12px 12px;
}
.msg-sender { font-size: 10px; font-weight: 700; color: var(--brand); margin-bottom: 3px; }
.msg-content { word-break: break-word; white-space: pre-wrap; }
.msg-time { font-size: 10px; margin-top: 4px; opacity: 0.55; text-align: right; }

/* Caixa de sugestão IA */
.inbox-ai-suggestion {
  margin: 0 14px 8px;
  padding: 12px 14px;
  background: rgba(139, 92, 246, 0.07);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* Caixa de resposta */
.inbox-reply-box {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface);
}
.inbox-reply-box textarea { margin: 0; resize: none; height: 64px; }
.inbox-reply-actions {
  display: flex; justify-content: space-between; align-items: center; margin-top: 8px;
}

@media (max-width: 768px) {
  .inbox-layout { grid-template-columns: 1fr; height: auto; }
  .inbox-list-panel { max-height: 35vh; }
  .inbox-chat-panel { height: 55vh; }
}

/* ── INBOX: painel de info do contato ── */
.inbox-layout { grid-template-columns: 280px 1fr; }
.inbox-layout.show-info { grid-template-columns: 280px 1fr 250px; }

.inbox-info-panel {
  border-left: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface);
  flex-direction: column;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.info-row span:first-child {
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
  font-size: 11px;
}
.info-row span:last-child {
  text-align: right;
  word-break: break-word;
}

@media (max-width: 900px) {
  .inbox-layout.show-info { grid-template-columns: 1fr; }
  .inbox-info-panel { border-left: none; border-top: 1px solid var(--border); max-height: 220px; }
}

/* ── PLAYER DE ÁUDIO ── */
.msg-audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  padding: 2px 0;
}

.audio-play-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: inherit;
  flex-shrink: 0;
  transition: background 0.15s;
}
.audio-play-btn:hover { background: rgba(255,255,255,0.25); }
.audio-play-btn:disabled { opacity: 0.6; cursor: wait; }
.msg-out .audio-play-btn { background: rgba(255,255,255,0.2); }

.audio-wave-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 28px;
}
.audio-wave-bars span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.25);
  transition: background 0.1s;
  flex-shrink: 0;
}
.msg-in .audio-wave-bars span { background: rgba(148,163,184,0.4); }
.audio-wave-bars span:nth-child(odd)  { height: 60%; }
.audio-wave-bars span:nth-child(3n)   { height: 100%; }
.audio-wave-bars span:nth-child(4n)   { height: 45%; }
.audio-wave-bars span:nth-child(5n)   { height: 80%; }
.audio-wave-bars span.active { background: rgba(255,255,255,0.85); }
.msg-in .audio-wave-bars span.active  { background: var(--brand); }

.audio-dur {
  font-size: 11px;
  opacity: 0.7;
  white-space: nowrap;
  flex-shrink: 0;
}
