/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Valeur par défaut; ajustée dynamiquement via JS (voir applyStickyTopOffset) */
    --sticky-top-offset: 0px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #008000 0%, #006400 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Bandeau en haut */
.top-banner {
    background: linear-gradient(135deg, #008000 0%, #006400 100%);
    padding: 0.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.banner-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.banner-logo i {
    font-size: 2rem;
    color: white;
}

.banner-gauge {
    margin-left: 1.2rem;
    min-width: 220px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.banner-gauge .gauge-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    color: rgba(255,255,255,0.95);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    user-select: none;
}

.banner-gauge .gauge-sub {
    color: rgba(255,255,255,0.85);
    font-size: 0.72rem;
    font-weight: 400;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.banner-gauge .gauge-bar {
    height: 10px;
    width: 100%;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
}

.banner-gauge .gauge-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00e676 0%, #66ff99 100%);
    border-radius: 999px;
    transition: width 180ms ease;
}

.banner-gauge.is-warn .gauge-fill {
    background: linear-gradient(90deg, #ffb300 0%, #ffd54f 100%);
}

.banner-gauge.is-over .gauge-fill {
    background: linear-gradient(90deg, #ff1744 0%, #ff5252 100%);
}

.banner-text h1 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.banner-text p {
    font-size: 0.9rem;
    color: white;
    margin: 0;
    opacity: 0.9;
    font-weight: 300;
}

.banner-author {
    font-size: 0.75rem;
    color: white;
    margin: 0;
    margin-top: 2px;
    opacity: 0.8;
    font-weight: 400;
}

@media (max-width: 900px) {
    .banner-content {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    .banner-gauge {
        margin-left: 0.8rem;
        min-width: 180px;
        max-width: 100%;
    }
}

.banner-profile {
    position: relative;
}

.banner-profile .profile-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.banner-profile .profile-avatar:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.05);
}

.banner-profile .profile-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 1rem;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.banner-profile .profile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.banner-profile .profile-info {
    padding-bottom: 1rem;
    border-bottom: 1px solid #f8f9fa;
    margin-bottom: 1rem;
}

.banner-profile .profile-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.banner-profile .profile-email {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.banner-profile .profile-role {
    color: #008000;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.banner-profile .profile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.banner-profile .profile-btn {
    background: #f8f9fa;
    color: #333;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.banner-profile .profile-btn:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.banner-profile .logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.banner-profile .logout-btn:hover {
    background: #c82333;
    transform: translateX(2px);
}

/* Bouton de retour dans le bandeau */
.banner-return-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    margin-right: 1rem;
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

.banner-return-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.05);
}

.banner-return-btn i {
    font-size: 1.05rem;
}

/* Actions des magasins */
.magasin-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.magasin-actions .btn {
    flex: 1;
    padding: 0.5rem 0.35rem;
    font-size: 0.85rem;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    line-height: 1.1;
    text-align: center;
    height: auto;
    min-height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Affiner spécifiquement “Modifier info magasin” (btn-primary) */
.magasin-actions .btn-primary {
    padding: 0.5rem 0.6rem;
    font-size: 0.84rem;
}

.btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.btn-share {
    background: #0dcaf0;
    color: #ffffff;
    border: 1px solid #0bbcd9;
}

.btn-share:hover {
    background: #0ab7d0;
    border-color: #099fba;
}

/* Notification de confirmation */
.confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirmation-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 2001;
    max-width: 500px;
    width: 90%;
    animation: confirmationSlideIn 0.3s ease-out;
}

@keyframes confirmationSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.confirmation-content {
    padding: 2rem;
}

.confirmation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.confirmation-header i {
    color: #ffc107;
    font-size: 1.5rem;
}

.confirmation-header h3 {
    color: #333;
    margin: 0;
    font-size: 1.3rem;
}

.confirmation-body {
    margin-bottom: 2rem;
}

.confirmation-body p {
    margin-bottom: 1rem;
    color: #555;
    line-height: 1.5;
}

.warning-text {
    color: #dc3545;
    font-weight: 500;
    font-size: 0.9rem;
}

.confirmation-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Style Télécommande */
.remote-control {
    background: linear-gradient(145deg, #2c2c2c, #1a1a1a);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid #333;
}

.remote-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #444;
    position: relative;
}

.remote-header h3 {
    color: #fff;
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.remote-header i {
    color: #00bcd4;
    margin-right: 0.5rem;
}

.remote-detach-btn {
    position: absolute;
    top: -0.5rem;
    right: 0;
    background: linear-gradient(145deg, #00bcd4, #0097a7);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

.remote-detach-btn:hover {
    background: linear-gradient(145deg, #10ccd4, #19a7b7);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 188, 212, 0.3);
}

.remote-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.remote-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1rem;
    border: 1px solid #444;
}

.section-title {
    color: #00bcd4;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 1px;
}

.remote-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.remote-btn {
    background: linear-gradient(145deg, #4a4a4a, #2a2a2a);
    border: none;
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 80px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* Etat actif pour les boutons de visibilité dans la télécommande */
.remote-btn.active {
  outline: 3px solid #7dd3fc;
  background: linear-gradient(145deg, #1e88e5, #1565c0);
}

/* Boutons visibilité: gris par défaut, bleu si actif */
#btnVisCoord,
#btnVisCDF {
  background: linear-gradient(145deg, #6b7280, #4b5563); /* gray */
}

#btnVisCoord.active,
#btnVisCDF.active {
  background: linear-gradient(145deg, #1e88e5, #1565c0); /* blue */
}

/* Mise en évidence des lignes produits selon mouvements */
tr.row-arret {
  background: rgba(239, 68, 68, 0.15);
}
tr.row-arret > td {
  background: rgba(239, 68, 68, 0.15) !important;
  background-color: rgba(239, 68, 68, 0.15) !important;
}

tr.row-switch {
  background: rgba(245, 158, 11, 0.15);
}
tr.row-switch > td {
  background: rgba(245, 158, 11, 0.15) !important;
  background-color: rgba(245, 158, 11, 0.15) !important;
}

/* Icône d'avertissement à côté de la description */
.warn-icon {
  color: #d97706; /* orange */
  margin-left: 6px;
}

/* Tooltip personnalisé pour les arrêts/switch */
.description-cell[data-tip] {
  position: relative;
}

.description-cell[data-tip]:hover:after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: 100%;
  transform: translateY(6px);
  background: #111827; /* slate-900 */
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  white-space: nowrap;
  z-index: 10;
}

.description-cell[data-tip]:hover:before {
  content: '';
  position: absolute;
  left: 10px;
  top: calc(100% + 1px);
  border-width: 6px;
  border-style: solid;
  border-color: #111827 transparent transparent transparent;
  z-index: 11;
}

/* Popover riche SWITCH */
.switch-popover {
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 10px;
  width: 320px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.35);
}
.switch-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.badge-switch {
  background: #d97706;
  color: #111827;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
}
.switch-popover-body { display: flex; gap: 10px; }
.switch-img img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.switch-label { font-weight: 600; margin-bottom: 4px; }
.switch-ean { opacity: 0.85; }

/* Popover riche ARRET */
.arret-popover {
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 10px;
  width: 320px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.35);
}
.arret-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.badge-arret {
  background: #ef4444; /* red */
  color: #111827;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
}
.top-badges {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  flex-wrap: wrap;
}
.top-indicator {
  display: inline-flex;
  cursor: pointer;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* TOP BIO - Vert */
.top-indicator.top-bio {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.4);
}

/* TOP 500/300 - Bleu */
.top-indicator.top-500-300 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.4);
}

/* TAN-A - Rose */
.top-indicator.top-tan-a {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 12px rgba(236, 72, 153, 0.4);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}
.top-popover {
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.35);
  font-size: 13px;
  z-index: 1000;
}
.badge-top {
  background: #0ea5e9;
  color: #111827;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  margin-right: 6px;
}
.arret-popover-body { display: flex; gap: 10px; }
.arret-label { font-weight: 600; margin-bottom: 4px; }
.arret-ean { opacity: 0.85; }

.remote-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.remote-btn:hover::before {
    left: 100%;
}

.remote-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.remote-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.remote-btn i {
    font-size: 1.2rem;
}

.remote-btn span {
    font-size: 0.8rem;
    text-align: center;
}

/* Couleurs des boutons */
.remote-red {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
}

.remote-red:hover {
    background: linear-gradient(145deg, #f74c3c, #d0392b);
    box-shadow: 
        0 6px 12px rgba(231, 76, 60, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.remote-green {
    background: linear-gradient(145deg, #27ae60, #229954);
}

.remote-green:hover {
    background: linear-gradient(145deg, #37ae70, #329964);
    box-shadow: 
        0 6px 12px rgba(39, 174, 96, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.remote-blue {
    background: linear-gradient(145deg, #3498db, #2980b9);
}

.remote-blue:hover {
    background: linear-gradient(145deg, #4498eb, #3980c9);
    box-shadow: 
        0 6px 12px rgba(52, 152, 219, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.remote-yellow {
    background: linear-gradient(145deg, #f39c12, #e67e22);
}

.remote-yellow:hover {
    background: linear-gradient(145deg, #f49c22, #f67e32);
    box-shadow: 
        0 6px 12px rgba(243, 156, 18, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.remote-purple {
    background: linear-gradient(145deg, #9b59b6, #8e44ad);
}

.remote-purple:hover {
    background: linear-gradient(145deg, #ab59c6, #9e44bd);
}

.remote-orange {
    background: linear-gradient(145deg, #ff9800, #f57c00);
}

.remote-orange:hover {
    background: linear-gradient(145deg, #ffa800, #f68c00);
    box-shadow: 
        0 6px 12px rgba(255, 152, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.remote-grey {
    background: linear-gradient(145deg, #7f8c8d, #6c7b7d);
}

.remote-grey:hover {
    background: linear-gradient(145deg, #8f9c9d, #7c8b8d);
    box-shadow: 
        0 6px 12px rgba(127, 140, 141, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Inputs de la télécommande */
.filter-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.remote-input {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #444;
    border-radius: 8px;
    padding: 0.8rem;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.remote-input::placeholder {
    color: #888;
}

.remote-input:focus {
    outline: none;
    border-color: #00bcd4;
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
    background: rgba(0, 0, 0, 0.5);
}

/* Styles pour les listes déroulantes */
.dropdown-container {
    position: relative;
    width: 100%;
}

.dropdown-input {
    width: 100%;
    box-sizing: border-box;
}

/* Styles pour select searchable */
.select-searchable-wrapper {
    position: relative;
    width: 100%;
}

.select-searchable-input {
    width: 100%;
    cursor: pointer;
    padding-right: 2.5rem;
}

.select-searchable-arrow {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #888;
    font-size: 0.7rem;
}

.select-searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #444;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.select-searchable-search {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-bottom: 1px solid #444;
    color: white;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.select-searchable-search:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
}

.select-searchable-search::placeholder {
    color: #888;
}

.select-searchable-options {
    max-height: 250px;
    overflow-y: auto;
}

.select-searchable-option {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #333;
    color: white;
    transition: all 0.2s;
}

.select-searchable-option:hover,
.select-searchable-option.highlighted {
    background: rgba(0, 188, 212, 0.2);
    color: #00bcd4;
}

.select-searchable-option:last-child {
    border-bottom: none;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00bcd4;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.dropdown-list.show {
    display: block;
}

.dropdown-item {
    padding: 0.8rem;
    color: white;
    cursor: pointer;
    border-bottom: 1px solid #333;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: rgba(0, 188, 212, 0.2);
    color: #00bcd4;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item.highlighted {
    background: rgba(0, 188, 212, 0.3);
    color: #00bcd4;
}

.dropdown-no-results {
    padding: 0.8rem;
    color: #888;
    font-style: italic;
    text-align: center;
}
/* Items de la liste de suggestions (familles) */
.dropdown-list .dropdown-item {
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    color: #333;
}
.dropdown-list .dropdown-item:last-child { border-bottom: 0; }
.dropdown-list .dropdown-item:hover {
    background: rgba(0,128,0,0.08);
    color: #008000;
}
.table-toolbar .btn.btn-secondary {
    background: #f3f7f5;
    border: 1px solid #d4e6d9;
    color: #2f855a;
}
.table-toolbar .btn.btn-secondary:hover {
    background: #e6f3ec;
}

/* Dropdown list for toolbar search */
.dropdown-list {
    position: absolute;
    margin-top: 0.25rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    width: 320px;
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}
.dropdown-list.show { display: block; }
.search-group { position: relative; }

/* Responsive */
@media (max-width: 768px) {
    .remote-body {
        grid-template-columns: 1fr;
    }
    
    .remote-buttons {
        justify-content: center;
    }
    
    .remote-btn {
        min-width: 70px;
        padding: 0.6rem 1rem;
    }
    
    .remote-btn i {
        font-size: 1rem;
    }
    
    .remote-btn span {
        font-size: 0.7rem;
    }
}

.container {
    width: 100%;
    margin: 0;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    padding: 1rem 0.5rem;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.main-content.recap-layout {
    /* Plus large, et aligné en haut (pas centré verticalement) */
    max-width: 1700px;
    align-items: stretch;
    justify-content: flex-start;
}

.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.welcome-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Auth container */
.auth-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    margin-bottom: 2rem;
}

/* Tabs */
.auth-tabs {
    display: flex;
    background: #f8f9fa;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: #008000;
    border-bottom: 3px solid #008000;
}

/* Users admin page */
.users-admin {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 28px rgba(0,0,0,0.08);
}
.users-admin .users-table {
    width: 100%;
    border-collapse: collapse;
}
.users-admin .users-table thead th {
    text-align: left;
    font-weight: 600;
    padding: 0.8rem;
    border-bottom: 2px solid #e9ecef;
}
.users-admin .users-table tbody td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #f1f3f5;
}
.users-admin input[type="text"],
.users-admin input[type="email"],
.users-admin select {
    width: 100%;
    border: 1px solid #dee2e6;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    outline: none;
}
.users-admin .icon-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #2f855a;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    margin-right: 0.35rem;
    cursor: pointer;
}
.users-admin .icon-btn:hover {
    background: #e9f7ef;
    border-color: #c3e6cb;
}

.tab-btn:hover:not(.active) {
    background: #e9ecef;
    color: #333;
}

/* Forms */
.auth-form {
    display: none;
    padding: 2rem;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group label i {
    color: #008000;
    width: 16px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #008000;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.1);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Override: compact banner return button (does not use full .btn sizing) */
.top-banner .banner-return-btn {
    width: auto !important;
    padding: 0.6rem 1.1rem;
    font-size: 1.05rem;
    border-radius: 6px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #008000 0%, #006400 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 128, 0, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 2px solid #d1d5db;
    color: #374151;
    width: auto;
    padding: 0.75rem 1.2rem;
}

.btn-outline.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.btn-warning {
    background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
    color: #7c2d12;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(245, 158, 11, 0.4);
}

.btn-warning:active {
    transform: translateY(0);
}

/* Messages */
.message {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    font-weight: 600;
    display: none;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    border-left: 6px solid transparent;
    display: none;
    align-items: center;
    gap: 10px;
}

.message.show { display: inline-flex; }

.message .msg-icon { font-size: 1.1rem; display: inline-flex; align-items: center; }
.message .msg-text { flex: 1; }

.message.success {
    background: linear-gradient(135deg, #e9f7ef, #d4edda);
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left-color: #28a745;
}

.message.error {
    background: linear-gradient(135deg, #fdecec, #f8d7da);
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left-color: #dc3545;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: white;
    opacity: 0.8;
}

/* Dashboard styles */
.dashboard {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 2rem;
    width: 100%;
    max-width: 1100px;
    margin-bottom: 2rem;
}

/* Header du dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.dashboard-title h2 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.dashboard-title p {
    color: #666;
    margin: 0;
    font-size: 1.1rem;
}

/* Menu profil en haut à droite */
.user-profile-dropdown {
    position: relative;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #008000 0%, #006400 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 128, 0, 0.2);
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 128, 0, 0.3);
}

.profile-menu {
    position: absolute;
    top: 60px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 1rem;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.profile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-info {
    padding-bottom: 1rem;
    border-bottom: 1px solid #f8f9fa;
    margin-bottom: 1rem;
}

.profile-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.profile-email {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.profile-role {
    color: #008000;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-btn {
    background: #f8f9fa;
    color: #333;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.profile-btn:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.logout-btn:hover {
    background: #c82333;
    transform: translateX(2px);
}

/* Responsive */
@media (max-width: 768px) {
    .banner-content {
        padding: 0 1rem;
    }
    
    .banner-text h1 {
        font-size: 1.5rem;
    }
    
    .banner-text p {
        font-size: 0.8rem;
    }
    
    .banner-logo i {
        font-size: 1.5rem;
    }
    
    .banner-logo {
        gap: 0.5rem;
    }
    
    .banner-profile .profile-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .welcome-section h2 {
        font-size: 2rem;
    }
    
    .auth-container {
        margin: 0 1rem;
    }
    
    .dashboard {
        margin: 0 1rem;
    }
    
    .container {
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-container,
.dashboard {
    animation: fadeIn 0.6s ease-out;
}

/* Loading state */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* Dashboard styles */
.dashboard-content h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.dashboard-content p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #008000;
    box-shadow: 0 10px 25px rgba(0, 128, 0, 0.1);
}

.stat-card i {
    font-size: 2.5rem;
    color: #008000;
    margin-bottom: 1rem;
}

.stat-card h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: #008000;
    margin: 0;
}

/* Styles pour la gestion du profil */
.profile-management {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.profile-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.profile-form h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.profile-stats {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.profile-stats h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.stat-item i {
    color: #008000;
    font-size: 1.5rem;
    width: 30px;
}

.stat-item strong {
    color: #333;
    display: block;
    margin-bottom: 0.2rem;
}

.stat-item p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Styles spécifiques pour la page de modification de magasin */
.edit-magasin-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.edit-magasin-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.edit-magasin-form {
    margin-top: 1.5rem;
}

.page-header {
    background: white;
    border-radius: 15px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.page-title h1 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Google brand button */
.btn-google {
    border: none;
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(#DB4437 100%);
    box-shadow: 0 8px 24px rgba(66, 133, 244, 0.25);
}
.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(66, 133, 244, 0.35);
}
.btn-google i {
    background: (#DB4437 100%);
    color: #4285F4;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.form-group small {
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: block;
}

/* Styles pour le dashboard */
.dashboard-actions {
    margin-bottom: 2rem;
    text-align: center;
}

/* Styles pour les mises à jour MAJ */
.maj-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.maj-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 2px solid transparent;
}

.maj-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: #008000;
}

.maj-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #008000, #00a000);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.maj-content {
    flex: 1;
}

.maj-content h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.maj-content p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.maj-stats {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

.maj-stats span {
    color: #008000;
    font-weight: 600;
    font-size: 0.9rem;
}

.maj-arrow {
    color: #008000;
    font-size: 1.2rem;
}

.maj-import-form {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.maj-info {
    margin-bottom: 2rem;
}

.info-card {
    background: #e8f5e8;
    border: 1px solid #008000;
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-card i {
    color: #008000;
    font-size: 1.2rem;
    margin-top: 0.2rem;
}

.info-card h4 {
    color: #008000;
    margin-bottom: 0.5rem;
}

.info-card p {
    color: #555;
    margin: 0;
}

.maj-file-upload {
    margin-bottom: 2rem;
}

.maj-history {
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

.maj-history h4 {
    color: #333;
    margin-bottom: 1rem;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.history-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.history-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.history-products {
    color: #008000;
    font-weight: 600;
}

.history-status {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.history-status.success {
    background: #d4edda;
    color: #155724;
}

.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Style pour la colonne VMM */
.vmm-cell {
    background: linear-gradient(135deg, #e8f5e8, #d4edda) !important;
    font-weight: 600;
    color: #155724;
    text-align: center;
}

.vmm-cell:not(:empty) {
    border-left: 3px solid #28a745;
    border-right: 3px solid #28a745;
}

/* Style pour la colonne Masse Marge */
.masse-marge-cell {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7) !important;
    font-weight: 600;
    color: #856404;
    text-align: center;
}

.masse-marge-cell:not(:empty) {
    border-left: 3px solid #ffc107;
    border-right: 3px solid #ffc107;
}

/* Disponibilité entrepôt - couleurs dans la cellule */
.dispo-cell {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.2rem 0;
    background-color: inherit !important;
}
.dispo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    background: #c4c4c4;
}
.dispo-low .dispo-dot { background: #d93025; }
.dispo-mid .dispo-dot { background: #a15c00; }
.dispo-high .dispo-dot { background: #137333; }
.dispo-label { color: #333; font-weight: 600; }

.dashboard-actions .btn {
    width: auto;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Carte cliquable */
.stat-card.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.stat-card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 128, 0, 0.2);
    border-color: #008000;
}

/* Logo cliquable */
.clickable-logo {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.5rem;
}

.clickable-logo:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.clickable-logo:hover i {
    transform: scale(1.1);
}

.clickable-logo i {
    transition: transform 0.3s ease;
}

.magasins-list {
    margin-top: 3rem;
}

.magasins-list h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.magasins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
}

.magasin-card {
    background: white;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    padding: 1.75rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.magasin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #2c7a2c, #28a745);
    opacity: 0.15;
    pointer-events: none; /* ne pas intercepter les clics */
}

.magasin-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,128,0,0.05), rgba(0,128,0,0));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none; /* ne pas intercepter les clics */
}

.magasin-card:hover {
    border-color: rgba(0,128,0,0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 128, 0, 0.12);
}

.magasin-card:hover::after {
    opacity: 1;
}

.magasin-card:hover::before {
    opacity: 0.35;
}

.magasin-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.magasin-header i {
    color: #1f7a1f;
    font-size: 1.4rem;
}

.magasin-header h4 {
    color: #1f2937;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.magasin-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.magasin-info p {
    color: #4b5563;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.magasin-info p i {
    color: #1f7a1f;
}

/* Meta badges (région / type) */
.magasin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.25rem 0 0.25rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
}

.badge i { font-size: 0.9rem; }

.badge-region {
    background: #e8f5e8;
    color: #1f7a1f;
    border: 1px solid #c7e8c7;
}

.badge-type {
    background: #eaf2ff;
    color: #205493;
    border: 1px solid #cfe1ff;
}

.badge-creator {
    background: #fde2e2; /* proche du style badge-region/type (fond clair) */
    color: #b02a37;      /* texte rouge foncé */
    border: 1px solid #f5c2c7; /* bordure légère comme les autres badges */
}

.badge-owner {
    background: #fff4cc;
    color: #a36b00;
    border: 1px solid #f0d98a;
}

.badge-shared {
    background: #e4f2ff;
    color: #0b6efd;
    border: 1px solid #bcdcff;
}

.badge-shared-count {
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
}

.badge-archived {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.magasin-created {
    color: #6b7280;
    font-size: 0.95rem;
}

.no-magasins {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-magasins i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.no-magasins p {
    margin: 0.5rem 0;
}

.no-magasins-archives {
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.no-magasins-archives p,
.no-magasins-archives i {
    color: #fff;
}

/* Styles pour la page des magasins */
.magasins-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1rem;
    padding-top: 0.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.page-title h2 {
    color: #333;
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
}

.page-title p {
    color: #666;
    margin: 0;
    font-size: 1rem;
}

.magasins-page .dashboard {
    background: transparent;
}

/* Styles pour le formulaire de création de magasin */
.create-magasin-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid #e9ecef;
    max-width: 600px;
    margin: 0 auto;
}

/* Dans .magasins-page, ".create-magasin-form" sert souvent de carte (liste/tableaux).
   On l'élargit et on passe sur un style "card" blanc sans impacter la page "Nouveau magasin"
   (qui n'est pas rendue dans .magasins-page). */
.magasins-page .create-magasin-form {
    max-width: 1100px;
    background: #fff;
    border: 1px solid #e9ecef;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Variante large (ex: fiche projet Coordinateur) */
.create-magasin-form.create-magasin-form-wide {
    max-width: 1100px;
}

/* Tables génériques (utilisées hors admin) */
.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

/* Fix ciblé: certains styles globaux peuvent casser l'ordre THEAD/TBODY.
   On force le modèle "table" uniquement pour le tableau Coordinateur. */
#coordFamiliesTable {
    display: table !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
    width: 100% !important;
    /* FORCER l'ordre d'affichage: thead avant tbody */
    table-layout: fixed !important;
    /* IMPORTANT: la div parent scrolle (overflow-y:auto).
       Si la table a overflow!=visible, sticky se “cale” sur la table et ne marche pas. */
    overflow: visible !important;
}
#coordFamiliesTable thead { 
    display: table-header-group !important; 
    /* Important: le sticky est porté par les TH (plus fiable cross-browser) */
    position: static !important;
    vertical-align: top !important;
    background: #f8f9fa !important;
}
#coordFamiliesTable thead tr {
    display: table-row !important;
    position: relative !important;
}
#coordFamiliesTable tbody { 
    display: table-row-group !important; 
    position: relative !important;
    z-index: 1 !important;
}
#coordFamiliesTable tbody tr {
    z-index: 1 !important;
}
#coordFamiliesTable tbody td {
    z-index: 1 !important;
    position: relative !important;
}
#coordFamiliesTable tr { 
    display: table-row !important; 
}
#coordFamiliesTable th,
#coordFamiliesTable td { 
    display: table-cell !important; 
}
.users-table thead th {
    text-align: left;
    font-weight: 600;
    padding: 0.8rem;
    border-bottom: 2px solid #dee2e6;
    background: #f8f9fa;
    color: #495057;
}

/* En-têtes collants (utile quand la table est dans un conteneur scrollable) */
.users-table.sticky-header thead th {
    position: sticky !important;
    top: 0 !important;
    /* Important: rester AU-DESSUS des inputs/lignes (sinon l'entête se fait recouvrir) */
    z-index: 1001 !important;
    background: #f8f9fa !important;
    background-clip: padding-box !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
/* Fix spécifique: s'assurer que le thead reste TOUJOURS au-dessus du tbody */
#coordFamiliesTable {
    display: table !important;
    table-layout: auto !important;
}
#coordFamiliesTable thead {
    display: table-header-group !important;
    /* Important: le sticky est porté par les TH (plus fiable cross-browser) */
    position: static !important;
    background: #f8f9fa !important;
    margin: 0 !important;
    /* S'assurer que le thead est toujours rendu en premier */
    vertical-align: top !important;
}
#coordFamiliesTable tbody {
    display: table-row-group !important;
    vertical-align: top !important;
}
#coordFamiliesTable thead th {
    position: sticky !important;
    /* Dans une div scrollable, l'entête doit coller en haut de la div (pas sous le bandeau global) */
    top: 0 !important;
    z-index: 1003 !important;
    background: #f8f9fa !important;
    background-clip: padding-box !important;
    color: #495057 !important;
    border-bottom: 2px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    padding: 0.8rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
}
.users-table tbody td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #f1f3f5;
    background: #fff;
    vertical-align: middle;
}
.users-table tbody tr:last-child td {
    border-bottom: none;
}
.users-table tbody tr:hover td {
    background: #f8fafc;
}
.users-table input[type="text"],
.users-table input[type="number"] {
    width: 100%;
    border: 1px solid #dee2e6;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    font-size: 0.95rem;
}
.users-table input[readonly] {
    background: #f1f3f5;
}

/* Badges dans les tableaux (ex: statut pending_coord) */
.users-table .badge {
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
}
.icon-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #2f855a;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
}
.icon-btn:hover {
    background: #e9f7ef;
    border-color: #c3e6cb;
}

.create-magasin-form h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Styles pour la page des produits */
.products-page {
    max-width: 1400px;
    margin: 0 auto;
}

.products-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.filter-group input {
    padding: 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
}

.filter-group input:focus {
    border-color: #008000;
    outline: none;
}

.products-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.table-loading i {
    font-size: 2rem;
    color: #008000;
    margin-bottom: 1rem;
}

.products-table-wrapper {
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
}

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

.products-table th {
    background: #f8f9fa;
    padding: 1rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.products-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

/* Colonnes de fin (potentiel / origines / codes / dates) plus compactes */
.products-table th:nth-last-child(-n+5),
.products-table td:nth-last-child(-n+5) {
    width: 120px;
    min-width: 100px;
    white-space: nowrap;
}

.products-table th:nth-last-child(-n+2),
.products-table td:nth-last-child(-n+2) {
    width: 110px;
    min-width: 90px;
    text-align: center;
}

.products-table tr:hover:not(.row-arret):not(.row-switch) {
    background-color: #f8f9fa;
}

/* Alternance lignes pour lisibilité */
.products-table tbody tr:nth-child(odd):not(.row-arret):not(.row-switch) {
    background: #ffffff;
}
.products-table tbody tr:nth-child(even):not(.row-arret):not(.row-switch) {
    background: #fdfdfd;
}

/* Améliorer l'entête sombre de la page créations */
.products-page .remote-header {
    background: #2b2b2b;
    color: white;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.products-page .remote-header h3 {
    color: white;
}

/* Toolbar au-dessus de la table */
.table-toolbar {
    width: 100%;
    margin: 0.75rem 0 0.5rem 0;
    display: flex;
    justify-content: space-between;
}
.table-search-overlay {
    position: fixed;
    top: 90px;
    right: 32px;
    background: rgba(17, 24, 39, 0.95);
    color: #fff;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    display: none;
    align-items: center;
    gap: 0.6rem;
    z-index: 1200;
    min-width: 280px;
}
.table-search-overlay input {
    flex: 1;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 0.4rem 0.45rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.table-search-overlay input::placeholder {
    color: rgba(255,255,255,0.6);
}
.table-search-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.table-search-controls button {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}
.table-search-controls button:hover {
    background: rgba(255,255,255,0.25);
}
.table-search-count {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    min-width: 54px;
    text-align: center;
}
.search-hit {
    background: #fef08a !important;
    color: #111827 !important;
    position: relative;
}
.search-hit-active {
    background: #fde047 !important;
    box-shadow: 0 0 0 2px #facc15 inset;
}
.search-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}
.search-group i { color: #008000; }
.search-input {
    border: none;
    outline: none;
    width: 240px;
}

.product-image-cell {
    width: 60px;
    text-align: center;
}

.product-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin: 0 auto;
}

.product-image:hover {
    transform: scale(1.1);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.description-cell {
    max-width: 200px;
    word-wrap: break-word;
}

.no-products {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-products i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.pagination-controls .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.pagination-controls .btn.active {
    background: #008000;
    color: white;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

/* Modal pour l'image */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 1.5rem 1.5rem 1rem 1.5rem;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(0,0,0,0.8);
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
}

/* Mise en forme de la modale générique (utilisée pour changement MDP) */
.modal-content h3 {
    margin: 0 0 1.25rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}
.modal-content .form-group {
    margin: 0 0 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.modal-content .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 0.25rem;
}
.modal-content .form-group input[type="password"],
.modal-content .form-group input[type="text"],
.modal-content .form-group input[type="email"],
.modal-content .form-group select,
.modal-content .form-group .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 1rem;
    transition: all 0.2s ease;
}
.modal-content .form-group select:focus,
.modal-content .form-group .form-control:focus {
    outline: none;
    border-color: #008000;
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.15);
}
.modal-content .form-group small {
    color: #6c757d;
}
.modal-content .form-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 0 0 0;
    margin-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Styles pour la liste des groupes de familles avec checkboxes */
.groupe-famille-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.groupe-famille-item:hover {
    background: #e8f5e8;
    border-color: #c3e6cb;
    transform: translateX(2px);
}

.groupe-famille-item input[type="checkbox"] {
    margin-right: 1rem;
    cursor: pointer;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.groupe-famille-item label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    user-select: none;
    font-size: 0.95rem;
    line-height: 1.4;
}

#groupeFamillesList {
    max-height: 400px;
    min-height: 250px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem;
    background: #f8f9fa;
}

#groupeFamillesList::-webkit-scrollbar {
    width: 8px;
}

#groupeFamillesList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#groupeFamillesList::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#groupeFamillesList::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.modal-content .btn-sm {
    margin-left: auto;
}

/* Styles pour select searchable dans la modal (fond blanc) */
.modal-content .select-searchable-dropdown {
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
}

.modal-content .select-searchable-search {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #333;
}

.modal-content .select-searchable-search:focus {
    background: white;
    border-bottom-color: #008000;
}

.modal-content .select-searchable-option {
    color: #333;
    border-bottom: 1px solid #f1f3f5;
}

.modal-content .select-searchable-option:hover,
.modal-content .select-searchable-option.highlighted {
    background: #e8f5e8;
    color: #008000;
}

/* Modale de partage magasin */
.share-modal {
    max-width: min(520px, 92vw);
    padding: 2rem 2rem 1.5rem;
    background: #ffffff;
}

.share-modal h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem 0;
    color: #1f2933;
}

.share-modal h3 i {
    color: #0b6efd;
}

.share-magasin-details {
    background: #f8f9fa;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.share-summary p {
    margin: 0 0 0.35rem;
    color: #425466;
}

.share-summary .share-count {
    font-size: 0.9rem;
    color: #0b7285;
}

.share-magasin-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-magasin-form label {
    font-weight: 600;
    color: #344054;
}

.share-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-input-row input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.share-input-row input:focus {
    outline: none;
    border-color: #0b6efd;
    box-shadow: 0 0 0 3px rgba(11, 110, 253, 0.15);
}

.share-help {
    font-size: 0.8rem;
    color: #6c757d;
}

.share-magasin-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 260px;
    overflow-y: auto;
}

.share-item {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #e1e6ef;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.share-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.share-item-name {
    font-weight: 600;
    color: #1f2933;
}

.share-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #55606f;
}

.share-item-email,
.share-item-role {
    background: #eef1f6;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.share-item-email {
    background: #eef5ff;
    color: #0b6efd;
}

.share-item-role {
    background: #f3f4f6;
    color: #495057;
}

.share-item-sharedby {
    color: #66758f;
}

.share-error,
.share-empty {
    text-align: center;
    color: #6c757d;
    font-size: 0.95rem;
}

.share-empty i {
    margin-right: 0.35rem;
    color: #0b6efd;
}

.share-owner-email {
    font-size: 0.85rem;
    color: #51606f;
    margin-left: 0.35rem;
}

.share-remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #dc3545;
    color: #dc3545;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.share-remove-btn:hover {
    background: #dc3545;
    color: white;
}

/* Styles pour la page des produits */
.products-page {
    padding: 1rem 0;
    width: 100%;
    max-width: none;
}

/* Page des produits en pleine largeur */
.main-content.products-layout {
    max-width: none;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0 0.5rem;
}

.products-filters {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 128, 0, 0.1);
    border: 1px solid rgba(0, 128, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.filter-group input {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-group input:focus {
    outline: none;
    border-color: #008000;
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.1);
}

.table-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
}

.table-loading i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    color: #008000;
}

.products-table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 128, 0, 0.1);
    border: 1px solid rgba(0, 128, 0, 0.1);
    margin-bottom: 1.5rem;
}

.products-table-wrapper {
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
}

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

.products-table th {
    background: linear-gradient(135deg, #2c5530 0%, #1a3d1e 100%);
    color: white;
    padding: 1.2rem 0.8rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.products-table td {
    padding: 1rem 0.8rem;
    border-bottom: 1px solid rgba(0, 128, 0, 0.1);
    vertical-align: top;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Indicateurs visuels pour filtres et tri actifs sur les en-têtes */
.products-table th .th-menu-btn {
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: 3px;
}

.products-table th .th-menu-btn:hover {
    background: rgba(44, 123, 229, 0.1);
}

.products-table th .th-menu-btn.filter-active {
    color: #2c7be5 !important;
    background: rgba(44, 123, 229, 0.15);
}

.products-table th .th-menu-btn.sort-active {
    font-weight: bold !important;
    color: #006400 !important;
}

.products-table th .th-menu-btn.filter-active.sort-active {
    color: #2c7be5 !important;
    background: rgba(44, 123, 229, 0.2);
    border: 1px solid rgba(44, 123, 229, 0.3);
}

/* Largeurs stables par colonne (thead + tbody) */
.products-table th[data-sort="rayon"], .products-table td.col-rayon { min-width: 140px; }
.products-table th[data-sort="groupe_familles"], .products-table td.col-groupe { min-width: 180px; }
.products-table th[data-sort="famille"], .products-table td.col-famille { min-width: 180px; }
.products-table th[data-sort="sous_famille"], .products-table td.col-sousfamille { min-width: 200px; }
.products-table th[data-sort="description"], .products-table td.col-description { min-width: 260px; word-break: break-word; }
.products-table th[data-sort="assort"], .products-table td.col-assort { min-width: 100px; }
.products-table th[data-sort="quantite"], .products-table td.col-quantite { min-width: 120px; }
.products-table th[data-sort="vmm_ventes_mensuelles"], .products-table td.col-vmm { min-width: 130px; }
.products-table th[data-sort="masse_marge"], .products-table td.col-massemarge { min-width: 130px; }
.products-table th[data-sort="ean"], .products-table td.col-ean { min-width: 150px; }
.products-table th[data-sort="disponibilite_entrepot"], .products-table td.col-dispo { min-width: 170px; }
.products-table th[data-sort="marque"], .products-table td.col-marque { min-width: 140px; }
.products-table th[data-sort="type_marque"], .products-table td.col-type-marque { min-width: 130px; }
.products-table th[data-sort="tva"], .products-table td.col-tva { min-width: 80px; }
.products-table th[data-sort="pa"], .products-table td.col-pa { min-width: 110px; }
.products-table th[data-sort="pv"], .products-table td.col-pv { min-width: 110px; }
.products-table th[data-sort="marge_euro"], .products-table td.col-marge-euro { min-width: 120px; }
.products-table th[data-sort="min_cde"], .products-table td.col-mincde { min-width: 100px; }
.products-table th[data-sort="marge"], .products-table td.col-marge { min-width: 100px; }
.products-table th:nth-child(20), .products-table td.col-ifls { min-width: 80px; } /* IFLS (non trié) */
.products-table th:nth-child(21), .products-table td.col-potentiel { min-width: 120px; } /* Potentiel vtes (non trié) */
.products-table th[data-sort="origine_assortiment"], .products-table td.col-origine { min-width: 160px; }
.products-table th[data-sort="code_entrepot"], .products-table td.col-code-entrepot { min-width: 130px; }
.products-table th:nth-last-child(2), .products-table td.col-date-commande { min-width: 140px; } /* Date commande (non trié) */
.products-table th[data-sort="date_derniere_cde"], .products-table td.col-date-derniere { min-width: 150px; }

/* Mode créatif - Réorganisation des colonnes */
.products-table.creative-mode th.draggable-column {
    cursor: move;
    user-select: none;
    position: relative;
}

.products-table.creative-mode th.draggable-column:hover {
    background: linear-gradient(135deg, #3a6b3f 0%, #2a4d2e 100%);
}

.products-table.creative-mode th.draggable-column::before {
    content: '⋮⋮';
    position: absolute;
    left: 4px;
    font-size: 0.7rem;
    opacity: 0.6;
    line-height: 1;
}

.products-table.creative-mode th.draggable-column:active {
    opacity: 0.7;
}

/* Mode créatif - Indicateurs visuels drag & drop */
.products-table.creative-mode th.dnd-dragging {
    opacity: 0.6;
}

.products-table.creative-mode th.dnd-drop-target {
    outline: 2px solid rgba(44, 123, 229, 0.55);
    outline-offset: -2px;
}

.products-table.creative-mode th.dnd-drop-before {
    box-shadow: inset 4px 0 0 rgba(44, 123, 229, 0.95);
}

.products-table.creative-mode th.dnd-drop-after {
    box-shadow: inset -4px 0 0 rgba(44, 123, 229, 0.95);
}

/* Mode créatif - Redimensionnement des colonnes */
.products-table.creative-mode th.resizable-column {
    padding-right: 14px; /* laisser la place à la poignée */
}

.products-table.creative-mode th.resizable-column .col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    background: rgba(255, 255, 255, 0);
}

.products-table.creative-mode th.resizable-column .col-resizer:hover {
    background: rgba(255, 255, 255, 0.18);
}

body.col-resize-active {
    cursor: col-resize !important;
    user-select: none;
}

.remote-btn.active {
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.6) !important;
    transform: scale(1.05);
}

/* Mise en avant de la colonne Quantité (lignes seulement) */
.products-table td.qty-cell {
    background: #f4fbf4;
    font-weight: 600;
}

/* Quantité origine (algo assort) */
.q-algo {
    background: #e8f5e9 !important;
    color: #1b5e20;
}

/* Quantité origine (TOP BIO) - Vert */
.q-top-bio {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #166534 !important;
    font-weight: 700;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Quantité origine (TOP 500/300) - Bleu */
.q-top-500-300 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    color: #1e40af !important;
    font-weight: 700;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Fallback pour compatibilité */
.q-top {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
}

/* Styles pour le mode d'édition UB */
.ub-cell {
    position: relative;
    min-width: 200px;
}

.ub-display {
    padding: 0.25rem 0;
}

.ub-edit {
    width: 100%;
    position: relative;
}

.ub-edit[style*="display: block"] {
    display: block !important;
}

.ub-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 32px;
}

.ub-search-input {
    flex: 1;
    padding: 0.4rem 2.5rem 0.4rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.ub-search-input:focus {
    outline: none;
    border-color: #008000;
    box-shadow: 0 0 0 2px rgba(0, 128, 0, 0.1);
}

.ub-dropdown-btn {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: #008000;
    border: none;
    border-radius: 4px;
    color: white;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
    min-width: 24px;
    min-height: 24px;
}

.ub-dropdown-btn:hover {
    background: #006400;
}

.ub-dropdown-btn i {
    font-size: 0.75rem;
}

.ub-dropdown-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1400px;
    height: 85vh;
    max-height: 900px;
    background: white;
    border: 3px solid #008000;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 10000;
    display: none;
    flex-direction: column;
}

.ub-modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #008000 0%, #006400 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 3px solid #006400;
}

.ub-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.ub-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ub-modal-clear {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

.ub-modal-clear:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.ub-modal-clear i {
    font-size: 0.9rem;
}

.ub-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.ub-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.ub-create-section {
    padding: 1.5rem;
    background: #f0f8f0;
    border-bottom: 2px solid #008000;
    flex-shrink: 0;
}

.ub-create-section h4 {
    margin: 0 0 1rem 0;
    color: #006400;
    font-size: 1.1rem;
    font-weight: 600;
}

.ub-create-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.ub-create-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #008000;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.ub-create-input:focus {
    outline: none;
    border-color: #006400;
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.1);
}

.ub-create-btn {
    background: #008000;
    border: none;
    border-radius: 6px;
    color: white;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

.ub-create-btn:hover {
    background: #006400;
    transform: translateY(-1px);
}

.ub-create-btn:active {
    transform: translateY(0);
}

.ub-dropdown-menu .ub-search-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 2px solid #008000;
    flex-shrink: 0;
}

.ub-dropdown-menu .ub-search-header input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #008000;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.ub-dropdown-menu .ub-search-header input:focus {
    outline: none;
    border-color: #006400;
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.1);
}

.ub-dropdown-menu .ub-options-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.ub-dropdown-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1rem;
    transition: background 0.2s;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ub-item-text {
    flex: 1;
    cursor: pointer;
}

.ub-dropdown-item:hover {
    background: #e8f5e9;
    color: #006400;
}

.ub-dropdown-item:hover .ub-item-text {
    font-weight: 500;
}

.ub-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.ub-edit-btn {
    background: transparent;
    border: none;
    color: #008000;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.6;
}

.ub-edit-btn:hover {
    background: rgba(0, 128, 0, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.ub-edit-btn:active {
    transform: scale(0.95);
}

.ub-rename-input {
    box-sizing: border-box;
}

.ub-delete-btn {
    background: transparent;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.6;
}

.ub-delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.ub-delete-btn:active {
    transform: scale(0.95);
}

.ub-dropdown-item:last-child {
    border-bottom: none;
}

.ub-dropdown-empty {
    color: #999;
    font-style: italic;
    text-align: center;
    cursor: default;
    padding: 2rem;
    font-size: 1.1rem;
}

.ub-dropdown-empty:hover {
    background: transparent;
}

/* Overlay pour le menu UB plein écran */
.ub-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.ub-dropdown-overlay.active {
    display: block;
}

@keyframes flash-green {
    0%, 100% {
        background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
        box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    }
    50% {
        background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
        box-shadow: 0 4px 16px rgba(34, 197, 94, 0.5);
    }
}

@keyframes flash-blue {
    0%, 100% {
        background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
    50% {
        background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5);
    }
}

/* Lignes entières pour TOP BIO - Vert */
tr.row-top-bio {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
}
tr.row-top-bio td {
    background: transparent !important;
    border-color: rgba(34, 197, 94, 0.2) !important;
}
tr.row-top-bio td.qty-cell {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #166534 !important;
    font-weight: 700;
}

/* Traits colorés sur les colonnes ventes mensuelles et masse marge pour TOP BIO */
tr.row-top-bio td.vmm-cell,
tr.row-top-bio td.masse-marge-cell {
    border-left: 4px solid #22c55e !important;
    border-right: 4px solid #22c55e !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* Lignes entières pour TOP 500/300 - Bleu */
tr.row-top-500-300 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
}
tr.row-top-500-300 td {
    background: transparent !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}
tr.row-top-500-300 td.qty-cell {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    color: #1e40af !important;
    font-weight: 700;
}

/* Traits colorés sur les colonnes ventes mensuelles et masse marge pour TOP 500/300 */
tr.row-top-500-300 td.vmm-cell,
tr.row-top-500-300 td.masse-marge-cell {
    border-left: 4px solid #3b82f6 !important;
    border-right: 4px solid #3b82f6 !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* Lignes entières pour TAN-A (Assort=A et Origine=TAN) - Rose */
tr.row-tan-a {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%) !important;
}
tr.row-tan-a td {
    background: transparent !important;
    border-color: rgba(236, 72, 153, 0.2) !important;
}
tr.row-tan-a td.qty-cell {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%) !important;
    color: #9f1239 !important;
    font-weight: 700;
}

/* Traits colorés sur les colonnes ventes mensuelles et masse marge pour TAN-A */
tr.row-tan-a td.vmm-cell,
tr.row-tan-a td.masse-marge-cell {
    border-left: 4px solid #ec4899 !important;
    border-right: 4px solid #ec4899 !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* Quantité origine (TAN-A) - Rose */
.q-tan-a {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%) !important;
    color: #9f1239 !important;
    font-weight: 700;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Forcer la couleur des colonnes quantité/quali sur arrêts & switch */
tr.row-arret td.q-algo,
tr.row-arret td.q-top,
tr.row-arret td.q-top-bio,
tr.row-arret td.q-top-500-300,
tr.row-arret td.q-tan-a,
tr.row-switch td.q-algo,
tr.row-switch td.q-top,
tr.row-switch td.q-top-bio,
tr.row-switch td.q-top-500-300,
tr.row-switch td.q-tan-a,
tr.row-arret td.qty-cell,
tr.row-switch td.qty-cell {
    background: rgba(239, 68, 68, 0.15) !important;
    color: inherit;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}
tr.row-switch td.q-algo,
tr.row-switch td.q-top,
tr.row-switch td.q-top-bio,
tr.row-switch td.q-top-500-300,
tr.row-switch td.q-tan-a,
tr.row-switch td.qty-cell {
    background: rgba(245, 158, 11, 0.15) !important;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Annuler les styles de ligne TOP et TAN-A si c'est un switch ou arrêt */
tr.row-arret.row-top-bio,
tr.row-arret.row-top-500-300,
tr.row-arret.row-tan-a,
tr.row-switch.row-top-bio,
tr.row-switch.row-top-500-300,
tr.row-switch.row-tan-a {
    background: inherit !important;
}
tr.row-arret.row-top-bio td,
tr.row-arret.row-top-500-300 td,
tr.row-arret.row-tan-a td,
tr.row-switch.row-top-bio td,
tr.row-switch.row-top-500-300 td,
tr.row-switch.row-tan-a td {
    background: inherit !important;
    border-color: inherit !important;
}

/* Input quantité autosave feedback */
.q-input {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.25rem 0.35rem;
}
.q-input.saved-ok {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40,167,69,0.15);
}
.q-input.saved-err {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.15);
}

.products-table tbody tr:hover:not(.row-arret):not(.row-switch) {
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5e8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 128, 0, 0.1);
    transition: all 0.2s ease;
}

.products-table tbody tr:nth-child(even):not(.row-arret):not(.row-switch) {
    background-color: #fafbfc;
}

.products-table tbody tr:nth-child(even):hover:not(.row-arret):not(.row-switch) {
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5e8 100%);
}

.product-image-cell {
    width: 60px;
    padding: 0.5rem !important;
}

.product-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid #e1e5e9;
}

.product-image:hover {
    transform: scale(1.1);
    border-color: #008000;
}

/* Sélection en masse (sans checkboxes) */
.products-table tbody tr[data-product-id] {
    cursor: pointer;
    user-select: none;
}

.products-table tbody tr.row-selected {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    border-left: 4px solid #28a745 !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3) !important;
}

.products-table tbody tr.row-selected td {
    background: transparent !important;
}

.products-table tbody tr.row-selected:hover {
    background: linear-gradient(135deg, #c3e6cb 0%, #b1dfbb 100%) !important;
}

/* Ligne focus (navigation clavier) */
.products-table tbody tr.row-focused {
    outline: 2px solid rgba(0, 188, 212, 0.9);
    outline-offset: -2px;
}

.products-table tbody tr.row-selected.row-focused {
    outline: 3px solid rgba(0, 188, 212, 1);
    outline-offset: -3px;
}

/* Barre d'actions en masse */
.bulk-actions-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.bulk-actions-info {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-actions-info small {
    font-weight: 400;
    opacity: 0.9;
    font-size: 0.85rem;
}

.bulk-actions-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bulk-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

.bulk-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.bulk-action-btn:active {
    transform: translateY(0);
}

.bulk-action-btn i {
    font-size: 0.9rem;
}

.recap-page {
    max-width: 1700px;
    margin: 0 auto;
    padding: 1rem;
}

.recap-hero {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.recap-hero h2 {
    margin: 0 0 0.35rem 0;
    font-size: 1.2rem;
}

.recap-hero p {
    margin: 0;
    color: #555;
    line-height: 1.4;
}

.recap-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 920px) {
    .recap-grid {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.recap-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.recap-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.05rem;
}

.recap-bars {
    display: grid;
    gap: 0.55rem;
}

.recap-bar-row {
    display: grid;
    grid-template-columns: 170px 1fr 90px;
    gap: 0.75rem;
    align-items: center;
}

.recap-bar-label {
    color: #333;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recap-bar-track {
    height: 10px;
    background: #f1f3f5;
    border-radius: 999px;
    overflow: hidden;
}

.recap-bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 999px;
}

.recap-bar-value {
    text-align: right;
    color: #333;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.recap-pies {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.recap-pie-wrap {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
}

.recap-pie-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 680px) {
    .recap-pie-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

.recap-mini {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.75rem 0.9rem 0.75rem;
    border: 1px solid #f1f3f5;
    border-radius: 12px;
    overflow: hidden; /* évite que la légende déborde sur la carte voisine */
}

.recap-mini-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1f2937;
    text-align: center;
}

.recap-mini-subtitle {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: -0.15rem;
    text-align: center;
}

.recap-mini svg {
    max-width: 100%;
    height: auto;
}

.recap-mini .recap-legend {
    max-width: 100%;
    font-size: 0.82rem;
}

.recap-mini .recap-mini-legend-item {
    width: 100%;
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    row-gap: 0.15rem;
    align-items: center;
    padding-right: 0.25rem; /* évite que le % soit “coupé” au bord */
}

.recap-mini .recap-mini-legend-item .recap-dot {
    grid-row: 1 / span 2;
}

.recap-mini .recap-mini-legend-label {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    white-space: nowrap; /* on garde "Couverture" intact */
    overflow: hidden;
    text-overflow: ellipsis;
}

.recap-mini .recap-mini-legend-value {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    white-space: nowrap;
}

.recap-mini .recap-legend-item strong {
    white-space: nowrap;
}

.recap-legend {
    width: 100%;
    display: grid;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.recap-legend-item {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.recap-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.recap-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.recap-muted {
    color: #666;
    font-size: 0.9rem;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.description-cell {
    max-width: 200px;
    word-wrap: break-word;
    line-height: 1.4;
}

.no-products {
    text-align: center;
    padding: 3rem !important;
    color: #666;
}

.no-products i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
    display: block;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 128, 0, 0.1);
    border: 1px solid rgba(0, 128, 0, 0.1);
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-controls .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-width: 40px;
}

.pagination-controls .btn.active {
    background: linear-gradient(135deg, #008000 0%, #006400 100%);
    color: white;
    border: none;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive pour la gestion du profil */
@media (max-width: 768px) {
    .profile-management {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .profile-menu {
        right: -50px;
    }
    
    .magasins-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-actions .btn {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    .products-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .products-table {
        font-size: 0.75rem;
    }
    
    .products-table th,
    .products-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .description-cell {
        max-width: 150px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}
