/* Design commun des 3 pages du dashboard (module 9). Jetons de design en haut : ne pas mettre de couleur en dur dans les pages. */
:root {
  --fond: #f4f5f8; --surface: #fff; --surface-2: #f8f9fb; --bord: #e3e6ec; --bord-fort: #c9ced8;
  --texte: #161a23; --texte-2: #4b5363; --texte-3: #6b7383;
  --primaire: #4338ca; --primaire-fonce: #3730a3; --primaire-pale: #eef0ff;
  --ok: #15803d; --ok-pale: #e7f6ec; --attente: #b45309; --attente-pale: #fdf1dc; --ko: #b91c1c; --ko-pale: #fdeaea; --neutre: #4b5363; --neutre-pale: #eceef3;
  --wa: #128c4a; --wa-incertain: #b45309;
  --r: 10px; --r-sm: 7px; --ombre: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.06);
  --police: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--police); font-size: 15px; line-height: 1.5; color: var(--texte); background: var(--fond); -webkit-font-smoothing: antialiased; }
a { color: var(--primaire); }
small { color: var(--texte-3); font-size: 13px; }
code { background: var(--neutre-pale); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }

/* ---- Barre du haut : marque, onglets, connexion (identique sur les 3 pages) */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 0 20px; min-height: 56px; background: var(--surface); border-bottom: 1px solid var(--bord); }
.marque { font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--texte); white-space: nowrap; }
.marque::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--primaire); margin-right: 8px; }
nav.onglets { display: flex; gap: 4px; align-self: stretch; }
nav.onglets a { display: flex; align-items: center; padding: 0 14px; min-height: 44px; text-decoration: none; color: var(--texte-2); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav.onglets a:hover { color: var(--texte); background: var(--surface-2); }
nav.onglets a[aria-current=page] { color: var(--primaire); border-bottom-color: var(--primaire); font-weight: 600; }
#connexion { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* ---- Contrôles */
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], select {
  font: inherit; font-size: 14px; color: var(--texte); background: var(--surface); border: 1px solid var(--bord-fort); border-radius: var(--r-sm); padding: 8px 10px; min-height: 40px; max-width: 100%;
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--primaire); outline-offset: 0; border-color: var(--primaire); }
button, .btn {
  font: inherit; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--bord-fort); border-radius: var(--r-sm); background: var(--surface); color: var(--texte); text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
button:hover:not(:disabled), .btn:hover { background: var(--surface-2); border-color: var(--texte-3); }
button:disabled { cursor: not-allowed; opacity: .5; }
.primaire { background: var(--primaire); border-color: var(--primaire); color: #fff; }
.primaire:hover:not(:disabled) { background: var(--primaire-fonce); border-color: var(--primaire-fonce); }
.danger { color: var(--ko); border-color: #efb4b4; }
.danger:hover:not(:disabled) { background: var(--ko-pale); border-color: var(--ko); }
.petit { min-height: 34px; padding: 0 10px; font-size: 13px; }
label { font-size: 13px; font-weight: 500; color: var(--texte-2); }

/* ---- Messages */
#msg { margin: 12px 0; font-size: 14px; color: var(--texte-2); white-space: pre-wrap; }
#msg:empty { display: none; }
#msg.err, .err { color: var(--ko); }
#msg.err { background: var(--ko-pale); border: 1px solid #f3c2c2; border-radius: var(--r-sm); padding: 10px 12px; }

/* ---- Mise en page des pages à contenu */
main { max-width: 1120px; margin: 0 auto; padding: 8px 20px 48px; }
.entete-page { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin: 20px 0 4px; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); margin: 28px 0 10px; }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r); box-shadow: var(--ombre); }
.defile { overflow-x: auto; }
.champ { display: flex; flex-direction: column; gap: 4px; }

/* ---- Pastilles de statut : couleur + texte (jamais la couleur seule) */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.nouveau, .a_scanner { background: var(--neutre-pale); color: var(--neutre); }
.contacte, .en_cours { background: var(--attente-pale); color: var(--attente); }
.accepte, .scannee { background: var(--ok-pale); color: var(--ok); }
.refuse { background: var(--ko-pale); color: var(--ko); }
.v { color: var(--ok); } .r { color: var(--ko); } .o { color: var(--attente); }

/* ---- Tableaux */
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--bord); }
th { background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--texte-3); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--bord-fort); border-bottom: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 720px) { html, body { overflow-x: hidden; } table { min-width: 640px; } nav.onglets { overflow-x: auto; } #connexion { margin-left: 0; width: 100%; } #connexion input { flex: 1; } .topbar { padding: 0 12px; } main { padding: 8px 12px 40px; } nav.onglets a { padding: 0 10px; } }
