:root {
  --accent: #6366f1;
  --accent-2: #818cf8;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: #1e293b;
}

/* ---------- Navigation ---------- */
.navbar {
  background: linear-gradient(135deg, #0f172a, #1e293b 55%, #334155);
  padding: 12px 8px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, .15);
}
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}
.brand-name { font-weight: 800; font-size: 1.1rem; color: #fff; line-height: 1.1; }
.brand-sub { font-size: .62rem; color: rgba(255,255,255,.5); letter-spacing: 1.1px; font-weight: 600; }
.navbar .nav-link {
  color: rgba(255,255,255,.78); font-size: .86rem; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; transition: all .15s;
}
.navbar .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.navbar .nav-link.active { color: #fff; background: rgba(99,102,241,.5); }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
}

/* ---------- Cartes ---------- */
.card-clean {
  background: #fff; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.kpi-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 700;
}
.kpi-value { font-size: 1.8rem; font-weight: 800; color: var(--ink); letter-spacing: -.5px; line-height: 1.1; }
.kpi-sub { font-size: .76rem; color: #94a3b8; }

.section-title {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted); font-weight: 700; margin-bottom: 10px;
}

/* ---------- Boutons / formulaires ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; font-weight: 600; box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 6px 16px rgba(99,102,241,.4);
}
.form-control, .form-select { border-radius: 8px; border-color: var(--line); }
.form-control:focus, .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-label { font-size: .8rem; font-weight: 600; color: #334155; margin-bottom: 4px; }

/* ---------- Pastilles voyageurs ---------- */
.traveler-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 4px; border-radius: 999px;
  font-size: .76rem; font-weight: 600;
  background: #fff; border: 1px solid var(--line);
}
.traveler-dot {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: .56rem; font-weight: 800; flex-shrink: 0;
}
.traveler-dot-lg { width: 30px; height: 30px; font-size: .74rem; }

/* ---------- Badges secteur ---------- */
.sector-badge {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  font-size: .68rem; font-weight: 700; color: #fff; white-space: nowrap;
}

/* ---------- Agenda ---------- */
.agenda-col { min-width: 300px; }
.agenda-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px 12px 0 0;
  color: #fff; font-weight: 700; font-size: .9rem;
}
.agenda-body {
  border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 12px 12px; background: #fff; padding: 10px;
  min-height: 120px;
}

.ev-card {
  border-left: 4px solid var(--accent);
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 4px;
  transition: box-shadow .15s, transform .15s;
  display: block; text-decoration: none; color: inherit;
}
.ev-card:hover { box-shadow: 0 4px 14px rgba(15,23,42,.1); transform: translateY(-1px); color: inherit; }
.ev-time { font-size: .76rem; font-weight: 700; color: var(--muted); }
.ev-title { font-size: .89rem; font-weight: 600; color: var(--ink); }
.ev-meta { font-size: .76rem; color: var(--muted); }
.ev-card.status-cancelled { opacity: .5; }
.ev-card.status-cancelled .ev-title { text-decoration: line-through; }
.ev-card.conflict { border-color: #ef4444; background: #fef2f2; }

/* ---------- Trajets ---------- */
.leg {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px; margin: 2px 0 6px 14px;
  font-size: .76rem; color: var(--muted);
  border-left: 2px dashed #cbd5e1;
}
.leg.tight { color: #b45309; border-left-color: #f59e0b; }
.leg.impossible { color: #b91c1c; border-left-color: #ef4444; font-weight: 600; }
.leg-estimated { font-style: italic; }

/* ---------- Autocomplétion ---------- */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; z-index: 1060; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,23,42,.14);
  max-height: 290px; overflow-y: auto; margin-top: 4px;
}
.ac-item { padding: 8px 12px; cursor: pointer; font-size: .85rem; border-bottom: 1px solid #f1f5f9; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: #eef2ff; }
.ac-main { font-weight: 600; color: var(--ink); }
.ac-sub { font-size: .76rem; color: var(--muted); }
.ac-empty { padding: 10px 12px; font-size: .8rem; color: var(--muted); }

/* ---------- Jetons (contacts / participants) ---------- */
.token {
  display: inline-flex; align-items: center; gap: 7px;
  background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3;
  border-radius: 999px; padding: 4px 6px 4px 12px;
  font-size: .8rem; font-weight: 500; margin: 0 5px 5px 0;
}
.token .btn-close { font-size: .55rem; padding: 3px; }

.attendee-toggle input { display: none; }
.attendee-toggle label {
  cursor: pointer; border: 2px solid var(--line); border-radius: 999px;
  padding: 5px 13px 5px 6px; font-size: .82rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; transition: all .15s; margin: 0 6px 6px 0;
}
.attendee-toggle input:checked + label {
  border-color: currentColor; box-shadow: 0 2px 8px rgba(15,23,42,.1);
}

/* ---------- Carte ---------- */
#gmap { width: 100%; height: calc(100vh - 210px); min-height: 460px; border-radius: 14px; }
.map-legend { font-size: .82rem; }
.map-panel { max-height: calc(100vh - 210px); overflow-y: auto; }

/* ---------- Notes / tableau blanc ---------- */
.note-card {
  border-left: 4px solid #cbd5e1;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; margin-bottom: 7px;
}
.note-card:hover { box-shadow: 0 2px 10px rgba(15, 23, 42, .07); }
.note-text { font-size: .88rem; color: var(--ink); white-space: pre-wrap; }
.note-meta { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.note-done .note-text { text-decoration: line-through; color: var(--muted); }
.note-done { opacity: .65; }

/* ---------- Divers ---------- */
.table-clean th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding: 10px 8px;
}
.table-clean td { vertical-align: middle; border-bottom: 1px solid #f1f5f9; font-size: .86rem; padding: 10px 8px; }
.table-clean tr:hover td { background: #f8faff; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #4f46e5; }
.empty-state { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty-state i { font-size: 2.4rem; color: #cbd5e1; display: block; margin-bottom: 10px; }
.day-pill {
  display: inline-block; padding: 6px 13px; border-radius: 9px;
  font-size: .82rem; font-weight: 600; color: #475569;
  background: #fff; border: 1px solid var(--line); white-space: nowrap;
}
.day-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-pill:hover { color: #334155; }
.day-pill.active:hover { color: #fff; }
