/* Feuille de style du CRM courtage — aucune ressource extérieure (fonctionnement hors ligne) */
:root {
  --encre: #1d2733;
  --encre-douce: #5a6675;
  --fond: #f5f6f8;
  --carte: #ffffff;
  --bordure: #d8dde4;
  --marine: #1f3a5f;
  --accent: #2f6fb0;
  --vert: #2e7d4f;
  --bleu: #2f6fb0;
  --orange: #b86b00;
  --rouge: #b3261e;
  --gris: #7a8591;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", system-ui, sans-serif; color: var(--encre); background: var(--fond); }
main { padding: 16px 24px 48px; max-width: 1600px; margin: 0 auto; }
h1 { font-size: 22px; margin: 8px 0 12px; }
h2 { font-size: 17px; margin: 24px 0 8px; display: flex; align-items: center; gap: 12px; }
h3 { font-size: 15px; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
a { color: var(--accent); }
small, .aide { color: var(--encre-douce); font-size: 12px; }
.aide { margin: 4px 0; }
.code { font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.selection { user-select: all; }

/* Barre du haut */
.barre { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--marine); color: #fff; position: sticky; top: 0; z-index: 10; }
.barre .marque { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.barre .marque span { font-weight: 400; opacity: .75; margin-left: 6px; }
.barre nav { display: flex; gap: 18px; flex: 1; flex-wrap: wrap; }
.barre nav a { color: #fff; text-decoration: none; opacity: .9; }
.barre nav a:hover { opacity: 1; text-decoration: underline; }
.quitter { background: #fff; color: var(--marine); }

/* Boutons */
button, .bouton { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 4px; font: inherit; cursor: pointer; text-decoration: none; }
button:hover, .bouton:hover { filter: brightness(1.08); }
.secondaire { background: #fff; color: var(--accent); }
.petit { padding: 2px 10px; font-size: 13px; font-weight: 400; }
button.lien { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
.lien.danger { color: var(--rouge); }
.en-ligne { display: inline; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; width: 100%; }
.actions-ligne { white-space: nowrap; }
.actions-ligne > * { margin-left: 8px; }

/* Messages */
.message { padding: 8px 12px; border-radius: 4px; border: 1px solid; }
.message.succes { background: #eaf5ee; border-color: #b9dcc5; color: var(--vert); }
.message.erreur { background: #fbeceb; border-color: #efc2bf; color: var(--rouge); }

/* Filtres */
.filtres { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--carte); border: 1px solid var(--bordure); border-radius: 6px; padding: 12px; }
.filtre { display: flex; flex-direction: column; font-size: 12px; color: var(--encre-douce); gap: 2px; }
.filtre.large { flex: 1 1 280px; }
.filtre.case { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--encre); }
input[type=text], input[type=date], select, textarea { font: inherit; padding: 5px 7px; border: 1px solid var(--bordure); border-radius: 4px; background: #fff; color: var(--encre); }
.filtre select, .filtre input { min-width: 130px; }

/* Tuiles d'accueil */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tuile { margin: 0; }
.tuile button, a.tuile { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; background: var(--carte); color: var(--encre); border: 1px solid var(--bordure); border-radius: 6px; text-align: left; text-decoration: none; }
.tuile strong { font-size: 30px; color: var(--marine); }
.tuile.alerte strong { color: var(--rouge); }
.bouton-prospect { display: block; width: fit-content; margin: 4px 0 16px; padding: 16px 32px; font-size: 20px; font-weight: 700; border-radius: 6px; }

/* Tableaux */
.defilement { overflow-x: auto; }
table.liste { width: 100%; border-collapse: collapse; background: var(--carte); border: 1px solid var(--bordure); }
.liste th, .liste td { padding: 6px 8px; border-bottom: 1px solid var(--bordure); text-align: left; vertical-align: top; }
.liste thead th { background: #eef1f5; font-weight: 600; }
.liste tbody tr:nth-child(even) { background: #fafbfc; }
.liste tbody tr:hover { background: #eef4fb; }
.nombre { text-align: right !important; white-space: nowrap; }
.vide { color: var(--encre-douce); font-style: italic; }
.depassee { color: var(--rouge); font-weight: 600; }
.texte-long { white-space: pre-wrap; max-width: 600px; }
tr.inactive td { color: var(--gris); }
.pagination { display: flex; gap: 12px; color: var(--encre-douce); margin: 10px 0; }

/* Pastilles */
.pastille { display: inline-block; padding: 0 7px; border-radius: 10px; font-size: 12px; background: #e6e9ee; color: var(--encre); white-space: nowrap; font-weight: 400; }
.pastille.verte { background: #e1f1e7; color: var(--vert); }
.pastille.bleue { background: #e3edf8; color: var(--bleu); }
.pastille.orange { background: #fbefdc; color: var(--orange); }
.pastille.grise { background: #eceef1; color: var(--gris); }
.pastille.rouge { background: #fbeceb; color: var(--rouge); }

/* Contrôles de cohérence */
.alertes { background: #fff8ec; border: 1px solid #efd3a3; border-radius: 6px; padding: 10px 14px; margin: 10px 0; }
.alertes ul { margin: 6px 0; padding-left: 18px; }
.alertes li { margin: 3px 0; }
.synthese { max-width: 900px; margin-bottom: 8px; }
tr.selection-regle td { background: #e3edf8 !important; font-weight: 600; }
.marquer-vue { display: flex; gap: 6px; align-items: center; }
.marquer-vue input[type=text] { min-width: 180px; }

/* Données publiques */
.message.info { background: #eef4fb; border-color: #c5d9ef; color: var(--bleu); }
.bandeau-veille { background: var(--carte); border: 1px solid var(--bordure); border-radius: 6px; padding: 8px 12px; }
.alerte-bodacc { background: #fbeceb; border: 1px solid #efc2bf; border-radius: 6px; padding: 10px 14px; margin: 10px 0; }
button[disabled] { opacity: .5; cursor: not-allowed; }
h3 { margin-top: 18px; }

/* Connexion et compte */
.boite-connexion { max-width: 440px; margin: 40px auto; background: var(--carte); border: 1px solid var(--bordure); border-radius: 8px; padding: 20px 24px; }
.formulaire-simple { display: flex; flex-direction: column; gap: 6px; max-width: 440px; }
.formulaire-simple button { margin-top: 10px; align-self: flex-start; }
input[type=password] { font: inherit; padding: 5px 7px; border: 1px solid var(--bordure); border-radius: 4px; background: #fff; color: var(--encre); }
.lien-nav { background: none; border: none; color: #fff; padding: 0; font: inherit; cursor: pointer; opacity: .9; }
.lien-nav:hover { text-decoration: underline; filter: none; }
.bouton-menu { display: none; }
a[href^="tel:"], a[href^="mailto:"] { white-space: nowrap; }

/* Téléphone et petite tablette */
@media (max-width: 760px) {
  body { font-size: 15px; }
  main { padding: 12px 12px 48px; }
  h1 { font-size: 20px; }
  h2 { flex-wrap: wrap; }
  .barre { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .barre .marque span { display: none; }
  .bouton-menu { display: inline-block; margin-left: auto; background: transparent; border: 1px solid rgba(255, 255, 255, .7); }
  .form-quitter { order: 2; }
  .barre nav { display: none; order: 3; width: 100%; flex-direction: column; gap: 0; }
  body.menu-ouvert .barre nav { display: flex; }
  .barre nav a, .barre nav .lien-nav { display: block; width: 100%; text-align: left; padding: 12px 4px; font-size: 16px;
                                       border-top: 1px solid rgba(255, 255, 255, .15); }
  /* Champs à 16 px : le téléphone ne zoome pas automatiquement sur la saisie */
  input[type=text], input[type=date], input[type=password], select, textarea { font-size: 16px; width: 100%; }
  button, .bouton { padding: 10px 16px; font-size: 15px; }
  .petit { padding: 6px 12px; font-size: 14px; }
  .filtres { flex-direction: column; align-items: stretch; }
  .filtre select, .filtre input { min-width: 0; }
  .filtre.case { font-size: 15px; }
  .tuiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tuile button, a.tuile { padding: 12px; }
  .tuile strong { font-size: 24px; }
  .bouton-prospect { width: 100%; text-align: center; font-size: 18px; }
  .entete-fiche, .entete-carte { flex-direction: column; align-items: stretch; }
  .entete-carte > div { flex-wrap: wrap; }
  .details { grid-template-columns: 1fr; }
  .formulaire fieldset { grid-template-columns: 1fr; padding: 10px; }
  .sommaire { gap: 10px; }
  /* Tableaux présentés en fiches */
  table.liste { border: none; background: transparent; }
  table.liste, .liste thead, .liste tbody, .liste tr, .liste td { display: block; width: 100%; }
  .liste thead { display: none; }
  .liste tr { background: var(--carte); border: 1px solid var(--bordure); border-radius: 6px; margin-bottom: 10px; padding: 8px 12px; }
  .liste tbody tr:nth-child(even), .liste tbody tr:hover { background: var(--carte); }
  .liste td { border: none; padding: 3px 0; text-align: left !important; white-space: normal; }
  .liste td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--encre-douce);
                                  text-transform: uppercase; letter-spacing: .02em; }
  .liste td:empty { display: none; }
  .defilement { overflow-x: visible; }
  .actions-ligne { white-space: normal; padding-top: 6px !important; }
  .actions-ligne > * { margin: 0 14px 0 0; }
  .texte-long { max-width: none; }
  .marquer-vue { flex-direction: column; align-items: stretch; }
  .ajout { flex-direction: column; }
  .pagination { flex-wrap: wrap; }
  .boite-connexion { margin: 16px auto; padding: 16px; }
  .formulaire-simple button { align-self: stretch; }
}

/* Fiche client */
.entete-fiche { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sous-titre { color: var(--encre-douce); margin: 0 0 8px; }
.sommaire { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0; padding: 8px 0; border-bottom: 1px solid var(--bordure); }
section { scroll-margin-top: 60px; }
.carte { background: var(--carte); border: 1px solid var(--bordure); border-radius: 6px; padding: 12px; margin-bottom: 14px; scroll-margin-top: 60px; }
.entete-carte { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.entete-carte > div { display: flex; gap: 10px; align-items: center; }
.details { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; margin: 0 0 10px; }
.details dt { font-size: 12px; color: var(--encre-douce); }
.details dd { margin: 0; }

/* Formulaires */
.formulaire fieldset { background: var(--carte); border: 1px solid var(--bordure); border-radius: 6px; margin: 0 0 14px; padding: 12px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 20px; }
.formulaire legend { font-weight: 600; padding: 0 6px; }
.champ { display: flex; flex-direction: column; gap: 3px; }
.champ label { font-size: 13px; }
.champ-case { justify-content: flex-end; }
.champ textarea { min-height: 110px; }
.formulaire fieldset:has(textarea) { grid-template-columns: 1fr; }
.requis { color: var(--rouge); }
.en-erreur input, .en-erreur select, .en-erreur textarea { border-color: var(--rouge); background: #fff7f6; }
.erreur-champ { color: var(--rouge); font-size: 12px; margin: 0; }
.ajout { display: flex; gap: 8px; margin-top: 8px; }

/* Page d'arrêt */
.au-revoir { max-width: 640px; margin: 80px auto; background: var(--carte); border: 1px solid var(--bordure); border-radius: 6px; padding: 24px 32px; }
