/* ═══════════════════════════════════════════════════════════════════
   CRM Nexus Pro — Design System
   Palette : Teal #1a818d | Vert #7bb87a | Corail #de655f | Or #f2a41e
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --teal:      #1a818d;
  --teal-dark: #136472;
  --teal-light:#e8f5f7;
  --green:     #7bb87a;
  --coral:     #de655f;
  --gold:      #f2a41e;
  --text:      #1a1f2e;
  --text-muted:#64748b;
  --text-light:#94a3b8;
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --sidebar-w: 248px;
  --sidebar-bg:#0d1f2d;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.06);
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding-bottom: 24px;
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
}
.main-layout {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}
.main-content {
  padding: 28px 32px;
  max-width: 1400px;
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 8px;
}
.brand-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1a818d, #0f5f6a);
  color: #fff;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; letter-spacing: .05em;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26,129,141,.4);
}
.brand-name { font-weight: 700; font-size: 14px; line-height: 1.2; color: #fff; }
.brand-sub  { font-size: 11px; color: rgba(255,255,255,.4); }

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 14px 18px 4px;
}

.sidebar-nav { padding: 0 10px; }
.sidebar-nav li { margin-bottom: 2px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  transition: background .15s, color .15s;
}
.nav-link:hover  { background: rgba(255,255,255,.08); color: rgba(255,255,255,.9); }
.nav-link.active {
  background: rgba(26,129,141,.28);
  color: #4dd4e0;
  font-weight: 600;
  box-shadow: inset 2px 0 0 #1a818d;
}
.nav-link svg { flex-shrink: 0; opacity: 1; }

.sidebar-projects {
  padding: 4px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-chip {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: color .15s;
}
.project-chip:hover { color: rgba(255,255,255,.85); }
.project-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(26,129,141,.6);
}

/* ── Page header ─────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Cards & Surfaces ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  padding: 20px;
}
.card-sm { padding: 14px 16px; }
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}

/* ── Stat cards ──────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -.02em; }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.stat-card.accent-teal  { border-top: 3px solid var(--teal); }
.stat-card.accent-green { border-top: 3px solid var(--green); }
.stat-card.accent-gold  { border-top: 3px solid var(--gold); }
.stat-card.accent-coral { border-top: 3px solid var(--coral); }

/* ── Dashboard grid ──────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dashboard-grid .card.full { grid-column: 1 / -1; }

/* ── Alert banner ────────────────────────────────────────────────────── */
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #fef2f2;
  border: 1px solid #fecaca;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .15s;
}
.alert-row:hover { background: #fee2e2; }
.alert-company { font-weight: 600; font-size: 13.5px; }
.alert-meta    { font-size: 12px; color: #b91c1c; }
.alert-days    { font-size: 12px; font-weight: 600; color: #ef4444; background: #fee2e2; padding: 2px 8px; border-radius: 20px; }

/* ── Interaction item ────────────────────────────────────────────────── */
.interaction-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.interaction-item:last-child { border-bottom: none; }
.int-type-badge {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  background: var(--teal-light);
  color: var(--teal);
}
.int-body { flex: 1; min-width: 0; }
.int-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.int-company { font-weight: 600; font-size: 13.5px; }
.int-content { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.int-date { font-size: 11.5px; color: var(--text-light); flex-shrink: 0; }

/* ── Tâche items ─────────────────────────────────────────────────────── */
.tache-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.tache-row:hover { box-shadow: 0 4px 12px rgba(0,0,0,.07); border-color: var(--border-2); }
.tache-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border-2);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.tache-check.done { background: var(--green); border-color: var(--green); }
.tache-check.done::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 700; }
.tache-body { flex: 1; min-width: 0; }
.tache-titre { font-size: 13.5px; font-weight: 500; }
.tache-titre.done { text-decoration: line-through; color: var(--text-muted); }
.tache-sub { font-size: 12px; color: var(--text-muted); }
.tache-echeance { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.tache-echeance.overdue { color: var(--coral); font-weight: 600; }

/* ── Badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-teal   { background: var(--teal-light); color: var(--teal); }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-coral  { background: #fee2e2; color: #dc2626; }
.badge-gold   { background: #fef3c7; color: #d97706; }
.badge-gray   { background: var(--bg); color: var(--text-muted); }
.badge-purple { background: #ede9fe; color: #7c3aed; }

/* Priority dots */
.prio-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prio-haute   { background: var(--coral); }
.prio-moyenne { background: var(--gold); }
.prio-basse   { background: var(--green); }

/* ── Pipeline / Kanban ────────────────────────────────────────────────── */
.kanban-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}
.kanban-col {
  min-width: 224px;
  max-width: 244px;
  flex-shrink: 0;
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  border: 2px dashed transparent;
  transition: border-color .15s, background .15s;
}
.kanban-col.drag-over {
  border-color: var(--teal);
  background: var(--teal-light);
}
.kanban-col-header {
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kanban-col-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.3;
  flex: 1;
}
.kanban-col-count {
  background: var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.kanban-cards {
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}
.kanban-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 13px 14px;
  cursor: grab;
  transition: box-shadow .18s, transform .12s;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.kanban-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.10); transform: translateY(-2px); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; }
.kc-company { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.kc-contact { font-size: 12px; color: var(--text-muted); }
.kc-footer  { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 4px; }
.kc-date    { font-size: 11px; color: var(--text-light); }

/* Won / Lost cols */
.kanban-col[data-etape="Signé / Gagné"] .kanban-col-name { color: var(--green); }
.kanban-col[data-etape="Perdu / Sans suite"] .kanban-col-name { color: var(--text-light); }

/* ── Opportunity detail ───────────────────────────────────────────────── */
.opp-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
.opp-section { margin-bottom: 24px; }
.opp-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-track {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}
.pipeline-step {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s;
}
.pipeline-step:hover { border-color: var(--teal); color: var(--teal); }
.pipeline-step.active { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }
.pipeline-step.won  { background: var(--green); border-color: var(--green); color: #fff; }
.pipeline-step.lost { background: var(--text-light); border-color: var(--text-light); color: #fff; }

.contact-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.contact-name { font-weight: 600; font-size: 14px; }
.contact-poste { font-size: 12.5px; color: var(--text-muted); }
.contact-links { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.contact-link {
  font-size: 12px;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 4px;
}
.contact-link:hover { text-decoration: underline; }

.interaction-full {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.interaction-full:last-child { border-bottom: none; }
.int-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--teal-light);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.int-full-body { flex: 1; }
.int-full-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.int-full-type { font-weight: 600; font-size: 13.5px; }
.int-full-meta { font-size: 12px; color: var(--text-muted); }
.int-full-content { font-size: 13px; color: var(--text); line-height: 1.6; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.search-input {
  padding: 8px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 13.5px;
  width: 260px;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26,129,141,.1); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table th:hover { color: var(--teal); }
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  cursor: pointer;
  transition: background .12s;
}
.data-table tbody tr:hover { background: var(--bg); }
.col-name { font-weight: 600; color: var(--text); }
.col-sub  { font-size: 12px; color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  transition: background .15s, box-shadow .15s, transform .1s;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #1e90a0, #136472); color: #fff; box-shadow: 0 2px 8px rgba(26,129,141,.3); }
.btn-primary:hover { background: linear-gradient(135deg, #1a818d, #0f5760); box-shadow: 0 4px 14px rgba(26,129,141,.38); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-2); }
.btn-secondary:hover { background: var(--bg); border-color: var(--text-light); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: #fee2e2; color: var(--coral); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fecaca; }

/* ── Select / Filter ────────────────────────────────────────────────── */
.filter-select {
  padding: 7px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--teal); }

/* ── Forms / Modals ─────────────────────────────────────────────────── */
dialog {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  width: 540px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}
dialog::backdrop { background: rgba(13,31,45,.5); backdrop-filter: blur(3px); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-form  { padding: 20px 24px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-group { margin-bottom: 14px; }
.form-row   { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,129,141,.14);
}
.form-textarea { resize: vertical; line-height: 1.5; }

/* ── Notes box ───────────────────────────────────────────────────────── */
.notes-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
}
.notes-box:empty::before { content: "Aucune note."; color: var(--text-light); }

/* ── Info rows ───────────────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.info-item {}
.info-key   { font-size: 11.5px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.info-val   { font-size: 13.5px; color: var(--text); }
.info-val a { color: var(--teal); }
.info-val a:hover { text-decoration: underline; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state svg { opacity: .3; margin-bottom: 12px; }
.empty-state p   { font-size: 14px; }

/* ── Loading ─────────────────────────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  gap: 12px;
}
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--coral); }
@keyframes toast-in { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: none; } }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .opp-layout { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main-content { padding: 16px; }
}

/* ── Entreprises nav item ─────────────────────────────────────────────── */
.sidebar-nav .nav-link .nav-count {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.5);
  padding: 1px 7px;
  border-radius: 20px;
}

/* ── Misc ────────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  cursor: pointer;
  transition: color .15s;
}
.back-link:hover { color: var(--teal); }

.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--teal-light);
  color: var(--teal);
}

.montant {
  font-weight: 700;
  color: var(--teal);
}

/* ── Rapports (Journal de bord) ──────────────────────────────────────── */
.rapports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.rapport-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  cursor: pointer;
  font: inherit;
  transition: box-shadow .18s, transform .12s, border-color .15s;
}
.rapport-card:hover {
  box-shadow: 0 8px 22px rgba(0,0,0,.10);
  transform: translateY(-2px);
  border-color: var(--teal);
}
.rapport-card.is-current { border-top: 3px solid var(--teal); }
.rapport-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rapport-week { font-size: 15px; font-weight: 700; color: var(--text); }
.rapport-range { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.rapport-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  padding-top: 9px;
  margin-top: 2px;
}
.rapport-card:hover .rapport-foot { color: var(--teal); }
.rapport-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border-2); flex-shrink: 0;
}
.rapport-dot.ok { background: var(--green); }

/* ── Drag-and-drop étapes pipeline ──────────────────────────────────── */
.etape-item.etape-dragging { opacity: 0.4; }
.etape-item.drag-over-etape {
  border-color: var(--teal) !important;
  background: var(--teal-light) !important;
}
.etape-handle { cursor: grab; }
.etape-handle:active { cursor: grabbing; }

/* ── Avatar chips (utilisateurs) ────────────────────────────────────── */
.avatar-chip {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
  cursor: default;
}
.avatar-chip.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar-img { object-fit: cover; border-radius: 50%; display: block; }

/* Avatar upload wrapper (page profil) */
.avatar-upload-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity .18s;
}
.avatar-upload-wrapper:hover .avatar-upload-overlay { opacity: 1; }

/* ── Sidebar user block ──────────────────────────────────────────────── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.15);
  cursor: pointer;
  transition: background .15s;
}
.sidebar-user:hover { background: rgba(0,0,0,.25); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: rgba(255,255,255,.9);
}
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.38); }

/* ── Multi-select user chips (assignation) ──────────────────────────── */
.user-chip-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 42px;
  cursor: default;
}
.user-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 4px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border-2);
  cursor: pointer;
  transition: background .12s, border-color .12s;
  user-select: none;
}
.user-chip.selected {
  background: var(--teal-light);
  border-color: var(--teal);
  color: var(--teal-dark);
}

/* ── Login page ─────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0d1f2d 0%, #0f3340 50%, #0d1f2d 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}
.login-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px; justify-content: center;
}
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; text-align: center; }
.login-sub   { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 24px; }
.login-error {
  background: #fef2f2; border: 1px solid #fecaca;
  color: #dc2626; border-radius: var(--radius);
  padding: 9px 12px; font-size: 13px; margin-bottom: 14px; display: none;
}
.color-swatch-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: border-color .15s, transform .1s;
}
.color-swatch.selected { border-color: var(--text); transform: scale(1.15); }
