/* Charte graphique GR TELECOM : bleu #0033A0, vert #4B8B8A, gris #A9A9A9 / #444444, blanc */
:root {
  --primary: #0033A0;
  --primary-dark: #002270;
  --primary-soft: #e6ecf7;
  --accent: #4B8B8A;
  --accent-soft: #e4efef;
  --grey: #A9A9A9;
  --bg: #f5f6f7;
  --card: #ffffff;
  --text: #444444;
  --muted: #6e6e6e;
  --border: #e2e2e2;
  --danger: #b3261e;
  --ok: #4B8B8A;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.4;
  padding-bottom: env(safe-area-inset-bottom);
}
[hidden] { display: none !important; }

/* Barre du haut : logo, menu principal, compte */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  background: #fff; color: var(--text); padding: 0 20px; padding-top: env(safe-area-inset-top); min-height: 62px;
  box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(16,24,40,.05);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--primary); font-weight: 700; text-decoration: none; font-size: 17px; flex: 0 0 auto; }
.brand img { height: 34px; width: auto; }
.brand small { display: block; color: var(--accent); font-weight: 600; font-size: 10px; letter-spacing: .1em; }
.menu { display: flex; gap: 2px; flex: 1; align-self: stretch; }
.menu a { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px;
  border-bottom: 3px solid transparent; margin-bottom: -3px; position: relative; z-index: 1; transition: color .15s, background .15s; }
.menu a:hover { color: var(--primary); background: #f7f9fc; }
.menu a.active { color: var(--primary); border-bottom-color: var(--primary); }
.menu svg, .compte svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.compte { position: relative; flex: 0 0 auto; }
.compte-btn { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; cursor: pointer; font: inherit; color: var(--text); }
.compte-btn:hover, .compte-btn[aria-expanded="true"] { border-color: var(--primary); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; letter-spacing: .02em; flex: 0 0 auto; }
.compte-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.compte-txt b { font-size: 13px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compte-txt small { font-size: 11px; color: var(--muted); }
.compte .chevron { width: 16px; height: 16px; color: var(--muted); }
.compte-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 270px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 16px 36px rgba(16,24,40,.16); padding: 8px; z-index: 40; }
.compte-entete { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.compte-entete span { font-size: 12px; color: var(--muted); word-break: break-all; }
.compte-entete .role { align-self: flex-start; margin-top: 6px; padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 11px; }
.compte-titre { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 2px 10px 6px; }
.compte-menu .affichage { margin: 0 10px 10px; }
.compte-menu .affichage button { flex: 1; padding: 8px 6px; }
.compte-quitter { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-top: 1px solid var(--border);
  background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--danger); cursor: pointer; }
.compte-quitter:hover { background: #fbe4e2; border-radius: 8px; }
.btn-link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 14px; }

#offline-banner { background: #fff3cd; color: #7a5b00; padding: 8px 16px; font-size: 14px; text-align: center; }

main { max-width: 900px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 180px; }
.row > .badge, .row > h1 { flex: 0 0 auto; }
.spacer { flex: 1; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff; cursor: pointer; text-decoration: none; min-height: 44px;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.secondary { background: #fff; color: var(--primary); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: 14px; }
.btn.block { width: 100%; }

.login { max-width: 380px; margin: 10vh auto 0; }
.login .logo { text-align: center; margin-bottom: 16px; }
.login .logo img { width: 240px; max-width: 80%; height: auto; }
.login .logo h1 { color: var(--primary); margin: 12px 0 0; }
.login { border-top: 4px solid var(--primary); }

.site-list { list-style: none; padding: 0; margin: 0; }
.site-list li a {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; color: inherit; text-decoration: none;
}
.site-list .code { font-weight: 700; }
.site-list .sub { color: var(--muted); font-size: 13px; }
.progress { height: 6px; background: #e6ebf0; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--ok); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge[data-s="En cours"]    { background: var(--primary-soft); color: var(--primary); }
.badge[data-s="Bloqué"]      { background: #fbe4e2; color: var(--danger); }
.badge[data-s="Réceptionné"] { background: var(--accent-soft); color: #2f6463; }
.badge[data-s="Terminé"]     { background: var(--accent); color: #fff; }
.badge[data-s="Facturé"]     { background: var(--primary); color: #fff; }

.gps { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gps .coords { font-family: ui-monospace, monospace; font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Items BOQ du site en cartes sur mobile */
.items { list-style: none; padding: 0; margin: 0; }
.items li { border-bottom: 1px solid var(--border); padding: 12px 0; }
.items li:last-child { border-bottom: 0; }
.items .head { display: flex; gap: 8px; align-items: flex-start; }
.items .des { flex: 1; }
.items .des b { color: var(--primary); }
.items .qty { display: flex; gap: 16px; font-size: 14px; margin-top: 6px; flex-wrap: wrap; }
.items .qty span b { font-weight: 700; }

dialog { border: 0; border-radius: 14px; padding: 20px; width: min(92vw, 440px); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff;
  padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: 90vw; font-size: 14px;
}
#toast.error { background: var(--danger); }

.empty { text-align: center; color: var(--muted); padding: 24px; }
.totals { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.totals div b { display: block; font-size: 18px; }

/* Photos chambre : grandes miniatures */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
@media (max-width: 600px) { .photos { grid-template-columns: 1fr; } }
.photos figure { margin: 0; }
.photos button { display: block; width: 100%; padding: 0; border: 0; background: #e6ebf0; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photos figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }

dialog.lightbox { width: 96vw; max-width: 1200px; padding: 0; background: #111; color: #fff; }
dialog.lightbox img { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: #000; }
.lb-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; font-size: 13px; }
.lb-bar .spacer { flex: 1; }


/* Informations de chaque site dans la liste */
.site-list .infos { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 13px; }
.site-list .infos span { display: flex; flex-direction: column; }
.site-list .infos small { color: var(--muted); font-size: 11px; }
#totaux-sites { margin-bottom: 12px; padding: 12px 16px; }

h1, h2 { color: var(--primary); font-weight: 700; }
a { color: var(--primary); }
.items .des b { color: var(--accent); }
.totals div b { color: var(--primary); }
#offline-banner { background: var(--accent-soft); color: #2f6463; }


/* Points GPS du tracé */
.points { margin: 0; padding: 0; list-style: none; }
.points li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pt-num { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.points .coords { font-size: 12px; }
.pt-actions { display: flex; gap: 4px; }

/* Carte du trajet */
dialog.carte-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border-radius: 0; display: flex; flex-direction: column; }
dialog.carte-dialog:not([open]) { display: none; }
.carte-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 3px solid var(--accent); font-size: 14px; }
.carte-bar b { color: var(--primary); }
#carte { flex: 1; min-height: 300px; }
.pin { background: none; border: 0; }
.leaflet-tooltip.pin-label { background: transparent; border: 0; box-shadow: none; color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; }
.leaflet-tooltip.pin-label::before { display: none; }

/* Boutons d'affichage PC / Tablette / Phone */
.affichage { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.affichage button { font: inherit; font-size: 12px; font-weight: 600; padding: 5px 8px; border: 0; background: #fff; color: var(--muted); cursor: pointer; white-space: nowrap; }
.affichage button + button { border-left: 1px solid var(--border); }
.affichage button.active { background: var(--primary); color: #fff; }

html[data-affichage="pc"] main { max-width: 1280px; }
html[data-affichage="pc"] .site-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 0 12px; }
html[data-affichage="pc"] .photos { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

html[data-affichage="tablette"], html[data-affichage="phone"] { background: #dfe2e6; }
html[data-affichage="tablette"] body { max-width: 820px; margin: 0 auto; min-height: 100vh; }
html[data-affichage="tablette"] .photos { grid-template-columns: repeat(2, 1fr); }

html[data-affichage="phone"] body { max-width: 430px; margin: 0 auto; min-height: 100vh; }
html[data-affichage="phone"] main { padding: 12px; }
html[data-affichage="phone"] .photos { grid-template-columns: 1fr; }
html[data-affichage="phone"] .row > * { flex-basis: 100%; }

/* Ajout d'items BOQ en bloc */
dialog.dialog-large { width: min(96vw, 720px); }
.bloc-outils { margin-bottom: 8px; }
.bloc-outils .bloc-tout { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; margin: 0; font-size: 14px; color: var(--text); }
.bloc-outils .bloc-tout input, .bloc-liste input[type=checkbox] { width: 20px; height: 20px; flex: 0 0 auto; }
.bloc-liste { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.bloc-liste li { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.bloc-liste li:last-child { border-bottom: 0; }
.bloc-liste li:has(:checked) { background: var(--primary-soft); }
.bloc-liste label { flex: 1; display: flex; gap: 8px; align-items: center; margin: 0; font-size: 14px; color: var(--text); cursor: pointer; }
.bloc-liste label b { color: var(--accent); }
.bloc-liste input[type=number] { flex: 0 0 110px; width: 110px; padding: 8px; }

/* Sections photos repliables */
.section-tete { margin-bottom: 12px; }
.pli { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.pli .fleche { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 16px; transition: transform .2s; }
.replie .pli .fleche { transform: rotate(-90deg); }
.replie .section-tete { margin-bottom: 0; }
.replie .photos, .replie .pliable { display: none; }

/* Informations du site en lecture seule (avant « Modifier ») */
#f-site.lecture input, #f-site.lecture select, #f-site.lecture textarea {
  background: #f7f8fa; color: var(--text); -webkit-text-fill-color: var(--text); opacity: 1; border-color: transparent; }
#f-site.lecture select { appearance: none; }
.actions-site { display: flex; gap: 8px; justify-content: flex-end; }

/* Date de mise à jour de la quantité réalisée */
.items .maj { font-size: 11px; margin-top: 4px; }

/* Détail des montants d'un site */
.detail-liste { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.detail-liste li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.d-titre { font-size: 14px; margin-bottom: 4px; }
.d-titre b { color: var(--accent); }
.d-calc { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; font-size: 14px; align-items: baseline; }
.d-calc span:nth-child(2) { color: var(--muted); }
.d-calc b { white-space: nowrap; }
.d-total { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-end; padding: 12px 0 0; border-top: 2px solid var(--primary); margin-top: -1px; }
.d-total div { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.d-total b { color: var(--primary); font-size: 18px; }
.alerte { color: var(--danger); font-weight: 600; }

/* Icônes des boutons Modifier / Ajouter / Supprimer (SVG en masque, couleur du texte) */
.i-edit { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E"); }
.i-add  { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.i-del  { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E"); }
.i-edit::before, .i-add::before, .i-del::before {
  content: ''; display: inline-block; width: 1.05em; height: 1.05em; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.lien-ico { display: inline-flex; align-items: center; gap: 4px; }

/* Icône seule (le texte reste lu par les lecteurs d'écran et sert d'info-bulle) */
.btn.i-edit, .btn.i-add, .btn.i-del { font-size: 0; gap: 0; padding: 0; width: 44px; min-width: 44px; flex: 0 0 auto; }
.btn.small.i-edit, .btn.small.i-add, .btn.small.i-del { width: 34px; min-width: 34px; }
.btn.i-edit::before, .btn.i-add::before, .btn.i-del::before { width: 18px; height: 18px; }
.btn.small.i-edit::before, .btn.small.i-add::before, .btn.small.i-del::before { width: 16px; height: 16px; }
.items .qty .btn { vertical-align: middle; margin-left: 4px; min-height: 30px; width: 30px; min-width: 30px; }
.items .qty > span { display: inline-flex; align-items: center; gap: 4px; }
.btn-photo { width: 40px; min-width: 40px; padding: 0; font-size: 18px; }

/* Coordonnées du point + bouton « Ma position » */
.coords-saisie { display: flex; flex-wrap: wrap; gap: 8px; }
.coords-saisie input { flex: 1 1 210px; min-width: 0; }
.coords-saisie .btn { flex: 1 0 auto; padding: 0 12px; white-space: nowrap; }
#pt-precision:empty { display: none; }

/* Tableau de bord */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.kpi:hover { border-color: var(--primary); }
.kpi small { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 22px; }
.kpi b { font-size: 28px; color: var(--primary); line-height: 1; }
.legende { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.legende span, .g-tip span { display: inline-flex; align-items: center; gap: 6px; }
.legende i, .g-tip i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.graphe { list-style: none; margin: 0 0 8px; padding: 0; }
.graphe li { display: grid; grid-template-columns: minmax(80px, 34%) 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0f1f3; }
.graphe li:last-child { border-bottom: 0; }
.g-nom { font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-barres { display: flex; flex-direction: column; gap: 2px; cursor: default; }
.g-barres > div { display: flex; align-items: center; gap: 6px; min-height: 12px; }
.barre { display: block; height: 10px; border-radius: 0 4px 4px 0; flex: 0 0 auto; }
.g-val { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-tip { position: absolute; z-index: 30; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.12); font-size: 13px; pointer-events: none; }

/* Téléphone : le menu devient une barre d'onglets en bas de l'écran */
@media (max-width: 700px) {
  .topbar { gap: 10px; padding: 0 12px; padding-top: env(safe-area-inset-top); min-height: 56px; }
  .brand { margin-right: auto; }
  .compte-txt, .compte .chevron { display: none; }
  .compte-btn { padding: 0; border: 0; }
  .menu { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(16,24,40,.08); padding-bottom: env(safe-area-inset-bottom); gap: 0; align-self: auto; }
  .menu a { flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 8px 2px; min-height: 60px; font-size: 11px;
    margin: 0; border-bottom: 0; border-top: 3px solid transparent; }
  .menu a.active { border-top-color: var(--primary); background: none; }
  .menu a svg { width: 22px; height: 22px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
html[data-affichage="phone"] .topbar { gap: 10px; padding: 0 12px; padding-top: env(safe-area-inset-top); min-height: 56px; }
html[data-affichage="phone"] .brand { margin-right: auto; }
html[data-affichage="phone"] .compte-txt, html[data-affichage="phone"] .compte .chevron { display: none; }
html[data-affichage="phone"] .compte-btn { padding: 0; border: 0; }
html[data-affichage="phone"] .menu { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(16,24,40,.08); padding-bottom: env(safe-area-inset-bottom); gap: 0; align-self: auto; }
html[data-affichage="phone"] .menu a { flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 8px 2px; min-height: 60px; font-size: 11px;
  margin: 0; border-bottom: 0; border-top: 3px solid transparent; }
html[data-affichage="phone"] .menu a.active { border-top-color: var(--primary); background: none; }
html[data-affichage="phone"] .menu a svg { width: 22px; height: 22px; }
html[data-affichage="phone"] body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
html[data-affichage="phone"] #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
html[data-affichage="phone"] .menu { left: 50%; right: auto; width: min(100%, 430px); transform: translateX(-50%); }

/* Effets du dashboard */
@media (prefers-reduced-motion: no-preference) {
  .dash > *, .dash .kpi { animation: apparition .55s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms); }
  .dash .barre { transform-origin: left center; animation: remplissage .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(300ms + var(--j, 0) * 70ms); }
  .dash .kpi, .dash .card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
  .dash .kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,51,160,.12); }
  .dash .card:hover { box-shadow: 0 8px 22px rgba(16,24,40,.08); }
  .dash .graphe li { transition: background .15s; }
  .dash .graphe li:hover { background: #f7f9fc; }
  .dash .graphe li:hover .barre { filter: brightness(1.1); }
}
@keyframes apparition { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes remplissage { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.dash .kpi { position: relative; overflow: hidden; }
.dash .kpi::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.dash .kpi:hover::after { transform: scaleX(1); }
