:root {
  --red: #d31e25;
  --red-dark: #a8151b;
  --black: #111111;
  --grey-100: #f4f4f2;
  --grey-300: #ddd;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(0,0,0,0.1);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--black);
  background: var(--grey-100);
}

h1, h2 { margin: 0; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }

.btn-secondary { background: var(--black); color: var(--white); }
.btn-secondary:hover { opacity: 0.85; }

.btn-ghost { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--black);
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-logo {
  width: 110px;
  margin-bottom: 12px;
}

.login-sub {
  color: #555;
  font-size: 0.9rem;
  margin: 8px 0 24px;
}

.login-card form {
  text-align: left;
}

.login-card .btn { width: 100%; margin-top: 8px; }

/* Shared fields */
.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label { font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.field input {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
}
.field input:focus { outline: 2px solid var(--red); border-color: var(--red); }

.form-status { margin-top: 12px; font-weight: 600; font-size: 0.9rem; min-height: 1.2em; }
.form-status.success { color: #1b8a3d; }
.form-status.error { color: var(--red-dark); }

/* Header */
.admin-header { background: var(--black); color: var(--white); }
.admin-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-logo { width: 44px; }
.admin-header h1 { font-size: 1.1rem; flex: 1; }
.admin-header-right { display: flex; align-items: center; gap: 14px; font-size: 0.9rem; }

/* Main */
.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.admin-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 28px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-bar { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.filter-bar select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--grey-300);
}

.admin-section-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Table */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 800px; }

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--grey-100);
  vertical-align: top;
}

th { color: #555; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }

.loading-row, .empty-row { text-align: center; color: #888; padding: 24px; }

.status-select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--grey-300);
  font-size: 0.85rem;
  font-weight: 700;
}

.status-nouveau { color: #b8860b; }
.status-contacte { color: #2563eb; }
.status-en_discussion { color: #7c3aed; }
.status-signe { color: #0891b2; }
.status-paye { color: #1b8a3d; }
.status-decline { color: var(--red-dark); }

.status-en_attente { color: #b8860b; }
.status-oui { color: #1b8a3d; }
.status-non { color: var(--red-dark); }
.status-a_recontacter { color: #7c3aed; }

.notes-input {
  width: 100%;
  min-width: 180px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.85rem;
  background: transparent;
}
.notes-input:hover, .notes-input:focus {
  border-color: var(--grey-300);
  background: var(--white);
}

/* Formulaire ajout prospect */
.add-prospect-form {
  background: var(--grey-100);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
  align-items: end;
}
.add-prospect-form .field-wide { grid-column: span 2; }
.add-prospect-form .form-status { grid-column: 1 / -1; }
.add-prospect-form.hidden { display: none; }

@media (max-width: 900px) {
  .add-prospect-form { grid-template-columns: 1fr 1fr; }
  .add-prospect-form .field-wide { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .add-prospect-form { grid-template-columns: 1fr; }
  .add-prospect-form .field-wide { grid-column: 1; }
}

/* Users */
.add-user-form {
  background: var(--grey-100);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.add-user-form .form-status { grid-column: 1 / -1; }

.add-user-form.hidden { display: none; }

.users-list { list-style: none; padding: 0; margin: 0; }
.users-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-100);
  font-size: 0.9rem;
}
.users-list li span.user-email { color: #777; }

@media (max-width: 720px) {
  .add-user-form { grid-template-columns: 1fr; }
}
