:root {
  /* 2Empower brand */
  --bg:           #f7f7fc;
  --surface:      #ffffff;
  --surface2:     #f1f0f9;
  --border:       #e4e0f5;
  --accent:       #5533da;
  --accent-light: #eceafc;
  --accent-hover: #4526c2;
  --pink:         #9b35c8;
  --pink-light:   #f5e9fd;
  --orange:       #ff6b35;
  --orange-light: #fff1eb;
  /* Gradient signature 2Empower : bleu-violet → violet-rose */
  --gradient:     linear-gradient(135deg, #4b3ac9 0%, #7b2fbe 50%, #9b35c8 100%);
  --gradient-warm: linear-gradient(135deg, #ff6b35 0%, #e0367a 100%);
  --text:         #1a1730;
  --text-muted:   #6b7280;
  --green:        #10b981;
  --green-light:  #d1fae5;
  --red:          #ef4444;
  --red-light:    #fee2e2;
  --shadow-sm:    0 1px 4px rgba(75,58,201,.07);
  --shadow:       0 4px 20px rgba(75,58,201,.14);
  --radius:       12px;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px; height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav__brand {
  font-weight: 800; font-size: 17px;
  color: white;
  background: var(--gradient);
  padding: 6px 14px;
  border-radius: 8px;
  margin-right: 12px;
  white-space: nowrap;
  letter-spacing: -.2px;
}

.nav__tabs { display: flex; gap: 2px; flex: 1; }

.nav__tab {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 7px 16px; border-radius: 8px;
  font-size: 14px; font-family: var(--font); font-weight: 500;
  transition: all .15s;
}
.nav__tab:hover  { background: var(--surface2); color: var(--accent); }
.nav__tab.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.nav__logout {
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  text-decoration: none; padding: 7px 12px; border-radius: 8px;
  transition: all .15s;
}
.nav__logout:hover { background: var(--surface2); color: var(--accent); }

/* ── Main ────────────────────────────────────────────────────────────────── */
.main { padding: 28px; max-width: 1200px; margin: 0 auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── KPIs ────────────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 24px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient);
}
.kpi__value {
  font-size: 36px; font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.kpi__label { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ── Charts ──────────────────────────────────────────────────────────────── */
.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.chart-card h3 {
  font-size: 13px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 18px;
  text-transform: uppercase; letter-spacing: .5px;
}

/* ── Section header ──────────────────────────────────────────────────────── */
.section-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 20px;
}
.section-header h2 { font-size: 20px; font-weight: 700; }

/* ── Resource list ───────────────────────────────────────────────────────── */
.resource-list { display: flex; flex-direction: column; gap: 12px; }

.resource-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.resource-card:hover { box-shadow: var(--shadow); }

.resource-card__header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 8px;
}
.resource-card__name { font-weight: 600; font-size: 15px; }
.resource-card__meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; gap: 20px;
}
.resource-card__actions { display: flex; gap: 8px; }

.badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
}
.badge--current  { background: var(--green-light); color: var(--green); }
.badge--count    { background: var(--accent-light); color: var(--accent); }
.badge--pink     { background: var(--pink-light);   color: var(--pink); }

/* ── Data table ──────────────────────────────────────────────────────────── */
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.data-table th, .data-table td {
  padding: 12px 16px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  color: var(--text-muted); font-weight: 600;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .6px; background: var(--surface2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface2); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px;
  font-family: var(--font); font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text);
  cursor: pointer; transition: all .15s;
}
.btn:hover { background: var(--surface2); border-color: var(--accent); color: var(--accent); }

.btn--primary {
  background: var(--gradient);
  border-color: transparent; color: #fff;
}
.btn--primary:hover {
  opacity: .9; border-color: transparent; color: #fff;
}

.btn--sm { padding: 5px 12px; font-size: 12px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(30,27,46,.5);
  backdrop-filter: blur(4px);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 500px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(124,58,237,.2);
}

.modal__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal__header h3 { font-size: 16px; font-weight: 700; }
.modal__close {
  background: var(--surface2); border: none; color: var(--text-muted);
  cursor: pointer; font-size: 16px; width: 28px; height: 28px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal__close:hover { background: var(--red-light); color: var(--red); }

.modal__form { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }

.modal__form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--text);
}

.modal__form input,
.modal__form textarea,
.modal__form select {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text);
  padding: 9px 12px; font-size: 13px;
  font-family: var(--font); transition: border-color .15s;
  outline: none;
}
.modal__form input:focus,
.modal__form textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
}
.modal__form textarea { resize: vertical; min-height: 70px; }

.label--checkbox {
  flex-direction: row !important; align-items: center;
  gap: 10px; cursor: pointer;
}
.label--checkbox input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent);
  padding: 0;
}

.modal__actions {
  display: flex; justify-content: flex-end;
  gap: 8px; padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── Misc ────────────────────────────────────────────────────────────────── */
.loading {
  color: var(--text-muted); font-size: 13px; padding: 30px 0;
  text-align: center;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Leads tab ───────────────────────────────────────────────────────────── */
.leads-total { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.lead-row:hover td { background: var(--surface2); }
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 16px;
}

/* ── Filters bar ─────────────────────────────────────────────────────────── */
.filters-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.filter-input, .filter-select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text);
  padding: 7px 11px; font-size: 13px;
  font-family: var(--font); outline: none;
  transition: border-color .15s;
}
.filter-input:focus, .filter-select:focus { border-color: var(--accent); }
.filter-input { width: 220px; }
.filter-select { cursor: pointer; }

/* ── N/A in detail ───────────────────────────────────────────────────────── */
.detail-na { color: var(--text-muted) !important; font-weight: 400 !important; font-style: italic; }

/* ── Badges statut Brevo ─────────────────────────────────────────────────── */
.badge--nouveau { background: var(--green-light);  color: var(--green); }
.badge--misa    { background: #dbeafe; color: #1d4ed8; }
.badge--echec   { background: var(--red-light);    color: var(--red); }

/* ── Bouton Brevo ────────────────────────────────────────────────────────── */
.btn--brevo {
  background: #0b66c3; border-color: #0b66c3; color: #fff;
  margin-top: 6px; display: inline-flex;
}
.btn--brevo:hover { opacity: .88; border-color: #0b66c3; color: #fff; }

/* ── Lead detail modal ───────────────────────────────────────────────────── */
.modal--wide { width: 920px; }

.list-id-badge {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  background: var(--surface2); border-radius: 5px; padding: 1px 6px;
  margin-left: 4px;
}
.field-badge {
  font-size: 10px; font-weight: 700; border-radius: 5px; padding: 1px 6px;
  margin-left: 6px; white-space: nowrap;
}
.field-badge--changed { background: var(--orange-light); color: var(--orange); }
.field-badge--new     { background: var(--green-light);  color: var(--green); }

/* Hero section */
.lead-hero {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.lead-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gradient);
  color: #fff; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lead-hero__info { flex: 1; }
.lead-hero__name  { font-size: 16px; font-weight: 700; }
.lead-hero__email { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.lead-hero__phone { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lead-hero__right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }

/* Grid sections */
.lead-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
}
.detail-section {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.detail-section:nth-child(odd) { border-right: 1px solid var(--border); }
.detail-section h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-muted); margin-bottom: 12px;
}
.detail-row {
  display: flex; justify-content: space-between;
  align-items: baseline; gap: 12px;
  font-size: 13px; margin-bottom: 7px;
}
.detail-label { color: var(--text-muted); white-space: nowrap; }
.detail-value { font-weight: 500; text-align: right; word-break: break-all; }
