/* ===== VARIABLES CSS ===== */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2234;
  --bg-card: #1f2937;
  --bg-hover: #283548;
  
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Zone sous le header : auth OU app (header ne défile jamais) */
.body-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.show-auth .body-main .app {
  display: none !important;
}
body.show-auth .body-main #auth-screen {
  display: flex !important;
  flex: 1;
}

/* ===== HEADER APP (toujours en haut, jamais scrollé) ===== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  z-index: 100;
}
.app-header .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-header .user-email {
  color: var(--text-secondary);
  font-size: 14px;
}
.app-header #logout-button {
  display: inline-block !important;
  margin-top: 0;
}
body.show-auth .app-header #logout-button,
body.show-auth .app-header .small-button.gray,
body.show-auth .app-header .user-email {
  display: none !important;
}

/* ===== SCROLLBAR CUSTOM ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 10px;
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== LAYOUT ===== */
.app {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
aside {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  padding: 24px 16px;
  width: 260px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow-y: auto;
}

aside::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.sidebar-logout {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.sidebar-logout-btn {
  width: 100%;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--danger);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.sidebar-logout-btn:hover {
  background: var(--danger);
  color: white;
}

aside h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

aside button {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

aside button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent-gradient);
  border-radius: 0 3px 3px 0;
  transition: height var(--transition-normal);
}

aside button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  transform: translateX(4px);
}

aside button:hover::before {
  height: 60%;
}

aside button.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-glow);
}

aside button.active::before {
  height: 70%;
}

/* ===== MAIN CONTENT ===== */
main {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  background: var(--bg-primary);
}

main h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 24px 0;
  letter-spacing: -0.5px;
}

/* ===== INPUTS & FORMS ===== */
input, textarea, select {
  display: block;
  margin-bottom: 12px;
  padding: 14px 16px;
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition-fast);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input:hover, textarea:hover, select:hover {
  border-color: var(--border-light);
  background: var(--bg-card);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* ===== BUTTONS ===== */
button {
  padding: 12px 20px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

button:active {
  transform: translateY(0);
}

button:active::after {
  width: 200px;
  height: 200px;
}

button:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

.list {
  margin-top: 24px;
}

/* ===== CARDS ===== */
.card {
  margin: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  max-width: 280px;
  width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-normal);
  display: inline-block;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-light);
}

.card:hover::before {
  opacity: 1;
}

.card span {
  font-size: 14px;
  display: block;
  margin-bottom: 10px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.card span:first-child {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Filtres clients (champs manquants) */
.client-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.client-filters .filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.client-filters .filter-check input {
  cursor: pointer;
}

/* Pour une disposition en grille de plusieurs cartes */
#client-list, #product-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

/* ===== LIVE GRID ===== */
.live-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.live-section {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.live-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
}

.live-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.vertical-list > .product,
.vertical-list > .client {
  background: var(--bg-tertiary);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.vertical-list > .product:hover,
.vertical-list > .client:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

/* ===== CONTROLS ===== */
.controls {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.controls button {
  background: var(--accent-gradient);
  border: none;
  padding: 10px 14px;
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
}

.controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.controls button:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cart-line {
  margin-bottom: 6px;
}

.cart-line strong {
  display: inline-block;
  min-width: 120px;
}

/* ===== PINNED & HIGHLIGHT STATES ===== */
.pinned {
  border: 2px solid var(--success) !important;
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.pinned span {
  color: var(--success) !important;
  font-weight: 600;
}

.highlight {
  border: 2px solid var(--info);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  animation: pulse-highlight 2s infinite;
}

@keyframes pulse-highlight {
  0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
  50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.5); }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== MODALES ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
  padding: 28px 32px;
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  max-width: 500px;
  width: 90%;
  animation: slideUp 0.3s ease;
}

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

.modal-content h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 700;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.modal .small-button.green {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  border: none;
  color: white;
}

.modal .small-button.green:hover {
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.modal .small-button.red {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  border: none;
  color: white;
}

.modal .small-button.red:hover {
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

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

.modal-actions button {
  flex: 1;
  max-width: 150px;
}

/* ===== EDIT FIELDS ===== */
#edit-client-name,
#edit-client-phone,
#edit-client-address,
#edit-client-comment,
#edit-product-name,
#edit-product-price,
#edit-product-stock,
#edit-product-ref {
  border: 1px solid var(--border-light);
}

#search-product,
#search-client {
  margin-top: 20px;
  position: relative;
}

#search-product::before,
#search-client::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

/* ===== SMALL BUTTONS ===== */
.small-button {
  background: var(--accent-gradient);
  border: none;
  padding: 10px 16px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  transition: all var(--transition-normal);
}

.small-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.small-button.gray {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.small-button.gray:hover {
  background: var(--bg-tertiary);
  box-shadow: none;
}

/* ===== FACTURES ===== */
.facture-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: all var(--transition-normal);
}

.facture-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.facture-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.facture-body {
  padding-left: 0;
}

.facture-body p {
  margin: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.facture-body p strong {
  color: var(--text-primary);
}

.facture-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.facture-actions button {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.facture-actions button:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}
.hidden {
  display: none;
}
/* ===== CLIENT PICKER ===== */
#client-picker-list {
  max-height: 350px;
  overflow-y: auto;
  margin-top: 16px;
  padding: 4px;
}

#client-picker-list .picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

#client-picker-list .picker-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

#client-picker-list .picker-item span {
  font-size: 14px;
  font-weight: 500;
}

#client-picker-list .picker-item button {
  padding: 8px 14px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

#client-picker-list .picker-item button:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

button.disabled {
  background: var(--bg-hover) !important;
  color: var(--text-muted) !important;
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
button.small-button {
  background: var(--accent-gradient);
  border: none;
  padding: 10px 16px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  transition: all var(--transition-normal);
}

button.small-button:active {
  transform: scale(0.98);
}

button.small-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

button.small-button:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.small-button.blue {
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

.small-button.disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 4px 8px 4px 0;
  color: white;
  letter-spacing: 0.3px;
}

.livraison.en-preparation { 
  background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.livraison.en-livraison { 
  background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.livraison.livree { 
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.paiement.payee { 
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.paiement.non-payee { 
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.facture-actions select {
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
  margin-left: 6px;
}

/* ===== HISTORIQUE ===== */
.historique-commande {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
}

.small-select {
  padding: 10px 14px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  width: auto;
  min-width: 300px;
  max-width: 340px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* ===== FILTRES BOX ===== */
.commande-filtres-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 24px 0;
  padding: 16px 20px;
  background: linear-gradient(145deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  justify-content: flex-start;
  align-items: center;
}

.filtre-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.filtre-chip:hover {
  border-color: var(--border-light);
}

.filtre-chip input,
.filtre-chip select {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-size: 13px;
  padding: 4px 0;
  outline: none;
  min-width: 100px;
}

.filtre-chip select {
  cursor: pointer;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  padding-right: 28px;
}

/* ===== DASHBOARD ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.dashboard-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-light);
}

.dashboard-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.dashboard-card .kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.dashboard-card .kpi-period {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Dashboard header & filters */
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-filters label { margin: 0; font-size: 14px; color: var(--text-secondary); }
.dashboard-filters input { margin: 0; width: 180px; }

/* Dashboard rows & blocks */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 28px;
}

.dashboard-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.dashboard-block.full-width {
  grid-column: 1 / -1;
}

.dashboard-block h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-list .item,
.dashboard-list-item {
  background: var(--bg-tertiary);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  border-left: 3px solid var(--accent-primary);
}

.dashboard-list-item.rupture {
  border-left-color: var(--danger);
}

.dashboard-empty {
  font-size: 14px;
  color: var(--text-muted);
  padding: 16px;
  text-align: center;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-chart {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  flex: 0 0 140px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bar {
  background: var(--accent-gradient);
  height: 20px;
  border-radius: 6px;
  transition: width 0.3s ease;
  min-width: 4px;
}

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Répartition statuts */
.dashboard-statuts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.statut-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.statut-label {
  flex: 0 0 120px;
  font-size: 14px;
  color: var(--text-secondary);
}

.statut-bar-wrap {
  flex: 1;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.statut-bar {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
}

.statut-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 28px;
  text-align: right;
}

@media (max-width: 900px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
}
.has-order {
  background-color: #2ecc71 !important;
  color: white !important;
  border-radius: 50% !important;
}
#livraison-parcours .facture-card {
  background-color: #1f2638;
  border-left: 4px solid #3498db;
}

select {
  background-color: #2a2f45;
  color: #ffffff;
  border: 1px solid #444;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s ease;
}

select:focus {
  border: 1px solid #3498db;
}

option {
  background-color: #1f2635;
  color: white;
  font-size: 14px;
}

#auth-screen {
  flex: 1;
  min-height: 0;
  background: var(--bg-primary);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
body.show-auth #auth-screen {
  display: flex !important;
}

.auth-box {
  background: #2a2f45;
  padding: 30px;
  border-radius: 10px;
  color: white;
  width: 300px;
  text-align: center;
  box-shadow: 0 0 15px #00000066;
}

.auth-box input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: none;
  border-radius: 5px;
  background: #1f2635;
  color: white;
  font-size: 14px;
}

.auth-box .blue-button {
  background: #3498db;
  border: none;
  color: white;
  padding: 10px 15px;
  margin-top: 10px;
  width: 100%;
  font-size: 15px;
  border-radius: 5px;
  cursor: pointer;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.auth-buttons .blue-button,
.auth-buttons .outline-button {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border-radius: 8px;
  cursor: pointer;
}
.auth-buttons .outline-button {
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}
.auth-buttons .outline-button:hover {
  background: rgba(99, 102, 241, 0.15);
}

.auth-box .auth-switch {
  margin-top: 15px;
  font-size: 13px;
}

.auth-box a {
  color: #74b9ff;
  cursor: pointer;
  text-decoration: none;
}

.hidden {
  display: none;
}

.loader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: white;
  font-family: sans-serif;
  font-size: 16px;
  text-align: center;
}

.loader.hidden {
  display: none;
}

.spinner {
  border: 5px solid #ccc;
  border-top: 5px solid #57aaff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  margin: 0 auto 15px;
  animation: spin 1s linear infinite;
}

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

.small-button.red {
  background: #e74c3c;
  color: white;
}
.small-button.blue {
  background: #3498db;
  color: white;
}
.small-button.gray {
  background: #7f8c8d;
  color: white;
}
.hero-header {
  background: #1f2635;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-header .logo {
  font-size: 24px;
  font-weight: bold;
  color: #57aaff;
  margin: 0;
}

.hero-header nav {
  display: flex;
  gap: 15px;
}

.nav-link {
  color: #cfd9e8;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
}

.nav-link:hover {
  text-decoration: underline;
}

.hero {
  padding: 60px 30px;
  background: linear-gradient(160deg, #0c0f1a, #182234);
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
}

.hero-text {
  flex: 1;
  max-width: 500px;
}

.hero-text h2 {
  font-size: 32px;
  margin-bottom: 20px;
  color: #ffffff;
}

.hero-text p {
  font-size: 16px;
  color: #ccc;
  line-height: 1.6;
}

.hero-img img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6),
              0 4px 12px rgba(87, 170, 255, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-img img:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7),
              0 6px 14px rgba(87, 170, 255, 0.4);
}


.features {
  padding: 50px 30px;
}

.features h3 {
  font-size: 24px;
  margin-bottom: 30px;
  text-align: center;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.feature-card {
  background: #1f2635;
  padding: 20px;
  border-radius: 10px;
  color: white;
  text-align: center;
  border-left: 4px solid #265bdf;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.testimonial {
  background: #111728;
  padding: 40px 30px;
  text-align: center;
}

.testimonial blockquote {
  font-size: 18px;
  font-style: italic;
  color: #a4c0ff;
  margin: 0 auto;
  max-width: 600px;
}

.testimonial footer {
  margin-top: 15px;
  color: #ccc;
  font-size: 14px;
}

.pricing {
  padding: 60px 30px;
}

.pricing h3 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
}

.pricing-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.price-card {
  background: #1f2635;
  border-radius: 10px;
  padding: 25px;
  width: 260px;
  color: white;
  text-align: center;
  border: 1px solid #2c3c55;
}

.price-card.highlighted {
  border: 2px solid #57aaff;
  background: #1b273f;
}

.price-card h4 {
  margin-bottom: 10px;
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  text-align: left;
}

.price-card li {
  margin-bottom: 10px;
}

.btn {
  display: inline-block;
  background: #265bdf;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
}

.btn:hover {
  background: #1e4fa1;
}

.btn.primary {
  background: #57aaff;
  color: black;
}

.btn.large {
  padding: 14px 28px;
  font-size: 16px;
  margin-top: 20px;
}

.footer {
  padding: 20px 30px;
  background: #0c0f1a;
  color: #777;
  text-align: center;
}

/* 🖱️ Curseur main + hover effet sur les blocs interactifs du Live */
#live-products > div,
#pinned-products > div,
#live-clients > div,
#live-carts > div {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 6px;
}

#live-products > div:hover,
#pinned-products > div:hover,
#live-clients > div:hover,
#live-carts > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== INTRO.JS CUSTOM STYLES ===== */
.custom-intro {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-tertiary) 100%) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--accent-primary) !important;
  border-radius: var(--radius-lg) !important;
  padding: 20px !important;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.2) !important;
  font-size: 14px !important;
  max-width: 380px !important;
}

.custom-intro .introjs-tooltip-title {
  color: var(--accent-primary) !important;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 10px;
}

.custom-intro .introjs-tooltiptext {
  line-height: 1.6;
  color: var(--text-secondary);
}

.introjs-button {
  background: var(--accent-gradient) !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  color: white !important;
  border: none !important;
  box-shadow: none !important;
  transition: all var(--transition-normal) !important;
}

.introjs-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4) !important;
}

.introjs-tooltipbuttons {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  gap: 10px;
}

/* ===== CTA BUTTONS ===== */
.btn, .cta-button {
  display: inline-block;
  background-color: #57aaff;
  color: #fff;
  font-weight: bold;
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(87, 170, 255, 0.4);
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn:hover, .cta-button:hover {
  background-color: #4a90e2;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(87, 170, 255, 0.6);
}
.btn.large, .cta-button.large {
  font-size: 18px;
  padding: 14px 30px;
}

.stock-negatif {
  background-color: #442222 !important;
  border-left: 4px solid #e74c3c;
  color: #ffbcbc !important;
}
.warning-zone {
  background: #2a1a1a;
  border: 2px dashed #e74c3c;
  padding: 20px;
  border-radius: 12px;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.warning-zone .card {
  background-color: #3b2b2b;
  border-color: #c0392b;
}
.en-commande {
  color: #f8c291 !important;
  font-weight: bold;
}
.en-commande::after {
  content: " 🛒 En commande";
  color: #ff6b6b;
  font-size: 13px;
  margin-left: 6px;
}

.stock-policy-box {
  background-color: #202738;
  padding: 12px 16px;
  border-left: 4px solid #ffc107;
  border-radius: 8px;
  margin-top: 20px;
  font-size: 15px;
  color: white;
}
.stock-policy-box input[type="checkbox"] {
  transform: scale(1.3);
  margin-right: 10px;
}
.badge-active {
  background-color: #ffc107 !important;
  color: black !important;
  font-weight: bold;
  border: 2px solid #e6b800;
}

#btn-filter-rupture {
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
  height: 34px;
}

.iti {
  width: 100%;
  margin-bottom: 10px;
}

.iti input {
  padding-left: 52px !important; /* espace pour le drapeau */
}

.iti__country-list {
  z-index: 10000 !important; /* pour éviter d'être caché */
  max-height: 200px;
  overflow-y: auto;
  font-size: 14px;
  background-color: white !important;
  color: black !important;
  border: 1px solid #ccc;
  z-index: 10000 !important;
}
.iti__country {
  color: black !important;
  background: white !important;
}

.iti__flag-box {
  background-color: transparent !important;
}

.iti__country:hover {
  background-color: #f0f0f0 !important;
}
#account-panel label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  font-weight: bold;
}

#account-panel input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

/* 1. Faites du label un conteneur flex pour aligner verticalement */
.card label {
  display: flex;
  align-items: center;
  gap: 8px;               /* espace entre case et nom */
  margin-bottom: 12px;
}

/* 2. Réinitialisez tout style bizarre sur la checkbox */
.client-checkbox {
  position: static; /* pas de positionnement absolu ou relatif */
  margin: 0;        /* supprime marge top/bottom qui décalait le texte */
  vertical-align: middle;
}

/* 3. Assurez-vous que le texte n’est pas poussé par les marges globales */
.card b {
  margin: 0;
  line-height: 1.2; /* ajustez pour une ligne propre */
}
.card .client-checkbox {
  display: inline-block !important;
  width: auto !important;
  margin: 0 8px 0 0;      /* petit espacement à droite */
  vertical-align: middle;
}

/* Bleu néon autour de la carte sélectionnée */
.card.selected {
  box-shadow: 0 0 20px 5px rgba(38, 91, 223, 0.9);
}

/* Règles spécifiques aux checkboxes de la liste produits */
.product-checkbox {
  display: inline-block !important;
  width: auto !important;
  margin: 0 8px 0 0;
  vertical-align: middle;
}
/* Étiquette du produit : flex sur une seule ligne */
.product-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Détails du produit, alignés sous le nom avec retrait pour la checkbox */
.product-details {
  margin-left: calc(1em + 24px); /* espace équivalent à la checkbox + gap */
  line-height: 1.4;
}

/* === OVERRIDE GLOBALE POUR LES CHECKBOX === */
input[type="checkbox"] {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 8px 0 0 !important;
  vertical-align: middle !important;
  position: static !important;
  padding: 0 !important;
  background: none !important;
}

/* Info-bulle CSV import */
.info-tooltip {
  display: inline-block;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  position: relative;
  color: #57aaff;
}

.tooltip-text {
  visibility: hidden;
  width: 240px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  bottom: 125%; /* au-dessus de l’icône */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 100;
  font-size: 13px;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%; /* pointe vers l’icône */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.info-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* === Réduction du champ “aucun fichier choisi” === */
#csv-file-input {
  width: 50%;              /* prend 50% de son conteneur */
  max-width: 400px;        /* ne dépassera pas 400px sur grand écran */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Limitation de la largeur de la bulle d’info === */
.tooltip-text {
  max-width: 300px;          /* la bulle ne pourra pas dépasser */
  word-wrap: break-word;     /* coupe les mots longs si besoin */
}

/* === Styles pour les cartes « client-card » dans l’admin === */
.client-card {
  background-color: #1f2635;      /* Fond sombre, cohérent avec le thème */
  border: 1px solid #2c3e50;      /* Légère bordure pour bien délimiter */
  border-radius: 10px;            /* Coins arrondis pour l’effet « card » */
  padding: 16px;                  /* Espacement interne confortable */
  margin: 12px 0;                 /* Espacement vertical entre les cartes */
  box-shadow: 0 2px 6px rgba(0,0,0,0.4); /* Ombre légère pour la profondeur */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 calc(33.333% - 16px); /* 3 cartes par ligne, en tenant compte du gap */
  box-sizing: border-box;         /* Inclut padding/bordure dans la taille */
  max-width: calc(33.333% - 16px);
}

.client-card strong {
  font-size: 16px;
  color: #fff;
}

.client-card p,
.client-card button {
  margin: 4px 0;
}

/* Bouton « Voir » */
.client-card button {
  align-self: flex-start;        /* Bouton calé à gauche */
  background-color: #265bdf;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.client-card button:hover {
  background-color: #3d6ff2;
}

/* Effet au survol de la carte */
.client-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
/* Container des cartes clients */
#client-list-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;               /* Espace entre les cartes */
  padding: 8px;             /* Un peu de marge intérieure */
}

/* Points de rupture pour mobile/tablette */
@media (max-width: 1024px) {
  .client-card {
    flex: 1 1 calc(50% - 16px);   /* 2 cartes par ligne */
    max-width: calc(50% - 16px);
  }
}

@media (max-width: 600px) {
  .client-card {
    flex: 1 1 100%;               /* 1 carte par ligne */
    max-width: 100%;
  }
}

.livraison.livree { background-color: #45c96e !important; }

/* Conteneur des filtres historique */
.historique-filtres {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

/* ===== HISTORIQUE CARDS ===== */
details.historique-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  padding: 16px;
  transition: all var(--transition-normal);
}

details.historique-card:hover {
  border-color: var(--border-light);
}

details.historique-card[open] {
  box-shadow: var(--shadow-md);
}

details.historique-card summary {
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 4px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

details.historique-card summary::-webkit-details-marker {
  display: none;
}

details.historique-card summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--accent-primary);
  transition: transform var(--transition-fast);
}

details.historique-card[open] summary::before {
  transform: rotate(90deg);
}

/* ===== STYLES POPUP MON COMPTE ===== */
.account-modal {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: linear-gradient(135deg, #1a2332 0%, #0f1520 100%);
  border-bottom: 1px solid #2c3c55;
  position: sticky;
  top: 0;
  z-index: 10;
}

.account-header h3 {
  margin: 0;
  font-size: 20px;
}

.close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.account-section {
  padding: 25px;
  border-bottom: 1px solid #2c3c55;
}

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

.account-section h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: #57aaff;
}

.section-desc {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: #888;
}

.logo-upload-area {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: #0f1520;
  border-radius: 10px;
  border: 2px dashed #2c3c55;
}

.logo-preview {
  width: 100px;
  height: 60px;
  object-fit: contain;
  background: #1a2332;
  border-radius: 8px;
  display: block;
}

.logo-preview[src=""] {
  display: none;
}

.logo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-btn {
  display: inline-block;
  padding: 10px 16px;
  background: #265bdf;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.upload-btn:hover {
  background: #3a6fe8;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

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

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 13px;
  color: #aaa;
  font-weight: 500;
}

.form-group input {
  margin: 0;
}

.primary-btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.account-email {
  margin: 0 0 15px 0;
  padding: 12px 15px;
  background: #0f1520;
  border-radius: 8px;
  font-size: 14px;
}

.password-change {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.password-change input {
  margin: 0;
}

.danger-zone {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 10px;
  margin: 20px;
}

.danger-zone h4 {
  color: #e74c3c;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full-width {
    grid-column: span 1;
  }
  .logo-upload-area {
    flex-direction: column;
    text-align: center;
  }
}


/* ===== PRODUCT STATS BOX ===== */
.product-stats-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-row .stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-row .stat-value.success {
  color: var(--success);
}

.stat-row .stat-value.info {
  color: var(--info);
}

.stat-row .stat-value.warning {
  color: var(--warning);
}

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: -8px 0 16px 0;
  padding: 8px 12px;
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Product card stock info */
.product-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
  font-size: 13px;
}

.stock-info {
  color: var(--text-secondary);
}

.ref-info {
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== LIVRAISON PARCOURS STYLES ===== */
.livraison-controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.depart-input-group {
  flex: 1;
  min-width: 300px;
}

.depart-input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

.livraison-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.livraison-stats .stat-item {
  text-align: center;
  flex: 1;
}

.livraison-stats .stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-primary);
}

.livraison-stats .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.livraison-actions {
  margin-bottom: 24px;
}

.livraison-actions a {
  text-decoration: none;
}

.parcours-empty,
.parcours-error,
.parcours-loading {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
}

.parcours-loading {
  border-style: solid;
}

.parcours-empty p,
.parcours-error p,
.parcours-loading p {
  margin: 10px 0;
  color: var(--text-secondary);
}

.parcours-error p:first-child {
  color: var(--danger);
  font-weight: 600;
}

.hint {
  font-size: 13px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

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

.parcours-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  transition: all var(--transition-fast);
}

.parcours-step:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.step-client {
  font-size: 16px;
}

.step-distance {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.step-address {
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.step-products {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.parcours-product {
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.step-cumul {
  font-size: 12px;
  color: var(--text-muted);
}

.step-nav-btn {
  width: 44px;
  height: 44px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.step-nav-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.1);
}
