/* ── Stat-Manager Web — Dark Theme ──────────────────────────────────────── */
:root {
  --navy:       #0F3C59;
  --blue:       #2E75B6;
  --blue-dark:  #1F4E79;
  --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;
}

/* ── 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 ─────────────────────────────────────────────────────── */
.vg-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.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 ─────────────────────────────────────────────────── */
.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;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;        /* Firefox */
}
.settings-tabs::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.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);
  border-left: 4px solid 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;
  color: var(--blue);
  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;
}

/* ── 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-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);  }

/* 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; }
}

.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;
}

/* ── 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);
}

/* 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-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;
}
