/*
 * DiagSAV — espace GMAO
 * Reprend les couleurs et polices de style.css. Pensé d'abord pour le
 * téléphone et la tablette (technicien sur chantier) : onglets en bas de
 * l'écran, grandes zones tactiles, barre d'actions fixe sur la fiche.
 */

.g-body {
  background: var(--surface-soft);
  padding-bottom: 84px; /* place pour la barre d'onglets mobile */
}

.g-icon {
  flex: 0 0 auto;
  vertical-align: middle;
}

/* ------------------------------------------------------------------ */
/* Onglets de l'espace GMAO                                            */
/* ------------------------------------------------------------------ */
.g-tabs {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -6px 20px rgba(16, 42, 58, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}

.g-tab {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
}

.g-tab--active {
  color: var(--accent);
}

.g-tab--active .g-icon {
  stroke-width: 2.2;
}

.g-tab--hide-mobile,
.g-desktop-only {
  display: none;
}

.g-tab--new .g-tab-plus {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(155, 72, 77, 0.3);
  color: #ffffff;
}

@media (min-width: 900px) {
  .g-body {
    padding-bottom: 0;
  }

  .g-tabs {
    position: sticky;
    top: 68px;
    bottom: auto;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 0 20px;
    border-top: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
  }

  .g-tab,
  .g-tab--hide-mobile {
    display: flex;
    min-height: 52px;
    flex-direction: row;
    gap: 8px;
    padding: 0 14px;
    border-bottom: 3px solid transparent;
    font-size: 0.84rem;
  }

  .g-tab--active {
    border-bottom-color: var(--accent);
  }

  .g-tab--new {
    order: 99;
    margin-left: 12px;
    color: var(--accent);
  }

  .g-desktop-only {
    display: inline;
  }

  .g-mobile-links {
    display: none;
  }

  .g-tab--new .g-tab-plus {
    width: 28px;
    height: 28px;
  }
}

/* ------------------------------------------------------------------ */
/* Mise en page                                                        */
/* ------------------------------------------------------------------ */
.g-main {
  width: min(1120px, calc(100% - 28px));
  margin: 18px auto 40px;
}

.g-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.g-context strong {
  color: var(--navy-deep);
}

.g-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 18px;
}

.g-head h1 {
  color: var(--navy-deep);
  font-size: clamp(1.3rem, 4.5vw, 1.75rem);
  line-height: 1.2;
}

.g-head p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.g-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.g-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.g-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

/* Une colonne ne s'élargit jamais au-delà de l'écran (textes longs coupés avec « … ») */
.g-grid > * {
  min-width: 0;
}

@media (min-width: 900px) {
  .g-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g-grid--side {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* ------------------------------------------------------------------ */
/* Cartes / blocs                                                      */
/* ------------------------------------------------------------------ */
.g-card {
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(16, 42, 58, 0.05);
}

.g-card > h2,
.g-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--navy-deep);
  font-size: 1rem;
}

.g-card-title small,
.g-card > h2 small {
  color: var(--text-muted);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
}

.g-card--accent {
  border-left: 4px solid var(--accent);
}

.g-card--warn {
  border-color: #ecd3ad;
  background: var(--warning-soft);
}

.g-empty {
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.g-muted {
  color: var(--text-muted);
}

.g-small {
  font-size: 0.82rem;
}

.g-note {
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--navy-soft);
  color: var(--navy-deep);
  font-size: 0.84rem;
}

.g-note--warn {
  background: var(--warning-soft);
  color: var(--warning);
}

/* Indicateurs du tableau de bord */
.g-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

@media (min-width: 700px) {
  .g-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.g-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
}

.g-kpi strong {
  color: var(--navy-deep);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 1.45rem;
  line-height: 1.1;
}

.g-kpi span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.g-kpi--alert strong {
  color: var(--accent);
}

/* Listes (interventions, clients, équipements) */
.g-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.g-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.g-item:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 16px rgba(16, 42, 58, 0.07);
}

.g-item-main {
  min-width: 0;
  flex: 1 1 auto;
}

.g-item-title {
  overflow: hidden;
  color: var(--navy-deep);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-item-sub {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-item-side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.g-item-time {
  flex: 0 0 auto;
  min-width: 64px;
  white-space: nowrap;
  color: var(--navy-deep);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.g-item-time small {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.g-item .g-icon.g-chev {
  color: var(--border-strong);
}

/* Pastilles de statut */
.g-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 0; /* capsules rectangulaires */
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.g-badge--planifiee { background: #1f8a4c; color: #ffffff; }
.g-badge--en_cours { background: var(--warning-soft); color: var(--warning); }
.g-badge--terminee,
.g-badge--en_service { background: var(--success-soft); color: var(--success); }
.g-badge--annulee,
.g-badge--hors_service { background: #eef0f1; color: #6c777d; }
.g-badge--en_panne {
  padding: 5px 12px;
  background: #c62828;
  color: #ffffff;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  animation: g-blink 1s linear infinite;
}

@keyframes g-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

/* Clignotement plus doux si le téléphone demande moins d'animations */
@media (prefers-reduced-motion: reduce) {
  .g-badge--en_panne { animation: g-pulse 2s ease-in-out infinite; }
  @keyframes g-pulse { 50% { opacity: 0.55; } }
}
.g-badge--signee { background: var(--success-soft); color: var(--success); }
.g-badge--a_signer { background: var(--accent-soft); color: var(--accent-dark); }
.g-badge--type { background: #ffffff; border: 1px solid var(--border); color: var(--navy); }

.g-due--late { color: var(--danger); font-weight: 700; }
.g-due--soon { color: var(--warning); font-weight: 700; }
.g-due--ok { color: var(--success); }

/* ------------------------------------------------------------------ */
/* Formulaires                                                         */
/* ------------------------------------------------------------------ */
.g-form .field {
  min-height: 46px;
  margin-bottom: 0;
}

.g-form textarea.field {
  min-height: 92px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
}

.g-fields {
  display: grid;
  gap: 12px 14px;
}

@media (min-width: 640px) {
  .g-fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-span-2 { grid-column: span 2; }
}

.g-label {
  display: block;
}

.g-label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--navy-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

.g-label > span em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 600;
}

.g-help {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.g-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.88rem;
  cursor: pointer;
}

.g-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: var(--accent);
}

.g-check:has(input:checked) {
  border-color: #c9a2a5;
  background: var(--accent-soft);
}

.g-checks {
  display: grid;
  gap: 8px;
}

@media (min-width: 700px) {
  .g-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Choix en "puces" (type d'intervention, pays...) */
.g-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.g-chip {
  position: relative;
}

.g-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.g-chip span,
a.g-chip {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 0; /* capsules rectangulaires */
  background: #ffffff;
  color: var(--navy-deep);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.g-chip input:checked + span,
a.g-chip.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: #ffffff;
}

.g-chip input:focus-visible + span {
  outline: 3px solid rgba(155, 72, 77, 0.25);
  outline-offset: 2px;
}

/* Mesures */
.g-measures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 700px) {
  .g-measures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.g-measure {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.g-measure label {
  color: var(--navy-deep);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
}

.g-measure .g-unit-wrap {
  position: relative;
}

.g-measure .field {
  padding-right: 52px;
}

.g-measure .g-unit {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  transform: translateY(-50%);
  pointer-events: none;
}

.g-measure--wide {
  grid-column: 1 / -1;
}

/* Pièces */
.g-parts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.g-part {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.g-part .g-part-label {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .g-part {
    grid-template-columns: 150px minmax(0, 1fr) 80px;
    padding: 0;
    border: 0;
    background: none;
  }

  .g-part .g-part-label {
    grid-column: auto;
  }
}

/* Barre d'actions fixe en bas de la fiche */
.g-sticky-actions {
  position: sticky;
  z-index: 30;
  bottom: 70px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
  margin: 18px -4px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -4px 20px rgba(16, 42, 58, 0.1);
}

.g-sticky-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 900px) {
  .g-sticky-actions {
    bottom: 12px;
  }

  .g-sticky-actions .btn {
    flex: 0 0 auto;
  }
}

.btn-ghost {
  border-color: var(--border-strong);
  background: #ffffff;
  color: var(--navy-deep);
}

.btn-ghost:hover {
  border-color: var(--navy);
}

.btn-danger {
  border-color: #dfb7bb;
  background: #ffffff;
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
}

.btn-block {
  width: 100%;
}

.g-main .btn-primary {
  min-width: 0;
}

.g-inline-form {
  display: inline;
}

/* Recherche */
.g-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.g-search .field {
  min-height: 46px;
  margin: 0;
}

.g-search .btn {
  min-height: 46px;
}

.g-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.g-filters a.g-chip {
  flex: 0 0 auto;
  min-height: 36px;
  font-size: 0.8rem;
}

.g-pager {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

/* Fiches détail */
.g-dl {
  display: grid;
  grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
  gap: 7px 12px;
  font-size: 0.88rem;
}

.g-dl dt {
  color: var(--text-muted);
  font-weight: 600;
}

.g-dl dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.g-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.g-quick a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--navy-deep);
  font-size: 0.82rem;
  font-weight: 700;
}

.g-quick a:hover {
  border-color: var(--navy);
}

.g-text {
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-line;
}

.g-section-label {
  margin: 14px 0 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.g-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.g-table th,
.g-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.g-table th {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.g-table td.num {
  text-align: right;
  white-space: nowrap;
}

.g-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.g-photo {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
  aspect-ratio: 1;
}

.g-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g-photo form {
  position: absolute;
  top: 4px;
  right: 4px;
}

.g-photo button {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--danger);
  cursor: pointer;
}

.g-plate {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
}

/* Prochaine étape (fiche intervention) */
.g-next {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #c9a2a5;
  border-radius: 12px;
  background: var(--accent-soft);
}

.g-next p {
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 600;
}

.g-next .g-actions .btn {
  flex: 1 1 auto;
}

/* Étapes Fiche → Signatures → PDF */
.g-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  counter-reset: gstep;
}

.g-step {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
}

.g-step::before {
  counter-increment: gstep;
  content: counter(gstep);
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 0.7rem;
}

.g-step--done {
  color: var(--success);
}

.g-step--done::before {
  content: "✓";
  background: var(--success-soft);
}

.g-step--current {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.g-step--current::before {
  background: var(--accent);
  color: #ffffff;
}

/* Signature */
.g-sign {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: 10px;
  background: #ffffff;
  touch-action: none;
}

.g-sign canvas {
  display: block;
  width: 100%;
  height: 190px;
  cursor: crosshair;
}

.g-sign-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a2adb2;
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
}

.g-sign.has-ink .g-sign-hint {
  display: none;
}

.g-sign-line {
  position: absolute;
  right: 18px;
  bottom: 42px;
  left: 18px;
  border-bottom: 1px solid #d5dde0;
  pointer-events: none;
}

.g-sign-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.g-signature-img {
  max-width: 260px;
  max-height: 110px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.g-recap {
  font-size: 0.88rem;
  line-height: 1.5;
}

.g-recap li {
  margin-left: 18px;
}

/* Planning */
.g-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.g-cal-nav h2 {
  color: var(--navy-deep);
  font-size: 1.1rem;
}

.g-cal-nav a {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--navy-deep);
}

.g-cal-head {
  display: none;
}

.g-cal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.g-day {
  display: none;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

/* Sur téléphone : seuls les jours avec interventions (et aujourd'hui) s'affichent */
.g-day--has,
.g-day--today {
  display: block;
}

.g-day--out {
  display: none !important;
}

.g-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.g-day-num {
  color: var(--navy-deep);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}

.g-day-num .g-day-long {
  display: inline;
}

.g-day-num .g-day-short {
  display: none;
}

.g-day--today .g-day-num {
  color: var(--accent);
}

.g-day-add {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--text-muted);
}

.g-day-add:hover {
  background: var(--surface-soft);
  color: var(--accent);
}

.g-ev {
  display: block;
  padding: 6px 8px;
  margin-top: 4px;
  border-left: 3px solid var(--navy);
  border-radius: 6px;
  background: var(--navy-soft);
  color: var(--navy-deep);
  font-size: 0.78rem;
  line-height: 1.3;
}

.g-ev strong {
  font-weight: 700;
}

.g-ev--en_cours { border-left-color: var(--warning); background: var(--warning-soft); }
.g-ev--terminee { border-left-color: var(--success); background: var(--success-soft); }
.g-ev--annulee { border-left-color: #a5b0b5; background: #f1f3f4; color: #7c878c; text-decoration: line-through; }

@media (min-width: 900px) {
  .g-cal-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
  }

  .g-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }

  .g-day,
  .g-day--out {
    display: block !important;
    min-height: 112px;
    padding: 6px;
  }

  .g-day--out {
    background: transparent;
    opacity: 0.45;
  }

  .g-day-num .g-day-long {
    display: none;
  }

  .g-day-num .g-day-short {
    display: inline;
  }

  .g-ev {
    padding: 4px 6px;
    font-size: 0.72rem;
  }

  .g-ev .g-ev-extra {
    display: none;
  }
}

/* Page de présentation */
.g-landing-hero {
  padding: 56px 20px 40px;
  background: linear-gradient(160deg, var(--navy-deep), var(--navy));
  color: #ffffff;
  text-align: center;
}

.g-landing-hero h1 {
  max-width: 760px;
  margin: 10px auto 12px;
  color: #ffffff;
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  line-height: 1.15;
}

.g-landing-hero p {
  max-width: 640px;
  margin: 0 auto 22px;
  color: rgba(255, 255, 255, 0.85);
}

.g-landing-hero .eyebrow {
  color: #e7c5c8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.g-landing-hero .g-actions {
  justify-content: center;
}

.g-landing-hero .btn-outline {
  border-color: rgba(255, 255, 255, 0.7);
  background: transparent;
  color: #ffffff;
}

.g-features {
  display: grid;
  gap: 14px;
  width: min(1060px, calc(100% - 28px));
  margin: 30px auto;
}

@media (min-width: 760px) {
  .g-features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.g-feature {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.g-feature .g-icon {
  color: var(--accent);
}

.g-feature h3 {
  margin: 8px 0 6px;
  color: var(--navy-deep);
  font-size: 1rem;
}

.g-feature p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.g-flow {
  width: min(1060px, calc(100% - 28px));
  margin: 0 auto 40px;
}

.g-flow ol {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  list-style: none;
  counter-reset: gflow;
}

@media (min-width: 760px) {
  .g-flow ol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.g-flow li {
  position: relative;
  padding: 14px 14px 14px 52px;
  border-radius: 10px;
  background: var(--navy-soft);
  color: var(--navy-deep);
  font-size: 0.88rem;
  font-weight: 600;
  counter-increment: gflow;
}

.g-flow li::before {
  content: counter(gflow);
  position: absolute;
  top: 12px;
  left: 14px;
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.8rem;
}

/* Choix du pays */
.g-country {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.g-country .g-chip span {
  width: 100%;
  justify-content: center;
  border-radius: 0; /* capsules rectangulaires */
}

/* Lien d'invitation */
.g-invite-link {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.g-invite-link input {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.8rem;
}

.g-team-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.g-team-row:last-child {
  border-bottom: 0;
}

.g-team-row form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.g-team-row select {
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #ffffff;
  font-size: 0.82rem;
}

.g-logo-preview {
  max-width: 180px;
  max-height: 80px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
}

.g-select-filter {
  margin-bottom: 6px !important;
}

.g-hidden {
  display: none !important;
}

/* Intervention annulée */
.g-next--cancel {
  border-color: #dfb7bb;
  background: var(--danger-soft);
}

.g-next--cancel p {
  color: var(--danger);
}

.g-checks--single {
  grid-template-columns: 1fr !important;
}

/* ------------------------------------------------------------------ */
/* Vue éclatée (PDF affiché dans la fiche équipement)                  */
/* ------------------------------------------------------------------ */
.g-vue {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.g-vue summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.g-vue summary::-webkit-details-marker {
  display: none;
}

.g-vue-thumb {
  flex: 0 0 auto;
  width: 54px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  object-fit: cover;
}

.g-vue-thumb--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.g-vue-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.g-vue-title strong {
  color: var(--navy-deep);
  font-size: 0.9rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.g-vue-title small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.g-vue-toggle {
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
}

.g-vue-toggle::after {
  content: attr(data-closed) " ▾";
}

.g-vue[open] .g-vue-toggle::after {
  content: attr(data-opened) " ▴";
}

.g-vue-pages {
  display: grid;
  gap: 12px;
  padding: 4px 10px 12px;
}

.g-vue-page {
  position: relative;
  display: block;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.g-vue-page img {
  display: block;
  width: 100%;
  height: auto;
}

.g-vue-page .g-vue-num {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 8px;
  border-radius: 0; /* capsules rectangulaires */
  background: rgba(16, 42, 58, 0.75);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.g-vue-page--loading {
  aspect-ratio: 1 / 1.414;
  background: linear-gradient(90deg, #f3f5f7 0%, #fff 50%, #f3f5f7 100%);
}

/* Page de recherche de vue éclatée */
.g-px-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.g-px-search-row .field {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 46px;
  margin: 0;
}

.g-px-search-row .btn {
  flex: 0 0 auto;
  min-height: 46px;
}

.g-px-results {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.g-px-item {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--navy-deep);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.g-px-item:hover,
.g-px-item:focus-visible {
  border-color: var(--navy);
}

.g-px-item.is-current {
  border-color: var(--navy);
  box-shadow: inset 4px 0 0 var(--navy);
}

.g-px-item img,
.g-px-noimg {
  flex: 0 0 auto;
  width: 44px;
  height: 60px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  object-fit: cover;
}

.g-px-noimg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.g-px-text {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
}

.g-px-text strong {
  font-size: 0.86rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.g-px-text small {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.g-px-item[aria-busy="true"] {
  opacity: 0.6;
  cursor: progress;
}

.g-px-detach {
  margin: 4px 0 12px;
}

.g-px-source {
  margin-top: 8px;
  font-size: 0.75rem;
}

#aide,
.g-vue-card {
  scroll-margin-top: 140px;
}

/* Entretien déjà prévu (fiche client, fiche équipement) */
.g-planned {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-left: 4px solid var(--navy);
  line-height: 1.45;
}

a.g-planned {
  text-decoration: none;
}

.g-planned .g-icon {
  margin-top: 2px;
}

.g-planned a,
.g-planned u {
  margin-left: 4px;
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}

.g-planned-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 0; /* capsules rectangulaires */
  background: var(--navy-soft);
  color: var(--navy-deep);
  font-weight: 700;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Paiements                                                           */
/* ------------------------------------------------------------------ */
.g-badge--paye,
.g-badge--pay-paye { background: var(--success-soft); color: var(--success); }
.g-badge--pay-a_encaisser { background: var(--danger-soft); color: var(--danger); }
.g-badge--pay-partiel,
.g-badge--pay-a_verifier,
.g-badge--a_verifier { background: var(--warning-soft); color: var(--warning); }
.g-badge--pay-inclus { background: var(--navy-soft); color: var(--navy); }
.g-badge--pay-a_chiffrer,
.g-badge--pay-annulee { background: #eef0f1; color: #6c777d; }

.g-pay-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.g-pay-summary > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.g-pay-summary strong {
  color: var(--navy-deep);
  font-size: 1.05rem;
}

.g-pay-summary span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.g-pay-summary .is-due { border-color: #e7b8bc; background: var(--danger-soft); }
.g-pay-summary .is-due strong { color: var(--danger); }
.g-pay-summary .is-ok strong { color: var(--success); }
.g-pay-summary .is-pending { border-color: #ecd3ad; background: var(--warning-soft); }

.g-pay-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.g-pay-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.g-pay-row.is-pending {
  border-color: #ecd3ad;
}

.g-pay-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  font-size: 0.86rem;
}

.g-pay-amount {
  color: var(--navy-deep);
  font-size: 1rem;
}

.g-pay-main small {
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.g-pay-side {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.g-pay-del {
  min-height: 32px;
  padding: 4px 8px;
}

#facturation h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#facturation,
#a-encaisser {
  scroll-margin-top: 140px;
}

.g-billing-edit {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-soft);
}

.g-billing-edit summary {
  color: var(--navy-deep);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.g-billing-edit form {
  margin-top: 10px;
}

.g-pay-methods .g-chip span {
  min-height: 46px;
  font-size: 0.9rem;
}

.g-amount {
  font-size: 1.3rem !important;
  font-weight: 700;
}

.g-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

/* Virement : QR code + coordonnées bancaires */
.g-transfer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

@media (min-width: 640px) {
  .g-transfer { grid-template-columns: 220px minmax(0, 1fr); }
}

.g-transfer-qr {
  position: relative;
  width: min(100%, 240px);
  margin: 0 auto;
  background: #ffffff;
}

.g-transfer-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.g-transfer-qr .g-qr-empty {
  display: flex;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* Croix suisse au centre du QR (QR-facture) */
.g-transfer-qr svg.g-swiss-cross {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

.g-transfer-info {
  margin: 0;
}

[data-for].g-hidden {
  display: none !important;
}

/* ------------------------------------------------------------------ */
/* Cases d'intervention : date en toutes lettres puis heure, capsules  */
/* ------------------------------------------------------------------ */
.g-item--iv {
  align-items: flex-start;
}

.g-item-when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin-bottom: 3px;
}

.g-item-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

/* même taille qu'avant pour l'heure */
.g-item-hour {
  color: var(--navy-deep);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.g-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.g-tag {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 0;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Couleurs feutrées, une par information */
.g-tag--entretien       { background: #e7eff4; border-color: #d3e1ea; color: #2f4d63; }
.g-tag--depannage       { background: #f6ebe4; border-color: #ead6c9; color: #7a4527; }
.g-tag--mise_en_service { background: #eeeaf5; border-color: #ddd6ea; color: #4c3f6f; }
.g-tag--controle        { background: #eef0e3; border-color: #dde1c8; color: #545d2e; }
.g-tag--autre           { background: #efefef; border-color: #e0e0e0; color: #555555; }
.g-tag--device          { background: #f3f0e8; border-color: #e5dfd0; color: #5b5242; }
.g-tag--tech            { background: #e8f0ee; border-color: #d3e3df; color: #36564f; }
.g-tag--pay             { background: #f6e6e7; border-color: #ebcfd1; color: #7d3036; font-weight: 700; }
.g-tag--pay.is-pending  { background: #f8eedd; border-color: #ecdcbc; color: #7a5520; }

/* ================================================================== */
/* Design 2026 : cartes arrondies, en-têtes bleu nuit, onglets en      */
/* pastilles. Les capsules (badges, puces, tags) restent rectangulaires.*/
/* ================================================================== */
.g-body {
  background: var(--background);
}

/* Onglets */
.g-tabs {
  border-top: 1px solid rgba(207, 216, 220, 0.7);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 -8px 24px -12px rgba(16, 42, 58, 0.25);
}

.g-tab {
  position: relative;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.g-tab--active {
  color: var(--navy-deep);
  font-weight: 600;
}

.g-tab--active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28%;
  right: 28%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

.g-tab--new .g-tab-plus {
  border-radius: 14px;
  background: var(--accent);
  box-shadow: 0 10px 20px -10px rgba(155, 72, 77, 0.8);
}

@media (min-width: 900px) {
  .g-tabs {
    top: 64px;
    gap: 2px;
    padding: 8px 20px;
    border-top: 0;
    border-bottom: 1px solid rgba(207, 216, 220, 0.7);
    box-shadow: none;
  }

  .g-tab,
  .g-tab--hide-mobile {
    min-height: 40px;
    padding: 0 14px;
    border-bottom: 0;
    border-radius: 10px;
    font-size: 0.84rem;
  }

  .g-tab:hover {
    background: var(--surface-soft);
    color: var(--navy-deep);
  }

  .g-tab--active,
  .g-tab--active:hover {
    background: var(--navy-soft);
  }

  .g-tab--active::before {
    display: none;
  }

  .g-tab--new {
    margin-left: 10px;
    padding: 0 16px 0 8px;
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 10px 20px -12px rgba(155, 72, 77, 0.9);
  }

  .g-tab--new:hover {
    background: var(--accent-dark);
    color: #ffffff;
  }

  .g-tab--new .g-tab-plus {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: none;
  }
}

/* Mise en page */
.g-main {
  width: min(1120px, calc(100% - 28px));
  margin: 20px auto 44px;
}

.g-context {
  margin-bottom: 16px;
  font-size: 0.78rem;
}

.g-context strong {
  font-family: var(--font-title);
  font-weight: 600;
}

.g-head {
  margin-bottom: 20px;
}

.g-head h1 {
  font-size: clamp(1.4rem, 4.6vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.g-back {
  padding: 4px 10px 4px 6px;
  margin-bottom: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

.g-back:hover {
  background: #ffffff;
  color: var(--navy-deep);
}

/* En-tête du tableau de bord : bonjour + indicateurs */
.g-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 24px 24px 20px;
  margin-bottom: 18px;
  border-radius: var(--radius-xl);
  background: var(--gradient);
  color: #ffffff;
}

.g-hero::before,
.g-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.g-hero::before {
  top: -120px;
  right: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.13), transparent 68%);
}

.g-hero::after {
  bottom: -160px;
  left: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(155, 72, 77, 0.3), transparent 70%);
}

.g-hero .g-head {
  margin-bottom: 18px;
}

.g-hero .g-head h1 {
  color: #ffffff;
}

.g-hero .g-head p {
  color: rgba(255, 255, 255, 0.75);
}

.g-hero .g-filters {
  padding: 3px;
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.g-hero .g-filters a.g-chip {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
}

.g-hero .g-filters a.g-chip.is-active {
  background: #ffffff;
  color: var(--navy-deep);
}

.g-hero .g-kpis {
  margin-bottom: 0;
}

.g-kpi {
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

a.g-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.g-hero .g-kpi {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.g-hero a.g-kpi:hover {
  background: rgba(255, 255, 255, 0.17);
  box-shadow: none;
}

.g-hero .g-kpi strong {
  color: #ffffff;
  font-size: 1.6rem;
}

.g-hero .g-kpi span {
  color: rgba(255, 255, 255, 0.78);
}

.g-hero .g-kpi--alert strong {
  color: #ffb4b9;
}

/* Cartes */
.g-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.g-card > h2,
.g-card-title {
  margin-bottom: 14px;
  font-size: 1.02rem;
  font-weight: 600;
}

.g-card--accent {
  border-left: 1px solid var(--border);
  box-shadow: inset 4px 0 0 var(--accent), var(--shadow);
}

.g-card--warn {
  border-color: #f0dcb8;
  background: #fffaf0;
}

.g-empty {
  padding: 22px 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.g-note {
  padding: 11px 14px;
  border-radius: 12px;
}

/* Listes */
.g-list {
  gap: 10px;
}

.g-item {
  padding: 13px 15px;
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.g-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.g-item-title {
  font-weight: 600;
}

/* Formulaires */
.g-label > span {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 0.8rem;
}

.g-check {
  border-radius: 12px;
}

.g-part {
  border-radius: 12px;
}

.g-sticky-actions {
  padding: 10px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.btn-ghost {
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--navy-soft);
}

.g-search .field,
.g-search .btn {
  min-height: 48px;
}

/* Fiches détail */
.g-quick a {
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 10px;
  background: #ffffff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.g-quick a:hover {
  background: var(--navy-soft);
}

.g-table th {
  background: var(--surface-soft);
}

.g-table th,
.g-table td {
  padding: 8px 10px;
}

.g-photo {
  border-radius: 12px;
}

.g-plate,
.g-signature-img,
.g-logo-preview {
  border-radius: 12px;
}

.g-next {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.g-step {
  padding: 9px 6px;
  border-radius: 12px;
}

.g-sign {
  border-radius: var(--radius);
}

/* Planning */
.g-cal-nav a {
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.g-day {
  border-radius: 12px;
}

.g-ev {
  border-radius: 8px;
}

/* Page de présentation */
.g-landing-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(1120px, calc(100% - 28px));
  margin: 20px auto 0;
  padding: 60px 24px 56px;
  border-radius: var(--radius-xl);
  background: var(--gradient);
}

.g-landing-hero::before,
.g-landing-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.g-landing-hero::before {
  top: -140px;
  right: -90px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.13), transparent 68%);
}

.g-landing-hero::after {
  bottom: -180px;
  left: -120px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(155, 72, 77, 0.32), transparent 70%);
}

.g-landing-hero h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.g-landing-hero .btn-outline {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.g-landing-hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
}

.g-features {
  width: min(1120px, calc(100% - 28px));
  margin: 24px auto 34px;
}

.g-feature {
  padding: 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.g-feature .g-icon {
  box-sizing: content-box;
  padding: 10px;
  border-radius: 12px;
  background: var(--accent-soft);
}

.g-flow {
  width: min(1120px, calc(100% - 28px));
}

.g-flow li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.g-flow li::before {
  border-radius: 8px;
}

.g-team-row select {
  min-height: 38px;
  border-radius: 10px;
}

/* Vue éclatée */
.g-vue {
  border-radius: var(--radius);
}

.g-vue-page {
  border-radius: 10px;
}

.g-px-item {
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.g-px-item:hover {
  box-shadow: var(--shadow-hover);
}

/* Paiements */
.g-pay-summary > div {
  border-radius: 12px;
}

.g-pay-row {
  border-radius: 12px;
}

.g-billing-edit {
  border-radius: 12px;
}

.g-transfer-qr .g-qr-empty {
  border-radius: 12px;
}

@media (max-width: 899px) {
  .g-hero {
    padding: 18px 16px 16px;
    border-radius: 20px;
  }

  .g-hero .g-kpi {
    padding: 10px 12px;
  }

  .g-hero .g-kpi strong {
    font-size: 1.35rem;
  }

  .g-landing-hero {
    padding: 44px 18px 40px;
    border-radius: 20px;
  }

  .g-card {
    padding: 16px;
  }
}

/* Téléphone : indicateurs du tableau de bord en bandeau défilant */
@media (max-width: 699px) {
  .g-hero .g-kpis {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 0 16px 2px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .g-hero .g-kpis::-webkit-scrollbar {
    display: none;
  }

  .g-hero .g-kpi {
    min-width: 112px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

/* ------------------------------------------------------------------ */
/* Itinéraire : choix Google Maps / Waze / Plans (téléphone)           */
/* ------------------------------------------------------------------ */
.g-route {
  position: fixed;
  z-index: 80;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

.g-route.is-open {
  visibility: visible;
  pointer-events: auto;
}

.g-route-scrim {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 58, 0.42);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.g-route.is-open .g-route-scrim {
  opacity: 1;
}

.g-route-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  transform: translateY(105%);
  transition: transform 0.25s ease;
}

.g-route.is-open .g-route-panel {
  transform: none;
}

.g-route-handle {
  width: 40px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 3px;
  background: #d3dade;
}

.g-route-title {
  color: var(--navy-deep);
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
}

.g-route-address {
  margin: 2px 0 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.g-route-apps {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.g-route-app {
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--navy-deep);
  font-family: var(--font-title);
  font-size: 0.98rem;
  font-weight: 600;
}

.g-route-app:active,
.g-route-app:hover {
  border-color: var(--navy);
  background: var(--navy-soft);
}

.g-route-logo {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
}

.g-route-app--google .g-route-logo { background: #1a73e8; }
.g-route-app--waze .g-route-logo { background: #33ccff; color: #0b2b3a; }
.g-route-app--apple .g-route-logo { background: #1d1d1f; }
.g-route-app--apple .g-route-logo::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #ffffff; }

html.g-route-lock,
html.g-route-lock body {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .g-route-panel,
  .g-route-scrim {
    transition: none;
  }
}

/* ------------------------------------------------------------------ */
/* Finances (responsables) : tableau de bord, suivi, relances          */
/* ------------------------------------------------------------------ */
:root {
  --f-revenue: #2f6fa8;
  --f-collected: #2aa37f;
}

.f-subnav {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: #e3e9ec;
  scrollbar-width: none;
}

.f-subnav a {
  display: inline-flex;
  flex: 1 0 auto;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 11px;
  color: var(--text-muted);
  font-family: var(--font-title);
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
}

.f-subnav a.is-on {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 42, 58, 0.08), 0 6px 14px -8px rgba(16, 42, 58, 0.3);
  color: var(--navy-deep);
  font-weight: 600;
}

.f-periods {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.f-periods a.g-chip {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.f-period-dates {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Bandeau principal : chiffre d'affaires */
.f-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
  padding: 26px;
  margin-bottom: 14px;
  border-radius: var(--radius-xl);
  background: var(--gradient);
  color: #ffffff;
}

.f-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -120px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.13), transparent 68%);
}

.f-hero-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
}

.f-hero-value {
  display: block;
  margin: 4px 0 6px;
  font-family: var(--font-title);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.f-hero-sub {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
}

.f-hero-side {
  display: grid;
  gap: 10px;
  align-content: center;
}

.f-hero-side > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.f-hero-side span,
.f-hero-side small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
}

.f-hero-side > div > b {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
}

.f-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
}

.f-delta b {
  padding: 1px 7px;
  font-weight: 700;
}

.f-hero .f-delta { color: rgba(255, 255, 255, 0.75); }
.f-hero .f-delta--good b { background: rgba(76, 209, 138, 0.2); color: #9ff0c4; }
.f-hero .f-delta--bad b { background: rgba(255, 140, 150, 0.2); color: #ffc1c6; }
.f-hero .f-delta--flat b { background: rgba(255, 255, 255, 0.12); color: #ffffff; }

/* Indicateurs */
.f-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.f-kpi {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.f-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.f-kpi-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.f-kpi strong {
  color: var(--navy-deep);
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 600;
}

.f-kpi small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.f-kpi--alert {
  border-color: #f0c9cc;
  background: #fff8f8;
}

.f-kpi--alert .f-kpi-label {
  color: var(--danger);
}

.f-kpi--alert strong {
  color: var(--danger);
}

/* Graphique en colonnes */
.f-chart-card {
  position: relative;
}

.f-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: -6px 0 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.f-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.f-key {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.f-key--revenue { background: var(--f-revenue); }
.f-key--collected { background: var(--f-collected); }

.f-columns {
  position: relative;
  min-height: 220px;
}

.f-columns svg {
  display: block;
  max-width: 100%;
}

.f-grid { stroke: #edf1f3; stroke-width: 1; }
.f-axis { stroke: #cfd8dc; stroke-width: 1; }
.f-tick { fill: var(--text-muted); font-family: var(--font-text); font-size: 11px; }
.f-col--revenue { fill: var(--f-revenue); }
.f-col--collected { fill: var(--f-collected); }
.f-hover { fill: rgba(23, 56, 76, 0.05); }
.f-hit { fill: transparent; cursor: default; outline: none; }
.f-hit:focus-visible { stroke: var(--navy); stroke-width: 2; }

.f-tip {
  position: absolute;
  z-index: 3;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.f-tip-month {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.f-tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.f-tip-row b {
  color: var(--navy-deep);
  font-variant-numeric: tabular-nums;
}

.f-tip-row span {
  color: var(--text-muted);
}

.f-line {
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

.f-line--revenue { background: var(--f-revenue); }
.f-line--collected { background: var(--f-collected); }

.f-table {
  margin-top: 10px;
}

.f-table summary {
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.f-scroll {
  margin-top: 8px;
  overflow-x: auto;
}

.g-table td.num,
.g-table th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Barres horizontales (répartitions, balance âgée) */
.f-bars,
.f-aging {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.f-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 0.86rem;
}

.f-bar-head small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.f-bar-head b {
  color: var(--navy-deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.f-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: #edf1f3;
}

.f-bar-track span {
  display: block;
  height: 100%;
  border-radius: 0 5px 5px 0;
  background: var(--f-revenue);
}

.f-aging--0_30 .f-bar-track span { background: #8aa6b8; }
.f-aging--31_60 .f-bar-track span { background: #e0a030; }
.f-aging--61_90 .f-bar-track span { background: #d9732b; }
.f-aging--90_plus .f-bar-track span { background: #c43d3d; }

.f-card-link {
  margin-top: 14px;
  font-size: 0.84rem;
  font-weight: 600;
}

.f-card-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
}

.f-due {
  color: var(--danger);
  font-weight: 700;
}

.f-top td {
  vertical-align: middle;
}

.f-history {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.f-history li {
  display: flex;
  gap: 10px;
  font-size: 0.86rem;
}

.f-history small {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.f-history-dot {
  width: 10px;
  height: 10px;
  flex: none;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--f-revenue);
}

.f-history-dot--jour { background: var(--f-collected); }
.f-history-dot--relance1 { background: #e0a030; }
.f-history-dot--relance2 { background: #d9732b; }
.f-history-dot--relance3 { background: #c43d3d; }

.f-defs {
  margin-top: 4px;
  line-height: 1.5;
}

/* Suivi des paiements */
.f-views {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.f-view {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.f-view span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.f-view strong {
  color: var(--navy-deep);
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.f-view small {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.f-view.is-on {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(23, 56, 76, 0.12);
}

.f-view--retard.is-on strong,
.f-view--retard strong {
  color: var(--danger);
}

.f-hint {
  margin: -4px 0 12px;
}

.f-checkall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.f-checkall input,
.f-row-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.f-rows {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.f-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.f-row:not(:has(.f-row-check)) {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.f-row-title {
  color: var(--navy-deep);
  font-family: var(--font-title);
  font-weight: 600;
}

.f-row-sub {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.f-row-sub a {
  color: var(--navy);
  font-weight: 600;
}

.f-row-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.f-row-amount strong {
  color: var(--navy-deep);
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.f-row-amount small {
  color: var(--text-muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.f-paid {
  color: var(--success) !important;
}

.f-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.f-row-actions .btn {
  min-width: 0;
}

.f-age {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 0; /* capsules rectangulaires */
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
}

.f-age--ok { background: #eef1f3; color: #4f5d65; }
.f-age--warning { background: #fdf3e1; color: #8a5a10; }
.f-age--serious { background: #fbe8dc; color: #92461a; }
.f-age--critical { background: #fbe4e4; color: #a12d2d; }

.f-tag-rem { background: #eef3f7; border-color: #dae4ec; color: var(--navy); gap: 4px; }
.f-tag-rem--none { background: #fff; border-color: var(--border); color: var(--text-muted); }
.f-tag-noemail { background: #fbe9e9; border-color: #f0cfd1; color: #9b3036; }

.f-bulkbar {
  position: sticky;
  z-index: 30;
  bottom: 74px;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  margin-top: 14px;
  border-radius: var(--radius-lg);
  background: var(--navy-deep);
  box-shadow: var(--shadow-lg);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.84rem;
}

.f-bulkbar.is-on {
  display: flex;
}

.f-bulkbar b {
  color: #ffffff;
}

/* Relance : choix du modèle */
.f-templates {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.f-tpl {
  position: relative;
  display: block;
  cursor: pointer;
}

.f-tpl input {
  position: absolute;
  opacity: 0;
}

.f-tpl > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 11px 14px 11px 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.f-tpl > span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 15px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: #ffffff;
  transform: translateY(-50%);
}

.f-tpl input:checked + span {
  border-color: var(--navy);
  background: var(--navy-soft);
}

.f-tpl input:checked + span::before {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 3px #ffffff;
  background: var(--navy);
}

.f-tpl input:focus-visible + span {
  outline: 3px solid rgba(155, 72, 77, 0.28);
  outline-offset: 2px;
}

.f-tpl strong {
  color: var(--navy-deep);
  font-size: 0.9rem;
}

.f-tpl small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.f-reco {
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  vertical-align: 1px;
}

.f-step {
  margin-top: 4px;
}

.f-body {
  min-height: 260px !important;
  line-height: 1.55;
}

.f-options {
  margin-top: 14px;
}

.f-payblock {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.f-payblock-amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.f-payblock-amount span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.f-payblock-amount b {
  color: var(--navy-deep);
  font-family: var(--font-title);
  font-size: 1.25rem;
}

/* Modèles */
.f-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: fflow;
}

.f-flow li {
  counter-increment: fflow;
}

.f-flow a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--navy-deep);
  font-size: 0.8rem;
  font-weight: 600;
}

.f-flow a::before {
  content: counter(fflow);
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: var(--f-revenue);
  color: #ffffff;
  font-size: 0.7rem;
}

.f-flow--jour a::before { background: var(--f-collected); }
.f-flow--relance1 a::before { background: #e0a030; }
.f-flow--relance2 a::before { background: #d9732b; }
.f-flow--relance3 a::before { background: #c43d3d; }

.f-template {
  scroll-margin-top: 140px;
}

.f-template-desc {
  margin: -8px 0 12px;
}

.f-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}

.f-var {
  padding: 4px 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 0; /* capsules rectangulaires */
  background: var(--surface-soft);
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.f-var:hover {
  border-style: solid;
  border-color: var(--navy);
}

@media (max-width: 1100px) {
  .f-views {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .f-hero {
    grid-template-columns: 1fr;
    padding: 20px 18px;
    border-radius: 20px;
  }

  .f-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .f-kpi {
    padding: 12px 14px;
  }

  .f-kpi strong {
    font-size: 1.2rem;
  }

  .f-periods {
    flex-wrap: nowrap;
    margin: 0 -14px 16px;
    padding: 0 14px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .f-periods a.g-chip {
    flex: 0 0 auto;
  }

  .f-period-dates {
    display: none;
  }

  .f-views {
    display: flex;
    margin: 0 -14px 14px;
    padding: 0 14px 2px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .f-view {
    min-width: 132px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .f-row,
  .f-row:not(:has(.f-row-check)) {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
  }

  .f-row:has(.f-row-check) {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .f-row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .f-row-actions .btn {
    flex: 1 1 0;
  }

  .f-row:has(.f-row-check) .f-row-actions {
    grid-column: 2 / -1;
  }
}

@media (min-width: 900px) {
  .f-bulkbar {
    bottom: 12px;
  }
}

@media (max-width: 480px) {
  .f-subnav a {
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .f-subnav a .g-icon {
    display: none;
  }
}

/* Onglets sur écran moyen (tablette paysage, petit portable) : plus compacts */
@media (min-width: 900px) and (max-width: 1180px) {
  .g-tabs {
    gap: 0;
    padding: 8px 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .g-tab,
  .g-tab--hide-mobile {
    flex: 0 0 auto;
    gap: 6px;
    padding: 0 9px;
    font-size: 0.8rem;
  }

  .g-tab .g-icon {
    width: 18px;
    height: 18px;
  }

  .g-tab--new {
    margin-left: 6px;
  }

  .g-tab--new .g-desktop-only {
    display: none;
  }
}

.f-missing {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.f-missing .g-icon {
  margin-top: 2px;
}
