:root {
  /* DA Louis — officiel */
  --bg:        #EDF0F0;
  --ink:       #03256c;
  --accent:    #3694f7;
  --good:      #38bb33;
  --bad:       #ff3236;
  /* dérivés */
  --surface:     #ffffff;
  --bg-2:        #dfe5e5;
  --muted:       #64708c;
  --line:        #d6dcdc;
  --accent-dark: #1f7fe0;
  --accent-soft: #e3f0fe;
  --good-soft:   #e4f6e3;
  --bad-soft:    #ffe5e5;
  --amber:       #f5b733;
  --shadow:      0 1px 2px rgba(3,37,108,.05), 0 14px 34px rgba(3,37,108,.10);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .2rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 1rem; letter-spacing: -.01em; }
h3 { margin: 0; }
.muted { color: var(--muted); font-size: .9rem; margin: .2rem 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.25rem;
  background: rgba(237,240,240,.85);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.btn-ghost {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: .45rem .8rem; border-radius: 10px; font: inherit; font-size: .85rem;
  font-weight: 600; cursor: pointer; transition: .15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }

/* Boutons */
.btn {
  background: var(--ink); color: #fff; border: 0; border-radius: 10px;
  padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn:hover { background: #06308a; }

/* Page head + recherche */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin: .5rem 0 1.4rem; flex-wrap: wrap;
}
#search {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: .65rem .9rem; font: inherit; min-width: 280px; color: var(--ink);
  box-shadow: var(--shadow);
}
#search:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* Grille de cartes */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow); color: var(--ink);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.card:hover {
  text-decoration: none; transform: translateY(-2px); border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(3,37,108,.06), 0 20px 40px rgba(3,37,108,.14);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.card h3 { font-size: 1.02rem; letter-spacing: -.01em; margin-bottom: .1rem; }
.card .email { color: var(--muted); font-size: .82rem; margin: 0 0 .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); }
.card-foot .dot { opacity: .5; }

/* Avatar */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 70% 58%), hsl(var(--h) 72% 42%));
}

/* Badges statut */
.badge {
  font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.big { font-size: .8rem; padding: .3rem .75rem; }
.badge.hot    { background: var(--bad-soft); color: #c81f22; border-color: #f5c2c3; }
.badge.active { background: var(--accent-soft); color: var(--accent-dark); border-color: #bcdcfb; }
.badge.cold   { background: var(--bg-2); color: var(--muted); border-color: var(--line); }
.badge.none   { background: transparent; color: var(--muted); border-color: var(--line); }

.empty, .no-result { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* Fiche personne */
.back { margin: 0 0 1rem; font-size: .9rem; }
.person-head {
  display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
}
.person-id { flex: 1; min-width: 0; }
.person-id h1 { margin-bottom: .1rem; }
.person-head .email { margin: .1rem 0; font-size: .9rem; }

.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1.2rem; align-items: start; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
}

/* Timeline */
.tl { display: flex; flex-direction: column; }
.tl-item {
  display: grid; grid-template-columns: 118px 1fr auto; align-items: center; gap: .8rem;
  padding: .85rem .4rem; border-bottom: 1px solid var(--line); color: var(--ink);
  position: relative; transition: .12s;
}
.tl-item:last-child { border-bottom: 0; }
.tl-item:hover { text-decoration: none; background: var(--accent-soft); border-radius: 10px; }
.tl-date { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tl-meta { font-size: .78rem; color: var(--muted); }
.tl-arrow { color: var(--accent); font-weight: 700; opacity: 0; transition: .12s; }
.tl-item:hover .tl-arrow { opacity: 1; }

/* Fiche de suivi */
.followup label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 1rem; }
.followup select, .followup input, .followup textarea {
  display: block; width: 100%; margin-top: .35rem; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; background: var(--bg);
  resize: vertical;
}
.followup select:focus, .followup input:focus, .followup textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; background: var(--surface);
}
.form-foot { display: flex; align-items: center; gap: .8rem; }
.saved { color: var(--good); font-weight: 600; font-size: .85rem; }

/* Transcription */
.transcript { max-width: 820px; margin: 0 auto; }
.transcript-head { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.transcript-body { font-size: .96rem; }
.transcript-body h2, .transcript-body h3, .transcript-body h4 { margin: 1.4rem 0 .5rem; }
.transcript-body p { margin: .5rem 0; }
.transcript-body strong { color: var(--ink); }
.transcript-body ul { margin: .5rem 0; padding-left: 1.2rem; }

/* Login */
body.centered { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 2.4rem 2.2rem; box-shadow: var(--shadow); max-width: 360px; width: 100%; text-align: center;
}
.login-card h1 { margin: .6rem 0 .2rem; }
.login-card form { margin-top: 1.4rem; display: flex; flex-direction: column; gap: .7rem; }
.login-card input {
  font: inherit; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.error { color: var(--bad); font-size: .85rem; margin: .2rem 0 0; }

@media (max-width: 820px) {
  .cols { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 96px 1fr auto; }
}
