:root {
  --navy: #0f2a4a;
  --navy-light: #16375f;
  --navy-dark: #0a1d33;
  --orange: #ff7a1a;
  --orange-dark: #e0650a;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e2e6ec;
  --text: #1c2733;
  --text-muted: #64748b;
  --green: #1a9e5c;
  --red: #d8402a;
  --amber: #d99a1f;
  --blue: #2467c9;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 42, 74, 0.08), 0 1px 2px rgba(15, 42, 74, 0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 9px;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: #b9c6d8; font-size: 11px; }
.topbar .btn-new { display: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.profile-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.profile-chip .avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--orange);
  color: #12233a;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}

/* ---------- layout ---------- */
.layout {
  flex: 1;
  display: flex;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}
.sidenav { display: none; }
.view {
  flex: 1;
  min-width: 0;
  padding: 16px;
  padding-bottom: calc(84px + var(--safe-bottom));
}

/* ---------- bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  z-index: 30;
}
.bottomnav a, .bottomnav button#btn-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 9.5px;
  color: var(--text-muted);
  padding: 4px 2px;
  border-radius: 8px;
  flex: 1 1 0;
  min-width: 0;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.bottomnav a span, .bottomnav button#btn-more span { font-size: 16px; }
.bottomnav a.active, .bottomnav button#btn-more.active { color: var(--navy); font-weight: 700; }
.bottomnav a.bottomnav-fab {
  background: var(--orange);
  color: #fff !important;
  flex: 0 0 46px;
  width: 46px; height: 46px;
  border-radius: 50%;
  margin-top: -22px;
  box-shadow: 0 4px 10px rgba(255, 122, 26, 0.45);
  font-size: 0;
}
.bottomnav-fab span { font-size: 24px; line-height: 1; color: #fff; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- cards / sections ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 10px;
}
.hero-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  overflow: hidden;
}
.hero-logo {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
  flex-shrink: 0;
}
.hero-title { color: #fff; font-size: 22px; margin: 0; line-height: 1.15; }
.hero-baseline { color: #b9c6d8; font-size: 12.5px; margin: 4px 0 0; font-weight: 600; }

@media (min-width: 760px) {
  .hero-banner { padding: 28px 32px; }
  .hero-logo { width: 72px; height: 72px; }
  .hero-title { font-size: 28px; }
  .hero-baseline { font-size: 14px; }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 20px; margin: 0; }

/* ---------- stat grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-card.alert .num { color: var(--red); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-nouveau { background: #e6edf7; color: var(--blue); }
.badge-planifie { background: #fdf1dc; color: var(--amber); }
.badge-en_cours { background: #fde8dc; color: var(--orange-dark); }
.badge-en-cours-vif {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--orange); color: #fff; font-weight: 800;
  padding: 4px 11px; border-radius: 999px; font-size: 11.5px; white-space: nowrap;
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.22);
}
.badge-termine { background: #e0f5e9; color: var(--green); }
.badge-facture { background: #eae6fb; color: #6440c9; }
/* À planifier : une action à faire, pas un état acquis — d'où le contour en
   pointillés, qui se distingue d'un « Planifié » plein même en noir et blanc. */
.badge-a-planifier { background: #fff8ec; color: var(--amber); border: 1px dashed var(--amber); }
/* PV signé par le client : l'aboutissement du chantier, en vert plein. */
.badge-pv-signe { background: #e0f5e9; color: var(--green); font-weight: 700; }
/* Chantier dont le client a signé le PV : le fond entier passe au vert, pour se
   repérer dans une liste longue sans avoir à lire les badges un par un. Teinte
   très claire à dessein — le texte et les badges doivent rester lisibles par
   dessus, y compris sur l'écran d'un téléphone en plein soleil. */
.intervention-card.iv-signee { background: #f2fbf5; }
.badge-devis-en_attente { background: #fdf1dc; color: var(--amber); }
.badge-devis-valide { background: #e0f5e9; color: var(--green); }
.badge-devis-refuse { background: #fde2df; color: var(--red); }
.badge-type-chantier { background: #12233a; color: #fff; }
.badge-type-informatique { background: var(--orange); color: #fff; }
.badge-prio-urgente { background: var(--red); color: #fff; }
.badge-prio-haute { background: #fde3dc; color: var(--red); }
.badge-prio-normale { background: #eef1f5; color: var(--text-muted); }
.badge-prio-basse { background: #eef1f5; color: var(--text-muted); }
.badge-prospect-nouveau { background: #e6edf7; color: var(--blue); }
.badge-prospect-contacte { background: #fdf1dc; color: var(--amber); }
.badge-prospect-rdv { background: #fde8dc; color: var(--orange-dark); }
.badge-prospect-offre_envoyee { background: #e0e7fb; color: #3f51b5; }
.badge-prospect-gagne { background: #e0f5e9; color: var(--green); }
.badge-prospect-perdu { background: #fde2df; color: var(--red); }

/* ---------- filters ---------- */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.filters select, .search-box input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.filters select { flex: 0 0 auto; min-width: 132px; }
.search-box { margin-bottom: 12px; }
.search-box input { width: 100%; }

/* ---------- recherche client "fluide" (combobox) ---------- */
.ss-wrap { position: relative; }
.ss-input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 10px; font-size: 14px; background: #fff; color: var(--text);
}
.ss-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; padding: 4px;
}
.ss-item { padding: 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.ss-item:hover { background: var(--bg); }

/* ---------- barre de recherche globale (topbar) ---------- */
.global-search { position: relative; flex: 1; max-width: 360px; margin: 0 10px; }
.global-search input {
  width: 100%; border: 1px solid rgba(255,255,255,0.25); border-radius: 999px;
  padding: 8px 14px; font-size: 13.5px; background: rgba(255,255,255,0.12); color: #fff;
}
.global-search input::placeholder { color: #b9c6d8; }
.global-search input:focus { background: #fff; color: var(--text); outline: none; }
.global-search .ss-menu { top: calc(100% + 6px); max-height: 320px; }
.global-search .ss-item { display: flex; align-items: center; gap: 8px; }
.global-search .gs-type { font-size: 10.5px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; flex-shrink: 0; }
@media (max-width: 760px) { .global-search { display: none; } }

.pagination span { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- list ---------- */
.intervention-list { display: flex; flex-direction: column; gap: 10px; }

/* ---------- interventions : vue colonnes par technicien ---------- */
.iv-colonnes { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.iv-colonne { flex: 0 0 300px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.iv-colonne-tete {
  font-size: 13.5px; font-weight: 800; margin-bottom: 10px; padding: 0 2px;
  display: flex; align-items: center; gap: 6px;
}
.iv-colonne-nb {
  background: var(--navy); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 1px 8px; margin-left: auto;
}
.iv-colonne-corps { display: flex; flex-direction: column; gap: 10px; }
.intervention-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.intervention-card.type-chantier { border-left-color: var(--navy); }
.intervention-card.type-informatique { border-left-color: var(--orange); }
.ic-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ic-title { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.ic-meta { color: var(--text-muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.ic-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.empty-state { text-align: center; color: var(--text-muted); padding: 40px 16px; }
.empty-state .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=datetime-local],
textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
  color: var(--text-muted);
}
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.active.orange { background: var(--orange); border-color: var(--orange); }
.chip.active.red { background: var(--red); border-color: var(--red); }

.color-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; position: relative;
}
.color-swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy); }
.color-swatch.active::after {
  content: "✓"; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 14px; font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.color-swatch.none { background: #fff; border: 2px dashed var(--border); color: var(--text-muted); font-size: 14px; }
.color-swatch.none.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text-muted); }
.color-swatch.none.active::after { content: ""; }
.color-swatch.none { display: flex; align-items: center; justify-content: center; }

/* ---------- detail view ---------- */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.status-btn {
  flex: 1 1 auto;
  min-width: 90px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
}
.status-btn.current { background: var(--navy); color: #fff; border-color: var(--navy); }

.info-grid { display: grid; grid-template-columns: 1fr; gap: 10px; font-size: 14px; }
.info-grid .k { color: var(--text-muted); font-size: 12px; }
.info-grid .v { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.waze-btn { background: #d6f4ff; border-color: #a9e6fb; color: #0a6a94; font-weight: 700; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.photo-grid .photo-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eef1f5; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.55); color: #fff; border: none;
  width: 22px; height: 22px; border-radius: 50%; font-size: 13px; cursor: pointer;
}
.photo-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed var(--border); border-radius: 10px; aspect-ratio: 1; cursor: pointer;
  color: var(--text-muted); font-size: 12px; gap: 4px;
}

/* ---------- table (clients / techniciens) ---------- */
.list-simple { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer;
}
.list-item .name { font-weight: 700; font-size: 14.5px; }
.list-item .sub { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.list-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.filtres-dates { align-items: center; }
.filtre-date { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.filtre-date input { padding: 7px 9px; }

/* ---------- agenda du technicien (fenêtre de planification) ---------- */
.agenda-jour { display: flex; flex-direction: column; gap: 6px; }
.agenda-ligne {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: center;
  background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 13px;
}
.agenda-heure { font-weight: 700; color: var(--navy); font-size: 12.5px; }
.agenda-titre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-conflit { background: #fde3e0; border: 1px solid #f5b5ac; }
@media (max-width: 520px) {
  .agenda-ligne { grid-template-columns: 1fr auto; }
  .agenda-heure { grid-column: 1 / -1; }
}

/* ---------- bouton poubelle (réservé aux administrateurs) ---------- */
.btn-poubelle {
  border: 1px solid var(--border); background: var(--card); color: var(--text-muted);
  border-radius: 8px; padding: 5px 9px; font-size: 14px; line-height: 1; cursor: pointer;
}
.btn-poubelle:hover { background: #fde3e0; border-color: #f5b5ac; }
.btn-poubelle:disabled { opacity: .5; cursor: default; }

/* ---------- voyant « vu par le technicien » ---------- */
.voyant {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  border: 1px solid transparent;
}
.voyant::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.voyant-vu { background: #e0f5e9; color: #146c40; border-color: #bfe6d1; }
.voyant-vu::before { background: var(--green); }
.voyant-nonvu { background: #eef1f5; color: var(--text-muted); border-color: #dde3ea; }
.voyant-nonvu::before { background: #b6bfcb; }

/* ---------- alerte dépannage non pris en charge ---------- */
.badge-retard { background: var(--red); color: #fff; font-weight: 700; }
.bandeau-alerte {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fde3e0; border: 1px solid #f5b5ac; border-left: 4px solid var(--red);
  color: #8c2115; border-radius: 10px; padding: 11px 14px; margin-bottom: 12px; font-size: 13.5px;
}
.bandeau-alerte strong { color: #6d190f; }
.bandeau-info {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #eef4fb; border: 1px solid #cfe0f3; border-left: 4px solid var(--blue);
  color: #1c3d63; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px;
}

/* ---------- tableau « prévu au devis » vs posé ---------- */
.tableau-prevu { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.tp-ligne {
  display: grid; grid-template-columns: 90px 1fr 52px 52px 56px 30px;
  gap: 6px; align-items: center; padding: 7px 8px; border-radius: 8px; background: var(--bg);
}
.tp-entete { background: transparent; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; padding-bottom: 0; }
.tp-ligne.tp-ok { background: #e9f7f0; }
.tp-ref { color: var(--text-muted); font-size: 12px; word-break: break-all; }
.tp-des { font-weight: 600; }
.tp-reste { color: var(--orange-dark); font-weight: 700; }
.tp-pose-quick {
  display: flex; align-items: center; gap: 6px; padding: 0 8px 8px; margin-top: -2px;
}
.tp-pose-quick input {
  width: 56px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px;
}
@media (max-width: 640px) {
  .tp-ligne { grid-template-columns: 1fr 44px 44px 48px 26px; }
  .tp-ref { display: none; }
}

/* ---------- onglets Interventions planifiées / Dépannages ---------- */
.onglets-nature { display: flex; gap: 8px; margin-bottom: 12px; }
.onglets-nature .onglet {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text-muted); text-decoration: none;
  font-weight: 700; font-size: 13.5px; text-align: center; box-shadow: var(--shadow);
}
.onglets-nature .onglet.actif { background: var(--navy); border-color: var(--navy); color: #fff; }
.onglets-nature .onglet-depannage.actif { background: var(--red); border-color: var(--red); }
.onglet-compteur {
  min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--bg); color: var(--text-muted); font-size: 12px;
}
.onglets-nature .onglet.actif .onglet-compteur { background: rgba(255, 255, 255, 0.22); color: #fff; }
@media (max-width: 520px) {
  .onglets-nature .onglet { font-size: 12.5px; padding: 10px 6px; flex-direction: column; gap: 4px; }
}

/* ---------- lien de demande de dépannage (fiche client) ---------- */
.lien-box {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-all;
  user-select: all;
}

/* ---------- toast ---------- */
.position-banner {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0; right: 0;
  background: var(--green);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  padding: 6px 10px;
  z-index: 90;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 20, 35, 0.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.modal {
  background: #fff; border-radius: 16px 16px 0 0;
  width: 100%; max-width: 480px;
  padding: 18px; max-height: 88vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-header h2 { font-size: 17px; margin: 0; }

/* ---------- responsive: tablet / desktop ---------- */
@media (min-width: 760px) {
  .topbar .btn-new { display: inline-flex; }
  .bottomnav { display: none; }
  .sidenav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 220px;
    flex-shrink: 0;
    padding: 20px 12px;
    border-right: 1px solid var(--border);
  }
  .sidenav a { padding: 10px 12px; border-radius: 10px; font-weight: 600; color: var(--text-muted); }
  .sidenav a.active { background: var(--navy); color: #fff; }
  .view { padding: 24px; padding-bottom: 24px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 16px; }
}

@media (min-width: 1000px) {
  .photo-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- rapports / materiels ---------- */
.rapport-item, .materiel-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.rapport-item .r-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.rapport-item .r-com { font-size: 13.5px; margin-top: 4px; white-space: pre-wrap; }
.rapport-item .r-meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.materiel-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.materiel-item .m-name { font-weight: 700; font-size: 14px; }
.materiel-item .m-qty { color: var(--text-muted); font-size: 12.5px; }
.materiel-actions { display: flex; gap: 6px; align-items: center; }
.time-total { font-size: 22px; font-weight: 800; color: var(--navy); }

/* ---------- signature pad ---------- */
.sig-pad-wrap { border: 2px dashed var(--border); border-radius: 12px; overflow: hidden; touch-action: none; background: #fbfcfe; }
.sig-pad-wrap canvas { width: 100%; height: 220px; display: block; touch-action: none; }
.pv-signed-box { text-align: center; }
.pv-signed-box img { max-width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

.nature-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.nature-depannage { background: #fde2df; color: var(--red); }
.nature-intervention { background: #e6edf7; color: var(--blue); }

/* ---------- calendrier ---------- */
.cal-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.cal-view-toggle { display: flex; gap: 6px; margin-left: auto; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 17px; font-weight: 800; margin: 0; text-transform: capitalize; min-width: 150px; }
.cal-arrow {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font-size: 16px; font-weight: 700; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.cal-weekday {
  background: #eef1f5; text-align: center; font-size: 10.5px; font-weight: 800;
  color: var(--text-muted); padding: 7px 2px; text-transform: uppercase; letter-spacing: 0.03em;
}
.cal-day {
  background: #fff; min-height: 58px; padding: 4px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
}
.cal-day.other-month { background: #fafbfc; }
.cal-day.other-month .cal-daynum { color: #c3ccd6; }
.cal-day.selected { background: #fff6ee; }
.cal-daynum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; font-size: 12px; font-weight: 700; border-radius: 50%;
}
.cal-day.today .cal-daynum { background: var(--navy); color: #fff; }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-dot.nature-depannage { background: var(--red); }
.cal-dot.nature-intervention { background: var(--blue); }
.cal-events-desktop { display: none; }

.cal-agenda { margin-top: 18px; }
.cal-agenda-title { font-size: 14.5px; font-weight: 800; margin: 0 0 10px; text-transform: capitalize; }

@media (min-width: 760px) {
  .cal-day { min-height: 108px; padding: 6px; align-items: stretch; }
  .cal-dots { display: none; }
  .cal-events-desktop { display: flex; flex-direction: column; gap: 2px; }
  .cal-event-pill {
    font-size: 11px; padding: 2px 6px; border-radius: 5px; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cal-event-pill.nature-depannage { background: var(--red); }
  .cal-event-pill.nature-intervention { background: var(--blue); }
  .cal-more { font-size: 10.5px; color: var(--text-muted); padding-left: 2px; }
}

/* ---------- calendrier : vue semaine ---------- */
.week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.week-grid-inner { min-width: 640px; }
.week-time-col { width: 46px; flex-shrink: 0; }
.week-header { display: flex; border-bottom: 1px solid var(--border); }
.week-day-head { flex: 1; text-align: center; padding: 8px 2px; border-left: 1px solid var(--border); }
.wdh-name { font-size: 10px; text-transform: uppercase; color: var(--text-muted); font-weight: 800; letter-spacing: 0.03em; }
.wdh-num {
  font-size: 15px; font-weight: 800; margin: 3px auto 0; width: 26px; height: 26px;
  line-height: 26px; border-radius: 50%; text-align: center;
}
.wdh-num.today { background: var(--navy); color: #fff; }
.week-allday-row { display: flex; border-bottom: 1px solid var(--border); min-height: 28px; }
.week-allday-cell { flex: 1; border-left: 1px solid var(--border); padding: 3px; display: flex; flex-direction: column; gap: 2px; }
.week-allday-chip {
  font-size: 10px; padding: 2px 6px; border-radius: 4px; color: #fff; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-weight: 600;
}
.week-body-scroll { max-height: 56vh; overflow-y: auto; }
.week-body { display: flex; position: relative; }
.week-hourlabels { position: relative; }
.week-hour-label {
  height: 48px; font-size: 10px; color: var(--text-muted); text-align: right;
  padding-right: 6px; transform: translateY(-6px); box-sizing: border-box;
}
.week-day-col { flex: 1; border-left: 1px solid var(--border); position: relative; }
.week-hour-cell { height: 48px; border-bottom: 1px solid #f0f2f5; box-sizing: border-box; }
.week-event {
  position: absolute; border-radius: 6px; padding: 3px 6px; color: #fff; font-size: 11px;
  font-weight: 600; overflow: hidden; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  line-height: 1.25;
}
.week-event .we-time { font-size: 9.5px; opacity: 0.9; display: block; font-weight: 700; }

/* ---------- agendas Google (lecture seule) ---------- */
.cal-google-legende { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
.cal-google-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cal-google-item.en-attente { opacity: 0.55; cursor: default; }
.cal-google-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.cal-dot-google { background: #fff; border: 2px solid; box-sizing: border-box; }
.google-event-list { display: flex; flex-direction: column; gap: 6px; }
.google-event-row {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  border-left: 3px solid; padding: 4px 8px; background: var(--bg); border-radius: 0 6px 6px 0;
}
.google-event-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.week-allday-chip.google { background: transparent; border: 1px solid; color: var(--text); }
.week-google-lane { position: absolute; top: 0; right: 2px; width: 5px; bottom: 0; }
.week-event-google {
  position: absolute; right: 0; width: 5px; border-radius: 3px; border-left: 3px solid;
  background: rgba(0,0,0,0.06); cursor: default;
}

/* ---------- offre commerciale (devis web) ---------- */
.offre-doc {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.offre-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.offre-logo { width: 52px; height: 52px; border-radius: 10px; background: #fff; object-fit: contain; flex-shrink: 0; }
.offre-header-mid { flex: 1; color: #fff; }
.offre-societe { font-size: 19px; font-weight: 800; }
.offre-coord { font-size: 12px; color: #b9c6d8; margin-top: 4px; line-height: 1.5; }
.offre-header-ref { text-align: right; color: #fff; flex-shrink: 0; }
.offre-ref-badge {
  display: inline-block; background: var(--orange); color: #fff; font-weight: 800;
  font-size: 11px; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 999px;
}
.offre-ref-num { font-size: 15px; font-weight: 800; margin-top: 6px; }
.offre-ref-date { font-size: 11.5px; color: #b9c6d8; margin-top: 2px; }

.offre-body { padding: 22px 24px 26px; }
.offre-client-box {
  background: var(--bg); border-radius: 10px; padding: 12px 16px; margin-bottom: 18px;
  border-left: 3px solid var(--orange);
}
.offre-client-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; }
.offre-client-nom { font-size: 16px; font-weight: 800; color: var(--navy); margin-top: 2px; }
.offre-client-titre { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }

.offre-titre-principal {
  font-size: 16px; font-weight: 800; color: var(--navy); margin: 0 0 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--orange);
}

.offre-section { margin-bottom: 20px; }
.offre-section-titre {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--navy); margin-bottom: 8px; padding-left: 10px; border-left: 3px solid var(--navy);
}
.offre-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.offre-table thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 700; padding: 6px 8px; border-bottom: 2px solid var(--border);
}
.offre-table th.c, .offre-table td.c { text-align: center; }
.offre-table th.r, .offre-table td.r { text-align: right; }
.offre-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.offre-table tbody tr:nth-child(even) { background: #fafbfc; }
.offre-total-ligne { font-weight: 800; color: var(--navy); }
.offre-produit { display: flex; align-items: center; gap: 10px; }
.offre-produit img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.offre-produit-vide { width: 34px; flex-shrink: 0; }
.offre-soustotal { text-align: right; font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.offre-soustotal strong { color: var(--text); }

.offre-total-box {
  background: var(--navy); border-radius: 12px; padding: 16px 20px; margin: 22px 0 4px;
  max-width: 320px; margin-left: auto;
}
.offre-total-ligne-sec {
  display: flex; justify-content: space-between; color: #b9c6d8; font-size: 13px; padding: 3px 0;
}
.offre-total-ttc {
  display: flex; justify-content: space-between; color: #fff; font-size: 19px; font-weight: 800;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.25);
}

.offre-footer { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border); }
.offre-footer > p { font-size: 11.5px; color: var(--text-muted); margin: 0 0 16px; }
.offre-signature { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.offre-signature-label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.offre-signature-box { width: 180px; height: 70px; border: 1px dashed var(--border); border-radius: 8px; }

.offre-acceptation {
  margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border);
}
.offre-acceptation a { color: var(--navy); font-weight: 700; text-decoration: underline; }
.offre-accept-ok {
  background: #e0f5e9; color: var(--green); font-weight: 700; font-size: 13.5px;
  padding: 12px 14px; border-radius: 10px;
}

@media (min-width: 640px) {
  .offre-header { padding: 28px 32px; }
  .offre-body { padding: 30px 32px 34px; }
}

/* ---------- print (PV de livraison) ---------- */
.print-only { display: none; }
@media print {
  .topbar, .sidenav, .bottomnav, .form-actions, .no-print { display: none !important; }
  .print-only { display: inline; }
  .view { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ---------- plans de baie ---------- */
.plan-card {
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--navy);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer;
}
.plan-meta { color: var(--text-muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }

.equip-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.equip-chip {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); background: #fff; border-radius: 10px;
  padding: 8px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text);
}
.equip-chip .dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.equip-chip.active { border-color: var(--navy); background: #eef3fb; box-shadow: 0 0 0 2px rgba(15,42,74,0.15); }
.armed-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #eef3fb; border: 1px solid var(--navy); color: var(--navy);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 700; margin-bottom: 12px;
}

.rack-block { margin-bottom: 20px; }
.rack-block-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.rack-block-title { font-weight: 800; font-size: 14.5px; }
.rack-block-sub { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.rack-actions { display: flex; gap: 6px; }

.rack-frame {
  border: 3px solid #232f3d; border-radius: 6px; background: #f7f8fa; overflow: hidden;
  box-shadow: inset 0 0 0 1px #4a5a6d, 0 2px 6px rgba(0,0,0,0.12);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.rack-row { display: flex; align-items: stretch; border-bottom: 1px solid #dfe3e8; }
.rack-row:last-child { border-bottom: none; }
.rack-u-label {
  flex: 0 0 30px; display: flex; align-items: center; justify-content: center; position: relative;
  font-size: 9.5px; font-weight: 700; color: #cfd8e3; background: linear-gradient(180deg, #3a4a5d, #2b3a4d);
  border-right: 1px solid #1c2733; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.rack-u-label::before, .rack-u-label::after {
  content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #12181f; box-shadow: inset 0 0 0 1px #4a5a6d; left: 3px;
}
.rack-u-label::before { top: 3px; }
.rack-u-label::after { bottom: 3px; }
.rack-slot-empty {
  flex: 1; min-height: 22px; background: repeating-linear-gradient(45deg, #fff, #fff 6px, #f1f3f5 6px, #f1f3f5 12px);
  cursor: default;
}
.rack-slot-empty.placeable { cursor: pointer; }
.rack-slot-empty.placeable:hover { background: #e3ecfb; }
.rack-item {
  flex: 1; display: flex; align-items: center; padding: 0 10px; color: #fff;
  font-size: 12.5px; font-weight: 700; cursor: pointer; gap: 8px; overflow: hidden;
  background-image: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(0,0,0,0.08));
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.rack-item .ri-icon { flex-shrink: 0; font-size: 13px; }
.rack-item .ri-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rack-item .ri-u { font-size: 10.5px; font-weight: 600; opacity: 0.85; flex-shrink: 0; }
.rack-item.editable:hover { filter: brightness(1.08); }

.rack-legend-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12.5px; }
.rack-legend-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; color: var(--text-muted);
  padding: 4px 8px; border-bottom: 1px solid var(--border);
}
.rack-legend-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rack-legend-table tr:last-child td { border-bottom: none; }
.rack-legend-table .rlt-u { font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.rack-legend-table .lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

.patch-panel-block {
  margin-top: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt, rgba(0,0,0,0.02));
}
.patch-panel-title { font-size: 12.5px; font-weight: 700; margin: 0 0 10px; color: var(--text-muted); }
.patch-panel-grid {
  display: grid; grid-template-columns: repeat(var(--patch-cols, 12), 1fr); gap: 4px; margin-bottom: 10px;
}
.patch-port {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; border-radius: 4px; color: #fff;
  background: linear-gradient(180deg, #2a2f36, #14171c);
  border: 1px solid rgba(0,0,0,0.35); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  cursor: default; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.patch-port.filled { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.5); }
.patch-conn-list { display: flex; flex-direction: column; gap: 4px; }
.patch-conn-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.patch-conn-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.patch-conn-port { font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.patch-conn-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .patch-panel-grid { grid-template-columns: repeat(min(var(--patch-cols, 12), 8), 1fr); }
}

.size-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.size-presets .chip { padding: 5px 10px; font-size: 12px; }

.cable-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.cable-row:last-child { border-bottom: none; }
.cable-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.cable-ends { flex: 1; min-width: 0; font-weight: 600; }
.cable-arrow { color: var(--text-muted); font-weight: 400; margin: 0 2px; }
.cable-meta { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

.net-canvas-wrap {
  border: 2px solid #2b3a4d; border-radius: 8px; background: #f7f8fa;
  overflow: hidden; margin-top: 10px;
}
.net-canvas { width: 100%; height: auto; display: block; touch-action: none; }
.net-node { cursor: grab; }
.net-node circle { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.net-node text { user-select: none; }
.net-link { cursor: pointer; }

.rack-mini {
  display: flex; flex-direction: column;
  width: 90px; flex-shrink: 0;
  border: 2px solid #2b3a4d; border-radius: 6px; overflow: hidden;
  background: repeating-linear-gradient(45deg, #fff, #fff 4px, #f1f3f5 4px, #f1f3f5 8px);
}
.rack-mini-sm { width: 26px; border-width: 1px; border-radius: 4px; }
.rack-mini-seg {
  border-bottom: 1px solid rgba(255,255,255,0.5);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.rack-mini-seg:last-child { border-bottom: none; }
.rack-mini-seg.editable { cursor: pointer; }
.rack-mini-seg.editable:hover { filter: brightness(1.1); }
.rack-mini-empty { background: transparent; }
.rack-mini-row { display: flex; gap: 6px; align-items: flex-end; margin-top: 10px; }

@media print {
  .rack-frame { border-color: #333; }
  .rack-u-label { background: #f0f0f0 !important; }
  .net-canvas-wrap { border-color: #333; }
  .rack-mini { border-color: #333; }
}

/* ---- tâches en colonnes : Client | Commentaire | État ---- */
.tache-ligne {
  display: grid;
  grid-template-columns: 210px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 11px 14px;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}
.tache-col { min-width: 0; }
.tache-client {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--navy);
  overflow-wrap: anywhere;
}
.tache-col-etat { display: flex; align-items: center; gap: 6px; }
.tache-entete {
  background: transparent;
  border: none;
  padding: 2px 14px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
/* sur mobile la grille se replie en une seule colonne */
@media (max-width: 700px) {
  .tache-ligne { grid-template-columns: 1fr; gap: 6px; }
  .tache-col-etat { justify-content: flex-start; }
  .tache-entete { display: none; }
}

/* ---- tableau de bord : tâches à traiter par personne ---- */
.taches-perso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.taches-perso-carte {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg, #f7f8fa);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s, transform .15s;
}
.taches-perso-carte:hover { border-color: var(--navy); transform: translateY(-1px); }
.tp-nom {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.tp-total {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--navy);
  margin: 2px 0 6px;
}
.tp-detail { display: flex; flex-wrap: wrap; gap: 5px; }
.tp-pastille {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.tp-a-faire  { background: #e0f5e9; color: #1b7f4b; }
.tp-en-cours { background: #fdf1dc; color: #b06a00; }

/* personne sans tâche : présente mais visuellement en retrait */
.taches-perso-carte.tp-vide { opacity: .62; }
.taches-perso-carte.tp-vide .tp-total { color: var(--text-muted); }
.tp-pastille.tp-aucune { background: #eceff3; color: #6b7280; }

/* ---- menu latéral : groupe repliable « Technique » ---- */
.nav-groupe { margin: 2px 0; }
.nav-groupe-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
}
.nav-groupe-tete:hover { background: rgba(0,0,0,.04); }
.nav-groupe.actif > .nav-groupe-tete { color: var(--navy); }
.nav-chevron { font-size: 11px; opacity: .7; }
.nav-groupe-contenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 10px;
  padding-left: 8px;
  border-left: 2px solid var(--border);
}

/* ---- page Technique : cartes des sous-modules ---- */
.technique-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.technique-carte {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color .15s, transform .15s;
}
.technique-carte:hover { border-color: var(--navy); transform: translateY(-2px); }
.tc-icone { font-size: 26px; line-height: 1; margin-bottom: 8px; }
.tc-titre { font-weight: 800; font-size: 15px; color: var(--navy); }
.tc-sous { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

/* ---- nom de client cliquable ---- */
.lien-client {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--navy);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.lien-client:hover { color: var(--orange, #ff7a1a); }

/* ---- détail dépliable (devis validés Axonaut) ---- */
.ax-details { margin-top: 10px; }
.ax-details summary {
  cursor: pointer; font-size: 13px; font-weight: 700; color: var(--navy);
  list-style: none; display: flex; align-items: center; gap: 4px;
}
.ax-details summary::-webkit-details-marker { display: none; }
.ax-details summary::before { content: "▸"; font-size: 11px; transition: transform 0.15s; }
.ax-details[open] summary::before { transform: rotate(90deg); }

/* ---- pièces jointes ---- */
.pj-liste { display: flex; flex-direction: column; gap: 6px; }
.pj-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
}
.pj-lien { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.pj-icone { font-size: 20px; flex-shrink: 0; }
.pj-infos { display: flex; flex-direction: column; min-width: 0; }
.pj-nom { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.pj-meta { font-size: 11.5px; color: var(--text-muted); }

/* ---- schéma réseau : zones VLAN ---- */
.net-zone { cursor: move; }
.net-zone-poignee { cursor: nwse-resize; }
.net-zone text { pointer-events: none; user-select: none; }

/* ---- discussion d'équipe ---- */
.chat-fil { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.chat-msg {
  background: var(--bg, #f5f7fa);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
}
.chat-msg.chat-moi { background: #eaf2fd; border-color: #c7dcf7; }
.chat-tete {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--text-muted); margin-bottom: 3px;
}
.chat-tete strong { color: var(--navy); font-size: 12.5px; }
.chat-tete button { margin-left: auto; }
.chat-texte { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-saisie { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.chat-saisie textarea { flex: 1; resize: vertical; }

/* ---- journal / historique ---- */
.journal-ligne {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.journal-ligne:last-child { border-bottom: none; }
.journal-lien { text-decoration: none; color: inherit; }
.journal-lien:hover .journal-titre { color: var(--navy); text-decoration: underline; }
.journal-icone { font-size: 16px; flex-shrink: 0; line-height: 1.3; }
.journal-objet { font-size: 12px; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.journal-titre { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.journal-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* type d'intervention : lien & téléphonie */
.badge-type-lien_telephonie { background: #2e7d32; color: #fff; }

/* ---- tableau de bord : « votre journée » ---- */
.ma-journee { border-left: 4px solid var(--orange, #ff7a1a); }
.mj-sous-titre {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  margin: 0 0 6px;
}

/* actions rapides dans « votre journée » */
.mj-ticket { flex-wrap: wrap; gap: 8px; }
.mj-ticket-lien { display: flex; flex: 1; min-width: 200px; text-decoration: none; color: inherit; }
.mj-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* actions rapides sur une carte d'intervention */
.ic-rapide {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.ic-affecter { flex: 0 0 190px; font-size: 12.5px; padding: 5px 8px; }
.ic-note { flex: 1; min-width: 0; font-size: 12.5px; padding: 5px 8px; }
@media (max-width: 640px) {
  .ic-rapide { flex-direction: column; }
  .ic-affecter { flex: 1 1 auto; }
}

/* actions rapides sur une ligne de tâche */
.tache-rapide {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.tache-affecter { flex: 0 0 180px; font-size: 12.5px; padding: 5px 8px; }
.tache-note { flex: 1; min-width: 0; font-size: 12.5px; padding: 5px 8px; }
@media (max-width: 700px) {
  .tache-rapide { flex-direction: column; }
  .tache-affecter { flex: 1 1 auto; }
}

/* ---------- poubelle sur les cartes d'intervention / dépannage ---------- */
.ic-coin { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ic-poubelle {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
  opacity: .35;                      /* discret tant qu'on ne le vise pas */
  transition: opacity .12s, background .12s, border-color .12s;
}
.ic-poubelle:hover { opacity: 1; background: #fde7e7; border-color: #c02626; }
.ic-poubelle:disabled { opacity: .2; cursor: default; }
/* sur écran tactile, pas de survol : on le laisse lisible en permanence */
@media (hover: none) { .ic-poubelle { opacity: .7; } }

/* ---------- affectation à plusieurs personnes (cases à cocher) ---------- */
.affect-cases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 8px;
  background: #fff;
}
.affect-case {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13.5px;
  user-select: none;
  background: #fff;
  transition: background .12s, border-color .12s, color .12s;
}
.affect-case:hover { border-color: var(--navy, #123); }
.affect-case input { cursor: pointer; margin: 0; }
/* une personne cochée se lit sans avoir à viser la case */
.affect-case.actif {
  background: var(--navy, #123);
  border-color: var(--navy, #123);
  color: #fff;
  font-weight: 600;
}

/* ---------- commentaire rapide sur les dossiers Lien & Téléphonie ---------- */
.lt-note {
  width: 100%;
  margin-top: 8px;
  font-size: 12.5px;
  padding: 6px 9px;
  border: 1px solid var(--border, #e2e6ec);
  border-radius: 7px;
  background: #fff;
}
.lt-note:focus { border-color: var(--navy, #123); outline: none; }

/* ---------- sélecteur du stock interne (liste déroulante avec recherche) ---------- */
.selecteur-stock {
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  box-shadow: var(--shadow); margin: -4px 0 12px; overflow: hidden;
}
.ss-entete { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px; border-bottom: 1px solid var(--border); background: var(--bg); }
.ss-recherche { flex: 1; min-width: 200px; }
.ss-filtre { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.ss-liste { max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ss-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; font: inherit;
}
.ss-item:hover, .ss-item:focus { background: #eef4fb; outline: none; }
.ss-item img, .ss-sans-photo {
  width: 34px; height: 34px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; background: var(--bg);
}
.ss-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ss-nom { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-meta { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-dispo { font-size: 11.5px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.ss-dispo.ss-ok { color: var(--green); }
.ss-pied { padding: 6px 12px; font-size: 12px; color: var(--text-muted); background: var(--bg); }

/* ---------- lignes du devis dans la fenêtre « Matériel à commander » ---------- */
.dm-devis { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; background: var(--bg); }
.dm-devis > summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 2px 0; }
.dm-lignes { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 260px; overflow-y: auto; }
.dm-ligne { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.dm-ligne.dm-faite { opacity: .6; cursor: default; }
.dm-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-nom { font-weight: 600; font-size: 13.5px; }
.dm-meta { font-size: 12px; color: var(--text-muted); }
.dm-qte { width: 64px; text-align: center; padding: 5px 6px; }
.dm-etat { font-size: 12px; font-weight: 700; color: var(--green); white-space: nowrap; }

/* ---------- tableau de bord : « Mon travail » et « Toute l'équipe » ---------- */
/* Pensé pour le téléphone d'abord : deux compteurs par ligne (quatre à partir
   d'une tablette, via la règle existante de .stat-grid), cible de clic pleine
   carte, aucun tableau, donc aucun défilement horizontal. */
a.stat-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
a.stat-card:hover { border-color: var(--navy); transform: translateY(-1px); }
/* Doigt sur un écran tactile : 44 px de haut au minimum. */
.tb-compteur { min-height: 76px; }
.tb-compteur .label {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.tb-mon-travail { border-left: 4px solid var(--navy); }
.tb-section + .tb-section { border-top: 1px dashed var(--border); padding-top: 4px; }
.tb-section .empty-state { padding: 18px 12px; }
.tb-section .empty-state .big { font-size: 28px; margin-bottom: 4px; }

.tb-equipe-titre { font-size: 18px; margin: 0; }

/* ---------- chiffre d'affaires chantier (écran administrateur) ---------- */
/* Pensé pour le téléphone : aucune largeur fixe, aucun tableau, donc aucun
   défilement horizontal. Les barres mensuelles sont du CSS pur — largeur en
   pourcentage posée à l'écriture du gabarit. Aucune bibliothèque de graphiques
   n'est chargée : le projet n'en utilise aucune et la politique de sécurité du
   serveur bloquerait un CDN. */

/* Le montant qui dort : une carte entière, cliquable, taille de cible confortable. */
.ca-total {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-left: 4px solid var(--orange);
  font: inherit;
  color: inherit;
}
.ca-total:hover { border-color: var(--orange); }
.ca-total-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--text-muted);
}
.ca-total-montant {
  font-size: 34px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.ca-total-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ca-total-voir { font-size: 13px; font-weight: 700; color: var(--orange-dark); }

.ca-ligne-montant {
  font-weight: 800;
  font-size: 15px;
  color: var(--navy);
  white-space: nowrap;
  padding-left: 10px;
}

/* Historique mensuel. */
.ca-barres { display: flex; flex-direction: column; gap: 14px; }
.ca-mois-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.ca-mois-nom {
  font-size: 13.5px;
  font-weight: 700;
  text-transform: capitalize;
}
.ca-mois-montant { font-size: 15px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.ca-piste {
  background: var(--bg);
  border-radius: 999px;
  height: 12px;
  margin-top: 5px;
  overflow: hidden;
}
.ca-barre {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
  /* Un mois à 0 € a une largeur nulle : il ne doit rien peindre du tout. */
  min-width: 0;
}
.ca-mois-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- le parc d'abonnements (revenu récurrent) ---------- */
/* Fond sombre, comme le bloc « chaque mois » de l'offre client (.offre-total-box-mensuel) :
   le récurrent ne s'additionne pas au chiffre d'affaires chantier, et rien ne le
   dit mieux que deux couleurs qu'on ne peut pas confondre. Même teinte, mêmes
   mots, d'un écran à l'autre. */
.ca-abo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  background: #123a5e;
  border: 1px solid #123a5e;
  border-left: 4px solid var(--green);
  color: #fff;
}
.ca-abo-titre {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #b9c6d8;
}
/* Le chiffre que le dirigeant regarde : le plus gros de l'écran. */
.ca-abo-annuel {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.ca-abo-mensuel { font-size: 13.5px; color: #cdd9e8; font-weight: 600; }
.ca-abo-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.ca-abo-badge { background: rgba(255, 255, 255, 0.16); color: #fff; }
.ca-abo-voir { font-size: 13px; font-weight: 700; color: #9fd8b8; }

/* La liste dépliée reste une carte ordinaire : c'est du détail, pas un indicateur. */
.ca-abo-liste .list-item { align-items: center; }
.ca-abo-ligne {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 10px;
  white-space: nowrap;
}
.ca-abo-ligne-mois { font-weight: 800; font-size: 15px; color: var(--navy); }
.ca-abo-ligne-an { font-size: 12px; color: var(--text-muted); }

@media (min-width: 760px) {
  .ca-total-montant { font-size: 42px; }
  .ca-abo-annuel { font-size: 42px; }
}

/* ---------- préparation matériel (l'onglet ex « matériels prêts ») ---------- */
/* Écrans pensés pour le téléphone, ouverts en camionnette : aucune largeur fixe,
   aucun tableau, donc aucun défilement horizontal ; tout s'empile et les cibles
   de clic restent larges. Aucune bibliothèque, aucun CDN — le projet n'en charge
   aucun et la politique de sécurité du serveur le bloquerait. */

/* Les trois ÉTAPES de la chaîne, dépliables. Elles ont remplacé les tuiles-filtres
   le 2026-09-18 : le dirigeant lisait « matériels prêts » au-dessus de matériel en
   commande, et deux mécanismes de filtrage se superposaient. L'en-tête sert à la
   fois de titre, de compteur et de poignée de repli — une seule cible, large, qui
   se vise au pouce. */
.prep-etape { margin-bottom: 14px; }
.prep-etape-tete {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  color: var(--navy);
  list-style: none;
}
/* Le chevron natif de <summary> est masqué et redessiné à droite : à gauche il
   colle au titre, à droite il tombe sous le pouce. */
.prep-etape-tete::-webkit-details-marker { display: none; }
.prep-etape-tete::after {
  content: "▸";
  margin-left: auto;
  font-size: 15px;
  color: var(--text-muted);
}
.prep-etape[open] > .prep-etape-tete::after { content: "▾"; }
.prep-etape[open] > .prep-etape-tete {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.prep-etape-titre { overflow-wrap: anywhere; }
.prep-etape-nb { font-size: 13px; }
.prep-etape-corps {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px;
  background: var(--bg);
}
.prep-genere { margin-top: 12px; text-align: center; }

/* Un bon de commande déroulé sous son chantier : la référence, le fournisseur,
   ce qui reste à recevoir, et le chemin vers la réception. */
.prep-commandes { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.prep-commande-bloc {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--card);
}
.prep-commande-resume {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-height: 34px;
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}
.prep-commande-resume::-webkit-details-marker { display: none; }
.prep-commande-ref { font-weight: 800; color: var(--navy); overflow-wrap: anywhere; }
.prep-commande-fourn { font-weight: 700; overflow-wrap: anywhere; }
.prep-commande-nb { color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.prep-receptionner { margin-top: 8px; }

/* Le sélecteur de fournisseur, sur chaque ligne qui n'est pas encore arrivée.
   Pleine largeur : c'est une liste déroulante qu'on ouvre en roulant, au doigt. */
.prep-fourn { display: block; margin-top: 8px; }
.prep-fourn-titre {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.prep-fourn-select { min-height: 44px; font-size: 14px; }
.prep-fourn-gele {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Une carte de chantier. « Prêt et affecté à personne » est le seul cas mis en
   avant : liseré vert et fond très légèrement teinté. Si tout ressortait, plus
   rien ne ressortirait. */
.prep-chantier { margin-bottom: 0; }
.prep-chantier.prep-a-affecter {
  border-left: 4px solid var(--green);
  background: #f5fbf7;
}
.prep-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.prep-client { font-size: 16px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.prep-titre { font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.prep-meta { color: var(--text-muted); font-size: 12.5px; margin-top: 6px; }
.prep-appel {
  margin: 10px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #146c40;
}
.prep-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.prep-sans-intervention { margin: 0; }

/* Ce qui manque encore : une liste, jamais un tableau. */
.prep-manque { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.prep-manque li {
  background: #fff8ec;
  border: 1px solid #f3dfba;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.prep-manque-des { font-weight: 700; display: block; }
.prep-manque-reste { color: var(--orange-dark); font-weight: 700; display: block; margin-top: 2px; }
.prep-manque-meta { color: var(--text-muted); font-size: 12.5px; display: block; margin-top: 2px; }

/* États : la couleur porte l'information, le mot la confirme — on ne demande
   jamais de distinguer deux pastilles sans texte. */
.badge-prep-pret { background: #e0f5e9; color: var(--green); }
.badge-prep-en_attente_reception { background: #fdf1dc; color: var(--amber); }
.badge-prep-a_preparer { background: #e6edf7; color: var(--blue); }
.badge-prep-ok { background: #e0f5e9; color: var(--green); }
.badge-prep-manque { background: #fde2df; color: var(--red); }
.badge-prep-neutre { background: #eef1f5; color: var(--text-muted); }
.badge-prep-attention { background: #fdf1dc; color: var(--amber); }

/* Le détail ligne par ligne, dans la fiche d'un devis. */
.prep-lignes { display: flex; flex-direction: column; gap: 8px; }
.prep-ligne { background: var(--bg); border-radius: 8px; padding: 9px 10px; }
.prep-ligne-haut { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.prep-ligne-des { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.prep-ligne-qte { font-weight: 700; font-size: 13.5px; color: var(--navy); white-space: nowrap; }
.prep-ligne-bas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.prep-manquant { color: var(--red); font-weight: 700; }
.prep-ref { overflow-wrap: anywhere; }
.prep-prix { font-weight: 700; color: var(--navy); }
.prep-total { font-weight: 800; font-size: 14px; color: var(--navy); margin-left: auto; }
.prep-deja { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; color: #146c40; }
.prep-sous-titre { margin-top: 14px; }
.prep-bouton { margin-top: 12px; }

/* Compte rendu d'une préparation. Les deux listes qui demandent une main humaine
   (sans fournisseur, non traité) portent .prep-alerte : elles ne doivent pas se
   lire comme un simple récapitulatif. */
.prep-resultat-bloc { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.prep-resultat {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.prep-resultat li { background: var(--bg); border-radius: 8px; padding: 7px 10px; overflow-wrap: anywhere; }
.prep-resultat.prep-alerte li {
  background: #fde8dc;
  border: 1px solid #f5c3aa;
  color: #8a3312;
  font-weight: 600;
}
.prep-commande { margin-bottom: 10px; }
.prep-commande-tete {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  font-size: 13.5px;
  margin-bottom: 5px;
}
.prep-commande-tete span { color: var(--text-muted); }

@media (min-width: 760px) {
  .prep-actions { flex-direction: row; }
  .prep-actions .btn { width: auto; flex: 1; }
}


/* Totaux de l'offre : le ponctuel et le mensuel sont deux blocs distincts, jamais
   une addition. Le second est encadré d'une teinte différente pour qu'on ne les
   confonde pas d'un coup d'œil — c'est un document qui part chez le client. */
.offre-total-titre { font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
                     opacity: .75; margin-bottom: 6px; }
.offre-total-box-mensuel { margin-top: 10px; background: #123a5e; }


/* ================= la file d'attente du matériel =========================
   Entre le devis validé et la planification, un chantier passe par
   l'approvisionnement. Deux repères de liste et un bandeau de fiche le disent.
   Tout s'empile avant de s'aligner : ces écrans s'ouvrent en camionnette, et
   rien ne doit déborder en largeur. */

/* Le signal que le dirigeant attend : le matériel est là, on peut planifier.
   Il doit se voir au milieu des autres badges, d'où le liseré plein. */
.badge-materiel-pret {
  background: #d8f3e4; color: #0f6b3f; font-weight: 800;
  border: 1px solid #8fd6b0;
}
.badge-materiel-attente { background: #fdf1dc; color: var(--amber); font-weight: 700; }

.mat-bandeau { border-left: 4px solid var(--border); }
.mat-bandeau.mat-a_preparer { border-left-color: var(--blue); }
.mat-bandeau.mat-en_attente_reception { border-left-color: var(--amber); }
.mat-bandeau.mat-pret { border-left-color: var(--green); }

.mat-tete {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.mat-resume { font-weight: 700; font-size: 14px; color: var(--navy); overflow-wrap: anywhere; }
.mat-refs {
  margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--text-muted);
  overflow-wrap: anywhere;
}
.mat-note { margin: 6px 0 0; }

/* Cibles larges : on vise au pouce, gant au doigt, sans zoomer. */
.mat-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mat-actions .btn { min-height: 44px; }

/* Le compteur « en attente de matériel » prend sa propre ligne du tableau de
   bord : les quatre compteurs existants gardent ainsi exactement la grille
   qu'ils avaient, en deux colonnes comme en quatre. */
.tb-compteur-large { grid-column: 1 / -1; }

@media (min-width: 760px) {
  .mat-actions { flex-direction: row; }
  .mat-actions .btn { width: auto; flex: 1; }
}


/* ============ l'écran unique « Suivi matériel » et son bon de préparation ====
   2026-09-20. Le magasinier prépare avec son téléphone dans une main : tout
   s'empile, les cibles font 44 px, et rien ne déborde en largeur. Aucune
   bibliothèque, aucune police distante — les classes existantes d'abord. */

/* Les deux onglets de l'écran fusionné. Même allure que les filtres
   « À commander / Commandés / Reçus » que le dirigeant utilise déjà ici. */
.ecran-materiel-onglets { margin-bottom: 14px; }
.ecran-materiel-onglets .chip { text-decoration: none; }

/* La colonne de stock des demandes de matériel : elle ne doit pas se lire comme
   une note de bas de page, c'est elle qui dit s'il faut acheter. */
.mac-stock {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 12.5px; color: var(--text-muted);
}
.mac-inutile { margin: 8px 0 0; color: #0f6b3f; font-weight: 700; }

/* --- la même file, en TABLEAU, sur un écran de bureau ----------------------
   « Fais une colonne dédiée au stock, c'est plus simple » (le dirigeant, annoté
   trois fois le 2026-09-20). Décider quoi commander, c'est comparer trente
   lignes entre elles : au bureau on balaie des colonnes, on ne lit pas trente
   paragraphes. La bascule se fait en JS, à MAC_LARGEUR_TABLEAU ; en deçà, la
   carte reprend la main — ce projet ne fait jamais défiler en largeur. */
.mac-tableau { padding: 4px 10px 6px; }
.mac-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mac-table thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 700; padding: 8px; white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.mac-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.mac-table tbody tr:last-child td { border-bottom: none; }

/* Les nombres se COMPARENT : calés à droite, même chasse, jamais coupés. C'est
   toute la raison d'être de cette mise en forme. */
.mac-table th.r, .mac-table td.r { text-align: right; }
.mac-t-nombre { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.mac-t-vide { color: var(--text-muted); font-weight: 400; }

/* La colonne réclamée : l'état au-dessus, ce qu'on a en réserve juste dessous.
   Les deux étages sont calés à droite, donc alignés d'une rangée à l'autre. */
.mac-td-stock { white-space: nowrap; }
.mac-t-reserve-qte { display: block; margin-top: 4px; color: var(--navy); }

.mac-t-des { font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.mac-t-meta { color: var(--text-muted); font-size: 12.5px; overflow-wrap: anywhere; }
.mac-t-des + .mac-t-meta, .mac-t-meta + .mac-t-meta { margin-top: 3px; }
.mac-t-inutile { margin-top: 4px; font-size: 12.5px; color: #0f6b3f; font-weight: 700; }

/* Les gestes s'empilent dans leur cellule : trois boutons côte à côte
   pousseraient la table au-delà de la fenêtre. */
.mac-td-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

/* Deux rangées se signalent : celle qui presse, et celle qu'on a déjà. */
.mac-table tr.mac-tr-urgent td:first-child { border-left: 4px solid var(--red); }
.mac-table tr.mac-tr-reserve { background: #f3fbf6; }

/* Le chantier n'est plus une étiquette : c'est la porte de son dossier. */
.mac-lien-chantier { font-weight: 600; }

/* --- « une page par devis » : la file rassemblée par chantier --------------
   « Essaye de faire une page par devis validé aussi » (le dirigeant,
   2026-09-20). Le choix entre la liste à plat et les groupes vit à côté des
   trois filtres, qui eux ne bougent pas. Sur un téléphone la bascule passe à la
   ligne plutôt que de rétrécir les filtres. */
.mac-barre {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px;
}
.mac-bascule { margin-left: auto; }

/* En CARTES : le groupe est un bloc, son en-tête un bandeau. */
.mac-gr { margin-bottom: 18px; }
.mac-gr > .mac-gr-tete {
  background: var(--bg); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px;
}

/* En TABLEAU : l'en-tête occupe une rangée entière, les colonnes restent
   alignées d'un chantier à l'autre — c'est ce qu'on vient comparer. */
.mac-table tr.mac-gr-rangee td {
  background: var(--bg); padding: 9px 8px; border-bottom: 2px solid var(--border);
}

/* Le même en-tête dans les deux formes : qui, et ce que ça pèse encore. Il
   s'enroule au lieu de pousser quoi que ce soit hors de l'écran. */
.mac-gr-tete {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  align-items: baseline; justify-content: space-between;
}
.mac-gr-ident { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.mac-gr-titre { font-weight: 700; font-size: 14px; color: var(--navy); overflow-wrap: anywhere; }
.mac-gr-client { font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.mac-gr-chiffres {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums;
}

/* --- le bon de préparation --- */
.bon-resume { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bon-tuile {
  background: var(--bg); border-radius: 8px; padding: 6px 10px;
  font-size: 12.5px; color: var(--text-muted);
}
.bon-tuile b { color: var(--navy); font-size: 14px; }

.bon-barre {
  background: var(--bg); border-radius: 10px; padding: 10px; margin-bottom: 12px;
}
.bon-tout { display: flex; align-items: center; gap: 8px; font-weight: 700; min-height: 44px; }
.bon-tout input { width: 20px; height: 20px; }
.bon-fourn { display: block; margin-top: 6px; }
.bon-gestes { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.bon-gestes .btn { min-height: 44px; }
.bon-aide { margin: 8px 0 0; }

.bon-lignes { display: flex; flex-direction: column; gap: 8px; }
.bon-ligne {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg); border-radius: 8px; padding: 9px 10px;
  border-left: 3px solid transparent;
}
/* Une ligne sur laquelle un geste est possible se distingue : les autres sont
   là pour être LUES — c'est tout l'objet de ce document. */
.bon-ligne-active { border-left-color: var(--blue); background: #fff; }
.bon-case { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.bon-case:disabled { opacity: .35; }
.bon-corps { display: block; min-width: 0; flex: 1; }
.bon-haut { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bon-des { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.bon-qte { font-weight: 700; font-size: 13.5px; color: var(--navy); white-space: nowrap; }
.bon-bas {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 6px; font-size: 12.5px; color: var(--text-muted);
}
.bon-sorti { color: #0f6b3f; font-weight: 700; }
.bon-commande {
  display: block; margin-top: 5px; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); overflow-wrap: anywhere;
}

@media (min-width: 760px) {
  .bon-gestes { flex-direction: row; }
  .bon-gestes .btn { width: auto; flex: 1; }
}

/* ============================== accès de connexion ==============================
   Écran Techniciens, lot du 2026-09-20. Deux blocs distincts, volontairement :
   la LIGNE d'état du compte, discrète, qui vit dans chaque fiche ; et la CARTE du
   mot de passe temporaire, qui doit au contraire sauter aux yeux — elle porte une
   information qui ne sera plus jamais réaffichée. */

.acces-compte {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 12.5px;
}
.acces-badge-ferme { background: var(--red); color: #fff; }
.acces-badge-attente { background: var(--orange); color: #fff; }

/* Bordure orange et fond clair : cette carte n'est pas du mobilier d'écran, c'est
   un message à lire maintenant. */
.acces-temporaire {
  border: 2px solid var(--orange);
  background: #fff8f2;
}
.acces-temporaire-grille {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 10px;
}
/* Chasse fixe et lettres espacées : un mot de passe engendré se recopie à la main
   aussi souvent qu'il se colle, et « l » contre « 1 » doit rester lisible.
   user-select rendu explicite pour que la sélection manuelle reste possible même
   si un style global la retire ailleurs. */
.acces-temporaire-valeur {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 17px; font-weight: 700; letter-spacing: .06em;
  color: var(--navy); overflow-wrap: anywhere;
  user-select: all; -webkit-user-select: all;
}
.acces-temporaire-alerte {
  margin: 0 0 10px; font-size: 12.5px; font-weight: 600; color: var(--orange-dark);
}
