:root {
  --gold: #1d4ed8;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #eef1f8;
  --border: #e2e6f0;
  --text: #111827;
  --text-dim: #6b7280;
  --green: #16a34a;
  --red: #dc2626;
  --blue: #1d4ed8;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--panel); border-right: 1px solid var(--border); padding: 20px 0; flex-shrink: 0; }
.logo { font-size: 18px; font-weight: 700; padding: 0 20px 20px; color: var(--gold); }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a { padding: 12px 20px; color: var(--text-dim); text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: var(--panel-2); color: var(--text); }
.sidebar nav a.active { background: rgba(29,78,216,.1); color: var(--gold); border-left-color: var(--gold); }
.content { flex: 1; padding: 30px 40px; max-width: 1200px; }
h1 { margin-top: 0; font-size: 24px; }
table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
tr:hover { background: var(--panel-2); }
a.row-link { color: var(--text); text-decoration: none; }
a.row-link:hover { color: var(--gold); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-nouveau { background: rgba(59,130,246,.15); color: var(--blue); }
.badge-a_appeler { background: rgba(59,130,246,.15); color: var(--blue); }
.badge-non_joint { background: rgba(107,114,128,.15); color: var(--text-dim); }
.badge-a_rappeler { background: rgba(249,115,22,.15); color: #f97316; }
.badge-interesse { background: rgba(29,78,216,.15); color: var(--gold); }
.badge-tres_interesse { background: rgba(29,78,216,.25); color: var(--gold); }
.badge-rdv { background: rgba(168,85,247,.15); color: #a855f7; }
.badge-client { background: rgba(34,197,94,.15); color: var(--green); }
.badge-carte_refusee { background: rgba(239,68,68,.15); color: var(--red); }
.badge-perdu { background: rgba(107,114,128,.1); color: var(--text-dim); }
.temp-chaud { color: #ef4444; }
.temp-tiede { color: #f97316; }
.temp-froid { color: #3b82f6; }
.alert-box { padding: 12px 16px; border-radius: 8px; margin-bottom: 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.alert-rouge { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); }
.alert-orange { background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.3); }
.alert-vert { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); }
.tag-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; font-size: 12px; margin: 2px 4px 2px 0; }
.tag-pill a { color: var(--text-dim); text-decoration: none; }
.delta-up { color: var(--green); font-size: 13px; }
.delta-down { color: var(--red); font-size: 13px; }
.funnel-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.funnel-label { width: 110px; font-size: 13px; color: var(--text-dim); }
.funnel-bar-bg { flex: 1; background: var(--panel-2); border-radius: 6px; height: 28px; overflow: hidden; }
.funnel-bar { background: linear-gradient(90deg, var(--gold), #3f6fe0); height: 100%; display: flex; align-items: center; padding-left: 10px; font-size: 12px; font-weight: 600; color: #fff; min-width: 2px; }
.funnel-val { width: 90px; text-align: right; font-size: 13px; color: var(--text-dim); }
.period-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.period-bar a { padding: 6px 14px; border-radius: 20px; font-size: 13px; text-decoration: none; color: var(--text-dim); border: 1px solid var(--border); }
.period-bar a.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.progress-bg { background: var(--panel-2); border-radius: 8px; height: 22px; overflow: hidden; margin: 8px 0; }
.progress-fill { background: linear-gradient(90deg, var(--green), #4ade80); height: 100%; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 40px; width: 340px; }
.retard { color: var(--red); font-weight: 700; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.search-box { width: 260px; margin: 0; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin: 20px 0 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.stat-card .val { font-size: 26px; font-weight: 700; color: var(--gold); }
.stat-card .lbl { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.btn { display: inline-block; background: var(--gold); color: #fff; padding: 10px 18px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; }
.btn:hover { opacity: .9; }
.btn-danger { background: var(--red); color: #fff; }
input, select, textarea { width: 100%; padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 14px; margin-bottom: 12px; font-family: inherit; }
label { font-size: 13px; color: var(--text-dim); display: block; margin-bottom: 4px; }
.form-row { display: flex; gap: 12px; }
.form-row > div { flex: 1; }
.note { background: var(--panel-2); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.note .date { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.filters { margin-bottom: 16px; }
.filters a { color: var(--text-dim); text-decoration: none; margin-right: 16px; font-size: 13px; }
.filters a.active, .filters a:hover { color: var(--gold); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { padding: 6px 14px; border-radius: 20px; font-size: 13px; text-decoration: none; color: var(--text-dim); border: 1px solid var(--border); background: var(--panel); white-space: nowrap; }
.chip.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.chip:hover { border-color: var(--gold); }

.mobile-toggle { display: none; }
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .mobile-toggle {
    display: block; position: fixed; top: 12px; left: 12px; z-index: 50;
    background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    width: 40px; height: 40px; font-size: 18px; cursor: pointer;
  }
  .sidebar {
    position: fixed; top: 0; left: -260px; height: 100vh; z-index: 40;
    transition: left .2s ease; box-shadow: 2px 0 12px rgba(0,0,0,.15);
  }
  .sidebar.open { left: 0; }
  .content { padding: 70px 16px 30px; max-width: 100%; }
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-box { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .form-row { flex-direction: column; }
}
