/* ── Stat-Manager Web — Dark Theme ──────────────────────────────────────── */
/* Sono — police des tickets et rapports Z (SIL OFL 1.1, usage commercial
   autorisé, cf. static/fonts/LICENCE-Sono.txt). Servie par l'application :
   aucune requête vers un service externe depuis le VPS ni depuis les postes
   clients. Variable 200–800 : une seule fois téléchargée pour toutes les
   graisses. */
@font-face {
  font-family: 'Sono';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/sono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FFFD;
}
@font-face {
  font-family: 'Sono';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/sono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0,
                 U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy:       #0F3C59;
  --blue:       #2E75B6;
  --blue-dark:  #1F4E79;
  /* Bleu de TEXTE. Le --blue de fond n'a que 1,7:1 sur les gris de
     l'application : illisible en petit. Celui-ci tient 4,5:1 sur les trois
     fonds (panneau clair, panneau sombre, resume d'accompagnement), seuil
     requis pour du petit texte. A reserver au texte, jamais au fond. */
  --blue-txt:   #B8DBFF;
  --panel:      #555F6C;
  --panel-dark: #454E5A;
  --card:       #505A67;
  --card-border:#6B7D8F;
  --text:       #C8DCEF;
  --text-dim:   #8FAABB;
  --green:      #22C55E;
  --red:        #EF4444;
  --orange:     #FB923C;
  --amber:      #F59E0B;
  --white:      #E8F2FA;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--panel);
  color: var(--text);
  min-height: 100vh;
}

/* ── Bouton Actualiser dans la navbar ───────────────────────────────────── */
.btn-nav-actualiser {
  background: var(--blue-dark);
  color: var(--white);
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  margin-left: 10px;
  transition: background 0.15s, opacity 0.15s;
}
.btn-nav-actualiser:hover    { background: var(--blue); }
.btn-nav-actualiser:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Indicateur sync auto FTP (pastille pulsante) ────────────────────────── */
.auto-sync-indic {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  margin-left: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.7);
  animation: auto-sync-pulse 2.5s ease-out infinite;
  cursor: help;
}
.auto-sync-indic.busy {
  animation-duration: 0.8s;
}
.auto-sync-indic.error {
  background: var(--red);
  animation: none;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.4);
}
.auto-sync-indic.flash {
  background: var(--blue);
  animation: auto-sync-flash 0.5s ease-out 4;
}
@keyframes auto-sync-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@keyframes auto-sync-flash {
  0%   { box-shadow: 0 0 0 0 rgba(46,117,182,0.8); transform: scale(1.5); }
  100% { box-shadow: 0 0 0 12px rgba(46,117,182,0); transform: scale(1); }
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand span { color: var(--blue); }

.navbar-logo {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.navbar-nav {
  display: flex;
  gap: 4px;
  list-style: none;
}

.navbar-nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--blue-dark);
  color: var(--white);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ── Navbar — toutes tailles ─────────────────────────────────────────────── */

.mobile-only  { display: none !important; }   /* inutilisé mais conservé */
.desktop-only { display: flex; }
.desktop-nav  { display: flex; }              /* inutilisé mais conservé */

/* Indicateur de page courante (desktop) */
.navbar-current {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-right: 16px;
  white-space: nowrap;
}

/* Utilisateur (desktop) */
.navbar-user {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-right: 14px;
  white-space: nowrap;
}

/* Sur mobile : cacher les éléments desktop-only */
@media (max-width: 700px) {
  .desktop-only { display: none !important; }
  .navbar-brand { font-size: 0.95rem; gap: 6px; }
  .brand-text   { display: none; }
  .navbar       { height: 46px; padding: 0 12px; }
}

/* ── Bouton hamburger ── */
.nav-ham-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--blue-dark);
  color: var(--white);
  border: none;
  height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-ham-btn:hover,
.nav-ham-btn.open { background: var(--blue); }

.nav-ham-ico {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.nav-ham-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-ham-arrow {
  font-size: 0.65rem;
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.nav-ham-btn.open .nav-ham-arrow { transform: rotate(180deg); }

/* ── Fond semi-transparent ── */
.nav-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 149;
}
.nav-mobile-backdrop.open { display: block; }

/* ── Panneau de navigation ── */
.nav-mobile-panel {
  display: none;
  position: fixed;
  top: 52px;           /* hauteur navbar desktop */
  left: 0;
  right: 0;
  background: var(--navy);
  border-bottom: 2px solid var(--blue-dark);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 150;
  overflow-y: auto;
  max-height: calc(100dvh - 52px);
}
.nav-mobile-panel.open { display: flex; flex-direction: column; }

@media (max-width: 700px) {
  .nav-mobile-panel { top: 46px; max-height: calc(100dvh - 46px); }
}

/* Sur desktop : panel centré, largeur max */
@media (min-width: 701px) {
  .nav-mobile-panel {
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    border-radius: 0 0 14px 14px;
    border-left: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
  }
}

/* ── Grille des items ── */
.nav-mobile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* 4 colonnes sur desktop */
  gap: 4px;
  padding: 12px;
  background: var(--panel-dark);
}

@media (max-width: 700px) {
  .nav-mobile-grid { grid-template-columns: 1fr 1fr; } /* 2 colonnes sur mobile */
}

.nav-mobile-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 18px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.nav-mobile-item:hover  { background: rgba(46,117,182,0.18); color: var(--white); }
.nav-mobile-item.active {
  background: var(--blue-dark);
  color: var(--white);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.nav-mobile-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
}
.nav-mobile-item.disabled:hover {
  background: transparent;
  color: var(--text-dim);
}

.nmi-ico { font-size: 1.6rem; line-height: 1; }
.nmi-lbl { line-height: 1.2; }

/* ── Pied du panneau ── */
.nav-mobile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--card-border);
  background: var(--navy);
}

.nav-mobile-user {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.nav-mobile-logout {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--red);
  transition: background 0.15s;
}
.nav-mobile-logout:hover { background: rgba(239,68,68,0.15); }

/* ── Lien déconnexion desktop (conservé pour compatibilité) ── */
.nav-logout {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.15s;
}
.nav-logout:hover { color: var(--red); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* ── Toolbar ────────────────────────────────────────────────────────────── */
.toolbar {
  background: var(--panel-dark);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

/* ── Sur un téléphone, les dates passent SOUS les boutons ────────────────
   Un champ de date occupe une ligne entière sur un écran étroit : les
   deux repoussaient « Période rapide » et « Saisons » plus bas que le
   premier coup d'œil, alors que c'est sur ces boutons qu'on tape presque
   toujours. On tape une date à la main quand aucun bouton ne convient —
   c'est le cas rare, il passe en dessous.
   Seul l'ordre d'AFFICHAGE change : le HTML garde l'ordre du bureau, donc
   la lecture au clavier et à la synthèse vocale reste celle-là. */
@media (max-width: 700px) {
  #bar_date .fg-rapide       { order: 1; }
  #bar_date .fg-date-du      { order: 2; }
  #bar_date .fg-date-au      { order: 3; }
  #bar_date .toolbar-actions { order: 4; }
}

/* ── Actions principales (Analyser, Sync, Export…) — taille harmonisée ──── */
.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: stretch;
}
.toolbar-btn {
  min-width: 160px;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}
/* Groupe Export Excel + Export Comptable : reste insécable */
.export-group {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: stretch;
}
@media (max-width: 480px) {
  /* Sur très petits écrans, on autorise le retour à la ligne */
  .export-group { flex-wrap: wrap; }
}

/* ── Boutons de période rapide — grille uniforme ───────────────────────── */
.quick-periods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  min-width: 520px;
}
.quick-periods .btn-sm {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .quick-periods { grid-template-columns: repeat(2, 1fr); min-width: 0; }
  .toolbar-btn { min-width: 130px; }
}

/* ── Bandeau "Site analysé" affiché sur toutes les pages (mode multi) ──── */
.current-site-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-dark);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}
.current-site-bar .cs-dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.current-site-bar .cs-label {
  color: var(--text-dim);
  font-size: 0.84rem;
}
.current-site-bar .cs-name  { font-weight: 700; font-size: 1rem; }
.current-site-bar .cs-city  { color: var(--text-dim); font-style: italic; }

/* État désactivé d'une option du toggle de mode (mode Z indisponible) */
.mode-switch .mode-opt-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Page Vue Globale ─────────────────────────────────────────────────────── */
/* Le même panneau en bas de la page Période : un titre le détache des
   chiffres de la période, qui se terminent juste au-dessus. */
.vg-bloc-tete {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--card-border);
}
.vg-bloc-tete h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}
.vg-bloc-statut { font-size: .78rem; color: var(--text-dim); }

/* Choix de la fenêtre du graphique d'évolution, poussé à droite du titre. */
.cam-fenetres { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.cam-f {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: .76rem;
  cursor: pointer;
  transition: color .1s, border-color .1s, background .1s;
}
.cam-f:hover { color: var(--text); border-color: var(--blue); }
.cam-f-on {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  font-weight: 600;
}
.vg-st-err  { color: var(--red); }
.vg-st-warn { color: var(--orange); }

/* Les sites de la sélection courante, au milieu de tous les autres.
   Fond OPAQUE obligatoire, colonne figée comprise : un fond translucide
   laisserait voir le tableau défiler dessous. */
.vg-table tr.vg-row-sel td             { background-color: #3C5570; }
.vg-table tr.vg-row-sel .vg-sticky-col { background-color: #36506B;
                                         box-shadow: inset 3px 0 0 var(--blue); }

.vg-charts-grid {
  display: grid;
  /* Deux colonnes des qu'il y a la place, jamais trois : quatre graphiques
     en trois colonnes laissent le dernier seul sur sa ligne. */
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (min-width: 760px) {
  .vg-charts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.vg-chart-card {
  background: var(--panel-dark);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--card-border);
}
.vg-chart-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--card-border);
}
.vg-chart-canvas {
  position: relative;
  height: 240px;
}
@media (max-width: 600px) {
  .vg-chart-canvas { height: 220px; }
}

.vg-scrollable {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 75vh;
  background: var(--panel-dark);
  border-radius: 8px;
}
.vg-table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
}
.vg-table th,
.vg-table td {
  white-space: nowrap;
  padding: 8px 14px;
}
.vg-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-dark);
}
/* Colonnes triables — header cliquable + indicateur */
.vg-table th.vg-sort {
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  transition: background 0.1s;
}
.vg-table th.vg-sort:hover { background: rgba(46,117,182,0.20); }
.vg-table th.vg-sort::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  opacity: 0.35;
  font-size: 0.75em;
}
.vg-table th.vg-sort:not(.sort-asc):not(.sort-desc)::after { content: '⇅'; }
.vg-table th.vg-sort.sort-asc::after  { content: '▲'; opacity: 1; color: var(--blue); }
.vg-table th.vg-sort.sort-desc::after { content: '▼'; opacity: 1; color: var(--blue); }

/* 1re colonne (Site) figée à gauche pendant le scroll horizontal */
/* Fond OPAQUE obligatoire pour masquer le contenu qui défile dessous */
.vg-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: #454E5A;   /* = var(--panel-dark), opaque */
  border-right: 2px solid var(--card-border) !important;
}
.vg-table thead .vg-sticky-col {
  z-index: 4;   /* au-dessus pendant le scroll (vertical + horizontal) */
  background-color: #454E5A;
}
.vg-table tfoot .vg-sticky-col {
  z-index: 3;
  background-color: #1F4E79;   /* = var(--blue-dark) opaque */
  color: var(--white);
  font-weight: 700;
}
.vg-row { transition: background-color 0.1s; }
/* Hover : fond OPAQUE pour les cellules normales ET la sticky-col */
.vg-row:hover td               { background-color: #3F5267; }
.vg-row:hover .vg-sticky-col   { background-color: #3A5570; }

.vg-color-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.vg-warn {
  color: var(--amber);
  margin-left: 6px;
  font-size: 0.85em;
  cursor: help;
}
.vg-not-configured td {
  opacity: 0.85;
  font-style: italic;
}

/* ── Barre sites (sélecteur multi-sites, page Synthèse) ──────────────────── */
.sites-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--panel-dark);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.sites-bar-label { font-weight: 700; color: var(--text); font-size: 0.92rem; }
.site-select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 240px;
  transition: border-color 0.15s;
}
.site-select:hover  { border-color: var(--blue); }
.site-select:focus  { border-color: var(--blue); outline: none; }

/* Sélecteur multi-sites (menu à cases à cocher) */
.site-multiselect { position: relative; display: inline-block; }
.site-ms-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 240px;
  transition: border-color 0.15s;
}
.site-ms-toggle:hover { border-color: var(--blue); }
.site-ms-caret { color: var(--text-dim); font-size: 0.8rem; }
.site-ms-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  min-width: 260px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  padding: 6px;
}
.site-ms-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}
.site-ms-opt:hover { background: var(--panel-dark); }
.site-ms-all {
  border-bottom: 1px solid var(--card-border);
  border-radius: 6px 6px 0 0;
  margin-bottom: 4px;
}
.site-ms-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.site-ms-name { flex: 1; }
.site-ms-list { display: flex; flex-direction: column; }
.site-ms-actions {
  display: flex;
  justify-content: flex-end;
  padding: 8px 8px 4px;
  border-top: 1px solid var(--card-border);
  margin-top: 4px;
}
.site-ms-err { padding: 8px; color: var(--red, #ef4444); font-size: 0.85rem; }

/* Bandeau coordonnées d'un site (1 seul site sélectionné) */
.site-info-banner {
  background: var(--panel-dark);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.site-info-banner .sib-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.site-info-banner .sib-line { color: var(--text-dim); }
.site-info-banner .sib-line strong { color: var(--text); }
.site-info-banner .sib-count { color: var(--text-dim); font-weight: 400; font-size: 0.9rem; }

/* ── Indicateur Z max disponible (page Synthèse, mode Z) ─────────────────── */
.z-max-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.45);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 18px;
  font-size: 0.92rem;
  color: var(--text);
}
.z-max-bar .z-max-label { color: var(--text-dim); }
.z-max-bar strong       { color: var(--amber); font-variant-numeric: tabular-nums; font-size: 1.05rem; }

/* ── Sélecteur de mode (Dates / Z) ───────────────────────────────────────── */
.mode-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: var(--panel-dark);
  padding: 6px;
  border-radius: 8px;
  width: fit-content;
}
.mode-switch .mode-opt {
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.mode-switch .mode-opt input { display: none; }
.mode-switch .mode-opt:hover { color: var(--text); }
.mode-switch .mode-opt.active,
.mode-switch .mode-opt:has(input:checked) {
  background: var(--blue);
  color: #fff;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  background: #3A4450;
  border: 1px solid var(--card-border);
  color: var(--white);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue);
}

.form-group input[type="date"] { width: 150px; }
.form-group input[type="text"] { width: 280px; }

/* ── Boutons ────────────────────────────────────────────────────────────── */
.btn {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover    { opacity: 0.88; }
.btn:active   { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-pulse {
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.6); }
  50%       { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

.btn-primary  { background: #107C41; color: white; }
.btn-blue     { background: var(--blue); color: white; }
.btn-dark     { background: var(--navy); color: var(--text); }
.btn-orange   { background: #D97706; color: white; }
.btn-sm       { padding: 5px 12px; font-size: 0.82rem; }

/* ── Barre de statut ────────────────────────────────────────────────────── */
.status-bar {
  background: var(--panel-dark);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s;
}
#status_msg {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.status-line1   { font-weight: 700; font-size: 0.95rem; }
.status-line2   { font-weight: 500; font-size: 0.80rem; opacity: 0.80; }
.status-line-z  { font-weight: 600; font-size: 0.82rem; opacity: 0.92; }

/* ── Cards Synthèse ─────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

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

@media (max-width: 420px) {
  .cards-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.card-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.card-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── Section graphiques ─────────────────────────────────────────────────── */
/* ── Tableau de bord ───────────────────────────────────────────────
   Une hiérarchie de lecture : le bandeau d'abord, les indicateurs ensuite,
   les graphiques après. L'ancienne grille donnait le même poids au chiffre
   d'affaires et aux articles offerts. */
.db-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 760px) { .db-hero { grid-template-columns: 1fr; } }

.db-hero-bloc {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.db-hero-enc { border-left-color: var(--green); }

.db-label {
  font-size: .78rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.db-hero-val {
  white-space: nowrap;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 500px) { .db-hero-val { font-size: 1.6rem; } }
.db-hero-val-sm { font-size: 1.7rem; }

.db-hero-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .84rem;
  color: var(--text-dim);
}
.db-hero-sub strong { color: var(--text); font-variant-numeric: tabular-nums; }
.db-sep { color: var(--card-border); }
.db-pos { color: var(--green) !important; }
.db-neg { color: var(--amber) !important; }

/* Part encaissée. Verte quand tout est rentré, ambre tant qu'il reste
   quelque chose sur une table : c'est une information d'exploitation, pas
   une erreur — d'où l'ambre et non le rouge. */
.db-jauge {
  height: 10px;
  border-radius: 6px;
  background: var(--panel-dark);
  border: 1px solid var(--card-border);
  overflow: hidden;
  margin: 2px 0 4px;
}
.db-jauge-in {
  height: 100%;
  background: var(--amber);
  border-radius: 5px;
  transition: width .35s ease;
}
.db-jauge-plein { background: var(--green); }

/* La valeur à gauche, la période précédente à droite, séparées d'un filet.
   Le comparatif est délibérément plus petit : c'est un repère, pas le
   chiffre qu'on vient lire. */
.db-corps {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}
.db-principal { flex: 1 1 auto; min-width: 0; display: flex;
                flex-direction: column; gap: 4px; justify-content: center; }

.db-avant {
  /* Le comparatif cède la place avant la valeur principale : c'est elle
     qu'on vient lire, et la voir passer à la ligne la rendait illisible. */
  flex: 0 1 auto;
  max-width: 48%;
  border-left: 1px solid var(--card-border);
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  font-size: .72rem;
  color: var(--text-dim);
  text-align: right;
  min-width: 74px;
}
.db-avant:empty { display: none; }     /* pas de filet sans comparatif */
.db-avant-lbl { text-transform: uppercase; letter-spacing: .3px; }
.db-avant-val { color: var(--text); font-size: .92rem; font-weight: 600;
                font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-avant-ecart { font-weight: 700; font-variant-numeric: tabular-nums; }
.db-hausse { color: var(--green); }
.db-baisse { color: var(--red); }
/* Offerts et remises : une hausse n'est ni bonne ni mauvaise en soi, elle
   peut être voulue. On montre l'écart sans le juger. */
.db-neutre { color: var(--text); }

.db-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(206px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.db-kpi {
  background: var(--panel-dark);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.db-kpi-val {
  white-space: nowrap;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.db-kpi-sub { font-size: .76rem; color: var(--text-dim); }
.db-kpi-alerte { border-color: var(--amber); }
.db-kpi-alerte .db-kpi-val { color: var(--amber); }

.db-large { margin-bottom: 16px; }

/* Sous un graphique : ce qu'il ne montre pas. */
.db-note {
  font-size: .76rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 6px;
  min-height: 1em;
}

.db-trio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 700px) {
  .charts-row { grid-template-columns: 1fr; }
}

.chart-box {
  background: var(--panel-dark);
  border-radius: 10px;
  padding: 16px;
}

.chart-box h3 {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* ── Tickets / infos bas ────────────────────────────────────────────────── */
.info-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.info-badge {
  background: var(--navy);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--text);
}

.info-badge span { color: var(--white); font-weight: 700; }

/* ── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--card-border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--navy);
}

.login-box {
  background: var(--panel-dark);
  border-radius: 14px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.login-box h1 {
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 6px;
}

.login-box .subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 5px;
  font-weight: 600;
}

.login-field input {
  width: 100%;
  background: #3A4450;
  border: 1px solid var(--card-border);
  color: var(--white);
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 1rem;
  outline: none;
}

.login-field input:focus { border-color: var(--blue); }

.login-error {
  background: #3A1A1A;
  color: var(--red);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

/* ── Settings ───────────────────────────────────────────────────────────── */
.settings-section {
  background: var(--panel-dark);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section h2 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.settings-grid .form-group input { width: 100%; }

/* ── Page Scrada ──────────────────────────────────────────────────────────── */
.scr-tabs { display: flex; gap: 4px; }
.scr-tab {
  background: var(--panel-dark);
  color: var(--text-dim);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.scr-tab:hover  { color: var(--text); background: rgba(46,117,182,0.10); }
.scr-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.scr-table-wrap { overflow-x: auto; }
.scr-table th { white-space: nowrap; }
.scr-row.scr-sent  td { background: rgba(34,197,94,0.06); }
.scr-row.scr-error td { background: rgba(239,68,68,0.06); }

.scr-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}
.scr-badge.ok     { background: rgba(34,197,94,0.20);  color: var(--green);  border: 1px solid var(--green); }
.scr-badge.err    { background: rgba(239,68,68,0.20);  color: var(--red);    border: 1px solid var(--red); }
.scr-badge.unsent { background: rgba(143,170,187,0.15); color: var(--text-dim); border: 1px solid var(--text-dim); }

.scr-log {
  margin-top: 12px;
  background: var(--panel-dark);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'Consolas', monospace;
  font-size: 0.82rem;
  max-height: 200px;
  overflow-y: auto;
}
.scr-log-line.ok  { color: var(--green); }
.scr-log-line.err { color: var(--red); }

/* ── Onglets dans Paramètres ─────────────────────────────────────────────── */
.settings-tabs {
  display: flex;
  /* Les onglets PASSENT A LA LIGNE. Ils defilaient, barre de defilement
     masquee : sous 1095 px de large, le dernier onglet (Maintenance, d'ou
     s'activent les modules) sortait de l'ecran et RIEN ne l'annoncait.
     En mode tech la barre mesure 1048 px : un ecran de portable a 125 %
     d'agrandissement suffisait a le faire disparaitre. */
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.settings-tab {
  padding: 9px 18px;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.settings-tab:hover  { color: var(--text); background: rgba(46,117,182,0.10); }
.settings-tab.active {
  color: var(--white);
  background: var(--panel-dark);
  border-color: var(--card-border);
  position: relative;
  top: 1px;
}

/* ── Page Sites — liste détectés ──────────────────────────────────────────── */
.sites-detected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.site-detected-item {
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.88rem;
}

/* Bandeau compteur de sites actifs */
.sites-counter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.sites-counter-bar strong { color: var(--green); font-size: 1.05rem; }

.site-card {
  background: var(--panel);
  border: 1px solid var(--card-border);
  /* --site-c : la couleur EXACTE du site (celle des graphiques).
     --site-txt : la meme, eclaircie par le serveur jusqu'au seuil de
     lisibilite. Les deux sont posees sur la carte par le gabarit. */
  border-left: 4px solid var(--site-c, var(--blue));
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
  transition: opacity 0.15s;
}
.site-card-inactive {
  opacity: 0.55;
  border-left-color: var(--text-dim);
}
.site-card-inactive .site-card-key {
  color: var(--text-dim) !important;
  text-decoration: line-through;
}

/* Toggle "Actif" dans l'en-tête de carte */
.site-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  margin-left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.30);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  user-select: none;
  transition: background 0.15s;
}
.site-active-toggle:hover { background: rgba(34,197,94,0.18); }
.site-active-toggle input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--green);
  margin: 0;
}
.site-card-inactive .site-active-toggle {
  background: rgba(143,170,187,0.10);
  border-color: rgba(143,170,187,0.30);
  color: var(--text-dim);
}
.site-card-header {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;   /* flèche | intitulé | actif | couleur */
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}
.site-card-collapsed .site-card-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.site-card:not(.site-card-collapsed) .site-card-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}
.site-card-toggle {
  display: inline-block;
  width: 14px;
  color: var(--blue);
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}
.site-card-key {
  font-weight: 700;
  font-size: 1rem;
  /* Jamais --blue : ce bleu de FOND ne tient que 1,3 de contraste sur le
     panneau, illisible en petit. A defaut de couleur de site, le bleu de
     texte. */
  color: var(--site-txt, var(--blue-txt));
  letter-spacing: 0.02em;
}
.site-card-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: Consolas, monospace;
  margin-right: auto;
}
.site-card-body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.25s ease-in-out;
}
.site-card-collapsed .site-card-body {
  max-height: 0;
  margin: 0;
  padding: 0;
}
.site-card-empty {
  border-left-color: var(--text-dim);
  background: rgba(143,170,187,0.05);
}
.site-card-empty-label {
  color: var(--text-dim) !important;
  font-style: italic;
  font-weight: 600;
}
.site-color-picker {
  width: 36px; height: 28px;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}
/* La couleur, du cote du technicien : elle se LIT, elle ne se choisit plus
   la -- c'est un detail de presentation, il appartient a l'exploitant. */
.site-pastille {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  flex: 0 0 auto;
}

/* ── Fiches sites (details tenus par l'administrateur) ─────────────────────── */
.fiche-intro {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim);
  background: rgba(46,117,182,0.07);
  border-left: 3px solid var(--blue);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  margin: 0 0 18px;
}
/* Le renvoi d'un onglet a l'autre : sans lui, le technicien chercherait
   l'adresse d'un magasin sur une page qui ne l'a plus. */
.fiche-renvoi {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-dim);
  background: rgba(143,170,187,0.08);
  border-left: 3px solid var(--text-dim);
  border-radius: 0 6px 6px 0;
  padding: 9px 13px;
  margin: 0 0 16px;
}
.fiche-renvoi-mini { margin: 0; font-size: 0.8rem; padding: 7px 11px; }
.fiche-renvoi a { color: var(--blue); font-weight: 600; }
.fiche-code {
  font-family: Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(143,170,187,0.12);
  border-radius: 4px;
  padding: 2px 7px;
}
.fiche-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1px 8px;
}
.fiche-badge-man { color: var(--amber); border-color: var(--amber); }
/* UN REFUS SE LIT. Il nomme toutes les cases fautives d'un coup : avec neuf
   friteries et sept jours, s'arreter a la premiere ferait recommencer
   soixante fois. */
.fiche-err {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--red);
  background: rgba(192,0,0,0.08);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 18px;
}
.fiche-err ul { margin: 8px 0 0; padding-left: 22px; }
.fiche-err li { margin: 3px 0; }

/* ── Horaires d'ouverture ──────────────────────────────────────────────────── */
.hor-titre {
  font-size: 0.98rem;
  margin: 22px 0 6px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
}
.hor-aide {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.hor-aide code {
  font-size: 0.78rem;
  background: rgba(143,170,187,0.12);
  border-radius: 3px;
  padding: 1px 5px;
}
.hor-tab {
  border-collapse: collapse;
  font-size: 0.86rem;
}
.hor-tab thead th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 700;
  text-align: center;
  padding: 4px 8px;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
.hor-tab tbody tr:nth-child(even) { background: rgba(143,170,187,0.04); }
.hor-jour {
  text-align: left;
  font-weight: 600;
  padding: 3px 12px 3px 4px;
  white-space: nowrap;
}
.hor-c { padding: 3px 4px; text-align: center; }
.hor-h {
  width: 62px;
  text-align: center;
  font-family: Consolas, monospace;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  padding: 4px 2px;
}
/* La case refusee se montre la ou l'on travaille, pas seulement en haut. */
.hor-faux {
  border: 2px solid var(--red) !important;
  background: rgba(192,0,0,0.08) !important;
}
/* Ce que l'application a compris : c'est lui qui transforme un refus en
   non-evenement -- on voit « 09:30 » des qu'on a tape « 930 ». */
.hor-vu {
  padding: 3px 4px 3px 14px;
  font-family: Consolas, monospace;
  font-size: 0.82rem;
  color: var(--green);
  white-space: nowrap;
}
.hor-vu-ferme { color: var(--text-dim); font-style: italic; }
/* « Non renseigne » n'est PAS « ferme » : une case vide ne doit jamais se
   lire comme une fermeture declaree. */
.hor-vu-vide { color: var(--text-dim); font-style: italic; opacity: 0.7; }
.hor-vu-faux { color: var(--red); font-weight: 700; }
.hor-pieds {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.hor-pieds-aide { font-size: 0.78rem; color: var(--text-dim); }

/* ── Grille de cases à cocher ─────────────────────────────────────────────── */
.settings-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(46,117,182,0.06);
  border: 1px solid rgba(46,117,182,0.18);
  transition: background 0.15s;
  font-size: 0.88rem;
}
.check-item:hover { background: rgba(46,117,182,0.14); }
.check-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--blue);
  flex-shrink: 0;
}
.check-item .check-ico  { font-size: 1.1rem; }
.check-item .check-hint { color: var(--text-dim); font-size: 0.78rem; font-style: italic; }

/* ── Table de données ───────────────────────────────────────────────────── */
.data-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.data-toolbar .form-group input[type="text"] { width: 200px; }

.table-wrap {
  background: var(--panel-dark);
  border-radius: 10px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead th {
  background: var(--navy);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table thead th.num { text-align: right; }

.data-table thead th:hover { color: var(--white); }
.data-table thead th.sort-asc::after  { content: ' ▲'; font-size: 0.7rem; }
.data-table thead th.sort-desc::after { content: ' ▼'; font-size: 0.7rem; }

.data-table tbody tr:nth-child(even) { background: rgba(0,0,0,0.12); }
.data-table tbody tr:hover           { background: rgba(46,117,182,0.15); }

.data-table td {
  padding: 8px 12px;
  color: var(--text);
  border-bottom: 1px solid rgba(107,125,143,0.2);
  white-space: nowrap;
}

.data-table td.num  { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.center { text-align: center; }

.data-table tfoot td {
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  padding: 10px 12px;
  text-align: right;
  border-top: 2px solid var(--blue);
}

.data-table tfoot td.label-col {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-dim);
}

/* Badges type article */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-offert  { background: rgba(34,197,94,0.2);   color: var(--green);  }
.badge-remise  { background: rgba(251,146,60,0.2);  color: var(--orange); }
.badge-annul   { background: rgba(251,146,60,0.15);  color: var(--orange); }
.badge-retour  { background: rgba(239,68,68,0.15);  color: var(--red);    }
.badge-casse   { background: rgba(120,120,120,0.25); color: #b0b0b0;       }
.badge-site    { background: var(--blue);            color: #fff;          font-size: 0.75rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.badge-tarif   { background: rgba(167,139,250,0.2); color: #a78bfa; }
.badge-normal  { display: none; }
.tkt-art-annul { opacity: .55; text-decoration: line-through; }
.tkt-art-note  { font-size: 0.70rem; font-style: italic; color: var(--muted); margin-left: 4px; }

/* ── Volets accordéon (Stat. Articles) ── */
.stat-volet {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.stat-volet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  background: var(--blue-dark);
  transition: background 0.15s;
}
.stat-volet-header:hover { background: rgba(46,117,182,0.4); }
.stat-volet-arrow { font-size: 0.9rem; min-width: 14px; }
.stat-volet-fam {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.stat-fam-offert     { background: rgba(34,197,94,0.2);  color: var(--green); }
.stat-fam-annulation { background: rgba(239,68,68,0.2);  color: var(--red); }
.stat-fam-remise     { background: rgba(251,146,60,0.2); color: var(--orange); }
.stat-fam-casse      { background: rgba(120,120,120,0.3); color: #c0c0c0; }
.stat-fam-generale,
.stat-fam-autre      { background: rgba(167,139,250,0.2); color: #a78bfa; }
.stat-volet-lib { font-weight: 600; flex: 1; }
.stat-volet-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.stat-volet-meta strong { color: var(--white); }
.stat-volet-body {
  padding: 8px 14px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.stat-detail-table {
  width: 100%;
  min-width: 720px;        /* force le débordement sur mobile → scroll horizontal */
  font-size: 0.85rem;
}
.stat-detail-table th { font-size: 0.78rem; white-space: nowrap; }
.stat-detail-table td { white-space: nowrap; }

/* ── Drill-down sur page Statistiques ── */
.stat-row:hover { background: rgba(46,117,182,0.15); }
.stat-toggle, .stat-tkt-toggle {
  display: inline-block; min-width: 12px; color: var(--text-dim);
  margin-right: 4px;
}
.stat-detail-cell {
  background: rgba(0,0,0,0.15);
  padding: 8px 14px !important;
}
.stat-tickets-actions {
  display: flex; align-items: center; gap: 8px;
  padding: 0 0 8px 0; flex-wrap: wrap;
}
.stat-tickets-count {
  font-size: 0.78rem; color: var(--text-dim);
  margin-left: auto;
}
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }
.stat-tickets-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stat-tickets-table {
  width: 100%; min-width: 700px;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.02);
}
.stat-tickets-table th { font-size: 0.76rem; white-space: nowrap; }
.stat-tickets-table td { white-space: nowrap; }
.stat-tkt-row:hover { background: rgba(46,117,182,0.2); }
.stat-tkt-det td {
  background: rgba(0,0,0,0.2);
  padding: 6px 10px !important;
  white-space: normal;
}

/* Header de volet : empêcher le wrap qui masque les chiffres sur mobile */
@media (max-width: 720px) {
  .stat-volet-header {
    flex-wrap: wrap;
    gap: 6px;
  }
  .stat-volet-meta {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
    padding-left: 20px;
  }
  .stat-volet-body { padding: 6px 8px 10px; }
}

/* Groupe règlement */
.group-header td {
  background: var(--blue-dark) !important;
  color: var(--white) !important;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Résumé comptage */
.table-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--panel-dark);
  border-radius: 0 0 10px 10px;
  border-top: 1px solid var(--card-border);
  font-size: 0.83rem;
  color: var(--text-dim);
}
.table-summary strong { color: var(--white); }

/* ── Table avec défilement horizontal (Règlements) ─────────────────────── */
.table-scrollable {
  overflow-x: auto;   /* autoriser le scroll horizontal */
}

/* Largeurs fixes des colonnes règlements — les 4 premières tiennent dans
   un écran ~360 px (76+56+110+84 = 326 px), les 2 dernières nécessitent
   un glissement vers la droite. */
#tbl_reglements {
  min-width: 490px;
}

@media (max-width: 700px) {
  .col-date    { width: 76px;  }
  .col-heure   { width: 56px;  }
  .col-libelle { width: 110px; }
  .col-montant { width: 84px;  }
  .col-ticket  { width: 80px;  }
  .col-vendeur { width: 84px;  }
}

/* Cellules détail règlement */
.reg-lib,
.reg-tkt,
.reg-vnd  { color: var(--text-dim); font-size: 0.82rem; }
.reg-date { font-variant-numeric: tabular-nums; }

/* Montant négatif (remboursement…) */
.neg { color: var(--red) !important; }

/* Compteur de lignes dans l'en-tête de groupe */
.fam-count {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 400;
  margin-left: 8px;
}

/* ── Annulations — colonnes + scroll horizontal ─────────────────────────── */
#tbl_ann {
  min-width: 580px;
}

@media (max-width: 700px) {
  /* 4 cols visibles (~320 px) : Article 115 + Qté 48 + Total 82 + Vendeur 75 */
  .col-ann-art   { width: 115px; }
  .col-ann-qte   { width: 48px;  }
  .col-ann-ttc   { width: 82px;  }
  .col-ann-vnd   { width: 75px;  }
  /* 4 cols en scroll : Motif 88 + N°Ticket 72 + Date 76 + Heure 56 */
  .col-ann-motif { width: 88px;  }
  .col-ann-tkt   { width: 72px;  }
  .col-ann-date  { width: 76px;  }
  .col-ann-heure { width: 56px;  }
}

/* Cellules principales */
.ann-art  { font-size: 0.85rem; color: var(--text); }
/* Métadonnées (cols 4-8) atténuées */
.ann-meta { color: var(--text-dim); font-size: 0.82rem; }

/* Première ligne d'une annulation multi-articles : légère bordure supérieure */
.ann-first-row td {
  border-top: 1px solid rgba(107,125,143,0.45) !important;
}

/* ── Accordion Articles ─────────────────────────────────────────────────── */
.fam-row {
  cursor: pointer;
  background: var(--blue-dark) !important;
  user-select: none;
}
.fam-row:hover { background: var(--navy) !important; }

.fam-toggle {
  display: inline-block;
  width: 16px;
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: color 0.15s;
}
.fam-row:hover .fam-toggle { color: var(--white); }

.fam-name {
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--white);
}
.fam-num {
  font-weight: 700;
  color: var(--white);
}

.det-row { background: transparent; }
.det-row:nth-child(even) { background: rgba(0,0,0,0.08) !important; }
.det-row:hover { background: rgba(46,117,182,0.12) !important; }

/* Colonnes table articles — qté et total toujours visibles */
.col-art-name { width: auto; }
.col-art-qte  { width: 62px;  white-space: nowrap; }
.col-art-ttc  { width: 100px; white-space: nowrap; }

@media (max-width: 700px) {
  .col-art-qte { width: 50px;  }
  .col-art-ttc { width: 85px;  }
}

/* Texte de la colonne article : autorise le retour à la ligne */
#tbl_articles .det-art,
#tbl_articles .fam-name,
#tbl_articles .det-row td:first-child { word-break: break-word; }

/* Lignes détail — bordure gauche colorée par catégorie */
.art-det-offert { border-left: 3px solid var(--green) !important; }
.art-det-remise { border-left: 3px solid var(--orange) !important; }
.art-det-tarif  { border-left: 3px solid #a78bfa !important; }

/* Chiffres détail : gras et légèrement plus grands */
.det-row td.num { font-weight: 700; font-size: 0.92rem; }

/* Deuxième ligne badge sous le nom d'article */
.art-badge-line { margin-top: 3px; line-height: 1.2; }

/* Valeur de référence des offerts (barré) */
.art-offert-val { text-decoration: line-through; opacity: 0.55; font-size: 0.82rem; }

.det-art {
  padding-left: 32px !important;
  color: var(--text);
  font-size: 0.85rem;
}

/* ── Page Évolution ─────────────────────────────────────────────────────── */
.evo-chart-main {
  margin-bottom: 16px;
}

.evo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 700px) {
  .evo-row { grid-template-columns: 1fr; }
}

/* Conteneurs canvas à hauteur fixe (responsive via maintainAspectRatio:false) */
.evo-canvas-wrap {
  position: relative;
  height: 200px;
}

.evo-canvas-main {
  height: 240px;
}

@media (max-width: 700px) {
  .evo-canvas-wrap      { height: 170px; }
  .evo-canvas-main      { height: 200px; }
}

/* ── Page Tickets ───────────────────────────────────────────────────────── */

/* Largeurs colonnes (desktop) */
.col-tkt-num   { width: 110px; }
.col-tkt-date  { width: 100px; }
.col-tkt-heure { width: 75px;  }
.col-tkt-ttc   { width: 110px; }
.col-tkt-vnd   { width: 110px; }
.col-tkt-table { width: 80px;  }
.col-tkt-cvrt  { width: 60px;  }
.col-tkt-site  { width: 90px;  }
.col-reg-site  { width: 90px;  }

/* ── Tableau comparatif multi-sites ─────────────────────────────────────── */
#multisite_table_wrap {
  border-radius: 8px;
  background: var(--panel-dark);
  padding: 4px 0;
}

.multisite-table {
  min-width: 520px;
  border-collapse: collapse;
  width: 100%;
}

.multisite-table thead tr {
  background: var(--navy);
}

.ms-th-site-name {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  left: 0;
  background: var(--navy);
  min-width: 160px;
  z-index: 2;
}

.ms-th-col {
  text-align: right;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 130px;
}

.ms-th-col.sortable {
  cursor: pointer;
  user-select: none;
}

.ms-th-col.sortable:hover {
  color: var(--blue);
}

.ms-site-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.ms-td-site {
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.85rem;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--panel-dark);
  z-index: 1;
  border-right: 1px solid var(--card-border);
}

.ms-td-total {
  font-weight: 600;
  color: var(--white);
}

.multisite-table tbody tr:nth-child(odd)  { background: rgba(255,255,255,0.03); }
.multisite-table tbody tr:nth-child(even) { background: transparent; }
.multisite-table tbody tr:hover           { background: rgba(46,117,182,0.12); }

.multisite-table tfoot tr {
  background: rgba(46,117,182,0.10);
  border-top: 1px solid var(--card-border);
}

.multisite-table tfoot .ms-td-site {
  background: rgba(46,117,182,0.10);
}

/* Sur mobile : min-width pour avoir le scroll horizontal */
#tbl_tickets { min-width: 640px; }

/* Priorité mobile : les 4 premières colonnes font ~380px */
@media (max-width: 700px) {
  .col-tkt-num   { width: 90px;  }
  .col-tkt-date  { width: 90px;  }
  .col-tkt-heure { width: 68px;  }
  .col-tkt-ttc   { width: 90px;  }
}

/* Ligne principale du ticket — cliquable */
.tkt-row {
  cursor: pointer;
  user-select: none;
}
.tkt-row:hover { background: rgba(46,117,182,0.12); }
.tkt-line-match { background: rgba(251,146,60,0.22); border-radius: 4px; }

.tkt-num {
  font-weight: 600;
  white-space: nowrap;
}

/* Ligne de détail */
.tkt-det-row td {
  padding: 0;
  background: var(--panel-dark);
  border-bottom: 2px solid var(--navy);
}

/* Panneau de détail */
.tkt-detail {
  padding: 10px 14px 12px;
}

.tkt-det-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.tkt-det-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.tkt-det-label {
  font-weight: 600;
  color: var(--text);
}

/* Sections articles / règlements côte à côte */
.tkt-det-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 700px) {
  .tkt-det-sections { grid-template-columns: 1fr; }
}

.tkt-det-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tkt-det-empty {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Ligne article */
.tkt-det-art {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.82rem;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.tkt-art-name {
  flex: 1;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.tkt-art-fam {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Surbrillance de recherche */
.hl {
  background: rgba(245,158,11,0.35);
  color: var(--white);
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 700;
}

.tkt-art-qte  { color: var(--text-dim); min-width: 36px; text-align: right; }
.tkt-art-pu   { color: var(--text-dim); min-width: 60px; text-align: right; font-size: 0.78rem; }
.tkt-art-tot  { min-width: 70px; text-align: right; font-weight: 600; color: var(--text); }

/* Ligne règlement */
.tkt-det-reg {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.82rem;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.tkt-reg-mode  { flex: 1; color: var(--white); }
.tkt-reg-heure { color: var(--text-dim); font-size: 0.78rem; }
.tkt-reg-mnt   { min-width: 80px; text-align: right; font-weight: 600; }

/* Badges */
.badge-offert {
  font-size: 0.68rem;
  background: rgba(139,92,246,0.25);
  color: #c4b5fd;
  border: 1px solid #8b5cf6;
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 700;
  letter-spacing: .02em;
}

.badge-remise {
  font-size: 0.68rem;
  background: rgba(245,158,11,0.2);
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 700;
  letter-spacing: .02em;
}

.badge-reste {
  font-size: 0.72rem;
  background: rgba(239,68,68,0.2);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 1px 6px;
  font-weight: 700;
  margin-left: 6px;
}

/* ── Page Tables Ouvertes ───────────────────────────────────────────────── */

.ot-summary {
  font-size: 0.9rem;
  color: var(--text);
}

/* Grille responsive de cartes */
.ot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 12px 0 20px;
}

@media (max-width: 700px) {
  .ot-grid { grid-template-columns: 1fr; }
}

/* Carte */
.ot-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ot-card-reste  { border-top: 3px solid var(--red);   }
.ot-card-ok     { border-top: 3px solid var(--green);  }

.ot-card-vieille { border-top-color: var(--amber); }

/* Table encore ouverte après plusieurs jours : signalée, pas masquée. */
.ot-vieille {
  background: rgba(245, 158, 11, .18);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, .45);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
}
.ot-vieille-note { color: var(--amber); }

/* En-tête de carte — cliquable */
.ot-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 10px;
  background: var(--panel-dark);
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.ot-card-header:hover { background: rgba(46,117,182,0.18); }

.ot-toggle {
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-shrink: 0;
  width: 14px;
}

.ot-table-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-right: 4px;
}

.ot-cvts {
  font-size: 0.75rem;
  background: rgba(46,117,182,0.25);
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 10px;
  padding: 1px 8px;
  font-weight: 600;
}

.ot-vendor {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
}

.ot-time {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Zone de détail (accordéon) */
.ot-detail {
  border-bottom: 1px solid var(--card-border);
}

/* Bloc commande */
.ot-cmd {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ot-cmd:last-child { border-bottom: none; }

.ot-cmd-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 4px;
  background: rgba(0,0,0,0.15);
  flex-wrap: wrap;
}

.ot-cmd-num {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--blue);
}

.ot-cmd-time {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.ot-cmd-vnd {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
}

.ot-cmd-sub {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

/* Articles */
.ot-cmd-arts {
  padding: 4px 14px 8px;
}

.ot-art-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ot-art-line:last-child { border-bottom: none; }

.ot-art-annul { opacity: 0.5; text-decoration: line-through; }

.ot-art-name {
  flex: 1;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.ot-art-qte {
  color: var(--text-dim);
  min-width: 34px;
  text-align: right;
  font-size: 0.77rem;
}

.ot-art-pu {
  color: var(--text-dim);
  min-width: 56px;
  text-align: right;
  font-size: 0.77rem;
}

.ot-art-tot {
  min-width: 72px;
  text-align: right;
  font-weight: 600;
  color: var(--text);
}
.ot-art-offert { color: #c4b5fd; font-weight: 400; font-style: italic; }

.ot-art-empty {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 8px 14px;
}

/* Badge annulé (annulation ligne après validation — article potentiellement sorti) */
.badge-annul {
  font-size: 0.68rem;
  background: rgba(251,146,60,0.2);
  color: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* Badge retour (retour article après service — alerte fraude) */
.badge-retour {
  font-size: 0.68rem;
  background: rgba(239,68,68,0.2);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* Paiements partiels */
.ot-paym-wrap {
  margin: 0 14px 8px;
  background: rgba(46,117,182,0.08);
  border: 1px solid rgba(46,117,182,0.3);
  border-radius: 6px;
  padding: 6px 10px;
}

.ot-paym-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.ot-paym-line {
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
  padding: 2px 0;
}

.ot-paym-mode  { flex: 1; color: var(--text); }
.ot-paym-heure { color: var(--text-dim); font-size: 0.75rem; }
.ot-paym-mnt   { font-weight: 600; color: var(--green); }

/* Pied de carte */
.ot-footer {
  border-top: 1px solid var(--card-border);
  padding: 8px 14px 10px;
  background: rgba(0,0,0,0.12);
}

.ot-footer-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  padding: 2px 0;
  color: var(--text-dim);
}

.ot-footer-reste {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.ot-footer-val   { font-weight: 600; color: var(--text); }
.ot-reste-zero   { color: var(--green); }

/* Message aucune table */
.ot-empty {
  text-align: center;
  padding: 40px 20px;
  font-size: 1rem;
  color: var(--green);
  font-weight: 600;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.progress-bar-wrap {
  height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  background: var(--green);
  width: 0%;
  transition: width 0.3s;
}

/* ── Page TVA ────────────────────────────────────────────────────────────── */
.col-tva-lib  { width: auto; min-width: 100px; }
.col-tva-ht   { width: 90px; }
.col-tva-tva  { width: 90px; }
.col-tva-ttc  { width: 95px; }

.tva-amount { font-weight: 600; color: var(--blue); }

/* ── Page Tranches horaires ──────────────────────────────────────────────── */
.col-tr-art  { width: auto; min-width: 180px; }
.col-tr-qte  { width: 80px;  }
.col-tr-ttc  { width: 130px; }

@media (max-width: 700px) {
  .col-tr-qte { width: 60px;  }
  .col-tr-ttc { width: 100px; }
}

/* Numéro de version (footer menu + page de connexion) */
.nav-mobile-version {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim, #8aa);
  opacity: 0.6;
  padding: 8px 0 4px;
}
.login-version {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim, #8aa);
  opacity: 0.55;
  margin-top: 18px;
}

.tr-row        { cursor: pointer; }
.tr-row:hover  { background: rgba(46,117,182,0.12); }
/* Tranche horaire sans activité : atténuée et non cliquable */
.tr-row.tr-empty        { cursor: default; opacity: 0.45; }
.tr-row.tr-empty:hover  { background: transparent; }

/* ── Page Vendeurs ───────────────────────────────────────────────────────── */
.col-vnd-art  { width: auto;  min-width: 180px; }
.col-vnd-qte  { width: 80px;  }
.col-vnd-ttc  { width: 130px; }

@media (max-width: 700px) {
  .col-vnd-qte { width: 60px;  }
  .col-vnd-ttc { width: 100px; }
}

/* Ligne vendeur (groupe) */
.vnd-row     { cursor: pointer; }
.vnd-row:hover { background: rgba(46,117,182,0.12); }

/* Sous-total famille dans un vendeur */
.vnd-fam-hdr {
  background: rgba(255,255,255,0.04);
  border-top: 1px solid var(--card-border);
  cursor: pointer;
}
.vnd-fam-hdr:hover { background: rgba(46,117,182,0.10); }
.vnd-fam-hdr .vnd-fam-name {
  padding-left: 2rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.vnd-fam-hdr .vnd-fam-tot {
  font-weight: 600;
  font-size: 0.85rem;
}
.vnd-fam-toggle {
  font-size: 0.7rem;
  margin-right: 4px;
  opacity: 0.7;
}

/* Ligne article dans un vendeur */
.vnd-art-row .vnd-art-name { padding-left: 3rem; }
.vnd-art-row .vnd-art-fam  { color: var(--muted); font-size: 0.82rem; font-style: italic; }

/* ── Page Comptes clients ────────────────────────────────────────────────── */
.col-cpt-cpt  { width: 100px; white-space: nowrap; }
.col-cpt-cli  { width: auto;  min-width: 120px; }
.col-cpt-nb   { width: 70px;  }
.col-cpt-ttc  { width: 110px; }
.col-cpt-pay  { width: 110px; }
.col-cpt-rst  { width: 110px; }

#tbl_comptes { min-width: 580px; }

/* Colonnes triables */
#th_compte, #th_client { cursor: pointer; }
#th_compte:hover, #th_client:hover { color: var(--white); }

/* Ligne compte (groupe) */
.cpt-row { cursor: pointer; }
.cpt-row:hover { background: rgba(46,117,182,0.12); }

/* Ligne ticket (sous-niveau) */
.cpt-tkt-row {
  background: rgba(255,255,255,0.03);
  cursor: pointer;
}
.cpt-tkt-row:hover { background: rgba(46,117,182,0.10); }

.cpt-tkt-num {
  padding-left: 28px !important;
  font-weight: 600;
  white-space: nowrap;
}
.cpt-tkt-date { color: var(--text-dim); font-size: 0.83rem; white-space: nowrap; }
.cpt-tkt-type { color: var(--text-dim); font-size: 0.82rem; }

/* Panneau de détail ticket — style calqué sur la page Tables */
.cpt-tkt-det-row { background: var(--panel-dark); }
.cpt-tkt-det-cell { padding: 0 !important; border-bottom: 2px solid var(--navy) !important; }

/* Pied de total compte (quand plusieurs commandes) */
.cpt-footer-total {
  border-top: 2px solid var(--blue) !important;
  margin-top: 4px;
}

/* ── Page Graphiques ─────────────────────────────────────────────────────── */
.graph-container {
  width: 100%;
  height: 400px;
  padding: 0 16px 16px;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .graph-container { padding: 0 8px 12px; }
}

/* ── Page Pointeuse ──────────────────────────────────────────────────────── */
.col-ptr-emp  { width: auto; min-width: 140px; }
.col-ptr-in   { width: 80px; }
.col-ptr-out  { width: 80px; }
.col-ptr-dur  { width: 80px; }
.col-ptr-act  { width: 80px; }

/* Navigation mois */
.ptr-month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 4px;
}
.ptr-month-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  min-width: 160px;
  text-align: center;
}
@media (max-width: 600px) {
  .ptr-month-label { min-width: 120px; font-size: .9rem; }
}

/* Ligne employé (groupe) */
.ptr-emp-row { cursor: pointer; }
.ptr-emp-row:hover { background: rgba(46,117,182,0.12); }

/* Lignes période */
.ptr-per-row { background: rgba(255,255,255,0.03); }

/* Colorisation selon le type */
.ptr-per-corrected td { background: rgba(34,197,94,0.07)  !important; }
.ptr-per-manual td    { background: rgba(46,117,182,0.10) !important; }
.ptr-per-autoclose td { background: rgba(251,146,60,0.08) !important; }

.ptr-date  { padding-left: 2.2rem !important; font-weight: 600; color: var(--text); }
.ptr-heure { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ptr-dur   { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.ptr-act   { white-space: nowrap; }

/* Valeur originale (barrée) dans les lignes corrigées */
.ptr-orig {
  text-decoration: line-through;
  color: var(--text-dim);
  font-size: 0.8em;
  margin-right: 4px;
  opacity: 0.7;
}

/* Colonne Actions */
.col-ptr-act  { width: 90px; }

/* Badge "auto-clôture" */
.ptr-badge-auto {
  font-size: 0.68rem;
  background: rgba(245,158,11,0.2);
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* Badge "manuel" */
.ptr-badge-manual {
  font-size: 0.66rem;
  background: rgba(46,117,182,0.25);
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 700;
  letter-spacing: .02em;
  margin-left: 5px;
}

/* Badge "corrigé" */
.ptr-badge-corrected {
  font-size: 0.66rem;
  background: rgba(34,197,94,0.2);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 700;
  letter-spacing: .02em;
  margin-left: 5px;
}

/* Boutons d'action sur chaque ligne */
.ptr-btn-edit, .ptr-btn-revert {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 1px 4px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.ptr-btn-edit:hover   { opacity: 1; background: rgba(46,117,182,0.2); }
.ptr-btn-revert:hover { opacity: 1; background: rgba(239,68,68,0.2); color: var(--red); }

/* ── Modal Pointeuse ─────────────────────────────────────────────────────── */
.ptr-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
}
.ptr-modal-backdrop.open { display: block; }

.ptr-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  background: var(--panel-dark);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.ptr-modal.open { display: flex; flex-direction: column; }

.ptr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--card-border);
}

.ptr-modal-ttl {
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
}

.ptr-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.ptr-modal-close:hover { color: var(--white); background: rgba(255,255,255,0.1); }

.ptr-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ptr-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ptr-modal-duree {
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 600;
  text-align: center;
  padding: 4px 0;
}

.ptr-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--card-border);
  flex-wrap: wrap;
}

/* ── Barre de navigation par jour (pages secondaires) ─────────────────────── */
.date-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--panel-dark);
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}

.btn-datnav {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn-datnav:hover    { background: var(--blue-dark); border-color: var(--blue); }
.btn-datnav:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.btn-datnav.active   { background: var(--blue); border-color: var(--blue); color: var(--white); }
.btn-datnav.active:hover { background: var(--blue); opacity: 0.88; }

.date-nav-cur {
  margin-left: 10px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Choix d'une période dans la barre de navigation ─────────────────
   Les deux champs tiennent sur la même ligne que les boutons de jour
   tant que l'écran le permet ; .date-nav-bar est déjà en flex-wrap,
   ils passent proprement dessous sur un téléphone. */
.date-nav-choix {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.date-nav-sep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--card-border);
}

/* ── Sur un téléphone, le choix de période prend sa propre ligne ─────────
   La barre est en flex-wrap : sans largeur imposée, « Du » remontait
   boucher le trou laissé par les boutons de jour, et « Au » se retrouvait
   séparé de sa case une ligne plus bas. Le trait de séparation n'a plus
   de sens quand il n'y a plus rien à sa gauche. */
@media (max-width: 700px) {
  .date-nav-choix { flex: 0 0 100%; margin-top: 2px; }
  .date-nav-sep   { display: none; }
}

.date-nav-lbl {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.date-nav-date {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 0.82rem;
  font-family: inherit;
}
.date-nav-date:focus { outline: none; border-color: var(--blue); }

/* Le bouton qui déclenche l'analyse se distingue des boutons de jour :
   c'est le seul de la barre qui attend une saisie avant d'être utile. */
.btn-datnav-go {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.btn-datnav-go:hover {
  background: var(--blue);
  border-color: var(--blue);
  opacity: 0.88;
}

/* ── Message aucune donnée pour ce jour ─────────────────────────────────── */
.no-data-day-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  border-bottom: 1px solid var(--card-border);
}

/* ── Page Les Flops ──────────────────────────────────────────────────────── */
.flops-panel {
  background: var(--panel-dark);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.flops-params-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-end;
}

.flops-param-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flops-param-btn {
  justify-content: flex-end;
}

.flops-label {
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flops-opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
}

.flops-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flops-sep {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.flops-input {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--white);
  padding: 6px 10px;
  font-size: 0.88rem;
  font-family: inherit;
}

.flops-input:focus {
  outline: none;
  border-color: var(--blue);
}

.flops-input-sm {
  width: 80px;
}

.flops-select {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--white);
  padding: 6px 10px;
  font-size: 0.88rem;
  font-family: inherit;
  min-width: 160px;
  cursor: pointer;
}

.flops-select:focus {
  outline: none;
  border-color: var(--blue);
}

/* ── Catégories de flops ──────────────────────────────────────────────────
   Quatre catégories, quatre décisions différentes : un liseré de couleur les
   distingue au premier coup d'œil. Rouge = le vrai flop (décision
   commerciale), ambre = anomalie de programmation, bleu = simple classement
   sous le seuil. */
.flops-cat {
  margin-bottom: 26px;
  border-left: 4px solid var(--blue);
  border-radius: 4px;
  padding-left: 12px;
}
.flops-cat-rouge { border-left-color: var(--red); }
.flops-cat-ambre { border-left-color: var(--amber); }
.flops-cat-bleu  { border-left-color: var(--blue); }

.flops-cat-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  cursor: pointer;
  padding: 6px 0 10px;
  user-select: none;
}
.flops-cat-head:hover .flops-cat-titre { color: var(--blue); }
.flops-cat-chevron { color: var(--text-dim); font-size: 0.8rem; transition: transform .15s; }
.flops-cat.replie .flops-cat-chevron { transform: rotate(-90deg); }
.flops-cat.replie .flops-cat-corps   { display: none; }

.flops-cat-titre { font-size: 1rem; font-weight: 700; color: var(--white); }
.flops-cat-nb {
  font-size: 0.78rem; font-weight: 700; color: var(--white);
  background: rgba(255,255,255,0.12);
  border-radius: 10px; padding: 1px 9px;
}
.flops-cat-aide {
  flex: 1 1 100%;
  font-size: 0.8rem; color: var(--text-dim); line-height: 1.35;
}

/* Fenêtre de dates du journal Scrada, annoncée avant tout envoi */
.scr-fenetre {
  background: rgba(245,158,11,.10); border: 1px solid var(--amber);
  border-radius: 8px; padding: 9px 13px; margin-bottom: 14px;
  font-size: 0.85rem; color: var(--text); line-height: 1.45;
}
.scr-row.scr-hors-fenetre { opacity: 0.45; }
.scr-hf-ico { color: var(--amber); }

/* ── Carte Modules de la page Maintenance ── */
.maint-mod-aide { font-size: 0.82rem; color: var(--text-dim); line-height: 1.4;
                  margin: 0 0 12px; }
.maint-mod-liste { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.maint-mod { display: flex; align-items: center; gap: 8px; cursor: pointer;
             font-size: 0.92rem; color: var(--white); }
.maint-mod input { width: 17px; height: 17px; accent-color: var(--blue);
                   cursor: pointer; }
.maint-mod-vide { color: var(--text-dim); font-size: 0.85rem; }
.maint-mod-pied { display: flex; align-items: center; gap: 12px;
                  margin-top: 14px; }
.maint-mod-msg  { font-size: 0.85rem; }

/* Toutes les colonnes des Flops se trient */
.flops-table th.flops-tri { cursor: pointer; user-select: none; white-space: nowrap; }
.flops-table th.flops-tri:hover { color: var(--blue); }
.flops-table th.flops-tri:not(.sort-asc):not(.sort-desc)::after {
  content: ' \2195'; font-size: 0.7rem; opacity: 0.35;
}

/* Claviers portant l'article */
.flops-clav { font-size: 0.84rem; }
.flops-clav-num { color: var(--text-dim); font-size: 0.78rem; }
.flops-aucun { color: var(--amber); font-style: italic; }

/* Blocs famille */
.flops-fam-block {
  margin-bottom: 24px;
}

.flops-fam-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--panel-dark);
  border: 1px solid var(--card-border);
  border-radius: 8px 8px 0 0;
  border-bottom: none;
}

.flops-fam-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
  flex: 1;
}

.flops-fam-count {
  font-size: 0.80rem;
  color: var(--text-dim);
  font-weight: 500;
}

.flops-fam-block .table-wrap {
  border-radius: 0 0 8px 8px;
  border: 1px solid var(--card-border);
  border-top: none;
}

/* Articles à zéro vente */
.flops-table tr.flops-zero td {
  opacity: 0.7;
}

.flops-table .flops-zero-val {
  color: var(--red);
  font-weight: 700;
}

.flops-qte {
  font-weight: 600;
  color: var(--amber);
}

/* ── Page Maintenance ────────────────────────────────────────────────────── */
.maint-page { max-width: 820px; margin: 0 auto; }

.maint-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.maint-title-ico { font-size: 2rem; }
.maint-title { margin: 0; font-size: 1.4rem; font-weight: 700; color: var(--white); }
.maint-subtitle { margin: 2px 0 0; font-size: 0.88rem; color: var(--text-dim); }

/* Statut */
.maint-status-card {
  background: var(--panel-dark);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.maint-status-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.maint-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 640px) {
  .maint-status-grid { grid-template-columns: repeat(2, 1fr); }
}
.maint-stat-item {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.maint-stat-ico  { font-size: 1.4rem; }
.maint-stat-val  { font-size: 0.92rem; font-weight: 700; color: var(--white); }
.maint-stat-lbl  { font-size: 0.72rem; color: var(--text-dim); }

.maint-val-ok     { color: var(--green) !important; }
.maint-val-warn   { color: var(--amber) !important; }
.maint-val-danger { color: var(--red)   !important; }

/* Actions */
.maint-actions { display: flex; flex-direction: column; gap: 12px; }

.maint-action-card {
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--panel-dark);
  padding: 16px 20px;
  transition: border-color 0.2s;
}
.maint-level-danger {
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.04);
}
.maint-action-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.maint-action-ico { font-size: 1.5rem; flex-shrink: 0; padding-top: 2px; }
.maint-action-info { flex: 1; }
.maint-action-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.maint-action-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.maint-action-desc code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.82rem;
  color: var(--text);
}
.maint-btn { flex-shrink: 0; margin-top: 2px; }

/* Bouton danger */
.btn-danger { background: #DC2626; color: white; }
.btn-danger:hover { opacity: 0.88; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

/* Panneau de confirmation */
.maint-confirm-panel {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
}
.maint-confirm-warn {
  font-size: 0.88rem;
  color: #FCA5A5;
  margin-bottom: 12px;
  line-height: 1.5;
}
.maint-confirm-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 4px;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}
.maint-confirm-opt input { margin-top: 2px; flex: 0 0 auto; }
.maint-confirm-opt em { opacity: .75; font-style: normal; }

.maint-confirm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.maint-confirm-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.maint-confirm-input {
  background: var(--panel);
  border: 1px solid rgba(239,68,68,0.5);
  border-radius: 6px;
  color: var(--white);
  padding: 6px 12px;
  font-size: 0.9rem;
  width: 160px;
  font-family: monospace;
  letter-spacing: 0.05em;
}
.maint-confirm-input:focus {
  outline: none;
  border-color: var(--red);
}

/* Journal */
.maint-log {
  margin-top: 20px;
  background: var(--panel-dark);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 16px;
}
.maint-log-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.maint-log-line {
  font-size: 0.85rem;
  font-family: monospace;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.maint-log-ok  { color: var(--green); }
.maint-log-err { color: var(--red);   }

/* Barre de progression index */
.maint-idx-progress {
  margin-top: 10px;
  font-size: 0.83rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 6px 10px;
}

/* ══ V4 — Stock ═══════════════════════════════════════════════════════════
   Présentation volontairement sobre : une colonne de rubriques à gauche, et
   une feuille de calcul à droite. Le fond clair est assumé — c'est lui qui
   fait lire la zone comme un classeur plutôt que comme une page de plus.  */

/* La barre de defilement ne doit JAMAIS decaler le contenu en apparaissant.
   On lui reserve sa place en permanence : taper une lettre dans une recherche
   fait grandir la fenetre, et sans cela tout glisse d'une quinzaine de pixels. */
html, .stk-feuille, .stk-modal-box, .stk-ac-liste, .stk-page {
  scrollbar-gutter: stable;
}

.stk-app {
  display: flex; gap: 0; align-items: stretch;
  min-height: calc(100vh - 150px);
  margin: 0 -14px -14px;
  border-top: 1px solid var(--card-border);
}

/* ── Colonne de gauche ─────────────────────────────────────────────────── */
.stk-nav {
  flex: 0 0 186px; display: flex; flex-direction: column;
  background: var(--panel-dark); border-right: 1px solid var(--card-border);
  padding: 10px 0;
}
.stk-nav-b {
  background: none; border: 0; border-left: 3px solid transparent;
  color: var(--text); text-align: left; cursor: pointer;
  padding: 11px 16px; font-size: 0.92rem; font-family: inherit;
}
.stk-nav-b:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.stk-nav-b.active {
  background: #FFFFFF; color: #1F3B52; font-weight: 700;
  border-left-color: var(--blue);
}

/* ── Feuille ───────────────────────────────────────────────────────────── */
.stk-feuille {
  flex: 1; min-width: 0; background: #FFFFFF; color: #1C1C1C;
  padding: 14px 16px 24px; overflow: auto;
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
}
.stk-accueil { color: #7A7A7A; font-size: 0.95rem; padding: 24px 2px; }

.stk-barre {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 8px;
}
.stk-b {
  background: #F3F3F3; border: 1px solid #B9B9B9; border-radius: 2px;
  color: #1C1C1C; cursor: pointer; padding: 4px 11px;
  font-size: 0.85rem; font-family: inherit;
}
.stk-b:hover { background: #E4EEF7; border-color: #7FA8CC; }
.stk-b-ok { background: #217346; border-color: #1A5C38; color: #FFF; font-weight: 600; }
.stk-b-ok:hover { background: #1A5C38; }
.stk-chk { font-size: 0.84rem; color: #444; display: flex; align-items: center; gap: 5px; }
.stk-chk input[type=date] { font-family: inherit; font-size: 0.84rem;
  border: 1px solid #B9B9B9; padding: 2px 4px; }
.stk-rech { border: 1px solid #B9B9B9; padding: 3px 7px; font-family: inherit;
  font-size: 0.85rem; min-width: 190px; }
.stk-info { font-size: 0.8rem; color: #6B6B6B; }
.stk-titre {
  margin: 22px 0 6px; font-size: 0.95rem; font-weight: 700; color: #1F3B52;
  border-bottom: 2px solid #217346; padding-bottom: 3px; display: inline-block;
}

/* ── La grille ─────────────────────────────────────────────────────────── */
.stk-grille {
  border-collapse: collapse; width: 100%; font-size: 0.85rem;
  background: #FFF; margin-bottom: 4px;
}
.stk-grille th {
  background: #F3F3F3; border: 1px solid #C6C6C6; color: #1C1C1C;
  font-weight: 600; text-align: left; padding: 4px 8px; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.stk-grille td {
  border: 1px solid #D4D4D4; padding: 3px 8px; vertical-align: top;
}
.stk-grille tbody tr:nth-child(even) td { background: #F8FBFD; }
.stk-grille tbody tr:hover td { background: #E4EEF7; }
.stk-grille th.n, .stk-grille td.n { text-align: right; white-space: nowrap; }
.stk-grille th.a, .stk-grille td.a { width: 92px; text-align: right; white-space: nowrap; }
.stk-grille small { color: #777; font-size: 0.76rem; }
.stk-vide { text-align: center; color: #8A8A8A; padding: 18px 10px; }
.stk-inactif td { color: #999; }
.stk-neg  { color: #C00000; font-weight: 600; }
.stk-ok   { color: #217346; font-weight: 700; }
.stk-att  { color: #B35C00; }
.stk-ref  { color: #7A7A7A; }
.stk-manque { color: #B35C00; }
.stk-incomplet { text-decoration: line-through; color: #B35C00; }
.stk-tag  {
  background: #E4EEF7; border: 1px solid #A8C7E0; border-radius: 2px;
  padding: 0 5px; font-size: 0.72rem; color: #1F3B52;
}
.stk-bq {
  background: #F3F3F3; border: 1px solid #B9B9B9; border-radius: 2px;
  cursor: pointer; padding: 1px 6px; font-size: 0.78rem;
  font-family: inherit; color: #1C1C1C; margin-left: 2px;
}
.stk-bq:hover { background: #E4EEF7; border-color: #7FA8CC; }
.stk-alerte {
  background: #FFF4CE; border: 1px solid #E0C068; padding: 6px 10px;
  font-size: 0.82rem; margin-bottom: 6px; color: #5C4600;
}
.stk-err { color: #C00000; font-size: 0.83rem; margin-top: 6px; }

/* ── Saisie d'un bon ───────────────────────────────────────────────────── */
.stk-saisie {
  border: 1px solid #C6C6C6; background: #FAFAFA; padding: 10px 12px;
  margin-bottom: 14px;
}
.stk-saisie-t { font-weight: 700; color: #1F3B52; margin-bottom: 8px;
  font-size: 0.9rem; }
.stk-saisie-l { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.stk-saisie-l label { display: flex; flex-direction: column; gap: 2px;
  font-size: 0.78rem; color: #555; }
.stk-saisie-l input, .stk-saisie-l select {
  border: 1px solid #B9B9B9; padding: 3px 6px; font-family: inherit;
  font-size: 0.85rem; min-width: 128px; background: #FFF; color: #1C1C1C;
}

/* ── Recherche à la frappe ─────────────────────────────────────────────── */
.stk-ac { position: relative; display: inline-block; }
.stk-ac-liste {
  position: absolute; z-index: 30; left: 0; min-width: 260px; top: 100%;
  max-height: 240px; overflow: auto; background: #FFF;
  border: 1px solid #B9B9B9; box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.stk-ac-item {
  padding: 4px 9px; cursor: pointer; font-size: 0.85rem; color: #1C1C1C;
  display: flex; gap: 8px; align-items: baseline;
}
.stk-ac-item small { color: #777; font-size: 0.75rem; }
.stk-ac-item:hover, .stk-ac-item.sel { background: #E4EEF7; }
.stk-ac-vide { padding: 9px; font-size: 0.82rem; color: #777; }

/* ── Fenêtre de saisie ─────────────────────────────────────────────────── */
.stk-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.stk-modal-box {
  background: #FFF; color: #1C1C1C; border: 1px solid #9C9C9C;
  width: 100%; max-width: 760px; max-height: 88vh; overflow: auto;
  padding: 16px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.4);
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
}
.stk-modal-box h3 { margin: 0 0 12px; font-size: 1rem; color: #1F3B52; }
.stk-grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; }
.stk-grille3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px 14px;
  align-items: end; }
.stk-l { display: flex; flex-direction: column; gap: 2px; font-size: 0.78rem;
  color: #555; }
.stk-l input, .stk-l select {
  border: 1px solid #B9B9B9; padding: 3px 6px; font-family: inherit;
  font-size: 0.85rem; width: 100%; background: #FFF; color: #1C1C1C;
}
.stk-l small { color: #888; font-size: 0.73rem; line-height: 1.25; }
.stk-case { display: flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 0.84rem; color: #333; flex-wrap: wrap; }
.stk-case small { color: #888; font-size: 0.73rem; width: 100%; margin-left: 22px; }
.stk-note { font-size: 0.8rem; color: #666; margin: 8px 0; line-height: 1.35; }
.stk-modal-err { color: #C00000; font-size: 0.84rem; margin-top: 10px; }
.stk-modal-pieds { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.stk-pf { margin-top: 12px; border-top: 1px solid #DDD; padding-top: 10px; }
.stk-pf-titre { display: flex; align-items: center; gap: 9px; font-size: 0.84rem;
  font-weight: 700; color: #1F3B52; margin-bottom: 6px; }
.stk-pf-ligne { display: grid; grid-template-columns: 1fr 1fr auto auto;
  gap: 7px; align-items: center; margin-bottom: 5px; }
.stk-pf-ligne select, .stk-pf-ligne input[type=text] {
  border: 1px solid #B9B9B9; padding: 3px 6px; font-family: inherit;
  font-size: 0.85rem; width: 100%; background: #FFF; color: #1C1C1C; }
.stk-pf-pr { display: flex; align-items: center; gap: 4px; font-size: 0.78rem;
  color: #666; white-space: nowrap; }
.stk-pf > small { display: block; color: #888; font-size: 0.74rem;
  line-height: 1.3; margin-top: 5px; }
.stk-compare { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px;
  font-size: 0.8rem; color: #666; }
.stk-compare span { background: #F3F3F3; border: 1px solid #C6C6C6;
  padding: 2px 8px; }
.stk-compare .stk-moins-cher { border-color: #217346; color: #1C1C1C;
  font-weight: 700; }

@media (max-width: 760px) {
  .stk-app { flex-direction: column; min-height: 0; }
  .stk-nav { flex: none; flex-direction: row; overflow-x: auto; padding: 0;
    border-right: 0; border-bottom: 1px solid var(--card-border); }
  .stk-nav-b { white-space: nowrap; border-left: 0;
    border-bottom: 3px solid transparent; }
  .stk-nav-b.active { border-left: 0; border-bottom-color: var(--blue); }
  .stk-feuille { padding: 10px; }
  .stk-grille { font-size: 0.8rem; }
  .stk-grille2, .stk-grille3 { grid-template-columns: 1fr; }
  .stk-pf-ligne { grid-template-columns: 1fr auto; }
}

/* Stock — cellules de saisie dans une grille */
.stk-cell {
  border: 1px solid #B9B9B9; padding: 2px 5px; font-family: inherit;
  font-size: 0.85rem; width: 100%; text-align: right;
  background: #FFFDE7; color: #1C1C1C;
}
.stk-cell:focus { outline: 2px solid #217346; outline-offset: -2px; background: #FFF; }

/* ══ V5 — Réservations ═════════════════════════════════════════════════════
   Même grammaire visuelle que le reste de l'application — colonne de
   rubriques sombre, feuille claire — mais un jeu de classes PROPRE au
   module : rien n'est partagé avec le Stock, et le module reste détachable
   en supprimant ce bloc et ses quatre fichiers.

   Les couleurs de statut portent du sens et doivent rester lisibles à deux
   mètres, sur l'écran d'un comptoir : ambre = à produire, vert = prêt,
   gris = soldé, rouge = annulé.                                          */

html, .rsv-feuille, .rsv-modal-box, .rsv-ac-liste, .rsv-page {
  scrollbar-gutter: stable;
}

/* ── Ce qui reste en place, ce qui défile ────────────────────────
   Au comptoir, on fait défiler trente commandes en cherchant un nom. Si les
   compteurs, la période et les statuts s'en vont avec la liste, il faut
   remonter pour changer un filtre — et on perd la ligne qu'on tenait. La
   feuille porte donc sa propre hauteur, et c'est la liste seule qui bouge.

   `height` et NON `min-height` : sans hauteur arrêtée, `overflow: auto` ne
   sert à rien, le bloc grandit avec son contenu et c'est la fenêtre qui
   défile. C'est ce qui rendait aussi inopérant le `position: sticky` des
   en-têtes de tableau, qui n'avaient aucun conteneur défilant où se coller.
   Le calc() n'est que la valeur de départ : rsvAjusterHauteur() mesure
   ensuite ce qui surplombe réellement la feuille — barre d'état, bandeau
   de site — qui apparaissent et disparaissent en cours de route. */
.rsv-app {
  display: flex; gap: 0; align-items: stretch;
  height: calc(100vh - 150px);
  margin: 0 -14px -14px;
  border-top: 1px solid var(--card-border);
}

/* ── Rubriques ─────────────────────────────────────────────────────────── */
.rsv-nav {
  flex: 0 0 196px; display: flex; flex-direction: column;
  background: var(--panel-dark); border-right: 1px solid var(--card-border);
  padding: 10px 0;
}
.rsv-nav-b {
  background: none; border: 0; border-left: 3px solid transparent;
  color: var(--text); text-align: left; cursor: pointer;
  padding: 11px 16px; font-size: 0.92rem; font-family: inherit;
}
.rsv-nav-b:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.rsv-nav-b.active {
  background: #FFFFFF; color: #1F3B52; font-weight: 700;
  border-left-color: var(--blue);
}
/* Le geste le plus fréquent du comptoir est en tête de colonne, pas au
   fond : on ne cherche pas « Nouvelle commande », on la prend. */
.rsv-nav-tete { padding: 4px 10px 12px; }
.rsv-b-neuve {
  width: 100%; padding: 10px 12px; font-size: 0.95rem; font-weight: 700;
}

/* ── Le lieu de travail ──────────────────────────────────────
   Au-dessus des rubriques et non dans les filtres d'une page : il gouverne
   les quatre pages, et il doit rester sous les yeux où que l'on aille. Un
   sélecteur pleine largeur — c'est un état, pas un bouton de plus. */
.rsv-nav-lieu {
  padding: 0 10px 12px; margin-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}
.rsv-nav-lieu-l {
  display: block; margin-bottom: 3px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text);
}
/* Blanc sur fond sombre, comme la rubrique active juste en dessous : c'est
   un état, et un état se lit sans le chercher. */
.rsv-nav-lieu select {
  width: 100%; font-family: inherit; font-size: 0.92rem; font-weight: 700;
  padding: 5px 6px; border: 1px solid var(--card-border); border-radius: 4px;
  background: #FFFFFF; color: #1F3B52;
}
.rsv-nav-lieu select:focus { outline: 2px solid var(--blue); }

/* ── Le magasin du mode borne ───────────────────────────────
   Des boutons hauts et pleine largeur : la question se pose sur l'écran
   tactile du comptoir, et on y vise avec un doigt, parfois les mains
   occupées. */
.rsv-mag-choix {
  display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px;
}
.rsv-mag-b {
  width: 100%; padding: 14px 12px; font-size: 1.05rem; font-weight: 700;
}
/* Le magasin déjà actif se distingue sans être imposé : on le reconnaît,
   on ne le subit pas. */
.rsv-mag-on { border-color: #2E75B6; box-shadow: inset 0 0 0 1px #2E75B6; }

/* ── Feuille ───────────────────────────────────────────────────────────── */
.rsv-feuille {
  flex: 1; min-width: 0; background: #FFFFFF; color: #1C1C1C;
  padding: 14px 16px 24px;
  /* En colonne : les compteurs en haut, la vue dessous qui prend le reste.
     `hidden` ici — le défilement est posé un cran plus bas, sur la vue. */
  display: flex; flex-direction: column; overflow: hidden;
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  /* Base relevée : cet écran se lit debout, à un comptoir, souvent de
     biais. Les tailles d'origine venaient d'un module qu'on consulte
     assis. */
  font-size: 0.95rem;
}

/* ── Compteurs du haut ─────────────────────────────────────────────────── */
/* Les compteurs gardent leur hauteur, la vue prend ce qui reste.
   `min-height: 0` n'est pas décoratif : sans lui, un élément flexible
   refuse de descendre sous la hauteur de son contenu, et plus rien ne
   défile — c'est la panne classique de ce montage. */
.rsv-page { flex: 1 1 auto; min-height: 0; overflow: auto; }
/* Commandes : les deux barres de filtres restent, la liste seule défile. */
#rsv_v_commandes { display: flex; flex-direction: column; overflow: hidden; }
#rsv_v_commandes > .rsv-barre,
#rsv_v_commandes > .rsv-filtres,
#rsv_v_commandes > .rsv-hors { flex: 0 0 auto; }
.rsv-defil {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  scrollbar-gutter: stable; padding-bottom: 10px;
}

.rsv-tuiles {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid #E2E2E2;
}
.rsv-tuile {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 92px; padding: 6px 12px; cursor: pointer;
  background: #F3F3F3; border: 1px solid #C6C6C6; border-radius: 3px;
  font-family: inherit; color: #1C1C1C;
}
.rsv-tuile:hover { background: #E4EEF7; border-color: #7FA8CC; }
.rsv-tuile-n { font-size: 1.32rem; font-weight: 700; line-height: 1.1; }
.rsv-tuile-l { font-size: 0.8rem; color: #4A5560; white-space: nowrap;
  font-weight: 600; }
.rsv-t-att    { background: #FFF4CE; border-color: #E0C068; }
.rsv-t-att:hover { background: #FFEBA8; }
.rsv-t-ok     { background: #E3F2E1; border-color: #8FBF8A; }
.rsv-t-ok:hover { background: #D1EACE; }
.rsv-t-alerte { background: #FBE3E3; border-color: #D89090; }
.rsv-t-alerte:hover { background: #F6CFCF; }
.rsv-t-alerte .rsv-tuile-n { color: #B00000; }
.rsv-tuile-info { font-size: 0.76rem; color: #6B6B6B; margin-left: 4px; }

/* ── Barres de commande ────────────────────────────────────────────────── */
.rsv-barre {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 8px;
}
.rsv-barre2 { padding-bottom: 8px; border-bottom: 1px solid #ECECEC; }

/* ── Les filtres de la liste, en deux colonnes ──────────────────────
   À gauche ce qui CADRE la liste : la période, les raccourcis, les statuts.
   À droite ce qui la CHERCHE : le lieu, le champ de recherche — et, en
   face des raccourcis, ce que la recherche a trouvé.

   Une grille plutôt que deux barres souples : les lignes se répondent d'une
   colonne à l'autre et leurs hauteurs s'alignent seules. La colonne de
   gauche prend la largeur de son contenu (la rangée de raccourcis, la plus
   large), la droite ce qui reste.

   Chaque case reste une rangée souple : un libellé et ses boutons s'y
   replient si la fenêtre se resserre, sans rompre la grille. */
.rsv-filtres {
  display: grid;
  /* `minmax(0, max-content)` et non `max-content` : sinon, sur une fenetre
     etroite, la colonne de gauche garde la largeur de sa rangee de
     raccourcis, ecrase celle de droite -- et le selecteur de lieu comme le
     champ de recherche se retrouvent COUPES, hors d'atteinte, puisque la
     feuille ne defile pas lateralement. Avec minmax, les boutons se
     replient dans leur case et tout reste accessible. */
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: 7px 26px; align-items: center;
  margin-bottom: 8px; padding-bottom: 8px;
  border-bottom: 1px solid #ECECEC;
}
.rsv-filtres > div {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  min-width: 0;
}
/* Le champ de recherche prend la largeur disponible et sait se retrecir :
   sa largeur minimale d'origine (190 px) debordait d'une colonne serree. */
.rsv-filtres .rsv-rech { flex: 1 1 160px; min-width: 0; }
.rsv-filtres .rsv-chk { min-width: 0; max-width: 100%; }
.rsv-filtres select { max-width: 100%; min-width: 0; }

/* Deux colonnes demandent de la place : la rangee de raccourcis fait a
   elle seule 450 px, et il en faut autant a droite pour le lieu et la
   recherche. En dessous, on empile -- un selecteur de lieu coupe en deux
   serait pire que la disposition en une colonne, puisque la feuille ne
   defile pas lateralement. Seuil mesure sur la rangee reelle, pas choisi
   au jugé. */
@media (max-width: 1000px) {
  .rsv-filtres { grid-template-columns: 1fr; gap: 6px; }
}
.rsv-barre-mini { margin: 4px 0 0; gap: 6px; }
.rsv-lbl { font-size: 0.82rem; color: #4A5560; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 700; }
.rsv-sep { width: 1px; height: 18px; background: #D4D4D4; margin: 0 2px; }
.rsv-chk { font-size: 0.9rem; color: #2C3440; display: inline-flex;
  align-items: center; gap: 6px; font-weight: 600; }
.rsv-chk input[type=date], .rsv-chk select {
  font-family: inherit; font-size: 0.9rem; font-weight: 400;
  border: 1px solid #B9B9B9; padding: 3px 5px; background: #FFF;
  color: #1C1C1C;
}
.rsv-rech { border: 1px solid #B9B9B9; padding: 4px 8px; font-family: inherit;
  font-size: 0.92rem; min-width: 210px; background: #FFF; color: #1C1C1C; }
.rsv-info { font-size: 0.86rem; color: #4A5560; }
.rsv-note { font-size: 0.9rem; color: #4A5560; line-height: 1.45;
  margin: 2px 0 10px; max-width: 72ch; }
.rsv-titre {
  margin: 22px 0 6px; font-size: 0.95rem; font-weight: 700; color: #1F3B52;
  border-bottom: 2px solid #217346; padding-bottom: 3px; display: inline-block;
}

/* Les cases de statut reprennent la teinte du statut : on lit le filtre
   sans lire les mots. */
.rsv-st-a_preparer { border-bottom: 2px solid #E0A800; }
.rsv-st-prete      { border-bottom: 2px solid #217346; }
.rsv-st-enlevee    { border-bottom: 2px solid #9A9A9A; }
.rsv-st-annulee    { border-bottom: 2px solid #C00000; }

/* ── Boutons ───────────────────────────────────────────────────────────── */
.rsv-b {
  background: #F3F3F3; border: 1px solid #B9B9B9; border-radius: 2px;
  color: #1C1C1C; cursor: pointer; padding: 5px 12px;
  font-size: 0.9rem; font-family: inherit; font-weight: 600;
}
.rsv-b:hover { background: #E4EEF7; border-color: #7FA8CC; }
.rsv-b:disabled { opacity: .5; cursor: not-allowed; }
.rsv-b:disabled:hover { background: #F3F3F3; border-color: #B9B9B9; }
.rsv-b-ok { background: #217346; border-color: #1A5C38; color: #FFF;
  font-weight: 600; }
.rsv-b-ok:hover { background: #1A5C38; border-color: #14452A; }
.rsv-b-sup { background: #FBE3E3; border-color: #D89090; color: #8C0000; }
.rsv-b-sup:hover { background: #F6CFCF; border-color: #C06A6A; }
.rsv-bq {
  background: #F3F3F3; border: 1px solid #B9B9B9; border-radius: 2px;
  cursor: pointer; padding: 2px 7px; font-size: 0.83rem;
  font-family: inherit; color: #1C1C1C; font-weight: 600;
}
.rsv-bq:hover { background: #E4EEF7; border-color: #7FA8CC; }
.rsv-bq-sup { color: #8C0000; }
.rsv-bq-sup:hover { background: #FBE3E3; border-color: #D89090; }

/* ── Grilles ───────────────────────────────────────────────────────────── */
.rsv-grille {
  border-collapse: collapse; width: 100%; font-size: 0.9rem;
  background: #FFF; margin-bottom: 4px;
}
.rsv-grille th {
  background: #E9EEF3; border: 1px solid #B9C4CE; color: #1F3B52;
  font-weight: 700; text-align: left; padding: 6px 8px; white-space: nowrap;
  position: sticky; top: 0; z-index: 2; font-size: 0.88rem;
}
.rsv-grille td { border: 1px solid #D4D4D4; padding: 5px 8px;
  vertical-align: top; }
.rsv-grille tbody tr:nth-child(even) td { background: #F8FBFD; }
.rsv-grille tbody tr:hover td { background: #E4EEF7; }
.rsv-grille th.n, .rsv-grille td.n { text-align: right; white-space: nowrap; }
.rsv-grille th.a, .rsv-grille td.a { text-align: right; white-space: nowrap;
  width: 180px; }
.rsv-grille small { display: block; color: #6A6A6A; font-size: 0.8rem; }
/* Colonne Total : l'acompte s'efface, le reste à payer se voit -- c'est
   le chiffre qu'on réclame au client, et il doit sauter aux yeux dans une
   colonne de montants tous semblables. */
/* `td.n` impose nowrap aux montants ; ces trois lignes-la, elles, ont le
   droit de se replier. Sinon « acompte 40,00 € » elargit la colonne de
   force et pousse le tableau hors de l'ecran d'un telephone. */
.rsv-grille td.n small.rsv-acpt,
.rsv-grille td.n small.rsv-reste,
.rsv-grille td.n small.rsv-solde,
.rsv-grille td.n small.rsv-trop { white-space: normal; }
.rsv-grille td.n small.rsv-acpt { color: #6A6A6A; }
.rsv-grille td.n small.rsv-reste { color: #1F3B52; font-weight: 700; }
.rsv-grille td.n small.rsv-solde { color: #1E7B34; font-weight: 700; }
.rsv-grille td.n small.rsv-trop  { color: #B3261E; font-weight: 700; }
.rsv-vide { text-align: center; color: #8A8A8A; padding: 20px 10px; }
.rsv-ref { color: #7A7A7A; }
.rsv-inactif td { color: #999; }
.rsv-qte { font-size: 1.02rem; color: #1F3B52; }
/* Une commande dont la date est passée mais qui n'est pas soldée : oubliée,
   ou enlevée sans avoir été pointée. Dans les deux cas il faut la voir. */
.rsv-retard td { background: #FFF6F6 !important; }
.rsv-retard:hover td { background: #FBE3E3 !important; }
.rsv-alerte-txt { color: #B00000 !important; font-weight: 600; }

/* Largeurs de colonnes : nommées plutôt que posées à l'index, pour que
   l'ajout d'une colonne ne décale pas tout le reste. */
.rsv-c-num  { width: 58px; }
.rsv-c-enl  { width: 104px; white-space: nowrap; }
.rsv-c-lieu { width: 96px; }
.rsv-c-st   { width: 86px; }
.rsv-c-qte  { width: 74px; }
.rsv-c-nb   { width: 78px; }
.rsv-c-mt   { width: 96px; }
.rsv-c-tel  { width: 116px; white-space: nowrap; }

/* ── Des colonnes qui ne bougent pas ─────────────────────────────
   `table-layout: fixed` : sans lui, le navigateur calcule les largeurs sur
   le CONTENU. Cocher un statut, changer de lieu ou de date redessinait
   alors toute la table, et l'on relisait une liste dont les repères avaient
   bougé — le numéro n'était plus au même endroit, le prix non plus. Les
   largeurs déclarées font désormais foi, quelle que soit la sélection.

   Seule la liste des commandes est concernée : les autres tableaux n'ont
   pas de colonne d'actions et se contentent du calcul automatique. */
/* Rien de tout cela en dessous de 861 px : huit colonnes figées ne
   tiennent pas sur un téléphone, et le calcul automatique y reste le moins
   mauvais des arbitrages. */
@media (min-width: 861px) {
  #rsv_v_commandes .rsv-grille {
    table-layout: fixed;
    /* En dessous, les colonnes seraient écrasées au lieu d'être stables :
       la colonne Articles tombait à 94 px. Mieux vaut faire défiler la
       liste latéralement — elle sait le faire. */
    min-width: 900px;
  }
  /* En pixels et non en pourcentage : une largeur proportionnelle reste
     stable d'une sélection à l'autre, mais pas d'une fenêtre à l'autre.
     Ici tout est fixe, et c'est Articles qui absorbe la place en plus. */
  #rsv_v_commandes .rsv-c-num { width: 72px; }
  #rsv_v_commandes .rsv-c-cli { width: 150px; }
  /* « sam. 14/11 07:30 » mesure 102 px pour 88 utiles : en largeur libre
     le navigateur élargissait la colonne, en largeur figée il ne le peut
     plus et la date débordait sur la colonne Client. On lui rend le droit
     de se replier — l'heure passe en dessous, en gras, ce qui se lit très
     bien. */
  #rsv_v_commandes .rsv-c-enl { white-space: normal; }
  #rsv_v_commandes .rsv-grille th.n,
  #rsv_v_commandes .rsv-grille td.n { width: 94px; }
  #rsv_v_commandes .rsv-grille th.a,
  #rsv_v_commandes .rsv-grille td.a { width: 96px; }
  /* La colonne Articles ne déclare rien : elle prend ce qui reste. C'est
     la plus nourrie, et la seule qui gagne à varier avec la fenêtre.

     `break-word` et NON `anywhere` : `anywhere` coupe au milieu d'un mot
     dès que ça l'arrange, et ça donnait « MALME / DY » sous le numéro et
     « 1,45 / € » dans les articles. `break-word` ne coupe un mot que s'il
     ne tient pas seul sur sa ligne. */
  #rsv_v_commandes .rsv-grille td { overflow-wrap: break-word; }
}

/* Entre 861 et 1150 px, ce jeu-là ne tient plus dans la feuille : les 900
   px minimum faisaient défiler la liste latéralement, et les boutons
   d'action partaient hors champ. Le jeu se resserre donc d'un cran.

   Deux jeux figés plutôt qu'un seul qui déborde : ce qui compte est que
   rien ne bouge quand on change la SÉLECTION, pas que la table soit
   identique sur toutes les tailles d'écran. */
@media (min-width: 861px) and (max-width: 1150px) {
  #rsv_v_commandes .rsv-grille { min-width: 0; }
  /* 72 px comme au palier large, et pas un de moins : « MALMEDY » mesure
     55 px, il en reste 47 à 64 px de colonne, et le code se coupait en
     « MALME / DY ». Un code magasin a une longueur fixe — c'est la seule
     colonne qui n'a rien à gagner à se resserrer. */
  #rsv_v_commandes .rsv-c-num  { width: 72px; }
  #rsv_v_commandes .rsv-c-enl  { width: 92px; }
  #rsv_v_commandes .rsv-c-cli  { width: 116px; }
  /* 84 et non 76 : mesure a l'ecran, « MALMEDY » ecrit 62 px et il n'en
     restait que 60 une fois les marges otees -- deux pixels, et le nom
     du magasin se coupait en « MALMED / Y ». Les huit pixels sortent de
     la colonne Articles, qui n'a pas de largeur declaree. */
  #rsv_v_commandes .rsv-c-lieu { width: 84px; }
  #rsv_v_commandes .rsv-c-st   { width: 82px; }
  #rsv_v_commandes .rsv-grille th.n,
  #rsv_v_commandes .rsv-grille td.n { width: 84px; }
  #rsv_v_commandes .rsv-grille th.a,
  #rsv_v_commandes .rsv-grille td.a { width: 88px; }
}

/* ── La colonne d'actions, sur deux étages ─────────────────────── */
.rsv-act { display: flex; flex-direction: column; gap: 3px; }
.rsv-act-a .rsv-bq { width: 100%; text-align: center; }
.rsv-act-i { display: flex; gap: 3px; }
/* `flex: 1 1 0` : les icônes se partagent la largeur à parts égales, donc
   une commande annulée (une icône de moins) garde des boutons alignés sur
   ceux de la ligne du dessus. */
.rsv-act-i .rsv-bq {
  flex: 1 1 0; min-width: 0; padding: 2px 0; text-align: center;
}

/* ── Articles et commentaires dans une ligne de liste ──────────────────── */
.rsv-art { padding: 1px 0; }
.rsv-art small { display: inline; color: #888; font-size: 0.74rem; }
/* UNE couleur par nature de commentaire, sur les trois modules ET sur le
   papier : BLEU = ce qui qualifie un ARTICLE, AMBRE = ce qui porte sur la
   COMMANDE entière. La même remarque « bien cuites » se lisait brune dans
   la liste et bleue sur les feuilles de production et d'expédition : deux
   couleurs pour une seule chose, c'est une couleur de trop. Les teintes
   sont celles du PDF (`note_art` et `note` dans reservations_pdf.py). */
.rsv-com {
  color: #2E75B6; font-size: 0.85rem; font-style: italic;
  padding-left: 11px; line-height: 1.4;
}
.rsv-com-gen {
  margin-top: 3px; padding-left: 0; color: #8A5A00;
  border-top: 1px dotted #E0C068; padding-top: 3px;
}

/* ── Pastilles de statut ───────────────────────────────────────────────── */
.rsv-p {
  display: inline-block; padding: 2px 9px; border-radius: 9px;
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
  border: 1px solid;
}
.rsv-p-a_preparer { background: #FFF4CE; border-color: #E0C068; color: #6B4E00; }
.rsv-p-prete      { background: #E3F2E1; border-color: #8FBF8A; color: #14532D; }
.rsv-p-enlevee    { background: #ECECEC; border-color: #C0C0C0; color: #555; }
.rsv-p-annulee    { background: #FBE3E3; border-color: #D89090; color: #8C0000; }

/* ── Recherche à la frappe ─────────────────────────────────────────────── */
.rsv-ac { position: relative; }
.rsv-ac-liste {
  position: absolute; z-index: 30; left: 0; right: 0; min-width: 280px;
  top: 100%; max-height: 260px; overflow: auto; background: #FFF;
  border: 1px solid #B9B9B9; box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
/* Retournée au-dessus du champ quand le cadre défilant ne laisse pas la
   place dessous. L'ombre suit, sinon elle porte du mauvais côté. */
.rsv-ac-liste.rsv-ac-haut {
  top: auto; bottom: 100%;
  box-shadow: 0 -6px 16px rgba(0,0,0,.18);
}
.rsv-ac-item {
  padding: 5px 9px; cursor: pointer; font-size: 0.85rem; color: #1C1C1C;
  display: flex; gap: 8px; align-items: baseline;
  justify-content: space-between;
}
.rsv-ac-item small { color: #777; font-size: 0.75rem; white-space: nowrap; }
.rsv-ac-item:hover, .rsv-ac-item.sel { background: #E4EEF7; }
.rsv-ac-vide { padding: 9px; font-size: 0.82rem; color: #777; }

/* ── Fenêtre de saisie ─────────────────────────────────────────────────── */
/* ── Feuille de production ─────────────────────────────────
   Elle se lit debout, à un mètre, les mains dans la farine. Tout y est plus
   grand et plus gras que dans le reste de l'application : ce n'est pas une
   préférence d'affichage, c'est ce qui la rend utilisable. */
.rsv-feuille-prod td, .rsv-feuille-prod th {
  font-size: 0.95rem; padding: 6px 10px;
  /* Tout s'aligne au milieu : la quantité est deux fois plus haute que le
     reste, et calée en haut elle flottait au-dessus de son article. */
  vertical-align: middle;
}
.rsv-feuille-prod .rsv-c-q { width: 62px; }
.rsv-feuille-prod .rsv-qte { font-size: 1.2rem; font-weight: 700; }
.rsv-feuille-prod .rsv-art { font-weight: 700; font-size: 1rem; }

/* Une remarque, juste sous son article : décalée, en bleu, avec le client
   en plus pâle. Elle doit se distinguer d'une ligne à produire sans pour
   autant se faire oublier. */
/* Porté par `.rsv-grille` et non par la seule feuille de production : les
   feuilles d'expédition affichent les mêmes lignes, et une remarque doit s'y
   lire pareil. Sélecteur aussi spécifique que celui des lignes alternées
   (`.rsv-grille tbody tr:nth-child(even) td`), sinon une remarque tombant sur
   une ligne paire reprenait le fond du tableau. */
.rsv-grille tbody tr.rsv-rql td {
  border-top: 0; padding-top: 2px; padding-bottom: 2px;
  background: #F7FAFD;
  /* Une remarque est du texte libre : elle se replie, elle ne déborde pas. */
  overflow-wrap: anywhere;
}
.rsv-grille tbody tr.rsv-rql .rsv-c-q,
.rsv-grille tbody tr.rsv-rql .rsv-c-qte { color: #2E75B6; }
.rsv-grille tbody tr.rsv-rql .rsv-c-q b,
.rsv-grille tbody tr.rsv-rql .rsv-c-qte b { font-size: 1rem; }
.rsv-grille tbody tr.rsv-rql .rsv-c-q small,
.rsv-grille tbody tr.rsv-rql .rsv-c-qte small {
  display: block; font-size: 0.7rem; color: #6A7580; line-height: 1;
}
.rsv-rql-txt {
  /* En BLEU : sur une feuille où tout le reste est noir, c'est ce qui
     fait repérer la remarque sans avoir à la lire. */
  color: #2E75B6; font-weight: 700; font-size: 0.95rem;
  padding-left: 18px; position: relative;
}
.rsv-rql-txt::before {
  content: '↳'; position: absolute; left: 2px; color: #9FBBD2;
  font-weight: 400;
}
.rsv-rql-qui {
  color: #6A7580; font-size: 0.8rem; margin-left: 8px; white-space: nowrap;
}

/* Le titre de famille coiffe ses articles.

   Selecteur deliberement aussi specifique que celui des lignes alternees
   (`.rsv-grille tbody tr:nth-child(even) td`) : sinon une famille tombant
   sur une ligne paire recevait le fond clair tout en gardant son texte
   blanc, et disparaissait purement et simplement. Le hover est repris pour
   la meme raison. */
.rsv-grille tbody tr.rsv-fam td,
.rsv-grille tbody tr.rsv-fam:hover td {
  background: #1F3B52; color: #FFF; font-weight: 700;
  font-size: 0.98rem; letter-spacing: .3px; padding: 5px 10px;
}
.rsv-fam-nb { float: right; font-weight: 400; opacity: .85; }

/* Le menu sur la fiche article du Programme. */
.pg-menu-tete-g {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.pg-menu-et { border-left: 3px solid #9FBBD2; padding: 4px 0 4px 10px;
  margin: 0 0 8px; }
.pg-menu-tete { display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap; }
.pg-menu-n {
  background: #1F3B52; color: #FFF; font-size: 0.72rem; font-weight: 700;
  padding: 1px 6px;
}
.pg-menu-cl { font-size: 0.78rem; color: #6A7580; }
.pg-menu-abs { font-size: 0.78rem; color: #C00000; font-weight: 700; }
.pg-menu-tarif { font-size: 0.82rem; }
.pg-menu-choix { display: flex; flex-wrap: wrap; gap: 4px 10px;
  margin-top: 4px; }
.pg-menu-choix span { font-size: 0.85rem; }
.pg-menu-choix small { color: #6A7580; }

/* L'acompte sur la fiche : le RESTE en gros, le versé en petit. C'est le
   reste qui déclenche un geste au moment de remettre la marchandise. */
.rsv-fi-acpt {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px;
  margin: 10px 0; padding: 9px 12px;
  background: #F2F8F2; border: 1px solid #A5C9A5;
}
.rsv-fi-acpt-trop { background: #FFF6E0; border-color: #E0B44A; }
.rsv-fi-acpt-l, .rsv-fi-acpt-r {
  display: flex; flex-direction: column;
}
.rsv-fi-acpt span { font-size: 0.8rem; color: #5A646E; }
.rsv-fi-acpt-l b { font-size: 1.1rem; color: #1F3B52; }
.rsv-fi-acpt-r b { font-size: 1.6rem; color: #1B5E20; line-height: 1.1; }
.rsv-fi-acpt-trop .rsv-fi-acpt-r b { color: #9A6B00; }
.rsv-fi-acpt-d {
  grid-column: 1 / -1; margin-top: 6px; display: flex; flex-wrap: wrap;
  gap: 4px 12px;
}
.rsv-fi-acpt-d span { font-size: 0.78rem; }
.rsv-fi-acpt-d button {
  border: 0; background: transparent; color: #C00000; cursor: pointer;
  font-size: 0.78rem; padding: 0 2px;
}

/* Dans la fiche, l'accompagnement se décale sous son article. */
.rsv-fi-fils { padding-left: 26px; }
.rsv-fi-fils .rsv-fi-q { opacity: .75; }
.rsv-fi-fils .rsv-fi-a::before { content: '↳  '; color: #9FBBD2; }

/* Une ligne rattachée à son porteur : décalée, et reliée par un filet.
   On doit voir d'un coup d'œil ce qui accompagne quoi. */
.rsv-o-fils { margin-left: 26px; position: relative; }
.rsv-o-fils::before {
  content: ''; position: absolute; left: -14px; top: 0; bottom: 50%;
  border-left: 2px solid #9FBBD2; border-bottom: 2px solid #9FBBD2;
  width: 10px;
}

/* ── Fenêtre de choix (accompagnements, menus) ──────────────────
   Seconde couche : elle s'ouvre PAR-DESSUS le formulaire de commande, qui
   reste intact dessous. */
.rsv-modal2 { z-index: 9100; background: rgba(0,0,0,.35); }
.rsv-choix-box { max-width: 760px; }
.rsv-et { border: 1px solid #C9C9C9; margin: 0 0 10px; padding: 8px 10px; }
.rsv-et-ok { border-color: #2E7D32; background: #F6FBF6; }
.rsv-et-tete {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.rsv-et-nom { font-weight: 700; color: #1F3B52; font-size: 1rem; }
.rsv-et-cpt { font-size: 0.85rem; color: #777; }
.rsv-et-ok .rsv-et-cpt { color: #2E7D32; font-weight: 700; }
.rsv-et-choix { display: flex; flex-wrap: wrap; gap: 6px; }
.rsv-et-c {
  border: 1px solid #C9C9C9; background: #FFF; cursor: pointer;
  padding: 6px 10px; font-size: 0.92rem; text-align: left;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.rsv-et-c:hover { background: #F0F4F8; }
/* En pas à pas, les choix sont la seule chose à faire : on les grandit. */
.rsv-choix-box .rsv-et-cpt { font-variant: small-caps; }
.rsv-et-c-on {
  background: #E4EEF7; border-color: #1F3B52; font-weight: 700;
}
.rsv-et-c small { color: #777; font-size: 0.8rem; }
.rsv-et-c b { color: #1F3B52; }

/* « Non enregistré » : visible sans être une alarme, mais impossible à
   manquer quand on vient de composer ses ateliers. */
.rsv-sale {
  display: inline-block; margin: 0 8px;
  background: #FFF6E0; border: 1px solid #E0B44A; color: #5A4100;
  font-weight: 700; padding: 2px 8px;
}

/* Un atelier : une carte, parce qu'on le lit comme un bloc. */
.rsv-at {
  border: 1px solid #C9C9C9; background: #FBFBFB;
  padding: 10px 12px; margin: 0 0 10px;
}
.rsv-at-tete { display: flex; gap: 8px; align-items: center; }
.rsv-at-nom {
  flex: 1; font-size: 1rem; font-weight: 700; color: #1F3B52;
  padding: 5px 8px; border: 1px solid #B9B9B9;
}
.rsv-at-lbl {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: .4px;
  color: #777; margin: 10px 0 5px;
}
.rsv-at-classes, .rsv-at-arts {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.rsv-at-c {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid #C9C9C9; background: #FFF; padding: 3px 8px;
  font-size: 0.85rem; cursor: pointer;
}
.rsv-at-c-on { background: #E4EEF7; border-color: #1F3B52; font-weight: 700; }
.rsv-at-c-pris { opacity: .45; cursor: not-allowed; }
.rsv-at-a {
  display: inline-flex; align-items: center; gap: 6px;
  background: #E4EEF7; border: 1px solid #9FBBD2; padding: 3px 4px 3px 8px;
  font-size: 0.85rem;
}
.rsv-at-a button {
  border: 0; background: transparent; cursor: pointer; color: #C00000;
  font-size: 0.85rem; line-height: 1; padding: 2px 4px;
}
.rsv-at-add { padding: 4px 8px; border: 1px solid #B9B9B9; min-width: 160px; }

/* La trouvaille hors fenêtre : visible sans être une alarme. */
.rsv-hors {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 8px; padding: 8px 12px;
  background: #FFF6E0; border: 1px solid #E0B44A; color: #5A4100;
  font-size: 0.9rem;
}
.rsv-hors b { color: #1F3B52; }

.rsv-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px;
}
.rsv-modal-box {
  background: #FFF; color: #1C1C1C; border: 1px solid #9C9C9C;
  width: 100%; max-width: 880px; max-height: 90vh; overflow: auto;
  padding: 16px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.4);
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
}
.rsv-modal-box h3 { margin: 0 0 12px; font-size: 1.05rem; color: #1F3B52; }
.rsv-grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; }
/* Le libellé d'un champ se lit AVANT de remplir : il doit être plus lourd
   que l'aide qui le suit, pas plus léger que la valeur qu'on tape. */
.rsv-l { display: flex; flex-direction: column; gap: 3px; font-size: 0.87rem;
  color: #2C3440; font-weight: 600; }
.rsv-l input, .rsv-l select {
  border: 1px solid #B9B9B9; padding: 5px 7px; font-family: inherit;
  font-size: 0.95rem; font-weight: 400; width: 100%; background: #FFF;
  color: #1C1C1C;
}
.rsv-l small { color: #6A7580; font-size: 0.8rem; line-height: 1.3;
  font-weight: 400; }
.rsv-case { display: flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 0.84rem; color: #333; flex-wrap: wrap; }
.rsv-case small { color: #888; font-size: 0.73rem; width: 100%;
  margin-left: 22px; }
.rsv-modal-err { color: #C00000; font-size: 0.85rem; margin-top: 10px;
  font-weight: 600; }
.rsv-modal-pieds { display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 14px; }
.rsv-pf { margin-top: 14px; border-top: 1px solid #DDD; padding-top: 10px; }
.rsv-pf-titre { display: flex; align-items: center; gap: 9px;
  font-size: 0.95rem; font-weight: 700; color: #1F3B52; margin-bottom: 8px;
  flex-wrap: wrap; }
.rsv-pf-titre .rsv-ref { font-weight: 400; font-size: 0.75rem; }

/* ── Lignes d'articles d'une commande ──────────────────────────────────── */
/* Une ligne = un article, sa quantité, son prix, SON commentaire. Le
   commentaire est sur la même ligne et non dessous : séparé de son article
   il perdrait ce qu'il qualifie. */
.rsv-o-ligne {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) 68px 78px minmax(150px, 1.6fr) 28px;
  gap: 6px; align-items: start; margin-bottom: 5px;
}
.rsv-o-ligne input {
  border: 1px solid #B9B9B9; padding: 3px 6px; font-family: inherit;
  font-size: 0.85rem; width: 100%; background: #FFF; color: #1C1C1C;
}
.rsv-o-qte, .rsv-o-pu { text-align: right; background: #FFFDE7 !important; }
.rsv-o-qte:focus, .rsv-o-pu:focus {
  outline: 2px solid #217346; outline-offset: -2px; background: #FFF !important;
}
.rsv-o-com { font-style: italic; }
.rsv-o-total { margin-top: 8px; font-size: 0.86rem; color: #1F3B52; }

/* ── Avertissement de doublon client ───────────────────────────────────── */
.rsv-alerte {
  background: #FFF4CE; border: 1px solid #E0C068; padding: 7px 10px;
  font-size: 0.82rem; margin: 10px 0 0; color: #5C4600; line-height: 1.45;
}
.rsv-dbl { display: flex; align-items: center; gap: 8px; margin-top: 4px;
  flex-wrap: wrap; }

/* ── Journal d'une commande ────────────────────────────────────────────── */
.rsv-jrn {
  display: grid; grid-template-columns: 128px 86px 92px 1fr; gap: 8px;
  font-size: 0.78rem; padding: 2px 0; border-bottom: 1px dotted #E4E4E4;
  align-items: baseline;
}
.rsv-jrn-q { color: #7A7A7A; white-space: nowrap; }
.rsv-jrn-a { font-weight: 700; color: #1F3B52; }
.rsv-jrn-u { color: #555; }
.rsv-jrn-d { color: #5A5A5A; }

@media (max-width: 860px) {
  /* En colonne, c'est la page entière qui défile : sur un téléphone, on ne
     peut pas geler trois rangées de commandes en haut de l'écran, il ne
     resterait rien pour la liste. */
  .rsv-app { flex-direction: column; min-height: 0; height: auto; }
  .rsv-feuille { display: block; overflow: visible; }
  .rsv-page, #rsv_v_commandes { display: block; overflow: visible; }
  .rsv-defil { overflow: visible; padding-bottom: 0; }
  /* Deux colonnes n'ont plus de sens sur 375 px : tout s'empile dans
     l'ordre où l'on s'en sert. */
  .rsv-filtres { grid-template-columns: 1fr; gap: 6px; }
  .rsv-nav { flex: none; flex-direction: row; overflow-x: auto; padding: 0;
    border-right: 0; border-bottom: 1px solid var(--card-border); }
  /* La colonne devient une barre : le lieu garde sa place en tête, sans se
     laisser étirer par la rangée d'onglets. */
  .rsv-nav-lieu { flex: 0 0 auto; display: flex; align-items: center;
    gap: 6px; padding: 4px 8px; margin: 0; border-bottom: 0;
    border-right: 1px solid var(--card-border); }
  .rsv-nav-lieu-l { margin: 0; white-space: nowrap; }
  .rsv-nav-lieu select { width: auto; max-width: 42vw; }
  .rsv-nav-b { white-space: nowrap; border-left: 0;
    border-bottom: 3px solid transparent; }
  .rsv-nav-b.active { border-left: 0; border-bottom-color: var(--blue); }
  .rsv-feuille { padding: 10px; }
  .rsv-grille { font-size: 0.8rem; }
  .rsv-grille th.a, .rsv-grille td.a { width: auto; }
  .rsv-grille2 { grid-template-columns: 1fr; }
  .rsv-o-ligne { grid-template-columns: 1fr 60px 70px 28px; }
  .rsv-o-comz { grid-column: 1 / -1; }
  /* Le commentaire prend sa propre ligne ; sans cela le ✕ se retrouvait
     seul sur une troisième ligne, étiré sur toute la largeur. */
  .rsv-o-ligne .rsv-bq-sup { grid-column: 4; grid-row: 1; }
  .rsv-jrn { grid-template-columns: 1fr 1fr; }
  .rsv-rech { min-width: 140px; flex: 1; }
  .rsv-modal { padding: 8px; }
  .rsv-modal-box { padding: 12px; }
}
/* Une ligne dont l'article n'a pas été pris dans le catalogue : elle n'a pas
   de code, et c'est le code qui groupe les totaux de production. */
.rsv-o-orphelin .rsv-o-art input {
  background: #FFF8E1; border-color: #E0C068;
}


/* ══ Réservations — ajouts v2 ═════════════════════════════════
   Réglages de gamme, création de client en bout de ligne, et commandes
   récurrentes.                                                           */

/* Le ＋ qui crée un client, au bout du champ de recherche. */
.rsv-ligne-plus { display: flex; gap: 6px; align-items: stretch; }
.rsv-ligne-plus input { flex: 1; min-width: 0; }
.rsv-b-plus {
  flex: 0 0 auto; width: 38px; cursor: pointer;
  background: #217346; border: 1px solid #1A5C38; border-radius: 2px;
  color: #FFF; font-size: 1.05rem; font-weight: 700; font-family: inherit;
  line-height: 1;
}
.rsv-b-plus:hover { background: #1A5C38; }

/* ── Réglages : la gamme réservable ───────────────────────────── */
.rsv-classes {
  display: grid; gap: 7px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.rsv-classe {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px;
  align-items: baseline; cursor: pointer;
  border: 1px solid #C6C6C6; border-radius: 3px; padding: 7px 10px;
  background: #FAFAFA; font-size: 0.9rem;
}
.rsv-classe:hover { border-color: #7FA8CC; background: #F2F7FB; }
.rsv-classe-on { background: #E3F2E1; border-color: #8FBF8A; }
.rsv-classe-nom { font-weight: 700; color: #1F3B52; }
.rsv-classe-nb { font-size: 0.8rem; color: #5A5A5A; white-space: nowrap; }
.rsv-classe small {
  grid-column: 2 / -1; color: #7A7A7A; font-size: 0.78rem; line-height: 1.3;
}

/* ── Commandes récurrentes ───────────────────────────────── */
.rsv-jours { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.rsv-jour {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  border: 1px solid #C6C6C6; border-radius: 3px; padding: 5px 10px;
  background: #FAFAFA; font-size: 0.88rem; font-weight: 600; color: #2C3440;
}
.rsv-jour:hover { border-color: #7FA8CC; background: #F2F7FB; }
.rsv-jour-on { background: #E3F2E1; border-color: #8FBF8A; color: #14532D; }

/* Les dates annoncées avant d'enregistrer : une règle de calendrier se
   vérifie en lisant ses dates, pas en relisant sa définition. */
.rsv-apercu {
  margin-top: 10px; padding: 8px 11px; font-size: 0.88rem;
  background: #EEF3F8; border: 1px solid #C2D4E4; border-radius: 3px;
  color: #1F3B52; line-height: 1.6;
}
.rsv-apercu:empty { display: none; }
.rsv-apercu-d {
  display: inline-block; background: #FFF; border: 1px solid #C2D4E4;
  border-radius: 3px; padding: 1px 7px; margin-right: 3px;
  font-weight: 600;
}

@media (max-width: 860px) {
  .rsv-nav-tete { padding: 6px; flex: 0 0 auto; }
  .rsv-b-neuve { width: auto; white-space: nowrap; padding: 8px 12px; }
  .rsv-classes { grid-template-columns: 1fr; }
}


/* ══ Réservations — ajouts v3 ═════════════════════════════════ */

/* « 12 baguettes, dont 4 bien cuites » : la quantité concernée se saisit
   contre le commentaire, pas ailleurs — elle le qualifie. Le champ
   n'apparaît que lorsqu'il a un sens : ligne commentée, quantité > 1. */
.rsv-o-comz { display: flex; gap: 5px; align-items: stretch; min-width: 0; }
.rsv-o-comz .rsv-o-com { flex: 1; min-width: 0; }
/* La quantité concernée appartient au commentaire d'ARTICLE : elle prend
   donc le bleu, en saisie comme en lecture. Elle était ambre des deux
   côtés, ce qui la rangeait avec les commentaires de commande. */
.rsv-o-cq {
  flex: 0 0 62px; text-align: right;
  background: #E4EEF7 !important; border-color: #A8C7E0 !important;
  font-weight: 700; color: #1F3B52 !important;
}
.rsv-o-cq:focus {
  outline: 2px solid #2E75B6; outline-offset: -2px; background: #FFF !important;
}
.rsv-o-cq::placeholder { font-weight: 400; color: #7FA8CC; }

/* Le même renseignement, en lecture : il doit sauter aux yeux sur la liste
   comme sur la feuille du fournil. */
.rsv-com-q {
  background: #E4EEF7; border: 1px solid #A8C7E0; border-radius: 3px;
  padding: 0 5px; color: #1F3B52; font-style: normal; font-weight: 700;
}

/* ── Zone défilante (historique d'un client) ────────────────────── */
/* Environ cinq lignes, puis on fait défiler : un client fidèle a des
   dizaines de commandes, et la fiche ne doit pas s'allonger sans fin. */
.rsv-defile {
  max-height: 15rem; overflow-y: auto; overflow-x: hidden;
  border: 1px solid #D4D4D4; scrollbar-gutter: stable;
}
.rsv-defile .rsv-grille { margin-bottom: 0; }
.rsv-defile .rsv-grille th { top: 0; }
/* Une commande déjà passée reste lisible mais s'efface : ce qui compte est
   ce qui vient. */
.rsv-passee td { color: #8A8A8A; background: #FAFAFA; }
.rsv-passee:hover td { color: #1C1C1C; }


/* ══ Réservations — tri des colonnes ════════════════════════════ */
.rsv-tri { cursor: pointer; user-select: none; padding-right: 18px !important;
  position: relative; }
.rsv-tri:hover { background: #DCE6EF; }
/* La flèche n'apparaît qu'au survol tant que la colonne n'est pas celle du
   tri : trois flèches grises ne disent pas laquelle compte. */
.rsv-tri::after {
  content: '\2195'; position: absolute; right: 5px; opacity: 0;
  font-weight: 400; font-size: 0.8em;
}
.rsv-tri:hover::after { opacity: .45; }
.rsv-tri-on { background: #D5E3EF; }
.rsv-tri-on[data-sens="haut"]::after { content: '\25B2'; opacity: 1; }
.rsv-tri-on[data-sens="bas"]::after  { content: '\25BC'; opacity: 1; }

/* Une échéance issue d'un abonnement : on distingue d'un coup d'œil
   l'habitué du client de passage. */
.rsv-recurrent { color: #C00000 !important; font-weight: 700; }


/* ══ Réservations — expéditions ══════════════════════════════
   Un bloc par magasin, nettement séparé : ces feuilles se détachent et se
   remettent à des personnes différentes.                                  */
.rsv-exp {
  margin: 0 0 18px; border: 1px solid #B9C4CE; border-radius: 3px;
  overflow: hidden;
}
.rsv-exp-tete {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  background: #1F3B52; color: #FFF; padding: 7px 11px;
}
.rsv-exp-nom { font-size: 1.05rem; font-weight: 700; }
.rsv-exp-res { font-size: 0.86rem; color: #C8DCEF; }
.rsv-exp-tete .rsv-bq { margin-left: auto; }
.rsv-exp .rsv-grille { margin-bottom: 0; }
.rsv-exp .rsv-grille th { position: static; }
.rsv-exp-vides { font-style: italic; }

/* Le champ qui manque, désigné : un message d'erreur sans repère visuel
   oblige à relire tout le formulaire pour trouver lequel. */
.rsv-manque {
  border-color: #C00000 !important; background: #FFF6F6 !important;
  outline: 2px solid #E88; outline-offset: -2px;
}

/* ══ Réservations — mode magasin ══════════════════════════════════════════
   Plein écran, sans le reste de l'application autour. Ce mode ne verrouille
   PAS l'appareil : Alt+Tab et la touche Windows restent hors de portée d'une
   page web. Le verrou réel se pose au niveau du poste (navigateur en mode
   kiosque) ; ceci en est l'étage applicatif.                              */
body.rsv-borne .navbar,
body.rsv-borne .nav-mobile-panel,
body.rsv-borne .nav-mobile-backdrop,
body.rsv-borne .sites-bar,
body.rsv-borne .current-site-bar,
body.rsv-borne .date-nav-bar,
body.rsv-borne .status-bar,
body.rsv-borne .no-data-day-msg { display: none !important; }
body.rsv-borne .main-content { padding: 0 !important; margin: 0 !important; }
body.rsv-borne .rsv-app { margin: 0; height: 100vh; min-height: 100vh;
  border-top: 0; }
/* Rien à sélectionner ni à faire glisser : sur un écran tactile, une
   sélection accidentelle fait apparaître les menus du navigateur. */
body.rsv-borne { user-select: none; -webkit-user-select: none;
  overscroll-behavior: none; }
body.rsv-borne input, body.rsv-borne textarea { user-select: text;
  -webkit-user-select: text; }

/* Le coin de sortie : invisible, et il doit le rester. */
.rsv-coin {
  position: fixed; top: 0; left: 0; width: 64px; height: 64px;
  z-index: 9500; cursor: default; background: transparent;
  touch-action: none;
}
/* Un repère n'apparaît qu'après 700 ms d'appui : celui qui frôle l'écran ne
   voit rien, celui qui appuie volontairement sait que ça prend. */
.rsv-coin-actif {
  background: radial-gradient(circle at 18px 18px,
    rgba(46,117,182,.30) 0%, rgba(46,117,182,0) 70%);
}

.rsv-nav-borne {
  width: 100%; background: none; border: 1px solid var(--card-border);
  color: var(--text-dim); border-radius: 4px; padding: 7px 10px;
  font-size: 0.8rem; font-family: inherit; cursor: pointer;
}
.rsv-nav-borne:hover { color: var(--white); border-color: var(--blue); }
body.rsv-borne .rsv-nav-borne { display: none; }
/* Au comptoir on prend des commandes : les feuilles de production et
   d'expédition sont un travail d'arrière-boutique, elles n'ont rien à
   faire sur un poste verrouillé. */
body.rsv-borne .rsv-nav-b[data-vue="production"],
body.rsv-borne .rsv-nav-b[data-vue="expeditions"],
body.rsv-borne .rsv-nav-b[data-vue="reglages"] { display: none !important; }

/* ── Pavé de sortie ─────────────────────────────────────────────────────
   Un pavé et non un champ texte : sur un écran tactile, un champ ouvre le
   clavier du système, qui recouvre la saisie et donne accès à ses propres
   réglages — exactement ce qu'un mode verrouillé doit éviter.            */
.rsv-pin-fond { background: rgba(10,20,30,.78); align-items: center; }
.rsv-pin-box {
  background: #FFF; border-radius: 10px; padding: 22px 26px 18px;
  width: 300px; text-align: center; color: #1C1C1C;
  box-shadow: 0 14px 50px rgba(0,0,0,.5);
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
}
.rsv-pin-box h3 { margin: 0 0 14px; font-size: 1rem; color: #1F3B52; }
.rsv-pin-pts {
  font-size: 1.9rem; letter-spacing: .34em; color: #1F3B52; height: 2.2rem;
}
.rsv-pin-err { color: #C00000; font-size: 0.82rem; min-height: 1.1rem;
  margin-bottom: 8px; font-weight: 600; }
.rsv-pin-grille {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.rsv-pin-t {
  padding: 16px 0; font-size: 1.25rem; font-family: inherit; cursor: pointer;
  background: #F3F3F3; border: 1px solid #C6C6C6; border-radius: 6px;
  color: #1C1C1C;
}
.rsv-pin-t:active { background: #D5E3EF; }
.rsv-pin-c { color: #8C0000; }
.rsv-pin-ok { background: #217346; border-color: #1A5C38; color: #FFF; }
.rsv-pin-ok:active { background: #14452A; }
.rsv-pin-annul { width: 100%; margin-top: 12px; }


/* ══ Réservations — fiche de commande ═════════════════════════════════════
   Lecture d'abord : on l'ouvre au comptoir pour répondre à un client qui
   attend. Grands caractères, peu de choses, et une croix pour sortir.    */
.rsv-num-ouvre { cursor: pointer; }
.rsv-num-ouvre b { text-decoration: underline dotted #7FA8CC 2px;
  text-underline-offset: 3px; }
.rsv-num-ouvre:hover { background: #DCE6EF !important; }

.rsv-fi-fond { align-items: center; }
.rsv-fi-box {
  max-width: 560px; padding: 20px 24px 18px; position: relative;
  font-size: 1.05rem;
}
.rsv-fi-x {
  position: absolute; top: 8px; right: 10px; width: 42px; height: 42px;
  background: none; border: 0; font-size: 1.5rem; line-height: 1;
  color: #8A8A8A; cursor: pointer; font-family: inherit; border-radius: 6px;
}
.rsv-fi-x:hover { background: #F0F0F0; color: #1C1C1C; }
.rsv-fi-tete {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  padding-right: 44px;
}
.rsv-fi-num { font-size: 1.8rem; font-weight: 700; color: #1F3B52; }
.rsv-fi-client { font-size: 1.3rem; font-weight: 700; color: #1C1C1C; }
.rsv-fi-tel { font-size: 1.1rem; color: #4A5560; margin-top: 2px; }
.rsv-fi-quand {
  font-size: 1.15rem; margin-top: 12px; color: #1F3B52;
}
.rsv-fi-lieu { font-size: 1.05rem; color: #4A5560; }
.rsv-fi-arts {
  margin: 16px 0 6px; border-top: 2px solid #B9C4CE;
  border-bottom: 2px solid #B9C4CE; padding: 6px 0;
}
.rsv-fi-l {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px;
  align-items: baseline; padding: 7px 0;
  border-bottom: 1px dotted #DDD;
}
.rsv-fi-l:last-child { border-bottom: 0; }
.rsv-fi-q {
  font-size: 1.5rem; font-weight: 700; color: #2E75B6; text-align: right;
}
.rsv-fi-a { font-size: 1.1rem; }
.rsv-fi-c {
  display: block; font-size: 0.95rem; color: #2E75B6; font-style: italic;
  margin-top: 3px;
}
.rsv-fi-p { font-size: 1.05rem; color: #4A5560; white-space: nowrap; }
.rsv-fi-total { text-align: right; font-size: 1.2rem; color: #1F3B52; }
/* Le commentaire de la COMMANDE, sur la fiche : ambre, comme dans la liste
   et comme sur le bon imprimé. Il était bleu, donc indiscernable d'un
   commentaire d'article deux lignes plus haut. */
.rsv-fi-gen {
  margin-top: 14px; padding: 9px 12px; background: #FFF6E0;
  border-left: 4px solid #B06E00; color: #5A4100;
  font-size: 1.02rem; line-height: 1.45;
}
.rsv-fi-note {
  margin-top: 8px; font-size: 0.95rem; color: #6A7580; font-style: italic;
}
.rsv-fi-pieds {
  display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap;
}
.rsv-fi-b {
  flex: 1; min-width: 130px; padding: 14px 12px; font-size: 1rem;
  font-family: inherit; font-weight: 600; cursor: pointer;
  background: #F3F3F3; border: 1px solid #B9B9B9; border-radius: 6px;
  color: #1C1C1C;
}
.rsv-fi-b:hover { background: #E4EEF7; border-color: #7FA8CC; }
.rsv-fi-ok { background: #217346; border-color: #1A5C38; color: #FFF; }
.rsv-fi-ok:hover { background: #1A5C38; }

@media (max-width: 860px) {
  .rsv-fi-box { padding: 16px 14px 14px; font-size: 1rem; }
  .rsv-fi-num { font-size: 1.5rem; }
  .rsv-fi-client { font-size: 1.15rem; }
  .rsv-fi-b { min-width: 100%; }
}

/* ── Sur téléphone, la liste devient des fiches ──────────────────
   Huit colonnes sur 375 px, c'était cinq lignes de texte par cellule et un
   nom de client coupé en trois. Le tableau reste le MÊME — mêmes cellules,
   même script, même ordre — mais chaque rangée se replie en fiche, par
   cases nommées. Une seule écriture pour les deux écrans : une seconde
   mise en page aurait divergé de la première au premier changement.    */
@media (max-width: 860px) {
  #rsv_v_commandes .rsv-grille thead { display: none; }
  #rsv_v_commandes .rsv-grille,
  #rsv_v_commandes .rsv-grille tbody { display: block; }
  #rsv_v_commandes .rsv-grille tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "num  enl st"
      "cli  cli cli"
      "art  art art"
      "lieu tot tot"
      "act  act act";
    gap: 3px 8px; align-items: center;
    margin: 0 0 10px; padding: 8px 10px;
    border: 1px solid #C6C6C6; border-radius: 5px; background: #FFF;
  }
  /* La zébrure n'a plus d'objet : chaque fiche porte son cadre. */
  #rsv_v_commandes .rsv-grille tbody tr:nth-child(even) td { background: none; }
  #rsv_v_commandes .rsv-grille td {
    display: block; border: 0; padding: 0; white-space: normal;
  }
  /* « Aucune commande » n'a qu'une cellule : elle échappe au découpage. */
  #rsv_v_commandes .rsv-tr-vide { display: block; }
  #rsv_v_commandes .rsv-c-enl  { grid-area: enl; display: flex; gap: 5px;
    flex-wrap: wrap; align-items: baseline; }
  #rsv_v_commandes .rsv-c-st   { grid-area: st; justify-self: end; }
  #rsv_v_commandes .rsv-c-cli  { grid-area: cli; font-size: 1rem; }
  #rsv_v_commandes .rsv-c-art  { grid-area: art; }
  #rsv_v_commandes .rsv-c-lieu { grid-area: lieu; font-size: 0.78rem;
    color: #6B6B6B; }
  #rsv_v_commandes .rsv-grille td.n { grid-area: tot; text-align: right;
    font-size: 1.05rem; }
  #rsv_v_commandes .rsv-grille td.a { grid-area: act; width: auto; }
  /* Le numéro ouvre la fiche de la commande. Sur un téléphone il doit
     AVOIR L'AIR d'un bouton, et se viser au pouce sans regarder : 38 px de
     haut, c'est la plus petite cible qu'on touche du premier coup. */
  #rsv_v_commandes .rsv-c-num {
    grid-area: num; display: flex; align-items: center; gap: 6px;
    min-height: 38px; padding: 4px 11px; font-size: 1.05rem;
    border: 1px solid #7FA8CC; border-radius: 4px;
    background: #EAF2F9; color: #1F3B52;
  }
  /* Le souligné pointillé disait « ceci s'ouvre » là où rien ne le
     montrait ; le cadre le dit mieux. */
  #rsv_v_commandes .rsv-c-num b { text-decoration: none; }
  #rsv_v_commandes .rsv-act { gap: 6px; margin-top: 5px; }
  #rsv_v_commandes .rsv-act-a .rsv-bq { min-height: 40px; font-size: 0.95rem; }
  #rsv_v_commandes .rsv-act-i .rsv-bq { min-height: 36px; font-size: 1rem; }
  /* Le mot « Lieu » s'efface : la punaise suffit devant un nom de magasin,
     et les onglets ont besoin de cette place dans la barre. */
  .rsv-nav-lieu-l span { display: none; }
}

/* Un geste que rien n'annonce est un geste que personne ne fait : on le dit
   une fois, au premier passage sur un écran tactile, et plus jamais. */
.rsv-astuce {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 9px; padding: 7px 10px;
  background: #EAF2F9; border: 1px solid #A8C7E0; border-radius: 4px;
  font-size: 0.86rem; color: #1F3B52;
}
.rsv-astuce button { margin-left: auto; }

/* Deux libelles pour un meme bouton : le long sur un ecran de comptoir, le
   court sur un telephone, ou chaque pixel de la barre compte. */
.rsv-l-court { display: none; }
@media (max-width: 860px) {
  .rsv-l-long { display: none; }
  .rsv-l-court { display: inline; }
}

/* ══ PATCH CITY-FRITE ══════════════════════════════════════════════════════
   Une page de réglage et d'export, pour une seule enseigne. Rien n'est
   partagé avec les autres modules : le bloc entier s'enlève avec le patch.  */
.cf-app { max-width: 1100px; }
.cf-bloc {
  background: var(--card-bg, #FFFFFF0D); border: 1px solid var(--card-border);
  border-radius: 6px; padding: 14px 16px; margin-bottom: 14px;
}
.cf-bloc h3 {
  margin: 0 0 10px; font-size: 1rem; color: var(--white);
  border-bottom: 1px solid var(--card-border); padding-bottom: 7px;
}
.cf-ligne {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  margin-bottom: 8px;
}
.cf-lbl { font-size: 0.82rem; color: var(--text-dim); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; }
.cf-chk { display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.9rem; color: var(--text); }
.cf-info { font-size: 0.86rem; color: var(--text-dim); }
/* L'aide dit POURQUOI, pas comment : le comment se voit à l'écran. */
.cf-aide { font-size: 0.84rem; color: var(--text-dim); line-height: 1.5;
  margin: 6px 0 0; max-width: 90ch; }
.cf-note { font-size: 0.9rem; color: var(--text); line-height: 1.55;
  margin: 0 0 14px; max-width: 90ch; }
/* Les explications sont PLIEES par defaut, un ⓘ par bloc les ouvre. La
   cible fait 24 px : c'est un bouton qu'on vise au doigt sur une tablette
   posee sur le comptoir, pas une note de bas de page. */
.cf-i {
  margin-left: 8px; min-width: 24px; height: 24px; padding: 0 5px;
  border: 1px solid var(--card-border); border-radius: 12px;
  background: none; color: var(--text-dim); cursor: pointer;
  font-size: 0.84rem; line-height: 1; vertical-align: middle;
}
.cf-i:hover { color: var(--white); border-color: var(--text-dim); }
/* Ouvert : le bouton le DIT. Sinon on reclique pour savoir ou on en est. */
.cf-i-on { color: var(--blue-txt); border-color: var(--blue-txt); }
.cf-pli { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; }
.cf-pli .cf-i { margin-left: 0; }
.cf-pli span { font-size: 0.84rem; color: var(--text-dim); }
.cf-vide { font-size: 0.86rem; color: var(--text-dim); font-style: italic; }
.cf-tab { width: 100%; border-collapse: collapse; margin: 6px 0;
  font-size: 0.88rem; }
.cf-tab th, .cf-tab td {
  padding: 5px 8px; border-bottom: 1px solid var(--card-border);
  text-align: left; color: var(--text);
}
.cf-tab th { color: var(--text-dim); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: .04em; }
.cf-tab td.n, .cf-tab th.n { text-align: right; white-space: nowrap; }
.cf-feuille { margin-top: 10px; }
/* Ce qui MANQUE se lit en premier. */
.cf-alerte { background: #3A2A1E; border-left: 4px solid #E0A030;
  padding: 7px 11px; border-radius: 3px; font-size: 0.88rem;
  color: #F0DCC0; margin: 8px 0; }
.cf-alerte ul { margin: 0; padding-left: 18px; }
.cf-alerte li { margin: 3px 0; line-height: 1.45; }
.cf-partiel td { background: rgba(224, 160, 48, .12); }

@media (max-width: 860px) {
  .cf-tab { font-size: 0.82rem; }
  .cf-bloc { padding: 10px 11px; }
}

/* ══ UN SECRET SANS type="password" ═══════════════════════
   Chrome propose « Enregistrer le mot de passe ? » dès qu'il VOIT un
   champ de ce type. Ni « autocomplete=off », ni l'absence de <form>, ni
   un champ créé en JavaScript ne l'en empêchent : la décision appartient
   à son gestionnaire de mots de passe, pas à la page. Et la bulle arrive
   au changement d'écran SUIVANT — sur la tablette, à la validation d'un
   comptage.
   Un secret retenu par le navigateur d'un appareil partagé l'ouvre pour
   qui le prend. Les champs des quatre pages qui demandent un secret
   (connexion, les deux codes d'accès, le comptage) sont donc des champs
   TEXTE, masqués ici : le navigateur n'a plus rien à proposer.
   `masque.js` rend leur type="password" aux rares navigateurs qui ne
   savent pas masquer — être masqué passe avant tout. */
.masque {
  -webkit-text-security: disc;
  text-security: disc;
}
/* « Afficher le mot de passe » : on démasque, on ne change pas de type.
   Repasser en type="password" suffirait à réveiller la proposition. */
.masque.masque-vu {
  -webkit-text-security: none;
  text-security: none;
}

/* ══ DÉCLARATION DE CAISSE (page employé, /caisse) ══════════════════════ */
/* Écrite pour un téléphone tenu d'une main, dans une friterie, entre deux
   clients. Les cibles font 44 px au minimum — c'est la taille d'un pouce,
   pas une marge de confort : une case ratée se corrige, une quantité tapée
   dans la mauvaise colonne ne se voit pas. */
/* L'attribut « hidden » ne suffit plus dès qu'une règle d'auteur donne un
   « display » à l'élément : elle bat la feuille du navigateur, et le pied
   de page restait affiché par-dessus l'écran du code. Vu à l'écran, jamais
   dans un test — la propriété, elle, valait bien « vrai ». */
.cz-body [hidden], .cz-pied[hidden], .cf-app [hidden] { display: none !important; }

.cz-body { background: var(--navy); min-height: 100vh;
  padding-bottom: 104px; }
.cz-app { max-width: 560px; margin: 0 auto; padding: 0 12px 12px; }

.cz-tete { display: flex; align-items: center; gap: 8px;
  padding: 10px 2px 12px; border-bottom: 1px solid var(--card-border);
  margin-bottom: 14px; }
.cz-logo { font-size: 1.05rem; font-weight: 700; color: var(--white); }
.cz-qui { flex: 1; font-size: 0.86rem; color: var(--blue-txt);
  text-align: right; line-height: 1.25; }
.cz-sortir { background: none; border: 1px solid var(--card-border);
  color: var(--text-dim); border-radius: 8px; padding: 7px 10px;
  font-size: 0.8rem; cursor: pointer; }

.cz-vue { animation: czEntre .18s ease-out; }
@keyframes czEntre { from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; } }
.cz-titre { font-size: 1.1rem; color: var(--white); font-weight: 700;
  text-align: center; margin: 10px 0 14px; }
.cz-aide { font-size: 0.84rem; color: var(--text-dim); line-height: 1.5;
  text-align: center; margin: 12px 0 0; }

/* ── Le clavier du code ──────────────────────────────────────────────── */
/* Un clavier à l'écran, et non un champ de saisie : celui du téléphone met
   une seconde à monter, cache la moitié de l'écran et propose en haut ce
   qu'on a tapé la dernière fois. */
.cz-points { height: 46px; display: flex; align-items: center;
  justify-content: center; font-size: 1.6rem; letter-spacing: .22em;
  color: var(--white); margin-bottom: 10px; }
.cz-vide { color: var(--text-dim); font-size: 1.2rem; letter-spacing: .3em; }
.cz-clavier { display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; max-width: 320px; margin: 0 auto; }
.cz-touche { min-height: 64px; font-size: 1.6rem; font-weight: 600;
  background: var(--panel); color: var(--white); border: none;
  border-radius: 12px; cursor: pointer; font-family: inherit; }
.cz-touche:active { background: var(--blue-dark); }
.cz-touche-ok { background: var(--blue); font-size: 1.1rem; }
.cz-touche-eff { background: var(--panel-dark); font-size: 1.3rem; }

/* ── Le choix de la friterie ─────────────────────────────────────────── */
.cz-sites { display: grid; gap: 10px; max-width: 360px; margin: 0 auto; }
.cz-site { min-height: 58px; font-size: 1.05rem; font-weight: 600;
  background: var(--panel); color: var(--white); border: none;
  border-radius: 12px; cursor: pointer; padding: 0 14px;
  font-family: inherit; }
.cz-site:active { background: var(--blue-dark); }

/* ── Le bandeau du moment ────────────────────────────────────────────── */
.cz-bandeau { display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.cz-bandeau strong { font-size: 1.05rem; color: var(--white); }
.cz-bandeau span { font-size: 0.85rem; color: var(--text); }
.cz-b-ouv { background: #1F4E79; border-left: 4px solid var(--blue-txt); }
.cz-b-clo { background: #3A2A1E; border-left: 4px solid var(--orange); }
/* Les comptages intermediaires : une troisieme couleur, pour qu'un coup
   d'oeil suffise a savoir lequel des quatre est a l'ecran. */
.cz-b-int { background: #243B36; border-left: 4px solid #3FB68B; }
.cz-choix-moment { background: var(--panel-dark); border-radius: 10px;
  padding: 12px; margin-bottom: 12px; }
.cz-choix-moment .cz-aide { text-align: left; margin: 0 0 10px; }
.cz-choix-btns { display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center; }
.cz-choix-btns .btn { flex: 1; min-width: 140px; min-height: 48px;
  justify-content: center; }
/* Le nom du comptage, et ses heures en dessous : avec quatre moments
   possibles, la phrase d'explication ne pouvait plus les porter. */
.cz-choix-b { flex-direction: column; gap: 1px; line-height: 1.25;
  padding: 8px 10px; text-align: center; }
.cz-choix-b small { font-size: 0.72rem; opacity: 0.75;
  font-variant-numeric: tabular-nums; }

/* Le compte a rebours du frein. Rouge, sous le clavier endormi : l'employe
   doit comprendre que ce n'est pas une panne et que cela va repartir. */
.cz-attente { margin: 10px 0 0; text-align: center; font-weight: 600;
  color: #FCA5A5; font-variant-numeric: tabular-nums; }
.cz-clavier button:disabled { opacity: 0.4; }

/* ── La grille de comptage ───────────────────────────────────────────── */
/* Trois colonnes, et une seule pour les comptages qui n'en demandent
   qu'une. Une colonne qu'il ne faut pas remplir n'est pas grisée : elle
   n'est pas là.
   Mais les PISTES, elles, restent les trois dans les deux cas : la case
   « Compté » garde ainsi exactement la même largeur d'un comptage à
   l'autre. Elle s'étirait avant sur toute la ligne, et la même quantité
   tapée le matin et le soir n'avait pas la même tête — on se méfie d'une
   case qui change de taille entre deux écrans. */
.cz-entete, .cz-ligne { display: grid; align-items: center;
  grid-template-columns: 78px repeat(3, 1fr); gap: 6px; }
.cz-entete { padding: 0 2px 6px; position: sticky; top: 0; z-index: 2;
  background: var(--navy); }
.cz-entete span { font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: .03em; color: var(--text-dim); text-align: center;
  font-weight: 700; }
.cz-ligne { padding: 3px 2px; border-radius: 8px; }
/* La coupure n'est plus un mot mais une vignette : line-height nul, sans
   quoi la ligne de texte vide sous le dessin décalerait tout. */
.cz-coupure { display: block; line-height: 0; padding-right: 2px; }
/* Vaut pour le dessin (svg) comme pour la photo (img). C'est la CASE qui
   impose sa taille, jamais le fichier : une photo de piece est carree, et
   laissee libre elle occupait toute la hauteur -- une piece de 2 centimes
   devenait alors plus grande qu'un billet de 500 euros, ce qui est le
   contraire de ce que les vignettes servent a montrer.
   D'ou un rapport fixe, le meme que celui du dessin (100 x 56), et
   `contain` : la photo se range DANS la case sans etre deformee. */
.cz-vig { display: block; width: 100%; aspect-ratio: 100 / 56;
  height: auto; }
/* Et la meme echelle que le dessin de la meme coupure : sans cela, huit
   photos de pieces et sept billets dessines ne seraient pas a la meme
   echelle sur le meme ecran. `--cz-t` est pose par coupures.js. */
.cz-photo { border-radius: 4px; object-fit: contain;
  transform: scale(var(--cz-t, 1)); }
/* La frontière billets / pièces : on vide les billets d'abord, et l'œil
   doit savoir où il en est sans relire les montants. */
.cz-ligne.cz-coupe { margin-top: 6px;
  border-top: 1px dashed var(--card-border); padding-top: 7px; }
.cz-qte { width: 100%; min-height: 44px; text-align: center;
  font-size: 1.05rem; font-family: inherit; background: var(--panel);
  color: var(--white); border: 1px solid var(--card-border);
  border-radius: 8px; }
.cz-qte:focus { outline: 2px solid var(--blue-txt); outline-offset: -1px;
  background: var(--panel-dark); }
.cz-faux { background: rgba(239, 68, 68, .14); }
.cz-faux .cz-qte { border-color: var(--red); }

.cz-outils { display: flex; gap: 8px; margin: 14px 0 0; flex-wrap: wrap; }
.cz-outils .btn { min-height: 42px; }

/* ── Les trois sommes, et l'assistant ────────────────────────────────
   Elles sont EN HAUT et en grand : c'est le geste courant. Les quinze
   quantites attendent sous une touche, pour qui compte le tiroir devant
   l'ecran. L'ancien ecran faisait l'inverse, et obligeait a saisir quinze
   cases pour obtenir un total qu'on avait deja sur un papier.
   A trois cases, elles tiennent en ligne sur un telephone tenu droit ;
   en dessous de 380 px elles s'empilent plutot que de se serrer. */
.cz-sommes { display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin: 2px 0 8px; }
/* Une seule case : elle prend toute la largeur. La classe vient du script
   plutot que d'un `:has()` -- l'ecran tourne sur les telephones des
   employes, et on ne sait pas lesquels. */
.cz-sommes-une { grid-template-columns: 1fr; }
.cz-somme { display: block; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-dim); }
.cz-somme[hidden] { display: none; }
.cz-s-lbl { display: block; font-weight: 700; }
.cz-somme .cz-champ-l { margin-top: 4px; }
.cz-somme .cz-champ-l i { right: 9px; font-size: 0.95rem; }
.cz-somme input { width: 100%; min-height: 54px; padding: 0 26px 0 10px;
  font: inherit; font-size: 1.25rem; font-weight: 700; text-align: right;
  background: var(--panel); color: var(--white);
  border: 1px solid var(--card-border); border-radius: 10px; }
.cz-somme input:focus { outline: 2px solid var(--blue-txt);
  outline-offset: -1px; }
/* Une case que l'assistant remplit ne se tape pas : elle le MONTRE, au
   lieu d'avaler une frappe en silence. */
.cz-somme input.cz-suit { background: var(--panel-dark);
  color: var(--blue-txt); border-style: dashed; }

.cz-assist-b { display: flex; flex-direction: column; align-items: center;
  gap: 1px; width: 100%; min-height: 46px; margin: 4px 0 0; padding: 6px;
  font: inherit; font-size: 0.92rem; font-weight: 700;
  background: var(--panel-dark); color: var(--text);
  border: 1px dashed var(--card-border); border-radius: 10px;
  cursor: pointer; line-height: 1.2; }
.cz-assist-b:active { background: var(--panel); }
.cz-assist-b small { font-size: 0.74rem; font-weight: 400;
  color: var(--blue-txt); }
.cz-assist-on { border-style: solid; border-color: var(--blue-txt); }

/* Les trois cases tiennent en ligne sur un telephone courant (375 px) :
   « 1766,20 » y entre, et l'assistant reste visible sous elles au lieu
   d'etre pousse hors de l'ecran par trois rangees. On ne les empile que
   sur les ecrans vraiment etroits, ou le montant se serrerait. */
@media (max-width: 339px) {
  .cz-sommes { grid-template-columns: 1fr; }
}
.cz-note { display: block; margin-top: 14px; font-size: 0.82rem;
  color: var(--text-dim); }
.cz-note textarea { width: 100%; margin-top: 5px; padding: 8px;
  font-family: inherit; font-size: 0.95rem; background: var(--panel);
  color: var(--white); border: 1px solid var(--card-border);
  border-radius: 8px; resize: vertical; }

/* ── L'argent qui entre ou qui sort ──────────────────────────────────
   Un retrait n'est pas un comptage : son bouton vit au-dessus du choix du
   moment, pas dans les outils de la grille. Il reste discret -- c'est un
   geste rare -- mais il porte son compteur du jour, parce qu'un retrait
   saisi deux fois ne se voit sinon qu'au tableau du gerant. */
.cz-mouv-b { display: flex; align-items: center; justify-content: center;
  gap: 10px; width: 100%; min-height: 44px; margin: 10px 0 0;
  padding: 0 12px; font: inherit; font-size: 0.9rem; font-weight: 600;
  background: var(--panel-dark); color: var(--text);
  border: 1px dashed var(--card-border); border-radius: 10px;
  cursor: pointer; }
.cz-mouv-b:active { background: var(--panel); }
.cz-mouv-b small { font-size: 0.76rem; font-weight: 400;
  color: var(--blue-txt); }

/* Les deux sens sont un CHOIX, pas une case a cocher : ils se prennent
   du pouce, et celui qui est pris se voit de loin. Le retrait est orange
   et l'entree verte -- la couleur dit le sens avant le mot. */
.cz-sens { display: flex; gap: 10px; margin: 0 0 16px; }
.cz-sens-b { flex: 1; display: flex; flex-direction: column; gap: 2px;
  min-height: 62px; padding: 8px; font: inherit; font-weight: 700;
  background: var(--panel-dark); color: var(--text);
  border: 2px solid var(--card-border); border-radius: 12px;
  cursor: pointer; line-height: 1.2; }
.cz-sens-b small { font-size: 0.7rem; font-weight: 400;
  color: var(--text-dim); }
.cz-sens-on { color: var(--white); }
.cz-sens-retrait { background: #3A2A1E; border-color: var(--orange); }
.cz-sens-entree { background: #16331F; border-color: var(--green); }
.cz-sens-on small { color: var(--text); }

/* Le temps qu'il fait : quatre cibles larges, tapees avec le pouce
   sur une tablette posee pres de la friteuse. Le texte reste en
   --text sur --panel-dark ; aucune information ne tient dans une
   teinte seule -- le bouton choisi porte AUSSI une coche et une
   bordure epaisse. */
.cz-meteo { margin: 0 0 14px; }
.cz-meteo-t { margin: 0 0 6px; font-size: 0.82rem;
  color: var(--text-dim); }
.cz-meteo-b { display: flex; gap: 8px; }
.cz-meteo-c { flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px; position: relative;
  min-height: 64px; padding: 8px 4px; font: inherit;
  background: var(--panel-dark); color: var(--text);
  border: 2px solid var(--card-border); border-radius: 12px;
  cursor: pointer; line-height: 1.2; }
.cz-meteo-c b { font-size: 1.3rem; font-weight: 400; }
.cz-meteo-c span { font-size: 0.72rem; }
.cz-meteo-on { background: var(--panel); color: var(--white);
  border-color: var(--orange); border-width: 3px;
  font-weight: 700; }
.cz-meteo-on::after { content: '✓'; position: absolute;
  top: 2px; right: 5px; font-size: 0.8rem; }

/* Le bandeau du temps, sous la courbe du CA. Les cases se partagent la
   zone tracee a parts egales, exactement comme les points de l'axe. */
.evo-meteo { display: flex; margin: 2px 0 10px; }
.evo-m-case { flex: 1 1 0; min-width: 0; text-align: center;
  position: relative; font-size: 0.95rem; line-height: 1.35;
  cursor: default; }
.evo-m-case i { position: absolute; top: -2px; right: 50%;
  margin-right: -14px; font-style: normal; font-size: 0.7rem;
  color: var(--text-dim); }
/* Pas de reponse : la case reste VIDE. Un tiret discret dit qu'on ne
   sait pas -- un vide total se lirait comme un oubli d'affichage. */
.evo-m-vide::before { content: '·'; color: var(--text-dim); }

/* Les enveloppes : ce qui est deja encode, puis UNE case libre.
   Le total courant est en retrait de ton, pas en couleur vive : il
   accompagne la lecture, il ne la commande pas. */
.env-liste { margin: 0 0 12px; }
.env-vide { margin: 0 0 4px; font-style: italic; }
.env-tab { width: 100%; border-collapse: collapse;
  font-size: 0.86rem; }
.env-tab th { padding: 3px 6px; text-align: left; font-weight: 600;
  font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-dim);
  border-bottom: 1px solid var(--card-border); }
.env-tab td { padding: 5px 6px;
  border-bottom: 1px solid var(--card-border); }
.env-tab .n { text-align: right; }
.env-cumul { color: var(--text-dim); }
.env-x { min-width: 26px; padding: 1px 6px; font: inherit;
  line-height: 1.2; background: transparent; color: var(--text-dim);
  border: 1px solid var(--card-border); border-radius: 6px;
  cursor: pointer; }
.env-x:hover { color: var(--white); border-color: var(--orange); }

/* La case libre : une date, un montant, un bouton. Toujours la, et
   toujours vide -- c'est ce qui permet d'encoder une seance de plus
   sans rien effacer. */
.env-ajout { display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin: 0 0 10px; }
.env-ajout-l { display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-dim); }
.env-date { min-height: 38px; padding: 0 8px; font: inherit;
  background: var(--panel); color: var(--white);
  border: 1px solid var(--card-border); border-radius: 8px; }

.cz-champ { display: block; margin: 0 0 14px; font-size: 0.82rem;
  color: var(--text-dim); }
.cz-champ b { color: var(--orange); font-weight: 700; }
.cz-champ-l { position: relative; display: block; margin-top: 5px; }
.cz-champ-l i { position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); font-style: normal; font-size: 1.1rem;
  color: var(--text-dim); pointer-events: none; }
.cz-champ input { width: 100%; min-height: 52px; padding: 0 34px 0 12px;
  font: inherit; font-size: 1.35rem; font-weight: 700;
  background: var(--panel); color: var(--white);
  border: 1px solid var(--card-border); border-radius: 10px; }
.cz-champ textarea { width: 100%; margin-top: 5px; padding: 8px;
  font-family: inherit; font-size: 0.95rem; background: var(--panel);
  color: var(--white); border: 1px solid var(--card-border);
  border-radius: 8px; resize: vertical; }
.cz-champ input:focus, .cz-champ textarea:focus {
  outline: 2px solid var(--blue-txt); outline-offset: -1px; }

/* Le message flottant est cale au-dessus du pied du comptage (92 px).
   Sur cet ecran-ci le pied est cache : laisse si haut, le message
   couvrait la premiere ligne de la liste -- c'est-a-dire le retrait
   qu'on vient d'enregistrer, celui qu'on veut justement relire. */
#cz_v_mouv:not([hidden]) ~ .cz-msg { bottom: 16px; }

/* Ce qui a deja bouge aujourd'hui. Le motif se lit en entier : c'est la
   piece justificative, et une piece tronquee ne justifie rien. */
.cz-mouv-liste { margin-top: 18px; }
.cz-mouv-t { font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-dim); margin: 0 0 6px; }
.cz-mouv-l { display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px; margin-bottom: 6px; border-radius: 8px;
  background: var(--panel-dark); border-left: 4px solid var(--card-border); }
.cz-mouv-retrait { border-left-color: var(--orange); }
.cz-mouv-entree { border-left-color: var(--green); }
.cz-mouv-l b { font-size: 1rem; color: var(--white); }
.cz-mouv-l span { font-size: 0.88rem; color: var(--text);
  overflow-wrap: anywhere; }
.cz-mouv-l i { font-style: normal; font-size: 0.74rem;
  color: var(--text-dim); }

/* ── Le pied : le total qu'on envoie, et le bouton qui l'envoie ──────── */
.cz-pied { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--panel-dark); border-top: 1px solid var(--card-border);
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; }
.cz-totaux { flex: 1; display: flex; flex-direction: column; gap: 1px;
  min-width: 0; }
.cz-t-gros { font-size: 1.35rem; font-weight: 700; color: var(--white);
  line-height: 1.1; }
.cz-t-lbl { font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-dim); }
.cz-t-det { font-size: 0.78rem; color: var(--text); }
.cz-t-faux { font-size: 0.78rem; color: var(--red); font-weight: 600; }
.cz-valider { min-height: 56px; min-width: 132px; padding: 0 16px;
  font-size: 1rem; font-weight: 700; background: var(--green);
  color: #06260F; border: none; border-radius: 12px; cursor: pointer;
  font-family: inherit; }
.cz-valider:disabled, .cz-valider.cz-off { background: var(--panel);
  color: var(--text-dim); cursor: not-allowed; }

/* ── L'écran de fin ──────────────────────────────────────────────────── */
.cz-fini-ok { width: 64px; height: 64px; margin: 20px auto 4px;
  border-radius: 50%; background: var(--green); color: #06260F;
  font-size: 2.1rem; display: flex; align-items: center;
  justify-content: center; }
.cz-fini-det { max-width: 340px; margin: 0 auto 18px; }
.cz-fini-det div { display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 2px; border-bottom: 1px solid var(--card-border);
  font-size: 0.92rem; }
.cz-fini-det span { color: var(--text-dim); }
.cz-fini-det b { color: var(--white); }
.cz-fini-det .cz-hors b { color: var(--orange); }

.cz-msg { position: fixed; left: 12px; right: 12px; bottom: 92px; z-index: 9;
  padding: 10px 12px; border-radius: 10px; font-size: 0.88rem;
  line-height: 1.45; background: var(--panel-dark);
  border-left: 4px solid var(--blue); color: var(--text);
  box-shadow: 0 6px 20px rgba(0,0,0,.45); }
.cz-msg-err { background: #3A1E1E; border-left-color: var(--red);
  color: #F5D6D6; }
.cz-msg-info { background: #1F3A4E; border-left-color: var(--blue-txt); }

@media (min-width: 480px) {
  .cz-entete, .cz-ligne { grid-template-columns: 98px repeat(3, 1fr);
    gap: 8px; }
  .cz-entete span { font-size: 0.75rem; }
}

/* ── Déclaration de caisse, côté gérant (page City-Frite) ───────────── */
.cz-sous { font-size: 0.95rem; color: var(--white); margin: 16px 0 8px;
  font-weight: 700; }
.cz-lien { font-family: 'Sono', monospace; font-size: 0.84rem;
  color: var(--blue-txt); background: var(--panel-dark); padding: 4px 8px;
  border-radius: 5px; word-break: break-all; }
.cz-form { background: var(--panel-dark); border-radius: 8px;
  padding: 10px 12px 4px; margin: 8px 0; }
.cz-dort td { opacity: .55; }
/* Les quatre moments : une GRILLE, pas quatre lignes qui s'alignent par
   hasard. Les colonnes « de » et « a » doivent tomber au meme endroit sur
   les quatre, sinon l'oeil ne les compare plus -- et c'est pour les
   comparer qu'on les met l'une sous l'autre.
   Une ligne eteinte reste lisible mais s'efface : il faut voir d'un coup
   d'oeil lesquels des quatre servent. */
.cz-moment { display: grid; align-items: center; gap: 10px;
  grid-template-columns: minmax(230px, 310px) auto auto 1fr;
  padding: 4px 0; }
.cz-moment.cz-dort { opacity: .5; }
.cz-m-tete { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cz-m-tete .cf-lbl { white-space: nowrap; }
.cz-m-tete input { flex: 1; min-width: 0; }
.cz-moment select { min-height: 30px; max-width: 100%; }
.cz-moment .cz-note-l { font-size: 0.82rem; color: var(--text-dim); }
@media (max-width: 820px) {
  /* Sur un ecran etroit, la tete prend toute la largeur et les deux heures
     restent COTE A COTE : « de 06:00 » puis « a 12:00 » l'un sous l'autre
     se lisent comme deux reglages sans rapport. */
  .cz-moment { grid-template-columns: auto auto; justify-content: start;
    gap: 6px 12px; padding: 10px 0;
    border-bottom: 1px solid var(--card-border); }
  .cz-m-tete, .cz-m-col { grid-column: 1 / -1; }
  .cz-m-tete { flex-wrap: wrap; }
  .cz-m-tete input { flex: 1 1 180px; }
}
.cz-flag { font-size: 0.74rem; color: var(--orange); white-space: nowrap; }
.cz-ko { color: var(--red); }
.cz-ok { color: var(--green-txt, #4ADE80); }
/* Une recette n'est pas une alerte : elle se lit, elle ne saute pas aux
   yeux. Le rouge est reserve a ce qui n'aurait pas du bouger. */
.cz-recette { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cz-plus { color: var(--green-txt, #4ADE80); }
/* Le calcul pose au detail : on doit pouvoir le refaire a la main. */
.cz-calcul { display: inline-block; line-height: 1.7;
  font-variant-numeric: tabular-nums; }
/* Au detail d'un comptage, la vignette remplace le libelle : plus
   petite qu'a l'ecran de saisie, l'oeil y suit une colonne de chiffres. */
.cz-td-vig { width: 62px; padding: 2px 6px 2px 2px; }
/* La hauteur suit le rapport fixe : 54 x 0,56 = 30 px, photo comme dessin. */
.cz-td-vig .cz-vig { width: 54px; }

/* ── Analyses : la feuille de gestion de l'argent ──────────────
   Ce tableau est la seule FEUILLE de l'application : fond blanc,
   quadrillage complet, titres de colonnes sur fond gris, colonne de
   gauche figée. Le reste de l'écran reste sombre, et c'est voulu : on
   vient ici relire ce qu'on tenait dans un classeur, et un classeur a
   un fond blanc. Ce n'est que de la peinture — aucune colonne, aucune
   ligne, aucun chiffre ne change de place ni de calcul.
   Les couleurs du thème sombre ne tiennent pas sur du blanc : le rouge
   #EF4444 n'y a que 3,3:1, et le vert clair des écarts positifs moins
   encore. La feuille porte donc ses propres couleurs, déclarées ici et
   valables nulle part ailleurs. */
.ar-large, .ar-tab {
  --fe-fond:   #FFFFFF;  /* la feuille */
  --fe-quad:   #C6CFD8;  /* le quadrillage, celui qui marque les colonnes */
  --fe-cadre:  #8A96A3;  /* le bord, et les traits qui séparent vraiment */
  --fe-tete:   #E8EEF5;  /* titres de colonnes, colonne de gauche, total */
  --fe-appui:  #D7E6F8;  /* les deux lignes qu'on lit en premier */
  --fe-note:   #F5F7FA;  /* le commentaire posé sous un jour */
  --fe-bande:  #CBD7E4;  /* le bandeau qui annonce une friterie */
  --fe-ambre:  #FDF1D0;  /* un jour vendu mais jamais compté */
  --fe-txt:    #15202B;  /* les chiffres */
  --fe-pale:   #5A6775;  /* ce qui explique, pas ce qui compte */
  --fe-rouge:  #B3261E;  /* 6,4:1 sur blanc */
  --fe-vert:   #14672E;  /* 6,0:1 sur blanc */
  --fe-orange: #8C4B08;  /* 5,8:1 sur blanc */
}
/* Un tableau d'argent sans unite ne se lit pas, et les montants n'ont
   plus de symbole : dix colonnes de « € » poussaient l'ecart hors de
   l'ecran. L'unite est donc dite UNE FOIS, au-dessus de la feuille,
   pour toutes les friteries a la fois. */
.ar-unite { display: block; font-size: 0.78rem; font-weight: 400;
  color: var(--text-dim); margin: 14px 0 0; }
/* Un tiret n'est pas un zero : il se lit « on ne sait pas », et il doit
   donc etre PLUS pale que les chiffres, pas aussi noir qu'eux. */
.cz-rien { color: var(--text-dim); opacity: .65; }
/* Des colonnes de montants se comparent a la verticale : sans chiffres
   de meme largeur, l'oeil ne voit pas qu'un centime manque. */
.ar-tab td.n, .ar-tab th.n { font-variant-numeric: tabular-nums; }
/* La feuille : un cadre, un fond blanc, et le défilement horizontal du
   TABLEAU — pas celui de la page. */
.ar-large { overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--fe-fond); border: 1px solid var(--fe-cadre);
  border-radius: 4px; margin: 4px 0 10px; }
.ar-large .ar-tab { min-width: 100%; width: auto; margin: 0;
  background: var(--fe-fond); }
/* LE QUADRILLAGE. C'est lui qui marque les colonnes. Un simple trait
   sous chaque ligne laissait dix colonnes de montants flotter côte à
   côte, et l'œil devait deviner où l'une finissait et où la suivante
   commençait. Chaque cellule porte donc son trait à droite et en bas ;
   le dernier d'une rangée est retiré, sinon il doublerait le cadre. */
.ar-tab th, .ar-tab td { border: 0;
  border-right: 1px solid var(--fe-quad);
  border-bottom: 1px solid var(--fe-quad);
  background: var(--fe-fond); color: var(--fe-txt); padding: 5px 9px; }
.ar-tab th:last-child, .ar-tab td:last-child { border-right: 0;
  border-left: 2px solid var(--fe-cadre); }
.ar-tab .ar-note td { border-left: 0; }
.ar-tab tbody tr:last-child td { border-bottom: 0; }
/* Les titres de colonnes : fond gris, texte noir et gras, comme la
   première ligne d'un classeur. Les petites majuscules du reste de
   l'application font un libellé ; ici, il faut un en-tête. */
.ar-tab thead th { background: var(--fe-tete); color: var(--fe-txt);
  font-size: .79rem; font-weight: 700; text-transform: none;
  letter-spacing: 0; border-bottom: 2px solid var(--fe-cadre); }
/* La colonne de gauche est l'en-tête des LIGNES : même gris que celui
   d'en haut, et un trait fort qui la détache des chiffres. Le coin en
   haut à gauche et la case « Total » en font partie. */
.ar-tab .ar-nom, .ar-tab .ar-j, .ar-tab thead th:first-child {
  background: var(--fe-tete); color: var(--fe-txt); font-weight: 600;
  white-space: nowrap; border-right: 2px solid var(--fe-cadre); }
.ar-tab .ar-nom { font-size: .82rem; }
/* Quand la période est courte, il reste de la largeur à distribuer. Elle
   doit aller aux colonnes de MONTANTS, celles qu'on compare : une colonne
   « Total » large de deux cents pixels pour y poser « 350,00 » donne à
   croire qu'il y manque quelque chose. La colonne de gauche et celle du
   résultat se serrent donc sur leur contenu. */
.ar-tab thead th:first-child, .ar-tab thead th:last-child { width: 1%; }
/* Et elle est FIGÉE. À dix colonnes on fait défiler pour atteindre
   l'écart, et sans elle on ne sait plus de quel jour on lit le chiffre :
   c'est le volet figé du classeur. L'en-tête passe DEVANT la colonne,
   sinon les deux se chevauchent au coin. */
.ar-large .ar-tab .ar-nom, .ar-large .ar-tab .ar-j {
  position: sticky; left: 0; z-index: 1; }
.ar-large .ar-tab thead th:first-child {
  position: sticky; left: 0; z-index: 2; }
/* Les TITRES, eux, ont le droit de passer a la ligne : « Cash compté »
   sur une seule ligne imposait a lui seul 105 px, et poussait l'ecart --
   la colonne pour laquelle on ouvre ce tableau -- hors de l'ecran. */
.ar-tab th.n { white-space: normal; }
/* LES QUATRE GROUPES DE LA CHAINE. Une couleur par question posee :
   ce qui a ete vendu, comment cela a ete paye, ce que le tiroir devait
   contenir, ce qu'on y a trouve. Les teintes sont PALES -- ce sont des
   chiffres qu'on vient lire, pas une infographie -- et toutes portent
   le meme texte #15202B, qui garde plus de 12:1 sur chacune.
   Elles sont declarees AVANT le total et la rangee ambre : a
   specificite egale, c'est l'ordre qui tranche, et ces deux-la doivent
   gagner. Un total reste gris, une journee vendue sans comptage reste
   ambre -- sinon la couleur du groupe effacerait l'alerte. */
.ar-large, .ar-tab {
  --fe-g1: #E7F0FB;   /* la recette */
  --fe-g2: #F0ECFA;   /* les reglements */
  --fe-g3: #E4F1F1;   /* le tiroir attendu */
  --fe-g4: #E9F3E9;   /* le tiroir trouve */
}
/* Disposition 1 : les postes sont des colonnes. */
.ar-tab th.ar-g1, .ar-tab td.ar-g1 { background: var(--fe-g1); }
.ar-tab th.ar-g2, .ar-tab td.ar-g2 { background: var(--fe-g2); }
.ar-tab th.ar-g3, .ar-tab td.ar-g3 { background: var(--fe-g3); }
.ar-tab th.ar-g4, .ar-tab td.ar-g4 { background: var(--fe-g4); }
/* Disposition 2 : ce sont des lignes. Seules les cases de MONTANT se
   colorent : la colonne de gauche est l'en-tete des lignes, elle garde
   son gris et reste lisible quand la feuille defile sous elle. */
.ar-tab tr.ar-g1 td.n { background: var(--fe-g1); }
.ar-tab tr.ar-g2 td.n { background: var(--fe-g2); }
.ar-tab tr.ar-g3 td.n { background: var(--fe-g3); }
.ar-tab tr.ar-g4 td.n { background: var(--fe-g4); }

/* UNE TEINTE PAR FRITERIE dans les comptages recus. Les comptages
   arrivent groupes par friterie : deux teintes en alternance suffisent
   a separer deux blocs, et elles se distinguent mieux que sept.
   Declarees AVANT la rangee ambre, pour la meme raison que les groupes :
   a specificite egale c'est l'ordre qui tranche, et « hors heures »
   doit gagner. */
.ar-tab td.cz-sa { background: var(--fe-fond); }
.ar-tab td.cz-sb { background: #F2F6FA; }

/* Le total d'une friterie se lit comme dans un classeur : trait fort
   au-dessus, fond gris, chiffres en gras. */
.ar-tab .ar-tot td { border-top: 2px solid var(--fe-cadre);
  background: var(--fe-tete); font-weight: 700; }
/* Les deux lignes qu'on vient lire en premier : le cash attendu et le
   cash trouve. Leur fond n'est plus distinct -- c'est le GROUPE qui
   colore, et une cinquieme teinte aurait brouille les quatre autres --
   mais leur nom reste en gras, et leur montant avec. */
.ar-tab .ar-fort .ar-nom { color: var(--fe-txt); font-weight: 700; }
/* Un jour vendu mais jamais compté : la rangée entière s'éclaire, jour
   compris — c'est la rangée qui pose question, pas une de ses cases. */
.ar-tab .cf-partiel td { background: var(--fe-ambre); }
/* La note vit SOUS sa ligne, pas dans une onzieme colonne : elle a de la
   place pour une phrase, et le tableau ne s'elargit pas pour elle. Son
   fond la donne pour ce qu'elle est : un commentaire, pas un chiffre. */
.ar-tab .ar-note td { padding-top: 3px; padding-bottom: 3px;
  font-size: .8rem; font-style: italic; background: var(--fe-note);
  color: var(--fe-pale); }
/* LE BANDEAU D'UNE FRITERIE. C'est lui qui separe deux magasins dans une
   feuille qui n'en fait qu'une, et il doit se voir de loin : apres trente
   lignes de chiffres, c'est lui qui dit qu'on a changé de magasin.
   Son nom reste collé à gauche quand la feuille défile — à trente
   colonnes, un bandeau parti hors de l'écran ne nomme plus rien.
   Ni lui ni la ligne de commentaire ne traversent une colonne : le trait
   fort de la colonne de résultat ne les concerne donc pas. */
.ar-tab .ar-site td { background: var(--fe-bande); border-left: 0;
  border-top: 3px solid var(--fe-cadre); padding: 7px 9px; }
.ar-tab tbody tr:first-child.ar-site td { border-top: 0; }
/* Colle a gauche : le NOM seul, pas le nom plus son decompte. Un
   element colle est bride par sa cellule -- il ne se deplace pas de plus
   que la place qu'il y laisse libre. A deux cents pixels de texte, le
   bandeau decrochait a mi-defilement. */
.ar-tab .ar-site-nom, .ar-tab .ar-colle { position: sticky; left: 0;
  display: inline-block; }
.ar-tab .ar-site-nom { font-weight: 700; font-size: .9rem;
  color: var(--fe-txt); }
.ar-tab .ar-site-q { font-style: normal; font-weight: 400;
  font-size: .78rem; color: var(--fe-pale); margin-left: 9px; }
/* Une friterie sans rien garde sa place dans la feuille : la voir vide
   est une information, la faire disparaître n'en est pas une. */
.ar-tab .ar-vide td { border-left: 0; font-style: italic;
  color: var(--fe-pale); }
/* Les couleurs du thème sombre, retaillées pour le blanc. L'ordre
   compte : « vendu, pas compté » porte à la fois cz-flag et cz-ko, et
   c'est le rouge qui doit gagner. */
.ar-tab .cz-rien { color: var(--fe-pale); opacity: 1; }
.ar-tab .cz-recette { color: var(--fe-pale); }
.ar-tab .cz-ok, .ar-tab .cz-plus { color: var(--fe-vert); }
.ar-tab .cz-flag { color: var(--fe-orange); }
.ar-tab .cz-ko { color: var(--fe-rouge); }
/* LA REMARQUE SOUS SA VALEUR. « hors heures », « corrige 2x », « total
   incoherent » etaient poses A COTE du chiffre : une seule ligne portant
   une mention elargissait la colonne pour elle, et les montants des
   autres lignes ne tombaient plus les uns sous les autres. En bloc sous
   la valeur, la remarque ne pousse rien -- et elle se lit mieux, parce
   qu'elle commente le chiffre juste au-dessus d'elle. */
.ar-tab .ar-sous { display: block; font-size: .76rem; font-weight: 400;
  font-style: normal; line-height: 1.35; margin-top: 1px;
  color: var(--fe-pale); }
.ar-tab td.n .ar-sous { white-space: nowrap; }

/* Le justificatif, sous sa journee. Il n'a pas de colonne a lui : une
   phrase dans une colonne elargit le tableau pour une seule ligne, et
   les montants des autres ne tombent plus les uns sous les autres. Sa
   couleur dit le SENS -- orange ce qui sort, vert ce qui entre -- parce
   que c'est la premiere chose qu'on cherche en lisant un ecart. */
.ar-tab .ar-mouv { display: inline-block; font-style: normal;
  padding: 0 7px; margin-right: 6px; border-radius: 3px;
  border-left: 3px solid var(--fe-cadre); background: #FFFFFF; }
.ar-tab .ar-mouv-r { border-left-color: var(--fe-orange);
  color: var(--fe-orange); }
.ar-tab .ar-mouv-e { border-left-color: var(--fe-vert);
  color: var(--fe-vert); }
.ar-tab .ar-mouv i { font-style: normal; color: var(--fe-pale); }

/* L'ordre des friteries : un rang, un nom, deux fleches. Les fleches
   sont larges -- on les vise au doigt -- et celle qui ne mene nulle
   part est eteinte plutot que cachee, pour que la ligne garde sa
   forme. */
.cf-ordre { display: flex; flex-direction: column; gap: 6px;
  margin: 0 0 14px; max-width: 420px; }
.cf-ord { display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; background: var(--panel-dark);
  border: 1px solid var(--card-border); border-radius: 8px; }
.cf-ord-n { min-width: 22px; font-size: .78rem; color: var(--text-dim);
  font-variant-numeric: tabular-nums; }
.cf-ord-nom { flex: 1; font-weight: 600; color: var(--white);
  overflow-wrap: anywhere; }
.cf-ord-b { min-width: 38px; min-height: 34px; padding: 0; }
.cf-ord-b[disabled] { opacity: .3; cursor: not-allowed; }

/* ── Les deux onglets de la page City-Frite ─────────────────────────
   Ce qu'on consulte d'un cote, ce qu'on regle de l'autre. Un trait sous
   l'onglet courant, et rien d'autre : ce sont deux portes, pas deux
   boutons d'action. */
.cf-onglets { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px;
  border-bottom: 1px solid var(--card-border); }
.cf-onglet { font: inherit; font-size: .95rem; font-weight: 600;
  color: var(--text-dim); background: none; border: 0;
  border-bottom: 3px solid transparent; padding: 10px 16px;
  margin-bottom: -1px; cursor: pointer; border-radius: 6px 6px 0 0; }
.cf-onglet:hover { color: var(--white); background: var(--panel-dark); }
.cf-onglet-on { color: var(--white);
  border-bottom-color: var(--blue-txt); }
.cf-onglet:focus-visible { outline: 2px solid var(--blue-txt);
  outline-offset: -2px; }

/* LA BULLE. Une remarque posee sous son montant imposait sa largeur a
   toute la colonne : « dont 2 sans écart » est plus large que n'importe
   quel montant, et une seule ligne suffisait a pousser la colonne
   entiere. La remarque passe donc au survol, et le montant prend une
   couleur -- VERT quand elle confirme, ROUGE quand elle reserve.
   Le pointille sous le chiffre dit qu'il y a quelque chose a lire :
   sans lui, personne ne survolerait. */
.ar-tab .ar-bul { cursor: help; text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--fe-cadre);
  text-underline-offset: 3px; }
.ar-tab .ar-bul-ok { color: var(--fe-vert); font-weight: 700;
  text-decoration-color: var(--fe-vert); }
.ar-tab .ar-bul-ko { color: var(--fe-rouge); font-weight: 700;
  text-decoration-color: var(--fe-rouge); }
.ar-tab .ar-bul:focus-visible { outline: 2px solid #2563EB;
  outline-offset: 1px; }
.ar-tab .ar-j[data-bulle] { cursor: help; }

/* La boite vit dans le BODY, en position fixe : dans la feuille, le
   cadre qui defile horizontalement la rognerait. */
.ar-bulle-boite { position: fixed; z-index: 60; max-width: 280px;
  padding: 8px 10px; border-radius: 6px; background: #15202B;
  color: #FFFFFF; font-size: .8rem; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); pointer-events: none;
  /* Le calcul d'un cash theorique tient sur cinq lignes : en une seule,
     il ne se refait pas a la main. */
  white-space: pre-line; }
.ar-bulle-boite[hidden] { display: none; }
/* Le meme rouge dans une explication de la page, qui vit sur fond
   sombre : celui de la feuille y serait illisible. */
.cf-aide .cf-rouge { color: var(--red); }

/* Les commentaires d'une feuille : ranges, pas supprimes. La touche dit
   combien il y en a -- sinon, le jour ou il y a quelque chose a lire,
   personne ne le saurait. */
.ar-com { margin: 6px 0 14px; }
.ar-com-b { font-size: .82rem; }
.ar-com-corps { margin-top: 8px; }
.ar-com-corps .cf-aide:first-child { margin-top: 0; }

/* LES QUATRE FEUILLES ET LEURS TITRES. Le recapitulatif vit SOUS la
   feuille, et c'est une feuille aussi : memes colonnes, meme
   quadrillage, meme colonne de gauche figee. Seuls les TITRES
   appartiennent a l'application -- ils annoncent un bloc, pas une note.
   Et le titre est la TOUCHE qui replie son bloc : pas une petite fleche
   posee a cote, qu'un doigt manque sur une tablette. Il garde donc
   l'allure d'un titre, parce qu'il en est un.
   Il passe a la ligne : un titre suivi de sa periode ne tient pas sur
   la largeur d'un telephone, et une ligne qui depasse pousse la feuille
   hors de l'ecran. */
.ar-sec-h { margin: 16px 0 0; font-size: inherit; font-weight: 400; }
.ar-sec-t { display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 2px 8px; width: 100%; text-align: left; background: none;
  border: 0; padding: 2px 0; cursor: pointer; font: inherit;
  font-size: .92rem; font-weight: 700; color: var(--white); }
.ar-sec-t:hover { color: var(--blue-txt); }
.ar-sec-t:focus-visible { outline: 2px solid var(--blue);
  outline-offset: 3px; border-radius: 3px; }
.ar-sec-t i { font-style: normal; font-weight: 400; font-size: .78rem;
  color: var(--text-dim); }
/* La fleche DIT l'etat : ouverte elle pointe vers le bloc, fermee elle
   pointe vers le titre. Elle TOURNE, elle ne change pas de caractere --
   deux glyphes differents ne tiennent jamais la meme largeur, et le
   titre sauterait de deux pixels a chaque clic. Elle prend la couleur
   du TITRE et non celle d une note : c est elle qui dit qu on peut
   cliquer, et une marque pale de onze pixels ne se voit pas. */
.ar-sec-fl { font-size: .8rem; color: inherit;
  transition: transform .12s ease; }
.ar-sec-t[aria-expanded="false"] .ar-sec-fl {
  transform: rotate(-90deg); }
/* L'unite dit « euros » juste sous le titre : les 14 px qu'elle gardait
   quand elle ouvrait la feuille feraient un trou. */
.ar-sec-c > .ar-unite:first-child { margin-top: 2px; }

/* La feuille des reglements n'a pas de colonne de resultat : son trait
   fort de droite n'aurait rien a separer. */
.ar-tab.ar-plat th:last-child, .ar-tab.ar-plat td:last-child {
  border-left: 0; }
.ar-tab.ar-plat thead th:last-child { width: auto; }

/* Deux reglages vivent DANS la feuille : le nom qu'on donne au reglement
   et sa destination. Les champs du theme sombre y seraient noirs sur
   blanc ; ils prennent donc les couleurs de la feuille, et restent
   discrets tant qu'on ne les touche pas -- ce sont des cases de tableur,
   pas un formulaire. */
.ar-tab th.ar-c, .ar-tab td.ar-c { text-align: center; }
/* La case est le seul controle de sa colonne : on l'agrandit, parce
   qu'une case de 13 px se rate une fois sur trois et qu'une case ratee
   fait croire a un reglage enregistre. */
.ar-tab .ar-use { width: 17px; height: 17px; margin: 0; cursor: pointer;
  accent-color: #2563EB; }
.ar-tab .ar-ren { font: inherit; color: var(--fe-txt);
  background: var(--fe-fond); border: 1px solid var(--fe-quad);
  border-radius: 3px; padding: 2px 5px; width: 100%; min-width: 150px; }
.ar-tab .ar-ren::placeholder { color: var(--fe-pale); opacity: .8; }
.ar-tab .ar-ren:focus, .ar-tab .ar-use:focus { outline: 2px solid #2563EB;
  outline-offset: -1px; border-color: #2563EB; }

@media (max-width: 820px) {
  .ar-tab th, .ar-tab td { padding: 4px 6px; font-size: .8rem; }
}

/* ══ LES MAGASINS SANS CAISSE CSI — la saisie d'une journee ════════════
   Une ligne par taux, une par mode : des cases de MEME largeur, les
   libelles alignes a gauche, et le calcul deduit pose a droite. Ce qui
   se compare se compare a la verticale -- un gerant recopie son ticket
   Z ligne par ligne, et un libelle qui decale la case oblige a chercher
   ou taper. */
.mn-l { gap: 10px; align-items: center; margin: 4px 0; }
.mn-lab { gap: 8px; }
/* Le libelle du taux ou du mode : une largeur FIXE, pour que les cases
   tombent les unes sous les autres quel que soit le nom que le client a
   donne a son reglement. */
.mn-lab { min-width: 13rem; }
.mn-mnt { width: 8.5rem; text-align: right;
  font-variant-numeric: tabular-nums; }
/* Le HT et la TVA deduits, poses a cote de ce qu'on tape : le gerant
   verifie sur son ticket Z sans attendre d'avoir enregistre. */
.mn-ded { font-size: .8rem; color: var(--text-dim);
  font-variant-numeric: tabular-nums; }
.mn-total { margin-top: 10px; }
.mn-total .mn-mnt, .mn-total input { font-weight: 600; }
/* LE CONTROLE, EN DIRECT. Trois etats et trois couleurs : juste, un
   ecart qu'on accepte, et une erreur qui bloque. L'orange dit « c'est
   enregistrable mais regarde », le rouge « reprends un chiffre ». */
.mn-calc { font-size: .86rem; color: var(--text-dim);
  font-variant-numeric: tabular-nums; }
.mn-juste { color: var(--green-txt, #4ADE80); }
.mn-ecart { color: var(--orange); }
.mn-faux { color: var(--red); font-weight: 600; }
.mn-flag { font-size: .74rem; color: var(--orange); white-space: nowrap; }
/* Le journal d'une journee : il se lit quand on le cherche, il ne doit
   pas concurrencer les chiffres du tableau. */
.mn-jrn { display: block; font-size: .76rem; color: var(--text-dim);
  line-height: 1.5; }

@media (max-width: 620px) {
  /* Sur un telephone, la largeur fixe du libelle pousserait la case
     hors de l'ecran : la ligne passe alors en deux etages. */
  .mn-lab { min-width: 0; width: 100%; }
  .mn-mnt { width: 100%; }
}

/* ══ ECRAN EMPLOYE — la recette d'un magasin sans caisse CSI ═══════════
   Le meme vocabulaire que le comptage : une case par ligne, le libelle
   au-dessus, le symbole dans la case. L'employe tape sur un telephone,
   souvent d'une main : les cases font toute la largeur et gardent la
   hauteur confortable des autres champs de cet ecran. */
.cz-rec-lignes { display: flex; flex-direction: column; gap: 10px;
  margin: 12px 0; }
.cz-rec-l { margin: 0; }
/* Le HT et la TVA deduits, sous la case : l'employe les compare a son
   ticket Z sans attendre d'avoir enregistre. Pales, car ce ne sont pas
   eux qu'on tape. */
.cz-rec-ded { display: block; margin-top: 4px; font-size: .8rem;
  color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cz-rec-tot { margin-top: 16px; }
.cz-rec-tot input { font-weight: 700; }
.cz-rec-t2 { margin-top: 22px; }
/* La date sous le bouton du jour : « Hier » ne suffit pas a 2 h du
   matin, quand la journee d'exploitation n'est pas celle du calendrier. */
.cz-rec-j { display: block; font-size: .76rem; opacity: .85;
  font-weight: 400; margin-top: 2px; }
/* TROIS etats, trois couleurs. Le rouge arrete, l'orange previent, le
   vert confirme -- et rien ne clignote : un ecran qui s'agite pendant
   qu'on tape fait perdre la ligne ou l'on en etait. */
.cz-rec-faux { color: var(--red); font-weight: 600; }
.cz-rec-juste { color: var(--green-txt, #4ADE80); }
.cz-rec-ecart { color: var(--orange); }

/* ══ LA PORTE DU MAGASIN ═══════════════════════════════════════════════
   L'ecran de la tablette : deux champs, un bouton, et rien d'autre. On
   l'ouvre debout, souvent d'une main, parfois avec les doigts gras : les
   cibles sont larges et il n'y a rien a chercher. */
.cz-mag-ok { width: 100%; }
/* La case « afficher le mot de passe » : sans elle, un mot de passe mal
   tape sur une tablette ne se voit jamais, et on accuse le mot de passe. */
.cz-chk-l { display: flex; align-items: center; gap: .6rem;
  margin: .2rem 0 1rem; font-size: .92rem; cursor: pointer; }
.cz-chk-l input { width: 1.15rem; height: 1.15rem; margin: 0; }

/* ── Le tableau des portes, cote gerant ──────────────────────────────
   Une ligne par friterie : ce qu'on tape sur sa tablette, et si elle est
   prete. Le mot de passe est une case ORDINAIRE, pas un champ masque :
   il doit se relire pour etre recopie sur un appareil neuf. */
.cz-mags { width: 100%; margin: 8px 0 12px; }
.cz-mags td, .cz-mags th { padding: 6px 10px; }
.cz-mag-mail { font-family: Consolas, monospace; font-size: .86rem; }
.cz-mag-mdp { width: 100%; min-width: 7rem; font-family: Consolas, monospace;
  letter-spacing: .04em; }
/* LE COIN DE LA TABLETTE. Invisible, sans curseur et sans contour : il
   ne doit se voir ni a l'oeil ni au survol. Un appui long de deux
   secondes et demie y demande le code qui rend l'appareil.
    empeche le navigateur de prendre l'appui pour un
   debut de defilement et d'annuler le geste a mi-chemin. */
.cz-coin {
  position: fixed; top: 0; left: 0; width: 72px; height: 72px;
  z-index: 9500; background: transparent; touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cz-coin[hidden] { display: none; }

/* LA CASE QUI BLOQUE LES AUTRES. Une bordure, pas un fond : on doit
   continuer a lire ce qu'on a tape dedans pour le corriger. */
.cz-mag-faux { border: 2px solid var(--red); background: #FFF4F4; }
.cz-mags-err { color: var(--red); font-size: .86rem; font-weight: 600;
  margin: 6px 0 0; }
.cz-mag-ok, .cz-mags .cz-mag-ok { color: var(--green-txt, #4ADE80);
  font-weight: 600; }
/* « Incomplet » n'est pas une alerte : c'est une tache a faire. L'orange
   le dit sans crier, et le rouge reste pour ce qui est casse. */
.cz-mag-ko { color: var(--orange); font-size: .86rem; }

@media (max-width: 620px) {
  .cz-mags td, .cz-mags th { padding: 4px 6px; font-size: .82rem; }
}

/* ══ L'ENVELOPPE — la case du tableau, et sa fenetre ════════════
   La seule case du tableau de l'argent ou l'on ECRIT. Elle doit donc se
   voir comme telle au milieu de dix colonnes de lecture -- sinon on ne
   la cherche pas -- sans pour autant crier : une enveloppe pas encore
   ouverte n'est pas une alerte, c'est du travail. */
.env-case { cursor: pointer; border-bottom: 1px dashed var(--text-dim);
  text-decoration: none; color: inherit; }
.env-case:hover { background: rgba(255, 255, 255, .10); }
.env-case-vide { border-bottom-color: var(--orange); }
/* « a ouvrir » : l'ambre du travail a faire, et en petit -- le mot ne
   doit pas elargir une colonne de montants. */
.env-a-faire { color: var(--orange); font-size: .78rem;
  white-space: nowrap; }
/* Le compte de ce qui reste a verifier, COLLE au total. Entre
   parentheses et en petit : le total garde sa lecture, et le chiffre
   dit tout de suite que la somme est incomplete. */
/* La case ou l'on ecrit ne doit pas se couper en deux lignes : le
   chiffre et sa marque d'avertissement se lisent ensemble. */
.env-col { white-space: nowrap; }
.env-reste-n { color: var(--orange); font-size: .74rem;
  margin-left: 3px; font-weight: 400; }

/* LA FENETRE. Un fond sombre, parce qu'on vient d'un tableau sombre et
   qu'un panneau blanc au milieu eblouit. */
.env-pop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 9000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 16px;
}
.env-pop[hidden] { display: none; }
.env-pop-boite {
  background: var(--panel-dark, #454E5A); color: var(--text);
  border: 1px solid var(--card-border); border-radius: 6px;
  width: 100%; max-width: 560px; max-height: 86vh; overflow: auto;
  padding: 16px 18px; box-shadow: 0 12px 44px rgba(0, 0, 0, .5);
}
.env-pop-boite h3 {
  margin: 0 0 8px; font-size: 1.02rem; color: var(--white);
  border-bottom: 1px solid var(--card-border); padding-bottom: 7px;
}
/* LES DEUX CASES ET LEUR SOMME, SUR UNE SEULE LIGNE. Le « + » et le
   « = » sont la pour que le calcul se LISE : deux cases cote a cote sans
   signe entre elles ne disent pas qu'elles s'additionnent. */
.env-somme {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 12px 0 4px;
}
.env-op { font-size: 1.15rem; color: var(--text-dim); }
.env-mnt { width: 7.5rem; text-align: right; font-size: 1.05rem;
  padding: 6px 8px; font-variant-numeric: tabular-nums; }
.env-tot { font-size: 1.12rem; color: var(--white);
  font-variant-numeric: tabular-nums; }
/* L'ecart, A COTE du total et pas dessous : c'est la comparaison qu'on
   vient faire, et elle doit tomber dans le meme regard. */
.env-ec { font-size: .88rem; font-variant-numeric: tabular-nums; }
.env-err { color: var(--red); font-size: .86rem; font-weight: 600;
  margin: 10px 0 0; }
.env-pieds { display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 14px; flex-wrap: wrap; }
/* L'aide posee a cote d'un champ, et non sous le bloc : elle explique
   CE champ-la, et sous le bloc on ne saurait plus lequel. */
.cf-aide-l { font-size: .84rem; color: var(--text-dim); }

@media (max-width: 620px) {
  .env-pop { padding: 4vh 8px 8px; }
  .env-pop-boite { padding: 12px 13px; }
  .env-mnt { width: 6.2rem; }
}

/* ── LES SAISONS : l'editeur de decoupages ──────────────────────
   Une carte par decoupage. Elle porte son nom, la case qui la designe aux
   boutons de periode, la bande des douze mois, le verdict de couverture et
   le tableau de ses saisons. */
.sa-carte { background: rgba(0, 0, 0, .12); border: 1px solid var(--border);
  border-radius: 7px; padding: 12px 13px; margin: 0 0 14px; }
.sa-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px; }
.sa-titre { flex: 1 1 14rem; min-width: 10rem; font-weight: 600; }
.sa-actif { flex: 0 0 auto; margin: 0; }
.sa-tab { margin: 10px 0; }
.sa-tab td, .sa-tab th { padding: 4px 6px; }
.sa-bornes { white-space: nowrap; }
/* Deux listes cote a cote, jour puis mois : aucune frappe, donc aucune
   borne impossible a taper -- et « 31 avril » ne peut pas etre choisi. */
.sa-sel { padding: 3px 4px; font-size: .84rem; }

/* LA BANDE DES DOUZE MOIS. Une piste par saison, posee sur l'annee : les
   trous se voient comme des blancs, les chevauchements comme deux barres
   au meme endroit. Aucune regle ici, juste des positions -- la couverture,
   elle, est calculee par le serveur. */
.sa-bande { margin: 4px 0 8px; }
.sa-bande .sa-mois { display: flex; font-size: .64rem;
  color: var(--text-dim); margin-left: 7.5rem; }
.sa-bande .sa-mois i { font-style: normal; text-align: center;
  border-left: 1px solid var(--border); }
.sa-ligne { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.sa-ligne > span { flex: 0 0 7rem; width: 7rem; font-size: .78rem;
  color: var(--text); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
/* LA COULEUR TIENT DANS LA PASTILLE, pas dans le texte : sur ce fond,
   une teinte distinctive ne passe pas les 4,5:1 d'un petit texte. */
.sa-pastille { display: inline-block; width: 8px; height: 8px;
  border-radius: 2px; margin-right: 5px; vertical-align: baseline; }
.sa-piste { position: relative; flex: 1 1 auto; height: 13px;
  background: rgba(0, 0, 0, .25); border-radius: 3px; }
.sa-piste b { position: absolute; top: 0; bottom: 0; border-radius: 3px;
  opacity: .85; }

.sa-verdict { font-size: .8rem; margin: 6px 0 0; }
.sa-ok { color: var(--green); }
.sa-note { color: var(--orange); }
/* Le verdict vient du serveur : des qu'une borne change il ne vaut plus
   rien, et il doit le dire au lieu de rassurer. */
.sa-vieux { color: var(--text-dim); font-style: italic; }

@media (max-width: 620px) {
  .sa-bande .sa-mois { margin-left: 0; }
  .sa-ligne { flex-wrap: wrap; }
  .sa-ligne > span { flex: 1 1 100%; width: auto; }
}

/* ── COMPARER DEUX PERIODES (page Evolution) ──────────────────
   Le bloc vit AU-DESSUS des trois graphiques : c'est l'outil qu'on vient
   chercher, les courbes de la periode analysee sont le decor. */
.cmp-bloc { margin-bottom: 18px; }
.cmp-barre { display: flex; gap: 14px; flex-wrap: wrap;
  align-items: flex-end; margin: 10px 0 4px; }
.cmp-barre .form-group { margin: 0; }
.cmp-align { display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 0; }
.cmp-aide { font-size: 0.84rem; color: var(--text-dim); line-height: 1.5;
  margin: 8px 0 0; max-width: 95ch; }

.cmp-msg { margin: 12px 0 0; padding: 9px 11px; border-radius: 6px;
  background: rgba(0, 0, 0, .18); font-size: .88rem; color: var(--text); }
.cmp-err { color: var(--red); }

/* LES DEUX PERIODES, ECRITES EN CLAIR : un comparatif qui ne dit pas ce
   qu'il compare oblige a aller verifier ailleurs. */
.cmp-periodes { margin: 14px 0 10px; font-size: .9rem; color: var(--text);
  line-height: 1.6; }
.cmp-periodes i { color: var(--text-dim); font-size: .84rem; }

.cmp-tab { margin: 0 0 6px; }
.cmp-tab th.n, .cmp-tab td.n { text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.cmp-tab th { font-size: .78rem; }
.cmp-note { font-size: .78rem; color: var(--text-dim); margin: 0 0 14px; }
.cmp-sous { font-size: .9rem; font-weight: 700; color: var(--white);
  margin: 18px 0 6px; }

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

/* LES CONSTATS. Un ecart de chiffre ne dit rien tout seul : ces phrases
   disent LAQUELLE des deux causes -- clients ou panier -- l'emporte. */
.cmp-constats { margin-top: 14px; }
.cmp-constats p { font-size: .88rem; color: var(--text); line-height: 1.55;
  margin: 0 0 7px; padding-left: 14px; border-left: 3px solid var(--blue);
  max-width: 95ch; }

@media (max-width: 620px) {
  .cmp-barre { gap: 9px; }
  .cmp-barre .form-group { flex: 1 1 100%; }
}
