/* Astreinte 7G — même langage que la Bibliothèque, Sentinelle et le logiciel 7G :
   bleu 7G, Lexend, surfaces douces, coins arrondis, clair / sombre. Pensé d'abord pour le téléphone. */
@font-face { font-family: "Lexend"; src: url(/polices/lexend.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
:root {
  --bleu: #0C3D63; --bleu-2: #15507F;
  --bg: #EEF2F6; --surface: #FFFFFF; --surface2: #F4F7FA; --ink: #0E2233; --ink-soft: #43566A; --muted: #6B7D90;
  --line: #DDE4EC; --line-2: #C9D4DE; --accent: #0C3D63; --accent-doux: #DCE8F2;
  --vert: #1F8A55; --vert-doux: #DDF3E6; --rouge: #C23A3E; --rouge-doux: #FBE3E3; --orange: #B8741A; --orange-doux: #FBEEDB;
  --shadow: 0 1px 0 rgba(12,61,99,.04), 0 10px 24px -16px rgba(12,61,99,.30); --shadow-sm: 0 1px 2px rgba(12,61,99,.08);
  --r: 12px; --f: "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif; color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0A1724; --surface: #112233; --surface2: #0E1D2C; --ink: #E6EEF5; --ink-soft: #B6C4D2; --muted: #8FA2B4;
  --line: #1E3347; --line-2: #27405A; --accent: #8DC0EA; --accent-doux: #16304A; --vert: #4CC486; --vert-doux: #123325;
  --rouge: #F07378; --rouge-doux: #3A1A1D; --orange: #E3A450; --orange-doux: #35260F;
  --shadow: 0 1px 0 rgba(0,0,0,.25), 0 12px 26px -16px rgba(0,0,0,.7); --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  color-scheme: dark;
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--f); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid #2E6DA4; outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 19px; }
h3 { font-size: 14px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primaire { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.btn.primaire:hover { background: var(--bleu-2); }
.btn.rouge { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn.vert { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn.danger { color: var(--rouge); border-color: transparent; background: none; }
.btn.danger:hover { border-color: var(--rouge); }
.btn.petit { min-height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.grand { min-height: 52px; font-size: 16px; padding: 0 22px; border-radius: 14px; }
.btn.plein { width: 100%; }
input[type=text], input[type=search], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); outline: none; font-size: 16px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
label.champ { display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
label.coche { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
label.coche input { width: 18px; height: 18px; accent-color: var(--bleu); }
.grille { display: grid; gap: 12px; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .deux { grid-template-columns: 1fr; } }

/* connexion */
.connexion { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 16px;
  background: radial-gradient(120% 85% at 50% 0%, #17568A 0%, #0C3D63 45%, #061A2B 100%); color: #EAF2F9; }
.logo-grand { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(145deg, #E25A5E, #9E2327); box-shadow: 0 18px 36px -14px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.3); }
.logo-grand svg { width: 32px; height: 32px; stroke: #fff; }
.connexion h1 { margin: 6px 0 0; font-size: 24px; color: #fff; }
.connexion .sous { margin: -4px 0 8px; color: rgba(234,242,249,.7); font-size: 13px; text-align: center; }
.carte-connexion { width: 100%; max-width: 380px; display: grid; gap: 12px; padding: 22px; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 40px 80px -30px rgba(0,0,0,.55); }
.carte-connexion label { display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.erreur { color: var(--rouge); font-size: 13px; min-height: 1em; margin: 0; }
.aide { margin: 0; color: var(--muted); font-size: 12.5px; }

/* en-tête */
.entete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 18px; padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.marque { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(145deg, #E25A5E, #9E2327); }
.logo svg { stroke: #fff; width: 20px; height: 20px; }
.nom { display: grid; font-weight: 600; font-size: 15px; line-height: 1.1; }
.nom small { font-weight: 400; font-size: 11px; color: var(--muted); }
.onglets { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.onglets a { padding: 6px 13px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; }
.onglets a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.espace { flex: 1; }
.moi { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bleu); color: #fff; font-weight: 600; font-size: 12.5px; cursor: pointer; flex: none; }
html.dans-logiciel .moi { display: none; }
@media (max-width: 760px) {
  .entete { flex-wrap: wrap; gap: 10px; padding: 8px 12px; }
  .entete .onglets { order: 3; width: 100%; }
  .nom small { display: none; }
}

.principal { max-width: 1100px; margin: 0 auto; padding: 16px 16px 110px; display: grid; gap: 16px; }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.carte > h3 { margin-bottom: 10px; }
.titre-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.titre-ligne .espace { flex: 1; }
.vide { color: var(--muted); font-size: 13px; padding: 14px 4px; text-align: center; }
.bandeau { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.bandeau.alerte { background: var(--rouge-doux); color: var(--rouge); }
.bandeau.info { background: var(--accent-doux); color: var(--ink); }
.bandeau.attention { background: var(--orange-doux); color: var(--orange); }
.bandeau b { font-weight: 600; }

/* garde en cours */
.garde { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.garde .pastille { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--vert-doux); color: var(--vert); font-weight: 700; flex: none; }
.garde .pastille.vide { background: var(--rouge-doux); color: var(--rouge); }
.garde b { font-size: 16px; font-weight: 600; display: block; }
.garde small { color: var(--muted); }
.qui-liste { display: grid; gap: 10px; flex: 1; min-width: 220px; }

/* appels */
.appels { display: grid; gap: 8px; }
.appel { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px 12px 0; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; color: var(--ink); text-align: left; width: 100%; box-shadow: var(--shadow-sm); overflow: hidden; }
.appel:hover { border-color: var(--line-2); }
.appel .barre { align-self: stretch; background: var(--c, var(--line-2)); }
.appel b { font-weight: 600; display: block; }
.appel .meta { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appel .droite { display: grid; justify-items: end; gap: 4px; font-size: 12px; color: var(--muted); }
.statut { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--ink-soft); white-space: nowrap; }
.statut.nouveau, .statut.transmis { background: var(--rouge-doux); color: var(--rouge); }
.statut.pris, .statut.sur_place { background: var(--orange-doux); color: var(--orange); }
.statut.resolu { background: var(--vert-doux); color: var(--vert); }
.clignote { animation: clignote 1.4s ease-in-out infinite; }
@keyframes clignote { 50% { opacity: .45; } }

/* nouvel appel */
.resultats-site { display: grid; gap: 6px; margin-top: 8px; max-height: 320px; overflow: auto; }
.site-choix { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); cursor: pointer; text-align: left; width: 100%; color: var(--ink); }
.site-choix:hover, .site-choix.on { border-color: var(--accent); background: var(--accent-doux); }
.site-choix small { color: var(--muted); }
.site-retenu { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--accent-doux); }
.site-retenu div { flex: 1; min-width: 0; }
.categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cat { display: grid; gap: 4px; justify-items: start; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; text-align: left; color: var(--ink); font-weight: 500; min-height: 64px; }
.cat span { font-size: 20px; }
.cat.on { border-color: var(--bleu); background: var(--bleu); color: #fff; }
.qui-recoit { font-size: 13px; color: var(--ink-soft); }

/* détail */
.fiche-tete { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.fiche-tete h2 { flex: 1; min-width: 200px; }
.infos { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; font-size: 14px; }
.infos dt { color: var(--muted); }
.infos dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chrono { display: grid; gap: 0; }
.chrono .pas { display: grid; grid-template-columns: 74px 14px 1fr; gap: 10px; font-size: 13px; }
.chrono .pas time { color: var(--muted); text-align: right; padding-top: 1px; }
.chrono .pas i { position: relative; }
.chrono .pas i::before { content: ""; position: absolute; left: 3px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chrono .pas i::after { content: ""; position: absolute; left: 6px; top: 16px; bottom: -4px; width: 2px; background: var(--line); }
.chrono .pas:last-child i::after { display: none; }
.chrono .pas div { padding-bottom: 12px; }
.chrono .pas small { display: block; color: var(--muted); }

/* listes simples */
.lignes { display: grid; }
.ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.ligne:last-child { border-bottom: 0; }
.ligne b { font-weight: 500; display: block; }
.ligne small { color: var(--muted); display: block; }
.ligne.cliquable { cursor: pointer; }
.ligne.cliquable:hover b { color: var(--accent); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface2); color: var(--ink-soft); }
.tag.vert { background: var(--vert-doux); color: var(--vert); }
.tag.rouge { background: var(--rouge-doux); color: var(--rouge); }
.tag.orange { background: var(--orange-doux); color: var(--orange); }
.recherche { position: relative; }
.recherche svg { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.recherche input { padding-left: 42px; }

/* planning */
.semaine { display: grid; gap: 6px; }
.semaine + .semaine { margin-top: 14px; }
.garde-ligne { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px 10px 0; border-radius: 12px; background: var(--surface2); overflow: hidden; }
.garde-ligne .barre { align-self: stretch; background: var(--vert); }
.garde-ligne.renfort .barre { background: var(--orange); }
.garde-ligne.trou .barre { background: var(--rouge); }
.garde-ligne.trou { background: var(--rouge-doux); color: var(--rouge); }
.raccourcis { display: flex; gap: 6px; flex-wrap: wrap; }

/* chiffres */
table.tableau { width: 100%; border-collapse: collapse; font-size: 13px; }
.tableau th, .tableau td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tableau th:first-child, .tableau td:first-child { text-align: left; }
.tableau th { color: var(--muted); font-weight: 500; }
.defile { overflow-x: auto; }

/* fenêtre */
.voile { position: fixed; inset: 0; z-index: 50; background: rgba(6,20,33,.55); display: grid; place-items: center; padding: 16px; }
.fenetre { width: 100%; max-width: 440px; background: var(--surface); border-radius: 18px; padding: 20px; display: grid; gap: 12px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); max-height: 90dvh; overflow: auto; }
.qr { background: #fff; border-radius: 12px; padding: 12px; width: 220px; margin: 0 auto; }
.qr svg { width: 100%; height: auto; display: block; }
.lien-copie { font-size: 12px; word-break: break-all; color: var(--muted); text-align: center; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--surface);
  padding: 11px 16px; border-radius: 12px; font-size: 13.5px; transition: .25s; z-index: 60; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* pages publiques (déclaration, lien du technicien) */
.public { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 20px 16px 40px; gap: 14px; }
.public .tete { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 520px; }
.public .tete b { font-size: 17px; font-weight: 600; display: block; }
.public .tete small { color: var(--muted); }
.public .carte { width: 100%; max-width: 520px; }
.appeler { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 520px; min-height: 56px; border-radius: 14px; background: var(--rouge); color: #fff; font-weight: 600; font-size: 16px; }
.appeler svg { stroke: #fff; }
.merci { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 24px 8px; }
.merci .rond { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--vert-doux); color: var(--vert); }
.merci .rond svg { width: 32px; height: 32px; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* étiquettes à imprimer */
.etiquettes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8mm; padding: 10mm; background: #fff; color: #0E2233; }
.etiquette { border: 1.5px solid #0C3D63; border-radius: 4mm; padding: 5mm; display: grid; grid-template-columns: 34mm 1fr; gap: 5mm; align-items: center; break-inside: avoid; }
.etiquette .qr-e svg { width: 34mm; height: 34mm; display: block; }
.etiquette .rouge { color: #C23A3E; font-weight: 700; font-size: 15pt; line-height: 1.1; }
.etiquette .site { font-size: 9pt; color: #43566A; margin-top: 2mm; }
.etiquette .num { font-size: 14pt; font-weight: 700; margin-top: 2mm; }
.etiquette .code { font-size: 8pt; color: #6B7D90; margin-top: 2mm; }
.barre-impression { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
@media print { .barre-impression { display: none; } body { background: #fff; } @page { margin: 0; } }

/* QR : le dessin utilise des traits fins carrés, pas le style des icônes */
.qr svg, .qr-e svg { stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }
.garde-ligne small { display: block; color: var(--muted); margin-top: 2px; }
.garde-ligne.trou small { color: inherit; opacity: .85; }
.garde-ligne .tag { margin-left: 6px; vertical-align: 1px; }
