/* ============================================================
   ANNUAIRE TSA — Feuille de style
   Design chaleureux, rassurant, moderne
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --fond-page:   #F5F0EB;
  --fond:        #ffffff;
  --fond-2:      #F9F5F1;
  --fond-3:      #F5F0EB;
  --bordure:     #EDE6DC;
  --bordure-2:   #D4C9BE;
  --texte:       #2C2A27;
  --texte-2:     #7A7570;
  --texte-3:     #B8ADA2;
  --bleu:        #4A90D9;
  --bleu-fonce:  #2E6FAD;
  --bleu-clair:  #EEF5FC;
  --vert-bg:     #EEF7EC;
  --vert-txt:    #2D6B3A;
  --amber-bg:    #FEF3E2;
  --amber-txt:   #8A5A0A;
  --rouge-bg:    #FDEDED;
  --rouge-txt:   #9B2C2C;
  --rayon:       10px;
  --rayon-lg:    16px;
  --rayon-xl:    20px;
  --max:         680px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond-page);
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- TOPBAR ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--fond);
  border-radius: var(--rayon-xl);
  margin: 20px 0 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  gap: 12px;
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--texte);
  letter-spacing: -0.3px;
  text-decoration: none;
}
.topbar-title img {
  width: 32px;
  height: 25px;
  flex-shrink: 0;
}
.topbar-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- BOUTONS ---- */
.btn {
  padding: 7px 14px;
  border-radius: var(--rayon);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--bordure-2);
  background: var(--fond);
  color: var(--texte-2);
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--fond-3); border-color: #B8ADA2; }
.btn-accent { border-color: var(--bleu); color: var(--bleu-fonce); background: var(--bleu-clair); }
.btn-accent:hover { background: #DDE9F7; }
.btn-admin { font-size: 11px; color: var(--texte-3); border-color: #E8E2DB; }
.btn-primary { background: var(--bleu-clair); border-color: var(--bleu); color: var(--bleu-fonce); font-weight: 500; }
.btn-primary:hover { background: #DDE9F7; }

/* ---- HERO ---- */
.hero {
  background: var(--fond);
  border-radius: var(--rayon-xl);
  padding: 28px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--bordure);
}
.hero-title { font-size: 22px; font-weight: 700; color: var(--texte); margin-bottom: 8px; letter-spacing: -0.5px; }
.hero-sub { font-size: 14px; color: var(--texte-2); line-height: 1.7; max-width: 520px; }

/* ---- STATS ---- */
.stats { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.stat { font-size: 12px; color: var(--texte-3); display: flex; align-items: center; gap: 5px; }
.stat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bleu); flex-shrink: 0; }

/* ---- RECHERCHE ---- */
.search-wrap { margin-top: 18px; position: relative; display: flex; gap: 8px; }
.search-wrap input {
  flex: 1;
  padding: 12px 16px 12px 42px;
  border: 1.5px solid var(--bordure-2);
  border-radius: var(--rayon-lg);
  font-size: 15px;
  font-family: inherit;
  background: var(--fond);
  color: var(--texte);
  outline: none;
  transition: border-color 0.15s;
}
.search-wrap input:focus { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(74,144,217,0.1); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texte-3); pointer-events: none; }

/* ---- FILTRES ---- */
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.pill {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--bordure-2);
  font-size: 13px;
  color: var(--texte-2);
  cursor: pointer;
  background: var(--fond);
  transition: all 0.15s;
  font-family: inherit;
}
.pill:hover { background: var(--fond-3); border-color: #B8ADA2; }
.pill.on { background: var(--bleu-clair); border-color: var(--bleu); color: var(--bleu-fonce); font-weight: 500; }

/* ---- COMPTEUR ---- */
.results-count { font-size: 12px; color: var(--texte-3); margin-bottom: 12px; }

/* ---- CARTES ---- */
.card {
  background: var(--fond);
  border: 1.5px solid var(--bordure);
  border-radius: var(--rayon-lg);
  padding: 18px;
  margin-bottom: 12px;
  transition: all 0.2s;
}
.card:hover { border-color: var(--bleu); box-shadow: 0 4px 12px rgba(74,144,217,0.1); transform: translateY(-1px); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.card-name { font-weight: 600; font-size: 15px; color: var(--texte); }
.card-meta { font-size: 13px; color: var(--texte-2); margin-top: 2px; }
.card-dept { font-size: 11px; color: var(--texte-3); background: var(--fond-3); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }

/* ---- TAGS ---- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 11px; padding: 3px 10px; border-radius: 6px; font-weight: 500; }
.tag-blue  { background: var(--bleu-clair); color: var(--bleu-fonce); }
.tag-green { background: var(--vert-bg);    color: var(--vert-txt); }
.tag-amber { background: var(--amber-bg);   color: var(--amber-txt); }
.tag-red   { background: var(--rouge-bg);   color: var(--rouge-txt); }

/* ---- SÉPARATEUR CARTE ---- */
.card-divider { height: 1px; background: var(--fond-3); margin: 12px 0; }
.card-tel {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--bleu-fonce);
  text-decoration: none; font-weight: 500;
}
.card-tel:hover { text-decoration: underline; }

/* ---- BOUTON SUGGÉRER ---- */
.suggest-btn {
  display: block; text-align: center; padding: 13px;
  border: 2px dashed #C8D9EE; border-radius: var(--rayon-lg);
  font-size: 13px; color: var(--bleu); cursor: pointer;
  margin-top: 8px; background: transparent;
  width: 100%; font-family: inherit; transition: all 0.15s;
  text-decoration: none;
}
.suggest-btn:hover { background: var(--bleu-clair); border-color: var(--bleu); }

/* ---- PAGE TITRE ---- */
.page-header { padding: 20px 0 16px; border-bottom: 1px solid var(--bordure); margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--texte); letter-spacing: -0.3px; }
.page-sub { font-size: 14px; color: var(--texte-2); margin-top: 4px; line-height: 1.6; }

/* ---- FORMULAIRES ---- */
.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: 11px; font-weight: 600; color: var(--texte-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--bordure);
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--texte-2); margin-bottom: 5px; font-weight: 500; }
.field input,
.field select,
.field textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--bordure-2);
  border-radius: var(--rayon);
  font-size: 14px; font-family: inherit;
  background: var(--fond); color: var(--texte); outline: none;
  transition: border-color 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(74,144,217,0.08); }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-note { font-size: 12px; color: var(--texte-3); font-weight: 400; }

/* ---- PILLS CHECKBOX ---- */
.check-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.check-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1.5px solid var(--bordure-2);
  border-radius: 99px; cursor: pointer; font-size: 13px;
  color: var(--texte-2); user-select: none; transition: all 0.15s;
}
.check-pill input { display: none; }
.check-pill.on { background: var(--bleu-clair); border-color: var(--bleu); color: var(--bleu-fonce); font-weight: 500; }

/* ---- NOTICE ---- */
.notice {
  background: var(--fond-2); border: 1px solid var(--bordure);
  border-radius: var(--rayon); padding: 10px 14px;
  font-size: 13px; color: var(--texte-2); line-height: 1.6; margin-bottom: 20px;
}
.notice-error { border-color: #F5A8A8; background: var(--rouge-bg); color: var(--rouge-txt); }

/* ---- ACTIONS FORMULAIRE ---- */
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---- PIED DE PAGE ---- */
.footer {
  margin-top: 40px; padding: 16px 0 28px;
  border-top: 1px solid var(--bordure);
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 8px;
}
.footer-note { font-size: 11px; color: var(--texte-3); }
.footer-links { display: flex; gap: 14px; }
.footer-link {
  font-size: 12px; color: var(--texte-2);
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; background: none; border: none; font-family: inherit;
}
.footer-link:hover { color: var(--bleu-fonce); }

/* ---- VIDE ---- */
.empty { text-align: center; padding: 40px; font-size: 14px; color: var(--texte-3); }

/* ---- RESPONSIVE MOBILE ---- */
@media (max-width: 520px) {
  .topbar { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .topbar-right { width: 100%; }
  .btn { font-size: 12px; padding: 6px 10px; }
  .field-row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; text-align: center; }
  .footer { flex-direction: column; align-items: flex-start; }
  .stats { flex-direction: column; gap: 4px; }
  .card-tel { font-size: 15px; }
  .hero { padding: 20px 16px; }
}
