body {
  background: #f8f9fa;
  padding-bottom: 2rem;
}

.navbar-app {
  background-color: #003d82 !important;
}

.btn-success, .btn-success:hover {
  background-color: #003d82 !important;
  border-color: #003d82 !important;
}

.btn-outline-success, .btn-outline-success:hover {
  color: #003d82;
  border-color: #003d82;
}

.btn-outline-success:hover {
  background-color: #003d82;
  border-color: #003d82;
  color: white;
}
/* État actif/sélectionné : garder la couleur de marque (navy) au lieu du vert
   par défaut de Bootstrap — cohérence des onglets de filtre (Tous/Ouverts…). */
.btn-outline-success.active,
.btn-outline-success:active,
.btn-check:checked + .btn-outline-success,
.show > .btn-outline-success.dropdown-toggle {
  background-color: #003d82 !important;
  border-color: #003d82 !important;
  color: #fff !important;
}

/* Marque : tout le « primary » de Bootstrap adopte le navy #003d82, pour que
   boutons et onglets de filtre soient identiques d'une page à l'autre
   (Vérifications et Conciergerie utilisaient le bleu vif par défaut). */
.btn-primary {
  --bs-btn-bg: #003d82; --bs-btn-border-color: #003d82;
  --bs-btn-hover-bg: #0052a3; --bs-btn-hover-border-color: #0052a3;
  --bs-btn-active-bg: #00336d; --bs-btn-active-border-color: #00336d;
  --bs-btn-disabled-bg: #003d82; --bs-btn-disabled-border-color: #003d82;
  --bs-btn-focus-shadow-rgb: 0, 61, 130;
}
.btn-outline-primary {
  --bs-btn-color: #003d82; --bs-btn-border-color: #003d82;
  --bs-btn-hover-bg: #003d82; --bs-btn-hover-border-color: #003d82;
  --bs-btn-active-bg: #003d82; --bs-btn-active-border-color: #003d82;
  --bs-btn-focus-shadow-rgb: 0, 61, 130;
}

/* Anneau de focus à la couleur de marque (au lieu du bleu Bootstrap) */
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #003d82;
  box-shadow: 0 0 0 0.2rem rgba(0, 61, 130, 0.25);
}

.page {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

.ticket-card, .liste-card {
  animation: slideUp 0.3s ease;
}

.liste-card {
  border-left: 4px solid #003d82;
  transition: box-shadow 0.15s;
}
.liste-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.produit-ligne {
  border-radius: 8px;
  background: white;
  border: 1px solid #dee2e6;
  margin-bottom: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.produit-ligne.achete { opacity: 0.5; text-decoration: line-through; }

.produit-ligne .nom { flex: 1; font-size: 0.95rem; }
.produit-ligne .qte { font-size: 0.85rem; color: #6c757d; white-space: nowrap; }

.import-item {
  border-radius: 8px;
  background: white;
  border: 1px solid #dee2e6;
  margin-bottom: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap-10px;
  gap: 10px;
}
.import-item.selected { border-color: #003d82; background: #f0f7ff; }
.import-item { opacity: 1; transition: opacity 0.15s, background 0.15s, border-color 0.15s; }
.import-item:not(.selected) { opacity: 0.55; }
.import-item .infos { flex: 1; min-width: 0; }
.import-item .nom { font-weight: 500; font-size: 0.95rem; }
.import-item .meta { font-size: 0.8rem; color: #6c757d; }
.import-item .import-nom { font-weight: 500; }
.import-item .import-badge { flex: 0 0 auto; font-size: 0.7rem; }
.import-item .import-prix-group { width: 120px; flex: 0 0 auto; }
.import-item .import-perso-group { max-width: 480px; }
.import-item .import-perso-group .input-group-text { background: #eef4fb; color: #003d82; }
.import-item .import-lien-row:empty { display: none; }
.import-item .import-lien-row a { color: #003d82; cursor: pointer; text-decoration: underline; }
.import-item .import-lie { color: #0c5460; }
.import-item .import-sugg { color: #495057; }

.progress { height: 8px; }

.navbar-brand { font-size: 1rem; }

/* Navbar réorganisée */
.navbar-app .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  padding: 6px 12px;
  transition: background 0.15s, color 0.15s;
}
.navbar-app .navbar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.navbar-app .navbar-nav .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  font-weight: 600;
}
.navbar-app .dropdown-item.active,
.navbar-app .dropdown-item:active {
  background: #003d82;
  color: #fff;
}
.navbar-app .navbar-nav .nav-link .badge { font-size: 0.65rem; vertical-align: middle; }
.navbar-app .navbar-toggler { border-color: rgba(255,255,255,0.4); }
/* Sur mobile (menu déployé), un peu d'air entre les groupes */
@media (max-width: 991.98px) {
  .navbar-app .navbar-collapse { padding-top: 8px; }
  .navbar-app .navbar-collapse .d-flex { margin-top: 8px; }
}

/* Checkbox large pour usage mobile */
.form-check-input.lg {
  width: 1.4em;
  height: 1.4em;
  margin-top: 0.1em;
  cursor: pointer;
}

/* Bottom sheet — ajout produit liste */
#bottom-sheet-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1060;
}
#bottom-sheet-overlay.visible { display: block; }

#bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 85vh;
  background: white;
  border-radius: 20px 20px 0 0;
  z-index: 1070;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(.32,1,.23,1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}
#bottom-sheet.open { transform: translateY(0); }

#bottom-sheet-handle {
  width: 40px; height: 4px;
  background: #dee2e6;
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

#bottom-sheet-header {
  padding: 10px 16px 8px;
  flex-shrink: 0;
}

#bottom-sheet-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 12px 24px;
}

.bs-produit-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid #f0f0f0;
}
.bs-produit-card:last-child { border-bottom: none; }
.bs-produit-info { flex: 1; min-width: 0; }
.bs-produit-info .nom { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-produit-info .meta { font-size: 0.78rem; color: #6c757d; }

.bs-qte-ctrl { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bs-qte-ctrl button {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid #003d82;
  background: white;
  color: #003d82;
  font-size: 1.1rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bs-qte-ctrl button.plus { background: #003d82; color: white; }
.bs-qte-ctrl button:active { transform: scale(0.92); }
.bs-qte-ctrl .qte-val { min-width: 20px; text-align: center; font-weight: 600; font-size: 0.95rem; }

.bs-produit-card.just-added { animation: flashGreen 0.5s ease; }
@keyframes flashGreen {
  0%   { background: #d1fae5; }
  100% { background: transparent; }
}

#bs-libre-section {
  margin-top: 8px;
  padding: 10px 4px;
  border-top: 2px dashed #dee2e6;
}

/* Dashboard - Inspiré d'eSeason */
.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.dashboard-section-card {
  background: white;
  border: none;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #003d82;
}

.dashboard-section-card:hover {
  box-shadow: 0 4px 12px rgba(0, 61, 130, 0.15);
  transform: translateX(4px);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  font-size: 2rem;
  color: #003d82;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-info {
  flex: 1;
  min-width: 0;
}

.section-info h6 {
  margin: 0 0 6px 0;
  font-weight: 600;
  color: #212529;
  font-size: 1rem;
}

.section-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.section-badges .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
  border: none;
  background: #f0f2f5;
  color: #212529;
}

.badge-open {
  background: #fff3cd !important;
  color: #856404 !important;
}

.badge-progress {
  background: #d1ecf1 !important;
  color: #0c5460 !important;
}

.badge-closed {
  background: #d4edda !important;
  color: #155724 !important;
}

.badge-info {
  background: #e7f3ff !important;
  color: #003d82 !important;
}

.section-main-stat {
  font-size: 2.5rem;
  font-weight: 700;
  color: #003d82;
  min-width: 60px;
  text-align: right;
}

/* Ticket cards */
.ticket-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  position: relative;
}
.ticket-card.border-2 {
  border-width: 2px !important;
}

/* Swipe des cartes (mobile) : glisser à droite = avancer le statut, à gauche = revenir */
.swipe-row { position: relative; overflow: hidden; border-radius: 10px; margin-bottom: 10px; }
.swipe-row .swipe-card { margin-bottom: 0 !important; touch-action: pan-y; will-change: transform; }
.swipe-bg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; color: #fff; font-weight: 600; font-size: 0.9rem; border-radius: 10px;
  opacity: 0; background: #6c757d;
}
.swipe-row.sw-right .swipe-bg { opacity: 1; background: #1e7e34; }
.swipe-row.sw-left  .swipe-bg { opacity: 1; background: #6c757d; }
.swipe-bg .g, .swipe-bg .d { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.swipe-bg i { font-size: 1.15rem; }

/* Accent de priorité (bord gauche) pour repérer d'un coup d'œil */
.ticket-card.prio-haute   { border-left: 5px solid #dc3545; }
.ticket-card.prio-normale { border-left: 5px solid #f0ad4e; }
.ticket-card.prio-basse   { border-left: 5px solid #adb5bd; }

.ticket-card:hover {
  box-shadow: 0 4px 12px rgba(0, 61, 130, 0.12);
  transform: translateY(-2px);
  border-color: #003d82;
}

.ticket-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.ticket-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticket-title {
  font-weight: 600;
  color: #212529;
  font-size: 0.95rem;
  flex: 1;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: #6c757d;
}

/* Pastille Arrivée / Départ : le repère visuel principal de la conciergerie.
   Vert = mise en place à l'arrivée, orange = reprise au départ. */
.ticket-sens {
  margin-bottom: 8px;
}
.sens-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sens-badge.sens-arrivee { background: #d1e7dd; color: #0f5132; }
.sens-badge.sens-depart  { background: #ffe0c2; color: #8a3e00; }
/* Variante pleine largeur, plus grande, pour l'en-tête du détail. */
.sens-badge-lg {
  justify-content: center;
  padding: 8px 12px;
  font-size: 0.95rem;
}

/* Flèches de priorisation manuelle (maintenance long terme) : poussées à droite
   de la ligne de méta-données, avec des cibles tactiles confortables. */
.lt-ordre {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.lt-ordre .btn {
  --bs-btn-padding-y: 2px;
  --bs-btn-padding-x: 8px;
  line-height: 1.2;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-item i {
  font-size: 0.8rem;
  color: #003d82;
}

/* Ticket detail sections */
.ticket-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-section {
  padding-bottom: 12px;
  border-bottom: 1px solid #e9ecef;
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.9rem;
}

.detail-label {
  font-weight: 600;
  color: #212529;
  flex-shrink: 0;
}

.detail-value {
  text-align: right;
  flex: 1;
  margin-left: 10px;
}

/* Matériel item */
.materiel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 8px;
}

.materiel-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: #212529;
}

.materiel-qte {
  font-size: 0.85rem;
  color: #6c757d;
  min-width: 50px;
  text-align: right;
}

/* Global search results */
.hover {
  cursor: pointer;
  transition: background-color 0.15s;
}
.hover:hover {
  background-color: #f0f7ff;
}

/* Toast animations */
@keyframes slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(400px); opacity: 0; }
}

/* Form improvements */
.form-control, .form-select {
  border-radius: 6px;
  border-color: #dee2e6;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #003d82;
  box-shadow: 0 0 0 0.2rem rgba(0, 61, 130, 0.15);
}

/* Button improvements */
.btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Modal improvements */
.modal-header {
  background: linear-gradient(135deg, #003d82 0%, #0052a3 100%);
  color: white;
  border-bottom: none;
}

.modal-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.nav-tabs .nav-link {
  color: #6c757d;
  border-color: transparent;
  font-weight: 500;
}

.nav-tabs .nav-link:hover {
  border-color: #dee2e6;
  color: #003d82;
}

.nav-tabs .nav-link.active {
  color: #003d82;
  background-color: #f8f9fa;
  border-color: #003d82;
  border-bottom-color: white;
}

/* Photo thumbnails */
#ticket-photos-list img {
  cursor: pointer;
  transition: transform 0.2s;
}

#ticket-photos-list img:hover {
  transform: scale(1.05);
}

/* Quick buttons */
.btn-outline-secondary {
  --bs-btn-hover-bg: #e2e6ea;
}

/* Required field indicator */
.text-danger {
  font-weight: bold;
}

/* Écran d'authentification */
#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: linear-gradient(135deg, #003d82 0%, #0052a3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#auth-overlay.d-none { display: none !important; }
.auth-box {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* Planning — calendrier */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-head {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  padding: 4px 0;
}
.cal-cell {
  position: relative;
  min-height: 52px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 4px;
  background: #fff;
}
.cal-empty { border: none; background: transparent; }
.cal-num { font-size: 0.8rem; color: #495057; }
.cal-has { cursor: pointer; background: #f0f7ff; border-color: #003d82; }
.cal-has:hover { background: #e0efff; }
.cal-today { box-shadow: inset 0 0 0 2px #003d82; }
.cal-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: #003d82;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  padding: 0 4px;
}
/* Pastilles de type (planning multi-sources) */
.planning-pastille {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 3px;
}
.cal-pastilles {
  position: absolute;
  bottom: 5px;
  left: 5px;
  display: flex;
  gap: 2px;
}
.cal-pastilles .planning-pastille { margin-right: 0; }

/* Historique par emplacement — timeline */
.historique-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 6px;
}
.historique-item:last-child { border-bottom: none; }
.hist-icon { font-size: 1.3rem; min-width: 28px; text-align: center; }
.hist-body { flex: 1; min-width: 0; }
.hist-title { font-weight: 600; font-size: 0.92rem; color: #212529; }
.hist-meta { font-size: 0.8rem; color: #6c757d; }
.hist-date { white-space: nowrap; flex-shrink: 0; }

/* Gros bouton retour à l'accueil (sous-pages) — ergonomie tactile */
.btn-retour {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  background: #e7f0fb;
  color: #003d82;
  border: 1px solid #cbdcf2;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.btn-retour i { font-size: 1.3rem; }
.btn-retour:hover, .btn-retour:focus {
  background: #d6e6f9;
  color: #003d82;
  border-color: #003d82;
  transform: translateY(-1px);
}
.btn-retour:active { transform: scale(0.99); }

/* Position sticky pour rester accessible au scroll */
@media (max-width: 768px) {
  .btn-retour {
    position: sticky;
    top: 8px;
    z-index: 500;
  }
}

/* Fil de discussion des tickets/tâches (module commentaires.js) */
.commentaires-fil {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.commentaire {
  background: #f1f3f5;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid #e9ecef;
}

/* Mes messages : teintés au bleu de marque pour se repérer dans le fil */
.commentaire-moi {
  background: #eaf1fb;
  border-color: #cfe0f7;
}

.commentaire-tete {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.commentaire-auteur {
  font-weight: 600;
  font-size: 0.85rem;
  color: #003d82;
}

.commentaire-date {
  font-size: 0.75rem;
  white-space: nowrap;
}

.commentaire-suppr {
  margin-left: auto;
  border: none;
  background: transparent;
  color: #adb5bd;
  padding: 0 2px;
  line-height: 1;
  cursor: pointer;
}

.commentaire-suppr:hover { color: #dc3545; }

.commentaire-corps {
  font-size: 0.9rem;
  color: #212529;
  white-space: pre-wrap;
  word-break: break-word;
}

.commentaire-saisie {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.commentaire-saisie textarea {
  resize: vertical;
  min-height: 38px;
}

