/* =========================================================================================
 *  ██████╗  ██████╗ ███╗   ███╗███╗   ███╗ █████╗ ███╗   ██╗██████╗     ██╗ ██████╗ ██╗  ██╗███████╗██████╗ 
 * ██╔════╝ ██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗  ██║██╔══██╗    ██║██╔═══██╗██║ ██╔╝██╔════╝██╔══██╗
 * ██║  ███╗██║   ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║  ██║    ██║██║   ██║█████╔╝ █████╗  ██████╔╝
 * ██║   ██║██║   ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║  ██║    ██║██║   ██║██╔═██╗ ██╔══╝  ██╔══██╗
 * ╚██████╔╝╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║  ██║██║ ╚████║██████╔╝██╗  ██║╚██████╔╝██║  ██╗███████╗██║  ██║
 *  ╚═════╝  ╚═════╝ ╚═╝     ╚═╝╚═╝     ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝╚═════╝ ╚═╝  ██║ ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝
 *                                                                        ╚════╝                              
 * -----------------------------------------------------------------------------------------
 *  APPLICATION COMMAND JOKER - STYLES & DESIGN SYSTEM FRONT-END
 * -----------------------------------------------------------------------------------------
 *  Entreprise   : Société JOKER - Solutions Chèques & Titres Spécialisés
 *  Charte       : Palette Officielle (Rouge Joker #d41f26, Bleu Cadeaux #0075be, Vert Habillement #008e4d)
 *  Ergonomie    : Rendu fluide 60 FPS, Design Moderne, Typographie Plus Jakarta Sans,
 *                 Responsive 100% Adaptatif (Mobile, Tablette, Desktop) & Optimisation Print.
 * ========================================================================================= */

/* =========================================================================================
 * SECTION 1 : VARIABLES CSS & PALETTE OFFICIELLE SOCIÉTÉ JOKER
 * ========================================================================================= */
:root {
  --primary: #d41f26;
  --primary-light: #e62b32;
  --primary-dark: #b0141a;
  --secondary: #111827;
  --success: #10b981;
  --success-dark: #047857;
  --warning: #f59e0b;
  --danger: #ef4444;
  --repas: #d41f26;
  --cadeaux: #0075be;
  --habillement: #008e4d;
  --bg-page: #f9fafb;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== BARRE DE NAVIGATION ==================== */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.nav-container {
  max-width: 1600px;
  width: 96%;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

/* Logo de la société dans la barre de menu */
.brand-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s;
}

.brand-logo:hover {
  transform: scale(1.03);
}

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

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-menu {
  display: flex;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.nav-tab.active {
  background: var(--primary);
  color: #ffffff;
}

.nav-tab.admin-tab-btn {
  background: #f1f5f9;
  color: var(--secondary);
}

.nav-tab.admin-tab-btn.active {
  background: var(--secondary);
  color: #ffffff;
}

.badge-count {
  background: var(--danger);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ==================== AUTH CLIENT NAVIGATION ==================== */
.nav-auth-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-login-btn {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
  background: #fef2f2 !important;
  transition: all 0.2s;
}

.nav-login-btn:hover {
  background: var(--primary) !important;
  color: white !important;
}

.user-profile-badge {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-profile-badge.hidden {
  display: none;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-code {
  font-size: 0.72rem;
  color: #15803d;
}

.btn-logout {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px;
  border-radius: 4px;
  transition: transform 0.15s;
}

.btn-logout:hover {
  transform: scale(1.15);
}

.btn-profile-pwd {
  background: transparent;
  border: none;
  color: #0284c7;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px;
  border-radius: 4px;
  transition: transform 0.15s, color 0.15s;
}

.btn-profile-pwd:hover {
  transform: scale(1.15);
  color: #0369a1;
}

/* ==================== BANNIÈRES DE STATUT CLIENT ==================== */
.client-auth-status-banner {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-left: 5px solid #16a34a;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.client-auth-status-banner.hidden {
  display: none;
}

.auth-banner-icon {
  font-size: 1.5rem;
  color: #16a34a;
  margin-top: 2px;
}

.auth-banner-content h4 {
  margin: 0 0 4px 0;
  color: #15803d;
  font-size: 0.98rem;
  font-weight: 700;
}

.auth-banner-content p {
  margin: 0;
  color: #166534;
  font-size: 0.85rem;
  line-height: 1.4;
}

.client-login-invite-box {
  background: #fef2f2;
  border: 1px dashed #fca5a5;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.client-login-invite-box.hidden {
  display: none;
}

.invite-icon-text {
  display: flex;
  align-items: center;
  gap: 12px;
}

.invite-icon-text i {
  font-size: 1.3rem;
  color: var(--primary);
}

.invite-icon-text strong {
  font-size: 0.92rem;
  color: #991b1b;
}

.invite-icon-text p {
  margin: 2px 0 0 0;
  font-size: 0.82rem;
  color: #7f1d1d;
}

.default-pwd-hint {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: #991b1b;
}

.login-error-alert {
  background: #fee2e2;
  border: 1px solid #f87171;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-top: 12px;
}

.login-error-alert.hidden {
  display: none;
}

/* ==================== BANNIÈRE D'ACCUEIL ==================== */
.hero-banner {
  background: linear-gradient(135deg, #0a0a0a 0%, #18181b 35%, #881337 75%, #d41f26 100%);
  color: white;
  padding: 42px 24px;
  position: relative;
  box-shadow: inset 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.hero-content {
  max-width: 1600px;
  width: 96%;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1 1 520px;
}

.hero-text h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-text p {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 800px;
  line-height: 1.5;
  margin: 0;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  align-self: flex-end;
  margin-left: auto;
}

.hero-pill {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-pill.highlight {
  background: #ffffff;
  border-color: #ffffff;
  color: #d41f26;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.hero-pill.highlight i {
  color: #d41f26;
}

/* ==================== PAGE D'ACCUEIL / PORTAIL VISITEUR ==================== */
.home-portal-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.35fr;
  gap: 28px;
  margin-bottom: 40px;
  align-items: stretch;
}

.home-login-card {
  border-top: 4px solid var(--primary);
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
}

.login-card-header {
  background: #fef2f2 !important;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  font-size: 0.95rem;
  pointer-events: none;
}

.form-input.with-icon {
  padding-left: 40px !important;
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-text-link:hover {
  background: #fef2f2;
  text-decoration: underline;
}

.home-search-helper {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
  text-align: center;
  font-size: 0.84rem;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.home-presentation-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.welcome-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.joker-welcome-box h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #111827;
  margin: 12px 0 8px 0;
  letter-spacing: -0.3px;
}

.welcome-lead {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.55;
}

.home-features-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fef2f2;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.feature-item strong {
  display: block;
  font-size: 0.92rem;
  color: #111827;
  margin-bottom: 2px;
}

.feature-item p {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.4;
}

/* Grille des 3 Produits sur la Page d'Accueil */
.home-products-section {
  margin-top: 10px;
}

.section-title-center {
  text-align: center;
  margin-bottom: 28px;
}

.section-title-center h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}

.section-title-center p {
  color: #6b7280;
  font-size: 0.92rem;
}

.home-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.home-product-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.home-product-card:hover {
  transform: translateY(-6px);
}

/* Lumière Rouge - Chèque Repas */
.card-repas-accent {
  border-top: 5px solid var(--repas);
}

.card-repas-accent:hover {
  border-color: rgba(212, 31, 38, 0.45);
  border-top: 5px solid var(--repas);
  box-shadow: 0 16px 32px -4px rgba(212, 31, 38, 0.28), 0 0 25px 4px rgba(212, 31, 38, 0.22);
}

/* Lumière Bleue - Chèque Cadeaux */
.card-cadeaux-accent {
  border-top: 5px solid var(--cadeaux);
}

.card-cadeaux-accent:hover {
  border-color: rgba(0, 117, 190, 0.45);
  border-top: 5px solid var(--cadeaux);
  box-shadow: 0 16px 32px -4px rgba(0, 117, 190, 0.3), 0 0 25px 4px rgba(0, 117, 190, 0.25);
}

/* Lumière Verte - Chèque Habillement */
.card-habillement-accent {
  border-top: 5px solid var(--habillement);
}

.card-habillement-accent:hover {
  border-color: rgba(0, 142, 77, 0.45);
  border-top: 5px solid var(--habillement);
  box-shadow: 0 16px 32px -4px rgba(0, 142, 77, 0.3), 0 0 25px 4px rgba(0, 142, 77, 0.25);
}

.card-img-wrapper {
  height: 220px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
}

.card-img-wrapper picture {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-product-card:hover .card-img-wrapper img {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.card-product-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-product-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin: 10px 0 6px 0;
}

.card-product-content p {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 900px) {
  .home-portal-grid {
    grid-template-columns: 1fr;
  }
  .home-products-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== CONTENEUR PRINCIPAL ==================== */
.main-container {
  max-width: 1600px;
  width: 96%;
  margin: 0 auto;
  padding: 24px 20px 80px 20px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ==================== CARTES ==================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
}

.header-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fef2f2;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--secondary);
}

.section-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 24px;
}

/* ==================== FORMULAIRE & RECHERCHE ==================== */
.search-box-group {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 24px;
}

.search-box-group label {
  display: block;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.autocomplete-wrapper {
  position: relative;
}

.search-input {
  font-size: 1.05rem !important;
  border-color: #fca5a5 !important;
  box-shadow: 0 0 0 3px rgba(212, 31, 38, 0.1);
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  margin-top: 4px;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}

.autocomplete-item:hover {
  background: #fef2f2;
}

.autocomplete-item strong {
  color: var(--primary-dark);
}

.autocomplete-item .client-badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.col-span-2 {
  grid-column: span 2;
}

.col-span-3 {
  grid-column: span 3;
}

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

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.required {
  color: var(--danger);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212, 31, 38, 0.15);
}

.helper-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.helper-text-info {
  font-size: 0.8rem;
  color: var(--primary-light);
  margin-top: 4px;
  display: block;
}

/* ==================== BLOCS PRODUITS (REPAS, CADEAUX, HABILLEMENT) ==================== */
.product-block {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 24px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-repas {
  border-left: 6px solid var(--repas);
}

.product-repas:hover {
  border-color: rgba(212, 31, 38, 0.4);
  border-left: 6px solid var(--repas);
  box-shadow: 0 8px 24px -2px rgba(212, 31, 38, 0.22), 0 0 16px 2px rgba(212, 31, 38, 0.16);
}

.product-cadeaux {
  border-left: 6px solid var(--cadeaux);
}

.product-cadeaux:hover {
  border-color: rgba(0, 117, 190, 0.4);
  border-left: 6px solid var(--cadeaux);
  box-shadow: 0 8px 24px -2px rgba(0, 117, 190, 0.24), 0 0 16px 2px rgba(0, 117, 190, 0.18);
}

.product-habillement {
  border-left: 6px solid var(--habillement);
}

.product-habillement:hover {
  border-color: rgba(0, 142, 77, 0.4);
  border-left: 6px solid var(--habillement);
  box-shadow: 0 8px 24px -2px rgba(0, 142, 77, 0.24), 0 0 16px 2px rgba(0, 142, 77, 0.18);
}

.product-banner {
  padding: 18px 24px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
}

/* Image en face de chaque produit */
.product-img-box {
  width: 140px;
  height: 86px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  padding: 4px;
}

.product-img-box picture {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-sample-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.2s;
}

.product-img-box:hover .product-sample-img {
  transform: scale(1.04);
}

.product-info {
  flex: 1;
}

.product-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.product-info h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--secondary);
}

.product-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-repas {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 700;
}

.badge-cadeaux {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-weight: 700;
}

.badge-habillement {
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #bbf7d0;
  font-weight: 700;
}

.product-actions {
  flex-shrink: 0;
}

/* ==================== LIGNES DE COMMANDE ==================== */
.lines-container {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-lines-placeholder {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  background: #fdfdfd;
}

.order-line-row {
  display: grid;
  grid-template-columns: 75px 1fr 1fr 1.15fr 1.25fr 1.2fr 1fr 1.35fr 40px;
  gap: 12px;
  align-items: center;
  background: #ffffff;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: background 0.15s, border-color 0.15s;
}

/* Style du sélecteur d'assemblage (Carnet / Vrac / Enveloppe) */
.line-select-assemblage {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  background-color: #ffffff;
  cursor: pointer;
  height: 38px;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.line-select-assemblage:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 31, 38, 0.12);
}

/* Badges d'assemblage dans les tableaux */
.badge-assemblage {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-carnet {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.badge-vrac {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.badge-enveloppe {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.order-line-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.line-num-badge {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.line-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.line-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.line-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
}

.line-input:focus {
  border-color: var(--primary-light);
  outline: none;
}

/* Switch Logo */
.logo-switch-container {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
}

.switch-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-label input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.switch-status-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.switch-status-text.active {
  color: var(--success-dark);
}

/* Totaux de ligne */
.line-calc-total {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
  text-align: right;
  padding: 8px 0;
}

.line-calc-tickets {
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  text-align: center;
}

.btn-remove-line {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-remove-line:hover {
  background: #fee2e2;
  color: var(--danger);
}

.product-subtotal {
  padding: 12px 24px;
  background: #f1f5f9;
  border-top: 1px solid var(--border-color);
  font-size: 0.88rem;
  color: #475569;
  text-align: right;
}

.product-subtotal strong {
  color: var(--secondary);
  font-size: 0.98rem;
}

/* ==================== BOUTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(212, 31, 38, 0.25);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-add-line {
  background: #fef2f2;
  color: var(--primary);
  border: 1px solid #fecaca;
}

.btn-add-line:hover {
  background: var(--primary);
  color: white;
}

.btn-add-cadeaux {
  background: #f0f9ff;
  color: var(--cadeaux);
  border: 1px solid #bae6fd;
}

.btn-add-cadeaux:hover {
  background: var(--cadeaux);
  color: white;
}

.btn-add-habillement {
  background: #f0fdf4;
  color: var(--habillement);
  border: 1px solid #bbf7d0;
}

.btn-add-habillement:hover {
  background: var(--habillement);
  color: white;
}

/* ==================== DROPZONE DOCUMENTS ==================== */
.file-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
}

.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--primary);
  background: #fef2f2;
}

.dropzone-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.file-dropzone h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.file-dropzone p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.file-input-hidden {
  display: none;
}

.file-formats {
  display: block;
  margin-top: 12px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.selected-files-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.file-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-item-info i {
  color: var(--primary-light);
  font-size: 1.1rem;
}

.file-size-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-delete-file {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-delete-file:hover {
  color: var(--danger);
}

/* ==================== BARRE DE RÉSUMÉ COMMANDE FLOTTANTE ==================== */
.order-summary-bar {
  position: sticky;
  bottom: 20px;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
  backdrop-filter: blur(10px);
}

.summary-details {
  display: flex;
  gap: 30px;
  align-items: center;
}

.summary-kpi {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary);
}

.summary-kpi.highlight .kpi-value {
  color: var(--primary);
  font-size: 1.45rem;
}

.btn-submit-order {
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(212, 31, 38, 0.35);
}

/* ==================== ALERTE SMTP ==================== */
.smtp-alert-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-left: 5px solid #d41f26;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: #9f1239;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.smtp-alert-box.success-alert {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: #16a34a;
  color: #166534;
}

.smtp-alert-box.hidden {
  display: none;
}

/* ==================== TABLEAU DE BORD ADMIN ==================== */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
  position: relative;
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-blue { background: #d41f26; }
.bg-green { background: #10b981; }
.bg-amber { background: #f59e0b; }
.bg-purple { background: #8b5cf6; }

/* ==================== EFFETS LUMINEUX KPI ADMIN ==================== */
/* 1. Total Commandes - Rouge */
.kpi-card:has(.bg-blue):hover,
.kpi-card-red:hover {
  transform: translateY(-5px);
  border-color: rgba(212, 31, 38, 0.45);
  box-shadow: 0 16px 32px -4px rgba(212, 31, 38, 0.28), 0 0 24px 3px rgba(212, 31, 38, 0.22);
}
.kpi-card:has(.bg-blue):hover .kpi-icon,
.kpi-card-red:hover .kpi-icon {
  box-shadow: 0 0 16px rgba(212, 31, 38, 0.55);
  transform: scale(1.08);
}

/* 2. Volume d'Affaires - Vert */
.kpi-card:has(.bg-green):hover,
.kpi-card-green:hover {
  transform: translateY(-5px);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 16px 32px -4px rgba(16, 185, 129, 0.28), 0 0 24px 3px rgba(16, 185, 129, 0.22);
}
.kpi-card:has(.bg-green):hover .kpi-icon,
.kpi-card-green:hover .kpi-icon {
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.55);
  transform: scale(1.08);
}

/* 3. Nouvelles / À Confirmer - Ambre / Orange */
.kpi-card:has(.bg-amber):hover,
.kpi-card-amber:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 16px 32px -4px rgba(245, 158, 11, 0.28), 0 0 24px 3px rgba(245, 158, 11, 0.22);
}
.kpi-card:has(.bg-amber):hover .kpi-icon,
.kpi-card-amber:hover .kpi-icon {
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.55);
  transform: scale(1.08);
}

/* 4. Total Carnets Traités - Violet */
.kpi-card:has(.bg-purple):hover,
.kpi-card-purple:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 16px 32px -4px rgba(139, 92, 246, 0.28), 0 0 24px 3px rgba(139, 92, 246, 0.22);
}
.kpi-card:has(.bg-purple):hover .kpi-icon,
.kpi-card-purple:hover .kpi-icon {
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.55);
  transform: scale(1.08);
}

.kpi-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-number {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--secondary);
}

.admin-header-flex {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-mini {
  position: relative;
  display: flex;
  align-items: center;
}

.search-mini i {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 0.85rem;
}

.search-mini input {
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  width: 230px;
}

.table-responsive {
  overflow-x: auto;
}

/* Optimisation Admin Table : défilement propre */
.admin-orders-card {
  width: 100%;
}

.admin-orders-card .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 1300px) {
  .admin-orders-card .table-responsive {
    overflow-x: hidden;
  }
}

.admin-table {
  width: 100% !important;
  table-layout: auto;
  border-collapse: collapse;
}

.admin-table th {
  background: #f8fafc;
  padding: 12px 10px;
  font-weight: 700;
  color: #475569;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.81rem;
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 10px;
  font-size: 0.83rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

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

.table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 700;
  color: #475569;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tr:hover td {
  background: #fdfdfd;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

/* Statuts Badges */
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-Nouvelle {
  background: #fef3c7;
  color: #b45309;
}

.status-Confirmée {
  background: #dcfce7;
  color: #15803d;
}

.status-En_préparation, .status-En-préparation {
  background: #e0e7ff;
  color: #4338ca;
}

.status-Expédiée {
  background: #e0f2fe;
  color: #0369a1;
}

.status-Livrée {
  background: #ecfdf5;
  color: #047857;
}

.status-Annulée {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-confirm-action {
  background: #10b981;
  color: white;
  border: none;
  font-size: 0.77rem;
  padding: 6px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
}

.btn-confirm-action:hover {
  background: #059669;
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: white;
  border-radius: var(--radius);
  max-width: 580px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: modalEnter 0.2s ease-out;
}

.modal-lg {
  max-width: 820px;
}

@keyframes modalEnter {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.modal-icon-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon-title i {
  color: var(--primary);
  font-size: 1.2rem;
}

.modal-icon-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}

.btn-close-modal:hover {
  color: var(--danger);
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

.modal-client-info-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
  font-size: 0.9rem;
}

.client-detail-row {
  display: flex;
  justify-content: space-between;
}

.text-blue {
  color: var(--primary);
}

/* Modal Succès Commande */
.modal-success {
  text-align: center;
  padding: 36px 30px;
}

.success-icon-badge {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 16px auto;
}

.success-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

.success-order-ref-box {
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 20px 0;
}

.success-order-ref-box span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.success-order-ref-box h3 {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 800;
  margin-top: 2px;
}

.success-info-list {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0 26px 0;
  font-size: 0.88rem;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
}

.info-item i {
  font-size: 1.2rem;
  margin-top: 2px;
}

.success-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ==================== SUIVI COMMANDE ==================== */
.tracking-search-bar {
  max-width: 600px;
  margin: 0 auto 24px auto;
}

.input-with-button {
  display: flex;
  gap: 10px;
}

.tracking-result-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
}

.tracking-timeline {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
  position: relative;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.timeline-step.completed .step-icon {
  background: var(--success);
  color: white;
}

.timeline-step.current .step-icon {
  background: var(--primary);
  color: white;
}

.step-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
}

/* ==================== PIED DE PAGE ==================== */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 24px 20px 24px;
  margin-top: auto;
}

.footer-container {
  max-width: 1600px;
  width: 96%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 30px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-logo {
  height: 38px;
  background: white;
  padding: 2px 6px;
  border-radius: 6px;
}

.footer-col h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
}

.footer-bottom {
  max-width: 1600px;
  width: 96%;
  margin: 30px auto 0 auto;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
  font-size: 0.8rem;
  text-align: center;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: white;
  font-size: 0.92rem;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transition: opacity 0.3s, transform 0.3s;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* ==========================================================================
   OPTIMISATIONS SMARTPHONE & APPAREILS MOBILES (RESPONSIVE COMPLET)
   ========================================================================== */

/* Adaptations générales pour tablettes et écrans intermédiaires (<= 992px) */
@media (max-width: 992px) {
  .nav-container {
    padding: 12px 18px;
  }
  .main-container {
    width: 96%;
    padding: 20px 14px 110px 14px;
  }
  .home-portal-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .home-products-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .col-span-2, .col-span-3 {
    grid-column: span 1;
  }
  .dashboard-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .admin-orders-card .table-responsive {
    overflow-x: auto !important;
  }
}

/* Optimisations complètes pour smartphones (<= 768px) */
@media (max-width: 768px) {
  /* --- TYPOGRAPHIE & TOUCH ERGONOMIE --- */
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    -webkit-tap-highlight-color: rgba(212, 31, 38, 0.08);
  }

  /* Évite le zoom automatique intempestif sur iOS Safari */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Boutons tactiles faciles à presser */
  .btn {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* --- NAVIGATION & HEADER SMARTPHONE --- */
  .navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    background: #ffffff;
  }

  .nav-container {
    padding: 8px 12px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .nav-brand {
    gap: 10px;
  }

  .brand-logo {
    height: 38px;
  }

  .brand-title {
    font-size: 1.05rem;
    line-height: 1.15;
  }

  .brand-subtitle {
    font-size: 0.68rem;
  }

  .nav-auth-section {
    gap: 8px;
  }

  .nav-login-btn {
    padding: 6px 12px;
    font-size: 0.8rem !important;
    min-height: 36px;
    border-radius: 8px;
  }

  .user-profile-badge {
    padding: 4px 8px;
    gap: 6px;
    border-radius: 8px;
    max-width: 170px;
  }

  .user-title {
    font-size: 0.78rem;
    max-width: 105px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .user-code {
    font-size: 0.68rem;
  }

  .btn-logout {
    padding: 6px;
    font-size: 1rem;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Menu des onglets client sur smartphone */
  .nav-menu {
    order: 3;
    width: 100%;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 6px;
    justify-content: space-between;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-menu::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 1;
    min-height: 40px;
    padding: 8px 6px;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    justify-content: center;
    border-radius: 8px;
    white-space: nowrap;
    gap: 5px;
  }

  /* --- BANDEAU ESPACE SOCIÉTÉ (ADMIN) SUR SMARTPHONE --- */
  .admin-top-bar {
    padding: 8px 12px;
  }

  .admin-top-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .admin-top-badge {
    font-size: 0.84rem;
    justify-content: space-between;
    width: 100%;
  }

  .admin-top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .btn-admin-bar {
    padding: 8px 8px;
    font-size: 0.76rem;
    justify-content: center;
    min-height: 38px;
    text-align: center;
  }

  .btn-admin-bar.btn-admin-logout {
    grid-column: span 2;
  }

  /* --- BANNIÈRE ACCUEIL HERO --- */
  .hero-banner {
    padding: 24px 14px 18px 14px;
    margin-bottom: 16px;
  }

  .hero-text h1 {
    font-size: 1.35rem;
    line-height: 1.25;
    margin-bottom: 8px;
  }

  .hero-text p {
    font-size: 0.84rem;
    line-height: 1.4;
    margin-bottom: 12px;
  }

  .hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
  }

  .hero-pill {
    padding: 4px 10px;
    font-size: 0.74rem;
    border-radius: 20px;
  }

  /* --- CONTENEUR PRINCIPAL --- */
  .main-container {
    width: 100%;
    padding: 12px 10px 145px 10px !important;
  }

  .card {
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .card-header {
    padding: 12px 14px;
    gap: 10px;
  }

  .header-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .card-header h2 {
    font-size: 1.05rem;
    line-height: 1.25;
  }

  .card-header .section-desc {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .card-body {
    padding: 14px;
  }

  /* --- PORTAIL ACCUEIL SUR MOBILE --- */
  .home-portal-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 10px;
  }

  .home-login-card .card-body {
    padding: 16px;
  }

  .home-presentation-card {
    padding: 16px;
  }

  .joker-welcome-box h1 {
    font-size: 1.25rem;
  }

  .welcome-lead {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .feature-item {
    gap: 10px;
    margin-bottom: 10px;
  }

  .feature-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 0.9rem;
  }

  .feature-item strong {
    font-size: 0.88rem;
  }

  .feature-item p {
    font-size: 0.78rem;
  }

  .home-products-section {
    margin-top: 24px;
  }

  .section-title-center h2 {
    font-size: 1.25rem;
  }

  .section-title-center p {
    font-size: 0.82rem;
  }

  .home-products-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-product-card {
    border-radius: 12px;
  }

  .card-img-wrapper {
    height: 180px;
    padding: 10px 14px;
  }

  .card-product-content {
    padding: 14px;
  }

  .card-product-content h3 {
    font-size: 1.05rem;
    margin: 8px 0 4px 0;
  }

  .card-product-content p {
    font-size: 0.8rem;
  }

  /* --- FORMULAIRE IDENTIFICATION CLIENT --- */
  .client-auth-status-banner {
    padding: 10px 12px;
    gap: 10px;
  }

  .auth-banner-content h4 {
    font-size: 0.88rem;
  }

  .auth-banner-content p {
    font-size: 0.78rem;
  }

  .client-login-invite-box {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }

  .client-login-invite-box .btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  .search-box-group label {
    font-size: 0.82rem;
  }

  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .col-span-2, .col-span-3 {
    grid-column: span 1;
  }

  .form-group label {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }

  .form-input, .form-textarea, .form-select {
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
  }

  /* Dropdown résultats autocomplétion */
  .autocomplete-dropdown {
    max-height: 240px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  }

  .autocomplete-item {
    padding: 12px 14px;
    min-height: 48px;
    font-size: 0.88rem;
  }

  /* --- BLOCS PRODUITS (REPAS, CADEAUX, HABILLEMENT) --- */
  .product-block {
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .product-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .product-img-box {
    width: 80px;
    height: 52px;
    min-width: 80px;
    padding: 2px;
  }

  .product-info h3 {
    font-size: 1.05rem;
  }

  .product-info p {
    font-size: 0.8rem;
  }

  .product-actions {
    width: 100%;
  }

  .btn-add-line {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 700;
  }

  .lines-container {
    padding: 10px 8px;
    gap: 10px;
  }

  /* --- REDESIGN CARTE MOBILE DES LIGNES DE COMMANDE (.order-line-row) --- */
  .order-line-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "badge remove"
      "carnets tickets"
      "valeur valeur"
      "logo assemblage"
      "totaltickets totalligne" !important;
    gap: 10px 12px !important;
    padding: 12px 12px !important;
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  }

  .order-line-row > .line-num-badge {
    grid-area: badge;
    align-self: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    width: fit-content;
  }

  .order-line-row > .line-field-carnets {
    grid-area: carnets;
  }

  .order-line-row > .line-field-tickets {
    grid-area: tickets;
  }

  .order-line-row > .line-field-valeur {
    grid-area: valeur;
  }

  .order-line-row > .line-field-logo {
    grid-area: logo;
  }

  .order-line-row > .line-field-assemblage {
    grid-area: assemblage;
  }

  .order-line-row > .line-field-totaltickets {
    grid-area: totaltickets;
    background: #f8fafc;
    border-radius: 8px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
  }

  .order-line-row > .line-field-totalligne {
    grid-area: totalligne;
    background: #fef2f2;
    border-radius: 8px;
    padding: 6px 10px;
    border: 1px solid #fecaca;
  }

  .order-line-row > .line-field-remove {
    grid-area: remove;
    justify-self: end;
  }

  .order-line-row .btn-remove-line {
    background: #fee2e2;
    color: #dc2626;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.15s, transform 0.15s;
  }

  .order-line-row .btn-remove-line:active {
    background: #fca5a5;
    transform: scale(0.95);
  }

  .order-line-row .line-input {
    font-size: 16px !important;
    min-height: 44px;
    text-align: center;
    border-radius: 8px;
    background: #f8fafc;
    font-weight: 700;
  }

  .order-line-row .line-calc-total {
    font-size: 1.05rem;
    color: #d41f26;
    font-weight: 800;
    text-align: right;
    padding: 2px 0;
  }

  .order-line-row .line-calc-tickets {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    padding: 2px 0;
  }

  .order-line-row .logo-switch-container {
    height: 44px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 10px;
    justify-content: space-between;
  }

  .product-subtotal {
    padding: 10px 14px;
    font-size: 0.82rem;
    text-align: center;
  }

  /* --- DOCUMENTS JOINTS & DROPZONE --- */
  .file-dropzone {
    padding: 18px 12px;
    border-radius: 10px;
  }

  .dropzone-icon {
    font-size: 2rem;
    margin-bottom: 6px;
  }

  .file-dropzone h3 {
    font-size: 0.95rem;
  }

  .file-dropzone p {
    font-size: 0.78rem;
  }

  .file-dropzone .btn {
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
    justify-content: center;
  }

  .file-formats {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  /* --- BARRE DE RÉSUMÉ COMMANDE FLOTTANTE EN BAS DE L'ÉCRAN --- */
  .order-summary-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-top: 2.5px solid #d41f26 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.16) !important;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)) 14px !important;
    z-index: 99 !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .summary-details {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .summary-kpi {
    text-align: center !important;
    flex: 1 !important;
  }

  .summary-kpi .kpi-label {
    font-size: 0.65rem !important;
    color: #64748b !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
  }

  .summary-kpi .kpi-value {
    font-size: 1rem !important;
    font-weight: 800 !important;
  }

  .summary-kpi.highlight .kpi-value {
    font-size: 1.25rem !important;
    color: #d41f26 !important;
  }

  .btn-submit-order {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 0.96rem !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 14px !important;
    box-shadow: 0 4px 14px rgba(212, 31, 38, 0.35) !important;
  }

  /* --- TABLEAUX SUR MOBILE (DÉFILEMENT FLUIDE SANS CASSE) --- */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    position: relative;
  }

  .admin-orders-card .table-responsive {
    overflow-x: auto !important;
  }

  .table, .admin-table {
    min-width: 680px !important;
  }

  .admin-table {
    min-width: 820px !important;
  }

  .table th, .admin-table th {
    padding: 10px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .table td, .admin-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  /* Filtres Espace Société */
  .admin-header-flex {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .admin-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .search-mini {
    width: 100%;
  }

  .search-mini input {
    width: 100%;
    min-height: 44px;
    font-size: 16px !important;
  }

  .admin-filters select, .admin-filters button {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  /* Dashboard KPIs */
  .dashboard-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }

  .kpi-card {
    padding: 12px;
    border-radius: 10px;
    gap: 10px;
  }

  .kpi-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .kpi-title {
    font-size: 0.72rem;
  }

  .kpi-number {
    font-size: 1.1rem;
  }

  /* --- SUIVI DE COMMANDE SUR SMARTPHONE --- */
  .input-with-button {
    flex-direction: column;
    gap: 8px;
  }

  .input-with-button .form-input {
    width: 100%;
    min-height: 46px;
    font-size: 16px !important;
  }

  .input-with-button .btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    font-size: 0.95rem;
  }

  .tracking-result-box {
    padding: 16px;
  }

  /* Timeline de suivi responsive sur mobile */
  .tracking-timeline {
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
    position: relative;
    padding-left: 10px;
  }

  .tracking-timeline::before {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 28px;
    width: 3px;
    background: #e2e8f0;
    z-index: 0;
  }

  .timeline-step {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    text-align: left;
  }

  .step-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 0.88rem;
    z-index: 1;
  }

  .step-title {
    font-size: 0.88rem;
    text-align: left;
  }

  /* --- FENÊTRES MODALES SUR SMARTPHONE (BOTTOM SHEET) --- */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-card {
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    border-radius: 18px 18px 0 0;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-header h3 {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 16px;
    max-height: calc(86vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }

  .modal-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer button {
    width: 100%;
    min-height: 44px;
    font-size: 0.95rem;
    justify-content: center;
  }

  .modal-client-info-box {
    padding: 10px 12px;
    font-size: 0.84rem;
  }

  /* --- NOTIFICATION TOAST SUR MOBILE --- */
  .toast {
    left: 12px;
    right: 12px;
    bottom: auto;
    top: 14px;
    transform: none;
    max-width: none;
    width: auto;
    font-size: 0.86rem;
    padding: 12px 16px;
    text-align: center;
    border-radius: 10px;
  }

  .toast.hidden {
    transform: translateY(-20px);
  }

  /* --- PIED DE PAGE SUR MOBILE --- */
  .footer {
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px;
  }

  .footer-container {
    flex-direction: column;
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .btn-footer-admin {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
}

/* Optimisations ultra-compactes pour smartphones de petite taille (<= 480px) */
@media (max-width: 480px) {
  .brand-subtitle {
    display: none;
  }

  .brand-title {
    font-size: 0.98rem;
  }

  .brand-logo {
    height: 34px;
  }

  .nav-tab {
    font-size: 0.72rem;
    padding: 6px 4px;
    gap: 4px;
  }

  .nav-tab i {
    font-size: 0.85rem;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary-kpi .kpi-value {
    font-size: 0.92rem !important;
  }

  .summary-kpi.highlight .kpi-value {
    font-size: 1.12rem !important;
  }

  .order-line-row {
    padding: 10px !important;
    gap: 8px 10px !important;
  }
}

.hidden {
  display: none !important;
}

/* Printable Bon de Commande */
@media print {
  body * {
    visibility: hidden;
  }
  #orderDetailsModal, #orderDetailsModal * {
    visibility: visible;
  }
  #orderDetailsModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
  }
  .modal-header-actions, .btn-close-modal {
    display: none !important;
  }
}

/* ==================== ESPACE SOCIÉTÉ & NAVIGATION DÉDIÉE ==================== */
.admin-top-bar {
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 3px solid #d41f26;
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 150;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.admin-top-container {
  max-width: 1600px;
  width: 96%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-top-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.admin-top-badge i {
  color: #d41f26;
  font-size: 1.2rem;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-pending-badge {
  background: rgba(212, 31, 38, 0.2);
  border: 1px solid rgba(212, 31, 38, 0.5);
  color: #fca5a5;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-admin-bar {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-admin-bar:hover {
  background: #334155;
  color: #ffffff;
}

.btn-admin-bar.btn-admin-logout {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
}

.btn-admin-bar.btn-admin-logout:hover {
  background: #b91c1c;
}

/* Pied de page et bouton secret accès société */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-footer-admin {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-footer-admin:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  color: #f8fafc;
}

.admin-notice-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #9f1239;
  margin-bottom: 16px;
}

.admin-notice-box i {
  color: #d41f26;
  font-size: 1.3rem;
  margin-top: 2px;
}

.admin-notice-box strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.admin-notice-box p {
  margin: 0;
  font-size: 0.82rem;
  color: #881337;
}

.btn-eye-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1rem;
}

/* Sélecteur dynamique d'étapes de commande (Société Joker) */
.status-select {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  outline: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.status-select-Nouvelle {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.status-select-Confirmée {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.status-select-En_préparation {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.status-select-Expédiée {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.status-select-Livrée {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}




/* ==========================================================================
   CMS PUBLICITÉS, ANNONCES & BANDEAU LOGOS PARTENAIRES
   ========================================================================== */

/* 1. Bandeau supérieur défilant / Annonce Top Bar */
.top-announcement-bar {
  background: linear-gradient(135deg, #090d16 0%, #111827 50%, #1e1b4b 100%);
  color: #f8fafc;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 105;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border-bottom: 2px solid rgba(225, 29, 72, 0.6);
  font-size: 0.86rem;
  line-height: 1.4;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-announcement-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
  text-align: left;
  flex-wrap: nowrap;
  max-width: 1280px;
  margin: 0 auto;
}

.announcement-badge {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.announcement-text {
  color: #f1f5f9;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none !important;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.announcement-link:hover {
  background: #ffffff;
  color: #0f172a !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-close-announcement {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-close-announcement:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

/* 2. Conteneurs d'annonces sur les différentes pages */
.ads-page-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

/* Carte Publicitaire / Bannière Promo */
.ad-banner-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #d41f26;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.ad-banner-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.ad-banner-media {
  width: 70px;
  height: 70px;
  min-width: 70px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.ad-banner-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ad-banner-body {
  flex: 1;
}

.ad-banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.ad-pill-badge {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ad-banner-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.ad-banner-body p {
  font-size: 0.86rem;
  color: #475569;
  margin: 4px 0 0 0;
  line-height: 1.45;
}

.ad-banner-action {
  flex-shrink: 0;
}

.ad-cta-btn {
  background: #d41f26;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(212, 31, 38, 0.25);
}

.ad-cta-btn:hover {
  background: #b91c1c;
  color: white;
  transform: translateY(-1px);
}

/* ==================== BANNIÈRE PUBLICITAIRE / PARTENAIRES EN MOUVEMENT CONTINU (STYLE EXACT PHOTO) ==================== */
.partners-banner-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  margin: 0 0 28px 0;
  padding: 16px 0;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.03);
  width: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.partners-banner-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
}

/* Masques dégradés latéraux élégants pour entrée/sortie sans coupure visuelle */
.partners-banner-card::before,
.partners-banner-card::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 90px;
  z-index: 3;
  pointer-events: none;
}

.partners-banner-card::before {
  left: 0;
  background: linear-gradient(to right, #ffffff 20%, rgba(255, 255, 255, 0) 100%);
}

.partners-banner-card::after {
  right: 0;
  background: linear-gradient(to left, #ffffff 20%, rgba(255, 255, 255, 0) 100%);
}

.partners-banner-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
}

/* Piste de défilement horizontal fluide et continu */
.partners-banner-track {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  width: max-content !important;
  gap: 60px;
  padding-left: 30px;
  animation: bannerPartnerScroll 28s linear infinite;
  -webkit-animation: bannerPartnerScroll 28s linear infinite;
  will-change: transform;
  user-select: none;
}

/* Pause automatique et fluide au survol pour permettre le clic ou l'inspection */
.partners-banner-card:hover .partners-banner-track {
  animation-play-state: paused;
  -webkit-animation-play-state: paused;
}

/* Keyframes de défilement infini sans saccade ni à-coup */
@keyframes bannerPartnerScroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@-webkit-keyframes bannerPartnerScroll {
  0% {
    -webkit-transform: translate3d(0, 0, 0);
  }
  100% {
    -webkit-transform: translate3d(-50%, 0, 0);
  }
}

.partner-banner-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
  padding: 8px 18px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.partner-banner-item img {
  height: auto;
  max-height: 48px;
  width: auto;
  max-width: 165px;
  object-fit: contain;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.03));
}

.partner-banner-item:hover {
  transform: translateY(-2px);
}

.partner-banner-item:hover img {
  transform: scale(1.12);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.14));
}

@media (max-width: 900px) {
  .partners-banner-track {
    gap: 36px;
    animation-duration: 20s;
    -webkit-animation-duration: 20s;
  }
  .partner-banner-item img {
    max-height: 38px;
    max-width: 130px;
  }
  .partners-banner-card::before,
  .partners-banner-card::after {
    width: 45px;
  }
}

/* 3. Bandeau Défilant Publicitaire & Logos Partenaires en Mouvement (Direct sur UNE SEULE LIGNE) */
.partners-marquee-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  margin: 0 0 24px 0;
  padding: 16px 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* Conteneur Défilement Marquee Fluide */
.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  display: flex;
}

/* Piste sur UNE SEULE LIGNE STRICTE qui tourne en mouvement continu sans pause */
.marquee-track {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  width: max-content;
  user-select: none;
  animation: marqueeContinuous 24s linear infinite;
  -webkit-animation: marqueeContinuous 24s linear infinite;
  will-change: transform;
}

/* Keyframes de défilement continu infini à 360° (de 0 à -50% pour un cycle parfait et invisible) */
@keyframes marqueeContinuous {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@-webkit-keyframes marqueeContinuous {
  0% {
    -webkit-transform: translate3d(0, 0, 0);
  }
  100% {
    -webkit-transform: translate3d(-50%, 0, 0);
  }
}

/* Style des Cartes Partenaires / Annonces en Mouvement : STRICTEMENT SUR UNE SEULE LIGNE */
.partner-logo-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  height: 122px;
  min-height: 122px;
  max-height: 122px;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s, border-color 0.25s;
  cursor: pointer;
  margin-right: 16px;
  box-sizing: border-box;
}

.partner-logo-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: #d41f26;
  box-shadow: 0 8px 20px rgba(212, 31, 38, 0.16);
  z-index: 2;
}

.partner-logo-wrapper {
  height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.partner-logo-wrapper img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.2s;
}

.partner-logo-card:hover .partner-logo-wrapper img {
  transform: scale(1.08);
}

.partner-logo-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  transition: all 0.2s;
}

.partner-logo-card:hover .partner-logo-fallback {
  background: #d41f26;
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(212, 31, 38, 0.25);
}

.partner-card-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.partner-card-desc {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.25;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* 4. Sous-Navigation Admin (Espace Société) */
.admin-subnav-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-subnav-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-subnav-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.admin-subnav-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.admin-subnav-btn.active span {
  background: #d41f26;
  color: white;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.admin-subpanel.hidden {
  display: none !important;
}

/* 5. Éléments du tableau CMS Publicités */
.ad-thumb-preview {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-thumb-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ad-placement-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  display: inline-block;
  white-space: nowrap;
}

.ad-placement-badge.top-banner {
  background: #fef3c7;
  color: #b45309;
}

.ad-placement-badge.home {
  background: #dcfce7;
  color: #15803d;
}

.ad-placement-badge.order {
  background: #fee2e2;
  color: #b91c1c;
}

.ad-placement-badge.tracking {
  background: #f3e8ff;
  color: #7e22ce;
}

.ad-placement-badge.partner-logos {
  background: #e2e8f0;
  color: #334155;
}

/* Interrupteur Toggle Switch Actif/Inactif */
.ad-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.ad-switch-btn.active {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.ad-switch-btn.inactive {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

.ad-switch-btn:hover {
  opacity: 0.85;
}

/* Mobile responsive pour le CMS & Partenaires */
@media (max-width: 768px) {
  .top-announcement-bar {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  .top-announcement-content {
    flex-wrap: wrap;
    gap: 8px;
    text-align: center;
    justify-content: center;
  }
  .announcement-text {
    white-space: normal;
  }
  .ad-banner-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }
  .ad-banner-action {
    width: 100%;
  }
  .ad-cta-btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }
  .partners-marquee-card {
    padding: 12px 0;
    margin-bottom: 18px;
  }
  .partner-logo-card {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    height: 110px;
    min-height: 110px;
    max-height: 110px;
    padding: 10px 12px;
    margin-right: 12px;
  }
  .partner-logo-wrapper {
    height: 38px;
    margin-bottom: 4px;
  }
  .partner-logo-fallback {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .partner-card-name {
    font-size: 0.82rem;
  }
  .partner-card-desc {
    font-size: 0.68rem;
    line-height: 1.2;
  }
  .admin-subnav-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}

/* ==================== SESSIONS & ÉQUIPE JOKER (RBAC) ==================== */
.admin-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.82rem;
  color: #fff;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.role-quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}
.role-quick-pill:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}
.role-quick-pill.active {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

/* Badges de rôle pour tableau */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.role-badge-superadmin {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}
.role-badge-commercial {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.role-badge-logistique {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.role-badge-comptabilite {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Grille explicative des rôles */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.role-desc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.role-desc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.role-desc-superadmin::before { background: linear-gradient(90deg, #7e22ce, #a855f7); }
.role-desc-commercial::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.role-desc-logistique::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.role-desc-comptabilite::before { background: linear-gradient(90deg, #16a34a, #4ade80); }

.role-desc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.role-desc-body {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}

/* ==================== CMS GESTION DES VISUELS & LOGO SOCIÉTÉ ==================== */
.branding-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.branding-card {
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.branding-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

.branding-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.branding-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.badge-logo { background: rgba(212, 31, 38, 0.1); color: #d41f26; }

.branding-status-tag {
  font-size: 0.72rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.branding-status-tag.custom {
  color: #059669;
  background: #ecfdf5;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.branding-preview-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}

.branding-preview-box img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
}

.branding-preview-box:hover img {
  transform: scale(1.03);
}

.branding-card-body h4 {
  font-size: 1.05rem;
  color: #0f172a;
  margin: 0 0 6px 0;
  font-weight: 700;
}

.branding-hint {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 10px 0;
  line-height: 1.4;
  min-height: 48px;
}

.branding-meta {
  font-size: 0.74rem;
  color: #94a3b8;
  margin-bottom: 14px;
}

.branding-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.branding-card-actions .btn {
  flex: 1;
  font-size: 0.82rem;
  padding: 8px 12px;
  justify-content: center;
}

.branding-card-actions .btn-reset-branding {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: #64748b;
}

.branding-card-actions .btn-reset-branding:hover {
  color: #d41f26;
  border-color: #d41f26;
}

