/* ========================================== */
/* THÈMES VISUELS (MODERNE, DARK, CHANTIER, GLASS) */
/* ========================================== */

/* Thème 1 : Par Défaut (Bleu Logistique Moderne) */
:root, [data-theme="default"] {
  --primary: #1E88E5;
  --primary-dark: #1565C0;
  --primary-light: #E3F2FD;
  --primary-container: #BBDEFB;
  --secondary: #0D9488;
  --secondary-container: #CCFBF1;
  --background: #F8FAFC;
  --surface: #FFFFFF;
  --surface-variant: #F1F5F9;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --success: #16A34A;
  --success-bg: #DCFCE7;
  --warning: #D97706;
  --warning-bg: #FEF3C7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --header-bg: rgba(255, 255, 255, 0.95);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Thème 2 : Sombre Entrepôt OLED (Dark Mode Pro) */
[data-theme="dark"] {
  --primary: #38BDF8;
  --primary-dark: #0284C7;
  --primary-light: #0C4A6E;
  --primary-container: #1E293B;
  --secondary: #2DD4BF;
  --secondary-container: #134E4A;
  --background: #0B0F19;
  --surface: #151D2F;
  --surface-variant: #1E293B;
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --border: #2A364F;
  --success: #22C55E;
  --success-bg: #064E3B;
  --warning: #F59E0B;
  --warning-bg: #78350F;
  --danger: #EF4444;
  --danger-bg: #7F1D1D;
  --card-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(21, 29, 47, 0.95);
}

/* Thème 3 : Haute Visibilité / Sécurité (Chariot & Plein Soleil) */
[data-theme="high-contrast"] {
  --primary: #D97706;
  --primary-dark: #B45309;
  --primary-light: #FEF3C7;
  --primary-container: #FDE68A;
  --secondary: #059669;
  --secondary-container: #D1FAE5;
  --background: #FFFDF5;
  --surface: #FFFFFF;
  --surface-variant: #FEF9C3;
  --text-main: #000000;
  --text-muted: #451A03;
  --border: #D97706;
  --success: #15803D;
  --success-bg: #BBF7D0;
  --warning: #C2410C;
  --warning-bg: #FFEDD5;
  --danger: #B91C1C;
  --danger-bg: #FECACA;
  --card-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
  --header-bg: rgba(255, 255, 255, 0.98);
}

/* Thème 4 : iOS Glassmorphism (Élégant & Épuré) */
[data-theme="glass"] {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --primary-container: #E0E7FF;
  --secondary: #06B6D4;
  --secondary-container: #CFFAFE;
  --background: #F1F5F9;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-variant: rgba(241, 245, 249, 0.75);
  --text-main: #1E1B4B;
  --text-muted: #64748B;
  --border: rgba(226, 232, 240, 0.9);
  --success: #10B981;
  --success-bg: #D1FAE5;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --card-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.08);
  --header-bg: rgba(255, 255, 255, 0.8);
}

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

input, textarea, select {
  user-select: auto;
  -webkit-user-select: auto;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.4;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--safe-bottom) + 72px);
  min-height: 100vh;
  touch-action: pan-y pinch-zoom;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background-color: var(--surface);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.25);
}

.brand-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.brand-store-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: #D32F2F;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.brand-icon {
  font-size: 1.3rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-share-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-share-header:active {
  background: var(--primary);
  color: #FFFFFF;
  transform: scale(0.96);
}

/* Bouton Refresh Header (Actualisation instantanée 1-Tap) */
.btn-refresh-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--surface-variant);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
  padding: 0;
  flex-shrink: 0;
}

.btn-refresh-header:active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(180deg) scale(0.92);
}

.btn-refresh-header.spinning,
.btn-refresh-header.spinning span {
  animation: ptrSpin 0.75s linear infinite;
}

/* Indicateur Pull-To-Refresh Tactile (iOS & PWA Standalone) */
.ptr-indicator {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 10000;
  transform: translateY(-120%);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ptr-indicator.active {
  opacity: 1;
}

.ptr-indicator.refreshing {
  transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.2s ease;
}

.ptr-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 7px 16px;
  border-radius: 9999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.ptr-indicator.ready .ptr-pill {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-light);
  box-shadow: 0 4px 20px rgba(30, 136, 229, 0.3);
}

.ptr-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 1rem;
  color: var(--primary);
  transition: transform 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
  font-weight: 900;
}

.ptr-icon.spinning {
  animation: ptrSpin 0.75s linear infinite;
}

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

.offline-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-variant);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.offline-badge.offline {
  background: var(--warning-bg, #FEF3C7);
  color: #B45309;
  border-color: #FCD34D;
  animation: pulse-offline 2s infinite ease-in-out;
}

.offline-badge.online {
  background: var(--success-bg, #D1FAE5);
  color: #065F46;
  border-color: #A7F3D0;
}

@keyframes pulse-offline {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Summary Banner */
.summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: var(--secondary-container);
  color: #0F766E;
  font-size: 0.9rem;
  font-weight: 600;
}

.summary-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-btn {
  background: #FFFFFF;
  border: 1px solid #0F766E;
  color: #0F766E;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.summary-btn:active {
  background: #E6FFFA;
}

/* Main Navigation Tabs */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: var(--safe-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 10px;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: color 0.15s;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
  fill: currentColor;
}

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

/* Zones Bar */
.zones-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-variant);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.zones-bar::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.chip.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.chip-btn-add {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px dashed var(--primary);
}

/* Filter & Order Action Bar */
.action-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.filter-chips-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
}

.filter-chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-variant);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}

.filter-chip.active {
  background: var(--text-main);
  color: #FFFFFF;
  border-color: var(--text-main);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-icon:active {
  background: var(--surface-variant);
}

/* Container Grid */
.container-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px;
}

@media (min-width: 640px) {
  .container-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .container-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Counting Tile */
.counting-tile {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  padding: 10px;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}

.counting-tile.has-count {
  background: #FCFDF4;
  border-color: #CBD5E1;
  box-shadow: var(--shadow-md);
}

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

.supplier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.format-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Container Image Area */
.tile-img-container {
  position: relative;
  width: 100%;
  height: 110px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}

.tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.camera-shortcut {
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 6px;
  border-bottom-right-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  z-index: 2;
}

.camera-shortcut:hover {
  background: rgba(0, 0, 0, 0.85);
}

/* Count Display Box */
.count-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 6px 4px;
  background: var(--surface-variant);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.count-box:active {
  transform: scale(0.98);
}

.count-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.count-number {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.count-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-step {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: none;
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: background 0.1s;
}

.btn-step:active {
  background: var(--surface-variant);
}

.btn-step:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Tile Action Row */
.tile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 4px;
}

.quick-inc-btn {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-variant);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.quick-inc-btn:active {
  background: #E2E8F0;
}

.tile-icon-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tile-sub-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-sub-btn:hover {
  background: var(--surface-variant);
  color: var(--text-main);
}

/* Returns (Stacks) Screen */
.stacks-screen {
  padding: 12px;
}

.quick-stack-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-variant);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}

.quick-stack-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-stack-btn:active {
  background: var(--primary-light);
}

.stacks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.stack-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-card.complete {
  border-color: var(--success);
  background: #F8FDF9;
}

.stack-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stack-title-area {
  display: flex;
  flex-direction: column;
}

.stack-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.stack-category-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.status-pill {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill.in-progress {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-pill.complete {
  background: var(--success-bg);
  color: var(--success);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--surface-variant);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-fill.complete {
  background: var(--success);
}

.stack-height-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
}

.stack-odd-warning {
  background: var(--warning-bg);
  color: #92400E;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ground-pallet-badge {
  background: #EEF2F6;
  border: 1px dashed #94A3B8;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

.ground-pallet-badge button {
  background: #FFFFFF;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.stack-items-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stack-item-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  background: var(--surface-variant);
  font-size: 0.78rem;
  font-weight: 700;
}

.stack-item-tag button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger);
  font-weight: 900;
  font-size: 0.9rem;
  margin-left: 2px;
}

.stack-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

/* ========================================== */
/* TOUR DE PALETTES VISUELLE & COMPOSANTS INTUITIFS */
/* ========================================== */

/* ========================================== */
/* SÉLECTEUR DE DISPOSITION D'INTERFACE       */
/* ========================================== */

.layout-selector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}

.layout-selector-bar::-webkit-scrollbar {
  display: none;
}

.layout-selector-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.layout-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.layout-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--surface-variant);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.layout-pill-btn:active {
  transform: scale(0.96);
}

.layout-pill-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 3px 8px rgba(30, 136, 229, 0.3);
}

/* ========================================== */
/* DISPOSITION 2 : LISTE COMPACTE EXPRESS     */
/* ========================================== */
.container-grid.layout-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
}

.list-row.has-count {
  border-color: var(--primary);
  background: #F8FAFC;
}

.list-row-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #E2E8F0;
  cursor: pointer;
}

.list-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-row-thumb .supplier-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #FFFFFF;
}

.list-row-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.list-row-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.supplier-badge-sm {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.format-badge-sm {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.list-row-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-step-sm {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface-variant);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-step-sm:active {
  background: var(--primary-light);
  color: var(--primary);
}

.list-row-count {
  min-width: 36px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  padding: 4px;
  cursor: pointer;
}

.has-count .list-row-count {
  color: var(--primary-dark);
}

.btn-step-quick {
  padding: 4px 8px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

/* ========================================== */
/* DISPOSITION 3 : GROSSES TOUCHES / GANTS    */
/* ========================================== */
.container-grid.layout-bigbuttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
}

.bigbutton-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: all 0.15s ease;
}

.bigbutton-card.has-count {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(30, 136, 229, 0.2);
}

.bigbutton-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-variant);
  border-bottom: 1px solid var(--border);
}

.bigbutton-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bigbutton-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-icon-soft {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.bigbutton-tap-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  width: 100%;
  background: #FFFFFF;
  border: none;
  cursor: pointer;
  transition: background 0.1s ease;
}

.bigbutton-tap-area:active {
  background: #E3F2FD;
}

.bigbutton-count-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.bigbutton-count-number {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-muted);
}

.has-count .bigbutton-count-number {
  color: var(--primary-dark);
}

.bigbutton-count-unit {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bigbutton-tap-prompt {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 16px;
  border-radius: 999px;
}

.bigbutton-quick-pad {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr 0.8fr;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-variant);
  border-top: 1px solid var(--border);
}

.bigpad-btn {
  padding: 12px 6px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  transition: transform 0.1s;
}

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

.pad-minus {
  background: #FEE2E2;
  color: #DC2626;
  border-color: #FCA5A5;
}

.pad-plus5 {
  background: #E0E7FF;
  color: #3730A3;
  border-color: #C7D2FE;
}

.pad-plus10 {
  background: #D1FAE5;
  color: #065F46;
  border-color: #6EE7B7;
}

.pad-edit {
  background: #FFFFFF;
  color: var(--text-main);
  border-color: var(--border);
}

/* ========================================== */
/* DISPOSITION 4 : TOUR LOGISTIQUE & PILES    */
/* ========================================== */
.container-grid.layout-tower {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px;
}

.tower-tile {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tower-tile.has-count {
  border-color: #10B981;
}

.tower-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tower-tile-body {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-variant);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.tower-mini-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tower-gauge-bar {
  width: 14px;
  height: 52px;
  background: #CBD5E1;
  border-radius: 4px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border: 1px solid #94A3B8;
}

.tower-gauge-fill {
  background: #10B981;
  width: 100%;
  transition: height 0.2s ease;
}

.tower-gauge-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
}

.tower-tile-center {
  flex: 1;
  cursor: pointer;
}

.tower-count-headline {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.tower-count-headline .count-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
}

.has-count .tower-count-headline .count-number {
  color: #065F46;
}

.tower-count-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tower-stack-calc {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.badge-full-stack {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}

.badge-remain-stack {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.badge-remain-done {
  background: #E0F2FE;
  color: #0369A1;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.badge-remain-empty {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tower-tile-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.tower-btn-stack {
  background: #D1FAE5 !important;
  color: #065F46 !important;
  border-color: #6EE7B7 !important;
  flex: 1;
}

/* Stack Visual Tower */
.stack-visual-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-variant);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px solid var(--border);
}

.stack-tower {
  display: flex;
  flex-direction: column-reverse; /* Empilement du bas vers le haut */
  width: 58px;
  height: 120px;
  background: rgba(0, 0, 0, 0.04);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  justify-content: flex-start;
  gap: 1.5px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.tower-ground-pallet {
  height: 8px;
  width: 100%;
  background: #B45309; /* Bois socle */
  border-radius: 2px;
  flex-shrink: 0;
  border-top: 1px solid #78350F;
}

.tower-layer {
  display: flex;
  height: 8px;
  width: 100%;
  gap: 1px;
  flex-shrink: 0;
}

.tower-layer.empty {
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
  background: transparent;
}

.tower-block-full {
  width: 100%;
  height: 100%;
  border-radius: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tower-block-half {
  width: 50%;
  height: 100%;
  border-radius: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tower-stats-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Boutons d'ajout rapide 1-TAP sur la carte */
.stack-quick-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 2px 0;
}

.stack-quick-add-row::-webkit-scrollbar {
  display: none;
}

.quick-add-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, background 0.15s;
}

.quick-add-chip:active {
  transform: scale(0.95);
  background: var(--surface-variant);
}

/* Ligne d'articles dans la pile avec stepper interactif [-] Qte [+] */
.stack-items-interactive {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stack-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-variant);
  border-radius: var(--radius-md);
  border-left: 3.5px solid var(--primary);
}

.stack-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.stack-stepper-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.stack-stepper-btn:active {
  background: var(--surface-variant);
}

.stack-item-count {
  min-width: 24px;
  text-align: center;
  font-weight: 900;
  font-size: 0.9rem;
}

.btn-sm {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

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

.btn-primary:active {
  background: var(--primary-dark);
}

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

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

/* Modals & Dialogs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-variant);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

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

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-control {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background: #FFFFFF;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Radio Card Selector */
.radio-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
}

.radio-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.radio-card input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

/* Tab bar in dialogs */
.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 10px;
  text-align: center;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Sort Order List in Dialog */
.sort-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.sort-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.sort-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-item-rank {
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--surface-variant);
  padding: 2px 6px;
  border-radius: 4px;
}

.sort-item-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
}

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

.sort-btn {
  background: var(--surface-variant);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.sort-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Summary Tables */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.summary-table th, .summary-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.summary-table th {
  background: var(--surface-variant);
  font-weight: 800;
}

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

.summary-highlight {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.summary-store-banner {
  background: var(--surface-variant);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.summary-store-badge {
  font-weight: 800;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.kpi-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.kpi-card.highlight {
  border-color: var(--primary);
  background: var(--primary-light);
}

.kpi-card-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.kpi-card-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--primary-dark);
  margin-top: 2px;
  line-height: 1.2;
}

.kpi-card-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Photo Upload Box */
.photo-preview-box {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface-variant);
  position: relative;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

/* ========================================== */
/* ÉCRAN PARAMÈTRES (ROUE CRANTÉE)            */
/* ========================================== */

/* ========================================== */
/* ÉCRAN PARAMÈTRES (ROUE CRANTÉE) - OPTIMISÉ IPHONE */
/* ========================================== */

.settings-screen {
  padding: 14px 14px calc(max(20px, env(safe-area-inset-bottom)) + 36px);
  max-width: 760px;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.settings-header {
  margin-bottom: 18px;
  padding: 0 4px;
}

.settings-header h2 {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.settings-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.35;
}

.settings-section {
  margin-bottom: 22px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
  padding: 0 4px;
}

.section-icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* Grille des cartes de disposition - 1 colonne fluide sur iPhone */
.settings-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 600px) {
  .settings-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

.setting-choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.setting-choice-card:active {
  transform: scale(0.98);
}

.setting-choice-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 3px 10px rgba(30, 136, 229, 0.15);
}

.choice-icon {
  font-size: 1.5rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-content {
  flex: 1;
  min-width: 0;
}

.choice-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
}

.choice-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.choice-check {
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 900;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setting-choice-card.active .choice-check {
  display: flex;
}

/* Grille des thèmes de couleur - 2 colonnes égales sur iPhone */
.theme-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (min-width: 640px) {
  .theme-cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.theme-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.theme-card:active {
  transform: scale(0.97);
}

.theme-card.active {
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  flex-shrink: 0;
}

.theme-card-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.theme-card-name {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-card-desc {
  font-size: 0.66rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.theme-card-check {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 900;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-card.active .theme-card-check {
  display: flex;
}

/* Liste de paramètres & rangées */
.settings-list-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  width: 100%;
  box-sizing: border-box;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
  width: 100%;
}

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

.settings-row.clickable {
  cursor: pointer;
}

.settings-row.clickable:active {
  background: var(--surface-variant);
}

.settings-row-text {
  flex: 1;
  min-width: 0;
}

.settings-row-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.settings-row-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* Inputs anti-zoom 16px sur iPhone */
.setting-number-input {
  width: 65px;
  height: 38px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface-variant);
  color: var(--text-main);
  font-size: 16px !important; /* EMPÊCHE LE ZOOM AUTOMATIQUE IPHONE */
  font-weight: 800;
  text-align: center;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.setting-select {
  height: 38px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface-variant);
  color: var(--text-main);
  font-size: 16px !important; /* EMPÊCHE LE ZOOM AUTOMATIQUE IPHONE */
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
}

/* Action Rows (Export, Backup, Reset) */
.settings-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
  box-sizing: border-box;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

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

.settings-action-row:active {
  background: var(--surface-variant);
}

.settings-action-row.danger:active {
  background: #FEE2E2;
}

.action-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.action-text {
  flex: 1;
  min-width: 0;
}

.action-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

.action-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.action-arrow {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 800;
  flex-shrink: 0;
}

/* Toggle Switch (iOS Style Robuste) */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.switch input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  padding: 0;
  z-index: 5;
  cursor: pointer;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E1;
  transition: background-color 0.25s ease;
  pointer-events: none;
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  transition: transform 0.25s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

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

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

.slider.round {
  border-radius: 30px;
}

.slider.round:before {
  border-radius: 50%;
}

.settings-info-box {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  padding: 16px 12px;
  line-height: 1.5;
}

/* ========================================== */
/* COMPOSANTS DE SÉLECTION MONO-TYPE PALETTE  */
/* ========================================== */

.quick-stack-btn.mono-highlight {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
  font-weight: 800;
}

.mono-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mono-picker-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.mono-picker-card:active {
  transform: scale(0.98);
  background: var(--surface-variant);
}

.mono-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

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

.mono-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
}

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

.mono-action {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Puces de fournisseur dans la création de pile */
.mono-supplier-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.mono-sup-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  width: 100%;
  text-align: left;
}

.mono-sup-btn:active {
  transform: scale(0.97);
}

.mono-sup-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(30, 136, 229, 0.2);
}

.mono-sup-btn-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Modal Large pour catalogue visuel */
.modal-dialog.modal-lg {
  max-width: 680px;
}

.modal-body {
  max-height: calc(88vh - 120px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Bouton principal Créer Pile Visuelle */
.btn-create-stack-visual {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, #0284C7 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  margin-bottom: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-create-stack-visual:active {
  transform: scale(0.98);
}

/* Grille Visuelle de Création de Piles (Style Mode Inventaire) */
.stack-creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 4px 2px;
}

.stack-creator-tile {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.stack-creator-tile:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stack-creator-tile:active {
  transform: scale(0.97);
}

.stack-creator-tile.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

.stack-creator-tile .tile-img-container {
  height: 95px;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border);
}

.stack-creator-tile .tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stack-creator-tile .stack-type-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stack-creator-tile .stack-type-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  flex: 1;
}

.stack-creator-tile .btn-create-tile {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s;
}

.stack-creator-tile .btn-create-tile:hover {
  background: var(--primary-dark);
}

/* Choix Effacement Inventaire */
.btn-clear-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.btn-clear-choice:hover {
  background: var(--surface-variant);
  border-color: var(--primary);
}

.btn-clear-choice.danger {
  border-color: #FCA5A5;
  background: #FFF5F5;
}

.btn-clear-choice.danger:hover {
  background: #FEE2E2;
  border-color: #EF4444;
}

.btn-tool-danger {
  color: #DC2626 !important;
  border-color: #FECACA !important;
  background: #FEF2F2 !important;
}

.btn-tool-danger:hover {
  background: #FEE2E2 !important;
  border-color: #DC2626 !important;
}

/* ========================================== */
/* VARIANTES D'INTERFACE POUR CRÉER UNE PILE  */
/* ========================================== */
.modal-layout-bar {
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  padding: 6px 10px;
  background: var(--surface-variant);
  border: 1px solid var(--border);
}

/* --- Style 2 : Liste Express dans la modale --- */
.stack-creator-grid.layout-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px;
}

.stack-creator-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background-color 0.15s;
  user-select: none;
}

.stack-creator-list-row:hover {
  border-color: var(--primary);
  background: var(--surface-variant);
  transform: translateX(2px);
}

.stack-creator-list-row:active {
  transform: scale(0.99);
}

.stack-creator-list-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #fff;
}

.stack-creator-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stack-creator-list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stack-creator-list-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-creator-list-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stack-creator-list-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-badge-sm {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 6px;
  border-radius: 4px;
}

.btn-create-tile-sm {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-create-tile-sm:hover {
  background: var(--primary-dark);
}

/* --- Style 3 : Grosses Touches dans la modale --- */
.stack-creator-grid.layout-bigbuttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px;
}

.stack-creator-bigbtn-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}

.stack-creator-bigbtn-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stack-creator-bigbtn-card:active {
  transform: scale(0.98);
}

.bigbtn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bigbtn-target-pill {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1E40AF;
  background: #DBEAFE;
  border: 1px solid #BFDBFE;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.bigbtn-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bigbtn-img {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1.5px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

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

.bigbtn-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.bigbtn-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

.btn-create-bigbtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-create-bigbtn:hover {
  background: var(--primary-dark);
}

/* --- Style 4 : Tour Logistique dans la modale --- */
.stack-creator-grid.layout-tower {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 4px 2px;
}

.stack-creator-tower-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}

.stack-creator-tower-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stack-creator-tower-card:active {
  transform: scale(0.98);
}

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

.tower-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tower-card-icon-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tower-card-img {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
}

.tower-card-target-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  border-radius: 6px;
  padding: 2px 6px;
  text-align: center;
  white-space: nowrap;
}

.tower-card-content {
  flex: 1;
  min-width: 0;
}

.tower-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.tower-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

.btn-create-tower {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.btn-create-tower:hover {
  background: var(--primary-dark);
}

/* ========================================== */
/* MODALE CEINTURES CREAMER                   */
/* ========================================== */
.ceinture-socle-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-variant);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.ceinture-quick-preset-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--surface-variant);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.ceinture-quick-preset-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.ceinture-quick-preset-btn:active {
  transform: scale(0.98);
}

.preset-icon-badge {
  font-weight: 900;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.preset-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.preset-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.preset-arrow {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.separator-text {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.separator-text::before,
.separator-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.separator-text span {
  padding: 0 10px;
}

.ceinture-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.ceinture-stepper-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ceinture-color-pill {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.ceinture-stepper-ctrls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ceinture-qty-input {
  width: 65px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 6px 4px;
}

.ceinture-total-bar {
  background: var(--surface-variant);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.15s;
}

.ceinture-total-bar.complete {
  background: #ECFDF5;
  border-color: #6EE7B7;
  color: #065F46;
}

/* Bannière Pool Locatif */
.pool-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

/* Stepper pour les palettes de pool */
.pool-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.pool-stepper-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pool-color-pill {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.pool-stepper-ctrls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pool-qty-input {
  width: 65px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 6px 4px;
}

.pool-total-bar {
  background: var(--surface-variant);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.15s;
}

.pool-total-bar.complete {
  background: #ECFDF5;
  border-color: #6EE7B7;
  color: #065F46;
}

/* Sélecteur de Socle / Palette Support 80x120 */
.support-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.support-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.support-choice-btn:hover {
  border-color: var(--primary);
}

.support-choice-btn.active {
  border-color: var(--primary);
  background: #EFF6FF;
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.25);
}

.support-choice-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.support-choice-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.support-choice-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Palette Support intégrée dans la liste interactive des contenants de la pile */
.support-pallet-item-row {
  background: rgba(245, 158, 11, 0.08) !important;
  border-left-width: 4px !important;
}

.support-pallet-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
  border: 1px solid #FDE68A;
}

/* Bandeau Récapitulatif Dédié Retours Base */
.returns-summary-banner {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
  color: #F8FAFC !important;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  padding: 8px 14px;
}

.returns-summary-banner .summary-badge {
  color: #F8FAFC !important;
}

.returns-summary-banner .summary-btn {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border: none;
}

/* Affichage Distinct par Pile dans le Bilan Retours */
.summary-stacks-detail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.summary-stack-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.summary-stack-card.complete {
  border-color: #86EFAC;
  background: #F0FDF4;
}

.summary-stack-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.summary-stack-num {
  display: inline-block;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 6px;
}

.summary-stack-cat {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 4px;
}

.summary-stack-card-body {
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.summary-stack-item-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.summary-stack-item-line.is-support {
  background: rgba(245, 158, 11, 0.1);
  padding: 3px 6px;
  border-radius: 6px;
  font-weight: 700;
  color: #92400E;
}

.summary-stack-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Feedback visuel lors du Maintien Appuyé (Long Touch) */
.tile-pressing {
  transform: scale(0.96) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.45) !important;
  border-color: var(--danger) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.tile-pressing .container-count {
  color: var(--danger) !important;
}

/* Désactiver le menu contextuel natif iOS / callout sur les zones de tap pour éviter les popups Safari */
.container-tile,
.container-row-list,
.big-tile,
.tower-card,
.tile-tap-area,
.list-tap-area,
.big-tap-area,
.tower-tap-area {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* ======================================================= */
/* ASSISTANT DE CRÉATION DE PILE : QUESTION MÉLANGE OU NON */
/* ======================================================= */
.create-stack-step {
  animation: fadeInStep 0.2s ease-out;
}

@keyframes fadeInStep {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Étape 1 : Question */
.step-question-box {
  text-align: center;
  padding: 16px 12px;
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(30, 136, 229, 0.2);
  margin-bottom: 16px;
}

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

.step-question-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.step-question-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.step-choice-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.step-choice-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.step-choice-card:active {
  transform: scale(0.98);
}

.step-choice-card.mono-card {
  border-color: #94A3B8;
}

.step-choice-card.mono-card:hover {
  border-color: #0284C7;
  background: rgba(2, 132, 199, 0.03);
}

.step-choice-card.mix-card {
  border-color: #C084FC;
}

.step-choice-card.mix-card:hover {
  border-color: #7C3AED;
  background: rgba(124, 58, 237, 0.03);
}

.step-choice-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.step-choice-badge.mono-badge {
  background: #E2E8F0;
  color: #334155;
}

.step-choice-badge.mix-badge {
  background: #EDE9FE;
  color: #6D28D9;
}

.step-choice-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 14px 0;
  height: 85px;
}

.step-pallet-svg {
  width: 95px;
  height: 80px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step-choice-card:hover .step-pallet-svg {
  transform: translateY(-3px) scale(1.05);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
}

.step-choice-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.step-choice-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
  margin-bottom: 14px;
}

.step-choice-btn {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: background 0.15s, color 0.15s;
}

.mono-card .step-choice-btn {
  background: #F1F5F9;
  color: #0284C7;
  border: 1px solid #CBD5E1;
}

.mono-card:hover .step-choice-btn {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0284C7;
}

.mix-card .step-choice-btn {
  background: #F5F3FF;
  color: #7C3AED;
  border: 1px solid #DDD6FE;
}

.mix-card:hover .step-choice-btn {
  background: #7C3AED;
  color: #FFFFFF;
  border-color: #7C3AED;
}

/* Barre de sous-navigation (Retour + Titre) */
.step-subnav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.btn-step-back {
  background: var(--surface-variant);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.btn-step-back:hover {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
}

.step-subnav-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.step-subnav-title span:first-child {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.step-subnav-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Sections par dimension dans l'étape Mono */
.dimension-section {
  margin-bottom: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.dimension-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}

.dimension-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: #0284C7;
  color: #FFF;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dimension-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}

.dimension-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

/* Cartes individuelles de piles mono complètes */
.mono-complete-card {
  background: var(--surface-variant);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-align: left;
  box-sizing: border-box;
}

.mono-complete-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  background: #FFF;
}

.mono-complete-card:active {
  transform: scale(0.97);
}

.mono-complete-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.supplier-pill {
  font-size: 0.68rem;
  font-weight: 800;
  color: #FFF;
  padding: 1px 6px;
  border-radius: 4px;
}

.mono-complete-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #15803D;
  background: #DCFCE7;
  padding: 1px 5px;
  border-radius: 4px;
}

.mono-complete-thumb {
  width: 100%;
  height: 65px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid var(--border);
}

.mono-complete-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.mono-complete-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.25;
  height: 28px;
  overflow: hidden;
  margin-bottom: 8px;
}

.mono-complete-action {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px;
  border-radius: 6px;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}

.mono-complete-card:hover .mono-complete-action {
  background: var(--primary);
  color: #FFF;
}

/* Grille des 3 menus de mélange */
.melange-menus-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.melange-menu-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
  box-sizing: border-box;
}

.melange-menu-card:hover {
  border-color: #7C3AED;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.melange-menu-card:active {
  transform: scale(0.98);
}

.melange-menu-img-wrap {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.melange-menu-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.melange-menu-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  color: #FFF;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.melange-menu-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.melange-menu-target {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
}

.melange-menu-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.btn-melange-open {
  background: #F5F3FF;
  color: #7C3AED;
  border: 1.5px solid #DDD6FE;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.melange-menu-card:hover .btn-melange-open {
  background: #7C3AED;
  color: #FFF;
  border-color: #7C3AED;
}

@media (max-width: 600px) {
  .melange-menu-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .melange-menu-img-wrap {
    width: 100%;
    height: 90px;
  }
  .btn-melange-open {
    width: 100%;
    text-align: center;
  }
  .dimension-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Toast de notification flottant (Feedbacks de création de pile) */
.app-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.94);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 90vw;
  text-align: center;
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
