/* =====================================================================
   CHARTE COLLECTIF CITOYEN — VIGILANCE ET CONTRÔLE DES PRIX
   Observatoire Citoyen du Pouvoir d'Achat
   ===================================================================== */

:root {
  --blue-france: #000091;
  --blue-france-dark: #000074;
  --blue-france-light: #f5f5fe;
  --blue-france-hover: #1212ff;

  --red-citoyen: #e1000f;
  --red-citoyen-dark: #c9191e;
  --red-citoyen-light: #ffe8e5;

  --green-success: #1b8a36;
  --green-light: #e3fde5;

  --amber-warning: #b35900;
  --amber-light: #fff2df;

  --grey-50: #f6f6f6;
  --grey-100: #eeeeee;
  --grey-200: #e5e5e5;
  --grey-300: #cecece;
  --grey-600: #666666;
  --grey-800: #3a3a3a;
  --grey-900: #161616;

  --border: #dddddd;
  --card-bg: #ffffff;
  --body-bg: #f5f5fe;

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: 64px;
  --nav-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  font-family: var(--font-stack);
  background-color: var(--body-bg);
  color: var(--grey-900);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================================
   EN-TÊTE COLLECTIF CITOYEN
   ===================================================================== */

.official-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #ffffff;
  border-bottom: 2px solid var(--blue-france);
  padding: max(0.45rem, var(--safe-top)) 1rem 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0, 0, 145, 0.08);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-badge-icon {
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-france-light);
  border: 1px solid rgba(0, 0, 145, 0.15);
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--blue-france);
  line-height: 1.15;
}

.brand-sub {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--grey-600);
  letter-spacing: 0.02em;
}

.header-citoyen-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.citoyen-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.badge-acronym {
  background: var(--blue-france);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.badge-full {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red-citoyen);
  text-transform: uppercase;
}

.service-name {
  font-size: 0.68rem;
  color: var(--grey-600);
  font-weight: 500;
  display: none;
}

@media (min-width: 640px) {
  .service-name {
    display: block;
  }
}

.header-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-header-icon {
  background: var(--blue-france-light);
  border: 1px solid var(--blue-france);
  color: var(--blue-france);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.btn-header-icon:hover {
  background: var(--blue-france);
  color: #ffffff;
}

.label-desktop {
  display: none;
}

@media (min-width: 768px) {
  .label-desktop {
    display: inline;
  }
}

/* =====================================================================
   BANDEAU DU DOSSIER ACTIF ET TOTAL
   ===================================================================== */

.dossier-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dossier-info {
  flex: 1;
  min-width: 220px;
}

.dossier-title-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-dossier {
  background: var(--blue-france);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag-dossier.archived {
  background: var(--grey-600);
}

.dossier-title-line h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--grey-900);
  line-height: 1.2;
}

.btn-icon-tiny {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem;
  border-radius: 3px;
}

.btn-icon-tiny:hover {
  background: var(--grey-100);
}

.dossier-meta {
  font-size: 0.78rem;
  color: var(--grey-600);
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dossier-total-box {
  text-align: right;
  background: var(--blue-france-light);
  border: 1px solid #ccd8ff;
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
}

.total-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--blue-france);
  letter-spacing: 0.05em;
}

.total-amount {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--blue-france);
  display: block;
  line-height: 1.1;
  font-family: var(--font-stack);
}

.total-anomalies {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--red-citoyen);
  display: block;
}

/* =====================================================================
   LAYOUT PRINCIPAL ET ONGLETS
   ===================================================================== */

.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 0.85rem calc(var(--nav-height) + var(--safe-bottom) + 1.2rem);
}

.tab-content {
  display: none;
}

.tab-content.active-tab {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.card-header,
.list-card-header,
.card-header-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-header h3,
.list-card-header h3,
.card-header-with-action h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--blue-france);
}

.subtitle-note {
  font-size: 0.8rem;
  color: var(--grey-600);
}

/* =====================================================================
   SECTION SCANNER (CAMÉRA & SAISIE)
   ===================================================================== */

.badge-mode {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--green-light);
  color: var(--green-success);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.scanner-camera-container {
  margin-bottom: 1rem;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 280px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background: #000000;
  border: 2px solid var(--blue-france);
}

#scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan-target-corners {
  position: absolute;
  top: 15%;
  bottom: 15%;
  left: 10%;
  right: 10%;
  border: 2px dashed rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.scan-laser {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--red-citoyen);
  box-shadow: 0 0 8px #ff2636, 0 0 14px #ff2636;
  animation: scanLaser 1.8s infinite ease-in-out;
}

@keyframes scanLaser {
  0% {
    top: 18%;
  }

  50% {
    top: 82%;
  }

  100% {
    top: 18%;
  }
}

.camera-floating-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 5;
}

.btn-floating {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(22, 22, 22, 0.75);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.btn-zoom-floating {
  width: auto;
  min-width: 46px;
  padding: 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 20px;
  background: rgba(0, 0, 145, 0.85);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Sélecteur d'objectif (Choix de la caméra anti-flou) */
.camera-lens-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.65rem auto;
  max-width: 520px;
  padding: 0.5rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.camera-lens-box .lens-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--grey-800);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.camera-lens-select {
  flex: 1;
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-france-dark);
  background: #ffffff;
  border: 1.5px solid var(--blue-france);
  border-radius: 6px;
  cursor: pointer;
}

/* Anneau de mise au point tactile (Touch-to-Focus) */
.focus-ring {
  position: absolute;
  width: 56px;
  height: 56px;
  border: 2px solid #38bdf8;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  animation: focusPulse 0.45s ease-out forwards;
}

@keyframes focusPulse {
  0% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.2;
  }
  60% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.85;
  }
}

.camera-placeholder {
  text-align: center;
  padding: 2.2rem 1rem;
  background: var(--blue-france-light);
  border: 2px dashed #b9caff;
  border-radius: 8px;
}

.placeholder-icon {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
}

.camera-placeholder p {
  color: var(--grey-600);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.camera-active-controls {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

.scanner-status {
  font-size: 0.85rem;
  color: var(--grey-600);
  text-align: center;
  margin: 0.75rem 0 1rem;
  font-weight: 500;
}

/* Saisie manuelle & douchette */
.manual-entry-box {
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: 6px;
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.box-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--blue-france);
  margin-bottom: 0.4rem;
}

.input-with-button {
  display: flex;
  gap: 0.4rem;
}

.input-with-button input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--grey-300);
  border-radius: 4px;
}

.input-with-button input:focus {
  outline: none;
  border-color: var(--blue-france);
  box-shadow: 0 0 0 2px rgba(0, 0, 145, 0.2);
}

.quick-scanner-settings {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--grey-200);
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  user-select: none;
}

.toggle-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue-france);
}

/* =====================================================================
   BOUTONS ET ACTIONS CITOYENNES
   ===================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font-family: var(--font-stack);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  text-decoration: none;
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

.btn-primary,
.btn-citoyen {
  background: var(--blue-france);
  color: #ffffff;
}

.btn-primary:hover,
.btn-citoyen:hover {
  background: var(--blue-france-dark);
}

.btn-danger-citoyen {
  background: var(--red-citoyen);
  color: #ffffff;
}

.btn-danger-citoyen:hover {
  background: var(--red-citoyen-dark);
}

.btn-secondary {
  background: var(--grey-100);
  color: var(--grey-900);
  border-color: var(--grey-300);
}

.btn-secondary:hover {
  background: var(--grey-200);
}

.btn-outline {
  background: transparent;
  border-color: var(--blue-france);
  color: var(--blue-france);
}

.btn-outline:hover {
  background: var(--blue-france-light);
}

.btn-outline-danger {
  background: transparent;
  border-color: var(--red-citoyen);
  color: var(--red-citoyen);
}

.btn-outline-danger:hover {
  background: var(--red-citoyen-light);
}

/* =====================================================================
   TABLEAU DU RELEVÉ & VUE MOBILE
   ===================================================================== */

.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.official-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.official-table th {
  background: var(--grey-50);
  color: var(--grey-800);
  font-weight: 700;
  padding: 0.75rem 0.65rem;
  border-bottom: 2px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.official-table td {
  padding: 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.official-table tr:hover {
  background: var(--blue-france-light);
}

.official-table tr.has-anomaly {
  background: #fff8f8;
}

.badge-ean {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--grey-100);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
}

.badge-anomaly-tag {
  background: var(--red-citoyen-light);
  color: var(--red-citoyen);
  border: 1px solid #ffccd0;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  display: inline-block;
}

.badge-conform {
  background: var(--green-light);
  color: var(--green-success);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  display: inline-block;
}

.qty-control-inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-qty-step {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-input-table {
  width: 48px;
  text-align: center;
  font-weight: 700;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Vue Cartes Mobile */
.mobile-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-item-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  border-left: 4px solid var(--blue-france);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mobile-item-card.has-anomaly {
  border-left-color: var(--red-citoyen);
  background: #fffafa;
}

.mobile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.mobile-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--grey-900);
}

.mobile-card-mid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.5rem 0;
}

.mobile-price-block {
  display: flex;
  flex-direction: column;
}

.mobile-unit-price {
  font-size: 0.75rem;
  color: var(--grey-600);
}

.mobile-subtotal {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--blue-france);
}

.mobile-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--grey-100);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--grey-600);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.empty-state h4 {
  font-size: 1.1rem;
  color: var(--grey-800);
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

.list-footer-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

/* Affichage conditionnel responsive */
.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }

  .desktop-only {
    display: block;
  }
}

/* =====================================================================
   ONGLET ARCHIVES & DOSSIERS MULTIPLES
   ===================================================================== */

.archive-filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  overflow-x: auto;
}

.filter-chip {
  background: var(--grey-100);
  border: 1px solid var(--grey-300);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--grey-800);
  cursor: pointer;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--blue-france);
  color: #ffffff;
  border-color: var(--blue-france);
}

.search-box {
  margin-bottom: 1rem;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
}

.dossiers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 680px) {
  .dossiers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dossier-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dossier-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 145, 0.08);
}

.dossier-card.is-current {
  border: 2px solid var(--blue-france);
  background: var(--blue-france-light);
}

.dossier-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.dossier-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--grey-900);
  line-height: 1.25;
}

.dossier-card-details {
  font-size: 0.8rem;
  color: var(--grey-600);
  margin-bottom: 0.85rem;
}

.dossier-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: #ffffff;
  border: 1px solid var(--grey-200);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.85rem;
}

.dossier-stat-row strong {
  color: var(--blue-france);
  font-size: 1.1rem;
}

.dossier-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dossier-card-actions .btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
}

.archive-backup-bar {
  background: var(--grey-50);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
}

.backup-note {
  font-size: 0.82rem;
  color: var(--grey-800);
  margin-bottom: 0.65rem;
}

.backup-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* =====================================================================
   FORMULAIRES & RÉGLAGES
   ===================================================================== */

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--grey-800);
}

.form-group input,
.form-group textarea {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-stack);
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-france);
  box-shadow: 0 0 0 2px rgba(0, 0, 145, 0.2);
}

.form-help {
  font-size: 0.72rem;
  color: var(--grey-600);
}

.separator-line {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* Styles pour la synchronisation multi-appareils */
.sync-section {
  background: var(--blue-france-light);
  border: 1px solid #ccd8ff;
  border-radius: 8px;
  padding: 1.1rem;
}

.sync-header-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.sync-header-line h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--blue-france);
  margin-bottom: 0;
}

.sync-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
}

.sync-badge.sync-ok {
  background: var(--green-light);
  color: var(--green-success);
}

.sync-badge.sync-warn {
  background: var(--amber-light);
  color: var(--amber-warning);
}

.sync-badge.sync-error {
  background: var(--red-citoyen-light);
  color: var(--red-citoyen);
}

.sync-card-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0.85rem 0 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sync-card-status {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sync-card-status span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--grey-900);
}

.sync-card-status small {
  font-size: 0.75rem;
  color: var(--grey-600);
}

.device-transfer-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem;
}

.save-feedback {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green-success);
  margin-left: 0.5rem;
}

/* Indicateur de synchronisation cloud en direct */
.cloud-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--green-light);
  color: var(--green-success);
  border: 1px solid #bbf7d0;
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.cloud-sync-indicator .sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-success);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(27, 138, 54, 0.2);
}

.cloud-sync-indicator.syncing {
  background: var(--blue-france-light);
  color: var(--blue-france);
  border-color: #bfdbfe;
}

.cloud-sync-indicator.syncing .sync-dot {
  background: var(--blue-france);
  animation: pulseSync 1s infinite alternate;
}

.cloud-sync-indicator.offline {
  background: var(--amber-light);
  color: var(--amber-warning);
  border-color: #fde68a;
}

.cloud-sync-indicator.offline .sync-dot {
  background: var(--amber-warning);
}

@keyframes pulseSync {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

.pwa-help-card {
  background: var(--blue-france-light);
  border-left: 4px solid var(--blue-france);
  padding: 1rem;
  border-radius: 0 6px 6px 0;
}

.pwa-help-card p {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.pwa-steps {
  font-size: 0.82rem;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* =====================================================================
   BARRE DE NAVIGATION INFÉRIEURE MOBILE
   ===================================================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.nav-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  background: none;
  border: none;
  color: var(--grey-600);
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
  transition: color 0.15s ease;
}

.nav-item:active {
  background: var(--grey-50);
}

.nav-item.active {
  color: var(--blue-france);
  font-weight: 800;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  background: var(--blue-france);
  border-radius: 0 0 2px 2px;
}

.nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.nav-label {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: 25%;
  background: var(--red-citoyen);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 10px;
  line-height: 1;
}

/* =====================================================================
   MODALES
   ===================================================================== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 22, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 200;
}

.modal-content {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 10px 30px rgba(0, 0, 145, 0.2);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header-citoyen {
  background: var(--grey-50);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-citoyen .modal-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1d4ed8, #2563eb, #3b82f6);
}

.modal-header-citoyen h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--blue-france);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--grey-600);
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

.modal-body {
  padding: 1rem;
  overflow-y: auto;
}

.barcode-badge-box {
  background: var(--blue-france-light);
  border: 1px solid #c7d5ff;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-barcode {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue-france);
}

.barcode-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--grey-900);
  letter-spacing: 0.05em;
}

.price-input-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.input-currency-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.input-price-large {
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  color: var(--blue-france) !important;
  padding-right: 2.2rem !important;
  width: 100%;
}

.currency-symbol {
  position: absolute;
  right: 12px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--grey-600);
}

/* Bouton Saisie Vocale */
.btn-voice-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 1rem;
  background: var(--blue-france-light);
  border: 1.5px solid var(--blue-france);
  border-radius: 6px;
  color: var(--blue-france);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  touch-action: manipulation;
  user-select: none;
}

.btn-voice-price:hover {
  background: #ebeeff;
  border-color: var(--blue-france-dark);
}

.btn-voice-price.is-recording {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
  animation: micPulseGlow 1.2s infinite alternate ease-in-out;
}

.btn-voice-price .voice-mic-icon {
  font-size: 1.25rem;
  line-height: 1;
}

@keyframes micPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    transform: scale(1.02);
  }
}

/* Boîte d'état de la dictée vocale */
.voice-status-box {
  margin-top: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  position: relative;
  transition: all 0.25s ease;
}

.voice-status-box.voice-success {
  background: #f0fdf4;
  border-color: #86efac;
}

.voice-status-box.voice-error {
  background: #fef2f2;
  border-color: #fca5a5;
}

.voice-pulse-indicator {
  position: relative;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  transition: background 0.2s ease;
}

.pulse-ring {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #ef4444;
  border-radius: 50%;
  animation: pulseRingAnim 1.2s infinite ease-out;
  opacity: 0.7;
}

@keyframes pulseRingAnim {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.voice-status-box.voice-success .pulse-dot {
  background: #16a34a;
}
.voice-status-box.voice-success .pulse-ring {
  border-color: #16a34a;
}

.voice-status-box.voice-error .pulse-dot {
  background: #dc2626;
}
.voice-status-box.voice-error .pulse-ring {
  display: none;
}

.voice-status-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.voice-status-title {
  font-weight: 700;
  color: var(--blue-france);
  font-size: 0.82rem;
}

.voice-status-box.voice-success .voice-status-title {
  color: #15803d;
}

.voice-status-box.voice-error .voice-status-title {
  color: #b91c1c;
}

.voice-status-desc {
  font-size: 0.78rem;
  color: var(--grey-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-voice-cancel {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--grey-600);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.btn-voice-cancel:hover {
  color: var(--grey-900);
}

/* Saisie du libellé avec micro */
.input-with-voice {
  display: flex;
  gap: 0.4rem;
}

.input-with-voice input {
  flex: 1;
}

.btn-voice-mini {
  background: var(--grey-100);
  border: 1px solid var(--grey-300);
  border-radius: 4px;
  padding: 0 0.75rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-voice-mini:hover {
  background: var(--grey-200);
  border-color: var(--blue-france);
}

.btn-voice-mini.is-recording {
  background: #fee2e2;
  border-color: #ef4444;
  animation: micPulseGlow 1.2s infinite alternate ease-in-out;
}

/* Retour visuel de la recherche automatique de désignation par code-barres */
.barcode-lookup-status {
  font-size: 0.78rem;
  margin-top: 0.35rem;
  min-height: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.barcode-lookup-status.loading {
  color: var(--blue-france);
  font-style: italic;
}

.barcode-lookup-status.success {
  color: #15803d;
  font-weight: 600;
}

.barcode-lookup-status.notfound {
  color: var(--grey-600);
  font-size: 0.75rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Ligne compacte Quantité + Rayon pour optimiser la largeur sur mobile */
.form-row-qty-shelf {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 0.75rem;
  align-items: flex-start;
}

.form-group-qty input {
  text-align: center;
  font-weight: 700;
  padding: 0.6rem 0.3rem;
}

@media (max-width: 480px) {
  .form-row-qty-shelf {
    grid-template-columns: 75px 1fr;
    gap: 0.5rem;
  }
}

/* Alertes Flash Notifications */
.flash-alert-container {
  max-width: 960px;
  margin: 0.75rem auto 0;
  padding: 0 1rem;
}

.flash-alert-box {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.flash-alert-box.is-error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.anomaly-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--red-citoyen-light);
  border: 1px solid #ffccd0;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red-citoyen-dark);
}

.anomaly-checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--red-citoyen);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

/* Utilitaires */
.hidden {
  display: none !important;
}

/* =====================================================================
   STYLISATION POUR EXPORT & IMPRESSION (RAPPORT DU COLLECTIF CITOYEN)
   ===================================================================== */

.print-only {
  display: none;
}

@media print {

  /* Cacher l'interface interactive */
  .official-header,
  .dossier-bar,
  .app-main,
  .bottom-nav,
  .modal {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .print-only {
    display: block !important;
    padding: 1.5cm;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }

  .pv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #000091;
    padding-bottom: 15px;
    margin-bottom: 20px;
  }

  .pv-citizen-block {
    display: flex;
    flex-direction: column;
    font-size: 8pt;
    line-height: 1.3;
  }

  .pv-citizen-block strong {
    font-size: 11pt;
    letter-spacing: 1px;
    color: #000091;
  }

  .pv-citizen-bar {
    width: 60px;
    height: 4px;
    background: #000091;
    border-radius: 2px;
    margin-bottom: 6px;
  }

  .pv-title-block {
    text-align: right;
  }

  .pv-title-block h2 {
    font-size: 14pt;
    font-weight: 900;
    color: #000091;
    margin-bottom: 4px;
  }

  .pv-ref {
    font-size: 8pt;
    color: #555555;
  }

  .pv-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #f6f6f6;
    border: 1px solid #cccccc;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 9.5pt;
  }

  .pv-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    font-size: 9pt;
  }

  .pv-table th,
  .pv-table td {
    border: 1px solid #aaaaaa;
    padding: 6px 8px;
    text-align: left;
  }

  .pv-table th {
    background: #eeeeee;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 8pt;
  }

  .pv-summary {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 25px;
    page-break-inside: avoid;
  }

  .pv-summary-box {
    border: 1px solid #000091;
    padding: 12px;
    width: 50%;
    font-size: 9.5pt;
    line-height: 1.5;
  }

  .pv-signature-box {
    border: 1px solid #cccccc;
    padding: 12px;
    width: 45%;
    font-size: 9pt;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .pv-stamp-space {
    height: 80px;
    border: 1px dashed #aaaaaa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888888;
    font-size: 8pt;
    margin-top: 10px;
  }
}

/* =====================================================================
   ÉCRAN DE CONNEXION TOTALEMENT NEUTRE (ACCÈS SÉCURISÉ)
   ===================================================================== */

body.is-locked {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  overflow: hidden;
}

body.is-locked .official-header,
body.is-locked .dossier-bar,
body.is-locked .app-main,
body.is-locked .bottom-nav,
body.is-locked .modal,
body.is-locked .print-only {
  display: none !important;
}

body:not(.is-locked) .login-screen {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  padding: 1.5rem 1rem;
}

.login-container {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
}

.login-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 2.2rem 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.login-icon-box {
  width: 58px;
  height: 58px;
  margin: 0 auto 1.2rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.login-desc {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 1.6rem;
  line-height: 1.4;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.login-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input {
  width: 100%;
  padding: 0.8rem 2.8rem 0.8rem 1rem;
  font-size: 1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.15);
}

.btn-pwd-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.4rem;
  color: #64748b;
  border-radius: 4px;
}

.btn-pwd-eye:hover {
  background: #f1f5f9;
}

.login-error-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.remember-device-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.remember-device-label input {
  width: 16px;
  height: 16px;
  accent-color: #0f172a;
}

.btn-login-submit {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  margin-top: 0.4rem;
}

.btn-login-submit:hover {
  background: #1e293b;
}

.btn-login-submit:active {
  transform: scale(0.99);
}

.login-footer-info {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: #64748b;
  letter-spacing: 0.04em;
}

/* =====================================================================
   ESPACE ADMINISTRATEUR EN CHEF & MULTI-UTILISATEURS
   ===================================================================== */

.login-input-margin {
  margin-bottom: 0.75rem;
}

/* Badge Utilisateur connecté dans le Header */
.current-user-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--blue-france-light);
  border: 1px solid rgba(0, 0, 145, 0.2);
  padding: 0.25rem 0.55rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-france);
}

.user-avatar-mini {
  font-size: 0.85rem;
  line-height: 1;
}

.user-display-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-tag {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--blue-france);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-role-tag.is-observer {
  background: var(--green-success);
}

/* Grille Statistiques Admin */
.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-title-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-title-icon {
  font-size: 1.4rem;
}

.admin-subtitle {
  font-size: 0.82rem;
  color: var(--grey-600);
  margin-top: 0.2rem;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--blue-france);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--grey-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.3rem;
}

/* Tableau Utilisateurs */
.users-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.users-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--grey-50);
  border-bottom: 1px solid var(--border);
}

.users-section-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--grey-900);
}

.badge-tag {
  background: var(--blue-france-light);
  color: var(--blue-france);
  border: 1px solid rgba(0, 0, 145, 0.2);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.users-table-container {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.users-table th {
  background: #ffffff;
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--grey-600);
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.05em;
}

.users-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.users-table tr:last-child td {
  border-bottom: none;
}

.users-table tr:hover td {
  background: #fafbff;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-france-light);
  border: 1px solid rgba(0, 0, 145, 0.2);
  color: var(--blue-france);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.user-name-title {
  font-weight: 700;
  color: var(--grey-900);
}

.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-role.role-admin {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-role.role-observer {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.user-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.btn-user-action {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.btn-user-action:hover {
  background: var(--grey-100);
}

.btn-user-action.btn-action-delete {
  color: var(--red-citoyen);
  border-color: #fecaca;
}

.btn-user-action.btn-action-delete:hover {
  background: var(--red-citoyen-light);
}

.btn-user-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Liste Utilisateurs Mobile */
.users-mobile-list {
  display: none;
  padding: 0.75rem;
  gap: 0.75rem;
  flex-direction: column;
}

.user-mobile-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.user-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-mobile-meta {
  font-size: 0.78rem;
  color: var(--grey-600);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.user-mobile-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--grey-100);
}

.user-mobile-actions .btn-user-action {
  flex: 1;
  justify-content: center;
}

@media (max-width: 768px) {
  .users-table-container {
    display: none;
  }
  .users-mobile-list {
    display: flex;
  }
  .user-display-name {
    display: none;
  }
}

/* Note informative d'aide */
.admin-info-note {
  background: var(--blue-france-light);
  border: 1px solid rgba(0, 0, 145, 0.15);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--grey-800);
}

.admin-info-note .info-note-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.admin-info-note ul {
  margin-top: 0.4rem;
  padding-left: 1.2rem;
  line-height: 1.45;
}

.user-selected-pill {
  padding: 0.5rem 0.75rem;
  background: var(--grey-100);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--blue-france);
}

.form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: var(--font-stack);
  background-color: #ffffff;
  color: var(--grey-900);
  cursor: pointer;
}

/* Filtre Superviseur dans Archives (Grand Administrateur) */
.admin-archives-filter-row {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-archives-filter-row label {
  font-size: 0.88rem;
  color: var(--grey-800);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-archives-filter-row select.admin-user-select {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1.5px solid var(--blue-france);
  border-radius: 6px;
  background: white;
  color: var(--blue-france-dark);
  cursor: pointer;
}

/* Badge Propriétaire du Dossier */
.badge-owner-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
