/* ============================
   Styles de l'application
   Jetons (couleurs, police, rayons, ombres, thèmes) : css/design.css,
   chargé AVANT ce fichier. Aucune couleur en dur ici.
   ============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ============================
   LOGIN PAGE
   ============================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--degrade-nav);
}

.login-card {
  background: var(--white);
  border-radius: var(--rayon-l);
  border: var(--bord-carte) solid var(--border);
  padding: 40px 48px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--ombre-l);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .brand {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}

.login-logo .tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.login-card h2 {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text);
}

/* ============================
   APP LAYOUT
   ============================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--degrade-nav);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
}

.marque-logo {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--rayon-m);
  background-color: var(--c-nav-actif);
  background-image: var(--degrade-marque);
  color: var(--c-sur-marque);
  font-weight: 800;
  font-size: 15px;
}

/* Logo de la PME (core/marque.js) : posé sur un fond blanc, lisible quel
   que soit le logo et le thème */
.marque-logo-image { background: #fff; padding: 3px; overflow: hidden; }
.marque-logo-image img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.login-logo-image { display: grid; place-items: center; margin-bottom: 12px; }
.login-logo-image img { max-width: 160px; max-height: 96px; object-fit: contain; }
.sidebar-brand .brand, .sidebar-brand .sub { overflow-wrap: anywhere; }

.sidebar-brand .brand {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand .sub {
  font-size: 12px;
  color: var(--c-nav-texte);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 2px 10px;
  color: var(--c-nav-texte);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  border-radius: var(--rayon-m);
  background: none;
  width: calc(100% - 20px);
  text-align: left;
  transition: background var(--duree-1), color var(--duree-1);
}

.nav-item:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.nav-item.active {
  background: var(--c-nav-actif);
  color: #fff;
}

.nav-item .icone { width: 20px; height: 20px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-badge {
  font-size: 12px;
  color: var(--c-nav-texte);
  margin-bottom: 10px;
}

.user-badge strong {
  color: #fff;
  display: block;
  font-size: 13px;
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--duree-1);
}

.btn-logout:hover { background: rgba(255,255,255,.15); }

/* --- Main content --- */
.main-content {
  margin-left: 220px;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text);
}

.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* ============================
   FORMS
   ============================ */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--c-bordure-champ);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--c-focus);
  box-shadow: var(--halo);
}

/* Champs que la liste ci-dessus ne couvrait pas (paramètres, nacelle…) */
input[type="number"], input[type="datetime-local"], input[type="time"], input[type="url"] {
  padding: 8px 12px;
  border: 1px solid var(--c-bordure-champ);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  outline: none;
}
input[type="file"] { font-family: var(--font); font-size: 13px; color: var(--text); max-width: 100%; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: .8; }

textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--duree-1), border-color var(--duree-1), transform var(--duree-1);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

/* Dégradé de la marque ; en « Plein soleil » le dégradé vaut « none » et
   l'aplat plein --c-marque reste seul (contraste maximal). */
.btn-primary {
  background-color: var(--c-marque);
  background-image: var(--degrade-marque);
  background-origin: border-box;
  color: var(--c-sur-marque);
  border-color: transparent;
  box-shadow: var(--ombre-marque);
}
.btn-primary:hover { background-color: var(--c-marque-survol); background-image: none; }
.btn:disabled { opacity: .6; cursor: default; box-shadow: none; }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border-color: var(--c-bordure-champ);
}
.btn-secondary:hover { background: var(--c-survol); }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }

/* ============================
   CARDS
   ============================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--rayon-m);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 20px; }

/* ============================
   STAT CARDS (Dashboard)
   ============================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--rayon-m);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Couleur d'un indicateur : liseré à gauche et icône du libellé (jamais seule) */
.stat-card.accent  { border-left: 4px solid var(--c-marque-texte); }
.stat-card.success { border-left: 4px solid var(--c-depose-trait); }
.stat-card.warning { border-left: 4px solid var(--c-urgent-trait); }
.stat-card.danger  { border-left: 4px solid var(--c-retard-trait); }
.stat-card.accent  .stat-label .icone { color: var(--c-marque-texte); }
.stat-card.success .stat-label .icone { color: var(--c-depose-texte); }
.stat-card.warning .stat-label .icone { color: var(--c-urgent-texte); }
.stat-card.danger  .stat-label .icone { color: var(--c-retard-texte); }
:root[data-theme="soleil"] .stat-label .icone { color: var(--text); }

/* Aide au survol (et au clavier) : explique un indicateur */
.aide { display: inline-grid; place-items: center; color: var(--text-muted); cursor: help; border-radius: 50%; }
.aide:hover, .aide:focus-visible { color: var(--c-marque-texte); }
.vqse-gauge-detail { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; }

/* ============================
   TABLES
   ============================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--rayon-m);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

thead th {
  background: var(--c-surface-2);
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--duree-1);
}

tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:hover { background: var(--c-survol); }

tbody td {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}

/* ============================
   BADGES / TAGS
   ============================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--rayon-pilule);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-dms     { background: var(--c-depose-fond); color: var(--c-depose-texte); }
.badge-echec   { background: var(--c-retard-fond); color: var(--c-retard-texte); }
.badge-rv, .badge-abs { background: var(--c-urgent-fond); color: var(--c-urgent-texte); }
.badge-ann     { background: var(--c-clos-fond); color: var(--c-clos-texte); }
.badge-default { background: var(--c-afaire-fond); color: var(--c-afaire-texte); }
.badge-pro     { background: var(--c-depose-fond); color: var(--c-depose-texte); border: 1px solid var(--c-depose-trait); }
.badge-inactif { background: var(--c-clos-fond); color: var(--c-clos-texte); border: 1px solid var(--border); }

.badge-planifiee  { background: var(--c-afaire-fond); color: var(--c-afaire-texte); }
.badge-en_cours   { background: var(--c-urgent-fond); color: var(--c-urgent-texte); }
.badge-realisee   { background: var(--c-depose-fond); color: var(--c-depose-texte); }
.badge-echec-stat { background: var(--c-retard-fond); color: var(--c-retard-texte); }
.badge-annulee    { background: var(--c-clos-fond); color: var(--c-clos-texte); }

/* ============================
   FILTERS BAR
   ============================ */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 16px 20px;
  background: var(--c-surface-2);
  border-radius: var(--rayon-m);
}

.filters-bar .form-group {
  margin: 0;
  min-width: 140px;
}

.filters-bar label {
  font-size: 11px;
  color: var(--text-muted);
}

.filters-bar input,
.filters-bar select {
  padding: 6px 10px;
  font-size: 12.5px;
}

/* ============================
   MODAL
   ============================ */
/* Ordre d'empilement de l'application, du fond vers la surface :
     topbar 50 · sidebar 100 · [Leaflet 100→1000] · modale 2000 · toasts 9999.
   La modale doit dépasser 1000 : c'est la valeur de .leaflet-top/.leaflet-bottom
   (les coins de contrôles de la carte), le plus haut que Leaflet produise. Elle
   doit rester SOUS les toasts, car un toast s'affiche par-dessus un formulaire
   ouvert — « Coordonnées invalides » pendant la saisie d'une VQSE, par exemple. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--c-voile);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--white);
  border: var(--bord-carte) solid var(--border);
  border-radius: var(--rayon-l);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  /* Seul le corps défile : l'en-tête et surtout les boutons du pied
     doivent rester visibles quand le formulaire est long. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--ombre-l);
  transform: translateY(-20px);
  transition: transform .2s;
}

.modal-overlay.open .modal-box { transform: translateY(0); }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}
/* Bouton « copier le ND » dans le titre d'une fiche */
.nd-copie-titre {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--c-bordure-champ); border-radius: var(--rayon-s);
  background: none; color: var(--text); cursor: pointer;
}
.nd-copie-titre:hover { background: var(--c-survol); }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}

.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  min-height: 0;   /* indispensable pour que l'enfant flex puisse rétrécir */
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* ============================
   ALERTS / TOAST
   ============================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--c-message);
  color: #fff;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  animation: slideIn .25s ease;
}

.toast.success { background: var(--c-succes-fort); }
.toast.error   { background: var(--c-danger-fort); }
.toast.warning { background: var(--c-alerte-fort); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================
   ALERT BOXES
   ============================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-danger  { background: var(--c-retard-fond); color: var(--c-retard-texte); }
.alert-warning { background: var(--c-urgent-fond); color: var(--c-urgent-texte); }
.alert-success { background: var(--c-depose-fond); color: var(--c-depose-texte); }
.alert-info    { background: var(--c-afaire-fond); color: var(--c-afaire-texte); }

/* ============================
   VQSE urgency
   ============================ */
.vqse-urgent  { background: var(--c-retard-teinte) !important; }
.vqse-warning { background: var(--c-urgent-teinte) !important; }

/* ============================
   PAGE sections
   ============================ */
.page { display: none; }
.page.active { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text);
}

/* ============================
   Charts grid
   ============================ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--rayon-m);
  padding: 20px;
  box-shadow: var(--shadow);
}

.chart-card canvas {
  max-height: 260px;
}

/* ============================
   Pagination
   ============================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.pagination button {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 12.5px;
  cursor: pointer;
}

.pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination button:disabled { opacity: .4; cursor: default; }

/* ============================
   Technicien detail
   ============================ */
.tech-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.tech-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.tech-meta { flex: 1; }
.tech-meta h2 { font-size: 20px; font-weight: 700; }
.tech-meta p  { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ============================
   Upload zone (CSV import)
   ============================ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--c-survol);
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--c-survol);
}

.upload-zone p { color: var(--text-muted); font-size: 13px; margin-top: 8px; }

/* ============================
   Responsive
   ============================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }

  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 28px 24px; }
}

/* ============================
   Loading spinner
   ============================ */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--c-bordure);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 12px;
}

/* ============================
   Empty state
   ============================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-state .icon .icone { width: 44px; height: 44px; }
.empty-state p { font-size: 14px; }

/* ============================
   Hamburger (mobile)
   ============================ */
.hamburger {
  display: none;
  place-items: center;
  background: none;
  border: none;
  border-radius: var(--rayon-m);
  cursor: pointer;
  padding: 8px;
  font-size: 20px;
  color: var(--text);
}

/* Téléphone : en-tête aux couleurs de la navigation, comme une application */
@media (max-width: 768px) {
  .hamburger { display: inline-grid; }
  .topbar { background: var(--c-nav-1); border-bottom: none; box-shadow: none; }
  .topbar-title, .topbar .hamburger { color: #fff; }
  .topbar .barre-bouton { color: #fff; border-color: rgba(255,255,255,.45); }
  .topbar .barre-bouton:hover { background: rgba(255,255,255,.12); }
  .topbar .notif-panneau, .topbar .theme-panneau { color: var(--text); }
}

/* ============================
   Misc helpers
   ============================ */
/* ============================
   V2 — Onglets tableau de bord
   ============================ */
.dash-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--rayon-s) var(--rayon-s) 0 0;
}
.dash-tabs { flex-wrap: wrap; }

.dash-tab:hover { background: var(--bg); color: var(--text); }
.dash-tab.active { color: var(--c-marque-texte); border-bottom-color: var(--c-marque-texte); }

/* ============================
   V2 — Badges retard & types
   ============================ */
.badge-retard    { background: var(--c-retard-fond); color: var(--c-retard-texte); }
.badge-retard-ok { background: var(--c-urgent-fond); color: var(--c-urgent-texte); }

.badge-type-default { background: var(--c-clos-fond); color: var(--c-clos-texte); }
.badge-type-plp     { background: var(--c-urgent-fond); color: var(--c-urgent-texte); }  /* jaune : PLP / SAV / câbles */
.badge-type-inst    { background: var(--c-depose-fond); color: var(--c-depose-texte); }  /* vert : installations */
.badge-type-lm      { background: var(--c-afaire-fond); color: var(--c-afaire-texte); }  /* bleu : liaisons / mesures */

/* ============================
   V2 — Coloration des lignes (interventions)
   ============================ */
tbody tr.row-late    { background: var(--c-retard-teinte) !important; box-shadow: inset 3px 0 0 var(--danger); }
tbody tr.row-echec   { box-shadow: inset 3px 0 0 var(--danger); }
tbody tr.row-reussi  { box-shadow: inset 3px 0 0 var(--success); }
tbody tr.row-absent  { box-shadow: inset 3px 0 0 var(--warning); }
tbody tr.row-reporte { box-shadow: inset 3px 0 0 var(--info); }

/* ============================
   V2 — Classement / rendement
   ============================ */
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
}

.progress {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 6px;
  transition: width .3s;
}

.rendement-kpis {
  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 768px) {
  .rendement-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ============================
   V2 — Gauge (VQSE)
   ============================ */
.vqse-gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gauge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-hole {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-val { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.gauge-lbl { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }

/* ============================
   V9 — Arrêtés : badge « Transmis »
   ============================ */
.badge-transmis { background: var(--c-afaire-fond); color: var(--c-afaire-texte); }

/* ============================
   V3 — Réconciliation (popup)
   ============================ */
.recon-suggest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg);
}

.recon-suggest > div { font-size: 13.5px; }

.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ============================
   V11 — Convertisseur de liste : vue deux panneaux
   ============================ */
.conv-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* deux panneaux de largeur égale */
  gap: 16px;
  align-items: stretch;
}

.conv-panel {
  display: flex;
  flex-direction: column;
  min-height: 62vh;
  min-width: 0;          /* sans quoi un contenu large fait déborder la grille */
  overflow: hidden;      /* les coins arrondis rognent le contenu */
}

/* La zone centrale d'un panneau prend toute la hauteur restante */
.conv-panel-body { flex: 1; min-height: 0; display: flex; }
/* Colonne défilante : garde le `margin:auto` de l'état vide opérant sur les
   deux axes, tout en empêchant le tableau d'être compressé. */
.conv-scroll     { overflow-y: auto; flex-direction: column; }
.conv-scroll > * { flex-shrink: 0; }

/* Le textarea occupe tout le panneau : pas de bordure propre, c'est la carte
   qui fait le cadre. On neutralise donc les styles globaux des champs. */
.conv-textarea {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 0;
  resize: none;
  padding: 14px 16px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--white);
  min-height: 0;
}
.conv-textarea:focus { border: none; box-shadow: inset 0 0 0 2px var(--c-focus); }

.conv-panel-foot {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--row-alt);
  flex-shrink: 0;
}
.conv-actions { justify-content: flex-start; }

/* Date des interventions à enregistrer (la liste collée n'en contient pas) */
.conv-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
}
.conv-date input { width: auto; padding: 6px 8px; }
.conv-ecartees table td { vertical-align: middle; }
/* Technicien manquant : menu + « Importer » sur la ligne écartée */
.conv-choix-tech { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.conv-choix-tech select { width: auto; min-width: 170px; max-width: 240px; padding: 5px 8px; }
tbody tr.conv-tech-manquant td:first-child { box-shadow: inset 3px 0 0 var(--danger, #c0392b); }

/* Bouton central */
.conv-mid { display: flex; align-items: center; justify-content: center; }

.conv-go {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--c-sur-marque);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.conv-go:hover  { background: var(--accent-hover); transform: scale(1.05); box-shadow: 0 8px 16px rgba(0,0,0,.14); }
.conv-go:active { transform: scale(.97); }
.conv-go-icon   { font-size: 22px; line-height: 1; }
.conv-go-lbl    { font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.conv-go-icon .v { display: none; }   /* la flèche ↓ ne sert qu'en mobile */

/* Tableau du résultat : en-têtes fixes pendant le défilement */
.conv-scroll table       { border-collapse: separate; border-spacing: 0; }
.conv-scroll thead th    { position: sticky; top: 0; z-index: 1; }
.conv-scroll tbody td    { border-bottom: 1px solid var(--border); }

/* Ligne à vérifier — même convention que les .row-* des interventions */
tbody tr.conv-suspect {
  background: var(--c-urgent-teinte) !important;
  box-shadow: inset 3px 0 0 var(--warning);
}

/* Apparition douce du résultat */
@keyframes convFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.conv-fade { animation: convFade .18s ease-out; }

@media (max-width: 900px) {
  .conv-layout { grid-template-columns: 1fr; }   /* panneaux empilés */
  .conv-panel  { min-height: 44vh; }
  .conv-go     { flex-direction: row; gap: 8px; padding: 12px 22px; }
  .conv-go-icon .h { display: none; }
  .conv-go-icon .v { display: inline; }          /* la flèche pointe vers le bas */
}

/* ============================
   Utilitaires partagés (zones de collage, popups de carte)
   ------------------------------------------------------------
   Les classes .plan-* gardent leur nom d'origine (module Planning,
   retiré — docs/decisions/0017) : le SAV du jour et la Carte VQSE
   s'en servent.
   ============================ */

/* Utilitaires de couleur de texte (manquaient au design system) */
.text-warning { color: var(--c-urgent-texte); }
.text-danger  { color: var(--c-retard-texte); }

/* ---- Zone de collage ---- */
.plan-input {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.5;
}

/* Séparateur souple entre l'action principale et les sorties */
.plan-sep { flex: 1 1 0; min-width: 0; }

/* ---- Popups Leaflet, ramenées à la charte de l'app ---- */
.plan-popup { font-family: var(--font); font-size: 12.5px; line-height: 1.55; min-width: 190px; }
.plan-popup strong { font-size: 13px; }
/* Leaflet empile ses propres couches de 100 à 1000 (tuiles, marqueurs, bulles,
   contrôles). Sans contexte d'empilement propre, ces valeurs concourent avec
   celles de l'application : la carte passait alors PAR-DESSUS la modale, qui
   s'ouvrait bien mais restait invisible. `isolation` les enferme dans la carte,
   une fois pour toutes — sans quoi tout futur calque devrait surenchérir. */
.leaflet-container { font-family: var(--font); isolation: isolate; }

/* ============================
   SAV du jour : liste d'appels (outil jetable, rien n'est enregistré)
   ============================ */
.sav-familles { max-width: 520px; margin-bottom: 16px; }

.sav-table          { max-height: 62vh; overflow: auto; }
.sav-table thead th { position: sticky; top: 0; z-index: 1; }

/* Le numéro à composer : c'est l'information qu'on vient chercher. */
.sav-num {
  white-space: nowrap;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* Retour du client : champ court, discret, jamais enregistré. */
.sav-retour {
  width: 100%;
  min-width: 180px;
  padding: 5px 8px;
  font-size: 13px;
}

/* Numéro absent : à retrouver avant d'appeler
   (même convention que .conv-suspect du convertisseur). */
tbody tr.sav-sans-num {
  background: var(--c-urgent-teinte) !important;
  box-shadow: inset 3px 0 0 var(--warning);
}

/* Appelé : la ligne s'efface pour ne laisser voir que le reste à faire. */
tbody tr.sav-fait {
  background: var(--row-alt) !important;
  box-shadow: inset 3px 0 0 var(--success);
  opacity: .5;
}
tbody tr.sav-fait td       { text-decoration: line-through; }
tbody tr.sav-fait .sav-retour,
tbody tr.sav-fait .sav-check { text-decoration: none; opacity: 1; }
tbody tr.sav-fait:hover      { opacity: 1; }

.sav-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--success); }

/* ============================
   V13 — Carte VQSE : points GPS + statut
   ============================ */
.cvqse-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

/* La carte occupe toute sa carte : les coins arrondis rognent les tuiles. */
.cvqse-carte-carte { overflow: hidden; }
#cvqse-map {
  height: 620px;
  width: 100%;
  background: var(--row-alt);
}

/* Légende sous la carte : deux couleurs, deux états, rien de plus. */
.cvqse-legende {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--row-alt);
  font-size: 12.5px;
  color: var(--text-muted);
}
.cvqse-legende i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}

/* Bilan chiffré dans la barre de filtres : c'est un texte, pas un champ. */
.cvqse-bilan { min-width: auto; }
.cvqse-bilan .text-muted { font-size: 13px; white-space: nowrap; padding-top: 6px; }

/* ---- Panneau liste, il défile avec la carte ---- */
.cvqse-panneau { display: flex; flex-direction: column; max-height: 680px; overflow: hidden; }
.cvqse-liste   { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }

.cvqse-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--white);
}
/* Faite : en retrait, pour que l'œil aille sur ce qui reste à faire. */
.cvqse-item-faite { background: var(--row-alt); opacity: .72; }
.cvqse-item-faite:hover { opacity: 1; }

.cvqse-item-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.cvqse-item-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cvqse-item-head .badge { margin-left: auto; flex-shrink: 0; }

.cvqse-item-gps {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.cvqse-item-note { font-size: 12.5px; margin-top: 4px; }

.cvqse-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* Pastille de statut */
.cvqse-pastille {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Boutons dans la bulle Leaflet : la popup est étroite, ils passent en pile. */
.cvqse-popup-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

@media (max-width: 1000px) {
  .cvqse-layout  { grid-template-columns: 1fr; }   /* la liste passe sous la carte */
  #cvqse-map     { height: 420px; }
  .cvqse-panneau { max-height: none; }
}

/* ---- Notifications (modules/notifications.js) ---- */
.notif-cloche { position: relative; }
.notif-bouton { position: relative; }
.notif-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 10px; background: var(--c-pastille); color: var(--c-sur-pastille);
  font-size: 12px; font-weight: 800; line-height: 20px; text-align: center;
}
.notif-panneau {
  position: absolute; right: 0; top: 42px; width: min(360px, calc(100vw - 32px));
  max-height: 70vh; overflow-y: auto; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--rayon-m);
  box-shadow: var(--ombre-l); z-index: 200;
}
.notif-entete {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.notif-item {
  display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 12px;
  background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer;
  color: var(--text); font-family: var(--font);
}
.notif-item:hover { background: var(--c-survol); }
.notif-non-lue { background: var(--c-afaire-fond); font-weight: 700; }
.notif-texte { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }

/* ---- Fichiers des VQSE (modules/vqse-fichiers.js) ---- */
.vfic-grille { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.vfic-vignette { position: relative; width: 84px; height: 84px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.vfic-vignette img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.vfic-vignette button {
  position: absolute; top: 2px; right: 2px; border: none; border-radius: 4px;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; cursor: pointer;
}
.vfic-doc { display: inline-flex; align-items: center; gap: 6px; margin: 4px 8px 4px 0; }

/* ---- Coordonnées GPS (core/gps.js) ---- */
.gps-apercu { font-size: 12px; margin-top: 4px; min-height: 16px; }
.gps-apercu.gps-ok { color: var(--c-depose-texte); }
.gps-apercu.gps-erreur { color: var(--c-retard-texte); }
.gps-itineraire { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cvqse-couches { display: flex; gap: 12px; align-items: center; min-height: 36px; }
.cvqse-couches label { display: flex; gap: 6px; align-items: center; font-weight: normal; margin: 0; }

/* ============================
   Espace technicien sur mobile — audit du 30/09/2026
   (docs/bilans/2026-09-30-audit-mobile-technicien.md)
   Rien ne change au-dessus de 768 px, sauf mention.
   ============================ */

/* Point 1 — VQSE en cartes sur mobile, tableau sur ordinateur */
.vqse-cartes { display: none; }
.vqse-carte {
  background: var(--white);
  border: var(--bord-carte) solid var(--border);
  border-radius: var(--rayon-l);
  padding: 16px;
  box-shadow: var(--ombre-m);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* En retard / urgent : liseré de couleur autour de la carte (la pastille
   porte l'icône et le texte : la couleur n'est jamais seule) */
.vqse-carte-retard { box-shadow: 0 0 0 2px var(--c-retard-trait), var(--ombre-m); }
.vqse-carte-urgent { box-shadow: 0 0 0 2px var(--c-urgent-trait), var(--ombre-m); }
.vqse-carte-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.vqse-carte .vqse-carte-nd { font-size: 21px; }
.vqse-carte-quoi { font-size: 16px; }
/* Libellé à gauche, valeur à droite : une valeur longue se replie dans sa colonne */
.vqse-carte-ligne { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px; align-items: baseline; font-weight: var(--graisse-fort); }
.vqse-carte-lib { color: var(--text-muted); font-weight: var(--graisse-texte); }
.vqse-delai { font-weight: var(--graisse-fort); }

/* Actions : le bouton principal, puis un bouton « Itinéraire » par point
   (icône au-dessus du libellé). Deux points : ils passent sous le bouton. */
.vqse-carte-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 6px; }
.vqse-carte-actions-1 { grid-template-columns: 1fr auto; }
.vqse-carte-actions-2 { grid-template-columns: 1fr 1fr; }
.vqse-carte-actions-2 .vqse-carte-principal { grid-column: 1 / -1; }
.vqse-carte-principal { justify-content: center; min-height: 52px; font-size: 16px; border-radius: var(--rayon-m); }
.vqse-carte-itineraire {
  flex-direction: column; justify-content: center; gap: 2px;
  min-height: 52px; min-width: 84px; padding: 6px 10px;
  border-radius: var(--rayon-m); font-size: 12px; line-height: 1.2; white-space: nowrap;
}
.vqse-carte-itineraire .icone { width: 20px; height: 20px; }
.vqse-carte-gestion { display: flex; flex-wrap: wrap; gap: 8px; }

/* VQSE d'un collègue (onglet « Toutes ») : lecture seule, en retrait */
.vqse-carte-lecture { background: var(--c-surface-2); box-shadow: none; border: 1px solid var(--border); }
.vqse-carte-lecture.vqse-carte-retard, .vqse-carte-lecture.vqse-carte-urgent { box-shadow: none; }
.vqse-carte-lecture .vqse-carte-nd { font-size: 18px; }
.vqse-carte-mention { display: flex; align-items: flex-start; gap: 6px; color: var(--text-muted); font-size: 14px; }
.vqse-carte-mention strong { color: var(--text); }

/* ND : un appui copie le numéro sans espaces (core/ui.js) */
.nd { font-weight: 800; white-space: nowrap; }
.nd small { font-size: .62em; font-weight: 700; letter-spacing: .06em; color: var(--text-muted); }
.nd-copie {
  display: inline-flex; align-items: baseline; gap: 6px;
  margin: 0; padding: 2px 6px 2px 0; border: none; border-radius: var(--rayon-s);
  background: none; color: var(--text); font-family: var(--font); font-size: inherit;
  cursor: pointer; text-align: left;
}
.nd-copie .chiffres { letter-spacing: .02em; }
td .nd small { display: none; }            /* la colonne s'appelle déjà « ND » */
.nd-icone { width: .7em; height: .7em; color: var(--text-muted); align-self: center; }
.nd-copie:hover .nd-icone, .nd-copie:active .nd-icone { color: var(--c-marque-texte); }

/* Résumé et onglets du technicien */
.vqse-resume { color: var(--text-muted); font-size: 16px; margin: -12px 0 14px; }
.onglets-puces { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.puce {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--cible); padding: 0 18px;
  border: 1px solid var(--c-bordure-champ); border-radius: var(--rayon-pilule);
  background: var(--white); color: var(--text); font: 700 15px var(--font); cursor: pointer;
}
.puce.active { background: var(--c-marque); border-color: var(--c-marque); color: var(--c-sur-marque); }

/* Filtres repliés sur téléphone (ils prenaient tout l'écran avant la
   liste). Sur ordinateur : toujours ouverts, sans ligne de titre. */
.filtres-repli > summary {
  display: flex; align-items: center; gap: 8px; min-height: var(--cible); padding: 0 16px;
  font-weight: 700; cursor: pointer; list-style: none;
}
.filtres-repli > summary::-webkit-details-marker { display: none; }
.filtres-repli[open] > summary { border-bottom: 1px solid var(--border); }
.filtres-repli .filters-bar { border-bottom: none; border-radius: var(--rayon-m); }
@media (min-width: 769px) { .filtres-repli > summary { display: none; } }

@media (max-width: 768px) {
  .vqse-tableau { display: none; }
  .vqse-cartes  { display: grid; gap: 12px; }
}

/* Point 2 — fiche VQSE : sections repliables ; sur téléphone, fenêtre
   plein écran, pied fixe (bouton « Déposer » sous le pouce) */
.vqse-section {
  border: 1px solid var(--border);
  border-radius: var(--rayon-m);
  margin-top: 12px;
  background: var(--white);
}
.vqse-section > summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  min-height: 48px;
  display: flex;
  align-items: center;
}
.vqse-section[open] > summary { border-bottom: 1px solid var(--border); }
.vqse-section > :not(summary) { margin: 12px; }

@media (max-width: 768px) {
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal-box {
    max-width: none;
    max-height: none;
    height: 100vh;
    height: 100dvh;           /* barre d'adresse mobile prise en compte */
    border-radius: 0;
  }
  .modal-header { padding: 12px 16px; }
  .modal-body   { padding: 16px; }
  .modal-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    flex-wrap: wrap;
  }
  .modal-footer .vqse-bouton-depot {
    flex: 1 1 100%;
    order: 2;                 /* en dernier : le plus près du pouce */
    justify-content: center;
    min-height: 52px;
    font-size: 17px;
  }
  .vqse-depot { margin-top: 0 !important; }
}

/* Point 3 — cibles tactiles pour doigts gantés : 48 px minimum (44 px pour
   le ✕ posé sur une vignette), 8 px d'écart. Écrans TACTILES uniquement
   (pointer: coarse) : rien ne change à la souris. */
@media (pointer: coarse) {
  .btn, .btn-sm {
    min-height: 48px;
    padding: 10px 16px;
  }
  .btn-sm { min-width: 48px; justify-content: center; }
  td .btn, .vfic-doc .btn, .cvqse-item-actions .btn { margin: 4px 8px 4px 0; }
  .modal-footer, .gps-itineraire, .vqse-carte-actions, .cvqse-item-actions { gap: 8px; }
  .modal-close { min-width: 48px; min-height: 48px; font-size: 26px; }
  .hamburger { min-width: 48px; min-height: 48px; }
  .nav-item { min-height: 48px; }
  input[type="text"], input[type="date"], input[type="search"], select { min-height: 48px; }
  input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; }
  .vfic-grille { gap: 10px; }
  .vfic-vignette { width: 104px; height: 104px; }
  .vfic-vignette button {
    width: 44px; height: 44px;
    font-size: 18px;
    border-radius: 0 0 0 10px;
    top: 0; right: 0;
  }
}

/* Point 4 — choix des photos avant envoi : deux gros boutons, vignettes,
   compteur. Le <input type="file"> reste dans la page (le libellé le
   déclenche) mais invisible : pas de display:none, que certains navigateurs
   mobiles refusent de déclencher. */
.vfic-cache {
  position: absolute; width: 1px; height: 1px; opacity: 0;
  overflow: hidden; clip: rect(0 0 0 0); pointer-events: none;
}
.vfic-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vfic-choix-bouton { position: relative; justify-content: center; min-height: 56px; font-size: 16px; cursor: pointer; }
.vfic-choix-bouton:focus-within { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.vfic-choix-bouton { border-radius: var(--rayon-m); }

/* Interventions : cartes sur téléphone, tableau sur ordinateur */
.int-cartes { display: none; }
.int-carte-pastilles { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 768px) {
  .int-tableau { display: none; }
  .int-cartes  { display: grid; gap: 12px; }
  .section-header { margin-bottom: 12px; }
}
/* Un seul titre par écran, sur téléphone comme sur ordinateur : celui de
   la barre du haut. Le titre de page reste dans le HTML pour les lecteurs
   d'écran (masqué visuellement, pas supprimé). */
.section-header .section-title {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.section-header { justify-content: flex-end; min-height: 0; }
.vqse-resume { margin-top: 0; }
/* Pied de fenêtre sans bouton : pas de bandeau vide */
.modal-footer:empty { display: none; }
.vfic-compteur { margin-top: 6px; font-size: 14px; color: var(--text); }
@media (max-width: 480px) { .vfic-choix { grid-template-columns: 1fr; } }

/* Point 5 — état de chaque photo pendant l'envoi, « Réessayer » */
.vfic-etat {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3px 4px; font-size: 12px; font-weight: 700; text-align: center;
  color: #fff; background: rgba(17, 24, 39, .75);
}
.vfic-etat-ok    .vfic-etat { background: var(--c-succes-fort); }
.vfic-etat-echec .vfic-etat { background: var(--c-danger-fort); }
.vfic-etat-echec { outline: 3px solid var(--c-danger-fort); }
.vfic-etat-envoi img { opacity: .6; }
.vfic-reessayer { flex: 1 1 100%; justify-content: center; min-height: 48px; font-size: 16px; }

/* Point 6 — texte lisible sur téléphone, sans zoom automatique :
   Safari (iPhone) zoome sur tout champ écrit en moins de 16 px. */
.vqse-rep-commentaire { font-size: 12px; margin-top: 4px; white-space: pre-wrap; }
.vqse-principal { font-size: 11px; }

@media (max-width: 768px) {
  body { font-size: 15px; }
  input[type="text"], input[type="password"], input[type="email"], input[type="date"],
  input[type="tel"], input[type="search"], select, textarea,
  .filters-bar input, .filters-bar select { font-size: 16px; }
  .form-group label, .filters-bar label { font-size: 14px; }
  .btn, .btn-sm { font-size: 15px; }
  .vqse-carte-principal, .vfic-choix-bouton, .vfic-reessayer { font-size: 17px; }
  .badge { font-size: 13px; padding: 3px 9px; }
  .modal-title { font-size: 18px; }
  .toast { font-size: 15px; }
  .vqse-rep-commentaire { font-size: 15px; }
  .vqse-principal { font-size: 13px; }
  .vfic-etat { font-size: 13px; }
}

/* ============================
   Administration › Marque (modules/admin.js, core/marque.js)
   ============================ */
.marque-admin { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 360px); gap: 20px; align-items: start; }
@media (max-width: 960px) { .marque-admin { grid-template-columns: minmax(0, 1fr); } }
.marque-titre { font-size: 15px; margin-bottom: 8px; }
.marque-intro { font-size: 13px; margin-bottom: 16px; }
.marque-aide { font-size: 12px; margin-top: 6px; }
.marque-libelle { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.marque-teintes { display: flex; flex-wrap: wrap; gap: 8px; }
.marque-teinte {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  background: var(--white); color: var(--text); border: 1.5px solid var(--c-bordure-champ);
  border-radius: var(--rayon-m); font: 600 14px var(--font); cursor: pointer;
}
.marque-teinte:hover { background: var(--c-survol); }
.marque-teinte[aria-checked="true"] { border-color: var(--c-marque-texte); box-shadow: 0 0 0 1px var(--c-marque-texte); }
.marque-teinte .marque-coche { visibility: hidden; }
.marque-teinte[aria-checked="true"] .marque-coche { visibility: visible; }
.marque-pastille { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .25); }
.marque-logo-ligne { display: flex; gap: 14px; align-items: flex-start; }
.marque-logo-grand { width: 72px; height: 72px; font-size: 26px; border: 1px solid var(--border); }
.marque-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.marque-apercu { border: 1px solid var(--border); border-radius: var(--rayon-m); overflow: hidden; }
.marque-apercu-nav { display: flex; align-items: center; gap: 10px; padding: 16px; background: var(--degrade-nav); }
.marque-apercu-nav .brand { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2; overflow-wrap: anywhere; }
.marque-apercu-nav .sub { font-size: 12px; color: var(--c-nav-texte); overflow-wrap: anywhere; }
.marque-apercu-corps { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
.marque-apercu-lien { color: var(--c-marque-texte); font-weight: 700; border-bottom: 2px solid var(--c-marque-texte); padding-bottom: 2px; }
.marque-apercu-fond { background: var(--c-marque-fond); color: var(--c-marque-texte); font-weight: 600; padding: 6px 12px; border-radius: var(--rayon-s); }

/* ============================
   Guide de démarrage (modules/guide.js)
   ============================ */
.guide-voile {
  position: fixed; inset: 0; z-index: 2500; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--c-voile);
}
.guide-carte {
  width: 100%; max-width: 460px; max-height: calc(100dvh - 40px); overflow-y: auto;
  padding: 20px 24px 18px; background: var(--white); color: var(--text);
  border: var(--bord-carte) solid var(--border); border-radius: var(--rayon-l); box-shadow: var(--ombre-l);
  text-align: center;
}
.guide-entete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.guide-compteur { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.guide-fermer {
  display: inline-grid; place-items: center; width: var(--cible); height: var(--cible); margin: -8px -12px -8px 0;
  background: none; border: none; border-radius: var(--rayon-m); color: var(--text); font-size: 18px; cursor: pointer;
}
.guide-fermer:hover { background: var(--c-survol); }
.guide-icone {
  display: inline-grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 12px;
  border-radius: var(--rayon-l); background: var(--c-marque-fond); color: var(--c-marque-texte); font-size: 28px;
}
.guide-titre { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 8px; }
.guide-texte { font-size: 15px; line-height: 1.55; text-align: left; }
.guide-lien {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--cible); margin-top: 4px; padding: 0 8px;
  background: none; border: none; color: var(--c-marque-texte); font: 700 14px var(--font); cursor: pointer;
}
.guide-lien:hover { text-decoration: underline; }
.guide-points { display: flex; justify-content: center; gap: 8px; margin: 10px 0 16px; }
.guide-point { width: 8px; height: 8px; border-radius: 50%; background: var(--c-bordure-champ); }
.guide-point.actif { width: 22px; border-radius: var(--rayon-pilule); background: var(--c-marque-texte); }
.guide-actions { display: flex; justify-content: space-between; gap: 8px; }
.guide-actions .btn { min-height: var(--cible); padding: 0 18px; font-size: 15px; }
.guide-rappel { margin-top: 14px; font-size: 12px; color: var(--text-muted); }
@media (max-width: 768px) {
  .guide-voile { align-items: flex-end; padding: 0; }
  .guide-carte { max-width: none; max-height: 92dvh; border-radius: var(--rayon-l) var(--rayon-l) 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .guide-actions .btn { flex: 1; justify-content: center; }
}

/* ============================================================
   Saisie rapide des résultats (modules/saisie-resultats.js)
   ============================================================ */
.saisie-boutons { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.btn-combo {
  background: var(--c-surface-2); color: var(--text);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.btn-combo:hover { background: var(--c-survol); border-color: var(--c-marque); }
.btn-combo.actif, .btn-choix.actif {
  background: var(--c-marque); color: var(--c-sur-marque); border-color: var(--c-marque);
}
.btn-choix { background: var(--white); color: var(--text); border: 1px solid var(--c-bordure-champ); }
.btn-choix:hover { border-color: var(--c-marque); }
.btn-choix small, .btn-combo small { opacity: .75; font-weight: 400; margin-left: 4px; }
.int-col-choix { width: 32px; text-align: center; }
/* Interventions (admin, responsable) : ligne allégée, saisie directe du
   résultat, du palier et de la référence (toujours visibles, même vides). */
#tbody-interventions tr { background: var(--white); }
#tbody-interventions tr.int-impaire { background: var(--row-alt); }
#tbody-interventions tr.row-choisie { background: var(--c-afaire-fond); }
/* Technicien filtré : « X à remplir sur Y » */
.int-compteur {
  display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center;
  padding: 8px 14px; margin-bottom: 12px; font-size: 14px;
  background: var(--c-surface-2); border: 1px solid var(--border); border-radius: var(--rayon-m);
}
.int-compteur .icone { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
.int-compteur-reste { color: var(--c-urgent-texte); }
.int-compteur-fini { background: var(--c-depose-fond); color: var(--c-depose-texte); }
#tbody-interventions tr.int-ligne td { padding: 6px 8px; vertical-align: middle; }
.int-col-tech { font-weight: 600; }
.int-col-date { white-space: nowrap; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.int-date { display: block; margin-top: 2px; }
.int-retard { display: block; font-weight: 700; color: var(--c-retard-texte); }
.int-col-saisie { width: 1%; }
.int-actions { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
/* Écran large : tout sur une ligne ; en dessous, les actions passent à la ligne plutôt que de déborder */
@media (min-width: 1400px) { #tbody-interventions .int-actions { flex-wrap: nowrap; } }
.int-actions-fin { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.int-actions .saisie-pec { margin-bottom: 0; white-space: nowrap; }
.sd-trio, .sd-entetes { display: flex; gap: 6px; align-items: center; }
.sd-resultat { width: 76px; flex: 0 0 76px; }
.sd-palie { width: 90px; flex: 0 0 90px; }
.sd-reference { width: 140px; flex: 0 0 140px; }
.sd-champ {
  box-sizing: border-box; padding: 5px 7px; font-size: 13px; font-weight: 600; text-transform: uppercase;
  font-variant-numeric: tabular-nums; background: var(--white);
}
/* La flèche de la liste de suggestions rognait le texte (DMS, ECHEC) */
.sd-champ::-webkit-calendar-picker-indicator { display: none !important; }
.sd-champ::placeholder { font-size: 12px; font-weight: 400; text-transform: none; color: var(--text-muted); opacity: .7; }
.sd-trio-erreur .sd-champ { border-color: var(--danger); }
.sd-avert:empty { display: none; }
.sd-avert-boite { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 6px 0 0; padding: 6px 10px; font-size: 12.5px; }
.sd-avert-actions { display: inline-flex; gap: 6px; }
.sd-etat { display: inline-flex; align-items: center; gap: 4px; min-width: 96px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--text-muted); }
.sd-etat .icone { width: 14px; height: 14px; }
.sd-etat-ok { color: var(--c-depose-texte); }
.sd-etat-erreur, .sd-etat-attente { color: var(--c-retard-texte); }
.sd-etat-detail { font-weight: 400; white-space: normal; }
tbody tr[data-id]:focus-visible { outline: 3px solid var(--c-focus); outline-offset: -3px; }
tbody tr.row-choisie { background: var(--c-afaire-fond); }

.saisie-marqueurs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.saisie-cable { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.saisie-cable input { width: auto; }
.int-marqueurs-form { align-items: center; gap: 16px; margin-bottom: 12px; }

/* Barre de saisie en lot */
.saisie-lot {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--c-afaire-fond); color: var(--c-afaire-texte);
  border: 1px solid var(--border); border-radius: var(--rayon-m); box-shadow: var(--ombre-m);
}
.saisie-lot-tete { display: flex; gap: 6px; align-items: baseline; }

/* Bandeau « N prises en charge » */
.saisie-pec {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px;
  padding: 2px 8px; font-size: 11px; font-weight: 600; cursor: pointer;
  border-radius: var(--rayon-pilule); border: 1px solid var(--border);
  background: var(--c-clos-fond); color: var(--c-clos-texte);
}
.saisie-pec-alerte { background: var(--c-urgent-fond); color: var(--c-urgent-texte); }
.saisie-pec .icone { width: 14px; height: 14px; }
.saisie-pec-derniere td { background: var(--c-depose-fond); }
.saisie-pec-choix { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.saisie-pec-choix label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.saisie-pec-choix input { width: auto; }
.saisie-pec-liste { padding-left: 18px; display: grid; gap: 6px; }

/* Panneau « Autre… » */
.modal-box.modal-large { max-width: 980px; }
.saisie-cible { margin-bottom: 12px; color: var(--text-muted); }
.saisie-aide { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.saisie-titre { font-size: 14px; margin: 16px 0 8px; }
.saisie-liste { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.saisie-option {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 12px; text-align: left; cursor: pointer;
  background: var(--white); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--rayon-s); font: inherit;
}
.saisie-option:hover { background: var(--c-survol); }
.saisie-option.actif { border-color: var(--c-marque); box-shadow: inset 3px 0 0 var(--c-marque); background: var(--c-survol); }
.saisie-option-libelle { font-weight: 600; }
.saisie-option-nb { font-size: 12px; color: var(--text-muted); }
.saisie-vide { padding: 8px 0; }
.saisie-compo { display: grid; gap: 10px; }
.saisie-etape { display: grid; gap: 6px; }
.saisie-etape-titre { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.saisie-groupe { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.saisie-groupe-titre { font-size: 12px; color: var(--text-muted); min-width: 140px; }
.saisie-apercu {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  padding: 10px 12px; border-radius: var(--rayon-m);
  background: var(--c-surface-2); border: 1px solid var(--border);
}
.saisie-apercu .btn-primary { margin-left: auto; }
.saisie-manuelle { margin-top: 16px; }
.saisie-manuelle summary { cursor: pointer; color: var(--text-muted); margin-bottom: 8px; }
.saisie-anomalies ul, .saisie-motifs { margin: 0; padding-left: 18px; }
.saisie-confirmer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.saisie-comptes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.saisie-controle-table { max-height: 55vh; overflow-y: auto; }
.saisie-motif-erreur { color: var(--c-retard-texte); }
.saisie-motif-alerte { color: var(--c-urgent-texte); }

/* Écran Exports : un bloc repliable par mois couvert */
.expo-sans-tech { margin-bottom: 12px; }
.expo-sans-tech ul { margin: 6px 0 8px 18px; }
.expo-aide { margin-bottom: 12px; color: var(--text-muted); font-size: 13px; }
.expo-mois { margin-bottom: 12px; padding: 0; overflow: hidden; }
.expo-mois > summary { padding: 12px 16px; cursor: pointer; text-transform: capitalize; }
.expo-mois > summary .text-muted { text-transform: none; }
.expo-mois .table-wrapper { border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }
/* Téléphone : « Télécharger » doit rester visible sans défilement */
@media (max-width: 768px) {
  .expo-secondaire { display: none; }
  .expo-mois th, .expo-mois td { padding-left: 8px; padding-right: 8px; }
}

/* Import : lignes écartées, visibles avant d'importer */
.import-ecartees { margin-top: 12px; }
.import-ecartees table td { vertical-align: middle; }

/* Carte (téléphone) : les trois mêmes champs sous les informations */
.int-carte-saisie { display: grid; gap: 6px; margin-top: 8px; }
.int-carte-saisie .sd-trio { display: grid; grid-template-columns: 1.15fr 1fr 1.6fr; }
.int-carte-saisie .sd-champ { width: auto; min-width: 0; }
.int-carte-saisie .int-actions { flex-wrap: wrap; }
@media (pointer: coarse) {
  .btn-combo, .btn-choix { min-height: 48px; }
  .saisie-option { min-height: 48px; }
  .sd-champ, .sd-remplir { min-height: 48px; font-size: 16px; }
}
#tbody-interventions tr.int-ligne:hover { background: var(--c-survol); }

/* Panneau « Autre… » : recherche à gauche, composeur à droite (écran large) */
.saisie-panneau { display: grid; gap: 16px 28px; }
@media (min-width: 900px) {
  .saisie-panneau { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
  .saisie-panneau-droite .saisie-titre { margin-top: 0; }
}
.saisie-apercu .btn-primary { margin-left: auto; }
