:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #242836;
  --border: #2e3345;
  --text: #e4e6ed;
  --text-muted: #8b8fa3;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --green: #22c55e;
  --yellow: #eab308;
  --orange: #f97316;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: all 0.15s;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-copy { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-copy:hover { border-color: var(--green); color: var(--green); }
.btn-copy.copied { border-color: var(--green); color: var(--green); }

.stats-bar {
  display: flex;
  gap: 24px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tabs {
  display: flex;
  gap: 0;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-badge {
  display: inline-block;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
}

.filters {
  display: flex;
  gap: 12px;
  padding: 16px 32px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 4px;
}

.filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--text-muted); color: var(--text); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

.search-input {
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  width: 240px;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { outline: none; border-color: var(--accent); }

.content {
  padding: 0 32px 32px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 24px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alerts {
  background: var(--surface);
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 13px;
}

.alerts strong { color: var(--orange); }

.prospect-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prospect-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.15s;
}

.prospect-card:hover { border-color: var(--accent); }

.prospect-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.prospect-name {
  font-size: 15px;
  font-weight: 600;
}

.prospect-name a {
  color: var(--text);
  text-decoration: none;
}

.prospect-name a:hover { color: var(--accent); }

.prospect-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.prospect-status {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-found { background: var(--surface-2); color: var(--text-muted); }
.status-connection_sent { background: #1e3a5f; color: var(--blue); }
.status-connected { background: #14532d; color: var(--green); }
.status-msg1_sent { background: #422006; color: var(--yellow); }
.status-relance1_sent { background: #431407; color: var(--orange); }
.status-relance2_sent { background: #450a0a; color: var(--red); }
.status-responded { background: #052e16; color: #4ade80; }
.status-rdv { background: #312e81; color: #a5b4fc; }
.status-rejected { background: #1c1917; color: #78716c; }
.status-skip { background: #1c1917; color: #78716c; }

.messages-section {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 10px 14px;
}

.message-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  min-width: 90px;
  flex-shrink: 0;
  padding-top: 2px;
}

.message-text {
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.5;
  flex: 1;
  max-height: 80px;
  overflow: hidden;
  cursor: pointer;
  transition: max-height 0.3s;
}

.message-text.expanded { max-height: none; }

.message-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.status-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
}

.status-select:focus { outline: none; border-color: var(--accent); }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 20px;
  background: var(--green);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  pointer-events: none;
  z-index: 100;
}

.toast.show { opacity: 1; transform: translateY(0); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text);
}

.import-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}

.import-section h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.import-section textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: monospace;
  font-size: 12px;
  resize: vertical;
  margin-bottom: 8px;
}

.import-section textarea:focus { outline: none; border-color: var(--accent); }

@media (max-width: 768px) {
  .header, .stats-bar, .tabs, .filters, .content { padding-left: 16px; padding-right: 16px; }
  .prospect-header { flex-direction: column; }
  .search-input { width: 100%; }
}
