﻿/* =========================================================================
   views.css — styles propres a chaque ecran
   ========================================================================= */

/* -------------------------------------------------------------------------
   Connexion
   ------------------------------------------------------------------------- */

.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-5);
  max-width: 420px;
  margin-inline: auto;
  padding: calc(var(--sat) + var(--sp-7)) var(--gutter) calc(var(--sab) + var(--sp-7));
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.login-mark {
  width: 84px; height: 84px;
  border-radius: 24px;
  box-shadow: 0 18px 40px -18px rgba(13, 42, 25, 0.7);
  animation: mark-in var(--t-slow) var(--ease-spring) both;
}
@keyframes mark-in { from { opacity: 0; transform: translateY(14px) scale(0.86); } to { opacity: 1; transform: none; } }
.login-brand h1 { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; text-align: center; }
.login-brand p { font-size: 14px; color: var(--ink-mute); text-align: center; }

.login-card { padding: var(--sp-5); animation: view-in var(--t-slow) var(--ease-out) both; animation-delay: 60ms; }
.login-foot { text-align: center; font-size: 12px; color: var(--ink-mute); line-height: 1.6; }

.lang-picker { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.lang-btn {
  min-width: 54px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--glass-bg-lo);
  border: 1px solid var(--glass-stroke);
  transition: all var(--t-fast) var(--ease-spring);
}
.lang-btn[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(160deg, var(--green-500), var(--green-700));
  border-color: transparent;
  box-shadow: 0 6px 14px -8px rgba(26, 87, 48, 0.8);
}
.lang-btn:active { transform: scale(0.94); }

/* -------------------------------------------------------------------------
   Accueil
   ------------------------------------------------------------------------- */

.hero { padding: var(--sp-2) var(--sp-1) var(--sp-4); }
.hero .hello { font-size: 27px; font-weight: 750; letter-spacing: -0.025em; }
.hero .date { font-size: 14px; color: var(--ink-mute); margin-top: 2px; text-transform: capitalize; }

/* Carte "creneau en cours" : ce que le collaborateur doit scanner maintenant */
.now-card { padding: var(--sp-5); overflow: hidden; }
.now-card .flag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.now-card .flag .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-500) 60%, transparent);
  animation: pulse 2.2s var(--ease-out) infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.now-card h2 { font-size: 22px; font-weight: 720; letter-spacing: -0.02em; margin-top: var(--sp-2); }
.now-card .when { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.now-card .when svg { width: 15px; height: 15px; }
.now-card .cta-row { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.now-card .cta-row .btn { flex: 1; }

.qr-mini {
  display: grid; place-items: center;
  width: 74px; height: 74px; flex: none;
  padding: 6px;
  border-radius: var(--r-sm);
  background: #fff;
  box-shadow: 0 6px 18px -8px rgba(13, 42, 25, 0.5);
}
.qr-mini svg { width: 100%; height: 100%; }

/* Planning heure par heure */
.timeline { position: relative; display: flex; flex-direction: column; }
.timeline::before {
  content: "";
  position: absolute;
  left: 54px; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom,
    transparent, color-mix(in srgb, var(--ink) 12%, transparent) 8%,
    color-mix(in srgb, var(--ink) 12%, transparent) 92%, transparent);
}
.tl-row {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  padding: 5px 0;
  scroll-margin-top: calc(var(--topbar-h) + var(--sat) + 60px);
}
.tl-time {
  flex: none;
  width: 46px;
  padding-top: 12px;
  text-align: right;
  font-family: var(--font-num);
  font-size: 13px; font-weight: 700;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.tl-dot {
  position: absolute;
  left: 49px; top: 19px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid color-mix(in srgb, var(--ink-mute) 45%, transparent);
  z-index: 1;
}
.tl-body { flex: 1; min-width: 0; margin-left: 18px; }
.tl-slot {
  min-height: 34px;
  border-radius: var(--r-sm);
  border: 1px dashed color-mix(in srgb, var(--ink-mute) 24%, transparent);
  display: grid; place-items: center;
  font-size: 12px; color: var(--ink-mute);
}

.tl-row.is-past { opacity: 0.46; }
.tl-row.is-past .tl-dot { border-color: color-mix(in srgb, var(--ink-mute) 30%, transparent); }
.tl-row.is-now .tl-time { color: var(--accent); }
.tl-row.is-now .tl-dot {
  border-color: var(--green-500);
  background: var(--green-500);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green-400) 28%, transparent);
}

.tl-event {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%;
  padding: 12px var(--sp-4);
  border-radius: var(--r-md);
  text-align: left;
  background: var(--glass-bg);
  border: 1px solid var(--glass-stroke);
  border-left: 4px solid var(--evt, var(--green-500));
  box-shadow: var(--glass-inner);
  backdrop-filter: blur(14px) saturate(165%);
  -webkit-backdrop-filter: blur(14px) saturate(165%);
  transition: transform var(--t-fast) var(--ease-spring);
}
.tl-event:active { transform: scale(0.985); }
.tl-event .body { flex: 1; min-width: 0; }
.tl-event .title { font-size: 15px; font-weight: 640; letter-spacing: -0.01em; }
.tl-event .meta { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-mute); margin-top: 2px; }
.tl-event .meta svg { width: 13px; height: 13px; flex: none; }
.tl-event .qr-tag {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--green-400) 18%, transparent);
  color: var(--accent);
}
.tl-event .qr-tag svg { width: 18px; height: 18px; }

.tl-jump {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--sab) + 20px);
  align-self: center;
  z-index: 2;
  margin-top: var(--sp-2);
}

/* Grille d'acces rapide */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
/* Sur un ecran de 320 px, "Charger / Decharger l'entrepot" elargirait la
   colonne : on autorise la coupure et on neutralise la largeur minimale. */
.quick-grid > *, .cha-actions > * { min-width: 0; }
.quick-tile .name { overflow-wrap: anywhere; }
.quick-tile {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4);
  min-height: 108px;
  border-radius: var(--r-lg);
  text-align: left;
  background: var(--glass-bg);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  backdrop-filter: blur(18px) saturate(175%);
  -webkit-backdrop-filter: blur(18px) saturate(175%);
  transition: transform var(--t-fast) var(--ease-spring);
}
.quick-tile:active { transform: scale(0.965); }
.quick-tile .ico {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--tint, var(--green-500)) 17%, transparent);
  color: var(--tint, var(--accent));
}
.quick-tile .ico svg { width: 21px; height: 21px; }
.quick-tile .name { font-size: 14.5px; font-weight: 640; line-height: 1.25; letter-spacing: -0.01em; margin-top: auto; }
.quick-tile .note { font-size: 12px; color: var(--ink-mute); }

/* --- tuile d'action avec le QR-code affiche en clair --- */
.quick-tile.is-qr {
  align-items: center;
  gap: 10px;
  padding: 12px;
  min-height: 0;
}
.quick-tile.is-qr .qr-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: var(--r-sm);
  /* Toujours blanc, meme en theme sombre : un QR sur fond sombre ne se lit pas. */
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07);
}
.quick-tile.is-qr .qr-box svg { width: 100%; height: 100%; }
.quick-tile.is-qr .foot {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.quick-tile.is-qr .ico {
  width: 30px; height: 30px;
  border-radius: 10px;
}
.quick-tile.is-qr .ico svg { width: 17px; height: 17px; }
.quick-tile.is-qr .name {
  margin-top: 0;
  font-size: 12.5px;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

/* -------------------------------------------------------------------------
   Fournisseurs / achats
   ------------------------------------------------------------------------- */

.achat-row {
  padding: 12px 0;
  border-top: 1px solid var(--glass-stroke-2);
}
.achat-row:first-of-type { border-top: 0; padding-top: 4px; }
.achat-row[data-statut="termine"] { opacity: 0.55; }

.achat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.achat-meta .qty {
  font-family: var(--font-num);
  font-size: 12.5px; font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.achat-chantier {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 6px 9px;
  border-radius: var(--r-xs);
  font-size: 12.5px;
  color: var(--accent);
  background: color-mix(in srgb, var(--green-400) 12%, transparent);
  transition: transform var(--t-fast) var(--ease-spring);
}
.achat-chantier:active { transform: scale(0.98); }
.achat-chantier svg { width: 14px; height: 14px; }
.achat-chantier .chev { margin-left: auto; }

/* Les trois jalons : accord → commandé → récupéré */
.jalons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.jalon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 8px 6px;
  border-radius: var(--r-sm);
  font-size: 11.5px; font-weight: 620;
  color: var(--ink-mute);
  background: var(--glass-bg-lo);
  border: 1px solid var(--glass-stroke);
  transition: all var(--t-fast) var(--ease-spring);
}
.jalon span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jalon svg { width: 14px; height: 14px; }
.jalon:active { transform: scale(0.94); }
.jalon.is-ok {
  color: #fff;
  background: linear-gradient(160deg, var(--green-500), var(--green-700));
  border-color: transparent;
  box-shadow: 0 5px 12px -7px rgba(26, 87, 48, 0.85);
}

/* Séparateur « ou » entre deux moyens de relier le planning */
.separateur-ou {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-2);
  color: var(--ink-mute);
  font-size: 12px;
}
.separateur-ou::before, .separateur-ou::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-stroke-2);
}

/* Numéros du mode d'emploi de la liaison iCal */
.etape {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  flex: none;
  border-radius: 50%;
  font-family: var(--font-num);
  font-size: 12px; font-weight: 750;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Logo du fournisseur de calendrier */
.cal-logo {
  display: inline-grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 8px 20px -10px rgba(20, 32, 26, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.cal-logo.is-sm { width: 44px; height: 44px; }
.cal-logo svg { width: 60%; height: 60%; }

/* Chantier le plus proche : la ligne ouvre la fiche, les deux boutons
   appellent le client et lancent l'itineraire. */
.proche-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 0;
}
.proche-row[data-separe] { border-top: 1px solid var(--glass-stroke-2); }
.proche-ouvrir {
  min-width: 0;
  text-align: left;
  padding: 4px 6px 4px 0;
  border-radius: var(--r-sm);
  transition: transform var(--t-fast) var(--ease-spring);
}
.proche-ouvrir:active { transform: scale(0.98); }
.near-card .dist {
  font-family: var(--font-num); font-size: 20px; font-weight: 750;
  color: var(--accent); letter-spacing: -0.02em;
}

/* -------------------------------------------------------------------------
   QR-code
   ------------------------------------------------------------------------- */

.qr-stage {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4);
  padding: var(--sp-5) 0 var(--sp-2);
}
.qr-frame {
  position: relative;
  padding: 18px;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: 0 20px 50px -20px rgba(13, 42, 25, 0.55), inset 0 0 0 1px rgba(0,0,0,0.05);
  animation: qr-pop var(--t-med) var(--ease-spring) both;
}
@keyframes qr-pop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
.qr-frame svg { width: min(64vw, 250px); height: auto; }
.qr-caption { text-align: center; }
.qr-caption .t { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.qr-caption .c {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; color: var(--ink-mute); margin-top: 3px; letter-spacing: 0.02em;
}

/* Scanner camera */
.scanner {
  position: relative;
  aspect-ratio: 3 / 4;
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #0a1410;
  box-shadow: var(--glass-shadow);
}
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner-reticle {
  position: absolute; inset: 14%;
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 100vmax rgba(6, 16, 11, 0.5);
}
.scanner-reticle::before, .scanner-reticle::after,
.scanner-reticle i::before, .scanner-reticle i::after {
  content: ""; position: absolute;
  width: 34px; height: 34px;
  border: 3px solid var(--lime);
}
.scanner-reticle::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.scanner-reticle::after  { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.scanner-reticle i::before { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.scanner-reticle i::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.scanner-beam {
  position: absolute; left: 14%; right: 14%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  box-shadow: 0 0 14px var(--lime);
  animation: beam 2.4s var(--ease-out) infinite;
}
@keyframes beam { 0%, 100% { top: 16%; } 50% { top: 82%; } }
.scanner-hint {
  position: absolute; left: 0; right: 0; bottom: 14px;
  text-align: center; font-size: 13px; color: #eaf6ec;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

/* -------------------------------------------------------------------------
   Fiche chantier
   ------------------------------------------------------------------------- */

.cha-hero { padding: var(--sp-5); }
.cha-hero .name { font-size: 22px; font-weight: 730; letter-spacing: -0.02em; }
.cha-hero .addr { display: flex; gap: 7px; font-size: 14px; color: var(--ink-soft); margin-top: 5px; }
.cha-hero .addr svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

.cha-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-top: var(--sp-4); }
.cha-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 13px 6px;
  border-radius: var(--r-md);
  font-size: 11.5px; font-weight: 620; text-align: center; line-height: 1.2;
  background: var(--glass-bg-lo);
  border: 1px solid var(--glass-stroke);
  transition: transform var(--t-fast) var(--ease-spring);
}
.cha-action:active { transform: scale(0.94); }
.cha-action svg { width: 20px; height: 20px; color: var(--accent); }

/* Respiration entre l'entete du chantier et la carte des heures. */
.cha-hero + .hours-card { margin-top: var(--sp-4); }

/* Analyse de la note brute */
.note-block { padding: var(--sp-4); }
.note-block + .note-block { margin-top: var(--sp-3); }
.note-block .head .icon-btn { flex: none; }

/* Barre d'outils du resume : editer, dicter, creer une section.
   Elle s'accroche sous la barre du haut pendant le defilement — on garde ainsi
   « Texte brut », « Dicter » et « Nouvelle section » a portee de pouce quel que
   soit l'endroit du resume ou l'on se trouve. */
.note-tools {
  position: sticky;
  top: calc(var(--topbar-h) + var(--sat));
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  /* Pleine largeur du contenu : la barre masque ce qui passe dessous. */
  margin: -4px calc(var(--gutter) * -1) var(--sp-3);
  padding: 9px var(--gutter) 10px;
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
}
.note-tools .chip { padding: 7px 12px; font-size: 13px; }
.note-tools .chip svg { width: 15px; height: 15px; }

/* Lignes d'une section : la croix n'apparait que sur les ajouts manuels. */
.note-ligne {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 15px;
  line-height: 1.45;
  padding: 3px 0;
}
.btn-suppr {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  margin-left: auto;
  border-radius: var(--r-pill);
  color: var(--ink-mute);
  transition: transform var(--t-fast) var(--ease-spring), background var(--t-fast), color var(--t-fast);
}
.btn-suppr svg { width: 15px; height: 15px; }
.btn-suppr:active {
  transform: scale(0.86);
  color: var(--danger);
  background: var(--danger-bg);
}
.qa-item, .calc-item { display: flex; align-items: center; gap: var(--sp-2); }
.tick-ligne { display: flex; align-items: center; gap: 2px; }
.tick-ligne .tick { flex: 1; min-width: 0; }

/* Aide a la dictee, au-dessus de la note brute */
.dictee-aide {
  padding: var(--sp-3);
  margin: 6px 0 var(--sp-3);
  border-radius: var(--r-md);
  background: var(--glass-bg-lo);
  border: 1px solid var(--glass-stroke);
}
.dictee-aide .chip { font-size: 12px; padding: 5px 10px; }

.sheet .textarea[data-note] {
  min-height: 72%;
  font-size: 16px;
  line-height: 1.5;
}
.sheet .textarea[data-note]::placeholder {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-mute);
}

/* Bouton micro pendant l'ecoute */
.btn.is-ecoute { animation: ecoute 1.6s var(--ease-out) infinite; }
@keyframes ecoute {
  0%, 100% { box-shadow: 0 10px 22px -12px rgba(171, 58, 28, 0.8), 0 0 0 0 rgba(199, 77, 42, 0.45); }
  50%      { box-shadow: 0 10px 22px -12px rgba(171, 58, 28, 0.8), 0 0 0 10px rgba(199, 77, 42, 0); }
}
.note-block .head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.note-block .head h3 { flex: 1; font-size: 14px; font-weight: 700; letter-spacing: -0.005em; }
.note-block .head .ico {
  display: grid; place-items: center;
  width: 28px; height: 28px; flex: none;
  border-radius: 9px;
  background: color-mix(in srgb, var(--tint, var(--green-500)) 16%, transparent);
  color: var(--tint, var(--accent));
}
.note-block .head .ico svg { width: 16px; height: 16px; }

.tick-list { display: flex; flex-direction: column; gap: 2px; }
.tick {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 8px;
  border-radius: var(--r-xs);
  font-size: 14.5px; line-height: 1.4;
  transition: background var(--t-fast), opacity var(--t-fast);
}
.tick:active { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.tick .box {
  flex: none; margin-top: 1px;
  display: grid; place-items: center;
  width: 21px; height: 21px;
  border-radius: 7px;
  border: 2px solid color-mix(in srgb, var(--ink-mute) 50%, transparent);
  transition: all var(--t-fast) var(--ease-spring);
}
.tick .box svg { width: 13px; height: 13px; color: #fff; opacity: 0; transform: scale(0.5); transition: all var(--t-fast) var(--ease-spring); }
.tick[aria-checked="true"] .box { background: linear-gradient(160deg, var(--green-500), var(--green-700)); border-color: transparent; }
.tick[aria-checked="true"] .box svg { opacity: 1; transform: none; }
.tick[aria-checked="true"] .txt { text-decoration: line-through; color: var(--ink-mute); }
.tick .txt { flex: 1; text-align: left; }

.qa-item { padding: 11px 12px; border-radius: var(--r-sm); background: var(--warn-bg); font-size: 14px; line-height: 1.4; }
.qa-item + .qa-item { margin-top: 7px; }

.calc-item {
  display: flex; align-items: baseline; gap: var(--sp-2);
  padding: 11px 12px; border-radius: var(--r-sm);
  background: var(--info-bg);
  font-size: 14px; line-height: 1.4;
}
.calc-item + .calc-item { margin-top: 7px; }
.calc-item .res { margin-left: auto; font-family: var(--font-num); font-weight: 750; white-space: nowrap; color: var(--info); }

.doc-row { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 8px; border-radius: var(--r-xs); }
.doc-row + .doc-row { border-top: 1px solid var(--glass-stroke-2); }
.doc-row .ico { display: grid; place-items: center; width: 34px; height: 34px; flex: none;
                border-radius: 9px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-soft); }
.doc-row .ico svg { width: 17px; height: 17px; }

/* Materiaux a preparer */
.mat-search { margin-bottom: var(--sp-3); }
.mat-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--glass-bg-lo);
  transition: background var(--t-fast);
}
.mat-row + .mat-row { margin-top: 6px; }
.mat-row[data-picked="true"] { background: color-mix(in srgb, var(--green-400) 15%, transparent); }
.mat-row .qty {
  font-family: var(--font-num); font-size: 13px; font-weight: 700;
  min-width: 46px; text-align: center;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.mat-row .stock { font-size: 11.5px; color: var(--ink-mute); }
.mat-row .stock.is-low { color: var(--danger); font-weight: 650; }

/* KPI heures */
.hours-card { padding: var(--sp-5); }
.hours-top { display: flex; align-items: flex-end; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.hours-top .big { font-family: var(--font-num); font-size: 34px; font-weight: 780; letter-spacing: -0.03em; line-height: 1; }
.hours-top .of { font-size: 15px; color: var(--ink-mute); padding-bottom: 3px; }
.hours-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-mute); margin-top: 7px; }

/* -------------------------------------------------------------------------
   Choix de chantier / recherche
   ------------------------------------------------------------------------- */

.picker-tools { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.picker-tools .row { gap: var(--sp-2); }
.sort-bar { display: flex; align-items: center; gap: var(--sp-2); overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.sort-bar::-webkit-scrollbar { display: none; }

.cha-row {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%;
  padding: 12px var(--sp-4);
  border-radius: var(--r-md);
  text-align: left;
  background: var(--glass-bg);
  border: 1px solid var(--glass-stroke);
  border-left: 4px solid var(--evt, var(--green-500));
  box-shadow: var(--glass-inner);
  transition: transform var(--t-fast) var(--ease-spring);
}
.cha-row:active { transform: scale(0.985); }
.cha-row .body { flex: 1; min-width: 0; }
.cha-row .name { font-size: 15px; font-weight: 640; }
.cha-row .addr { font-size: 12.5px; color: var(--ink-mute); }
.cha-row .tags { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.cha-row .fav { color: var(--sun); }
.cha-row .fav svg { width: 18px; height: 18px; }
.cha-row .fav[aria-pressed="false"] { color: color-mix(in srgb, var(--ink-mute) 55%, transparent); }

/* -------------------------------------------------------------------------
   Rapports
   ------------------------------------------------------------------------- */

.rep-line { padding: var(--sp-4); }
.rep-line + .rep-line { margin-top: var(--sp-3); }
.rep-line .head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.rep-line .head .name { flex: 1; font-size: 15.5px; font-weight: 680; }
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.time-grid .field { margin: 0; }
.time-grid .input { text-align: center; padding-inline: 6px; }
.gruen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.gruen-grid .field { margin: 0; }

/* -------------------------------------------------------------------------
   Inventaire
   ------------------------------------------------------------------------- */

.inv-total {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 14px var(--sp-4);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, var(--green-500), var(--green-700));
  color: #fff;
  box-shadow: 0 12px 28px -14px rgba(26, 87, 48, 0.85), inset 0 1px 0 rgba(255,255,255,0.24);
}
.inv-total .val { margin-left: auto; font-family: var(--font-num); font-size: 20px; font-weight: 780; }

.inv-row { padding: 13px var(--sp-4); border-radius: var(--r-md);
           background: var(--glass-bg); border: 1px solid var(--glass-stroke); box-shadow: var(--glass-inner); }
.inv-row + .inv-row { margin-top: var(--sp-2); }
.inv-row .top { display: flex; align-items: center; gap: var(--sp-2); }
.inv-row .name { flex: 1; font-size: 15px; font-weight: 640; }
.inv-row .count { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-mute); margin-top: 4px; }
.inv-row .count.is-zero { color: var(--danger); }
.inv-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--glass-stroke-2); }
.size-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 5px 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.size-chip b {
  display: grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--r-pill);
  font-family: var(--font-num); font-size: 11.5px;
  background: var(--ok-bg); color: var(--ok);
}
.size-chip b.is-zero { background: var(--danger-bg); color: var(--danger); }

.team-hero {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: linear-gradient(155deg, var(--green-600), var(--green-800));
  color: #fff;
  box-shadow: 0 16px 36px -18px rgba(13, 42, 25, 0.9), inset 0 1px 0 rgba(255,255,255,0.18);
  text-align: center;
}
.team-hero h2 { font-size: 21px; font-weight: 740; letter-spacing: -0.02em; }
.team-hero p { font-size: 13.5px; opacity: 0.82; margin-top: 3px; }

.veh-card { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4); }
.veh-card .plate {
  font-family: var(--font-num); font-size: 15px; font-weight: 750; letter-spacing: 0.06em;
  padding: 5px 11px; border-radius: 7px;
  background: #fff; color: #10231a;
  border: 2px solid #1a3a28;
}

/* -------------------------------------------------------------------------
   Demandes
   ------------------------------------------------------------------------- */

.req-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }

/* `.card.is-tap` impose display:block avec une specificite plus forte que
   `.req-tile` seul : on qualifie la regle pour reprendre la main sur la mise
   en page, sinon icone, texte et chevron s'empilent les uns sous les autres. */
.card.is-tap.req-tile,
.req-tile {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  text-align: left;
}
.req-tile .ico {
  display: grid; place-items: center;
  width: 46px; height: 46px; flex: none;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--tint, var(--green-500)) 16%, transparent);
  color: var(--tint, var(--accent));
}
.req-tile .ico svg { width: 23px; height: 23px; }
.req-tile .body { flex: 1; min-width: 0; }
/* Titre et description sont des <span> : sans display:block ils se suivraient
   sur la meme ligne. */
.req-tile .name { display: block; font-size: 15.5px; font-weight: 660; }
.req-tile .desc {
  display: block;
  font-size: 12.5px; color: var(--ink-mute); line-height: 1.35; margin-top: 2px;
}
.req-tile .chev { flex: none; }

/* -------------------------------------------------------------------------
   Devis
   ------------------------------------------------------------------------- */

.devis-section { padding: var(--sp-4); }
.devis-section + .devis-section { margin-top: var(--sp-3); }
.devis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-3); }
.devis-grid .field { margin: 0; }
.devis-grid .span-2 { grid-column: 1 / -1; }

/* Les champs date/heure ont une largeur intrinseque qui force la grille a
   deborder : on la neutralise partout ou des champs sont en colonnes. */
.devis-grid > *, .task-fields > *, .time-grid > *, .gruen-grid > * { min-width: 0; }
.input[type="date"], .input[type="time"] { min-width: 0; width: 100%; }

.pick-list { display: flex; flex-wrap: wrap; gap: 7px; }

.task-card { padding: var(--sp-4); border-radius: var(--r-md); background: var(--glass-bg-lo); border: 1px solid var(--glass-stroke); }
.task-card + .task-card { margin-top: var(--sp-2); }
.task-card .num {
  display: grid; place-items: center;
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  font-family: var(--font-num); font-size: 13px; font-weight: 750;
  background: linear-gradient(160deg, var(--green-500), var(--green-700));
  color: #fff;
}
.task-card .head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.task-card .head .t { flex: 1; font-size: 15px; font-weight: 660; }
.task-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.task-fields .field { margin: 0; }
.task-fields .span-2 { grid-column: 1 / -1; }

.devis-foot { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-5); }
.company-foot { text-align: center; font-size: 11.5px; color: var(--ink-mute); line-height: 1.65; margin-top: var(--sp-5); }

/* -------------------------------------------------------------------------
   Impression (export PDF du devis via le navigateur)
   ------------------------------------------------------------------------- */

@media print {
  .backdrop, .topbar, .tabbar, .layer, .devis-foot, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .view { padding: 0; max-width: none; }
  .card, .devis-section, .task-card, .glass {
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    break-inside: avoid;
  }
  .input, .select, .textarea { border: 1px solid #ccc !important; background: #fff !important; }
  .company-foot { color: #333; }
}
